wt.ownership
Class StandardOwnershipService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.ownership.StandardOwnershipService
All Implemented Interfaces:
Manager, NetFactor, OwnershipService, OwnershipServiceSvr, Serializable

public class StandardOwnershipService
extends StandardManager
implements OwnershipService, OwnershipServiceSvr, Serializable

Server implementation of the OwnershipService capability.

Use the newStandardOwnershipService static factory method(s), not the StandardOwnershipService 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: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private static boolean DEBUG
           
private static String RESOURCE
           
private static boolean VERBOSE
           
 
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
StandardOwnershipService()
           
 
Method Summary
 Ownable assignOwnership(Ownable obj, WTPrincipal principal)
          Assign the ownership of an object to a specific principal (user or group).
 WTCollection assignOwnership(WTCollection objs, WTPrincipal principal)
          Assign the ownership of objects to a specific principal (user or group).
 void changeOwner(Ownable obj, WTPrincipal principal, boolean commit_change)
          Replace the Owner of an object.
 void changeOwnership(WTCollection objs, WTPrincipal principal, boolean commit_change)
          Replace the Owner of the specified objects.
protected  void dispatchVetoableMultiObjectEvent(String eventType, WTCollection objs, Ownership new_ownership, boolean commit)
          

Supported API: false
 String getConceptualClassname()
          Deprecated.  
static StandardOwnershipService newStandardOwnershipService()
          Default factory for the class.
protected  void performStartupProcess()
          Override StandardManager to supply startup method.
protected  void processFullRestoreEvent(Ownable target)
          

Supported API: false
 void registerEvents(ManagerService ms)
          Register events with the passed ManagerService.
 Ownable releaseOwnership(Ownable obj)
          Release the ownership of an Ownable object.
 WTCollection releaseOwnership(WTCollection objs)
          Release the ownership of Ownable objects.
 void replaceOwnership(Ownable from, Ownable to, boolean commit_change)
          Give one Ownable object the same ownership as another.
 void replaceOwnership(Ownable from, WTCollection tos)
          Give Ownable objects the same ownership as another.
private  void replaceOwnership(Ownership new_ownership, Ownable object, boolean commit_change)
           
private  void replaceOwnership(Ownership new_ownership, WTCollection objects, boolean commit_change)
           
 Ownable takeOwnership(Ownable obj)
          Take over the ownership of an Ownable object.
 WTCollection takeOwnership(WTCollection objs)
          Take over the ownership of Ownable objects.
private  WTCollection updateOwnership(WTCollection objects, Ownership new_ownership)
           
 
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

DEBUG

private static final boolean DEBUG

VERBOSE

private static final boolean VERBOSE
Constructor Detail

StandardOwnershipService

public StandardOwnershipService()
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

dispatchVetoableMultiObjectEvent

protected void dispatchVetoableMultiObjectEvent(String eventType,
                                                WTCollection objs,
                                                Ownership new_ownership,
                                                boolean commit)
                                         throws WTException


Supported API: false

Parameters:
eventType -
objs -
new_ownership -
commit -
Throws:
WTException

processFullRestoreEvent

protected void processFullRestoreEvent(Ownable target)
                                throws WTException


Supported API: false

Parameters:
target -
Throws:
WTException

replaceOwnership

public void replaceOwnership(Ownable from,
                             WTCollection tos)
                      throws WTException,
                             OwnershipException
Give Ownable objects the same ownership as another. This will commit the change to the database.

Supported API: false

Parameters:
from -
tos -
Throws:
WTException
OwnershipException

newStandardOwnershipService

public static StandardOwnershipService newStandardOwnershipService()
                                                            throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardOwnershipService
Throws:
WTException

assignOwnership

public Ownable assignOwnership(Ownable obj,
                               WTPrincipal principal)
                        throws WTException
Assign the ownership of an object to a specific principal (user or group). Ownership may only be assigned for an object that is not currently owned. Returns the now owned object. This operation is for use on objects that have already been persisted in the database. To assign the owner to an object prior to it being stored in the database, use the OwnershipHelper.setOwner() method. You can only assign the ownership of an object if you have administrative rights to the object.

Supported API: false

Specified by:
assignOwnership in interface OwnershipService
Parameters:
obj -
principal -
Returns:
Ownable
Throws:
WTException
See Also:
OwnershipHelper

takeOwnership

public Ownable takeOwnership(Ownable obj)
                      throws WTException
Take over the ownership of an Ownable object. This is equivalent to an assignOwnership, but with specifying the current session principal. Ownership may only be taken for an object that is not currently owned. Returns the now owned object. This operation is for use on objects that have already been persisted in the database. To take ownership of an object prior to it being stored in the database, use the OwnershipHelper.setOwner() method. You can only take the ownership of an object if you have administrative rights to the object.

Supported API: false

Specified by:
takeOwnership in interface OwnershipService
Parameters:
obj -
Returns:
Ownable
Throws:
WTException
See Also:
OwnershipHelper, SessionMgr

releaseOwnership

public Ownable releaseOwnership(Ownable obj)
                         throws WTException
Release the ownership of an Ownable object. This disassociates the Ownable object with it's current owner, making the object unowned. Returns the now un-owned object. This operation is for use on objects that have already been persisted in the database. To release ownership of an object prior to it being stored in the database, use the OwnershipHelper.setOwner() method. You can only release the ownership of an object you own or if you have administrative rights to the object.

Supported API: false

Specified by:
releaseOwnership in interface OwnershipService
Parameters:
obj -
Returns:
Ownable
Throws:
WTException
See Also:
OwnershipHelper

assignOwnership

public WTCollection assignOwnership(WTCollection objs,
                                    WTPrincipal principal)
                             throws WTException
Assign the ownership of objects to a specific principal (user or group). Ownership may only be assigned for objects that are not currently owned. Returns the now owned objects. This operation is for use on objects that have already been persisted in the database. To assign the owner to an object prior to it being stored in the database, use the OwnershipHelper.setOwner() method. You can only assign the ownership of an object if you have administrative rights to the object.

Supported API: false

Specified by:
assignOwnership in interface OwnershipService
Parameters:
objs -
principal -
Returns:
WTCollection
Throws:
WTException
See Also:
OwnershipHelper

takeOwnership

public WTCollection takeOwnership(WTCollection objs)
                           throws WTException
Take over the ownership of Ownable objects. This is equiavlent to an assignOwnership, but with specifying the current session principal. Ownership may only be taken for objects that are not currently owned. Returns the now owned objects. This operation is for use on objects that have already been persisted in the database. To take ownership of an object prior to it being stored in the database, use the OwnershipHelper.setOwner() method. You can only take the ownership of an object if you have administrative rights to the object.

Supported API: false

Specified by:
takeOwnership in interface OwnershipService
Parameters:
objs -
Returns:
WTCollection
Throws:
WTException
See Also:
OwnershipHelper, SessionMgr

releaseOwnership

public WTCollection releaseOwnership(WTCollection objs)
                              throws WTException
Release the ownership of Ownable objects. This disassociates the Ownable objects with their current owner, making the objects unowned. Returns the now un-owned objects. This operation is for use on objects that have already been persisted in the database. To release ownership of an object prior to it being stored in the database, use the OwnershipHelper.setOwner() method. You can only release the ownership of an object you own or if you have administrative rights to the object.

Supported API: false

Specified by:
releaseOwnership in interface OwnershipService
Parameters:
objs -
Returns:
WTCollection
Throws:
WTException
See Also:
OwnershipHelper

replaceOwnership

public void replaceOwnership(Ownable from,
                             Ownable to,
                             boolean commit_change)
                      throws WTException,
                             OwnershipException
Give one Ownable object the same ownership as another. Optionally this can commit the change to the database. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
replaceOwnership in interface OwnershipServiceSvr
Parameters:
from -
to -
commit_change -
Throws:
WTException
OwnershipException

changeOwner

public void changeOwner(Ownable obj,
                        WTPrincipal principal,
                        boolean commit_change)
                 throws WTException,
                        OwnershipException
Replace the Owner of an object. Optionally this will commit the change to the database. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
changeOwner in interface OwnershipServiceSvr
Parameters:
obj -
principal -
commit_change -
Throws:
WTException
OwnershipException

changeOwnership

public void changeOwnership(WTCollection objs,
                            WTPrincipal principal,
                            boolean commit_change)
                     throws WTException,
                            OwnershipException
Replace the Owner of the specified objects. Optionally this will commit the change to the database. This method provides low level access to the database and bypasses access control operations.

Supported API: false

Specified by:
changeOwnership in interface OwnershipServiceSvr
Parameters:
objs -
principal -
commit_change -
Throws:
WTException
OwnershipException

performStartupProcess

protected void performStartupProcess()
                              throws ManagerException
Override StandardManager to supply startup method.

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

registerEvents

public void registerEvents(ManagerService ms)
Register events with the passed ManagerService.

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

replaceOwnership

private void replaceOwnership(Ownership new_ownership,
                              WTCollection objects,
                              boolean commit_change)
                       throws WTException,
                              OwnershipException
Throws:
WTException
OwnershipException

replaceOwnership

private void replaceOwnership(Ownership new_ownership,
                              Ownable object,
                              boolean commit_change)
                       throws WTException,
                              OwnershipException
Throws:
WTException
OwnershipException

updateOwnership

private WTCollection updateOwnership(WTCollection objects,
                                     Ownership new_ownership)
                              throws WTException,
                                     OwnershipException
Throws:
WTException
OwnershipException