org.opencms.db
Class CmsAlias

java.lang.Object
  extended by org.opencms.db.CmsAlias

public class CmsAlias
extends java.lang.Object

This class represents an alias from a virtual path to a resource in the VFS.


Field Summary
static java.util.regex.Pattern ALIAS_PATTERN
          The regular expression which describes valid alias paths: one or more segments, each consisting of a slash at the front followed by one or more 'unreserved characters' for URIs (see RFC 2396).
protected  java.lang.String m_aliasPath
          The alias path.
protected  CmsAliasMode m_mode
          The alias mode.
protected  java.lang.String m_siteRoot
          The site root for the alias.
protected  CmsUUID m_structureId
          The structure id of the aliased page.
 
Constructor Summary
CmsAlias(CmsUUID structureId, java.lang.String siteRoot, java.lang.String aliasPath, CmsAliasMode mode)
          Creates a new alias.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getAliasPath()
          Gets the alias path.
 CmsAliasMode getMode()
          Gets the alias mode.
 java.lang.String getSiteRoot()
          Gets the alias site root.
 CmsUUID getStructureId()
          Gets the structure id of the aliased resource.
 int hashCode()
           
 boolean isPermanentRedirect()
          Checks whether the mode of the alias is 'permanent redirect'.
 boolean isRedirect()
          Checks whether the mode of the alias is a redirect type (permanent or temporary).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIAS_PATTERN

public static final java.util.regex.Pattern ALIAS_PATTERN
The regular expression which describes valid alias paths: one or more segments, each consisting of a slash at the front followed by one or more 'unreserved characters' for URIs (see RFC 2396).


m_aliasPath

protected java.lang.String m_aliasPath
The alias path.


m_mode

protected CmsAliasMode m_mode
The alias mode.


m_siteRoot

protected java.lang.String m_siteRoot
The site root for the alias.


m_structureId

protected CmsUUID m_structureId
The structure id of the aliased page.

Constructor Detail

CmsAlias

public CmsAlias(CmsUUID structureId,
                java.lang.String siteRoot,
                java.lang.String aliasPath,
                CmsAliasMode mode)
Creates a new alias.

Parameters:
structureId - the structure id of the aliased page
siteRoot - the site root of the alias
aliasPath - the alias path
mode - the alias mode
Method Detail

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getAliasPath

public java.lang.String getAliasPath()
Gets the alias path.

Returns:
the alias path

getMode

public CmsAliasMode getMode()
Gets the alias mode.

Returns:
the alias mode

getSiteRoot

public java.lang.String getSiteRoot()
Gets the alias site root.

Returns:
the alias site root

getStructureId

public CmsUUID getStructureId()
Gets the structure id of the aliased resource.

Returns:
the structure id of the aliased resource

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

isPermanentRedirect

public boolean isPermanentRedirect()
Checks whether the mode of the alias is 'permanent redirect'.

Returns:
true if the mode of the alias is 'permanent redirect'

isRedirect

public boolean isRedirect()
Checks whether the mode of the alias is a redirect type (permanent or temporary).

Returns:
true if the mode of the alias is a redirect type