org.opencms.file
Class CmsGroup

java.lang.Object
  extended byorg.opencms.file.CmsGroup
All Implemented Interfaces:
I_CmsPrincipal

public class CmsGroup
extends Object
implements I_CmsPrincipal

A group in the OpenCms permission system.

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

Field Summary
 
Fields inherited from interface org.opencms.security.I_CmsPrincipal
FLAG_DISABLED, FLAG_ENABLED, FLAG_GROUP_PROJECT_MANAGER, FLAG_GROUP_PROJECT_USER, FLAG_GROUP_WORKFLOW_ROLE, PRINCIPAL_GROUP, PRINCIPAL_USER
 
Constructor Summary
CmsGroup()
          Default Constructor.
CmsGroup(CmsUUID id, CmsUUID parentId, String name, String description, int flags)
          Constructor, creates a new Cms group object.
 
Method Summary
static void checkName(String name)
          Validates a group name.
 Object clone()
          Returns a clone of this Objects instance.
 boolean equals(Object obj)
          Compares the given object with this principal.
 String getDescription()
          Returns the description of this group.
 boolean getDisabled()
          Returns true if this group is disabled.
 int getFlags()
          Returns this groups flags.
 CmsUUID getId()
          Returns the id of this group.
 String getName()
          Returns the name of this group.
 CmsUUID getParentId()
          Returns the parent id of this group, or UNKNOWN_ID.
 boolean getProjectCoWorker()
          Returns true if this group is enabled as a project user group.
 boolean getProjectManager()
          Returns true if this group is enabled as a project manager group.
 boolean getRole()
          Returns true if this group is enabled as a role for tasks group.
 int hashCode()
          Returns the hash code of this object.
 boolean isEnabled()
          Returns the enabled flag.
 void setDescription(String description)
          Sets the description of this group.
 void setDisabled()
          Disables this group by setting the FLAG_DISABLED flag.
 void setEnabled()
          Enables this group by setting the FLAG_ENABLED flag.
 void setEnabled(boolean enabled)
          Sets the enabled flag.
 void setName(String name)
          Sets the name.
 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.
 void setRole(boolean value)
          Sets the "role for tasks" flag for this group to the given value.
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CmsGroup

public CmsGroup()
Default Constructor.


CmsGroup

public CmsGroup(CmsUUID id,
                CmsUUID parentId,
                String name,
                String description,
                int flags)
Constructor, creates a new Cms group object.

Parameters:
id - the id of the group
parentId - the parent group of the group (or UNKNOWN_ID)
name - the name of the group
description - the description of the group
flags - the flags of the group
Method Detail

checkName

public static void checkName(String name)
Validates a group name.

The parameter should not be empty.

Parameters:
name - the login to validate

clone

public Object clone()
Returns a clone of this Objects instance.

Returns:
a clone of this instance

equals

public boolean equals(Object obj)
Description copied from interface: I_CmsPrincipal
Compares the given object with this principal.

Specified by:
equals in interface I_CmsPrincipal
See Also:
Object.equals(java.lang.Object)

getDescription

public String getDescription()
Returns the description of this group.

Returns:
the description of this group

getDisabled

public boolean getDisabled()
Returns true if this group is disabled.

Returns:
true if this group is disabled

getFlags

public int getFlags()
Returns this groups flags.

Returns:
this groups flags

getId

public CmsUUID getId()
Returns the id of this group.

Specified by:
getId in interface I_CmsPrincipal
Returns:
id the id of this group

getName

public String getName()
Returns the name of this group.

Specified by:
getName in interface I_CmsPrincipal
Returns:
name the name of this group

getParentId

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

Returns:
the parent id of this group

getProjectCoWorker

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

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

getProjectManager

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

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

getRole

public boolean getRole()
Returns true if this group is enabled as a role for tasks group.

Returns:
true if this group is enabled as a role for tasks group

hashCode

public int hashCode()
Description copied from interface: I_CmsPrincipal
Returns the hash code of this object.

Specified by:
hashCode in interface I_CmsPrincipal
See Also:
Object.hashCode()

isEnabled

public boolean isEnabled()
Returns the enabled flag.

It should replace the getDisabled() method.

Returns:
the enabled flag

setDescription

public void setDescription(String description)
Sets the description of this group.

Parameters:
description - the description of this group

setDisabled

public void setDisabled()
Disables this group by setting the FLAG_DISABLED flag.


setEnabled

public void setEnabled()
Enables this group by setting the FLAG_ENABLED flag.


setEnabled

public void setEnabled(boolean enabled)
Sets the enabled flag.

It should replace the setDisabled() and the setEnabled() methods.

Parameters:
enabled - the enabled flag

setName

public void setName(String name)
Sets the name.

Parameters:
name - the name to set

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

setRole

public void setRole(boolean value)
Sets the "role for tasks" flag for this group to the given value.

Parameters:
value - the value to set

toString

public String toString()
See Also:
Object.toString()