com.elasticpath.domain.cmuser.impl
Class UserPermissionImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractPersistenceImpl
          extended by com.elasticpath.domain.impl.AbstractValueObjectImpl
              extended by com.elasticpath.domain.cmuser.impl.UserPermissionImpl
All Implemented Interfaces:
UserPermission, EpDomain, Persistence, ValueObject, java.io.Serializable, org.acegisecurity.GrantedAuthority

public class UserPermissionImpl
extends AbstractValueObjectImpl
implements UserPermission

The default implementation of UserPermission.

See Also:
Serialized Form

Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
UserPermissionImpl()
           
 
Method Summary
 java.lang.String getAuthority()
          Gets the authority for this Permission.
 java.lang.String getDisplayText()
          Gets the displayText for this Permission for the system default locale.
 java.lang.String getDisplayText(java.util.Locale locale)
          Gets the displayText for this Permission of the given locale.
 java.lang.String getPermissionGroup()
          Gets the group that this Permission is in.
 void init()
          Initializes the UserPermission object given its authority.
 void setAuthority(java.lang.String authority)
          Sets the authority for this Permission.
 void setDisplayText(java.lang.String displayText)
          Sets the default displayText for this Permission.
 void setPermissionGroup(java.lang.String permissionGroup)
          Sets the group that this Permission is in.
 
Methods inherited from class com.elasticpath.domain.impl.AbstractPersistenceImpl
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, 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.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, 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

UserPermissionImpl

public UserPermissionImpl()
Method Detail

getAuthority

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

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

getDisplayText

public java.lang.String getDisplayText()
Gets the displayText for this Permission for the system default locale.

Specified by:
getDisplayText in interface UserPermission
Returns:
the displayText of the permission for the system default locale.

getDisplayText

public java.lang.String getDisplayText(java.util.Locale locale)
Gets the displayText for this Permission of the given locale. Looked into the message resources and look for displayText keyed by name of thiss Permission. Return the default displayText if not found.

Specified by:
getDisplayText in interface UserPermission
Parameters:
locale - the locale of the displayText tp return.
Returns:
the displayText of the permission of the given locale; return the default displayText if not found.

getPermissionGroup

public java.lang.String getPermissionGroup()
Gets the group that this Permission is in.

Specified by:
getPermissionGroup in interface UserPermission
Returns:
the permissionGroup identifier.

init

public void init()
Initializes the UserPermission object given its authority. Call setElasticPath before initializing.

Specified by:
init in interface UserPermission

setAuthority

public void setAuthority(java.lang.String authority)
                  throws EpDomainException
Sets the authority for this Permission.

Specified by:
setAuthority in interface UserPermission
Parameters:
authority - the identifier of the permission.
Throws:
EpDomainException - if the given authority is null or an empty string.

setDisplayText

public void setDisplayText(java.lang.String displayText)
Sets the default displayText for this Permission.

Specified by:
setDisplayText in interface UserPermission
Parameters:
displayText - - the default displayText of the permission.

setPermissionGroup

public void setPermissionGroup(java.lang.String permissionGroup)
                        throws EpDomainException
Sets the group that this Permission is in.

Specified by:
setPermissionGroup in interface UserPermission
Parameters:
permissionGroup - the identifier of the permissionGroup.
Throws:
EpDomainException - if the given permissionGroup is null or an empty string.