org.opencms.file
Class CmsGroup

java.lang.Object
  extended by org.opencms.security.CmsPrincipal
      extended by org.opencms.file.CmsGroup
All Implemented Interfaces:
java.lang.Comparable, java.security.Principal, I_CmsPrincipal

public class CmsGroup
extends CmsPrincipal

A group principal in the OpenCms permission system.

Since:
6.0.0
Version:
$Revision: 1.28 $
Author:
Alexander Kandzior, Michael Emmerich
See Also:
CmsUser

Field Summary
 
Fields inherited from class org.opencms.security.CmsPrincipal
m_description, m_flags, m_id, m_name
 
Fields inherited from interface org.opencms.security.I_CmsPrincipal
FLAG_CORE_LIMIT, FLAG_DISABLED, FLAG_ENABLED, FLAG_GROUP_PROJECT_MANAGER, FLAG_GROUP_PROJECT_USER, FLAG_GROUP_ROLE, FLAG_GROUP_VIRTUAL, FLAG_USER_MANAGED, FLAG_USER_WEBUSER, PRINCIPAL_GROUP, PRINCIPAL_USER
 
Constructor Summary
CmsGroup()
          Creates a new, empty OpenCms group principal.
CmsGroup(CmsUUID id, CmsUUID parentId, java.lang.String name, java.lang.String description, int flags)
          Creates a new OpenCms group principal.
 
Method Summary
 void checkName(java.lang.String name)
          Checks if the provided group name is valid and can be used as an argument value for CmsPrincipal.setName(String).
 java.lang.Object clone()
           
 java.lang.String getDescription(java.util.Locale locale)
          Returns the description of this organizational unit.
 boolean getDisabled()
          Deprecated. use CmsPrincipal.isEnabled() instead
 CmsUUID getParentId()
          Returns the parent group id of this group.
 boolean isGroup()
          Returns true if this principal is of type CmsGroup.
 boolean isProjectCoWorker()
          Returns true if this group is enabled as a project user group.
 boolean isProjectManager()
          Returns true if this group is enabled as a project manager group.
 boolean isRole()
          Checks if this group is a role group.
 boolean isUser()
          Returns true if this principal is of type CmsUser.
 boolean isVirtual()
          Checks if this group is a virtual group, emulating a role.
 void setDisabled()
          Deprecated. use CmsPrincipal.setEnabled(boolean) instead
 void setEnabled()
          Deprecated. use CmsPrincipal.setEnabled(boolean) instead
 void setParentId(CmsUUID parentId)
          Sets the parent group id of this group.
 void setProjectCoWorker(boolean value)
          Sets the project user flag for this group to the given value.
 void setProjectManager(boolean value)
          Sets the project manager flag for this group to the given value.
 java.lang.String toString()
           
 
Methods inherited from class org.opencms.security.CmsPrincipal
compareTo, equals, filterCore, filterCoreFlag, filterFlag, getDescription, getDisplayName, getFlags, getId, getName, getOuFqn, getPrefixedGroup, getPrefixedName, getPrefixedUser, getSimpleName, hashCode, isEnabled, readPrefixedPrincipal, readPrincipal, readPrincipal, readPrincipalIncludingHistory, setDescription, setEnabled, setFlags, setName
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CmsGroup

public CmsGroup()
Creates a new, empty OpenCms group principal.


CmsGroup

public CmsGroup(CmsUUID id,
                CmsUUID parentId,
                java.lang.String name,
                java.lang.String description,
                int flags)
Creates a new OpenCms group principal.

Parameters:
id - the unique id of the group
parentId - the is of the parent group
name - the fully qualified name of the name of the group
description - the description of the group
flags - the flags of the group
Method Detail

checkName

public void checkName(java.lang.String name)
Checks if the provided group name is valid and can be used as an argument value for CmsPrincipal.setName(String).

A group name must not be empty or whitespace only.

Parameters:
name - the group name to check
See Also:
I_CmsValidationHandler.checkGroupName(String)

clone

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

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

getDisabled

public boolean getDisabled()
Deprecated. use CmsPrincipal.isEnabled() instead

Returns true if this group is disabled.

Returns:
true if this group is disabled

getParentId

public CmsUUID getParentId()
Returns the parent group id of this group.

Returns:
the parent group id of this group

isGroup

public boolean isGroup()
Description copied from interface: I_CmsPrincipal
Returns true if this principal is of type CmsGroup.

Specified by:
isGroup in interface I_CmsPrincipal
Overrides:
isGroup in class CmsPrincipal
Returns:
true if this principal is of type CmsGroup
See Also:
I_CmsPrincipal.isGroup()

isProjectCoWorker

public boolean isProjectCoWorker()
Returns true if this group is enabled as a project user group.

Returns:
true if this group is enabled as a project user group

isProjectManager

public boolean isProjectManager()
Returns true if this group is enabled as a project manager group.

Returns:
true if this group is enabled as a project manager group

isRole

public boolean isRole()
Checks if this group is a role group.

Returns:
true if this group is a role group

isUser

public boolean isUser()
Description copied from interface: I_CmsPrincipal
Returns true if this principal is of type CmsUser.

Specified by:
isUser in interface I_CmsPrincipal
Overrides:
isUser in class CmsPrincipal
Returns:
true if this principal is of type CmsUser
See Also:
I_CmsPrincipal.isUser()

isVirtual

public boolean isVirtual()
Checks if this group is a virtual group, emulating a role.

Returns:
if this group is a virtual group

setDisabled

public void setDisabled()
Deprecated. use CmsPrincipal.setEnabled(boolean) instead

Disables this group.


setEnabled

public void setEnabled()
Deprecated. use CmsPrincipal.setEnabled(boolean) instead

Enables this group.


setParentId

public void setParentId(CmsUUID parentId)
Sets the parent group id of this group.

Parameters:
parentId - the parent group id to set

setProjectCoWorker

public void setProjectCoWorker(boolean value)
Sets the project user flag for this group to the given value.

Parameters:
value - the value to set

setProjectManager

public void setProjectManager(boolean value)
Sets the project manager flag for this group to the given value.

Parameters:
value - the value to set

toString

public java.lang.String toString()
Specified by:
toString in interface java.security.Principal
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()