org.yawlfoundation.yawl.resourcing.rsInterface
Class WorkQueueGatewayClientAdapter

java.lang.Object
  extended by org.yawlfoundation.yawl.resourcing.rsInterface.WorkQueueGatewayClientAdapter

public class WorkQueueGatewayClientAdapter
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 Version: 2.0


Field Summary
protected  ResourceMarshaller _marshaller
           
protected  String _uri
           
protected  WorkQueueGatewayClient _wqclient
           
 
Constructor Summary
WorkQueueGatewayClientAdapter()
           
WorkQueueGatewayClientAdapter(String uri)
           
 
Method Summary
 String acceptOffer(String pid, String itemID, String handle)
           
 String addRegisteredService(YAWLServiceReference service, String handle)
           
 String allocateItem(String pid, String itemID, String handle)
           
 String cancelCase(String caseID, String handle)
           
 boolean checkConnection(String handle)
          Checks that the connection to the service is valid
 String completeItem(String pid, String itemID, String handle)
           
 String connect(String userid, String password)
          Attempts to connect to the service (as a service)
 String deallocateItem(String pid, String itemID, String handle)
           
 String delegateItem(String pFrom, String pTo, String itemID, String handle)
           
 void disconnect(String handle)
          Disconnects a session from the service
 QueueSet getAdminQueues(String handle)
           
 Set<Participant> getAllParticipants(String handle)
           
 String getCaseData(String caseID, String handle)
           
 String getCaseDataSchema(YSpecificationID specID, String handle)
           
 String getClientURI()
           
 String getDecompID(WorkItemRecord wir, String handle)
           
 Set<Participant> getDistributionSet(String itemID, String handle)
           
 String getFullNameForUserID(String userid, String handle)
           
 Set<SpecificationData> getLoadedSpecs(String handle)
           
 Set<Participant> getOrgGroupMembers(String oid, String handle)
           
 Participant getParticipant(String pid, String handle)
           
 Participant getParticipantFromUserID(String userid, String handle)
           
 Set<Participant> getParticipantsAssignedWorkItem(String workItemID, int queueType, String handle)
           
 Set<WorkItemRecord> getQueuedWorkItems(String pid, int queue, String handle)
           
 Set<YAWLServiceReference> getRegisteredServices(String handle)
           
 Set<Participant> getReportingToParticipant(String pid, String handle)
           
 Set<Participant> getRoleMembers(String rid, String handle)
           
 String getRunningCases(YSpecificationID specID, String handle)
           
 SpecificationData getSpecData(YSpecificationID specID, String handle)
           
 Set<SpecificationData> getSpecList(String handle)
           
 TaskPrivileges getTaskPrivileges(String itemid, String handle)
           
 UserPrivileges getUserPrivileges(String pid, String handle)
           
 String getWorkItem(String itemID, String handle)
           
 Set<WorkItemRecord> getWorkItemChildren(String itemID, String handle)
           
 String getWorkItemDataSchema(String itemID, String handle)
           
 String getWorkItemDurationsForParticipant(YSpecificationID specID, String taskName, String pid, String handle)
           
 Set<YParameter> getWorkItemOutputOnlyParameters(String itemID, String handle)
           
 Set<YParameter> getWorkItemParameters(String itemID, String handle)
           
 boolean isValidUserSession(String handle)
           
 String launchCase(YSpecificationID specID, String caseData, String handle)
           
 String offerItem(Set<String> pid, String itemID, String handle)
           
 String pileItem(String pid, String itemID, String handle)
           
 String reallocateItem(String pid, String itemID, String handle)
           
 String reallocateItem(String pFrom, String pTo, String itemID, boolean stateful, String handle)
           
 String redirectWorkItemToYawlService(String itemID, String serviceName, String handle)
           
 String removeRegisteredService(String id, String handle)
           
 String reofferItem(Set<String> pid, String itemID, String handle)
           
 String restartItem(String pid, String itemID, String handle)
           
 void setClientURI(String uri)
           
 String skipItem(String pid, String itemID, String handle)
           
 WorkItemRecord startItem(String pid, String itemID, String handle)
           
protected  String successCheck(String xml)
           
 boolean successful(String result)
           
 String suspendItem(String pid, String itemID, String handle)
           
 boolean synchroniseCaches(String handle)
           
 String unloadSpecification(YSpecificationID specID, String handle)
           
 String unsuspendItem(String pid, String itemID, String handle)
           
 void updateWIRCache(WorkItemRecord wir, String handle)
           
 String updateWorkItemData(String itemID, String data, String handle)
           
 String uploadSpecification(String fileContents, String fileName, String handle)
           
 String userlogin(String userid, String password)
          Attempts to connect to the service (as a user/participant)
 String userlogin(String userid, String password, boolean encrypt)
          Attempts to connect to the service (as a user/participant)
 String userlogout(String handle)
          Logs out a user session (as opposed to a service connection)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_wqclient

protected WorkQueueGatewayClient _wqclient

_uri

protected String _uri

_marshaller

protected ResourceMarshaller _marshaller
Constructor Detail

WorkQueueGatewayClientAdapter

public WorkQueueGatewayClientAdapter()

WorkQueueGatewayClientAdapter

public WorkQueueGatewayClientAdapter(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 (as a service)

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

userlogin

public String userlogin(String userid,
                        String password)
Attempts to connect to the service (as a user/participant)

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

userlogout

public String userlogout(String handle)
Logs out a user session (as opposed to a service connection)

Parameters:
handle - the session handle
Returns:
a success message
Throws:
IOException

userlogin

public String userlogin(String userid,
                        String password,
                        boolean encrypt)
Attempts to connect to the service (as a user/participant)

Parameters:
userid - the userid
password - the corresponding password
encrypt - true if encryption is required (most cases); false if the password is already encrypted
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

isValidUserSession

public boolean isValidUserSession(String handle)
                           throws IOException
Throws:
IOException

getParticipantFromUserID

public Participant getParticipantFromUserID(String userid,
                                            String handle)
                                     throws IOException,
                                            ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getFullNameForUserID

public String getFullNameForUserID(String userid,
                                   String handle)
                            throws IOException,
                                   ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getUserPrivileges

public UserPrivileges getUserPrivileges(String pid,
                                        String handle)
                                 throws IOException,
                                        ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getTaskPrivileges

public TaskPrivileges getTaskPrivileges(String itemid,
                                        String handle)
                                 throws IOException,
                                        ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getReportingToParticipant

public Set<Participant> getReportingToParticipant(String pid,
                                                  String handle)
                                           throws IOException,
                                                  ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getOrgGroupMembers

public Set<Participant> getOrgGroupMembers(String oid,
                                           String handle)
                                    throws IOException,
                                           ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getRoleMembers

public Set<Participant> getRoleMembers(String rid,
                                       String handle)
                                throws IOException,
                                       ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getParticipant

public Participant getParticipant(String pid,
                                  String handle)
                           throws IOException,
                                  ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getAllParticipants

public Set<Participant> getAllParticipants(String handle)
                                    throws IOException,
                                           ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getDistributionSet

public Set<Participant> getDistributionSet(String itemID,
                                           String handle)
                                    throws IOException,
                                           ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getAdminQueues

public QueueSet getAdminQueues(String handle)
                        throws IOException,
                               ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getQueuedWorkItems

public Set<WorkItemRecord> getQueuedWorkItems(String pid,
                                              int queue,
                                              String handle)
                                       throws IOException,
                                              ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getWorkItem

public String getWorkItem(String itemID,
                          String handle)
                   throws IOException,
                          ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getWorkItemChildren

public Set<WorkItemRecord> getWorkItemChildren(String itemID,
                                               String handle)
                                        throws IOException,
                                               ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getWorkItemParameters

public Set<YParameter> getWorkItemParameters(String itemID,
                                             String handle)
                                      throws IOException,
                                             ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getWorkItemOutputOnlyParameters

public Set<YParameter> getWorkItemOutputOnlyParameters(String itemID,
                                                       String handle)
                                                throws IOException,
                                                       ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getWorkItemDataSchema

public String getWorkItemDataSchema(String itemID,
                                    String handle)
                             throws IOException,
                                    ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getCaseDataSchema

public String getCaseDataSchema(YSpecificationID specID,
                                String handle)
                         throws IOException,
                                ResourceGatewayException
Throws:
IOException
ResourceGatewayException

synchroniseCaches

public boolean synchroniseCaches(String handle)
                          throws IOException
Throws:
IOException

updateWorkItemData

public String updateWorkItemData(String itemID,
                                 String data,
                                 String handle)
                          throws IOException,
                                 ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getParticipantsAssignedWorkItem

public Set<Participant> getParticipantsAssignedWorkItem(String workItemID,
                                                        int queueType,
                                                        String handle)
                                                 throws IOException,
                                                        ResourceGatewayException
Throws:
IOException
ResourceGatewayException

acceptOffer

public String acceptOffer(String pid,
                          String itemID,
                          String handle)
                   throws IOException,
                          ResourceGatewayException
Throws:
IOException
ResourceGatewayException

startItem

public WorkItemRecord startItem(String pid,
                                String itemID,
                                String handle)
                         throws IOException,
                                ResourceGatewayException
Throws:
IOException
ResourceGatewayException

deallocateItem

public String deallocateItem(String pid,
                             String itemID,
                             String handle)
                      throws IOException,
                             ResourceGatewayException
Throws:
IOException
ResourceGatewayException

delegateItem

public String delegateItem(String pFrom,
                           String pTo,
                           String itemID,
                           String handle)
                    throws IOException,
                           ResourceGatewayException
Throws:
IOException
ResourceGatewayException

reallocateItem

public String reallocateItem(String pFrom,
                             String pTo,
                             String itemID,
                             boolean stateful,
                             String handle)
                      throws IOException,
                             ResourceGatewayException
Throws:
IOException
ResourceGatewayException

skipItem

public String skipItem(String pid,
                       String itemID,
                       String handle)
                throws IOException,
                       ResourceGatewayException
Throws:
IOException
ResourceGatewayException

pileItem

public String pileItem(String pid,
                       String itemID,
                       String handle)
                throws IOException,
                       ResourceGatewayException
Throws:
IOException
ResourceGatewayException

suspendItem

public String suspendItem(String pid,
                          String itemID,
                          String handle)
                   throws IOException,
                          ResourceGatewayException
Throws:
IOException
ResourceGatewayException

unsuspendItem

public String unsuspendItem(String pid,
                            String itemID,
                            String handle)
                     throws IOException,
                            ResourceGatewayException
Throws:
IOException
ResourceGatewayException

completeItem

public String completeItem(String pid,
                           String itemID,
                           String handle)
                    throws IOException,
                           ResourceGatewayException
Throws:
IOException
ResourceGatewayException

offerItem

public String offerItem(Set<String> pid,
                        String itemID,
                        String handle)
                 throws IOException,
                        ResourceGatewayException
Throws:
IOException
ResourceGatewayException

reofferItem

public String reofferItem(Set<String> pid,
                          String itemID,
                          String handle)
                   throws IOException,
                          ResourceGatewayException
Throws:
IOException
ResourceGatewayException

allocateItem

public String allocateItem(String pid,
                           String itemID,
                           String handle)
                    throws IOException,
                           ResourceGatewayException
Throws:
IOException
ResourceGatewayException

reallocateItem

public String reallocateItem(String pid,
                             String itemID,
                             String handle)
                      throws IOException,
                             ResourceGatewayException
Throws:
IOException
ResourceGatewayException

restartItem

public String restartItem(String pid,
                          String itemID,
                          String handle)
                   throws IOException,
                          ResourceGatewayException
Throws:
IOException
ResourceGatewayException

redirectWorkItemToYawlService

public String redirectWorkItemToYawlService(String itemID,
                                            String serviceName,
                                            String handle)
                                     throws IOException,
                                            ResourceGatewayException
Throws:
IOException
ResourceGatewayException

getLoadedSpecs

public Set<SpecificationData> getLoadedSpecs(String handle)
                                      throws IOException
Throws:
IOException

getSpecList

public Set<SpecificationData> getSpecList(String handle)
                                   throws IOException
Throws:
IOException

getSpecData

public SpecificationData getSpecData(YSpecificationID specID,
                                     String handle)
                              throws IOException
Throws:
IOException

uploadSpecification

public String uploadSpecification(String fileContents,
                                  String fileName,
                                  String handle)
                           throws IOException
Throws:
IOException

unloadSpecification

public String unloadSpecification(YSpecificationID specID,
                                  String handle)
                           throws IOException
Throws:
IOException

launchCase

public String launchCase(YSpecificationID specID,
                         String caseData,
                         String handle)
                  throws IOException
Throws:
IOException

getRunningCases

public String getRunningCases(YSpecificationID specID,
                              String handle)
                       throws IOException
Throws:
IOException

cancelCase

public String cancelCase(String caseID,
                         String handle)
                  throws IOException
Throws:
IOException

updateWIRCache

public void updateWIRCache(WorkItemRecord wir,
                           String handle)
                    throws IOException
Throws:
IOException

getDecompID

public String getDecompID(WorkItemRecord wir,
                          String handle)
                   throws IOException
Throws:
IOException

getCaseData

public String getCaseData(String caseID,
                          String handle)
                   throws IOException
Throws:
IOException

getWorkItemDurationsForParticipant

public String getWorkItemDurationsForParticipant(YSpecificationID specID,
                                                 String taskName,
                                                 String pid,
                                                 String handle)
                                          throws IOException
Throws:
IOException

getRegisteredServices

public Set<YAWLServiceReference> getRegisteredServices(String handle)
                                                throws IOException
Throws:
IOException

removeRegisteredService

public String removeRegisteredService(String id,
                                      String handle)
                               throws IOException
Throws:
IOException

addRegisteredService

public String addRegisteredService(YAWLServiceReference service,
                                   String handle)
                            throws IOException
Throws:
IOException


Copyright © 2004-2012 The YAWL Foundation.