org.opencms.security
Class CmsOrganizationalUnit

java.lang.Object
  extended by org.opencms.security.CmsOrganizationalUnit

public class CmsOrganizationalUnit
extends java.lang.Object

An organizational unit in OpenCms.

Since:
6.5.6
Version:
$Revision: 1.2 $
Author:
Michael Moossen

Field Summary
static java.lang.String SEPARATOR
          The character used to separate each level in a fully qualified name.
 
Constructor Summary
CmsOrganizationalUnit(CmsUUID id, java.lang.String fqn, java.lang.String description, int flags, CmsUUID projectId)
          Creates a new OpenCms organizational unit principal.
 
Method Summary
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getDescription()
          Returns the description of this organizational unit.
 java.lang.String getDescription(java.util.Locale locale)
          Returns the description of this organizational unit.
 java.lang.String getDisplayName(java.util.Locale locale)
          Returns the display name for this organizational unit.
 int getFlags()
          Returns the flags of this organizational unit.
 CmsUUID getId()
          Returns the id of this organizational unit.
 java.lang.String getName()
          Returns the fully qualified name of this organizational unit.
 java.lang.String getParentFqn()
          Returns the full qualified name of the parent organizational unit of this organizational unit.
static java.lang.String getParentFqn(java.lang.String fqn)
          Returns the parent fully qualified name.
 CmsUUID getProjectId()
          Returns the id of the related default project.
 java.lang.String getSimpleName()
          Returns the simple name of this organizational unit.
static java.lang.String getSimpleName(java.lang.String fqn)
          Returns the last name of the given fully qualified name.
 int hashCode()
           
static java.lang.String removeLeadingSeparator(java.lang.String fqn)
          Returns the given fully qualified name without leading separator.
 void setDescription(java.lang.String description)
          Sets the description of this organizational unit.
 void setFlags(int value)
          Sets this organizational unit flags to the specified value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR

public static final java.lang.String SEPARATOR
The character used to separate each level in a fully qualified name.

See Also:
Constant Field Values
Constructor Detail

CmsOrganizationalUnit

public CmsOrganizationalUnit(CmsUUID id,
                             java.lang.String fqn,
                             java.lang.String description,
                             int flags,
                             CmsUUID projectId)
Creates a new OpenCms organizational unit principal.

Parameters:
id - the unique id of the organizational unit
fqn - the fully qualified name of the this organizational unit (should end with slash)
description - the description of the organizational unit
flags - the flags of the organizational unit
projectId - the id of the related default project
Method Detail

getParentFqn

public static final java.lang.String getParentFqn(java.lang.String fqn)
Returns the parent fully qualified name.

This is null for the root ou, and the empty string for first level ous.

Parameters:
fqn - the fully qualified name to get the parent from
Returns:
the parent fully qualified name

getSimpleName

public static final java.lang.String getSimpleName(java.lang.String fqn)
Returns the last name of the given fully qualified name.

Parameters:
fqn - the fully qualified name to get the last name from
Returns:
the last name of the given fully qualified name

removeLeadingSeparator

public static java.lang.String removeLeadingSeparator(java.lang.String fqn)
Returns the given fully qualified name without leading separator.

Parameters:
fqn - the fully qualified name to fix
Returns:
the given fully qualified name without leading separator

clone

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

equals

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

getDescription

public java.lang.String getDescription()
Returns the description of this organizational unit.

This could return also just a macro, so please use the getDescription(Locale) method.

Returns:
the description of this organizational unit

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Returns the description of this organizational unit.

Parameters:
locale - the locale
Returns:
the description of this organizational unit

getDisplayName

public java.lang.String getDisplayName(java.util.Locale locale)
Returns the display name for this organizational unit.

Parameters:
locale - the locale
Returns:
the display name for this organizational unit

getFlags

public int getFlags()
Returns the flags of this organizational unit.

The organizational unit flags are used to store special information about the organizational unit state encoded bitwise. Usually the flags int value should not be directly accessed.

Returns:
the flags of this organizational unit

getId

public CmsUUID getId()
Returns the id of this organizational unit.

Returns:
the id of this organizational unit.

getName

public java.lang.String getName()
Returns the fully qualified name of this organizational unit.

Returns:
the fully qualified name of this organizational unit

getParentFqn

public java.lang.String getParentFqn()
Returns the full qualified name of the parent organizational unit of this organizational unit.

This is null for the root ou, and the empty string for first level ous.

Returns:
the full qualified name of the parent organizational unit of this organizational unit

getProjectId

public CmsUUID getProjectId()
Returns the id of the related default project.

Returns:
the id of the related default project

getSimpleName

public java.lang.String getSimpleName()
Returns the simple name of this organizational unit.

Returns:
the simple name of this organizational unit.

hashCode

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

setDescription

public void setDescription(java.lang.String description)
Sets the description of this organizational unit.

Parameters:
description - the principal organizational unit to set

setFlags

public void setFlags(int value)
Sets this organizational unit flags to the specified value.

The organizational unit flags are used to store special information about the organizational units state encoded bitwise. Usually the flags int value should not be directly accessed.

Parameters:
value - the value to set this organizational units flags to

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()