org.opencms.file.history
Interface I_CmsHistoryResource

All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable
All Known Implementing Classes:
CmsHistoryFile, CmsHistoryFolder

public interface I_CmsHistoryResource
extends java.lang.Cloneable, java.io.Serializable, java.lang.Comparable

A historical version of a resource in the OpenCms VFS resource history.

History resources are resources that contain additional information used to describe the historical state.

The historical resource object extends the resource object since it be an history for a file as well as for a folder.

History resources contain the names of the users that created or last modified the resource as string obejcts because a user id might have been deleted.

Since:
6.9.1
Version:
$Revision: 1.3 $
Author:
Michael Moossen

Method Summary
 CmsUUID getBackupId()
          Deprecated. this field has been removed
 java.lang.String getCreatedByName()
          Deprecated. use {#getUserCreated()} instead now the CmsObject.readUser(CmsUUID) also returns historical users
 long getDateContent()
          Returns the date of the last modification of the content of this resource.
 long getDateCreated()
          Returns the date of the creation of this resource.
 long getDateExpired()
          Returns the expiration date this resource.
 long getDateLastModified()
          Returns the date of the last modification of this resource.
 long getDateReleased()
          Returns the release date this resource.
 int getFlags()
          Returns the flags of this resource.
 java.lang.String getLastModifiedByName()
          Deprecated. use {#getUserLastModified()} instead with CmsPrincipal.readPrincipalIncludingHistory(org.opencms.file.CmsObject, CmsUUID)
 int getLength()
          Returns the length of the resource.
 java.lang.String getName()
          Returns the name of this resource, e.g.
 CmsUUID getParentId()
          Returns the structure id of the parent resource.
 CmsUUID getProjectLastModified()
          Returns the id of the project where the resource has been last modified.
 int getPublishTag()
          Returns the publish tag of this historical resource.
 int getPublishTagId()
          Deprecated. use getPublishTag() instead
 CmsUUID getResourceId()
          Returns the id of the resource database entry of this resource.
 int getResourceVersion()
          Returns the version number of the resource part for this historical resource.
 java.lang.String getRootPath()
          Returns the name of a resource with it's full path from the root folder including the current site root, for example /sites/default/myfolder/index.html.
 int getSiblingCount()
          Returns the number of siblings of the resource, also counting this resource.
 CmsResourceState getState()
          Returns the state of this resource.
 CmsUUID getStructureId()
          Returns the id of the structure record of this resource.
 int getStructureVersion()
          Returns the version number of the structure part for this historical resource.
 int getTypeId()
          Returns the resource type id for this resource.
 CmsUUID getUserCreated()
          Returns the user id of the user who created this resource.
 CmsUUID getUserLastModified()
          Returns the user id of the user who made the last change on this resource.
 int getVersion()
          Returns the version number of this historical resource.
 boolean isExpired(long time)
          Returns true if this resource is expired at the given time according to the information stored in getDateExpired().
 boolean isFile()
          Returns true if the resource is a file, i.e. can have no sub-resources.
 boolean isFolder()
          Returns true if the resource is a folder, i.e. can have sub-resources.
 boolean isInternal()
          Checks if the resource is internal.
 boolean isLabeled()
          Checks if the link has to be labeled with a special icon in the explorer view.
 boolean isReleased(long time)
          Returns true if this resource is released at the given time according to the information stored in getDateReleased().
 boolean isReleasedAndNotExpired(long time)
          Returns true if this resource is valid at the given time according to the information stored in getDateReleased() and getDateExpired().
 boolean isTouched()
          Returns true if this resource was touched.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getBackupId

public CmsUUID getBackupId()
Deprecated. this field has been removed

Returns the history id of this historical resource.

Returns:
the history id of this historical resource

getCreatedByName

public java.lang.String getCreatedByName()
Deprecated. use {#getUserCreated()} instead now the CmsObject.readUser(CmsUUID) also returns historical users

Returns the user name of the creator of this historical resource.

Returns:
the user name of the creator of this historical resource

getDateContent

public long getDateContent()
Returns the date of the last modification of the content of this resource.

Returns:
the date of the last modification of the content of this resource

getDateCreated

public long getDateCreated()
Returns the date of the creation of this resource.

Returns:
the date of the creation of this resource

getDateExpired

public long getDateExpired()
Returns the expiration date this resource.

Returns:
the expiration date of this resource

getDateLastModified

public long getDateLastModified()
Returns the date of the last modification of this resource.

Returns:
the date of the last modification of this resource

getDateReleased

public long getDateReleased()
Returns the release date this resource.

Returns:
the release date of this resource

getFlags

public int getFlags()
Returns the flags of this resource.

Returns:
the flags of this resource

getLastModifiedByName

public java.lang.String getLastModifiedByName()
Deprecated. use {#getUserLastModified()} instead with CmsPrincipal.readPrincipalIncludingHistory(org.opencms.file.CmsObject, CmsUUID)

Returns the name of the user who last changed this historical resource.

Returns:
the name of the user who last changed this historical resource

getLength

public int getLength()
Returns the length of the resource.

If the resource is a file, then this is the byte size of the file content. If the resource is a folder, then the size is always -1.

Returns:
the length of the content

getName

public java.lang.String getName()
Returns the name of this resource, e.g. index.html.

Returns:
the name of this resource

getParentId

public CmsUUID getParentId()
Returns the structure id of the parent resource.

Returns:
the structure id of the parent resource

getProjectLastModified

public CmsUUID getProjectLastModified()
Returns the id of the project where the resource has been last modified.

Returns:
the id of the project where the resource has been last modified, or null

getPublishTag

public int getPublishTag()
Returns the publish tag of this historical resource.

Returns:
the publish tag of this historical resource

getPublishTagId

public int getPublishTagId()
Deprecated. use getPublishTag() instead

Returns the publish tag of this historical resource.

Returns:
the publish tag of this historical resource

getResourceId

public CmsUUID getResourceId()
Returns the id of the resource database entry of this resource.

Returns:
the id of the resource database entry

getResourceVersion

public int getResourceVersion()
Returns the version number of the resource part for this historical resource.

Returns:
the version number of the resource part for this historical resource

getRootPath

public java.lang.String getRootPath()
Returns the name of a resource with it's full path from the root folder including the current site root, for example /sites/default/myfolder/index.html.

Returns:
the name of a resource with it's full path from the root folder including the current site root

getSiblingCount

public int getSiblingCount()
Returns the number of siblings of the resource, also counting this resource.

If a resource has no sibling, the total sibling count for this resource is 1, if a resource has n siblings, the sibling count is n + 1.

Returns:
the number of siblings

getState

public CmsResourceState getState()
Returns the state of this resource.

Returns:
the state of this resource

getStructureId

public CmsUUID getStructureId()
Returns the id of the structure record of this resource.

Returns:
the id of the structure record of this resource

getStructureVersion

public int getStructureVersion()
Returns the version number of the structure part for this historical resource.

Returns:
the version number of the structure part for this historical resource

getTypeId

public int getTypeId()
Returns the resource type id for this resource.

Returns:
the resource type id of this resource

getUserCreated

public CmsUUID getUserCreated()
Returns the user id of the user who created this resource.

Returns:
the user id

getUserLastModified

public CmsUUID getUserLastModified()
Returns the user id of the user who made the last change on this resource.

Returns:
the user id of the user who made the last change


getVersion

public int getVersion()
Returns the version number of this historical resource.

Returns:
the version number of this historical resource

isExpired

public boolean isExpired(long time)
Returns true if this resource is expired at the given time according to the information stored in getDateExpired().

Parameters:
time - the time to check the expiration date against
Returns:
true if this resource is expired at the given time
See Also:
isReleased(long), isReleasedAndNotExpired(long)

isFile

public boolean isFile()
Returns true if the resource is a file, i.e. can have no sub-resources.

Returns:
true if this resource is a file, false otherwise

isFolder

public boolean isFolder()
Returns true if the resource is a folder, i.e. can have sub-resources.

Returns:
true if this resource is a folder, false otherwise

isInternal

public boolean isInternal()
Checks if the resource is internal.

This state is stored as bit 1 in the resource flags.

Returns:
true if the resource is internal, otherwise false

isLabeled

public boolean isLabeled()
Checks if the link has to be labeled with a special icon in the explorer view.

This state is stored as bit 2 in the resource flags.

Returns:
true if a link to the resource has to be labeled, otherwise false

isReleased

public boolean isReleased(long time)
Returns true if this resource is released at the given time according to the information stored in getDateReleased().

Parameters:
time - the time to check the release date against
Returns:
true if this resource is released at the given time
See Also:
isExpired(long), isReleasedAndNotExpired(long)

isReleasedAndNotExpired

public boolean isReleasedAndNotExpired(long time)
Returns true if this resource is valid at the given time according to the information stored in getDateReleased() and getDateExpired().

A resource is valid if it is released and not yet expired.

Parameters:
time - the time to check the release and expiration date against
Returns:
true if this resource is valid at the given time
See Also:
isExpired(long), isReleased(long)

isTouched

public boolean isTouched()
Returns true if this resource was touched.

Returns:
boolean true if this resource was touched