org.apache.slide.content
Class NodeRevisionDescriptor

java.lang.Object
  extended byorg.apache.slide.content.NodeRevisionDescriptor
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public final class NodeRevisionDescriptor
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Node Revision Descriptor class.

Version:
$Revision: 1.34.2.4 $
See Also:
Serialized Form

Field Summary
static java.lang.String COLLECTION_TYPE
          Collection type.
static java.lang.String CONTENT_LANGUAGE
          Content language.
static java.lang.String CONTENT_LENGTH
          Content length.
static java.lang.String CONTENT_TYPE
          MIME type of the content.
static java.lang.String CREATION_DATE
          Creation date.
static java.lang.String CREATION_USER
           
protected static java.text.SimpleDateFormat creationDateFormat
          Simple date format for the creation date ISO representation (partial).
static java.lang.String ETAG
          ETag.
protected static java.text.SimpleDateFormat format
          HTTP date format.
protected static java.text.SimpleDateFormat[] formats
          Date formats using for Date parsing.
static java.lang.String LAST_MODIFIED
          Last modification date.
static java.lang.String MODIFICATION_DATE
           
static java.lang.String MODIFICATION_USER
           
static java.lang.String NAME
          Name.
static java.lang.String OWNER
          Owner.
static java.lang.String RESOURCE_TYPE
          Type.
static java.lang.String SOURCE
          Source.
static java.lang.String TYPE
           
 
Constructor Summary
NodeRevisionDescriptor()
          Constructor.
NodeRevisionDescriptor(long contentLength)
          Constructor for client applications.
NodeRevisionDescriptor(NodeRevisionNumber number, java.lang.String branchName, java.util.Vector labels, java.util.Hashtable properties)
          Constructor used for retrieval.
 
Method Summary
 void addLabel(java.lang.String label)
          Add new label.
 NodeRevisionDescriptor cloneObject()
          Clone.
 java.util.Enumeration enumerateLabels()
          Enumerate labels.
 java.util.Enumeration enumerateProperties()
          Properties values enumerator.
 java.util.Enumeration enumeratePropertiesName()
          Properties names enumerator.
 java.util.Enumeration enumerateRemovedProperties()
           
 java.util.Enumeration enumerateUpdatedProperties()
           
 boolean equals(java.lang.Object obj)
          Equals.
 boolean exists(java.lang.String name)
          Tests if a property has been set.
 boolean exists(java.lang.String name, java.lang.String namespace)
          Tests if a property has been set.
 java.lang.String getBranchName()
          Branch name accessor.
 java.lang.String getContentLanguage()
          Content language accessor.
 long getContentLength()
          Content length accessor.
 java.lang.String getContentType()
          Get the MIME content type of the data (if any).
 java.lang.String getCreationDate()
          Creation date accessor.
 java.util.Date getCreationDateAsDate()
          Creation date accessor.
 java.lang.String getCreationUser()
          Get the creation user
 java.lang.String getETag()
          Get the ETAG property (if any).
 java.lang.String getLastModified()
          Last modification date accessor.
 java.util.Date getLastModifiedAsDate()
          Creation date accessor.
 java.lang.String getModificationDate()
          Modification date accessor.
 java.lang.String getModificationUser()
          Get the mofications user
 java.lang.String getName()
          Name accessor.
 java.lang.String getNamespacedPropertyName(java.lang.String namespace, java.lang.String propertyName)
          Calculate the property name concatenated with the namespace, if available
 java.lang.String getOwner()
          Get the owner property (if any).
(package private)  java.util.Hashtable getProperties()
          Properties accessor.
 java.util.Enumeration getPropertiesNames()
          Deprecated. Replaced by enumeratePropertiesName
 java.util.Enumeration getPropertiesValues()
          Deprecated. Replaced by enumerate properties
 NodeProperty getProperty(java.lang.String name)
          Property accessor.
 NodeProperty getProperty(java.lang.String name, java.lang.String namespace)
          Property accessor.
 java.lang.String getResourceType()
          Get the ResourceType property (if any).
 NodeRevisionNumber getRevisionNumber()
          Revision number accessor.
 java.lang.String getSource()
          Get the source property (if any).
 boolean propertyValueContains(java.lang.String name, java.lang.String substr)
          Checks whether the value of the given property contains the specified substring.
 boolean propertyValueContains(java.lang.String name, java.lang.String namespace, java.lang.String substr)
          Checks whether the value of the given property contains the specified substring.
 void removeLabel(java.lang.String label)
          Remove a label.
 void removeLabels()
          Remove all labels.
 void removeProperty(NodeProperty property)
          Remove a property.
 void removeProperty(java.lang.String property)
          Remove a property.
 void removeProperty(java.lang.String property, java.lang.String nameSpace)
          Remove a property.
 void resetRemovedProperties()
           
 void resetUpdatedProperties()
           
(package private)  void setBranchName(java.lang.String branchName)
          Branch name mutator.
 void setContentLanguage(java.lang.String contentLanguage)
          Content language mutator.
 void setContentLength(long contentLength)
          Creation length mutator.
 void setContentLength(java.lang.String contentLength)
          Creation length mutator.
 void setContentType(java.lang.String contentType)
          Content type mutator.
 void setCreationDate(java.util.Date creationDate)
          Creation date mutator.
 void setCreationDate(java.lang.String creationDate)
          Creation date mutator.
 void setCreationUser(java.lang.String creationUser)
          Creation user mutator.
(package private)  void setDefaultProperties(java.util.Enumeration defaultProperties)
          Set default properties.
 void setETag(java.lang.String eTag)
          Set ETAG property.
 void setLastModified(java.util.Date lastModified)
          Last modified mutator.
 void setLastModified(java.lang.String lastModified)
          Last modified mutator.
 void setModificationDate(java.util.Date modificationDate)
          Modification date mutator.
 void setModificationDate(java.lang.String modificationDate)
          Modification date mutator.
 void setModificationUser(java.lang.String modificationUser)
          Modification user mutator.
 void setName(java.lang.String name)
          Name mutator.
 void setOwner(java.lang.String owner)
          Set owner property.
 void setOwner(java.lang.String owner, java.lang.String userpath)
          Set owner property.
(package private)  void setProperties(java.util.Hashtable properties)
          Properties mutator.
 void setProperty(NodeProperty property)
          Property mutatory.
 void setProperty(java.lang.String name, java.lang.Object value)
          Property mutator.
 void setProperty(java.lang.String name, java.lang.String namespace, java.lang.Object value)
          Property mutator.
 void setResourceType(java.lang.String resourceType)
          Set ResourceType property.
(package private)  void setRevisionNumber(NodeRevisionNumber number)
          Revision number mutator.
 void setSource(java.lang.String source)
          Set source property.
 void validate()
          Validate.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CREATION_DATE

public static final java.lang.String CREATION_DATE
Creation date.

See Also:
Constant Field Values

CREATION_USER

public static final java.lang.String CREATION_USER
See Also:
Constant Field Values

MODIFICATION_DATE

public static final java.lang.String MODIFICATION_DATE
See Also:
Constant Field Values

MODIFICATION_USER

public static final java.lang.String MODIFICATION_USER
See Also:
Constant Field Values

LAST_MODIFIED

public static final java.lang.String LAST_MODIFIED
Last modification date.

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
Name.

See Also:
Constant Field Values

RESOURCE_TYPE

public static final java.lang.String RESOURCE_TYPE
Type.

See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

SOURCE

public static final java.lang.String SOURCE
Source.

See Also:
Constant Field Values

OWNER

public static final java.lang.String OWNER
Owner.

See Also:
Constant Field Values

CONTENT_TYPE

public static final java.lang.String CONTENT_TYPE
MIME type of the content.

See Also:
Constant Field Values

CONTENT_LANGUAGE

public static final java.lang.String CONTENT_LANGUAGE
Content language.

See Also:
Constant Field Values

CONTENT_LENGTH

public static final java.lang.String CONTENT_LENGTH
Content length.

See Also:
Constant Field Values

ETAG

public static final java.lang.String ETAG
ETag.

See Also:
Constant Field Values

COLLECTION_TYPE

public static final java.lang.String COLLECTION_TYPE
Collection type.

See Also:
Constant Field Values

format

protected static final java.text.SimpleDateFormat format
HTTP date format.


formats

protected static final java.text.SimpleDateFormat[] formats
Date formats using for Date parsing.


creationDateFormat

protected static final java.text.SimpleDateFormat creationDateFormat
Simple date format for the creation date ISO representation (partial).

Constructor Detail

NodeRevisionDescriptor

public NodeRevisionDescriptor()
Constructor.


NodeRevisionDescriptor

public NodeRevisionDescriptor(long contentLength)
Constructor for client applications.


NodeRevisionDescriptor

public NodeRevisionDescriptor(NodeRevisionNumber number,
                              java.lang.String branchName,
                              java.util.Vector labels,
                              java.util.Hashtable properties)
Constructor used for retrieval. Can be used by client apps, but it is mostly useless as number and creationDate fields are ignored during revision creation.

Method Detail

getBranchName

public java.lang.String getBranchName()
Branch name accessor.


setBranchName

void setBranchName(java.lang.String branchName)
Branch name mutator.


getRevisionNumber

public NodeRevisionNumber getRevisionNumber()
Revision number accessor.


setRevisionNumber

void setRevisionNumber(NodeRevisionNumber number)
Revision number mutator.


addLabel

public void addLabel(java.lang.String label)
Add new label.


removeLabel

public void removeLabel(java.lang.String label)
Remove a label.


removeLabels

public void removeLabels()
Remove all labels.


enumerateLabels

public java.util.Enumeration enumerateLabels()
Enumerate labels.


getProperties

java.util.Hashtable getProperties()
Properties accessor.


setProperties

void setProperties(java.util.Hashtable properties)
Properties mutator.


exists

public boolean exists(java.lang.String name)
Tests if a property has been set.

Parameters:
name - Property name
Returns:
true if the property has been set

exists

public boolean exists(java.lang.String name,
                      java.lang.String namespace)
Tests if a property has been set.

Parameters:
name - Property name
Returns:
true if the property has been set

getProperty

public NodeProperty getProperty(java.lang.String name)
Property accessor.

Parameters:
name - Property name
Returns:
String property value

getProperty

public NodeProperty getProperty(java.lang.String name,
                                java.lang.String namespace)
Property accessor.

Parameters:
name - Property name
namespace - Property namespace
Returns:
String property value

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Property mutator.

Parameters:
name - Property name
value - Property value

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String namespace,
                        java.lang.Object value)
Property mutator.

Parameters:
name - Property name
value - Property value
namespace - Property value

setProperty

public void setProperty(NodeProperty property)
Property mutatory.

Parameters:
property - Property

removeProperty

public void removeProperty(NodeProperty property)
Remove a property.

Parameters:
property - Property

removeProperty

public void removeProperty(java.lang.String property)
Remove a property.

Parameters:
property - Property

removeProperty

public void removeProperty(java.lang.String property,
                           java.lang.String nameSpace)
Remove a property.

Parameters:
property - Property

getPropertiesNames

public java.util.Enumeration getPropertiesNames()
Deprecated. Replaced by enumeratePropertiesName

Properties names enumerator.

Returns:
Enumeration of the properties names

enumeratePropertiesName

public java.util.Enumeration enumeratePropertiesName()
Properties names enumerator.

Returns:
Enumeration of the properties names

getPropertiesValues

public java.util.Enumeration getPropertiesValues()
Deprecated. Replaced by enumerate properties

Properties values enumerator.

Returns:
Enumeration of the properties values

enumerateProperties

public java.util.Enumeration enumerateProperties()
Properties values enumerator.

Returns:
Enumeration of the properties values

enumerateRemovedProperties

public java.util.Enumeration enumerateRemovedProperties()

enumerateUpdatedProperties

public java.util.Enumeration enumerateUpdatedProperties()

resetUpdatedProperties

public void resetUpdatedProperties()

resetRemovedProperties

public void resetRemovedProperties()

propertyValueContains

public boolean propertyValueContains(java.lang.String name,
                                     java.lang.String substr)
Checks whether the value of the given property contains the specified substring.

Parameters:
name - the property name
substr - the substring to check
Returns:
true, if the value of the given property contains the specified substring

propertyValueContains

public boolean propertyValueContains(java.lang.String name,
                                     java.lang.String namespace,
                                     java.lang.String substr)
Checks whether the value of the given property contains the specified substring.

Parameters:
name - the property name
namespace - the namespace
substr - the substring to check
Returns:
true, if the value of the given property contains the specified substring

getName

public java.lang.String getName()
Name accessor.

Returns:
String name

setName

public void setName(java.lang.String name)
Name mutator.

Parameters:
name - New name

getETag

public java.lang.String getETag()
Get the ETAG property (if any).

Returns:
String

setETag

public void setETag(java.lang.String eTag)
Set ETAG property.

Parameters:
eTag - New etag

getOwner

public java.lang.String getOwner()
Get the owner property (if any).

Returns:
String

setOwner

public void setOwner(java.lang.String owner)
Set owner property.

Parameters:
owner - New owner

setOwner

public void setOwner(java.lang.String owner,
                     java.lang.String userpath)
Set owner property.

Parameters:
owner - New owner

getSource

public java.lang.String getSource()
Get the source property (if any).

Returns:
String

setSource

public void setSource(java.lang.String source)
Set source property.

Parameters:
source - New source

getResourceType

public java.lang.String getResourceType()
Get the ResourceType property (if any).

Returns:
String

setResourceType

public void setResourceType(java.lang.String resourceType)
Set ResourceType property.

Parameters:
resourceType - New ResourceType

getContentType

public java.lang.String getContentType()
Get the MIME content type of the data (if any).

Returns:
String

setContentType

public void setContentType(java.lang.String contentType)
Content type mutator.

Parameters:
contentType - New content type

getContentLanguage

public java.lang.String getContentLanguage()
Content language accessor.

Returns:
String content language

setContentLanguage

public void setContentLanguage(java.lang.String contentLanguage)
Content language mutator.

Parameters:
contentLanguage - New content language

getCreationDate

public java.lang.String getCreationDate()
Creation date accessor.

Returns:
String creation date

getModificationDate

public java.lang.String getModificationDate()
Modification date accessor.

Returns:
String modification date

getCreationUser

public java.lang.String getCreationUser()
Get the creation user

Returns:
String

getModificationUser

public java.lang.String getModificationUser()
Get the mofications user

Returns:
String

getCreationDateAsDate

public java.util.Date getCreationDateAsDate()
Creation date accessor.

Returns:
String creation date

setCreationDate

public void setCreationDate(java.util.Date creationDate)
Creation date mutator.

Parameters:
creationDate - New creation date

setModificationDate

public void setModificationDate(java.util.Date modificationDate)
Modification date mutator.

Parameters:
modificationDate - New modification date

setModificationDate

public void setModificationDate(java.lang.String modificationDate)
Modification date mutator.

Parameters:
modificationDate - New modification date

setCreationUser

public void setCreationUser(java.lang.String creationUser)
Creation user mutator.

Parameters:
creationUser - New creation user

setModificationUser

public void setModificationUser(java.lang.String modificationUser)
Modification user mutator.

Parameters:
modificationUser - New modification user

setCreationDate

public void setCreationDate(java.lang.String creationDate)
Creation date mutator.

Parameters:
creationDate - New creation date

getLastModified

public java.lang.String getLastModified()
Last modification date accessor.

Returns:
String last modification date

getLastModifiedAsDate

public java.util.Date getLastModifiedAsDate()
Creation date accessor.

Returns:
String creation date

setLastModified

public void setLastModified(java.util.Date lastModified)
Last modified mutator.

Parameters:
lastModified - New last modified date

setLastModified

public void setLastModified(java.lang.String lastModified)
Last modified mutator.

Parameters:
lastModified - New last modified

setContentLength

public void setContentLength(long contentLength)
Creation length mutator.

Parameters:
contentLength - New content length

setContentLength

public void setContentLength(java.lang.String contentLength)
Creation length mutator.

Parameters:
contentLength - New content length

getContentLength

public long getContentLength()
Content length accessor.

Returns:
String

setDefaultProperties

void setDefaultProperties(java.util.Enumeration defaultProperties)
Set default properties.


getNamespacedPropertyName

public java.lang.String getNamespacedPropertyName(java.lang.String namespace,
                                                  java.lang.String propertyName)
Calculate the property name concatenated with the namespace, if available

Parameters:
namespace - the namespace name, possibly null
Returns:
propertyName the property name

cloneObject

public NodeRevisionDescriptor cloneObject()
Clone.

Returns:
Object clone

equals

public boolean equals(java.lang.Object obj)
Equals.

Parameters:
obj - Object to test
Returns:
boolean True if the two object are equal :
  • obj is of type NodeRevisionDescriptor and is not null
  • The two revision numbers are equal

  • validate

    public void validate()
    Validate.