org.apache.slide.content
Class NodeRevisionDescriptor

java.lang.Object
  |
  +--org.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.19 $
Author:
Remy Maucherat
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.
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 NAME
          Name.
static java.lang.String SOURCE
          Source.
static java.lang.String TYPE
          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
(package private) static void ()
           
 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.
 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 getLastModified()
          Last modification date accessor.
 java.util.Date getLastModifiedAsDate()
          Creation date accessor.
 java.lang.String getName()
          Name accessor.
(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.
 NodeRevisionNumber getRevisionNumber()
          Revision number accessor.
 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.
(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.
(package private)  void setDefaultProperties(java.util.Enumeration defaultProperties)
          Set default properties.
 void setLastModified(java.util.Date lastModified)
          Last modified mutator.
 void setLastModified(java.lang.String lastModified)
          Last modified mutator.
 void setName(java.lang.String name)
          Name mutator.
(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.
protected  void setProperty(java.lang.String name, java.lang.Object value, boolean standard)
          Property mutator.
 void setProperty(java.lang.String name, java.lang.String namespace, java.lang.Object value)
          Property mutator.
(package private)  void setRevisionNumber(NodeRevisionNumber number)
          Revision number mutator.
 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.

LAST_MODIFIED

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

NAME

public static final java.lang.String NAME
Name.

TYPE

public static final java.lang.String TYPE
Type.

SOURCE

public static final java.lang.String SOURCE
Source.

CONTENT_TYPE

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

CONTENT_LANGUAGE

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

CONTENT_LENGTH

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

ETAG

public static final java.lang.String ETAG
ETag.

COLLECTION_TYPE

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

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

static void ()

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

protected void setProperty(java.lang.String name,
                           java.lang.Object value,
                           boolean standard)
Property mutator.
Parameters:
name - Property name
value - Property value
standard - True if one of the standrad properties

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

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

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

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

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:
creationLength - New content length

setContentLength

public void setContentLength(java.lang.String contentLength)
Creation length mutator.
Parameters:
creationLength - New content length

getContentLength

public long getContentLength()
Content length accessor.
Returns:
String

setDefaultProperties

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

cloneObject

public NodeRevisionDescriptor cloneObject()
Clone.
Returns:
Object clone

equals

public boolean equals(java.lang.Object obj)
Equals.
Overrides:
equals in class java.lang.Object
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.