|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.clients.web.util.NameablePluginAdaptor
public class NameablePluginAdaptor
This class wraps a Nameable
object around a
PluginDefinition
. Calls to setName
and setDescription
are ignored.
Field Summary | |
---|---|
private PluginDefinition |
plugin
|
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
NameablePluginAdaptor(PluginDefinition plugin)
|
Method Summary | |
---|---|
void |
checkPermission(Permission permission)
Check if the logged in user has the desired permission on the item, otherwise throw an exception. |
String |
getDescription()
Get the description for the item. |
int |
getId()
Get the id for the item. |
String |
getName()
Get the name of the item. |
Set<Permission> |
getPermissions()
Get the logged in user's permissions on the item. |
Item |
getType()
Get the type of item represented by the object. |
int |
getVersion()
Get the version number of the item. |
boolean |
hasPermission(Permission permission)
Check if the logged in user has the desired permission on the item. |
void |
setDescription(String description)
Ignored. |
void |
setName(String name)
Ignored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final PluginDefinition plugin
Constructor Detail |
---|
public NameablePluginAdaptor(PluginDefinition plugin)
Method Detail |
---|
public String getName()
Nameable
getName
in interface Nameable
String
with the name of the itempublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
setDescription
in interface Nameable
description
- The new description for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic void setName(String name) throws PermissionDeniedException, InvalidDataException
setName
in interface Nameable
name
- The new name for the item
PermissionDeniedException
- If the logged in user doesn't
have write permission
InvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic int getId()
Identifiable
getId
in interface Identifiable
public Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public int getVersion()
Identifiable
getVersion
in interface Identifiable
public void checkPermission(Permission permission) throws PermissionDeniedException
AccessControlled
checkPermission
in interface AccessControlled
permission
- Permission the user should have.
PermissionDeniedException
- If the user doesn't have the
requested permissionpublic boolean hasPermission(Permission permission)
AccessControlled
hasPermission
in interface AccessControlled
permission
- The permission to check if the user has.
public Set<Permission> getPermissions()
AccessControlled
getPermissions
in interface AccessControlled
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |