|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.core.BasicItem<D>
public abstract class BasicItem<D extends BasicData>
This is the root superclass of all item classes. All items must inherit from this class. This class provides access to the id, type and version of the item as well as permission checking methods.
| Method Summary | |
|---|---|
void |
checkPermission(Permission permission)
Checks if the logged in user has the specified permission on this item. |
boolean |
equals(Object o)
Check if this item is equal to another item. |
DbControl |
getDbControl()
Get the DbControl object that currently manages this item. |
int |
getId()
Get the id for the item. |
Set<Permission> |
getPermissions()
|
SessionControl |
getSessionControl()
Get the SessionControl object that manages this item. |
int |
getVersion()
Get the version number of the item. |
int |
hashCode()
The hash code is calculated at object construction and remains the same during the objects lifetime. |
boolean |
hasPermission(Permission permission)
Checks if the logged in user has the specified permission on this item. |
boolean |
isDetached()
Check if this item is attached to a DbControl object or not. |
boolean |
isInDatabase()
Checks if the item has been saved to the database or not. |
abstract boolean |
isUsed()
Check if this item is used by some other item. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.proteios.core.Identifiable |
|---|
getType |
| Method Detail |
|---|
public final boolean hasPermission(Permission permission)
Subclasses that needs to check other keys, such as the SharedItem
should override the initPermissions(int,int) method instead.
hasPermission in interface AccessControlledpermission - A value from the Permission class
TRUE if the user has the permission,
FALSE otherwise
public final void checkPermission(Permission permission)
throws PermissionDeniedException
PermissionDeniedException is thrown.
checkPermission in interface AccessControlledpermission - A value from the Permission class
PermissionDeniedException - If the logged in user doesn't have the
requested permissionpublic final Set<Permission> getPermissions()
public final int getId()
Identifiable
getId in interface Identifiablepublic final int getVersion()
Identifiable
getVersion in interface Identifiablepublic String toString()
toString in class Objectpublic final boolean equals(Object o)
equals in class ObjectBasicData.equals(Object)public final int hashCode()
hashCode in class ObjectBasicData.hashCode()public final boolean isInDatabase()
public final boolean isDetached()
DbControl object or not. An
item is detached if there is no DbControl, if it is
closed, or if is not managed by the DbControl.
DbControl.detachItem(BasicItem),
DbControl.reattachItem(BasicItem),
DbControl.saveItem(BasicItem)
public abstract boolean isUsed()
throws BaseException
BaseException
public final DbControl getDbControl()
throws ConnectionClosedException
DbControl object that currently manages this item.
ConnectionClosedException - If the item is connected to a closed
DbControl object, or not connected at all
public final SessionControl getSessionControl()
throws ConnectionClosedException
SessionControl object that manages this item.
ConnectionClosedException - If the item is connected to a closed
DbControl object, or not connected at all
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||