|
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.core.BasicItem<ReporterTypeData> net.sf.basedb.core.ReporterType
public class ReporterType
This class holds reporter type information. A reporter may have, but is not required to have a type. The main reason for a reporter to have a type is to make it easier for client application to filter the reporter list.
ReporterData
Field Summary | |
---|---|
private static Item |
TYPE
The type of item represented by this class. |
Fields inherited from interface net.sf.basedb.core.Nameable |
---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
Constructor Summary | |
---|---|
ReporterType(ReporterTypeData data)
Constructor that sets reporter type data. |
Method Summary | |
---|---|
static ReporterType |
getById(DbControl dc,
int id)
Get a ReporterType object when you know the ID. |
String |
getDescription()
Get the description for the item. |
Date |
getEntryDate()
Get the date that the item was registered in the database. |
String |
getName()
Get the name of the item. |
static ReporterType |
getNew(DbControl dc)
Create a new ReporterType item. |
static ItemQuery<ReporterType> |
getQuery()
Get a query configured to retrieve reporter types. |
Item |
getType()
Get the type of item represented by the object. |
Set<ItemProxy> |
getUsingItems()
Get all: Reporter :s of this type
|
boolean |
isRemoved()
Check if the removed flag is set for this item. |
boolean |
isUsed()
Check if any reporters of this type exists. |
ReporterData |
newReporter(String externalId)
Create a new ReporterData object of this type. |
void |
setDescription(String description)
Set the description for the item. |
void |
setName(String name)
Set the name of the item. |
void |
setRemoved(boolean removed)
Set the removed flag for this item. |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getVersion, hashCode, hasPermission, initPermissions, isDetached, isInDatabase, onAfterCommit, onAfterInsert, onBeforeCommit, onRollback, setDbControl, setProjectDefaults, toString, toTransferable, validate |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Field Detail |
---|
private static final Item TYPE
Item.REPORTERTYPE
,
getType()
Constructor Detail |
---|
ReporterType(ReporterTypeData data)
data
- A ReporterTypeData
object.Method Detail |
---|
public static ReporterType getNew(DbControl dc) throws PermissionDeniedException, BaseException
ReporterType
item.
dc
- The DbControl
which will be used for
permission checking and database access.
ReporterType
item.
PermissionDeniedException
- If the logged in user doesn't
have CREATE
permission for this type
of item.
BaseException
- If there is another error.public static ReporterType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
ReporterType
object when you know the ID.
dc
- The DbControl
which will be used for
permission checking and database access.id
- The ID of the item to load.
ReporterType
item.
ItemNotFoundException
- This exception is thrown if an
item with the specified ID is not found.
PermissionDeniedException
- This exception is thrown if
the logged in user doesn't have READ
permission to the items.
BaseException
- This exception is thrown if there is another
error.public static ItemQuery<ReporterType> getQuery()
ItemQuery
objectpublic Item getType()
Item
enumeration.
getType
in interface Identifiable
public String getName()
Nameable
getName
in interface Nameable
String
with the name of the itempublic void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.
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 String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.
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 boolean isRemoved()
Removable
isRemoved
in interface Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwise
PermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEpublic Date getEntryDate()
Registered
getEntryDate
in interface Registered
public boolean isUsed() throws BaseException
isUsed
in class BasicItem<ReporterTypeData>
BaseException
- If not able to tell if item is used or not.BasicItem.getUsingItems()
public Set<ItemProxy> getUsingItems()
Reporter
:s of this type
getUsingItems
in class BasicItem<ReporterTypeData>
BasicItem.addUsingItems(Set, Item, org.hibernate.Query)
public ReporterData newReporter(String externalId) throws PermissionDeniedException, InvalidDataException, BaseException
ReporterData
object of this type.
externalId
- The external id of the new reporter. Null is not allowed
ReporterData
object
PermissionDeniedException
- This exception is thrown if
user doesn't have use permission
for this reporter type.
InvalidDataException
- If required argument is null.
BaseException
- If there is another error.
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |