wt.inf.sharing
Class DefaultDataSharingDelegate

java.lang.Object
  extended bywt.inf.sharing.AbstractDataSharingDelegate
      extended bywt.inf.sharing.DefaultDataSharingDelegate
All Implemented Interfaces:
DataSharingDelegate, Externalizable, Serializable

public class DefaultDataSharingDelegate
extends AbstractDataSharingDelegate
implements Externalizable

Default implementation of the DataSharingDelegate interface.

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
static long EXTERNALIZATION_VERSION_UID
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
private static boolean VERBOSE
           
 
Constructor Summary
DefaultDataSharingDelegate()
           
 
Method Summary
 ObjectIdentifier getOid(Object object)
          Returns object's associated oid.
 String getOidString(Object object)
          Returns String representation of the object's oid (debugging).
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(DefaultDataSharingDelegate thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
private  void setIterationAdHocAccess(AdHocControlled object, WTPrincipal user, WTPrincipalReference admins_ref, long target_container_id)
           
private  void setIterationAdHocAccess(Persistable object, WTContainer to_container, Folder to_folder)
           
 SharedContainerMap setMapAccess(SharedContainerMap map)
          Gives the share creator and container administrators all rights over the share.
 WTCollection setMapAccess(WTCollection maps)
          Sets ad hoc access control to the SharedContainerMap objects contained in the WTCollection passed as argument.
 Persistable setObjectAccess(Persistable object, WTContainer to_container, boolean is_version_share)
          Gives the container administrators the same rights as the share creator over the share target.
 Persistable setObjectAccess(Persistable object, WTContainer to_container, boolean is_version_share, Folder to_folder)
           
 WTCollection setObjectAccess(WTCollection objects, WTContainer to_container, boolean is_version_share)
          Sets ad hoc access control to the Persistable objects contained in the WTCollection passed as argument This method is called when the object is being shared to the container passed as argument.
 WTCollection setObjectAccess(WTCollection objects, WTContainer to_container, boolean is_version_share, Folder to_folder)
           
private  void setObjectAdHocAccess(AdHocControlled object, WTPrincipal user, WTPrincipalReference admins_ref, long target_container_id)
           
private  Persistable setObjectAdHocAccess(Persistable object, WTContainer to_container, Folder to_folder)
           
private  String showCollection(Collection collection)
          Returns String representation of the list passed as argument (debugging).
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class wt.inf.sharing.AbstractDataSharingDelegate
checkValidShare, checkValidShare, readVersion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

VERBOSE

private static final boolean VERBOSE
Constructor Detail

DefaultDataSharingDelegate

public DefaultDataSharingDelegate()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class AbstractDataSharingDelegate
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class AbstractDataSharingDelegate
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(DefaultDataSharingDelegate thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

setMapAccess

public SharedContainerMap setMapAccess(SharedContainerMap map)
                                throws WTException
Gives the share creator and container administrators all rights over the share.

Supported API: false

Specified by:
setMapAccess in interface DataSharingDelegate
Overrides:
setMapAccess in class AbstractDataSharingDelegate
Parameters:
map -
Returns:
SharedContainerMap
Throws:
WTException

setObjectAccess

public Persistable setObjectAccess(Persistable object,
                                   WTContainer to_container,
                                   boolean is_version_share)
                            throws WTException
Gives the container administrators the same rights as the share creator over the share target.

Supported API: false

Specified by:
setObjectAccess in interface DataSharingDelegate
Overrides:
setObjectAccess in class AbstractDataSharingDelegate
Parameters:
object -
to_container -
is_version_share -
Returns:
Persistable
Throws:
WTException

setMapAccess

public WTCollection setMapAccess(WTCollection maps)
                          throws WTException
Sets ad hoc access control to the SharedContainerMap objects contained in the WTCollection passed as argument. Returns a collection of persisted shares. This method is called when shares are created. and the maps passed as argument has not been persisted yet.

Supported API: false

Specified by:
setMapAccess in interface DataSharingDelegate
Overrides:
setMapAccess in class AbstractDataSharingDelegate
Parameters:
maps -
Returns:
WTCollection
Throws:
WTException

setObjectAccess

public WTCollection setObjectAccess(WTCollection objects,
                                    WTContainer to_container,
                                    boolean is_version_share)
                             throws WTException
Sets ad hoc access control to the Persistable objects contained in the WTCollection passed as argument This method is called when the object is being shared to the container passed as argument. The object is updated in the database in case it is modified. Returns a collection of persisted objects.

Supported API: false

Specified by:
setObjectAccess in interface DataSharingDelegate
Overrides:
setObjectAccess in class AbstractDataSharingDelegate
Parameters:
objects -
to_container -
is_version_share -
Returns:
WTCollection
Throws:
WTException

setObjectAdHocAccess

private void setObjectAdHocAccess(AdHocControlled object,
                                  WTPrincipal user,
                                  WTPrincipalReference admins_ref,
                                  long target_container_id)
                           throws WTException
Throws:
WTException

setIterationAdHocAccess

private void setIterationAdHocAccess(AdHocControlled object,
                                     WTPrincipal user,
                                     WTPrincipalReference admins_ref,
                                     long target_container_id)
                              throws WTException
Throws:
WTException

getOid

public 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.


getOidString

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


showCollection

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

Throws:
WTException

setObjectAccess

public Persistable setObjectAccess(Persistable object,
                                   WTContainer to_container,
                                   boolean is_version_share,
                                   Folder to_folder)
                            throws WTException
Specified by:
setObjectAccess in interface DataSharingDelegate
Throws:
WTException

setObjectAccess

public WTCollection setObjectAccess(WTCollection objects,
                                    WTContainer to_container,
                                    boolean is_version_share,
                                    Folder to_folder)
                             throws WTException
Specified by:
setObjectAccess in interface DataSharingDelegate
Throws:
WTException

setIterationAdHocAccess

private void setIterationAdHocAccess(Persistable object,
                                     WTContainer to_container,
                                     Folder to_folder)
                              throws WTException
Throws:
WTException

setObjectAdHocAccess

private Persistable setObjectAdHocAccess(Persistable object,
                                         WTContainer to_container,
                                         Folder to_folder)
                                  throws WTException
Throws:
WTException