org.yawlfoundation.yawl.resourcing.rsInterface
Class ResourceGatewayClientAdapter

java.lang.Object
  extended by org.yawlfoundation.yawl.resourcing.rsInterface.ResourceGatewayClientAdapter
Direct Known Subclasses:
ExampleAdapter

public class ResourceGatewayClientAdapter
extends Object

This adapter class adds a transformation layer to the resource gateway client, effectively reconstituting the Strings returned from the gateway into java objects. Author: Michael Adams Date: 26/10/2007


Field Summary
protected  ResourceMarshaller _marshaller
           
protected  ResourceGatewayClient _rgclient
           
protected  String _uri
           
protected  XNodeParser _xnodeParser
           
static String JSON_FORMAT
           
static String XML_FORMAT
           
 
Constructor Summary
ResourceGatewayClientAdapter()
           
ResourceGatewayClientAdapter(String uri)
           
 
Method Summary
 String addCapability(Capability cap, String handle)
          Adds a new capability to the service's org data
 String addNonHumanCategory(String category, String handle)
          Adds a new NonHumanResource category
 String addNonHumanResource(NonHumanResource resource, String handle)
          Adds a new NonHumanResource to the service's org data
 boolean addNonHumanSubCategory(String id, String subcategory, String handle)
          Adds a new NonHumanResource category
 boolean addNonHumanSubCategoryByName(String category, String subcategory, String handle)
          Adds a new NonHumanResource category
 String addOrgGroup(OrgGroup group, String handle)
          Adds a new org group to the service's org data
 String addParticipant(Participant p, boolean encryptPassword, String handle)
          Adds a new participant to the service's org data
 String addParticipant(Participant p, String handle)
          Adds a new participant to the service's org data
 String addParticipantToCapability(Participant p, Capability cap, String handle)
          Adds the specified Participant to the specified Capability
 String addParticipantToPosition(Participant p, Position pos, String handle)
          Adds the specified Participant to the specified Position
 String addParticipantToRole(Participant p, Role role, String handle)
          Adds the specified Participant to the specified Role
 String addPosition(Position pos, String handle)
          Adds a new position to the service's org data
 String addRole(Role role, String handle)
          Adds a new role to the service's org data
 boolean checkConnection(String handle)
          Checks that the connection to the service is valid
 String connect(String userid, String password)
          Attempts to connect to the service
 void disconnect(String handle)
          Disconnects a session from the service
 Set<Participant> getActiveParticipants(String handle)
          Gets the set of Participants that are currently logged on
 List<String> getAllNonHumanResourceNames(String handle)
          Gets the name of each NonHumanResource
 List<AbstractSelector> getAllocators(String handle)
          Gets a complete list of available Allocator objects
 List<String> getAllParticipantNames(String handle)
          Gets the full name of each participant
 List<String> getAllRoleNames(String handle)
          Gets the name of each role
 List getCapabilities(String handle)
          Gets a complete list of available Capability objects
 Capability getCapability(String id, String handle)
          Gets the Capability with the specified id
 Capability getCapabilityByName(String name, String handle)
          Gets the Capability with the specified name
 Map<String,String> getCapabilityIdentifiers(String handle)
          Gets the id and name of every Capability
 String getCapabilityIdentifiersToJSON(String handle)
          Gets the id and name of every Capability in JSON format
 String getClientURI()
           
 Map<String,String> getCodeletMap(String handle)
           
 List<YParameter> getCodeletParameters(String codeletName, String handle)
           
 List<CodeletInfo> getCodelets(String handle)
          Gets a complete list of available codelets
 List<AbstractSelector> getConstraints(String handle)
          Gets a complete list of available Constraint objects
 List<AbstractSelector> getFilters(String handle)
          Gets a complete list of available Filter objects
 List<NonHumanCategory> getNonHumanCategories(String handle)
          Gets the list of all NonHumanCategory objects known to the Resource Service
 String getNonHumanCategoriesToJSON(String handle)
          Gets the list of all NonHumanResource category names in JSON format
 NonHumanCategory getNonHumanCategory(String id, String handle)
          Gets the NonHumanCategory with the specified id
 NonHumanCategory getNonHumanCategoryByName(String name, String handle)
          Gets the NonHumanCategory with the specified name
 Map<String,Set<String>> getNonHumanCategorySet(String handle)
          Gets the list of all NonHumanResource category names and the subcategories of each
 NonHumanResource getNonHumanResource(String id, String handle)
          Gets the NonHumanResource with the specified id
 NonHumanResource getNonHumanResourceByName(String name, String handle)
          Gets the NonHumanResource with the specified name
 Map<String,String> getNonHumanResourceIdentifiers(String handle)
          Gets the id and name of every NonHumanResource
 String getNonHumanResourceIdentifiersToJSON(String handle)
          Gets the id and name of every NonHumanResource in JSON format
 List<NonHumanResource> getNonHumanResources(String handle)
          Gets a complete list of available NonHumanResource objects
 List<String> getNonHumanSubCategories(String id, String handle)
          Gets the list of all the subcategory names of a NonHumanResource category
 List<String> getNonHumanSubCategoriesByName(String category, String handle)
          Gets the list of all the subcategory names of a NonHumanResource category
 String getNonHumanSubCategoriesToJSON(String id, String handle)
          Gets the list of all the subcategory names of a NonHumanResource category in JSON format
 String getNonHumanSubCategoriesToJSONByName(String category, String handle)
          Gets the list of all the subcategory names of a NonHumanResource category in JSON format
 OrgGroup getOrgGroup(String id, String handle)
          Gets the OrgGroup with the specified id
 OrgGroup getOrgGroupByName(String name, String handle)
          Gets the OrgGroup with the specified name
 Map<String,String> getOrgGroupIdentifiers(String handle)
          Gets the id and name of every OrgGroup
 String getOrgGroupIdentifiersToJSON(String handle)
          Gets the id and name of every OrgGroup in JSON format
 List getOrgGroups(String handle)
          Gets a complete list of available OrgGroup objects
 Participant getParticipant(String pid, String handle)
          Gets a particular Participant
 List getParticipantCapabilities(String pid, String handle)
          Gets a list of all capabilities held by the specified participant
 Participant getParticipantFromUserID(String userID, String handle)
          Gets the Participant with the specified user id
 Map<String,String> getParticipantIdentifiers(ResourceDataSet.Identifier identifier, String handle)
          Gets the id and chosen name value of every Participant
 Map<String,String> getParticipantIdentifiers(String handle)
          Gets the id and full name of every Participant
 String getParticipantIdentifiersToJSON(ResourceDataSet.Identifier identifier, String handle)
          Gets the id and chosen name value of every Participant in JSON format
 String getParticipantIdentifiersToJSON(String handle)
          Gets the id and full name of every Participant in JSON format
 List getParticipantPositions(String pid, String handle)
          Gets a list of all positions held by the specified participant
 List getParticipantRoles(String pid, String handle)
          Gets a list of all roles 'occupied' by the specified participant
 List<Participant> getParticipants(String handle)
          Gets a complete list of available Participant objects
 Set<Participant> getParticipantsWithCapability(String capabilityName, String handle)
          Gets the set of Participants that hold the named capability
 Set<Participant> getParticipantsWithPosition(String positionName, String handle)
          Gets the set of Participants that 'occupy' the named position
 Set<Participant> getParticipantsWithRole(String roleName, String handle)
          Gets the set of Participants that 'occupy' the named role
 Position getPosition(String id, String handle)
          Gets the Position with the specified id
 Position getPositionByName(String name, String handle)
          Gets the Position with the specified name
 Map<String,String> getPositionIdentifiers(String handle)
          Gets the id and name of every Position
 String getPositionIdentifiersToJSON(String handle)
          Gets the id and name of every Position in JSON format
 List getPositions(String handle)
          Gets a complete list of available Position objects
 Set<String> getReferencedParticipantIDs(String anyID, String handle)
          Gets a set of participant ids referenced by the id string argument
 Role getRole(String id, String handle)
          Gets the Role with the specified id
 Role getRoleByName(String name, String handle)
          Gets the Role with the specified name
 Map<String,String> getRoleIdentifiers(String handle)
          Gets the id and name of every Role
 String getRoleIdentifiersToJSON(String handle)
          Gets the id and name of every Role in JSON format
 List getRoles(String handle)
          Gets a complete list of available Role objects
 UserPrivileges getUserPrivileges(String id, String handle)
          Gets the UserPrivileges of the Participant with the specified id
 boolean isKnownCapability(String capabilityID, String handle)
          Checks if an id corresponds to a capability id known to the service
 boolean isKnownNonHumanCategory(String id, String handle)
          Checks if an id corresponds to a NonHumanCategory id known to the service
 boolean isKnownNonHumanResource(String id, String handle)
          Checks if an id corresponds to a NonHumanResource id known to the service
 boolean isKnownOrgGroup(String groupID, String handle)
          Checks if an id corresponds to a OrgGroup id known to the service
 boolean isKnownParticipant(String participantID, String handle)
          Checks if an id corresponds to a participant id known to the service
 boolean isKnownPosition(String positionID, String handle)
          Checks if an id corresponds to a position id known to the service
 boolean isKnownRole(String roleID, String handle)
          Checks if an id corresponds to a role id known to the service
 String removeCapability(Capability cap, String handle)
          Removes (deletes) the specified Capability from the service's org data
 boolean removeNonHumanCategory(String id, String handle)
          Removes a category of the list of NonHumanResource categories
 boolean removeNonHumanCategoryByName(String name, String handle)
          Removes a category of the list of NonHumanResource categories
 String removeNonHumanResource(NonHumanResource resource, String handle)
          Removes (deletes) the specified NonHumanResource from the service's org data
 boolean removeNonHumanSubCategory(String id, String subcategory, String handle)
          Removes a subcategory of a NonHumanResource category
 boolean removeNonHumanSubCategoryByName(String category, String subcategory, String handle)
          Removes a subcategory of a NonHumanResource category
 String removeOrgGroup(OrgGroup group, String handle)
          Removes (deletes) the specified OrgGroup from the service's org data
 String removeParticipant(Participant p, String handle)
          Removes (deletes) the specified Participant from the service's org data
 String removeParticipantFromCapability(Participant p, Capability cap, String handle)
          Removes (deletes) the specified Participant from the set of Participants holding the specified Capability
 String removeParticipantFromPosition(Participant p, Position pos, String handle)
          Removes (deletes) the specified Participant from the set of Participants occupying the specified Position
 String removeParticipantFromRole(Participant p, Role role, String handle)
          Removes (deletes) the specified Participant from the set of Participants occupying the specified Role
 String removePosition(Position pos, String handle)
          Removes (deletes) the specified Position from the service's org data
 String removeRole(Role role, String handle)
          Removes (deletes) the specified Role from the service's org data
 void setClientURI(String uri)
           
 String setContainingOrgGroup(OrgGroup group, OrgGroup containingGroup, String handle)
          Sets the containing OrgGroup for an OrgGroup (i.e.
 String setContainingPosition(Position pos, Position containingPos, String handle)
          Sets the containing Position for a Position (i.e.
 String setContainingRole(Role role, Role containingRole, String handle)
          Sets the containing Role for a Role (i.e.
 String setParticipantPrivileges(Participant p, String handle)
          Sets the user privileges for a Participant
 String setParticipantPrivileges(Participant p, UserPrivileges privs, String handle)
          Sets the user privileges for a Participant
 String setPositionOrgGroup(Position pos, OrgGroup group, String handle)
          Sets the containing OrgGroup for a Position
protected  String successCheck(String xml)
           
 boolean successful(String result)
           
 String updateCapability(Capability cap, String handle)
          Updates the Capability stored in the service's org data with the modified values of the Capability specified
 String updateNonHumanCategory(NonHumanCategory category, String handle)
          Updates the NonHumanCategory stored in the service's org data with the modified values of the NonHumanResource specified
 String updateNonHumanResource(NonHumanResource resource, String handle)
          Updates a new NonHumanResource to the service's org data with the modified values of the NonHumanResource specified
 String updateOrgGroup(OrgGroup group, String handle)
          Updates the OrgGroup stored in the service's org data with the modified values of the OrgGroup specified
 String updateParticipant(Participant p, boolean encryptPassword, String handle)
          Updates the Participant stored in the service's org data with the modified values of the Participant specified
 String updateParticipant(Participant p, String handle)
          Updates the Participant stored in the service's org data with the modified values of the Participant specified
 String updatePosition(Position pos, String handle)
          Updates the Position stored in the service's org data with the modified values of the Position specified
 String updateRole(Role role, String handle)
          Updates the Role stored in the service's org data with the modified values of the Role specified
 String validateUserCredentials(String userid, String password, boolean checkForAdmin, String handle)
          Checks the user credentials passed against those stored
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_FORMAT

public static final String XML_FORMAT
See Also:
Constant Field Values

JSON_FORMAT

public static final String JSON_FORMAT
See Also:
Constant Field Values

_rgclient

protected ResourceGatewayClient _rgclient

_uri

protected String _uri

_marshaller

protected ResourceMarshaller _marshaller

_xnodeParser

protected XNodeParser _xnodeParser
Constructor Detail

ResourceGatewayClientAdapter

public ResourceGatewayClientAdapter()

ResourceGatewayClientAdapter

public ResourceGatewayClientAdapter(String uri)
Method Detail

setClientURI

public void setClientURI(String uri)

getClientURI

public String getClientURI()

successful

public boolean successful(String result)

successCheck

protected String successCheck(String xml)
                       throws ResourceGatewayException
Throws:
ResourceGatewayException

checkConnection

public boolean checkConnection(String handle)
Checks that the connection to the service is valid

Parameters:
handle - the current sessionhandle
Returns:
true if the connection is valid, false if otherwise

connect

public String connect(String userid,
                      String password)
Attempts to connect to the service

Parameters:
userid - the userid
password - the corresponding password
Returns:
a sessionhandle if successful, or a failure message if otherwise

disconnect

public void disconnect(String handle)
Disconnects a session from the service

Parameters:
handle - the sessionhandle of the session to disconnect

validateUserCredentials

public String validateUserCredentials(String userid,
                                      String password,
                                      boolean checkForAdmin,
                                      String handle)
                               throws IOException,
                                      ResourceGatewayException
Checks the user credentials passed against those stored

Parameters:
userid - the userid of the Participant
password - the associated password
checkForAdmin - when true, also checks that the user has admin privileges
handle - a valid session handle
Returns:
an XML message of success or an appropriate error message
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there was a problem validating the credentials

getAllParticipantNames

public List<String> getAllParticipantNames(String handle)
                                    throws IOException,
                                           ResourceGatewayException
Gets the full name of each participant

Parameters:
handle - the current sessionhandle
Returns:
a List of participant full names
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the names

getAllRoleNames

public List<String> getAllRoleNames(String handle)
                             throws IOException,
                                    ResourceGatewayException
Gets the name of each role

Parameters:
handle - the current sessionhandle
Returns:
a List of role names
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the names

getAllNonHumanResourceNames

public List<String> getAllNonHumanResourceNames(String handle)
                                         throws IOException,
                                                ResourceGatewayException
Gets the name of each NonHumanResource

Parameters:
handle - the current sessionhandle
Returns:
a List of NonHumanResource names
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the names

getNonHumanResources

public List<NonHumanResource> getNonHumanResources(String handle)
                                            throws IOException,
                                                   ResourceGatewayException
Gets a complete list of available NonHumanResource objects

Parameters:
handle - the current sessionhandle
Returns:
a List of NonHumanResource objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the NonHumanResource

getRoles

public List getRoles(String handle)
              throws IOException,
                     ResourceGatewayException
Gets a complete list of available Role objects

Parameters:
handle - the current sessionhandle
Returns:
a List of Role objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the roles

getCapabilities

public List getCapabilities(String handle)
                     throws IOException,
                            ResourceGatewayException
Gets a complete list of available Capability objects

Parameters:
handle - the current sessionhandle
Returns:
a List of Capability objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the capabilities

getPositions

public List getPositions(String handle)
                  throws IOException,
                         ResourceGatewayException
Gets a complete list of available Position objects

Parameters:
handle - the current sessionhandle
Returns:
a List of Position objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the positions

getOrgGroups

public List getOrgGroups(String handle)
                  throws IOException,
                         ResourceGatewayException
Gets a complete list of available OrgGroup objects

Parameters:
handle - the current sessionhandle
Returns:
a List of OrgGroup objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the groups

getParticipants

public List<Participant> getParticipants(String handle)
                                  throws IOException,
                                         ResourceGatewayException
Gets a complete list of available Participant objects

Parameters:
handle - the current sessionhandle
Returns:
a List of Participant objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the participants

getParticipant

public Participant getParticipant(String pid,
                                  String handle)
                           throws IOException,
                                  ResourceGatewayException
Gets a particular Participant

Parameters:
pid - the id of the Participant to get
handle - the current session handle
Returns:
a Participant object for the id, or null if not found
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the participant

getReferencedParticipantIDs

public Set<String> getReferencedParticipantIDs(String anyID,
                                               String handle)
                                        throws IOException
Gets a set of participant ids referenced by the id string argument

Parameters:
anyID - the id of a Participant, Role, Capability, Position or OrgGroup
handle - a valid session handle
Returns:
the set of the ids of all participants who are members of the group object referenced; if anyID is the id of a single participant, then only that id is returned in the set
Throws:
IOException - if the service can't be reached

getConstraints

public List<AbstractSelector> getConstraints(String handle)
                                      throws IOException,
                                             ResourceGatewayException
Gets a complete list of available Constraint objects

Parameters:
handle - the current sessionhandle
Returns:
a List of Constraint objects (instantiated as GenericConstraint objs)
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the constraints

getAllocators

public List<AbstractSelector> getAllocators(String handle)
                                     throws IOException,
                                            ResourceGatewayException
Gets a complete list of available Allocator objects

Parameters:
handle - the current sessionhandle
Returns:
a List of Allocator objects (instantiated as GenericAllocator objs)
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the allocators

getFilters

public List<AbstractSelector> getFilters(String handle)
                                  throws IOException,
                                         ResourceGatewayException
Gets a complete list of available Filter objects

Parameters:
handle - the current sessionhandle
Returns:
a List of Filter objects (instantiated as GenericFilter objs)
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the filters

getCodelets

public List<CodeletInfo> getCodelets(String handle)
                              throws IOException,
                                     ResourceGatewayException
Gets a complete list of available codelets

Parameters:
handle - the current sessionhandle
Returns:
a List of AbstractCodelet objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the codelets

getCodeletMap

public Map<String,String> getCodeletMap(String handle)
                                 throws IOException,
                                        ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getCodeletParameters

public List<YParameter> getCodeletParameters(String codeletName,
                                             String handle)
                                      throws IOException,
                                             ResourceGatewayException
Throws:
IOException
ResourceGatewayException

isKnownCapability

public boolean isKnownCapability(String capabilityID,
                                 String handle)
Checks if an id corresponds to a capability id known to the service

Parameters:
capabilityID - the id to check
handle - the current sessionhandle
Returns:
true if the id is known (valid), false if otherwise

isKnownNonHumanResource

public boolean isKnownNonHumanResource(String id,
                                       String handle)
Checks if an id corresponds to a NonHumanResource id known to the service

Parameters:
id - the id to check
handle - the current sessionhandle
Returns:
true if the id is known (valid), false if otherwise

isKnownRole

public boolean isKnownRole(String roleID,
                           String handle)
Checks if an id corresponds to a role id known to the service

Parameters:
roleID - the id to check
handle - the current sessionhandle
Returns:
true if the id is known (valid), false if otherwise

isKnownParticipant

public boolean isKnownParticipant(String participantID,
                                  String handle)
Checks if an id corresponds to a participant id known to the service

Parameters:
participantID - the id to check
handle - the current sessionhandle
Returns:
true if the id is known (valid), false if otherwise

isKnownPosition

public boolean isKnownPosition(String positionID,
                               String handle)
Checks if an id corresponds to a position id known to the service

Parameters:
positionID - the id to check
handle - the current sessionhandle
Returns:
true if the id is known (valid), false if otherwise

isKnownOrgGroup

public boolean isKnownOrgGroup(String groupID,
                               String handle)
Checks if an id corresponds to a OrgGroup id known to the service

Parameters:
groupID - the id to check
handle - the current sessionhandle
Returns:
true if the id is known (valid), false if otherwise

isKnownNonHumanCategory

public boolean isKnownNonHumanCategory(String id,
                                       String handle)
Checks if an id corresponds to a NonHumanCategory id known to the service

Parameters:
id - the id to check
handle - the current sessionhandle
Returns:
true if the id is known (valid), false if otherwise

getActiveParticipants

public Set<Participant> getActiveParticipants(String handle)
                                       throws IOException,
                                              ResourceGatewayException
Gets the set of Participants that are currently logged on

Parameters:
handle - the current sessionhandle
Returns:
the Set of currently logged on Participants
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the participants

getParticipantRoles

public List getParticipantRoles(String pid,
                                String handle)
                         throws IOException,
                                ResourceGatewayException
Gets a list of all roles 'occupied' by the specified participant

Parameters:
pid - the id of the Participant of interest
handle - the current sessionhandle
Returns:
a List of (Role) objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the roles

getParticipantCapabilities

public List getParticipantCapabilities(String pid,
                                       String handle)
                                throws IOException,
                                       ResourceGatewayException
Gets a list of all capabilities held by the specified participant

Parameters:
pid - the id of the Participant of interest
handle - the current sessionhandle
Returns:
a List of (Capability) objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the capabilities

getParticipantPositions

public List getParticipantPositions(String pid,
                                    String handle)
                             throws IOException,
                                    ResourceGatewayException
Gets a list of all positions held by the specified participant

Parameters:
pid - the id of the Participant of interest
handle - the current sessionhandle
Returns:
a List of (Position) objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the positions

getParticipantsWithRole

public Set<Participant> getParticipantsWithRole(String roleName,
                                                String handle)
                                         throws IOException,
                                                ResourceGatewayException
Gets the set of Participants that 'occupy' the named role

Parameters:
roleName - the name of the role in question (not the id)
handle - the current sessionhandle
Returns:
a Set of Participant objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the participants

getParticipantsWithPosition

public Set<Participant> getParticipantsWithPosition(String positionName,
                                                    String handle)
                                             throws IOException,
                                                    ResourceGatewayException
Gets the set of Participants that 'occupy' the named position

Parameters:
positionName - the name of the position in question (not the id)
handle - the current sessionhandle
Returns:
a Set of Participant objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the participants

getParticipantsWithCapability

public Set<Participant> getParticipantsWithCapability(String capabilityName,
                                                      String handle)
                                               throws IOException,
                                                      ResourceGatewayException
Gets the set of Participants that hold the named capability

Parameters:
capabilityName - the name of the capability in question (not the id)
handle - the current sessionhandle
Returns:
a Set of Participant objects
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the participants

getParticipantFromUserID

public Participant getParticipantFromUserID(String userID,
                                            String handle)
                                     throws IOException,
                                            ResourceGatewayException
Gets the Participant with the specified user id

Parameters:
userID - the userid to match to a Participant
handle - a valid session handle
Returns:
the matching Participant
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Participant

getNonHumanResource

public NonHumanResource getNonHumanResource(String id,
                                            String handle)
                                     throws IOException,
                                            ResourceGatewayException
Gets the NonHumanResource with the specified id

Parameters:
id - the id of the NonHumanResource to get
handle - a valid session handle
Returns:
the matching NonHumanResource
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the NonHumanResource

getNonHumanResourceByName

public NonHumanResource getNonHumanResourceByName(String name,
                                                  String handle)
                                           throws IOException,
                                                  ResourceGatewayException
Gets the NonHumanResource with the specified name

Parameters:
name - the id of the NonHumanResource to get
handle - a valid session handle
Returns:
the matching NonHumanResource
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the NonHumanResource

getRole

public Role getRole(String id,
                    String handle)
             throws IOException,
                    ResourceGatewayException
Gets the Role with the specified id

Parameters:
id - the id of the Role to get
handle - a valid session handle
Returns:
the matching Role
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Role

getRoleByName

public Role getRoleByName(String name,
                          String handle)
                   throws IOException,
                          ResourceGatewayException
Gets the Role with the specified name

Parameters:
name - the id of the Role to get
handle - a valid session handle
Returns:
the matching Role
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Role

getCapability

public Capability getCapability(String id,
                                String handle)
                         throws IOException,
                                ResourceGatewayException
Gets the Capability with the specified id

Parameters:
id - the id of the Capability to get
handle - a valid session handle
Returns:
the matching Capability
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Capability

getCapabilityByName

public Capability getCapabilityByName(String name,
                                      String handle)
                               throws IOException,
                                      ResourceGatewayException
Gets the Capability with the specified name

Parameters:
name - the id of the Capability to get
handle - a valid session handle
Returns:
the matching Capability
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Capability

getPosition

public Position getPosition(String id,
                            String handle)
                     throws IOException,
                            ResourceGatewayException
Gets the Position with the specified id

Parameters:
id - the id of the Position to get
handle - a valid session handle
Returns:
the matching Position
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Position

getPositionByName

public Position getPositionByName(String name,
                                  String handle)
                           throws IOException,
                                  ResourceGatewayException
Gets the Position with the specified name

Parameters:
name - the id of the Position to get
handle - a valid session handle
Returns:
the matching Position
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Position

getOrgGroup

public OrgGroup getOrgGroup(String id,
                            String handle)
                     throws IOException,
                            ResourceGatewayException
Gets the OrgGroup with the specified id

Parameters:
id - the id of the OrgGroup to get
handle - a valid session handle
Returns:
the matching OrgGroup
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the OrgGroup

getOrgGroupByName

public OrgGroup getOrgGroupByName(String name,
                                  String handle)
                           throws IOException,
                                  ResourceGatewayException
Gets the OrgGroup with the specified name

Parameters:
name - the id of the OrgGroup to get
handle - a valid session handle
Returns:
the matching OrgGroup
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the OrgGroup

getParticipantIdentifiers

public Map<String,String> getParticipantIdentifiers(String handle)
                                             throws IOException,
                                                    ResourceGatewayException
Gets the id and full name of every Participant

Parameters:
handle - a valid session handle
Returns:
a Map of Participant id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Participants

getParticipantIdentifiersToJSON

public String getParticipantIdentifiersToJSON(String handle)
                                       throws IOException,
                                              ResourceGatewayException
Gets the id and full name of every Participant in JSON format

Parameters:
handle - a valid session handle
Returns:
a JSON String of Participant id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Participants

getParticipantIdentifiers

public Map<String,String> getParticipantIdentifiers(ResourceDataSet.Identifier identifier,
                                                    String handle)
                                             throws IOException,
                                                    ResourceGatewayException
Gets the id and chosen name value of every Participant

Parameters:
identifier - a valid ResourceDataSet Identifier value
handle - a valid session handle
Returns:
a Map of Participant id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Participants

getParticipantIdentifiersToJSON

public String getParticipantIdentifiersToJSON(ResourceDataSet.Identifier identifier,
                                              String handle)
                                       throws IOException,
                                              ResourceGatewayException
Gets the id and chosen name value of every Participant in JSON format

Parameters:
identifier - a valid ResourceDataSet Identifier value
handle - a valid session handle
Returns:
a JSON String of Participant id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Participants

getNonHumanResourceIdentifiers

public Map<String,String> getNonHumanResourceIdentifiers(String handle)
                                                  throws IOException,
                                                         ResourceGatewayException
Gets the id and name of every NonHumanResource

Parameters:
handle - a valid session handle
Returns:
a Map of NonHumanResource id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the NonHumanResources

getNonHumanResourceIdentifiersToJSON

public String getNonHumanResourceIdentifiersToJSON(String handle)
                                            throws IOException,
                                                   ResourceGatewayException
Gets the id and name of every NonHumanResource in JSON format

Parameters:
handle - a valid session handle
Returns:
a JSON String of NonHumanResource id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the NonHumanResources

getRoleIdentifiers

public Map<String,String> getRoleIdentifiers(String handle)
                                      throws IOException,
                                             ResourceGatewayException
Gets the id and name of every Role

Parameters:
handle - a valid session handle
Returns:
a Map of Role id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Roles

getRoleIdentifiersToJSON

public String getRoleIdentifiersToJSON(String handle)
                                throws IOException,
                                       ResourceGatewayException
Gets the id and name of every Role in JSON format

Parameters:
handle - a valid session handle
Returns:
a JSON String of Role id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Roles

getPositionIdentifiers

public Map<String,String> getPositionIdentifiers(String handle)
                                          throws IOException,
                                                 ResourceGatewayException
Gets the id and name of every Position

Parameters:
handle - a valid session handle
Returns:
a Map of Position id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Positions

getPositionIdentifiersToJSON

public String getPositionIdentifiersToJSON(String handle)
                                    throws IOException,
                                           ResourceGatewayException
Gets the id and name of every Position in JSON format

Parameters:
handle - a valid session handle
Returns:
a JSON String of Position id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Positions

getCapabilityIdentifiers

public Map<String,String> getCapabilityIdentifiers(String handle)
                                            throws IOException,
                                                   ResourceGatewayException
Gets the id and name of every Capability

Parameters:
handle - a valid session handle
Returns:
a Map of Capability id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Capabilities

getCapabilityIdentifiersToJSON

public String getCapabilityIdentifiersToJSON(String handle)
                                      throws IOException,
                                             ResourceGatewayException
Gets the id and name of every Capability in JSON format

Parameters:
handle - a valid session handle
Returns:
a JSON String of Capability id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the Capabilities

getOrgGroupIdentifiers

public Map<String,String> getOrgGroupIdentifiers(String handle)
                                          throws IOException,
                                                 ResourceGatewayException
Gets the id and name of every OrgGroup

Parameters:
handle - a valid session handle
Returns:
a Map of OrgGroup id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the OrgGroups

getOrgGroupIdentifiersToJSON

public String getOrgGroupIdentifiersToJSON(String handle)
                                    throws IOException,
                                           ResourceGatewayException
Gets the id and name of every OrgGroup in JSON format

Parameters:
handle - a valid session handle
Returns:
a JSON String of OrgGroup id/name pairs
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the OrgGroups

getUserPrivileges

public UserPrivileges getUserPrivileges(String id,
                                        String handle)
                                 throws IOException,
                                        ResourceGatewayException
Gets the UserPrivileges of the Participant with the specified id

Parameters:
id - the id of the Participant to get the UserPrivileges for
handle - a valid session handle
Returns:
the matching UserPrivileges
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there is some problem getting the UserPrivileges

addParticipant

public String addParticipant(Participant p,
                             String handle)
                      throws IOException
Adds a new participant to the service's org data

Parameters:
p - the Participant
handle - the current sessionhandle
Returns:
the id of the newly added Participant, or an error message if there was a problem (note: the returned id should be subsequently added to the Participant object using p.setID() )
Throws:
IOException - if there was a problem connecting to the resource service

addParticipant

public String addParticipant(Participant p,
                             boolean encryptPassword,
                             String handle)
                      throws IOException
Adds a new participant to the service's org data

Parameters:
p - the Participant
encryptPassword - if true, will encrypt the current password within 'p' before storing it on the server side (recommended for plain text passwords)
handle - the current sessionhandle
Returns:
the id of the newly added Participant, or an error message if there was a problem (note: the returned id should be subsequently added to the Participant object using p.setID() )
Throws:
IOException - if there was a problem connecting to the resource service

addNonHumanResource

public String addNonHumanResource(NonHumanResource resource,
                                  String handle)
                           throws IOException
Adds a new NonHumanResource to the service's org data

Parameters:
resource - the NonHumanResource
handle - the current sessionhandle
Returns:
the id of the newly added NonHumanResource, or an error message if there was a problem (note: the returned id should be subsequently added to the NonHumanResource object using cap.setID() )
Throws:
IOException - if there was a problem connecting to the resource service

addCapability

public String addCapability(Capability cap,
                            String handle)
                     throws IOException
Adds a new capability to the service's org data

Parameters:
cap - the Capability
handle - the current sessionhandle
Returns:
the id of the newly added Capability, or an error message if there was a problem (note: the returned id should be subsequently added to the Capability object using cap.setID() )
Throws:
IOException - if there was a problem connecting to the resource service

addRole

public String addRole(Role role,
                      String handle)
               throws IOException
Adds a new role to the service's org data

Parameters:
role - the Role
handle - the current sessionhandle
Returns:
the id of the newly added Role, or an error message if there was a problem (note: the returned id should be subsequently added to the Role object using role.setID() )
Throws:
IOException - if there was a problem connecting to the resource service

addPosition

public String addPosition(Position pos,
                          String handle)
                   throws IOException
Adds a new position to the service's org data

Parameters:
pos - the Position
handle - the current sessionhandle
Returns:
the id of the newly added Position, or an error message if there was a problem (note: the returned id should be subsequently added to the Position object using pos.setID() )
Throws:
IOException - if there was a problem connecting to the resource service

addOrgGroup

public String addOrgGroup(OrgGroup group,
                          String handle)
                   throws IOException
Adds a new org group to the service's org data

Parameters:
group - the OrgGroup
handle - the current sessionhandle
Returns:
the id of the newly added OrgGroup, or an error message if there was a problem (note: the returned id should be subsequently added to the OrgGroup object using group.setID() )
Throws:
IOException - if there was a problem connecting to the resource service

addParticipantToRole

public String addParticipantToRole(Participant p,
                                   Role role,
                                   String handle)
                            throws IOException
Adds the specified Participant to the specified Role

Parameters:
p - the Participant
role - the Role to add the Particpant to
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

addParticipantToCapability

public String addParticipantToCapability(Participant p,
                                         Capability cap,
                                         String handle)
                                  throws IOException
Adds the specified Participant to the specified Capability

Parameters:
p - the Participant
cap - the Capability to add the Particpant to
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

addParticipantToPosition

public String addParticipantToPosition(Participant p,
                                       Position pos,
                                       String handle)
                                throws IOException
Adds the specified Participant to the specified Position

Parameters:
p - the Participant
pos - the Position to add the Particpant to
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

updateParticipant

public String updateParticipant(Participant p,
                                boolean encryptPassword,
                                String handle)
                         throws IOException
Updates the Participant stored in the service's org data with the modified values of the Participant specified

Parameters:
p - the Participant
encryptPassword - if true, will encrypt the current password within 'p' before storing it on the server side (recommended for plain text passwords)
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

updateParticipant

public String updateParticipant(Participant p,
                                String handle)
                         throws IOException
Updates the Participant stored in the service's org data with the modified values of the Participant specified

Parameters:
p - the Participant
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

updateNonHumanResource

public String updateNonHumanResource(NonHumanResource resource,
                                     String handle)
                              throws IOException
Updates a new NonHumanResource to the service's org data with the modified values of the NonHumanResource specified

Parameters:
resource - the NonHumanResource
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

updateCapability

public String updateCapability(Capability cap,
                               String handle)
                        throws IOException
Updates the Capability stored in the service's org data with the modified values of the Capability specified

Parameters:
cap - the Capability
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

updateRole

public String updateRole(Role role,
                         String handle)
                  throws IOException
Updates the Role stored in the service's org data with the modified values of the Role specified

Parameters:
role - the Role
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

updatePosition

public String updatePosition(Position pos,
                             String handle)
                      throws IOException
Updates the Position stored in the service's org data with the modified values of the Position specified

Parameters:
pos - the Position
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

updateOrgGroup

public String updateOrgGroup(OrgGroup group,
                             String handle)
                      throws IOException
Updates the OrgGroup stored in the service's org data with the modified values of the OrgGroup specified

Parameters:
group - the OrgGroup
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

updateNonHumanCategory

public String updateNonHumanCategory(NonHumanCategory category,
                                     String handle)
                              throws IOException
Updates the NonHumanCategory stored in the service's org data with the modified values of the NonHumanResource specified

Parameters:
category - the NonHumanResource
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

removeParticipant

public String removeParticipant(Participant p,
                                String handle)
                         throws IOException
Removes (deletes) the specified Participant from the service's org data

Parameters:
p - the Participant
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

removeNonHumanResource

public String removeNonHumanResource(NonHumanResource resource,
                                     String handle)
                              throws IOException
Removes (deletes) the specified NonHumanResource from the service's org data

Parameters:
resource - the NonHumanResource
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

removeCapability

public String removeCapability(Capability cap,
                               String handle)
                        throws IOException
Removes (deletes) the specified Capability from the service's org data

Parameters:
cap - the Capability
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

removeRole

public String removeRole(Role role,
                         String handle)
                  throws IOException
Removes (deletes) the specified Role from the service's org data

Parameters:
role - the Role
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

removePosition

public String removePosition(Position pos,
                             String handle)
                      throws IOException
Removes (deletes) the specified Position from the service's org data

Parameters:
pos - the Position
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

removeOrgGroup

public String removeOrgGroup(OrgGroup group,
                             String handle)
                      throws IOException
Removes (deletes) the specified OrgGroup from the service's org data

Parameters:
group - the OrgGroup
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

removeParticipantFromRole

public String removeParticipantFromRole(Participant p,
                                        Role role,
                                        String handle)
                                 throws IOException
Removes (deletes) the specified Participant from the set of Participants occupying the specified Role

Parameters:
p - the Participant
role - the Role to remove the specified Participant from
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

removeParticipantFromCapability

public String removeParticipantFromCapability(Participant p,
                                              Capability cap,
                                              String handle)
                                       throws IOException
Removes (deletes) the specified Participant from the set of Participants holding the specified Capability

Parameters:
p - the Participant
cap - the Capability to remove the specified Participant from
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

removeParticipantFromPosition

public String removeParticipantFromPosition(Participant p,
                                            Position pos,
                                            String handle)
                                     throws IOException
Removes (deletes) the specified Participant from the set of Participants occupying the specified Position

Parameters:
p - the Participant
pos - the Position to remove the specified Participant from
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

setContainingRole

public String setContainingRole(Role role,
                                Role containingRole,
                                String handle)
                         throws IOException
Sets the containing Role for a Role (i.e. the 'parent' Role the Role 'belongs to')

Parameters:
role - the Role
containingRole - the containing or parent Role that encapsulates role
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

setContainingOrgGroup

public String setContainingOrgGroup(OrgGroup group,
                                    OrgGroup containingGroup,
                                    String handle)
                             throws IOException
Sets the containing OrgGroup for an OrgGroup (i.e. the 'parent' OrgGroup the OrgGroup 'belongs to')

Parameters:
group - the OrgGroup
containingGroup - the containing or parent OrgGroup that encapsulates group
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

setContainingPosition

public String setContainingPosition(Position pos,
                                    Position containingPos,
                                    String handle)
                             throws IOException
Sets the containing Position for a Position (i.e. the 'parent' Position the Position 'reports to')

Parameters:
pos - the Position
containingPos - the containing or parent Position that encapsulates pos
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

setPositionOrgGroup

public String setPositionOrgGroup(Position pos,
                                  OrgGroup group,
                                  String handle)
                           throws IOException
Sets the containing OrgGroup for a Position

Parameters:
pos - the Position
group - the containing OrgGroup
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

setParticipantPrivileges

public String setParticipantPrivileges(Participant p,
                                       UserPrivileges privs,
                                       String handle)
                                throws IOException
Sets the user privileges for a Participant

Parameters:
p - the Participant
privs - the UserPrivileges object
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

setParticipantPrivileges

public String setParticipantPrivileges(Participant p,
                                       String handle)
                                throws IOException
Sets the user privileges for a Participant

Parameters:
p - the Participant (note: the privilege values used are the ones currently within the Participant object specified)
handle - the current sessionhandle
Returns:
a message indicating success, or describing a problem encountered
Throws:
IOException - if there was a problem connecting to the resource service

getNonHumanCategory

public NonHumanCategory getNonHumanCategory(String id,
                                            String handle)
                                     throws IOException,
                                            ResourceGatewayException
Gets the NonHumanCategory with the specified id

Parameters:
id - a valid NonHumanCategory identifier
handle - a valid session handle
Returns:
the NonHumanCategory object matching the id specified
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there was a problem getting the NonHumanCategory

getNonHumanCategoryByName

public NonHumanCategory getNonHumanCategoryByName(String name,
                                                  String handle)
                                           throws IOException,
                                                  ResourceGatewayException
Gets the NonHumanCategory with the specified name

Parameters:
name - a valid NonHumanCategory name
handle - a valid session handle
Returns:
the NonHumanCategory object matching the name specified
Throws:
IOException - if the service can't be reached
ResourceGatewayException - if there was a problem getting the NonHumanCategory

getNonHumanCategories

public List<NonHumanCategory> getNonHumanCategories(String handle)
                                             throws IOException,
                                                    ResourceGatewayException
Gets the list of all NonHumanCategory objects known to the Resource Service

Parameters:
handle - the current sessionhandle
Returns:
a list of categories
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the list

getNonHumanCategoriesToJSON

public String getNonHumanCategoriesToJSON(String handle)
                                   throws IOException,
                                          ResourceGatewayException
Gets the list of all NonHumanResource category names in JSON format

Parameters:
handle - the current sessionhandle
Returns:
a JSON String of paired category names
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the list

getNonHumanSubCategories

public List<String> getNonHumanSubCategories(String id,
                                             String handle)
                                      throws IOException,
                                             ResourceGatewayException
Gets the list of all the subcategory names of a NonHumanResource category

Parameters:
id - the category id to get the subcategories for
handle - the current sessionhandle
Returns:
a list of category name strings
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the list

getNonHumanSubCategoriesByName

public List<String> getNonHumanSubCategoriesByName(String category,
                                                   String handle)
                                            throws IOException,
                                                   ResourceGatewayException
Gets the list of all the subcategory names of a NonHumanResource category

Parameters:
category - the category name to get the subcategories for
handle - the current sessionhandle
Returns:
a list of category name strings
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the list

getNonHumanSubCategoriesToJSON

public String getNonHumanSubCategoriesToJSON(String id,
                                             String handle)
                                      throws IOException,
                                             ResourceGatewayException
Gets the list of all the subcategory names of a NonHumanResource category in JSON format

Parameters:
id - the category id to get the subcategories for
handle - the current sessionhandle
Returns:
a JSON String of category name pairs
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the list

getNonHumanSubCategoriesToJSONByName

public String getNonHumanSubCategoriesToJSONByName(String category,
                                                   String handle)
                                            throws IOException,
                                                   ResourceGatewayException
Gets the list of all the subcategory names of a NonHumanResource category in JSON format

Parameters:
category - the category name to get the subcategories for
handle - the current sessionhandle
Returns:
a JSON String of category name pairs
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the list

getNonHumanCategorySet

public Map<String,Set<String>> getNonHumanCategorySet(String handle)
                                               throws IOException,
                                                      ResourceGatewayException
Gets the list of all NonHumanResource category names and the subcategories of each

Parameters:
handle - the current sessionhandle
Returns:
a map of category names to a set of subcategory name strings
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem getting the list

addNonHumanCategory

public String addNonHumanCategory(String category,
                                  String handle)
                           throws IOException,
                                  ResourceGatewayException
Adds a new NonHumanResource category

Parameters:
category - the category to add
handle - the current sessionhandle
Returns:
a unique id for the category
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem adding the category

addNonHumanSubCategoryByName

public boolean addNonHumanSubCategoryByName(String category,
                                            String subcategory,
                                            String handle)
                                     throws IOException,
                                            ResourceGatewayException
Adds a new NonHumanResource category

Parameters:
category - the category name to add the subcategory to
subcategory - the subcategory to add
handle - the current sessionhandle
Returns:
true if the add was successful
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem adding the subcategory

addNonHumanSubCategory

public boolean addNonHumanSubCategory(String id,
                                      String subcategory,
                                      String handle)
                               throws IOException,
                                      ResourceGatewayException
Adds a new NonHumanResource category

Parameters:
id - the identifier of the category to add the subcategory to
subcategory - the subcategory to add
handle - the current sessionhandle
Returns:
true if the add was successful
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem adding the subcategory

removeNonHumanCategory

public boolean removeNonHumanCategory(String id,
                                      String handle)
                               throws IOException,
                                      ResourceGatewayException
Removes a category of the list of NonHumanResource categories

Parameters:
id - the identifier of the category to remove; all of the category's subcategories will also be removed
handle - the current sessionhandle
Returns:
true if the removal was successful
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem removing the category

removeNonHumanCategoryByName

public boolean removeNonHumanCategoryByName(String name,
                                            String handle)
                                     throws IOException,
                                            ResourceGatewayException
Removes a category of the list of NonHumanResource categories

Parameters:
name - the name of the category to remove; all of the category's subcategories will also be removed
handle - the current sessionhandle
Returns:
true if the removal was successful
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem removing the category

removeNonHumanSubCategoryByName

public boolean removeNonHumanSubCategoryByName(String category,
                                               String subcategory,
                                               String handle)
                                        throws IOException,
                                               ResourceGatewayException
Removes a subcategory of a NonHumanResource category

Parameters:
category - the name of the category to remove the subcategory from
subcategory - the subcategory name to remove
handle - the current sessionhandle
Returns:
true if the removal was successful
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem removing the subcategory

removeNonHumanSubCategory

public boolean removeNonHumanSubCategory(String id,
                                         String subcategory,
                                         String handle)
                                  throws IOException,
                                         ResourceGatewayException
Removes a subcategory of a NonHumanResource category

Parameters:
id - the identifier of the category to remove the subcategory from
subcategory - the subcategory name to remove
handle - the current sessionhandle
Returns:
true if the removal was successful
Throws:
IOException - if there was a problem connecting to the resource service
ResourceGatewayException - if there was a problem removing the subcategory


Copyright © 2004-2012 The YAWL Foundation.