Merged V3.3-BUG-FIX to HEAD

20954: Calendar Dashlet updates. Fixes: ALF-2907 (meeting workspace issue)
   20968: Minor VersionableAspect fix to onDeleteNode policy firing (follow-on for r19507)
   20981: Removed Install Jammer installers from V3.3.3
   20982: AVMTestSuite - run PurgeTestP after AVMServiceTest (investigating ALF-3611)
   20997: Fix for ALF-2605 - updated share-config-custom.xml.sample and removed obsolete extension files
   21030: Pulled XAMConnector AMP into main 3.3SP3 codeline.  Apart from build changes (incl. EOL), there are no repo changes.
   21032: StoreSelector passes through NodeContentContext allowing stores access to node information
   21036: Fix ALF-245: Can't delete space that contains "translation without content"
      - Delete triggers 'unmakeTranslation'
      - Empty translations are marked with sys:temporary before being deleted
   21051: More on fix ALF-245.  Reduced complexity by not deleting empty translations twice
   21064: Merged V3.3 to V3.3-BUG_FIX
      20898: Merged HEAD to V3.3
         20724: AVMTestSuite - temporarily comment out PurgeTestP
            - TODO: investigate intermittent test failure
      20903: Incremented version revision
      20921: AVM - fix purge store so that vr nodes are actually orphaned (ALF-3627)
      20952: Fix for ALF-3704: Module conflict - Alfresco web client config property page missing metadata. 
         This is application of a fix made to the config service in a hotfix. The change provides a deterministic load order for config files loaded via the ConfigBootstrap spring bean. More importantly it means that config files loaded by modules on different machines in a cluster load in the same order.

         The forms client and AWE config files have been updated to take advantage of the new loading order.
      21061: Merged PATCHES/V3.1.2 to V3.3 (RECORD ONLY)
         20890: ALF-3687: Apply LUCENE-1383 patch to Lucene 2.1.0 to reduce memory leaks from ThreadLocals
         20891: ALF-3687: Build classpath fix
         20892: Incremented version label
      21062: Merged PATCHES/V3.2.1 to V3.3
         20897: (RECORD ONLY) Incremented version label
         20901: (RECORD ONLY) ALF-3740: Merged V3.3 to PATCHES/V3.2.1
            20524: VersionMigrator - option to run as scheduled job (ALF-1000)
         20904: (RECORD ONLY) ALF-3732: Merged PATCHES/V3.2.r to PATCHES/V3.2.1
            19803: ALF-558: File servers (CIFS / FTP / NFS) can now handle concurrent write operations on Alfresco repository
               - ContentDiskDriver / AVMDiskDriver now use retrying transactions for write operations
               - Disable EagerContentStoreCleaner on ContentDiskDriver / AVMDiskDriver closeFile() operations so that they may be retried after rollback (Sony zero byte problem)
               - Allow manual association of AVM ContentData with nodes so that closeFile() may be retried
               - Propagation of new argument through AVM interfaces
         20905: (RECORD ONLY) ALF-3732: Rolled back the now unnecessary reference()/dereference() stuff from ALF-558
         20906: (RECORD ONLY) ALF-3732: Merged DEV/V3.3-BUG-FIX to PATCHES/V3.2.1
            20623: Fix for ALF-3188 : Access Denied when updating doc via CIFS
         20907: (RECORD ONLY) ALF-3732: Merged V3.3 to PATCHES/V3.2.1
            20173: Propagate IOExceptions from retryable write transactions in AlfrescoDiskDriver
         20950: ALF-3779: Upgrades on large repositories from v2.1 and v2.2 were failing on MySQL due to "The total number of locks exceeds the lock table size" errors
            - Solution was to add support for new --BEGIN TXN and --END TXN comments and execute LOCK TABLES statements in the same transaction as large INSERT - SELECT statements.
         20990: ALF-3789: Concurrency issues with InMemoryTicketComponentImpl
            - Previous ETHREEOH-1842 method of caching web session 'ref counts' against tickets could cause tickets to unpredictably fall out of the transactional cache
            - Rolled back original ETHREEOH-1842 fix. Would be too much overhead to keep these ref counts consistent across a cluster.
            - Instead, avoid invalidating tickets on web session timeout and only do it on explicit log out.
            - Now tickets maintained in non-transactional shared cache so they can't drop out unpredictably
            - Logic for ticket inactivity timeout caching improved so that it should work across a cluster
         20991: (RECORD ONLY) Incremented version label
         20993: ALF-3789: Fixed Spring configuration backward compatibily issue with previous fix
            - Ticket cache bean name restored to ticketsCache. This is actually now a non-transactional cache.
            - Also externalized parameters so that they can now be controlled by alfresco-global.properties without any bean overrides
               authentication.ticket.ticketsExpire=false
               authentication.ticket.expiryMode=AFTER_FIXED_TIME
               authentication.ticket.validDuration=PT1H
         20994: Eclipse classpath fixes for unit testing after ant build
         21057: ALF-3592: PassthruCifsAuthenticator now auto-creates / imports users who do not already exist in Alfresco
            - At least one of the following properties must be true for this to happen
               synchronization.autoCreatePeopleOnLogin
               synchronization.syncWhenMissingPeopleLogIn
            - Also improved debug logging of unknown passthru domains
      21063: Merged PATCHES/V3.2.r to V3.3
         21037: ALF-3793: Final attempt at realigning saved XForm data with a modified Schema
            - removeRemovedNodes / insertUpdatedNodes / insertPrototypeNodes replaced by a one stop recursive process that builds a new instance tree from scratch
            - Nodes copied over in correct order
            - Missing nodes added in and extra nodes discarded
            - Prototype nodes appended at appropriate points
         21038: (RECORD ONLY) Incremented version label


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@21065 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Dave Ward 2010-07-11 14:22:26 +00:00
parent 669ce5c579
commit 0465e9b101
32 changed files with 403 additions and 459 deletions

View File

@ -523,13 +523,13 @@
<ref bean="ticketsCache"/>
</property>
<!-- The period for which tickets are valid in XML duration format. -->
<!-- The default is P1H for one hour. -->
<!-- The default is PT1H for one hour. -->
<property name="validDuration">
<value>PT1H</value>
<value>${authentication.ticket.validDuration}</value>
</property>
<!-- Do tickets expire or live for ever? -->
<property name="ticketsExpire">
<value>false</value>
<value>${authentication.ticket.ticketsExpire}</value>
</property>
<!-- Are tickets only valid for a single use? -->
<property name="oneOff">
@ -539,7 +539,7 @@
<!-- AFTER_INACTIVITY, AFTER_FIXED_TIME, DO_NOT_EXPIRE -->
<!-- The default is AFTER_FIXED_TIME -->
<property name="expiryMode">
<value>AFTER_FIXED_TIME</value>
<value>${authentication.ticket.expiryMode}</value>
</property>
</bean>

View File

@ -473,7 +473,7 @@
<!-- The cross-transaction shared cache for In-Memory Tickets -->
<bean name="ticketsSharedCache" class="org.alfresco.repo.cache.EhCacheAdapter">
<bean name="ticketsCache" class="org.alfresco.repo.cache.EhCacheAdapter">
<property name="cache">
<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean" >
<property name="cacheManager">
@ -485,22 +485,7 @@
</bean>
</property>
</bean>
<!-- The transactional cache for In-Memory Tickets -->
<bean name="ticketsCache" class="org.alfresco.repo.cache.TransactionalCache">
<property name="sharedCache">
<ref bean="ticketsSharedCache" />
</property>
<property name="name">
<value>org.alfresco.ticketsTransactionalCache</value>
</property>
<property name="maxCacheSize">
<value>10</value>
</property>
</bean>
<!-- ===================================== -->
<!-- Lookup for AVM entities -->
<!-- ===================================== -->

View File

@ -282,6 +282,7 @@ INSERT INTO t_summary_nstat (node_id, transaction_id)
SELECT node_id, transaction_id FROM alf_node_status WHERE node_id IS NOT NULL;
-- Copy data over
--BEGIN TXN
LOCK TABLES
t_alf_node WRITE,
alf_node AS n READ,
@ -303,6 +304,7 @@ INSERT INTO t_alf_node
JOIN t_summary_nstat nstat ON (nstat.node_id = n.id)
JOIN t_alf_store s ON (s.protocol = n.protocol AND s.identifier = n.identifier)
;
--END TXN
UNLOCK TABLES;
DROP TABLE t_summary_nstat;
@ -371,6 +373,7 @@ CREATE TABLE t_alf_child_assoc
UNIQUE (parent_node_id, type_qname_id, child_node_name_crc, child_node_name)
) TYPE=InnoDB;
--BEGIN TXN
LOCK TABLES
t_alf_child_assoc WRITE,
alf_child_assoc AS ca READ,
@ -400,6 +403,7 @@ INSERT INTO t_alf_child_assoc
JOIN t_qnames_dyn tqndyn ON (ca.qname = tqndyn.qname)
JOIN t_qnames tqn ON (ca.type_qname = tqn.qname)
;
--END TXN
UNLOCK TABLES;
-- Clean up
@ -428,6 +432,7 @@ CREATE TABLE t_alf_node_assoc
UNIQUE (source_node_id, target_node_id, type_qname_id)
) TYPE=InnoDB;
--BEGIN TXN
LOCK TABLES
t_alf_node_assoc WRITE,
alf_node_assoc AS na READ,
@ -447,6 +452,7 @@ INSERT INTO t_alf_node_assoc
alf_node_assoc na
JOIN t_qnames tqn ON (na.type_qname = tqn.qname)
;
--END TXN
UNLOCK TABLES;
-- Clean up
@ -501,6 +507,7 @@ CREATE TABLE t_alf_node_aspects
PRIMARY KEY (node_id, qname_id)
) TYPE=InnoDB;
--BEGIN TXN
LOCK TABLES
t_alf_node_aspects WRITE,
alf_node_aspects AS na READ,
@ -520,6 +527,7 @@ INSERT INTO t_alf_node_aspects
WHERE
tqn.qname != '{http://www.alfresco.org/model/system/1.0}referenceable'
;
--END TXN
UNLOCK TABLES;
-- Clean up
@ -761,6 +769,7 @@ CREATE TABLE t_alf_node_properties
PRIMARY KEY (node_id, qname_id, list_index, locale_id)
) TYPE=InnoDB;
--BEGIN TXN
-- Copy values over
LOCK TABLES
t_alf_node_properties WRITE,
@ -791,7 +800,9 @@ INSERT INTO t_alf_node_properties
WHERE
np.attribute_value IS NULL
;
--END TXN
UNLOCK TABLES;
-- Update cm:auditable properties on the nodes
UPDATE t_alf_node n SET audit_creator =
(

View File

@ -73,6 +73,7 @@ CREATE TABLE t_summary_nstat
INSERT INTO t_summary_nstat (node_id, transaction_id)
SELECT node_id, transaction_id FROM alf_node_status WHERE node_id IS NOT NULL;
--BEGIN TXN
-- Copy data over
LOCK TABLES
t_alf_node WRITE,
@ -93,6 +94,7 @@ INSERT INTO t_alf_node
JOIN t_summary_nstat nstat ON (nstat.node_id = n.id)
JOIN t_alf_store s ON (s.protocol = n.protocol AND s.identifier = n.identifier)
;
--END TXN
UNLOCK TABLES;
DROP TABLE t_summary_nstat;
@ -161,6 +163,7 @@ CREATE TABLE t_alf_child_assoc
UNIQUE (parent_node_id, type_qname_id, child_node_name_crc, child_node_name)
) TYPE=InnoDB;
--BEGIN TXN
LOCK TABLES
t_alf_child_assoc WRITE,
alf_child_assoc AS ca READ
@ -186,6 +189,7 @@ INSERT INTO t_alf_child_assoc
FROM
alf_child_assoc ca
;
--END TXN
UNLOCK TABLES;
-- Clean up
@ -213,6 +217,7 @@ CREATE TABLE t_alf_node_assoc
UNIQUE (source_node_id, target_node_id, type_qname_id)
) TYPE=InnoDB;
--BEGIN TXN
LOCK TABLES
t_alf_node_assoc WRITE,
alf_node_assoc AS na READ
@ -230,6 +235,7 @@ INSERT INTO t_alf_node_assoc
FROM
alf_node_assoc na
;
--END TXN
UNLOCK TABLES;
-- Clean up
@ -284,6 +290,7 @@ CREATE TABLE t_alf_node_aspects
PRIMARY KEY (node_id, qname_id)
) TYPE=InnoDB;
--BEGIN TXN
LOCK TABLES
t_alf_node_aspects WRITE,
alf_node_aspects AS na READ,
@ -306,6 +313,7 @@ INSERT INTO t_alf_node_aspects
ns.uri != 'http://www.alfresco.org/model/system/1.0' OR
qn.local_name != 'referenceable'
;
--END TXN
UNLOCK TABLES;
-- Clean up
@ -477,6 +485,7 @@ CREATE TABLE t_alf_node_properties
PRIMARY KEY (node_id, qname_id, list_index, locale_id)
) TYPE=InnoDB;
--BEGIN TXN
-- Copy values over
LOCK TABLES
t_alf_node_properties WRITE,
@ -501,7 +510,9 @@ INSERT INTO t_alf_node_properties
WHERE
np.attribute_value IS NULL
;
--END TXN
UNLOCK TABLES;
-- Update cm:auditable properties on the nodes
UPDATE t_alf_node n SET audit_creator =
(

View File

@ -412,6 +412,20 @@ V2.1-A.fixes.to.schema=0
# The default authentication chain
authentication.chain=alfrescoNtlm1:alfrescoNtlm
# Do authentication tickets expire or live for ever?
authentication.ticket.ticketsExpire=false
# If ticketsEpire is true then how they should expire?
# Valid values are: AFTER_INACTIVITY, AFTER_FIXED_TIME, DO_NOT_EXPIRE
# The default is AFTER_FIXED_TIME
authentication.ticket.expiryMode=AFTER_FIXED_TIME
# If authentication.ticket.ticketsExpire is true and
# authentication.ticket.expiryMode is AFTER_FIXED_TIME or AFTER_INACTIVITY,
# this controls the minimum period for which tickets are valid.
# The default is PT1H for one hour.
authentication.ticket.validDuration=PT1H
# Default NFS user mappings
nfs.user.mappings=admin
nfs.user.mappings.default.uid=0

View File

@ -116,7 +116,7 @@ public class AlfrescoCifsAuthenticator extends CifsAuthenticatorBase
{
// Use the existing authentication token
getAuthenticationService().validate(alfClient.getAuthenticationTicket(), null);
getAuthenticationService().validate(alfClient.getAuthenticationTicket());
// Debug

View File

@ -433,7 +433,7 @@ public abstract class CifsAuthenticatorBase extends CifsAuthenticator implements
{
try
{
getAuthenticationService().validate(alfClient.getAuthenticationTicket(), null);
getAuthenticationService().validate(alfClient.getAuthenticationTicket());
}
catch (AuthenticationException e)
{

View File

@ -188,7 +188,7 @@ public class PassthruCifsAuthenticator extends CifsAuthenticatorBase implements
{
// Use the existing authentication token
getAuthenticationService().validate(alfClient.getAuthenticationTicket(), null);
getAuthenticationService().validate(alfClient.getAuthenticationTicket());
// Debug
@ -269,41 +269,32 @@ public class PassthruCifsAuthenticator extends CifsAuthenticatorBase implements
else
{
// Map the passthru username to an Alfresco person
String username = client.getUserName();
String personName = getPersonService().getUserIdentifier(username);
if (null == personName)
{
personName = username;
}
if ( personName != null)
{
// Use the person name as the current user
getAuthenticationComponent().setCurrentUser(personName);
alfClient.setAuthenticationTicket(getAuthenticationService().getCurrentTicket());
// DEBUG
if ( logger.isDebugEnabled())
logger.debug("Setting current user using person " + personName + " (username " + username + ")");
// Allow the user full access to the server
authSts = ICifsAuthenticator.AUTH_ALLOW;
// Debug
if (logger.isDebugEnabled())
logger.debug("Passthru authenticate user=" + client.getUserName() + ", FULL");
}
else if ( logger.isDebugEnabled())
logger.debug("Failed to find person matching user " + username);
// Use the person name as the current user
getAuthenticationComponent().setCurrentUser(username);
alfClient.setAuthenticationTicket(getAuthenticationService().getCurrentTicket());
// DEBUG
if ( logger.isDebugEnabled())
logger.debug("Setting current user using person " + getAuthenticationComponent().getCurrentUserName() + " (username " + username + ")");
// Allow the user full access to the server
authSts = ICifsAuthenticator.AUTH_ALLOW;
// Debug
if (logger.isDebugEnabled())
logger.debug("Passthru authenticate user=" + client.getUserName() + ", FULL");
}
}
catch (AuthenticationException ex)
catch (AuthenticationException e)
{
logger.debug("User invalid or max tickets exceeded", ex);
throw e;
}
catch (Exception ex)
{

View File

@ -313,7 +313,7 @@ public class AlfrescoRpcAuthenticator implements RpcAuthenticator, InitializingB
{
// Set the authentication context for the request
getAuthenticationService().validate(alfClient.getAuthenticationTicket(), null);
getAuthenticationService().validate(alfClient.getAuthenticationTicket());
// DEBUG

View File

@ -748,7 +748,7 @@ public class ContentIOControlHandler implements IOControlHandler
{
// Validate the existing ticket
getAuthenticationService().validate( cInfo.getAuthenticationTicket(), null);
getAuthenticationService().validate( cInfo.getAuthenticationTicket());
needTicket = false;
}
catch ( AuthenticationException ex)
@ -757,7 +757,7 @@ public class ContentIOControlHandler implements IOControlHandler
try
{
getAuthenticationService().invalidateTicket( cInfo.getAuthenticationTicket(), null);
getAuthenticationService().invalidateTicket( cInfo.getAuthenticationTicket());
cInfo.setAuthenticationTicket( null);
}
catch (Exception ex2)

View File

@ -651,7 +651,7 @@ public class SessionImpl implements Session
{
try
{
getRepositoryImpl().getServiceRegistry().getAuthenticationService().invalidateTicket(getTicket(), null);
getRepositoryImpl().getServiceRegistry().getAuthenticationService().invalidateTicket(getTicket());
}
finally
{

View File

@ -124,7 +124,7 @@ public class JCRProxyFactory
{
if (username == null)
{
authenticationService.validate(session.getTicket(), null);
authenticationService.validate(session.getTicket());
}
}

View File

@ -59,7 +59,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public Action createAction(String ticket, String name)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.createAction(name);
}
@ -69,7 +69,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public Action createAction(String ticket, String name,
Map<String, Serializable> params)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.createAction(name, params);
}
@ -78,7 +78,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public ActionCondition createActionCondition(String ticket, String name)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.createActionCondition(name);
}
@ -88,7 +88,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public ActionCondition createActionCondition(String ticket, String name,
Map<String, Serializable> params)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.createActionCondition(name, params);
}
@ -97,7 +97,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public CompositeAction createCompositeAction(String ticket)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.createCompositeAction();
}
@ -107,7 +107,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public boolean evaluateAction(String ticket, Action action,
NodeRef actionedUponNodeRef)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.evaluateAction(action, actionedUponNodeRef);
}
@ -117,7 +117,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public boolean evaluateActionCondition(String ticket,
ActionCondition condition, NodeRef actionedUponNodeRef)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.evaluateActionCondition(condition, actionedUponNodeRef);
}
@ -127,7 +127,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public void executeAction(String ticket, Action action,
NodeRef actionedUponNodeRef)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
fActionService.executeAction(action, actionedUponNodeRef);
}
@ -137,7 +137,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public void executeAction(String ticket, Action action,
NodeRef actionedUponNodeRef, boolean checkConditions)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
fActionService.executeAction(action, actionedUponNodeRef, checkConditions);
}
@ -148,7 +148,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
NodeRef actionedUponNodeRef, boolean checkConditions,
boolean executeAsynchronously)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
fActionService.executeAction(action, actionedUponNodeRef, checkConditions, executeAsynchronously);
}
@ -157,7 +157,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public Action getAction(String ticket, NodeRef nodeRef, String actionId)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.getAction(nodeRef, actionId);
}
@ -167,7 +167,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public ActionConditionDefinition getActionConditionDefinition(
String ticket, String name)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.getActionConditionDefinition(name);
}
@ -177,7 +177,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public List<ActionConditionDefinition> getActionConditionDefinitions(
String ticket)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.getActionConditionDefinitions();
}
@ -186,7 +186,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public ActionDefinition getActionDefinition(String ticket, String name)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.getActionDefinition(name);
}
@ -195,7 +195,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public List<ActionDefinition> getActionDefinitions(String ticket)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.getActionDefinitions();
}
@ -205,7 +205,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
public List<ActionDefinition> getActionDefinitions(String ticket,
NodeRef nodeRef)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.getActionDefinitions(nodeRef);
}
@ -214,7 +214,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public ParameterConstraint getParameterConstraint(String ticket, String name)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.getParameterConstraint(name);
}
@ -223,7 +223,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public List<ParameterConstraint> getParameterConstraints(String ticket)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.getParameterConstraints();
}
@ -232,7 +232,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public List<Action> getActions(String ticket, NodeRef nodeRef)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fActionService.getActions(nodeRef);
}
@ -241,7 +241,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public void removeAction(String ticket, NodeRef nodeRef, Action action)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
fActionService.removeAction(nodeRef, action);
}
@ -250,7 +250,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public void removeAllActions(String ticket, NodeRef nodeRef)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
fActionService.removeAllActions(nodeRef);
}
@ -259,7 +259,7 @@ public class ActionServiceTransportImpl implements ActionServiceTransport
*/
public void saveAction(String ticket, NodeRef nodeRef, Action action)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
fActionService.saveAction(nodeRef, action);
}
}

View File

@ -257,7 +257,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String getInputHandle(String ticket, int version, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
InputStream in = fAVMService.getFileInputStream(version, path);
String handle = GUID.generate();
synchronized (this)
@ -274,7 +274,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String getInputHandle(String ticket, AVMNodeDescriptor desc)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
InputStream in = fAVMService.getFileInputStream(desc);
String handle = GUID.generate();
synchronized (this)
@ -294,7 +294,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public byte [] readInput(String ticket, String handle, int count)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
InputStream in = null;
synchronized (this)
{
@ -347,7 +347,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public synchronized void closeInputHandle(String ticket, String handle)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
InputStream in = fInputStreams.get(handle);
if (in != null)
{
@ -372,7 +372,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String getOutputHandle(String ticket, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
OutputStream out = fAVMService.getFileOutputStream(path);
String handle = GUID.generate();
synchronized (this)
@ -394,7 +394,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void writeOutput(String ticket, String handle, byte [] buff, int count)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
OutputStream out = null;
synchronized (this)
{
@ -429,7 +429,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public synchronized void closeOutputHandle(String ticket, String handle)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
OutputStream out = fOutputStreams.get(handle);
if (out != null)
{
@ -456,7 +456,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
public SortedMap<String, AVMNodeDescriptor>
getDirectoryListingDirect(String ticket, int version, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getDirectoryListingDirect(version, path);
}
@ -469,7 +469,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
public SortedMap<String, AVMNodeDescriptor>
getDirectoryListing(String ticket, int version, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getDirectoryListing(version, path);
}
@ -481,7 +481,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
public SortedMap<String, AVMNodeDescriptor>
getDirectoryListing(String ticket, AVMNodeDescriptor dir)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getDirectoryListing(dir);
}
@ -493,7 +493,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List<String> getDeleted(String ticket, int version, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getDeleted(version, path);
}
@ -505,7 +505,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String createFile(String ticket, String path, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
OutputStream out = fAVMService.createFile(path, name);
String handle = GUID.generate();
synchronized (this)
@ -524,7 +524,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createDirectory(String ticket, String path, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.createDirectory(path, name);
}
@ -536,7 +536,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createLayeredFile(String ticket, String targetPath, String parent, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.createLayeredFile(targetPath, parent, name);
}
@ -548,7 +548,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createLayeredDirectory(String ticket, String targetPath, String parent, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.createLayeredDirectory(targetPath, parent, name);
}
@ -559,7 +559,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void retargetLayeredDirectory(String ticket, String path, String target)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.retargetLayeredDirectory(path, target);
}
@ -569,7 +569,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createStore(String ticket, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.createStore(name);
}
@ -582,7 +582,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void createBranch(String ticket, int version, String srcPath, String dstPath, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.createBranch(version, srcPath, dstPath, name);
}
@ -593,7 +593,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void removeNode(String ticket, String parent, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.removeNode(parent, name);
}
@ -606,7 +606,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void rename(String ticket, String srcParent, String srcName, String dstParent, String dstName)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.rename(srcParent, srcName, dstParent, dstName);
}
@ -617,7 +617,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void uncover(String ticket, String dirPath, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.uncover(dirPath, name);
}
@ -628,7 +628,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public int getNextVersionID(String ticket, String storeName)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getNextVersionID(storeName);
}
@ -649,7 +649,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map<String, Integer> createSnapshot(String ticket, String store, String label, String comment)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.createSnapshot(store, label, comment);
}
@ -660,7 +660,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List<VersionDescriptor> getStoreVersions(String ticket, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getStoreVersions(name);
}
@ -673,7 +673,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List<VersionDescriptor> getStoreVersions(String ticket, String name, Date from, Date to)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getStoreVersions(name, from, to);
}
@ -683,7 +683,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List<AVMStoreDescriptor> getStores(String ticket)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getStores();
}
@ -694,7 +694,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMStoreDescriptor getStore(String ticket, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getStore(name);
}
@ -706,7 +706,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor getStoreRoot(String ticket, int version, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getStoreRoot(version, name);
}
@ -718,7 +718,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor lookup(String ticket, int version, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.lookup(version, path);
}
@ -734,7 +734,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor lookup(String ticket, int version, String path, boolean includeDeleted)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.lookup(version, path, includeDeleted);
}
@ -747,7 +747,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor lookup(String ticket, AVMNodeDescriptor dir, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.lookup(dir, name);
}
@ -765,7 +765,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor lookup(String ticket, AVMNodeDescriptor dir, String name, boolean includeDeleted)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.lookup(dir, name, includeDeleted);
}
@ -778,7 +778,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public String getIndirectionPath(String ticket, int version, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getIndirectionPath(version, path);
}
@ -788,7 +788,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void purgeStore(String ticket, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.purgeStore(name);
}
@ -799,7 +799,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void purgeVersion(String ticket, int version, String name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.purgeVersion(version, name);
}
@ -809,7 +809,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void makePrimary(String ticket, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.makePrimary(path);
}
@ -821,7 +821,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public List<AVMNodeDescriptor> getHistory(String ticket, AVMNodeDescriptor desc, int count)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getHistory(desc, count);
}
@ -832,7 +832,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setOpacity(String ticket, String path, boolean opacity)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.setOpacity(path, opacity);
}
@ -844,7 +844,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public AVMNodeDescriptor getCommonAncestor(String ticket, AVMNodeDescriptor left, AVMNodeDescriptor right)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getCommonAncestor(left, right);
}
@ -856,7 +856,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public LayeringDescriptor getLayeringInfo(String ticket, int version, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getLayeringInfo(version, path);
}
@ -868,7 +868,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setNodeProperty(String ticket, String path, QName name, PropertyValue value)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.setNodeProperty(path, name, value);
}
@ -879,7 +879,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setNodeProperties(String ticket, String path, Map<QName, PropertyValue> properties)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.setNodeProperties(path, properties);
}
@ -892,7 +892,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public PropertyValue getNodeProperty(String ticket, int version, String path, QName name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getNodeProperty(version, path, name);
}
@ -904,7 +904,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map<QName, PropertyValue> getNodeProperties(String ticket, int version, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getNodeProperties(version, path);
}
@ -915,7 +915,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void deleteNodeProperty(String ticket, String path, QName name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.deleteNodeProperty(path, name);
}
@ -925,7 +925,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void deleteNodeProperties(String ticket, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.deleteNodeProperties(path);
}
@ -937,7 +937,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setStoreProperty(String ticket, String store, QName name, PropertyValue value)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.setStoreProperty(store, name, value);
}
@ -948,7 +948,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setStoreProperties(String ticket, String store, Map<QName, PropertyValue> props)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.setStoreProperties(store, props);
}
@ -960,7 +960,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public PropertyValue getStoreProperty(String ticket, String store, QName name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getStoreProperty(store, name);
}
@ -972,7 +972,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map<QName, PropertyValue> queryStorePropertyKey(String ticket, String store, QName keyPattern)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.queryStorePropertyKey(store, keyPattern);
}
@ -983,7 +983,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map<String, Map<QName, PropertyValue>> queryStoresPropertyKey(String ticket, QName keyPattern)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.queryStoresPropertyKeys(keyPattern);
}
@ -994,7 +994,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Map<QName, PropertyValue> getStoreProperties(String ticket, String store)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getStoreProperties(store);
}
@ -1005,7 +1005,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void deleteStoreProperty(String ticket, String store, QName name)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.deleteStoreProperty(store, name);
}
@ -1014,7 +1014,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void renameStore(String ticket, String sourceName, String destName)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.renameStore(sourceName, destName);
}
@ -1023,7 +1023,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void addAspect(String ticket, String path, QName aspectName)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.addAspect(path, aspectName);
}
@ -1032,7 +1032,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Set<QName> getAspects(String ticket, int version, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getAspects(version, path);
}
@ -1041,7 +1041,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public boolean hasAspect(String ticket, int version, String path, QName aspectName)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.hasAspect(version, path, aspectName);
}
@ -1050,7 +1050,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void removeAspect(String ticket, String path, QName aspectName)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.removeAspect(path, aspectName);
}
@ -1059,7 +1059,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void revert(String ticket, String path, AVMNodeDescriptor toRevertTo)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.revert(path, toRevertTo);
}
@ -1068,7 +1068,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public Pair<Integer, String> getAPath(String ticket, AVMNodeDescriptor desc)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fAVMService.getAPath(desc);
}
@ -1077,7 +1077,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setGuid(String ticket, String path, String guid)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.setGuid(path, guid);
}
@ -1086,7 +1086,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setEncoding(String ticket, String path, String encoding)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.setEncoding(path, encoding);
}
@ -1095,7 +1095,7 @@ public class AVMRemoteTransportService implements AVMRemoteTransport, Runnable
*/
public void setMimeType(String ticket, String path, String mimeType)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fAVMService.setMimeType(path, mimeType);
}
}

View File

@ -65,7 +65,7 @@ public class AVMSyncServiceTransportImpl implements AVMSyncServiceTransport
public List<AVMDifference> compare(String ticket, int srcVersion,
String srcPath, int dstVersion, String dstPath, NameMatcher excluder)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
return fSyncService.compare(srcVersion, srcPath, dstVersion, dstPath, excluder);
}
@ -74,7 +74,7 @@ public class AVMSyncServiceTransportImpl implements AVMSyncServiceTransport
*/
public void flatten(String ticket, String layerPath, String underlyingPath)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
fSyncService.flatten(layerPath, underlyingPath);
}
@ -83,7 +83,7 @@ public class AVMSyncServiceTransportImpl implements AVMSyncServiceTransport
*/
public void resetLayer(String ticket, String layerPath)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
fSyncService.resetLayer(layerPath);
}
@ -95,7 +95,7 @@ public class AVMSyncServiceTransportImpl implements AVMSyncServiceTransport
boolean overrideConflicts, boolean overrideOlder, String tag,
String description)
{
fAuthenticationService.validate(ticket, null);
fAuthenticationService.validate(ticket);
fSyncService.update(diffList, excluder, ignoreConflicts, ignoreOlder, overrideConflicts, overrideOlder, tag, description);
}
}

View File

@ -70,6 +70,9 @@ public class AVMTestSuite extends TestSuite
suite.addTestSuite(AVMServiceTestBase.class);
suite.addTestSuite(AVMServiceTest.class);
suite.addTestSuite(PurgeTestP.class);
suite.addTestSuite(AVMServiceLocalTest.class);
suite.addTestSuite(AVMLockingServiceTest.class);

View File

@ -1018,6 +1018,17 @@ public class SchemaBootstrap extends AbstractLifecycleBean
fetchColumnName = assigns[1];
continue;
}
// Allow transaction delineation
else if (sql.startsWith("--BEGIN TXN"))
{
connection.setAutoCommit(false);
}
else if (sql.startsWith("--END TXN"))
{
connection.commit();
connection.setAutoCommit(true);
}
// Check for comments
if (sql.length() == 0 ||
sql.startsWith( "--" ) ||

View File

@ -248,7 +248,7 @@ public class ImapServiceImplTest extends TestCase
private void reauthenticate(String name, String password)
{
authenticationService.invalidateTicket(authenticationService.getCurrentTicket(), null);
authenticationService.invalidateTicket(authenticationService.getCurrentTicket());
authenticationService.clearCurrentSecurityContext();
authenticationService.authenticate(name, password.toCharArray());
}

View File

@ -211,7 +211,7 @@ public class LoadTester extends TestCase
private void reauthenticate(String name, String password)
{
authenticationService.invalidateTicket(authenticationService.getCurrentTicket(), null);
authenticationService.invalidateTicket(authenticationService.getCurrentTicket());
authenticationService.clearCurrentSecurityContext();
authenticationService.authenticate(name, password.toCharArray());
}

View File

@ -291,10 +291,21 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
// set the pivot language and the functional name
nodeService.setProperty(mlContainerNodeRef, ContentModel.PROP_LOCALE, locale);
nodeService.setProperty(mlContainerNodeRef, ContentModel.PROP_NAME, containerFunctionalName);
}
else
{
// ALF-2200: Create the translation as the same type as the pivot
NodeRef pivotNodeRef = this.getPivotTranslation(mlContainerNodeRef);
if (pivotNodeRef != null && !pivotNodeRef.equals(contentNodeRef))
{
QName pivotNodeType = nodeService.getType(pivotNodeRef);
QName contentNodeType = nodeService.getType(contentNodeRef);
if (!pivotNodeType.equals(contentNodeType))
{
nodeService.setType(contentNodeRef, pivotNodeType);
}
}
// Check that the language is not duplicated
Map<Locale, NodeRef> existingLanguages = this.getTranslations(mlContainerNodeRef);
if (existingLanguages.containsKey(locale))
@ -379,7 +390,7 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
/** @inheritDoc */
public void deleteTranslationContainer(NodeRef mlContainerNodeRef)
{
if(!ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(nodeService.getType(mlContainerNodeRef)))
if (!ContentModel.TYPE_MULTILINGUAL_CONTAINER.equals(nodeService.getType(mlContainerNodeRef)))
{
throw new IllegalArgumentException(
"Node type must be " + ContentModel.TYPE_MULTILINGUAL_CONTAINER);
@ -394,30 +405,17 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
// remove the translations
for(NodeRef translationToRemove : translations.values())
{
if(nodeService.exists(translationToRemove))
// unmake the translation, ignore any parent-child logic
this.unmakeTranslationSimple(translationToRemove);
// remove it, if necessary
if (nodeService.exists(translationToRemove))
{
// unmake the translation
this.unmakeTranslation(translationToRemove);
// remove it
if(nodeService.exists(translationToRemove))
{
nodeService.deleteNode(translationToRemove);
}
nodeService.deleteNode(translationToRemove);
}
}
// if the mlContainer is not removed with the pivot,
if(nodeService.exists(mlContainerNodeRef))
{
// force its deletion
nodeService.deleteNode(mlContainerNodeRef);
if (logger.isWarnEnabled())
{
logger.warn("The ML container " + mlContainerNodeRef + " was not removed with it's pivot translation in the unmakeTranslation process.");
}
}
// force its deletion
nodeService.deleteNode(mlContainerNodeRef);
// done
if (logger.isDebugEnabled())
@ -427,26 +425,37 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
" Number of translations: " + translationCount);
}
}
/**
* Does the work of making the translation a simple node again. No parent-child relationships
* are modified and the pivot-container logic is not done here.
*
* @param translationNodeRef a translation
*/
private void unmakeTranslationSimple(NodeRef translationNodeRef)
{
if (nodeService.hasAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
{
nodeService.removeAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION);
nodeService.addAspect(translationNodeRef, ContentModel.ASPECT_TEMPORARY, null);
}
else
{
nodeService.removeAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
}
}
/** @inheritDoc */
public void unmakeTranslation(NodeRef translationNodeRef)
{
// Get the container
NodeRef containerNodeRef = getMLContainer(translationNodeRef, true);
if (containerNodeRef == null)
{
if (nodeService.hasAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
{
nodeService.deleteNode(translationNodeRef);
}
else
{
nodeService.removeAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
}
unmakeTranslationSimple(translationNodeRef);
}
else if (isPivotTranslation(translationNodeRef))
{
// Get all translation child associations
// Pivot nodes are handled by unmaking all translations and removing the container
List<ChildAssociationRef> mlChildAssocs = nodeService.getChildAssocs(
containerNodeRef,
ContentModel.ASSOC_MULTILINGUAL_CHILD,
@ -455,30 +464,15 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
{
NodeRef mlChildNodeRef = mlChildAssoc.getChildRef();
// Delete empty translations
if (nodeService.hasAspect(mlChildNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
{
nodeService.deleteNode(mlChildNodeRef);
}
else
{
nodeService.removeAspect(mlChildNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
}
unmakeTranslationSimple(mlChildNodeRef);
}
// Now delete the container
nodeService.deleteNode(containerNodeRef);
}
else
{
if (nodeService.hasAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
{
nodeService.deleteNode(translationNodeRef);
}
else
{
// Get the container and break the association to it
nodeService.removeChild(containerNodeRef, translationNodeRef);
nodeService.removeAspect(translationNodeRef, ContentModel.ASPECT_MULTILINGUAL_DOCUMENT);
}
nodeService.removeChild(containerNodeRef, translationNodeRef);
unmakeTranslationSimple(translationNodeRef);
}
}
@ -739,11 +733,13 @@ public class MultilingualContentServiceImpl implements MultilingualContentServic
// Create the document in the space of the node of reference
NodeRef parentNodeRef = nodeService.getPrimaryParent(translationOfNodeRef).getParentRef();
// Create the empty translation
// Create the empty translation.
// ALF-2200: Create the translation as the same type as the pivot
QName newTranslationType = nodeService.getType(translationOfNodeRef);
NodeRef newTranslationNodeRef = fileFolderService.create(
parentNodeRef,
name,
ContentModel.TYPE_CONTENT).getNodeRef();
newTranslationType).getNodeRef();
// add the translation to the container
addTranslation(newTranslationNodeRef, translationOfNodeRef, locale);

View File

@ -122,15 +122,8 @@ public class MultilingualDocumentAspect implements
*/
public void beforeDeleteNode(NodeRef nodeRef)
{
if (nodeService.hasAspect(nodeRef, ContentModel.ASPECT_MULTILINGUAL_EMPTY_TRANSLATION))
{
// We just let it get deleted
}
else
{
// First unhook it
multilingualContentService.unmakeTranslation(nodeRef);
}
// First unhook it
multilingualContentService.unmakeTranslation(nodeRef);
}
/**

View File

@ -436,8 +436,11 @@ public abstract class AbstractNodeServiceImpl implements NodeService
if (ignorePolicy(childNodeRef))
{
// special case
qnames = new HashSet<QName>(1);
qnames.add(ContentModel.ASPECT_VERSIONABLE);
if (childAspectQnames.contains(ContentModel.ASPECT_VERSIONABLE) || childNodeTypeQName.equals(ContentModel.ASPECT_VERSIONABLE))
{
qnames = new HashSet<QName>(1);
qnames.add(ContentModel.ASPECT_VERSIONABLE);
}
}
else
{

View File

@ -97,7 +97,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<List<FileInfo>> callback = new RetryingTransactionCallback<List<FileInfo>>()
{
@ -122,7 +122,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<List<FileInfo>> callback = new RetryingTransactionCallback<List<FileInfo>>()
{
@ -147,7 +147,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<List<FileInfo>> callback = new RetryingTransactionCallback<List<FileInfo>>()
{
@ -172,7 +172,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
{
@ -201,7 +201,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<List<FileInfo>> callback = new RetryingTransactionCallback<List<FileInfo>>()
{
@ -232,7 +232,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<List<FileInfo>> callback = new RetryingTransactionCallback<List<FileInfo>>()
{
@ -257,7 +257,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<FileInfo> callback = new RetryingTransactionCallback<FileInfo>()
{
@ -283,7 +283,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<FileInfo> callback = new RetryingTransactionCallback<FileInfo>()
{
@ -309,7 +309,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<FileInfo> callback = new RetryingTransactionCallback<FileInfo>()
{
@ -334,7 +334,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<FileInfo> callback = new RetryingTransactionCallback<FileInfo>()
{
@ -359,7 +359,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<FileInfo[]> callback = new RetryingTransactionCallback<FileInfo[]>()
{
@ -389,7 +389,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{
@ -415,7 +415,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<Object> callback = new RetryingTransactionCallback<Object>()
{
@ -442,7 +442,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<FileInfo> callback = new RetryingTransactionCallback<FileInfo>()
{
@ -467,7 +467,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<List<FileInfo>> callback = new RetryingTransactionCallback<List<FileInfo>>()
{
@ -492,7 +492,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<FileInfo> callback = new RetryingTransactionCallback<FileInfo>()
{
@ -517,7 +517,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<FileInfo> callback = new RetryingTransactionCallback<FileInfo>()
{
@ -546,7 +546,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<ContentData> callback = new RetryingTransactionCallback<ContentData>()
{
@ -595,7 +595,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<ContentData[]> callback = new RetryingTransactionCallback<ContentData[]>()
{
@ -647,7 +647,7 @@ public class FileFolderRemoteServer implements FileFolderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<byte[]> callback = new RetryingTransactionCallback<byte[]>()
{

View File

@ -156,7 +156,7 @@ public class LoaderRemoteServer implements LoaderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
{
@ -241,7 +241,7 @@ public class LoaderRemoteServer implements LoaderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
// Make the call
RetryingTransactionCallback<FileInfo[]> callback = new RetryingTransactionCallback<FileInfo[]>()
@ -322,7 +322,7 @@ public class LoaderRemoteServer implements LoaderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
{
public NodeRef execute() throws Throwable
@ -349,7 +349,7 @@ public class LoaderRemoteServer implements LoaderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
RetryingTransactionCallback<FileInfo[]> callback = new RetryingTransactionCallback<FileInfo[]>()
{
public FileInfo[] execute() throws Throwable
@ -385,7 +385,7 @@ public class LoaderRemoteServer implements LoaderRemote
AuthenticationUtil.pushAuthentication();
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
RetryingTransactionCallback<NodeRef> callback = new RetryingTransactionCallback<NodeRef>()
{
public NodeRef execute() throws Throwable
@ -412,7 +412,7 @@ public class LoaderRemoteServer implements LoaderRemote
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
RetryingTransactionCallback<NodeRef[]> callback = new RetryingTransactionCallback<NodeRef[]>()
{
public NodeRef [] execute() throws Throwable

View File

@ -244,7 +244,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public synchronized void closeInputHandle(String ticket, String handle)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
InputStream in = fInputStreams.get(handle);
if (in != null)
{
@ -267,7 +267,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public synchronized void closeOutputHandle(String ticket, String handle)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
OutputStream out = fOutputStreams.get(handle);
if (out != null)
{
@ -290,7 +290,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public NodeRef createDirectory(String ticket, NodeRef base, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fRepoRemote.createDirectory(base, path);
}
@ -299,7 +299,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public String createFile(String ticket, NodeRef base, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
OutputStream out = fRepoRemote.createFile(base, path);
return getOutputHandle(out);
}
@ -309,7 +309,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public Map<String, Pair<NodeRef, Boolean>> getListing(String ticket, NodeRef dir)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fRepoRemote.getListing(dir);
}
@ -318,7 +318,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public NodeRef getRoot(String ticket)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fRepoRemote.getRoot();
}
@ -327,7 +327,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public Pair<NodeRef, Boolean> lookup(String ticket, NodeRef base, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
return fRepoRemote.lookup(base, path);
}
@ -336,7 +336,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public String readFile(String ticket, NodeRef base, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
InputStream in = fRepoRemote.readFile(base, path);
return getInputHandle(in);
}
@ -346,7 +346,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public String readFile(String ticket, NodeRef fileRef)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
InputStream in = fRepoRemote.readFile(fileRef);
return getInputHandle(in);
}
@ -356,7 +356,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public byte[] readInput(String ticket, String handle, int count)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
InputStream in = null;
synchronized (this)
{
@ -405,7 +405,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public void removeNode(String ticket, NodeRef base, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fRepoRemote.removeNode(base, path);
}
@ -414,7 +414,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public void removeNode(String ticket, NodeRef toRemove)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fRepoRemote.removeNode(toRemove);
}
@ -423,7 +423,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public void rename(String ticket, NodeRef base, String src, String dst)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
fRepoRemote.rename(base, src, dst);
}
@ -432,7 +432,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public String writeFile(String ticket, NodeRef base, String path)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
OutputStream out = fRepoRemote.writeFile(base, path);
return getOutputHandle(out);
}
@ -442,7 +442,7 @@ public class RepoRemoteTransportService implements RepoRemoteTransport,
*/
public void writeOutput(String ticket, String handle, byte[] buff, int count)
{
fAuthService.validate(ticket, null);
fAuthService.validate(ticket);
OutputStream out = null;
synchronized (this)
{

View File

@ -67,11 +67,6 @@ public abstract class AbstractAuthenticationService implements AuthenticationSer
{
return sysAdminParams.getMaxUsers();
}
public String getCurrentTicket()
{
return getCurrentTicket(null);
}
public abstract Set<String> getUsersWithTickets(boolean nonExpiredOnly);

View File

@ -32,8 +32,7 @@ import org.alfresco.service.cmr.security.MutableAuthenticationService;
*
* @author dward
*/
public abstract class AbstractChainingAuthenticationService extends AbstractAuthenticationService implements
MutableAuthenticationService
public abstract class AbstractChainingAuthenticationService extends AbstractAuthenticationService implements MutableAuthenticationService
{
/**
* Instantiates a new abstract chaining authentication service.
@ -57,8 +56,7 @@ public abstract class AbstractChainingAuthenticationService extends AbstractAuth
*/
protected abstract List<AuthenticationService> getUsableAuthenticationServices();
/*
* (non-Javadoc)
/* (non-Javadoc)
* @see org.alfresco.service.cmr.security.AuthenticationService#createAuthentication(java.lang.String, char[])
*/
public void createAuthentication(String userName, char[] password) throws AuthenticationException
@ -71,10 +69,8 @@ public abstract class AbstractChainingAuthenticationService extends AbstractAuth
getMutableAuthenticationService().createAuthentication(userName, password);
}
/*
* (non-Javadoc)
* @see org.alfresco.service.cmr.security.AuthenticationService#updateAuthentication(java.lang.String, char[],
* char[])
/* (non-Javadoc)
* @see org.alfresco.service.cmr.security.AuthenticationService#updateAuthentication(java.lang.String, char[], char[])
*/
public void updateAuthentication(String userName, char[] oldPassword, char[] newPassword)
throws AuthenticationException
@ -249,7 +245,7 @@ public abstract class AbstractChainingAuthenticationService extends AbstractAuth
// it doesn't exist in any of the authentication components
return false;
}
/**
* {@inheritDoc}
*/
@ -293,13 +289,13 @@ public abstract class AbstractChainingAuthenticationService extends AbstractAuth
/**
* {@inheritDoc}
*/
public void invalidateTicket(String ticket, String sessionId) throws AuthenticationException
public void invalidateTicket(String ticket) throws AuthenticationException
{
for (AuthenticationService authService : getUsableAuthenticationServices())
{
try
{
authService.invalidateTicket(ticket, sessionId);
authService.invalidateTicket(ticket);
return;
}
catch (AuthenticationException e)
@ -314,13 +310,13 @@ public abstract class AbstractChainingAuthenticationService extends AbstractAuth
/**
* {@inheritDoc}
*/
public void validate(String ticket, String sessionId) throws AuthenticationException
public void validate(String ticket) throws AuthenticationException
{
for (AuthenticationService authService : getUsableAuthenticationServices())
{
try
{
authService.validate(ticket, sessionId);
authService.validate(ticket);
return;
}
catch (AuthenticationException e)
@ -335,13 +331,13 @@ public abstract class AbstractChainingAuthenticationService extends AbstractAuth
/**
* {@inheritDoc}
*/
public String getCurrentTicket(String sessionId)
public String getCurrentTicket()
{
for (AuthenticationService authService : getUsableAuthenticationServices())
{
try
{
return authService.getCurrentTicket(sessionId);
return authService.getCurrentTicket();
}
catch (AuthenticationException e)
{
@ -354,13 +350,13 @@ public abstract class AbstractChainingAuthenticationService extends AbstractAuth
/**
* {@inheritDoc}
*/
public String getNewTicket(String sessionId)
public String getNewTicket()
{
for (AuthenticationService authService : getUsableAuthenticationServices())
{
try
{
return authService.getNewTicket(sessionId);
return authService.getNewTicket();
}
catch (AuthenticationException e)
{
@ -552,5 +548,7 @@ public abstract class AbstractChainingAuthenticationService extends AbstractAuth
}
return defaultGuestUserNames;
}
}

View File

@ -70,7 +70,7 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
throw ae;
}
ticketComponent.clearCurrentTicket();
getCurrentTicket(null);
getCurrentTicket();
}
public String getCurrentUserName() throws AuthenticationException
@ -88,9 +88,9 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
return ticketComponent.getUsersWithTickets(nonExpiredOnly);
}
public void invalidateTicket(String ticket, String sessionId) throws AuthenticationException
public void invalidateTicket(String ticket) throws AuthenticationException
{
ticketComponent.invalidateTicketById(ticket, sessionId);
ticketComponent.invalidateTicketById(ticket);
}
public int countTickets(boolean nonExpiredOnly)
@ -104,7 +104,7 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
}
public void validate(String ticket, String sessionId) throws AuthenticationException
public void validate(String ticket) throws AuthenticationException
{
String currentUser = null;
try
@ -112,7 +112,7 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
// clear context - to avoid MT concurrency issue (causing domain mismatch) - see also 'authenticate' above
clearCurrentSecurityContext();
currentUser = ticketComponent.validateTicket(ticket, sessionId);
currentUser = ticketComponent.validateTicket(ticket);
authenticationComponent.setCurrentUser(currentUser, UserNameValidationMode.CHECK);
}
catch (AuthenticationException ae)
@ -122,22 +122,22 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
}
}
public String getCurrentTicket(String sessionId) throws AuthenticationException
public String getCurrentTicket() throws AuthenticationException
{
String userName = getCurrentUserName();
// So that preAuthenticationCheck can constrain the creation of new tickets, we first ask for the current ticket
// without auto-creation
String ticket = ticketComponent.getCurrentTicket(userName, sessionId, false);
String ticket = ticketComponent.getCurrentTicket(userName, false);
if (ticket == null)
{
// If we get through the authentication check then it's safe to issue a new ticket (e.g. for
// SSO/external-based login)
return getNewTicket(sessionId);
return getNewTicket();
}
return ticket;
}
public String getNewTicket(String sessionId)
public String getNewTicket()
{
String userName = getCurrentUserName();
try
@ -149,7 +149,7 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
clearCurrentSecurityContext();
throw e;
}
return ticketComponent.getNewTicket(userName, sessionId);
return ticketComponent.getNewTicket(userName);
}
public void clearCurrentSecurityContext()
@ -174,7 +174,7 @@ public class AuthenticationServiceImpl extends AbstractAuthenticationService imp
authenticationComponent.setGuestUserAsCurrentUser();
String guestUser = authenticationComponent.getCurrentUserName();
ticketComponent.clearCurrentTicket();
ticketComponent.getCurrentTicket(guestUser, null, true); // to ensure new ticket is created (even if client does not explicitly call getCurrentTicket)
ticketComponent.getCurrentTicket(guestUser, true); // to ensure new ticket is created (even if client does not explicitly call getCurrentTicket)
}
public boolean guestUserAuthenticationAllowed()

View File

@ -278,11 +278,11 @@ public class AuthenticationTest extends TestCase
//userTransaction = transactionService.getUserTransaction();
//userTransaction.begin();
pubAuthenticationService.validate(ticket, null);
pubAuthenticationService.validate(ticket);
userName = pubAuthenticationService.getCurrentUserName();
assertEquals("andy", userName);
pubAuthenticationService.validate(newticket, null);
pubAuthenticationService.validate(newticket);
userName = pubAuthenticationService.getCurrentUserName();
assertEquals("andy", userName);
@ -641,14 +641,14 @@ public class AuthenticationTest extends TestCase
Authentication result = authenticationManager.authenticate(token);
result.setAuthenticated(true);
String ticket = ticketComponent.getNewTicket(getUserName(result), null);
String user = ticketComponent.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
String ticket = ticketComponent.getNewTicket(getUserName(result));
String user = ticketComponent.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
user = null;
try
{
user = ticketComponent.validateTicket("INVALID", null);
user = ticketComponent.validateTicket("INVALID");
assertNotNull(null);
}
catch (AuthenticationException e)
@ -656,11 +656,11 @@ public class AuthenticationTest extends TestCase
assertNull(user);
}
ticketComponent.invalidateTicketById(ticket, null);
ticketComponent.invalidateTicketById(ticket);
try
{
user = ticketComponent.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
user = ticketComponent.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -689,11 +689,11 @@ public class AuthenticationTest extends TestCase
Authentication result = authenticationManager.authenticate(token);
result.setAuthenticated(true);
String ticket = tc.getNewTicket(getUserName(result), null);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
String ticket = tc.getNewTicket(getUserName(result));
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
dao.deleteUser("Andy");
// assertNull(dao.getUserOrNull("Andy"));
@ -715,12 +715,12 @@ public class AuthenticationTest extends TestCase
Authentication result = authenticationManager.authenticate(token);
result.setAuthenticated(true);
String ticket = tc.getNewTicket(getUserName(result), null);
tc.validateTicket(ticket, null);
assertTrue(!ticketComponent.getCurrentTicket("Andy", null, true).equals(ticket));
String ticket = tc.getNewTicket(getUserName(result));
tc.validateTicket(ticket);
assertTrue(!ticketComponent.getCurrentTicket("Andy", true).equals(ticket));
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -749,13 +749,13 @@ public class AuthenticationTest extends TestCase
Authentication result = authenticationManager.authenticate(token);
result.setAuthenticated(true);
String ticket = tc.getNewTicket(getUserName(result), null);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
String ticket = tc.getNewTicket(getUserName(result));
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
synchronized (this)
{
@ -771,7 +771,7 @@ public class AuthenticationTest extends TestCase
}
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -781,7 +781,7 @@ public class AuthenticationTest extends TestCase
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -791,7 +791,7 @@ public class AuthenticationTest extends TestCase
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -814,7 +814,7 @@ public class AuthenticationTest extends TestCase
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -823,7 +823,7 @@ public class AuthenticationTest extends TestCase
}
tc.setExpiryMode(ExpiryMode.AFTER_INACTIVITY.toString());
ticket = tc.getNewTicket(getUserName(result), null);
ticket = tc.getNewTicket(getUserName(result));
for (int i = 0; i < 50; i++)
{
@ -840,7 +840,7 @@ public class AuthenticationTest extends TestCase
e.printStackTrace();
}
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
}
}
@ -860,7 +860,7 @@ public class AuthenticationTest extends TestCase
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -889,13 +889,13 @@ public class AuthenticationTest extends TestCase
Authentication result = authenticationManager.authenticate(token);
result.setAuthenticated(true);
String ticket = tc.getNewTicket(getUserName(result), null);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
String ticket = tc.getNewTicket(getUserName(result));
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
synchronized (this)
{
@ -911,7 +911,7 @@ public class AuthenticationTest extends TestCase
}
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -921,7 +921,7 @@ public class AuthenticationTest extends TestCase
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -931,7 +931,7 @@ public class AuthenticationTest extends TestCase
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -954,7 +954,7 @@ public class AuthenticationTest extends TestCase
try
{
tc.validateTicket(ticket, null);
tc.validateTicket(ticket);
assertNotNull(null);
}
catch (AuthenticationException e)
@ -982,13 +982,13 @@ public class AuthenticationTest extends TestCase
Authentication result = authenticationManager.authenticate(token);
result.setAuthenticated(true);
String ticket = tc.getNewTicket(getUserName(result), null);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
String ticket = tc.getNewTicket(getUserName(result));
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
synchronized (this)
{
try
@ -1002,8 +1002,8 @@ public class AuthenticationTest extends TestCase
}
}
tc.validateTicket(ticket, null);
assertEquals(ticketComponent.getCurrentTicket("Andy", null, true), ticket);
tc.validateTicket(ticket);
assertEquals(ticketComponent.getCurrentTicket("Andy", true), ticket);
dao.deleteUser("Andy");
// assertNull(dao.getUserOrNull("Andy"));
@ -1138,14 +1138,14 @@ public class AuthenticationTest extends TestCase
// instance
String ticket = authenticationService.getCurrentTicket();
// validate our ticket is still valid
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
assertEquals(ticket, authenticationService.getCurrentTicket());
// destroy the ticket instance
authenticationService.invalidateTicket(ticket, null);
authenticationService.invalidateTicket(ticket);
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
fail("Invalid taicket should have been rejected");
}
catch (AuthenticationException e)
@ -1187,11 +1187,11 @@ public class AuthenticationTest extends TestCase
// validate our ticket is still valid
authenticationService.clearCurrentSecurityContext();
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
assertEquals(ticket, authenticationService.getCurrentTicket());
// destroy the ticket instance
authenticationService.invalidateTicket(ticket, null);
authenticationService.invalidateTicket(ticket);
Authentication current = authenticationComponent.getCurrentAuthentication();
if (current != null)
@ -1202,7 +1202,7 @@ public class AuthenticationTest extends TestCase
try
{
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
fail("Invalid ticket should have been rejected");
}
catch (AuthenticationException e)
@ -1246,11 +1246,11 @@ public class AuthenticationTest extends TestCase
// instance
String ticket = authenticationService.getCurrentTicket();
// validate our ticket is still valid
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
assertEquals(ticket, authenticationService.getCurrentTicket());
// destroy the ticket instance
authenticationService.invalidateTicket(ticket, null);
authenticationService.invalidateTicket(ticket);
Authentication current = authenticationComponent.getCurrentAuthentication();
if (current != null)
@ -1306,11 +1306,11 @@ public class AuthenticationTest extends TestCase
// instance
String ticket = authenticationService.getCurrentTicket();
// validate our ticket is still valid
authenticationService.validate(ticket, null);
authenticationService.validate(ticket);
assertEquals(ticket, authenticationService.getCurrentTicket());
// destroy the ticket instance
authenticationService.invalidateTicket(ticket, null);
authenticationService.invalidateTicket(ticket);
Authentication current = authenticationComponent.getCurrentAuthentication();
if (current != null)
@ -1328,48 +1328,6 @@ public class AuthenticationTest extends TestCase
// assertNull(dao.getUserOrNull("Andy"));
}
public void testAuthenticationServiceSessionIds()
{
// create an authentication object e.g. the user
authenticationService.createAuthentication("Andy", "auth1".toCharArray());
// authenticate with this user details
authenticationService.authenticate("Andy", "auth1".toCharArray());
// assert the user is authenticated
assertEquals("Andy", authenticationService.getCurrentUserName());
// Get the user's ticket and associate it with "AndySessionId"
String andyTicket = authenticationService.getCurrentTicket("AndySessionId");
// Now validate the ticket in another session
authenticationService.validate(andyTicket, "DaveSessionId");
assertEquals(andyTicket, authenticationService.getCurrentTicket());
// Invalidate it in that session
authenticationService.invalidateTicket(andyTicket, "DaveSessionId");
// Make sure we don't get that ticket again in the same session
assertNotSame(andyTicket, authenticationService.getCurrentTicket("DaveSessionId"));
// The ticket should still validate in the other session
authenticationService.validate(andyTicket, "AndySessionId");
// When we invalidate it in the other session, the ticket should be invalidated globally
authenticationService.invalidateTicket(andyTicket, "AndySessionId");
try
{
authenticationService.validate(andyTicket, null);
fail("Invalid ticket should have been rejected");
}
catch (AuthenticationException e)
{
// Expected
}
}
public void testPubAuthenticationService1()
{
authenticationComponent.setSystemUserAsCurrentUser();
@ -1510,14 +1468,14 @@ public class AuthenticationTest extends TestCase
assertNull(authenticationComponent.getCurrentAuthentication());
// validate our ticket is still valid
pubAuthenticationService.validate(ticket, null);
pubAuthenticationService.validate(ticket);
assertEquals(ticket, authenticationService.getCurrentTicket());
// destroy the ticket instance
pubAuthenticationService.invalidateTicket(ticket, null);
pubAuthenticationService.invalidateTicket(ticket);
try
{
pubAuthenticationService.validate(ticket, null);
pubAuthenticationService.validate(ticket);
fail("Ticket should not validate");
}
catch (AuthenticationException e)
@ -1579,11 +1537,11 @@ public class AuthenticationTest extends TestCase
// instance
String ticket = pubAuthenticationService.getCurrentTicket();
// validate our ticket is still valid
pubAuthenticationService.validate(ticket, null);
pubAuthenticationService.validate(ticket);
assertEquals(ticket, authenticationService.getCurrentTicket());
// destroy the ticket instance
pubAuthenticationService.invalidateTicket(ticket, null);
pubAuthenticationService.invalidateTicket(ticket);
}
@ -1640,11 +1598,11 @@ public class AuthenticationTest extends TestCase
// instance
String ticket = pubAuthenticationService.getCurrentTicket();
// validate our ticket is still valid
pubAuthenticationService.validate(ticket, null);
pubAuthenticationService.validate(ticket);
assertEquals(ticket, authenticationService.getCurrentTicket());
// destroy the ticket instance
pubAuthenticationService.invalidateTicket(ticket, null);
pubAuthenticationService.invalidateTicket(ticket);
authenticationComponent.clearCurrentSecurityContext();

View File

@ -299,11 +299,11 @@ public class ChainingAuthenticationServiceTest extends TestCase
String ticket = as.getCurrentTicket();
assertTrue(ticket == as.getCurrentTicket());
as.validate(ticket, null);
as.invalidateTicket(ticket, null);
as.validate(ticket);
as.invalidateTicket(ticket);
try
{
as.validate(ticket, null);
as.validate(ticket);
fail();
}
catch (AuthenticationException e)
@ -312,11 +312,11 @@ public class ChainingAuthenticationServiceTest extends TestCase
}
ticket = as.getCurrentTicket();
as.validate(ticket, null);
as.validate(ticket);
as.invalidateUserSession("andy");
try
{
as.validate(ticket, null);
as.validate(ticket);
fail();
}
catch (AuthenticationException e)
@ -664,11 +664,11 @@ public class ChainingAuthenticationServiceTest extends TestCase
String ticket = as.getCurrentTicket();
assertTrue(ticket == as.getCurrentTicket());
as.validate(ticket, null);
as.invalidateTicket(ticket, null);
as.validate(ticket);
as.invalidateTicket(ticket);
try
{
as.validate(ticket, null);
as.validate(ticket);
fail();
}
catch (AuthenticationException e)
@ -677,11 +677,11 @@ public class ChainingAuthenticationServiceTest extends TestCase
}
ticket = as.getCurrentTicket();
as.validate(ticket, null);
as.validate(ticket);
as.invalidateUserSession("andy");
try
{
as.validate(ticket, null);
as.validate(ticket);
fail();
}
catch (AuthenticationException e)

View File

@ -278,7 +278,7 @@ public class TestAuthenticationServiceImpl implements MutableAuthenticationServi
userToTicket.remove(userName);
}
public void invalidateTicket(String ticket, String sessionId) throws AuthenticationException
public void invalidateTicket(String ticket) throws AuthenticationException
{
String userToRemove = null;
for (String user : userToTicket.keySet())
@ -296,7 +296,7 @@ public class TestAuthenticationServiceImpl implements MutableAuthenticationServi
}
public void validate(String ticket, String sessionId) throws AuthenticationException
public void validate(String ticket) throws AuthenticationException
{
String userToSet = null;
for (String user : userToTicket.keySet())
@ -319,12 +319,6 @@ public class TestAuthenticationServiceImpl implements MutableAuthenticationServi
}
public String getCurrentTicket()
{
return getCurrentTicket(null);
}
// TODO: Fix this up
public String getCurrentTicket(String sessionId)
{
String currentUser = getCurrentUserName();
String ticket = userToTicket.get(currentUser);
@ -336,7 +330,7 @@ public class TestAuthenticationServiceImpl implements MutableAuthenticationServi
return ticket;
}
public String getNewTicket(String sessionId)
public String getNewTicket()
{
String currentUser = getCurrentUserName();
String ticket = userToTicket.get(currentUser);

View File

@ -90,56 +90,37 @@ public interface AuthenticationService
@Auditable(parameters = {"userName"})
public void invalidateUserSession(String userName) throws AuthenticationException;
/**
* Invalidate a single ticket by ID or remove its association with a given session ID.
*
* @param sessionId
* the app server session ID (e.g. HttpSession ID) or <code>null</code> if not applicable.
* @throws AuthenticationException
*/
@Auditable(parameters = {"ticket", "sessionId"}, recordable = {false, false})
public void invalidateTicket(String ticket, String sessionId) throws AuthenticationException;
/**
* Invalidate a single ticket by ID
*
* @param ticket
* @throws AuthenticationException
*/
@Auditable(parameters = {"ticket"}, recordable = {false})
public void invalidateTicket(String ticket) throws AuthenticationException;
/**
* Validate a ticket. Set the current user name accordingly.
*
* @param ticket
* @throws AuthenticationException
*/
@Auditable(parameters = {"ticket"}, recordable = {false})
public void validate(String ticket) throws AuthenticationException;
/**
* Validate a ticket and associate it with a given app server session ID. Set the current user name accordingly.
*
* @param ticket
* @param sessionId
* the app server session ID (e.g. HttpSession ID) or <code>null</code> if not applicable.
* @throws AuthenticationException
*/
@Auditable(parameters = {"ticket", "sessionId"}, recordable = {false, false})
public void validate(String ticket, String sessionId) throws AuthenticationException;
/**
* Gets the current ticket as a string. If there isn't an appropriate current ticket, a new ticket will be made the
* current ticket.
*
* @param sessionId
* the app server session ID (e.g. HttpSession ID) or <code>null</code> if not applicable. If non-null,
* the ticket returned is either a new one or one previously associated with the same sessionId by
* {@link #validate(String, String)} or {@link #getCurrentTicket(String)}.
* @return the current ticket as a string
*/
@Auditable(parameters = {"sessionId"}, recordable = {false})
public String getCurrentTicket(String sessionId);
/**
* Gets the current ticket as a string. If there isn't an appropriate current ticket, a new ticket will be made the
* current ticket.
*
* @return the current ticket as a string
* Get the current ticket as a string
* @return
*/
@Auditable
public String getCurrentTicket();
/**
* Get a new ticket as a string
* @param sessionId
* the app server session ID (e.g. HttpSession ID) or <code>null</code> if not applicable.
* @return
*/
@Auditable(parameters = {"sessionId"}, recordable = {false})
public String getNewTicket(String sessionId);
@Auditable
public String getNewTicket();
/**
* Remove the current security information