wt.fc
Class StandardIdentityService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.fc.StandardIdentityService
All Implemented Interfaces:
IdentityService, Manager, NetFactor, Serializable

public class StandardIdentityService
extends StandardManager
implements IdentityService, Serializable

Standard implementation of the identity service. Provides means to change the identity of an Identified object as well identity checks for the creation of these objects.

Use the newStandardIdentityService static factory method(s), not the StandardIdentityService constructor, to construct instances of this class. Instances must be constructed using the static factory(s), in order to ensure proper initialization of the instance.



Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static String RESOURCE
           
private static String SEMANTIC_KEY_UNIQUELY_IDENTIFIED_REF
           
 
Fields inherited from class wt.services.StandardManager
 
Fields inherited from interface wt.services.Manager
MANAGER_SERVICE, STARTUP_AUTOMATIC, STARTUP_MANUAL, STATUS_EMERGENCY_SHUTDOWN, STATUS_EMERGENCY_SHUTTING_DOWN, STATUS_SHUTDOWN, STATUS_SHUTDOWN_ERRORS, STATUS_SHUTDOWN_FAILURE, STATUS_SHUTTING_DOWN, STATUS_STARTED, STATUS_STARTED_ERRORS, STATUS_STARTING_UP, STATUS_STARTUP_FAILURE
 
Constructor Summary
StandardIdentityService()
           
 
Method Summary
 WTCollection changeIdentities(WTKeyedMap identifiedToIdentificationObjectMap)
          Changes the identities of all the Identied objects (the keys) to the ones of the IdentificationObjects (the values).
 Identified changeIdentity(Identified obj, IdentificationObject identity)
          Changes the identity of the object to the one held by the Identification object.
 Master changeMasterIdentity(Master master, String name, String number, WTOrganization org)
          Change the Mastered object identity with the new name, number and organization.
protected  void deleteSemanticKeys(WTCollection uniquelyIdentifieds)
           
private  void dispatchVetoableMultiObjectEvent(IdentityServiceEvent event)
           
 String getConceptualClassname()
          Deprecated.  
static StandardIdentityService newStandardIdentityService()
          Default factory for the class.
protected  void performStartupProcess()
          Identity service startup process which consists of subscription to the creation/deletion persistence manager events.
 void registerEvents(ManagerService managerService)
          Register PRE-/POST_CHANGE_IDENTITY.
protected  void storeSemanticKeys(WTCollection uniquelyIdentifieds)
           
 
Methods inherited from class wt.services.StandardManager
emergencyShutdown, emergencyShutdownComplete, emergencyShuttingDown, getClassInfo, getManagerService, getManagerStatus, getName, getStartupType, init, initialize, initialize, isStarted, newStandardManager, newStandardManager, performEmergencyShutdownProcess, performShutdownProcess, setManagerService, shutdown, shutdownFailure, shutdownSuccess, shuttingDown, started, startedErrors, startingUp, startup, startupFailure, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

SEMANTIC_KEY_UNIQUELY_IDENTIFIED_REF

private static final String SEMANTIC_KEY_UNIQUELY_IDENTIFIED_REF
See Also:
Constant Field Values
Constructor Detail

StandardIdentityService

public StandardIdentityService()
Method Detail

getConceptualClassname

public String getConceptualClassname()
Deprecated.  

Returns the conceptual (modeled) name for the class.

Supported API: false

Specified by:
getConceptualClassname in interface NetFactor
Overrides:
getConceptualClassname in class StandardManager
Returns:
String

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Identity service startup process which consists of subscription to the creation/deletion persistence manager events.

Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

registerEvents

public void registerEvents(ManagerService managerService)
Register PRE-/POST_CHANGE_IDENTITY.

Supported API: false

Specified by:
registerEvents in interface Manager
Overrides:
registerEvents in class StandardManager
Parameters:
managerService - the ManagerService with which to register events.

newStandardIdentityService

public static StandardIdentityService newStandardIdentityService()
                                                          throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardIdentityService
Throws:
WTException

changeIdentity

public Identified changeIdentity(Identified obj,
                                 IdentificationObject identity)
                          throws WTException
Changes the identity of the object to the one held by the Identification object. The identity change is performed after identity constraints have been checked (including uniqueness constraints). The change is performed as a single operation, even if the identity is composed of several attributes.

Supported API: true

Specified by:
changeIdentity in interface IdentityService
Parameters:
obj -
identity -
Returns:
Identified
Throws:
WTException

changeIdentities

public WTCollection changeIdentities(WTKeyedMap identifiedToIdentificationObjectMap)
                              throws WTException
Changes the identities of all the Identied objects (the keys) to the ones of the IdentificationObjects (the values). Checks the validity of the changes including uniqueness constraints. If the changes are allowed, performs them and saves the changed objects in the database. Returns the changed objects or throws an exception if the change is not allowed. Posts PRE and POST change identity events.

Supported API: true

Specified by:
changeIdentities in interface IdentityService
Parameters:
identifiedToIdentificationObjectMap -
Returns:
WTCollection
Throws:
WTException

changeMasterIdentity

public Master changeMasterIdentity(Master master,
                                   String name,
                                   String number,
                                   WTOrganization org)
                            throws WTPropertyVetoException,
                                   UniquenessException,
                                   WTException
Change the Mastered object identity with the new name, number and organization.

Supported API: false

Specified by:
changeMasterIdentity in interface IdentityService
Parameters:
master -
name -
number -
org -
Returns:
Master
Throws:
WTPropertyVetoException
UniquenessException
WTException

storeSemanticKeys

protected void storeSemanticKeys(WTCollection uniquelyIdentifieds)
                          throws WTException
Throws:
WTException

deleteSemanticKeys

protected void deleteSemanticKeys(WTCollection uniquelyIdentifieds)
                           throws WTException
Throws:
WTException

dispatchVetoableMultiObjectEvent

private void dispatchVetoableMultiObjectEvent(IdentityServiceEvent event)
                                       throws WTException
Throws:
WTException