org.gcube.contentmanagement.layerindependent.descriptions
Class BasicReferenceDescription

java.lang.Object
  extended by org.gcube.contentmanagement.layerindependent.descriptions.BasicReferenceDescription

public class BasicReferenceDescription
extends java.lang.Object

Defines constants related to refernces between two info objects as well as an layer-independent representation of such a reference. Layer independent is achieved by having no dependencies to any class of other layers. By this, it can easily be used in combination with Storage as well as Content Layer, on server as well as client side, whereas stubs should be used only within one layer and in the boundary between them.


Field Summary
static java.lang.String ANY_ROLE
          wildcard for querying references with arbitrary role
static java.lang.String PROPAGATE_DELETE_SOURCE
          will cascade the delete event of the target object to the source object of the reference.
static java.lang.String PROPAGATE_DELETE_SOURCE_IF_SINGLE_APPEARANCE
          will propagate delete event of the target object if and onlf if the source object does not appear in any other reference with the same role
static java.lang.String PROPAGATE_DELETE_TARGET
          will cascade the delete event of the source object to the target object of the reference.
static java.lang.String PROPAGATE_DELETE_TARGET_IF_SINGLE_APPEARANCE
          will propagate delete event of the source object if and onlf if the target object does not appear in any other reference with the same role
static java.lang.String PROPAGATE_NO_DELETE
          will not propagate any delete event of the target object of this reference
static java.lang.String REFERENCE
          generic reference String for error identification
static java.lang.String RELATION_LEGACY_ROLE_CONTAINED
          Deprecated. Should no longer be used, since the ordering is not that useful if a child orders it's parents than the other way round. Has been replaced by RELATION_ROLE_CONTAINS. Existing records receive special treatment, this means, they will get inverted / updated to new style automatically.
static java.lang.String RELATION_ROLE_ANNOTATION
          Deprecated.  
static java.lang.String RELATION_ROLE_CONTAINS
          part-of relationship: source is parent document/collection, target is child document / collection.
static java.lang.String RELATION_ROLE_MEMBERSHIP
          membership relationship: source is document, target is collection
static java.lang.String RELATION_ROLE_METADATA
          metadata relationship: source is document, target is metadata
static java.lang.String RELATION_ROLE_REPRESENTATION
          alternative representation relationship: source is the main representation of the content, target represents the same content in a different form is the target, e.g.
static java.lang.String ROLE
          generic role String for error identification
static int UNDEFINED_POSITION
          indicates that a position has not been defined
 
Constructor Summary
BasicReferenceDescription()
          Empty constructor, should only be used for internal purposes.
BasicReferenceDescription(java.lang.String sourceoid, java.lang.String targetoid, java.lang.String role, int position, java.lang.String rule)
          Constructs a reference description with all inforamtion except for secondary role set initially
BasicReferenceDescription(java.lang.String sourceoid, java.lang.String targetoid, java.lang.String role, java.lang.String secondaryRole, int position, java.lang.String rule)
          Constructs a reference description with all inforamtion set initially
 
Method Summary
 int getPosition()
          Returns the position of the references.
 java.lang.String getPropagationRule()
          Returns the propagation rule for this reference.
 java.lang.String getRole()
          Returns the primary role of the source object with respect to the target object of the reference.
 java.lang.String getSecondaryRole()
          Returns the secondary role
 java.lang.String getSourceOID()
          Returns the object ID of the source object
 java.lang.String getTargetOID()
          Returns the object ID of the target object
 void setPosition(int position)
          Sets the position of the references.
 void setPropagationRule(java.lang.String propagationRule)
          Sets the propagation rule for this reference.
 void setRole(java.lang.String role)
          Sets the primary role of the source object with respect to the target object of the reference.
 void setSecondaryRole(java.lang.String secondaryRole)
          Sets the secondary role
 void setSourceOID(java.lang.String sourceoid)
          Sets the object ID of the source object
 void setTargetOID(java.lang.String targetoid)
          Sets the object ID of the target object
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPAGATE_DELETE_TARGET_IF_SINGLE_APPEARANCE

public static final java.lang.String PROPAGATE_DELETE_TARGET_IF_SINGLE_APPEARANCE
will propagate delete event of the source object if and onlf if the target object does not appear in any other reference with the same role

See Also:
Constant Field Values

PROPAGATE_DELETE_SOURCE_IF_SINGLE_APPEARANCE

public static final java.lang.String PROPAGATE_DELETE_SOURCE_IF_SINGLE_APPEARANCE
will propagate delete event of the target object if and onlf if the source object does not appear in any other reference with the same role

See Also:
Constant Field Values

PROPAGATE_DELETE_TARGET

public static final java.lang.String PROPAGATE_DELETE_TARGET
will cascade the delete event of the source object to the target object of the reference. Handle with care.

See Also:
Constant Field Values

PROPAGATE_DELETE_SOURCE

public static final java.lang.String PROPAGATE_DELETE_SOURCE
will cascade the delete event of the target object to the source object of the reference. Handle with care.

See Also:
Constant Field Values

PROPAGATE_NO_DELETE

public static final java.lang.String PROPAGATE_NO_DELETE
will not propagate any delete event of the target object of this reference

See Also:
Constant Field Values

UNDEFINED_POSITION

public static final int UNDEFINED_POSITION
indicates that a position has not been defined

See Also:
Constant Field Values

ANY_ROLE

public static final java.lang.String ANY_ROLE
wildcard for querying references with arbitrary role

See Also:
Constant Field Values

RELATION_ROLE_MEMBERSHIP

public static final java.lang.String RELATION_ROLE_MEMBERSHIP
membership relationship: source is document, target is collection

See Also:
Constant Field Values

RELATION_ROLE_CONTAINS

public static final java.lang.String RELATION_ROLE_CONTAINS
part-of relationship: source is parent document/collection, target is child document / collection.

See Also:
Constant Field Values

REFERENCE

public static final java.lang.String REFERENCE
generic reference String for error identification

See Also:
Constant Field Values

ROLE

public static final java.lang.String ROLE
generic role String for error identification

See Also:
Constant Field Values

RELATION_LEGACY_ROLE_CONTAINED

@Deprecated
public static final java.lang.String RELATION_LEGACY_ROLE_CONTAINED
Deprecated. Should no longer be used, since the ordering is not that useful if a child orders it's parents than the other way round. Has been replaced by RELATION_ROLE_CONTAINS. Existing records receive special treatment, this means, they will get inverted / updated to new style automatically.
legacy part-of relationship: source is child document/collection, target is parent document / collection.

See Also:
Constant Field Values

RELATION_ROLE_REPRESENTATION

public static final java.lang.String RELATION_ROLE_REPRESENTATION
alternative representation relationship: source is the main representation of the content, target represents the same content in a different form is the target, e.g. different format or lower resolution. So, in contrast to a-part-of, this document is semantically equivalent (as good as possible using a different format).

See Also:
RELATION_ROLE_CONTAINS, Constant Field Values

RELATION_ROLE_METADATA

public static final java.lang.String RELATION_ROLE_METADATA
metadata relationship: source is document, target is metadata

See Also:
Constant Field Values

RELATION_ROLE_ANNOTATION

@Deprecated
public static final java.lang.String RELATION_ROLE_ANNOTATION
Deprecated. 
metadata relationship: source is document, target is annotation. This is no longer of use due to the redesign of the Metadata Catalog, according to which the primary role will be RELATION_ROLE_METADATA for annotations and only the secondary role will be is RELATION_ROLE_ANNOTATION.

See Also:
Constant Field Values
Constructor Detail

BasicReferenceDescription

public BasicReferenceDescription(java.lang.String sourceoid,
                                 java.lang.String targetoid,
                                 java.lang.String role,
                                 int position,
                                 java.lang.String rule)
Constructs a reference description with all inforamtion except for secondary role set initially

Parameters:
sourceoid - the object ID of the source object
targetoid - the object ID of the target object
role - the role of the source obejct with regard to the target object
position - the position, of ordering is important or
rule - the propagation rule

BasicReferenceDescription

public BasicReferenceDescription(java.lang.String sourceoid,
                                 java.lang.String targetoid,
                                 java.lang.String role,
                                 java.lang.String secondaryRole,
                                 int position,
                                 java.lang.String rule)
Constructs a reference description with all inforamtion set initially

Parameters:
sourceoid - the object ID of the source object
targetoid - the object ID of the target object
role - the role of the source obejct with regard to the target object
secondaryRole - the secondary role
position - the position, of ordering is important or
rule - the propagation rule

BasicReferenceDescription

public BasicReferenceDescription()
Empty constructor, should only be used for internal purposes.

Method Detail

getPosition

public int getPosition()
Returns the position of the references. This can be used to define an ordering if some info object has several outgoing references.

Returns:
the position
See Also:
UNDEFINED_POSITION

setPosition

public void setPosition(int position)
Sets the position of the references. This can be used to define an ordering if some info object has several outgoing references.

Parameters:
position - the position

getPropagationRule

public java.lang.String getPropagationRule()
Returns the propagation rule for this reference. Can be one of the constants, which are handled internally by the Storage Management.

Returns:
the propagation rule
See Also:
PROPAGATE_DELETE_SOURCE, PROPAGATE_DELETE_SOURCE_IF_SINGLE_APPEARANCE, PROPAGATE_DELETE_TARGET, PROPAGATE_DELETE_TARGET_IF_SINGLE_APPEARANCE, PROPAGATE_NO_DELETE

setPropagationRule

public void setPropagationRule(java.lang.String propagationRule)
Sets the propagation rule for this reference. Can be one of the constants, which are handled internally by the Storage Management.

Parameters:
propagationRule - the propation rule
See Also:
PROPAGATE_DELETE_SOURCE, PROPAGATE_DELETE_SOURCE_IF_SINGLE_APPEARANCE, PROPAGATE_DELETE_TARGET, PROPAGATE_DELETE_TARGET_IF_SINGLE_APPEARANCE, PROPAGATE_NO_DELETE

getRole

public java.lang.String getRole()
Returns the primary role of the source object with respect to the target object of the reference. Can be one of the defined constants or any user-defined identifier.

Returns:
the role
See Also:
RELATION_ROLE_CONTAINS, RELATION_ROLE_MEMBERSHIP, RELATION_ROLE_METADATA

setRole

public void setRole(java.lang.String role)
Sets the primary role of the source object with respect to the target object of the reference. Can be one of the defined constants or any user-defined identifier. Initializes the special treatment of RELATION_LEGACY_ROLE_CONTAINED

Parameters:
role - the role
See Also:
RELATION_ROLE_CONTAINS, RELATION_ROLE_MEMBERSHIP, RELATION_ROLE_METADATA

getSourceOID

public java.lang.String getSourceOID()
Returns the object ID of the source object

Returns:
the object ID from which the reference origins

setSourceOID

public void setSourceOID(java.lang.String sourceoid)
Sets the object ID of the source object

Parameters:
sourceoid - the object ID from which the reference origins

getTargetOID

public java.lang.String getTargetOID()
Returns the object ID of the target object

Returns:
the object ID to which the reference is pointing

setTargetOID

public void setTargetOID(java.lang.String targetoid)
Sets the object ID of the target object

Parameters:
targetoid - the object ID to which the reference is pointing

getSecondaryRole

public java.lang.String getSecondaryRole()
Returns the secondary role

Returns:
the secondary role

setSecondaryRole

public void setSecondaryRole(java.lang.String secondaryRole)
Sets the secondary role

Parameters:
secondaryRole - the secondary role