|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.cafesoft.cams.access.AbstractResourceRequest
Base class for all ResourceRequests.
This class implements the ResourceRequest interface. In fact, this class implements almost every method. A subclass of this class must only write code to parse the id and the actions. In addition, the subclass may contain additional getter/setter methods to allow for pieces of the id to be retrieved and set quickly.
ResourceRequest| Field Summary | |
protected String |
actions
Colloquial actions of the ResourceRequest (i.e. this is the raw actions of the ResourceRequest). |
protected long |
actionsMask
ActionMask of the actions being performed on the ResourceRequest. |
protected String |
id
Colloquial id of the ResourceRequest (i.e. this is the raw id of the ResourceRequest). |
protected ResourceType |
type
ResourceType of the ResourceRequest. |
| Constructor Summary | |
AbstractResourceRequest(ResourceType type,
String id,
String actions)
Create a new AbstractResourceRequest object. |
|
| Method Summary | |
String |
getActions()
Get the actions being requested on the Resource |
long |
getActionsMask()
Get an integer mask representing the actions being requested on the Resource. |
String |
getId()
Get the Resource's Id |
ResourceType |
getResourceType()
Get the ResourceType. |
protected void |
parseActions(String actions)
Parse the actions. |
protected void |
parseId(String id)
Parse the id. |
void |
setActions(String actions)
Set the actions being performed on the Resource |
void |
setId(String id)
Set the Resource's Id |
String |
toString()
Get a String representation of the ResourceRequest. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected ResourceType type
protected String id
protected String actions
protected long actionsMask
| Constructor Detail |
public AbstractResourceRequest(ResourceType type,
String id,
String actions)
throws InvalidResourceException
type - the ResourceType of the ResourceRequest.id - the colloquial id of the ResourceRequest.actions - the colloquial actions of the ResourceRequest.
InvalidResourceException - if any errors occur while
creating the AbstractResourceRequest.| Method Detail |
public final ResourceType getResourceType()
getResourceType in interface ResourceRequestpublic final long getActionsMask()
getActionsMask in interface ResourceRequestpublic final String getId()
getId in interface ResourceRequest
public final void setId(String id)
throws InvalidResourceException
setId in interface ResourceRequestid - a String indicating the Resource's Id
InvalidResourceException - if the Resource's identifier is
valid. This may occur if the identifier must follow a specific
pattern, or it must be non-null or non-empty.public final String getActions()
getActions in interface ResourceRequest
public final void setActions(String actions)
throws InvalidResourceException
setActions in interface ResourceRequestactions - a String indicating the action(s) being requested.
InvalidResourceException - if one or more actions is invalid
for the resource associated with this request.public String toString()
toString in class Object
protected void parseId(String id)
throws InvalidResourceException
This method should be overridden by subclasses.
id - the id to parse.
InvalidResourceException - if the id is invalid.
protected void parseActions(String actions)
throws InvalidResourceException
This method should be overridden by subclasses.
actions - the actions to parse.
InvalidResourceException - if the actions is invalid.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||