org.gcube.contentmanagement.layerindependent.descriptions
Class BasicInfoObjectDescription

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

public class BasicInfoObjectDescription
extends java.lang.Object

Defines constants related to info objects and various info object types as well as an layer-independent representation of such an object. 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_OBJECT
          Constant for filtering based on objects, where every objects should satisfy the filter
static java.lang.String LOCATION
          Constant for the information of info object's ID
static java.lang.String OBJECT_FLAVOUR
          Constant for the information of info object's ID
static java.lang.String OBJECT_FLAVOUR_MATERIALIZED
          Constant to define an object that is materialized inside content management
static java.lang.String OBJECT_FLAVOUR_VIRTUAL
          Constant to define an object that is virtual
static java.lang.String OBJECT_ID
          Constant for the information of info object's ID
static java.lang.String OBJECT_NAME_NOT_SET
          Name of the object should always be set.
static java.lang.String OBJECT_TYPE_ANNOTATION
          Deprecated.  
static java.lang.String OBJECT_TYPE_COLLECTION
          Constant for the type information of info objects representing a collection
static java.lang.String OBJECT_TYPE_DOCUMENT
          Constant for the type information of info objects representing a document
static java.lang.String OBJECT_TYPE_METADATA
          Constant for the type information of info objects representing a metadata object
static java.lang.String OBJECT_TYPE_METADATA_COLLECTION
          Constant for the type information of info objects representing a metadata collection for metadata objects (used by MC)
static java.lang.String RAW_CONTENT_DO_NOT_TRANFER
          Deprecated. because of typo, use RAW_CONTENT_DO_NOT_TRANSFER iunstead.
static java.lang.String RAW_CONTENT_DO_NOT_TRANSFER
          Constant for filelocation to identify that no content should be transfered at all
static java.lang.String RAW_CONTENT_IN_MESSAGE
          Constant to define that content has been sent as part of the message - this works only for very small files
 
Constructor Summary
BasicInfoObjectDescription()
          Construtor, if no information is initially given
BasicInfoObjectDescription(java.lang.String objectid, java.lang.String name, java.lang.String type, java.util.Map<java.lang.String,BasicPropertyDescription> properties, java.util.List<BasicReferenceDescription> references)
          Constructs a new info object with all values initiatilized
 
Method Summary
 java.lang.String getName()
          Returns the name of the object
 java.lang.String getObjectID()
          Returns the object ID
 BasicPropertyDescription[] getProperties()
          Deprecated. prefer use of getPropertyMap() instead because less conversion effort required
 BasicPropertyDescription getProperty(java.lang.String propertyName)
          Returns one particular property of the info object
 java.util.Map<java.lang.String,BasicPropertyDescription> getPropertyMap()
          Returns the properties map
 BasicReferenceDescription[] getReferences()
          Deprecated. prefer use of getReferencesCollection() instead because less conversion effort required
 java.util.List<BasicReferenceDescription> getReferencesCollection()
          Returns the references
 byte[] getTemporaryRawContent()
          Returns the temporary raw content
 java.lang.String getType()
          Returns the type of the object.
static boolean isCollectionType(java.lang.String type)
          Static method to check if a given argument represents the collection object type
static boolean isDocumentType(java.lang.String type)
          Static method to check if a given argument represents the document object type
 boolean isInstanceofCollectionType()
          Chechs whether this instance represents an info object of the collection object type
 boolean isInstanceofDocumentType()
          Chechs whether this instance represents an info object of the document object type
 void setLastUpdate(long lastUpdate)
          Sets the time of the last update
 void setName(java.lang.String name)
          Sets the name of the object
 void setObjectID(java.lang.String objectID)
          Sets the object ID
 void setProperties(java.util.Map<java.lang.String,BasicPropertyDescription> properties)
          Sets the properties
 void setReferences(java.util.List<BasicReferenceDescription> references)
          Sets the references
 void setTemporaryRawContent(byte[] content)
          Sets the temporary raw content
 void setType(java.lang.String type)
          Sets the type of the object.
 boolean transportsRawContent()
          Checks whether some raw content has been stored for temporary transfer in the info object
 boolean updatedSince(long time)
          Checks whether this object has been updated since a particular time
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANY_OBJECT

public static final java.lang.String ANY_OBJECT
Constant for filtering based on objects, where every objects should satisfy the filter

See Also:
Constant Field Values

OBJECT_ID

public static final java.lang.String OBJECT_ID
Constant for the information of info object's ID

See Also:
Constant Field Values

OBJECT_FLAVOUR

public static final java.lang.String OBJECT_FLAVOUR
Constant for the information of info object's ID

See Also:
Constant Field Values

LOCATION

public static final java.lang.String LOCATION
Constant for the information of info object's ID

See Also:
Constant Field Values

OBJECT_TYPE_COLLECTION

public static final java.lang.String OBJECT_TYPE_COLLECTION
Constant for the type information of info objects representing a collection

See Also:
Constant Field Values

OBJECT_TYPE_DOCUMENT

public static final java.lang.String OBJECT_TYPE_DOCUMENT
Constant for the type information of info objects representing a document

See Also:
Constant Field Values

OBJECT_TYPE_METADATA

public static final java.lang.String OBJECT_TYPE_METADATA
Constant for the type information of info objects representing a metadata object

See Also:
Constant Field Values

OBJECT_TYPE_METADATA_COLLECTION

public static final java.lang.String OBJECT_TYPE_METADATA_COLLECTION
Constant for the type information of info objects representing a metadata collection for metadata objects (used by MC)

See Also:
Constant Field Values

OBJECT_TYPE_ANNOTATION

@Deprecated
public static final java.lang.String OBJECT_TYPE_ANNOTATION
Deprecated. 
Constant for the type information of info objects representing an annotation

See Also:
Constant Field Values

OBJECT_FLAVOUR_VIRTUAL

public static final java.lang.String OBJECT_FLAVOUR_VIRTUAL
Constant to define an object that is virtual

See Also:
Constant Field Values

OBJECT_FLAVOUR_MATERIALIZED

public static final java.lang.String OBJECT_FLAVOUR_MATERIALIZED
Constant to define an object that is materialized inside content management

See Also:
Constant Field Values

RAW_CONTENT_DO_NOT_TRANSFER

public static final java.lang.String RAW_CONTENT_DO_NOT_TRANSFER
Constant for filelocation to identify that no content should be transfered at all

See Also:
Constant Field Values

RAW_CONTENT_DO_NOT_TRANFER

@Deprecated
public static final java.lang.String RAW_CONTENT_DO_NOT_TRANFER
Deprecated. because of typo, use RAW_CONTENT_DO_NOT_TRANSFER iunstead.
Constant for filelocation to identify that no content should be transfered at all

See Also:
Constant Field Values

RAW_CONTENT_IN_MESSAGE

public static final java.lang.String RAW_CONTENT_IN_MESSAGE
Constant to define that content has been sent as part of the message - this works only for very small files

See Also:
Constant Field Values

OBJECT_NAME_NOT_SET

public static final java.lang.String OBJECT_NAME_NOT_SET
Name of the object should always be set. But just in case it isn't, set it to this value.

See Also:
Constant Field Values
Constructor Detail

BasicInfoObjectDescription

public BasicInfoObjectDescription()
Construtor, if no information is initially given


BasicInfoObjectDescription

public BasicInfoObjectDescription(java.lang.String objectid,
                                  java.lang.String name,
                                  java.lang.String type,
                                  java.util.Map<java.lang.String,BasicPropertyDescription> properties,
                                  java.util.List<BasicReferenceDescription> references)
Constructs a new info object with all values initiatilized

Parameters:
objectid - the object id
name - the object name
type - the object type
properties - the properties
references - the references
Method Detail

getObjectID

public java.lang.String getObjectID()
Returns the object ID

Returns:
the object ID

setObjectID

public void setObjectID(java.lang.String objectID)
Sets the object ID

Parameters:
objectID - the object ID

getProperties

@Deprecated
public BasicPropertyDescription[] getProperties()
Deprecated. prefer use of getPropertyMap() instead because less conversion effort required

Returns the properties as array

Returns:
the properties

getPropertyMap

public java.util.Map<java.lang.String,BasicPropertyDescription> getPropertyMap()
Returns the properties map

Returns:
the properties map

getProperty

public BasicPropertyDescription getProperty(java.lang.String propertyName)
Returns one particular property of the info object

Parameters:
propertyName - the name of the property
Returns:
the property, if such a property has been set; otherwise null

setProperties

public void setProperties(java.util.Map<java.lang.String,BasicPropertyDescription> properties)
Sets the properties

Parameters:
properties - the properties

getReferences

@Deprecated
public BasicReferenceDescription[] getReferences()
Deprecated. prefer use of getReferencesCollection() instead because less conversion effort required

Returns the references as array

Returns:
the references

getReferencesCollection

public java.util.List<BasicReferenceDescription> getReferencesCollection()
Returns the references

Returns:
the references

setReferences

public void setReferences(java.util.List<BasicReferenceDescription> references)
Sets the references

Parameters:
references - the references

getName

public java.lang.String getName()
Returns the name of the object

Returns:
the name
See Also:
OBJECT_NAME_NOT_SET

setName

public void setName(java.lang.String name)
Sets the name of the object

Parameters:
name - the name

getType

public java.lang.String getType()
Returns the type of the object.

Returns:
the type
See Also:
OBJECT_TYPE_DOCUMENT, OBJECT_TYPE_COLLECTION, OBJECT_TYPE_METADATA

setType

public void setType(java.lang.String type)
Sets the type of the object.

Parameters:
type - the type
See Also:
OBJECT_TYPE_DOCUMENT, OBJECT_TYPE_COLLECTION, OBJECT_TYPE_METADATA

isDocumentType

public static boolean isDocumentType(java.lang.String type)
Static method to check if a given argument represents the document object type

Parameters:
type - the type information to check
Returns:
true, if this type information corresponds to a document
See Also:
OBJECT_TYPE_DOCUMENT

isInstanceofDocumentType

public boolean isInstanceofDocumentType()
Chechs whether this instance represents an info object of the document object type

Returns:
true, if this info object corresponds to a document
See Also:
OBJECT_TYPE_DOCUMENT

isCollectionType

public static boolean isCollectionType(java.lang.String type)
Static method to check if a given argument represents the collection object type

Parameters:
type - the type information to check
Returns:
true, if this type information corresponds to a collection
See Also:
OBJECT_TYPE_COLLECTION

isInstanceofCollectionType

public boolean isInstanceofCollectionType()
Chechs whether this instance represents an info object of the collection object type

Returns:
true, if this info object corresponds to a collection
See Also:
OBJECT_TYPE_COLLECTION

setLastUpdate

public void setLastUpdate(long lastUpdate)
Sets the time of the last update

Parameters:
lastUpdate - the time in milliseconds
See Also:
System.currentTimeMillis()

updatedSince

public boolean updatedSince(long time)
Checks whether this object has been updated since a particular time

Parameters:
time - the time in milliseconds to which the last update should be compared
Returns:
true, if there has been an update after the given time
See Also:
System.currentTimeMillis()

transportsRawContent

public boolean transportsRawContent()
Checks whether some raw content has been stored for temporary transfer in the info object

Returns:
true, if there is raw content; false otherwise

setTemporaryRawContent

public void setTemporaryRawContent(byte[] content)
Sets the temporary raw content

Parameters:
content - the content

getTemporaryRawContent

public byte[] getTemporaryRawContent()
Returns the temporary raw content

Returns:
the raw content