Last update: 2011-06-23

org.proteios.core
Class Client

java.lang.Object
  extended by org.proteios.core.BasicItem<D>
      extended by org.proteios.core.OwnedItem<D>
          extended by org.proteios.core.SharedItem<D>
              extended by org.proteios.core.CommonItem<ClientData>
                  extended by org.proteios.core.Client
All Implemented Interfaces:
AccessControlled, Identifiable, Nameable, Ownable, Removable, Shareable

public class Client
extends CommonItem<ClientData>

This class represents a registered client application. Registering a client application has some benefits:

Version:
2.0
Author:
Nicklas

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 org.proteios.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Method Summary
static Client getByExternalId(DbControl dc, String externalId)
          Get a Client item when you know the external ID.
 String getExternalId()
          Get the external id for this 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.
 boolean isUsed()
          Always return FALSE.
 void setExternalId(String externalId)
          Set the external id for this Client item.
 
Methods inherited from class org.proteios.core.CommonItem
getDescription, getName, isRemoved, setDescription, setName, setRemoved
 
Methods inherited from class org.proteios.core.SharedItem
getItemKey, getProjectKey, isShared, setItemKey, setProjectKey
 
Methods inherited from class org.proteios.core.OwnedItem
getOwner, setOwner
 
Methods inherited from class org.proteios.core.BasicItem
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.proteios.core.Identifiable
getId, getVersion
 
Methods inherited from interface org.proteios.core.AccessControlled
checkPermission, hasPermission
 
Methods inherited from interface org.proteios.core.Ownable
getOwner, setOwner
 

Field Detail

TYPE

public static final Item TYPE
The type of item represented by this class.

See Also:
Item.CLIENT, getType()

MAX_EXTERNAL_ID_LENGTH

public static final int MAX_EXTERNAL_ID_LENGTH
The maximum length of the external id variable that can be stored in the database. Check the length against this value before calling the setExternalId(String) method to avoid exceptions.

See Also:
Constant Field Values
Method Detail

getByExternalId

public static Client getByExternalId(DbControl dc,
                                     String externalId)
                              throws ItemNotFoundException,
                                     PermissionDeniedException,
                                     BaseException
Get a Client item when you know the external ID.

Parameters:
dc - The DbControl which will be used for permission checking and database access.
externalId - The external id of the item to load
Returns:
The Client item
Throws:
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

getQuery

public static ItemQuery<Client> getQuery()
Get a new query object for this class.

Returns:
An ItemQuery object

getType

public Item getType()
Description copied from interface: Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in the Item enumeration.

Returns:
A value indicating the type of item

isUsed

public boolean isUsed()
               throws BaseException
Always return FALSE. A client can be referenced from help, sessions and settings but those references are automatically deleted if the client is deleted and aren't inclued in this check.

Specified by:
isUsed in class BasicItem<ClientData>
Returns:
TRUE if this item is used, FALSE otherwise
Throws:
BaseException

getExternalId

public String getExternalId()
Get the external id for this Client item.

Returns:
A string with the external id of this item

setExternalId

public void setExternalId(String externalId)
                   throws PermissionDeniedException,
                          InvalidDataException
Set the external id for this Client item. The value cannot be null and must not be longer than the value specified by the MAX_EXTERNAL_ID_LENGTH constant.

Parameters:
externalId - The new external id for this item
Throws:
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

Last update: 2011-06-23