com.elasticpath.domain.cmuser.impl
Class UserRoleImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractEntityImpl
              extended by com.elasticpath.domain.cmuser.impl.UserRoleImpl
All Implemented Interfaces:
UserRole, Entity, EpDomain, Persistence, java.io.Serializable, org.acegisecurity.GrantedAuthority

public class UserRoleImpl
extends AbstractEntityImpl
implements UserRole

The default implementation of UserRole.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Fields inherited from interface com.elasticpath.domain.cmuser.UserRole
DEFAULT_USERROLE, ROLE_PROFIX, SUPERUSER
 
Constructor Summary
UserRoleImpl()
           
 
Method Summary
 java.lang.String getAuthority()
          Gets the authority for this UserRole.
 java.lang.String getDescription()
          Gets the description of this UserRole.
 java.lang.String getName()
          Gets the name of this UserRole.
 java.util.Set getUserPermissions()
          Gets the Permissions associated with this Role.
 boolean isDefaultUserRole()
          Return true if this is the default USER role.
 boolean isSuperUserRole()
          Return true if this is the SUPERUSER role.
 void setDefaultValues()
          Set default values for those fields need default values.
 void setDescription(java.lang.String description)
          Sets the description of this UserRole.
 void setName(java.lang.String name)
          Sets the name of this UserRole.
 void setUserPermissions(java.util.Set userPermissions)
          Sets the Permissions associated with this UserRole.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEntityImpl
convertAttributeGroupAttributes, getGuid, setGuid
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.Entity
getGuid, setGuid
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

UserRoleImpl

public UserRoleImpl()
Method Detail

getAuthority

public java.lang.String getAuthority()
Gets the authority for this UserRole.

Specified by:
getAuthority in interface org.acegisecurity.GrantedAuthority
Returns:
the authority as an identifier of the userRole.

getDescription

public java.lang.String getDescription()
Gets the description of this UserRole.

Specified by:
getDescription in interface UserRole
Returns:
the userRole description.

getName

public java.lang.String getName()
Gets the name of this UserRole.

Specified by:
getName in interface UserRole
Returns:
the userRole name.

getUserPermissions

public java.util.Set getUserPermissions()
Gets the Permissions associated with this Role.

Specified by:
getUserPermissions in interface UserRole
Returns:
the set of userPermissions.

isDefaultUserRole

public boolean isDefaultUserRole()
Return true if this is the default USER role.

Specified by:
isDefaultUserRole in interface UserRole
Returns:
true if this is the default USER role; otherwise, false.

isSuperUserRole

public boolean isSuperUserRole()
Return true if this is the SUPERUSER role.

Specified by:
isSuperUserRole in interface UserRole
Returns:
true if this is the SUPERUSER role; otherwise, false.

setDefaultValues

public void setDefaultValues()
Set default values for those fields need default values.

Specified by:
setDefaultValues in interface Persistence
Overrides:
setDefaultValues in class AbstractEntityImpl

setDescription

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

Specified by:
setDescription in interface UserRole
Parameters:
description - the userRole description.

setName

public void setName(java.lang.String name)
             throws EpDomainException
Sets the name of this UserRole.

Specified by:
setName in interface UserRole
Parameters:
name - the userRole name.
Throws:
EpDomainException - if the given name is null or an empty string.

setUserPermissions

public void setUserPermissions(java.util.Set userPermissions)
Sets the Permissions associated with this UserRole.

Specified by:
setUserPermissions in interface UserRole
Parameters:
userPermissions - the new set of userPermissions.