public class Client extends CommonItem<ClientData> implements Registered
ClientDefaultSetting
,
UserClientSetting
Modifier and Type | Field and Description |
---|---|
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.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
Client(ClientData clientData) |
Modifier and Type | Method and Description |
---|---|
static Client |
getByExternalId(DbControl dc,
java.lang.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(java.lang.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.
|
java.util.Date |
getEntryDate()
Get the date that the item was registered in the database.
|
java.lang.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,
java.lang.String externalId,
boolean create)
Get a
Help item when you know the external ID. |
static Client |
getNew(DbControl dc,
java.lang.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(java.lang.String name,
java.lang.String value)
Create a new default setting for this client.
|
Help |
newHelp(java.lang.String externalId)
Create a new help text for this client.
|
void |
setExternalId(java.lang.String externalId)
Set the external id for this
Client item. |
getDescription, getName, isRemoved, setDescription, setName, setRemoved, toTransferable
getItemKey, getProjectKey, initPermissions, isShared, onBeforeCommit, setItemKey, setProjectKey, toTransferable
getOwner, isOwner, setOwner, takeOwnership, toTransferable
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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
getOwner, isOwner, setOwner, takeOwnership
public static final Item TYPE
Item.CLIENT
,
getType()
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String)
method to avoid
exceptions.Client(ClientData clientData)
public static Client getNew(DbControl dc, java.lang.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 itemRole
itemBaseException
- 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 loadClient
itemItemNotFoundException
- If an item with the specified
ID is not foundPermissionDeniedException
- If the logged in user doesn't
have Permission.READ
permission to the itemBaseException
- If there is another errorpublic static Client getByExternalId(DbControl dc, java.lang.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 loadClient
itemItemNotFoundException
- If an item with the specified ID is not foundPermissionDeniedException
- If the logged in user doesn't have
READ
permission for the itemBaseException
- If there is another errorpublic static ItemQuery<Client> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public java.util.Date getEntryDate()
Registered
getEntryDate
in interface Registered
public java.lang.String getExternalId()
Client
item.public void setExternalId(java.lang.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 itemPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the new value is null or longer than
MAX_EXTERNAL_ID_LENGTH
public ClientDefaultSetting newDefaultSetting(java.lang.String name, java.lang.String value) throws PermissionDeniedException, InvalidDataException, BaseException
name
- The name of the settingvalue
- The value of the settingClientDefaultSetting
objectPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the name or value is null or
longer than what is allowedBaseException
- If there is another errorpublic ClientDefaultSetting getDefaultSetting(java.lang.String name) throws ItemNotFoundException, InvalidDataException, BaseException
name
- The name of the settingItemNotFoundException
- If a setting with the specified
name isn't foundInvalidDataException
- If name is nullBaseException
- If there is another errorpublic ItemQuery<ClientDefaultSetting> getDefaultSettings() throws BaseException
ItemQuery
objectBaseException
- If getting the query fails.public Help newHelp(java.lang.String externalId) throws PermissionDeniedException, InvalidDataException, BaseException
externalId
- The external ID of the help textHelp
objectPermissionDeniedException
- If the logged in user doesn't have
write permissionInvalidDataException
- If the exernal ID is null or
longer than what is allowedBaseException
- If there is another errorpublic ItemQuery<Help> getHelp()
ItemQuery
objectpublic Help getHelpByExternalId(DbControl dc, java.lang.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
itemItemNotFoundException
- 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.