wt.inf.sharing
Class StandardDataSharingService

java.lang.Object
  extended bywt.services.StandardManager
      extended bywt.inf.sharing.StandardDataSharingService
All Implemented Interfaces:
DataSharingService, DataSharingServiceSvr, Manager, NetFactor, Serializable

public class StandardDataSharingService
extends StandardManager
implements DataSharingService, DataSharingServiceSvr, Serializable

Use the newStandardDataSharingService static factory method(s), not the StandardDataSharingService 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 CABINET_CLASS_NAME
           
private static int CHUNK_SIZE
           
private static String CLASSNAME
           
private  DataSharingDelegateFactory delegateFactory
          Variable pointing to a singleton instance of the DataSharingDelegateFactory.
private  Map excludesCache
           
protected static Object FOLDER_SHARE_ACCESS_KEY
           
private static int IN_PERSONAL_CABINET
           
private static String MOVE_EVENT_CLASS_NAME
           
private static String MOVE_EVENT_NAME
           
private static String OBJECT_BRANCH_ID
           
private static int OBJECT_MODE
           
private static int OBJECT_NOT_SHAREABLE
           
private static int OBJECT_SHAREABLE
           
private static String RESOURCE
           
private static String SHARE_TABLE_NAME
           
private static String SHARED_OBJECT_ID
           
private static String SHARED_OBJECT_KEY
           
private static String SHARED_VERSION_ID
           
private static int SHARING_NOT_ENABLED
           
private static int SHARING_QUEUE_INTERVAL
           
private static String SHARING_QUEUE_NAME
           
private  ProcessingQueue sharingQueue
           
private static String SOURCE_CONTAINER_KEY
           
private static StructureSharingDelegateFactory structDelegateFactory
          Variable pointing to a singleton instance of the StructureSharingDelegateFactory.
private static String SUB_FOLDER_CLASS_NAME
           
private static String TARGET_CONTAINER_KEY
           
private static String TARGET_FOLDER_ID
           
private static String TARGET_FOLDER_KEY
           
private static boolean USE_QUEUE
           
private static boolean VERBOSE
           
private static int VERSION_MODE
           
 
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
StandardDataSharingService()
           
 
Method Summary
private  void addEnabledClause(QuerySpec qs, int enabled_status, int index)
          Adds a clause to the query spec that restricts the maps returned to those with the same status as the one passed as argument.
private  void addObjectClause(QuerySpec qs, Object object)
          Adds a clause to the query spec that restricts the maps returned to those that reference the object passed as argument.
private  void addShareKeyClause(QuerySpec qs, long share_key)
          Adds a clause to the query spec that restricts the maps returned to those with the same status as the one passed as argument.
private  void addSourceContainerClause(QuerySpec qs, WTContainerRef container_ref)
          Adds a clause to the query spec that restricts the maps returned to those for which the source container is the one passed as argument as an container reference.
private  void addTargetContainerClause(QuerySpec qs, WTContainerRef container_ref, int index)
          Adds a clause to the query spec that restricts the maps returned to those for which the target container is the one passed as argument as an container reference.
private  void appendAnd(QuerySpec qs)
          Returns object's identification (name) for debugging purposes
private  void appendJoin(QuerySpec qs, Class link_class, Class role_a_class, Class role_b_class, int lnk_indx, int a_indx, int b_indx)
           
private  String asString(char c)
           
 SharedContainerMap checkDuplicate(Persistable object, WTContainerRef to_container_ref, Folder to_folder, boolean is_version)
          Checks if the object has been shared to the container to the folder passed as argument for the same type of sharing.
 void checkIncompatibleDuplicate(Persistable object, WTContainerRef to_container_ref, Folder to_folder)
          Checks whether the new share is compatible with existing shares of the same object to the same target container.
private  void checkValidOp(SharedContainerMap map, String operation_key)
          Checks if the map is safe for a disable/enable/remove operation.
private  void checkValidShare(Persistable object, WTContainerRef to_container_ref, Folder to_folder)
          Throws exception if the sharing of an object to a container/folder is not valid.
private  boolean containsVersion(WTCollection unresolvedIteratedProjectShareRefs, long branchId)
           
private static SharedContainerMap copy(SharedContainerMap map, Persistable object)
           
private  WTArrayList copyFolderShares(List share_list, Persistable object, ObjectReference folder_ref)
          Copies shares to the object passed as argument.
private  WTArrayList copyFolderShares(WTCollection folder_shares, HashMap object_map, HashMap folder_map, WTHashSet changed_objects)
          Copies shares to the objects in the object map passed as argument.
 WTContainer disableContainerSharing(WTContainer container)
          Disables data sharing in which the wt.inf.WTContainer passed as argument is the source of the data to be shared.
private  Persistable disableMap(SharedContainerMap map)
          Disables a given map.
 void disableShare(Persistable object, WTContainerRef container_ref)
          Disables all wt,inf.sharing.SharedContainerMap for the target object and target container pased as arguments.
 void disableShare(SharedContainerMap map)
          Disables all wt,inf.sharing.SharedContainerMap with the same key and target container as the one passed as argument.
 void emitSharingEvent(String event_type, WTCollection map_list)
          Emits data sharing event.
 WTContainer enableContainerSharing(WTContainer container)
          Enables data sharing in which the wt.inf.WTContainer passed as argument is the source of the data to be shared.
private  Persistable enableMap(SharedContainerMap map)
          Enables a given map.
 void enableShare(Persistable object, WTContainerRef container_ref)
          Enables all wt,inf.sharing.SharedContainerMap for the target object and target container pased as arguments.
 void enableShare(SharedContainerMap map)
          Enables all wt,inf.sharing.SharedContainerMap with the same key and target container as the one passed as argument.
private  WTCollection getAllProjectShares(WTCollection shares)
          Returns a List of all shares to Project.
 WTCollection getAllShareMaps(WTCollection objects, WTContainerRef container_ref, int enabled_status)
          Returns the object and version share maps for the collection of object and target container passed as parameter in the given sharing state (enabled/disabled).
private  HashMap getCheckedOut(WTContainerRef container_ref)
           
private  long[] getChunkedIds(long[] id_array, int n_chunks, int i)
           
 QueryResult getClassObjects(Class obj_class, WTContainerRef container_ref)
          Gets all objects of the given class to the container passed as argument.
 String getConceptualClassname()
          Deprecated.  
private  WTCollection getConflictResolution(WTCollection allProjectShares, SharingConflictType conflictType)
          Returns a List of all shares to Project.
 QueryResult getContainerMaps(WTContainerRef from_container_ref, WTContainerRef to_container_ref, int enabled_status)
          Given a target container, returns all the objects shared by the container.
protected  ProcessingQueue getDataSharingQueue()
          

Supported API: false
private  QuerySpec getFolderContentQS(Folder folder, ConfigSpec config_spec, Class obj_class)
           
private static List getFolderContents(Folder folder, HashMap content_map)
          Returns the contents of the folder and subfolders.
private  QueryResult getFolderMapChunk(long[] folder_id__array)
           
private  WTArrayList getFolderMaps(Persistable object, ObjectReference folder_ref)
          Returns a list with all maps associated for the object and folder passed as argument.
private  HashMap getFolderShareMap(WTCollection folder_shares)
           
private static long getId(Object object)
          Returns object's id.
private  long[] getKeyArray(WTCollection maps)
           
private  QueryResult getKeyMapChunk(long[] key_array)
           
 QueryResult getKeyMaps(long share_key, WTContainerRef container_ref, int enabled_status)
          Returns all sharing maps that have the key passed as argument.
private  WTCollection getKeyMaps(WTCollection maps)
          Returns all maps with the same key as one of the maps passed as argument.
private  List getList(Object object)
          Returns a list with the object passed as argument.
private  QueryResult getMapChunk(long[] ver_id_array, long[] obj_id_array, WTContainerRef container_ref, int enabled_status)
           
 QueryResult getMaps(WTContainerRef container_ref, boolean not_checked_out)
          Returns all enabled maps (SharedContainerMap) for which the target share is the container whose reference is passed as argument.
private static Persistable getObject(ObjectIdentifier obj_id)
          Retrieves object given its object identifier.
 SharedContainerMap getObjectKeyMap(long share_key, Persistable object, int enabled_status)
          Returns the map for a given key, object and sharing status.
 QueryResult getObjectMaps(Object object, WTContainerRef container_ref, int enabled_status)
          Returns sharing map for the object and container passed as parameter if it is in the given sharing state (enabled/disabled).
private  String getObjectName(Object object)
          Returns object's identification (name) for debugging purposes
 WTCollection getObjectShareMaps(WTCollection objects, WTContainerRef container_ref, int enabled_status)
          Returns the object share maps for the collection of object and target container passed as parameter in the given sharing state (enabled/disabled).
private  SearchCondition getObjSc(ObjectIdentifier oid)
          Returns the search condition for a given object or object's iteration.
static ObjectIdentifier getOid(Object object)
          Returns object's associated oid.
static String getOidString(Object object)
          Returns String representation of the object's oid (debugging).
private  WTCollection getOriginalObjects(WTCollection unresolvedProjectShareRefs, WTCollection originalObjects)
          Returns a List of all shares to Project.
private  WTCollection getRefs(WTCollection unresolvedProjectShares)
          Returns a List of all shares to Project.x
private  int getShareableState(Persistable object)
           
 SortedEnumeration getSharedFolderContents(Folder folder)
          Returns shared contents given a folder.
 WTCollection getSharedFolderContents(Folder folder, ConfigSpec config_spec, Class[] obj_classes)
          Returns shared folder content given a Folder and a {@link wt.config.ConfigSpec).
 WTCollection getSharedObjects(WTCollection objects, WTContainerRef container_ref)
          Returns a WTCollection of objects contained in the collection passed as argument and are shared to a container, given its reference.
 long getShareKey(Persistable object, WTContainerRef to_container_ref)
          Returns the share key for the object and container passed as arguments.
private  WTArrayList getTargetFolderMaps(WTKeyedMap folder_map)
          Returns all shares such that the target folder has the oid passed as argument.
private  WTValuedMap getTargetFolderPairs(Persistable target, ObjectReference folder_ref)
           
private  SearchCondition getVerSc(long branch_id)
          Returns the search condition for a given object's version.
 WTCollection getVersionShareMaps(WTCollection objects, WTContainerRef container_ref, int enabled_status)
          Returns the version share maps for the collection of object and target container passed as parameter in the given sharing state (enabled/disabled).
 boolean isShareable(Persistable object)
          Determines if the Persistable can be shared.
 boolean isSharedTo(Persistable object, WTContainerRef container_ref)
          Determines if the object is shared to the container whose reference is passed as argument.
private  boolean isValidOp(SharedContainerMap map, String operation_key)
          Returns true if operation is valid, 'false' otherwise.
private  void markSharesForDelete(WTContainer container)
          Marks for delete all shares that reference container passed as argument.
private  void moveAclEntries(AdHocControlled object1, Persistable object2, long owner_id)
          Removes all ACL entries from object1 with the key passed as argument.
static StandardDataSharingService newStandardDataSharingService()
          Default factory for the class.
private  boolean noShares()
           
protected  void performStartupProcess()
          

Supported API: false
private  SharedContainerMap populateAttributes(SharedContainerMap map, Persistable object, WTContainerRef to_container_ref, Folder to_folder, long share_key, int share_type)
          Populates the attributes of a SharedContainedMap passed as argument.
private  void processCheckInEvent(WTKeyedMap object_map)
          Processes multi-object check in event.
static void processCheckInStructEvent(String obj_class_name, ObjectIdentifier obj_id)
          Calls structure delegate to process a check in event.
private  void processContainerMoveEvent(WTCollection objects)
          Update the source container reference on any SharedContainerMaps that refer to the moved object
static void processCreateLinkEvent(String link_class_name, ObjectIdentifier link_id)
          Calls structure delegate to process a store event in which a link is created.
private  void processCreateObjectEvent(WTCollection objects)
          Processes object creation.
static void processDeleteLinkEvent(String link_class_name, QueryKey roleA_id, QueryKey roleB_id)
          Calls structure delegate to process a store event in which a binary link is deleted.
private  void processDeleteObjectEvent(WTCollection objects)
          Processes object deletion.
private  void processExcludes(QuerySpec qs, int from_index)
           
private  void processFolderChangeEvent(FolderServiceEvent folder_event)
          Processes folder change events.
private  void processFolderChangeMaps(WTValuedMap target_folder_map, List dest_list, WTArrayList added_maps, WTArrayList removed_maps)
          Called from processFolderChangeEvent().
private  void queueMethodCall(String method_name, Class[] arg_types, Object[] args)
          Queues a call to the method whose's name is passed as argument.
private  void registerAsListener()
          Register as listener to the following events: POST_MARK_FOR_DELETE POST_RESTORE_MARK_FOR_DELETE POST_CHANGE_FOLDER POST_STORE POST_DELETE POST_CHECKIN
 void registerEvents(ManagerService service)
          

Supported API: false
private  void removeContainerEntries(AdHocControlled object, long container_id, IterationIdentifier iter_id, WTCollection objects)
          Removes all entries in the object due to the sharing from the container passed as argument.
private  void removeMap(SharedContainerMap map)
          Removes a given map.
 void removeShare(Persistable object, WTContainerRef container_ref)
          Removes all wt,inf.sharing.SharedContainerMap for the target object and target container pased as arguments.
 void removeShare(SharedContainerMap map)
          Removes all wt,inf.sharing.SharedContainerMap with the same key and target container as the one passed as argument.
 void removeShares(List shares)
          Removes all wt,inf.sharing.SharedContainerMap contained in the list passed as argument.
 void removeShares(WTCollection shares)
          Removes all wt,inf.sharing.SharedContainerMap contained in the collection passed as argument.
private  void restoreShares(WTContainer container)
          Restores all shares marked for delete that reference container passed as argument.
private  boolean sameIterId(Iterated object, IterationIdentifier iter_id)
          Determines whether the iteration identifier of an Iterated object is the same as one passed as argument.
 SharedContainerMap setAccessControl(SharedContainerMap map, WTContainer container, Persistable object)
          Sets ad hoc access control to the map and object passed as argument.
 SharedContainerMap setAccessControl(SharedContainerMap map, WTContainer container, Persistable object, Folder to_folder)
           
private  WTCollection shareableCollection(WTCollection objects)
          Returns a List from a QueryResult.
 SharedContainerMap shareFolder(Folder folder, WTContainerRef to_container_ref, Folder to_folder)
          Share the folder passed as argument and all contained objects ("folder set").
 SharedContainerMap shareObject(Persistable object, WTContainerRef to_container_ref, Folder to_folder)
          Shares an object given the target container and the target folder.
 QueryResult shareObjectList(List objects, WTContainerRef to_container_ref, Folder to_folder)
          Share a list of objects given the target container and the target folder.
private  WTArrayList shareObjectSet(List objects, WTContainerRef to_container_ref, Folder to_folder, long share_key, int share_type, int mode)
          Shares a set of objects given in a list.
private  SharedContainerMap sharePersistable(Persistable object, WTContainerRef to_container_ref, Folder to_folder, long share_key, int share_type)
          Shares an individual object.
 SharedContainerMap shareStructure(Persistable struct_handle, WTContainerRef to_container_ref, Folder to_folder)
          Shares a structure through the handle passed as argument.
 SharedContainerMap shareVersion(Persistable object, WTContainerRef to_container_ref, Folder to_folder)
          Shares an object given the target container and the target folder.
private  SharedContainerMap shareVersion(Persistable object, WTContainerRef to_container_ref, Folder to_folder, long share_key, int share_type)
          Shares an individual object.
 QueryResult shareVersionList(List objects, WTContainerRef to_container_ref, Folder to_folder)
          Share a list of objects given the target container and the target folder.
 WTCollection shareVersions(WTCollection objects, WTContainerRef to_container_ref, Folder to_folder)
          Shares a WTCollection given the target container and the target folder.
private  HashMap shareVersionSet(List objects, WTContainerRef to_container_ref, Folder to_folder, long share_key, int share_type)
          Shares a set of objects.
private  String showAdHocAcl(AdHocControlled object)
          Shows ad hoc ACL.
private static String showCollection(Collection collection)
          Returns String representation of the list passed as argument (debugging).
private static String showIds(long[] ids)
           
private  String showMap(SharedContainerMap map)
          Returns String representtaion of a SharedContainerMap for debugging purposes
private  String showShareType(int share_type)
          Returns a readable representation of the share type.
private  void sortFolders(List folders)
           
 void switchShare(Persistable object1, WTContainerRef container_ref, Persistable object2)
          Replaces an object for another in a share map for a given target container.
private static List toList(QueryResult qr)
          Returns a List from a QueryResult.
private static QueryResult toQueryResult(WTArrayList wt_list)
          Returns a QueryResult of Persistables from a WTCollection.
private  long[] toVersionIdArray(WTCollection objects)
          Returns an array of version ids from the objects passed as argument.
private static WTArrayList toWTArrayList(Persistable object)
          Returns a WTCollection with a single persistable.
private static WTArrayList toWTArrayList(QueryResult qr)
          Returns a WTCollection from a QueryResult consisting only of persistables.
 void undoShares(WTCollection objects, WTContainerRef container_ref)
          Removes all the object and version share maps for the collection of objects and target container passed as parameters in either sharing state.
 
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

delegateFactory

private final DataSharingDelegateFactory delegateFactory
Variable pointing to a singleton instance of the DataSharingDelegateFactory.


structDelegateFactory

private static final StructureSharingDelegateFactory structDelegateFactory
Variable pointing to a singleton instance of the StructureSharingDelegateFactory.


SHARING_QUEUE_NAME

private static final String SHARING_QUEUE_NAME
See Also:
Constant Field Values

sharingQueue

private ProcessingQueue sharingQueue

VERBOSE

private static final boolean VERBOSE

SUB_FOLDER_CLASS_NAME

private static final String SUB_FOLDER_CLASS_NAME

CABINET_CLASS_NAME

private static final String CABINET_CLASS_NAME

SHARE_TABLE_NAME

private static final String SHARE_TABLE_NAME

SHARING_QUEUE_INTERVAL

private static final int SHARING_QUEUE_INTERVAL

USE_QUEUE

private static final boolean USE_QUEUE

OBJECT_MODE

private static final int OBJECT_MODE
See Also:
Constant Field Values

VERSION_MODE

private static final int VERSION_MODE
See Also:
Constant Field Values

CHUNK_SIZE

private static final int CHUNK_SIZE

excludesCache

private Map excludesCache

OBJECT_SHAREABLE

private static final int OBJECT_SHAREABLE
See Also:
Constant Field Values

OBJECT_NOT_SHAREABLE

private static final int OBJECT_NOT_SHAREABLE
See Also:
Constant Field Values

SHARING_NOT_ENABLED

private static final int SHARING_NOT_ENABLED
See Also:
Constant Field Values

IN_PERSONAL_CABINET

private static final int IN_PERSONAL_CABINET
See Also:
Constant Field Values

SHARED_OBJECT_KEY

private static final String SHARED_OBJECT_KEY
See Also:
Constant Field Values

SHARED_OBJECT_ID

private static final String SHARED_OBJECT_ID
See Also:
Constant Field Values

SHARED_VERSION_ID

private static final String SHARED_VERSION_ID
See Also:
Constant Field Values

TARGET_FOLDER_KEY

private static final String TARGET_FOLDER_KEY
See Also:
Constant Field Values

TARGET_FOLDER_ID

private static final String TARGET_FOLDER_ID
See Also:
Constant Field Values

TARGET_CONTAINER_KEY

private static final String TARGET_CONTAINER_KEY
See Also:
Constant Field Values

SOURCE_CONTAINER_KEY

private static final String SOURCE_CONTAINER_KEY
See Also:
Constant Field Values

OBJECT_BRANCH_ID

private static final String OBJECT_BRANCH_ID
See Also:
Constant Field Values

MOVE_EVENT_CLASS_NAME

private static final String MOVE_EVENT_CLASS_NAME
See Also:
Constant Field Values

MOVE_EVENT_NAME

private static final String MOVE_EVENT_NAME
See Also:
Constant Field Values

FOLDER_SHARE_ACCESS_KEY

protected static final Object FOLDER_SHARE_ACCESS_KEY
Constructor Detail

StandardDataSharingService

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


Supported API: false

Overrides:
performStartupProcess in class StandardManager
Throws:
ManagerException

getDataSharingQueue

protected ProcessingQueue getDataSharingQueue()
                                       throws WTException


Supported API: false

Returns:
ProcessingQueue
Throws:
WTException

processCheckInStructEvent

public static void processCheckInStructEvent(String obj_class_name,
                                             ObjectIdentifier obj_id)
                                      throws WTException
Calls structure delegate to process a check in event.

Supported API: false

Parameters:
obj_class_name -
obj_id -
Throws:
WTException

processDeleteLinkEvent

public static void processDeleteLinkEvent(String link_class_name,
                                          QueryKey roleA_id,
                                          QueryKey roleB_id)
                                   throws WTException
Calls structure delegate to process a store event in which a binary link is deleted. The ids of role A and role B objects are passed as argument, in addition to the deleted link.

Note:

Supported API: false

Parameters:
link_class_name -
roleA_id -
roleB_id -
Throws:
WTException

processCreateLinkEvent

public static void processCreateLinkEvent(String link_class_name,
                                          ObjectIdentifier link_id)
                                   throws WTException
Calls structure delegate to process a store event in which a link is created.

Supported API: false

Parameters:
link_class_name -
link_id -
Throws:
WTException

newStandardDataSharingService

public static StandardDataSharingService newStandardDataSharingService()
                                                                throws WTException
Default factory for the class.

Supported API: false

Returns:
StandardDataSharingService
Throws:
WTException

disableContainerSharing

public WTContainer disableContainerSharing(WTContainer container)
                                    throws WTException
Disables data sharing in which the wt.inf.WTContainer passed as argument is the source of the data to be shared. If the container has previously enabled data sharing, all the sharings are disabled.

Supported API: false

Specified by:
disableContainerSharing in interface DataSharingService
Parameters:
container -
Returns:
WTContainer
Throws:
WTException

disableShare

public void disableShare(SharedContainerMap map)
                  throws WTException
Disables all wt,inf.sharing.SharedContainerMap with the same key and target container as the one passed as argument.

Supported API: false

Specified by:
disableShare in interface DataSharingService
Parameters:
map -
Throws:
WTException

disableShare

public void disableShare(Persistable object,
                         WTContainerRef container_ref)
                  throws WTException
Disables all wt,inf.sharing.SharedContainerMap for the target object and target container pased as arguments. Disables both object and version shares.

NoteIf the share exists and is a COLLECTIVE, FOLDER or STRUCTURE share, then all related shares are disabled.

Supported API: false

Specified by:
disableShare in interface DataSharingService
Parameters:
object -
container_ref -
Throws:
WTException

enableContainerSharing

public WTContainer enableContainerSharing(WTContainer container)
                                   throws WTException
Enables data sharing in which the wt.inf.WTContainer passed as argument is the source of the data to be shared. If the container has previously disabled data sharing, all the sharings are re-enabled.

Supported API: false

Specified by:
enableContainerSharing in interface DataSharingService
Parameters:
container -
Returns:
WTContainer
Throws:
WTException

enableShare

public void enableShare(SharedContainerMap map)
                 throws WTException
Enables all wt,inf.sharing.SharedContainerMap with the same key and target container as the one passed as argument.

Supported API: false

Specified by:
enableShare in interface DataSharingService
Parameters:
map -
Throws:
WTException

enableShare

public void enableShare(Persistable object,
                        WTContainerRef container_ref)
                 throws WTException
Enables all wt,inf.sharing.SharedContainerMap for the target object and target container pased as arguments. Enables both object and version shares.

NoteIf the share exists and is a COLLECTIVE, FOLDER or STRUCTURE share, then all related shares are enabled.

Supported API: false

Specified by:
enableShare in interface DataSharingService
Parameters:
object -
container_ref -
Throws:
WTException

getClassObjects

public QueryResult getClassObjects(Class obj_class,
                                   WTContainerRef container_ref)
                            throws WTException
Gets all objects of the given class to the container passed as argument.

Supported API: false

Specified by:
getClassObjects in interface DataSharingService
Parameters:
obj_class -
container_ref -
Returns:
QueryResult
Throws:
WTException

getContainerMaps

public QueryResult getContainerMaps(WTContainerRef from_container_ref,
                                    WTContainerRef to_container_ref,
                                    int enabled_status)
                             throws WTException
Given a target container, returns all the objects shared by the container.

Supported API: false

Specified by:
getContainerMaps in interface DataSharingService
Parameters:
from_container_ref -
to_container_ref -
enabled_status -
Returns:
QueryResult
Throws:
WTException

getKeyMaps

public QueryResult getKeyMaps(long share_key,
                              WTContainerRef container_ref,
                              int enabled_status)
                       throws WTException
Returns all sharing maps that have the key passed as argument.

Supported API: false

Specified by:
getKeyMaps in interface DataSharingService
Parameters:
share_key -
container_ref -
enabled_status -
Returns:
QueryResult
Throws:
WTException

getMaps

public QueryResult getMaps(WTContainerRef container_ref,
                           boolean not_checked_out)
                    throws WTException
Returns all enabled maps (SharedContainerMap) for which the target share is the container whose reference is passed as argument. Maps for objects checked out to the container are not included if the value of the 'not_checked_out' argument is true. Otherwise all maps are returned.

Supported API: false

Specified by:
getMaps in interface DataSharingService
Parameters:
container_ref -
not_checked_out -
Returns:
QueryResult
Throws:
WTException

getObjectKeyMap

public SharedContainerMap getObjectKeyMap(long share_key,
                                          Persistable object,
                                          int enabled_status)
                                   throws WTException
Returns the map for a given key, object and sharing status. Returns 'null' if there is no such map.

Supported API: false

Specified by:
getObjectKeyMap in interface DataSharingService
Parameters:
share_key -
object -
enabled_status -
Returns:
SharedContainerMap
Throws:
WTException

getObjectMaps

public QueryResult getObjectMaps(Object object,
                                 WTContainerRef container_ref,
                                 int enabled_status)
                          throws WTException
Returns sharing map for the object and container passed as parameter if it is in the given sharing state (enabled/disabled). The integer constants indicating whether only enabled, only disabled or both kinds of shares are to be retruned are defined in DataSharingHelper. They are the following: The object passed as argument may be a Persistable, an object identifier or a Long. If a Persistable is passed as argument, both object and version shares are returned. If an ObjectIdentifier is passed as argument, only object shares are retuned. Finally, if a Long is passed as argument, only version shares are returned. The Long in question is interpreted as the branch id of the object.

Supported API: false

Specified by:
getObjectMaps in interface DataSharingService
Parameters:
object -
container_ref -
enabled_status -
Returns:
QueryResult
Throws:
WTException

getSharedFolderContents

public SortedEnumeration getSharedFolderContents(Folder folder)
                                          throws WTException
Returns shared contents given a folder. The output is a SortedEnumeration.

Supported API: false

Specified by:
getSharedFolderContents in interface DataSharingService
Parameters:
folder -
Returns:
SortedEnumeration
Throws:
WTException

getShareKey

public long getShareKey(Persistable object,
                        WTContainerRef to_container_ref)
                 throws WTException
Returns the share key for the object and container passed as arguments. Returns null if the object is not shared by the container or the share key is 'null.'

Supported API: false

Specified by:
getShareKey in interface DataSharingService
Parameters:
object -
to_container_ref -
Returns:
long
Throws:
WTException

isShareable

public boolean isShareable(Persistable object)
                    throws WTException
Determines if the Persistable can be shared. Returns true if:

Supported API: false

Specified by:
isShareable in interface DataSharingService
Parameters:
object -
Returns:
boolean
Throws:
WTException

isSharedTo

public boolean isSharedTo(Persistable object,
                          WTContainerRef container_ref)
                   throws WTException
Determines if the object is shared to the container whose reference is passed as argument. Returns 'true' if the object is shared either as a version or not; whether or not the share is enabled; returns 'false' otherwise.

If the container reference passed as argument is 'null' then the method returns whether the object is shared to any container.

Supported API: false

Specified by:
isSharedTo in interface DataSharingService
Parameters:
object -
container_ref -
Returns:
boolean
Throws:
WTException

removeShare

public void removeShare(SharedContainerMap map)
                 throws WTException
Removes all wt,inf.sharing.SharedContainerMap with the same key and target container as the one passed as argument.

Supported API: false

Specified by:
removeShare in interface DataSharingService
Parameters:
map -
Throws:
WTException

removeShare

public void removeShare(Persistable object,
                        WTContainerRef container_ref)
                 throws WTException
Removes all wt,inf.sharing.SharedContainerMap for the target object and target container pased as arguments. Removes both object and version shares, enabled or disabled shares.

NoteIf the share exists and is a COLLECTIVE, FOLDER or STRUCTURE share, then all related shares are removed.

Supported API: false

Specified by:
removeShare in interface DataSharingService
Parameters:
object -
container_ref -
Throws:
WTException

removeShares

public void removeShares(List shares)
                  throws WTException
Removes all wt,inf.sharing.SharedContainerMap contained in the list passed as argument.

Supported API: false

Specified by:
removeShares in interface DataSharingService
Parameters:
shares -
Throws:
WTException

shareFolder

public SharedContainerMap shareFolder(Folder folder,
                                      WTContainerRef to_container_ref,
                                      Folder to_folder)
                               throws WTException
Share the folder passed as argument and all contained objects ("folder set"). The contained iterated objects in the list are shared as versions. Returns the SharedContainerMap for the shared folder. The target folder may not be null. The share key of the objects in the folder set the String representation of the reference to the shared folder.

The way the operation deals with duplicate shares is as follows:

Where an equivalent share is one with same target object and container: same ûmodeú (version/object); same target folder. A conflicting share is one with same target object and container but has either a different mode or a different folder.

Supported API: false

Specified by:
shareFolder in interface DataSharingService
Parameters:
folder -
to_container_ref -
to_folder -
Returns:
SharedContainerMap
Throws:
WTException

shareObject

public SharedContainerMap shareObject(Persistable object,
                                      WTContainerRef to_container_ref,
                                      Folder to_folder)
                               throws WTException
Shares an object given the target container and the target folder. The object shared is the specific one passed as argument. So, if the object is Iterated, then the specific iteration passed as argument is shared. Returns a wt.inf.SharedContainerMap object representing the sharing of the data.

The way the operation deals with duplicate shares is as follows:

Where an equivalent share is one with same target object and container: same ûmodeú (version/object); same target folder. A conflicting share is one with same target object and container but has either a different mode or a different folder.

Supported API: false

Specified by:
shareObject in interface DataSharingService
Parameters:
object -
to_container_ref -
to_folder -
Returns:
SharedContainerMap
Throws:
WTException
See Also:
Iterated, WTContainer, Folder, wt.sharing.SharedContainerMap

shareObjectList

public QueryResult shareObjectList(List objects,
                                   WTContainerRef to_container_ref,
                                   Folder to_folder)
                            throws WTException
Share a list of objects given the target container and the target folder. The specific iterations of the objects are shared if the object is Iterated. Returns a list of SharedContainerMap representing the sharing of the objects. The target folder may be null. All the sharings will tagged as belonging to the same action. This means that the remove/disable/enable operations affect all objects in the set. The share key for the maps is the String representation of the reference to the first object in the list passed as argument.

Supported API: false

Specified by:
shareObjectList in interface DataSharingService
Parameters:
objects -
to_container_ref -
to_folder -
Returns:
QueryResult
Throws:
WTException
See Also:
Iterated, WTContainer, Folder, wt.sharing.SharedContainerMap, wt.sharing.DataSharingService#shareObject

shareStructure

public SharedContainerMap shareStructure(Persistable struct_handle,
                                         WTContainerRef to_container_ref,
                                         Folder to_folder)
                                  throws WTException
Shares a structure through the handle passed as argument. A structure delegate is called to return the objects contained in the structure. Returns the SharedContainerMap for the shared structure handle. The target folder may be null. The share key of the objects in the folder set the String representation of the reference to the shared structure handle.

Supported API: false

Specified by:
shareStructure in interface DataSharingService
Parameters:
struct_handle -
to_container_ref -
to_folder -
Returns:
SharedContainerMap
Throws:
WTException

shareVersion

public SharedContainerMap shareVersion(Persistable object,
                                       WTContainerRef to_container_ref,
                                       Folder to_folder)
                                throws WTException
Shares an object given the target container and the target folder. If the object is Iterated, then a version is shared, otherwise an instance is shared. Returns a wt.inf.SharedContainerMap object representing the sharing of the data.

The way the operation deals with duplicate shares is as follows:

Where an equivalent share is one with same target object and container: same ûmodeú (version/object); same target folder. A conflicting share is one with same target object and container but has either a different mode or a different folder.

Supported API: false

Specified by:
shareVersion in interface DataSharingService
Parameters:
object -
to_container_ref -
to_folder -
Returns:
SharedContainerMap
Throws:
WTException
See Also:
Iterated, WTContainer, Folder, wt.sharing.SharedContainerMap

shareVersionList

public QueryResult shareVersionList(List objects,
                                    WTContainerRef to_container_ref,
                                    Folder to_folder)
                             throws WTException
Share a list of objects given the target container and the target folder. The iterated objects in the list are shared as versions and the non-iterated as objects. Returns a list of SharedContainerMap representing the sharing of the objects. The target folder may be null. All the sharings will tagged as belonging to the same action. This means that the remove/disable/enable operations affect all objects in the set. The share key for the maps is the String representation of the reference to the first object in the list passed as argument.

Supported API: false

Specified by:
shareVersionList in interface DataSharingService
Parameters:
objects -
to_container_ref -
to_folder -
Returns:
QueryResult
Throws:
WTException

shareVersions

public WTCollection shareVersions(WTCollection objects,
                                  WTContainerRef to_container_ref,
                                  Folder to_folder)
                           throws WTException
Shares a WTCollection given the target container and the target folder. Returns a collection of SharedContainerMap representing the sharing of the objects. The objects in the input collection are not assumed to be Iterated. For the ones that are version shares are created; for the others, object shares. The shares are not assumed to belong to the same action. This means that they can be removed/disabled/enabled independently.

Supported API: false

Specified by:
shareVersions in interface DataSharingService
Parameters:
objects -
to_container_ref -
to_folder -
Returns:
WTCollection
Throws:
WTException

switchShare

public void switchShare(Persistable object1,
                        WTContainerRef container_ref,
                        Persistable object2)
                 throws WTException
Replaces an object for another in a share map for a given target container. All ACL entries due to the share are removed from old target to the new target object.

Supported API: false

Specified by:
switchShare in interface DataSharingService
Parameters:
object1 -
container_ref -
object2 -
Throws:
WTException

getObjectShareMaps

public WTCollection getObjectShareMaps(WTCollection objects,
                                       WTContainerRef container_ref,
                                       int enabled_status)
                                throws WTException
Returns the object share maps for the collection of object and target container passed as parameter in the given sharing state (enabled/disabled). The integer constants indicating whether only enabled, only disabled or both kinds of shares are to be retruned are defined in DataSharingHelper. They are the following:

Supported API: false

Specified by:
getObjectShareMaps in interface DataSharingService
Parameters:
objects -
container_ref -
enabled_status -
Returns:
WTCollection
Throws:
WTException

getVersionShareMaps

public WTCollection getVersionShareMaps(WTCollection objects,
                                        WTContainerRef container_ref,
                                        int enabled_status)
                                 throws WTException
Returns the version share maps for the collection of object and target container passed as parameter in the given sharing state (enabled/disabled). The integer constants indicating whether only enabled, only disabled or both kinds of shares are to be retruned are defined in DataSharingHelper. They are the following:

Supported API: false

Specified by:
getVersionShareMaps in interface DataSharingService
Parameters:
objects -
container_ref -
enabled_status -
Returns:
WTCollection
Throws:
WTException

getAllShareMaps

public WTCollection getAllShareMaps(WTCollection objects,
                                    WTContainerRef container_ref,
                                    int enabled_status)
                             throws WTException
Returns the object and version share maps for the collection of object and target container passed as parameter in the given sharing state (enabled/disabled). The integer constants indicating whether only enabled, only disabled or both kinds of shares are to be retruned are defined in DataSharingHelper. They are the following:

Supported API: false

Specified by:
getAllShareMaps in interface DataSharingService
Parameters:
objects -
container_ref -
enabled_status -
Returns:
WTCollection
Throws:
WTException

removeShares

public void removeShares(WTCollection shares)
                  throws WTException
Removes all wt,inf.sharing.SharedContainerMap contained in the collection passed as argument.

Supported API: false

Specified by:
removeShares in interface DataSharingService
Parameters:
shares -
Throws:
WTException

getSharedObjects

public WTCollection getSharedObjects(WTCollection objects,
                                     WTContainerRef container_ref)
                              throws WTException
Returns a WTCollection of objects contained in the collection passed as argument and are shared to a container, given its reference. If the container reference is 'null', returns all shared objects contained in the collection passed as argument.

Supported API: false

Specified by:
getSharedObjects in interface DataSharingService
Parameters:
objects -
container_ref -
Returns:
WTCollection
Throws:
WTException

getSharedFolderContents

public WTCollection getSharedFolderContents(Folder folder,
                                            ConfigSpec config_spec,
                                            Class[] obj_classes)
                                     throws WTException
Returns shared folder content given a Folder and a wt.config.ConfigSpec). The objects returne are of one of the classes given in the array passed as argument. The config spec passed as argument can be null, in which case it is simply ignored.

For example, to get the shared EPM contents you call mySharedObjs = getSharedFolderContents (myFolder, myConfig, new Class [] {Folder.class, EPMDocument.class, WTPart.class); Note that if you have nested folders, the folder class itself needs to be included.

Supported API: false

Specified by:
getSharedFolderContents in interface DataSharingService
Parameters:
folder -
config_spec -
obj_classes -
Returns:
WTCollection
Throws:
WTException

undoShares

public void undoShares(WTCollection objects,
                       WTContainerRef container_ref)
                throws WTException
Removes all the object and version share maps for the collection of objects and target container passed as parameters in either sharing state.

Supported API: false

Specified by:
undoShares in interface DataSharingService
Parameters:
objects -
container_ref -
Throws:
WTException

emitSharingEvent

public void emitSharingEvent(String event_type,
                             WTCollection map_list)
                      throws WTException
Emits data sharing event.

Supported API: false

Specified by:
emitSharingEvent in interface DataSharingServiceSvr
Parameters:
event_type -
map_list -
Throws:
WTException

registerEvents

public void registerEvents(ManagerService service)


Supported API: false

Specified by:
registerEvents in interface DataSharingServiceSvr
Overrides:
registerEvents in class StandardManager
Parameters:
service -

setAccessControl

public SharedContainerMap setAccessControl(SharedContainerMap map,
                                           WTContainer container,
                                           Persistable object)
                                    throws WTException
Sets ad hoc access control to the map and object passed as argument. Returns the persisted and updated map. Also the object is updated in the database.

Supported API: false

Specified by:
setAccessControl in interface DataSharingServiceSvr
Parameters:
map -
container -
object -
Returns:
SharedContainerMap
Throws:
WTException

getFolderMapChunk

private QueryResult getFolderMapChunk(long[] folder_id__array)
                               throws WTException
Throws:
WTException

getKeyMapChunk

private QueryResult getKeyMapChunk(long[] key_array)
                            throws WTException
Throws:
WTException

getMapChunk

private QueryResult getMapChunk(long[] ver_id_array,
                                long[] obj_id_array,
                                WTContainerRef container_ref,
                                int enabled_status)
                         throws WTException
Throws:
WTException

getChunkedIds

private long[] getChunkedIds(long[] id_array,
                             int n_chunks,
                             int i)

getKeyMaps

private WTCollection getKeyMaps(WTCollection maps)
                         throws WTException
Returns all maps with the same key as one of the maps passed as argument.

Throws:
WTException

getKeyArray

private long[] getKeyArray(WTCollection maps)
                    throws WTException
Throws:
WTException

processFolderChangeMaps

private void processFolderChangeMaps(WTValuedMap target_folder_map,
                                     List dest_list,
                                     WTArrayList added_maps,
                                     WTArrayList removed_maps)
                              throws WTException
Called from processFolderChangeEvent().

Throws:
WTException

getFolderMaps

private WTArrayList getFolderMaps(Persistable object,
                                  ObjectReference folder_ref)
                           throws WTException
Returns a list with all maps associated for the object and folder passed as argument. The folder is passed as a reference and must be not 'null'.

Throws:
WTException

copy

private static SharedContainerMap copy(SharedContainerMap map,
                                       Persistable object)
                                throws WTException
Throws:
WTException

moveAclEntries

private void moveAclEntries(AdHocControlled object1,
                            Persistable object2,
                            long owner_id)
                     throws WTException
Removes all ACL entries from object1 with the key passed as argument. These entries are copied to object2 if it is ad hoc controlled.

Throws:
WTException

queueMethodCall

private void queueMethodCall(String method_name,
                             Class[] arg_types,
                             Object[] args)
                      throws WTException
Queues a call to the method whose's name is passed as argument. The method must be public, static and defined in the service.

Throws:
WTException

getObject

private static Persistable getObject(ObjectIdentifier obj_id)
                              throws WTException
Retrieves object given its object identifier. Returns null if object has been deleted.

Throws:
WTException

addEnabledClause

private void addEnabledClause(QuerySpec qs,
                              int enabled_status,
                              int index)
                       throws WTException
Adds a clause to the query spec that restricts the maps returned to those with the same status as the one passed as argument. A boolean argument

Throws:
WTException

addShareKeyClause

private void addShareKeyClause(QuerySpec qs,
                               long share_key)
                        throws WTException
Adds a clause to the query spec that restricts the maps returned to those with the same status as the one passed as argument. A boolean argument

Throws:
WTException

addTargetContainerClause

private void addTargetContainerClause(QuerySpec qs,
                                      WTContainerRef container_ref,
                                      int index)
                               throws WTException
Adds a clause to the query spec that restricts the maps returned to those for which the target container is the one passed as argument as an container reference.

Throws:
WTException

addSourceContainerClause

private void addSourceContainerClause(QuerySpec qs,
                                      WTContainerRef container_ref)
                               throws WTException
Adds a clause to the query spec that restricts the maps returned to those for which the source container is the one passed as argument as an container reference.

Throws:
WTException

addObjectClause

private void addObjectClause(QuerySpec qs,
                             Object object)
                      throws WTException
Adds a clause to the query spec that restricts the maps returned to those that reference the object passed as argument. The object may be passed as an ObjectIdentifier of a non-iterated object or branch identifier (Long) of an iterated object.

Throws:
WTException

getCheckedOut

private HashMap getCheckedOut(WTContainerRef container_ref)
                       throws WTException
Throws:
WTException

getObjSc

private SearchCondition getObjSc(ObjectIdentifier oid)
                          throws WTException
Returns the search condition for a given object or object's iteration.

Throws:
WTException

getVerSc

private SearchCondition getVerSc(long branch_id)
                          throws WTException
Returns the search condition for a given object's version.

Throws:
WTException

toVersionIdArray

private long[] toVersionIdArray(WTCollection objects)
                         throws WTException
Returns an array of version ids from the objects passed as argument.

Throws:
WTException

showShareType

private String showShareType(int share_type)
Returns a readable representation of the share type.


sharePersistable

private SharedContainerMap sharePersistable(Persistable object,
                                            WTContainerRef to_container_ref,
                                            Folder to_folder,
                                            long share_key,
                                            int share_type)
                                     throws WTException
Shares an individual object.

Throws:
WTException

shareVersion

private SharedContainerMap shareVersion(Persistable object,
                                        WTContainerRef to_container_ref,
                                        Folder to_folder,
                                        long share_key,
                                        int share_type)
                                 throws WTException
Shares an individual object.

Throws:
WTException

registerAsListener

private void registerAsListener()
                         throws ManagerException
Register as listener to the following events:

Throws:
ManagerException

processContainerMoveEvent

private void processContainerMoveEvent(WTCollection objects)
                                throws WTException
Update the source container reference on any SharedContainerMaps that refer to the moved object

Parameters:
objects - The objects that were moved
Throws:
WTException

processCheckInEvent

private void processCheckInEvent(WTKeyedMap object_map)
                          throws WTException
Processes multi-object check in event. The argument passed is a map: original->working copies. The processing is performed in the following manner:
  1. find all object share maps for the original copies;
  2. for each working copy, check if there is a corresponding map;
  3. if there is a map, get the working copy and update its ad hoc ACL;
  4. save all working copies.
In this way there will be at most 2 (more likely 1) accesses to the database

Throws:
WTException

processCreateObjectEvent

private void processCreateObjectEvent(WTCollection objects)
                               throws WTException
Processes object creation. If an object is created in a shared folder, then it is automatically shared to the same sontainers the folder is shared. The processing is performed in the following manner:
  1. find all folders for the objects passed as argument;
  2. find all maps for the folders found;
  3. for each object, get the corresponding folder maps;
  4. for each folder map, create a corresponding object share
  5. save all shares.
In this way there will be at most 2 accesses to the database: (1) getting the folder maps and (2) saving the created shares.

Throws:
WTException

processDeleteObjectEvent

private void processDeleteObjectEvent(WTCollection objects)
                               throws WTException
Processes object deletion. All shares corresponding to the objects deleted are removed. Additionally, if a deleted object is a target folder, all shares that reference that target folder are removed as well.

Throws:
WTException

processFolderChangeEvent

private void processFolderChangeEvent(FolderServiceEvent folder_event)
                               throws WTException
Processes folder change events. Let 'object' be the folder entry and 'folder' be the new folder. The processing is as follows.
  1. If object is shared because it is contained in a shared folder, then remove the share.
  2. Moreover, if the object itself is a folder, remove all shares for objects contained in it.
  3. If folder is shared, then let Ci, i = 1, 2... be the containers to which folder is shared.
  4. If object is single-shared to Ci, then remove this share.
  5. For each Ci create share for object where target is Ci
  6. If the object itself is a folder, then for each Ci create share for each content of object.
In this way there will be at most 2 accesses to the database: (1) getting the folder maps and (2) saving the created shares.

Throws:
WTException

getFolderShareMap

private HashMap getFolderShareMap(WTCollection folder_shares)
                           throws WTException
Throws:
WTException

getTargetFolderPairs

private WTValuedMap getTargetFolderPairs(Persistable target,
                                         ObjectReference folder_ref)
                                  throws WTException
Throws:
WTException

getTargetFolderMaps

private WTArrayList getTargetFolderMaps(WTKeyedMap folder_map)
                                 throws WTException
Returns all shares such that the target folder has the oid passed as argument.

Throws:
WTException

markSharesForDelete

private void markSharesForDelete(WTContainer container)
                          throws WTException
Marks for delete all shares that reference container passed as argument.

Throws:
WTException

restoreShares

private void restoreShares(WTContainer container)
                    throws WTException
Restores all shares marked for delete that reference container passed as argument.

Throws:
WTException

checkValidShare

private void checkValidShare(Persistable object,
                             WTContainerRef to_container_ref,
                             Folder to_folder)
                      throws WTException
Throws exception if the sharing of an object to a container/folder is not valid.

Throws:
WTException
See Also:
isShareable(Persistable)

getShareableState

private int getShareableState(Persistable object)
                       throws WTException
Throws:
WTException

copyFolderShares

private WTArrayList copyFolderShares(List share_list,
                                     Persistable object,
                                     ObjectReference folder_ref)
                              throws WTException
Copies shares to the object passed as argument.

Throws:
WTException

copyFolderShares

private WTArrayList copyFolderShares(WTCollection folder_shares,
                                     HashMap object_map,
                                     HashMap folder_map,
                                     WTHashSet changed_objects)
                              throws WTException
Copies shares to the objects in the object map passed as argument. Also returns the objects that were changed (ACL updated).

Throws:
WTException

getFolderContents

private static List getFolderContents(Folder folder,
                                      HashMap content_map)
                               throws WTException
Returns the contents of the folder and subfolders.

Throws:
WTException

shareObjectSet

private WTArrayList shareObjectSet(List objects,
                                   WTContainerRef to_container_ref,
                                   Folder to_folder,
                                   long share_key,
                                   int share_type,
                                   int mode)
                            throws WTException
Shares a set of objects given in a list. The list may be a list of persistables or a list of pairs . This case happens when a folder is shared.

Throws:
WTException

shareVersionSet

private HashMap shareVersionSet(List objects,
                                WTContainerRef to_container_ref,
                                Folder to_folder,
                                long share_key,
                                int share_type)
                         throws WTException
Shares a set of objects.

Throws:
WTException

checkIncompatibleDuplicate

public void checkIncompatibleDuplicate(Persistable object,
                                       WTContainerRef to_container_ref,
                                       Folder to_folder)
                                throws WTException
Checks whether the new share is compatible with existing shares of the same object to the same target container.

Throws:
WTException

checkDuplicate

public SharedContainerMap checkDuplicate(Persistable object,
                                         WTContainerRef to_container_ref,
                                         Folder to_folder,
                                         boolean is_version)
                                  throws WTException
Checks if the object has been shared to the container to the folder passed as argument for the same type of sharing. Returns the duplicate share if this is the case; otherwise returns 'null.'

Assumes that the type of the intended share is SharedContainerMap.SINGLE.

Throws:
WTException

checkValidOp

private void checkValidOp(SharedContainerMap map,
                          String operation_key)
                   throws WTException
Checks if the map is safe for a disable/enable/remove operation. This operation is not valid if the type is FOLDER or STRUCTURE and it was not the target of the create operation.

Throws an exception if the operation is not valid.

Throws:
WTException

isValidOp

private boolean isValidOp(SharedContainerMap map,
                          String operation_key)
                   throws WTException
Returns true if operation is valid, 'false' otherwise. Checks if the map is safe for a disable/enable/remove operation. This operation is not valid if the type is FOLDER or STRUCTURE and it was not the target of the create operation.

Throws:
WTException

populateAttributes

private SharedContainerMap populateAttributes(SharedContainerMap map,
                                              Persistable object,
                                              WTContainerRef to_container_ref,
                                              Folder to_folder,
                                              long share_key,
                                              int share_type)
                                       throws WTException
Populates the attributes of a SharedContainedMap passed as argument. This method is called when the share is created and the map passed as argument can be non-persistent. The map returned is persisted.

Throws:
WTException

disableMap

private Persistable disableMap(SharedContainerMap map)
                        throws WTException
Disables a given map. Operation consists in setting the enabled flag to false and storing the ad hoc entries of the object corresponding to the container_ref in hand in the map. These same entries are removed from the object.

Throws:
WTException

removeMap

private void removeMap(SharedContainerMap map)
                throws WTException
Removes a given map. In addition to deleting the map, one has to update the object's ad hoc Acl. Returns the updated object.

Throws:
WTException

removeContainerEntries

private void removeContainerEntries(AdHocControlled object,
                                    long container_id,
                                    IterationIdentifier iter_id,
                                    WTCollection objects)
                             throws WTException
Removes all entries in the object due to the sharing from the container passed as argument. In case of Iterated objects, removes also from all shared iterations.

Doesn't actually update the objects but rather returns a collection of all modified objects in a WTCollection. It is the responsibility of the calling method to update the objects.

Throws:
WTException

sameIterId

private boolean sameIterId(Iterated object,
                           IterationIdentifier iter_id)
                    throws WTException
Determines whether the iteration identifier of an Iterated object is the same as one passed as argument. Returns 'true' if this is the case; 'false' otherwise.

Throws:
WTException

enableMap

private Persistable enableMap(SharedContainerMap map)
                       throws WTException
Enables a given map. Operation consists in setting the enabled flag to true and restoring the ad hoc entries of the object corresponding to the container_ref in hand from the map.

Throws:
WTException

getOid

public static ObjectIdentifier getOid(Object object)
Returns object's associated oid. Accepts not only Persistable as argument but also ObjectReference and ObjectIdentifier objects. Returns 'null' if object is null.


getId

private static long getId(Object object)
Returns object's id.


getList

private List getList(Object object)
Returns a list with the object passed as argument.


getOidString

public static String getOidString(Object object)
Returns String representation of the object's oid (debugging).


showIds

private static String showIds(long[] ids)

showCollection

private static String showCollection(Collection collection)
                              throws WTException
Returns String representation of the list passed as argument (debugging).

Throws:
WTException

showMap

private String showMap(SharedContainerMap map)
                throws WTException
Returns String representtaion of a SharedContainerMap for debugging purposes

Throws:
WTException

appendAnd

private void appendAnd(QuerySpec qs)
Returns object's identification (name) for debugging purposes


getObjectName

private String getObjectName(Object object)
Returns object's identification (name) for debugging purposes


appendJoin

private void appendJoin(QuerySpec qs,
                        Class link_class,
                        Class role_a_class,
                        Class role_b_class,
                        int lnk_indx,
                        int a_indx,
                        int b_indx)
                 throws WTException
Throws:
WTException

processExcludes

private void processExcludes(QuerySpec qs,
                             int from_index)
                      throws WTException
Throws:
WTException

getFolderContentQS

private QuerySpec getFolderContentQS(Folder folder,
                                     ConfigSpec config_spec,
                                     Class obj_class)
                              throws WTException
Throws:
WTException

noShares

private boolean noShares()
                  throws WTException
Throws:
WTException

sortFolders

private void sortFolders(List folders)
                  throws WTException
Throws:
WTException

toWTArrayList

private static WTArrayList toWTArrayList(QueryResult qr)
Returns a WTCollection from a QueryResult consisting only of persistables.


toQueryResult

private static QueryResult toQueryResult(WTArrayList wt_list)
                                  throws WTException
Returns a QueryResult of Persistables from a WTCollection.

Throws:
WTException

toWTArrayList

private static WTArrayList toWTArrayList(Persistable object)
Returns a WTCollection with a single persistable.


toList

private static List toList(QueryResult qr)
Returns a List from a QueryResult.


shareableCollection

private WTCollection shareableCollection(WTCollection objects)
                                  throws WTException
Returns a List from a QueryResult.

Throws:
WTException

asString

private String asString(char c)

showAdHocAcl

private String showAdHocAcl(AdHocControlled object)
                     throws WTException
Shows ad hoc ACL.

Throws:
WTException

getAllProjectShares

private WTCollection getAllProjectShares(WTCollection shares)
                                  throws WTException
Returns a List of all shares to Project.

Throws:
WTException

getConflictResolution

private WTCollection getConflictResolution(WTCollection allProjectShares,
                                           SharingConflictType conflictType)
                                    throws WTException
Returns a List of all shares to Project.

Throws:
WTException

getOriginalObjects

private WTCollection getOriginalObjects(WTCollection unresolvedProjectShareRefs,
                                        WTCollection originalObjects)
                                 throws WTException
Returns a List of all shares to Project.

Throws:
WTException

containsVersion

private boolean containsVersion(WTCollection unresolvedIteratedProjectShareRefs,
                                long branchId)
                         throws WTException
Throws:
WTException

getRefs

private WTCollection getRefs(WTCollection unresolvedProjectShares)
                      throws WTException
Returns a List of all shares to Project.x

Throws:
WTException

setAccessControl

public SharedContainerMap setAccessControl(SharedContainerMap map,
                                           WTContainer container,
                                           Persistable object,
                                           Folder to_folder)
                                    throws WTException
Throws:
WTException