|
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<D> net.sf.basedb.core.OwnedItem<D> net.sf.basedb.core.SharedItem<D> net.sf.basedb.core.CommonItem<ClientData> net.sf.basedb.core.Client
public class Client
This class represents a registered client application. Registering a client application has some benefits:
ClientDefaultSetting
,
UserClientSetting
Field Summary | |
---|---|
static int |
MAX_EXTERNAL_ID_LENGTH
The maximum length of the external id variable that can be stored in the database. |
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 | |
---|---|
Client(ClientData clientData)
|
Method Summary | |
---|---|
static Client |
getByExternalId(DbControl dc,
String externalId)
Get a Client item when you know the external ID. |
static Client |
getById(DbControl dc,
int id)
Get a Client item when you know the ID. |
ClientDefaultSetting |
getDefaultSetting(String name)
Get the default setting with the specified name. |
ItemQuery<ClientDefaultSetting> |
getDefaultSettings()
Get a query that will return all default settings for this client. |
Date |
getEntryDate()
Get the date that the item was registered in the database. |
String |
getExternalId()
Get the external id for this Client item. |
ItemQuery<Help> |
getHelp()
Get a query that will return all help texts for this client. |
Help |
getHelpByExternalId(DbControl dc,
String externalId,
boolean create)
Get a Help item when you know the external ID. |
static Client |
getNew(DbControl dc,
String externalId)
Create a new Client item. |
static ItemQuery<Client> |
getQuery()
Get a new query object for this class. |
Item |
getType()
Get the type of item represented by the object. |
ClientDefaultSetting |
newDefaultSetting(String name,
String value)
Create a new default setting for this client. |
Help |
newHelp(String externalId)
Create a new help text for this client. |
void |
setExternalId(String externalId)
Set the external id for this Client item. |
Methods inherited from class net.sf.basedb.core.CommonItem |
---|
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable |
Methods inherited from class net.sf.basedb.core.SharedItem |
---|
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey, toTransferable |
Methods inherited from class net.sf.basedb.core.OwnedItem |
---|
getOwner, isOwner, setOwner, takeOwnership, toTransferable |
Methods inherited from class net.sf.basedb.core.BasicItem |
---|
addUsingItems, addUsingItems, checkPermission, equals, getData, getDbControl, getId, getPermissions, getPluginPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, 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 |
Methods inherited from interface net.sf.basedb.core.Ownable |
---|
getOwner, isOwner, setOwner, takeOwnership |
Field Detail |
---|
public static final Item TYPE
Item.CLIENT
,
getType()
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
method to avoid
exceptions.
Constructor Detail |
---|
Client(ClientData clientData)
Method Detail |
---|
public static Client getNew(DbControl dc, String externalId) throws BaseException
Client
item.
dc
- The DbControl
which will be used for
permission checking and database accessexternalId
- The external id of the new item
Role
item
BaseException
- If there is an errorpublic static Client getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
Client
item 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
Client
item
ItemNotFoundException
- If an item with the specified
ID is not found
PermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the item
BaseException
- If there is another errorpublic static Client getByExternalId(DbControl dc, String externalId) throws ItemNotFoundException, PermissionDeniedException, BaseException
Client
item when you know the external ID.
dc
- The DbControl
which will be used for
permission checking and database access.externalId
- The external id of the item to load
Client
item
ItemNotFoundException
- If an item with the specified ID is not found
PermissionDeniedException
- If the logged in user doesn't have
READ
permission for the item
BaseException
- If there is another errorpublic static ItemQuery<Client> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.
getType
in interface Identifiable
public Date getEntryDate()
Registered
getEntryDate
in interface Registered
public String getExternalId()
Client
item.
public void setExternalId(String externalId) throws PermissionDeniedException, InvalidDataException
Client
item. The value
cannot be null and must not be longer than the value specified by
the MAX_EXTERNAL_ID_LENGTH
constant.
externalId
- The new external id for this item
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the new value is null or longer than
MAX_EXTERNAL_ID_LENGTH
public ClientDefaultSetting newDefaultSetting(String name, String value) throws PermissionDeniedException, InvalidDataException, BaseException
name
- The name of the settingvalue
- The value of the setting
ClientDefaultSetting
object
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the name or value is null or
longer than what is allowed
BaseException
- If there is another errorpublic ClientDefaultSetting getDefaultSetting(String name) throws ItemNotFoundException, InvalidDataException, BaseException
name
- The name of the setting
ItemNotFoundException
- If a setting with the specified
name isn't found
InvalidDataException
- If name is null
BaseException
- If there is another errorpublic ItemQuery<ClientDefaultSetting> getDefaultSettings() throws BaseException
ItemQuery
object
BaseException
- If getting the query fails.public Help newHelp(String externalId) throws PermissionDeniedException, InvalidDataException, BaseException
externalId
- The external ID of the help text
Help
object
PermissionDeniedException
- If the logged in user doesn't have
write permission
InvalidDataException
- If the exernal ID is null or
longer than what is allowed
BaseException
- If there is another errorpublic ItemQuery<Help> getHelp()
ItemQuery
objectpublic Help getHelpByExternalId(DbControl dc, String externalId, boolean create) throws ItemNotFoundException, PermissionDeniedException, BaseException
Help
item when you know the external ID.
dc
- The DbControl
which will be used for
permission checking and database access.externalId
- The external id of the item to loadcreate
- TRUE if a new Help should be created if one doesn't
exists, FALSE to throw an exception.
Help
item
ItemNotFoundException
- If an item with the specified ID is not found.
PermissionDeniedException
- If the logged in user doesn't have
READ
permission for the item.
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 |