org.yawlfoundation.yawl.resourcing.rsInterface
Class ResourceCalendarGatewayClient

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.interfce.Interface_Client
      extended by org.yawlfoundation.yawl.resourcing.rsInterface.ResourceCalendarGatewayClient

public class ResourceCalendarGatewayClient
extends Interface_Client

Author:
Michael Adams
Created/Last Date:
11/10/2010

Constructor Summary
ResourceCalendarGatewayClient()
          empty constructor
ResourceCalendarGatewayClient(String uri)
          constructor
 
Method Summary
 String checkConnection(String handle)
          Check that a session handle is active
 String connect(String userID, String password)
          Connects an external entity to the resource service
 void disconnect(String handle)
          Disconnects an external entity from the resource service
 String getAvailability(String resourceXML, Date fromDate, Date toDate, String handle)
          Gets the periods (timeslots) between 'from' and 'to' when the resource described by the resource record xml, is available
 String getAvailability(String resourceXML, long from, long to, String handle)
          Gets the periods (timeslots) between 'from' and 'to' when the resource described by the resource record xml, is available
 String getReservations(String resourceXML, Date fromDate, Date toDate, String handle)
          Gets all the current reservations held for a resource within a time period
 String getReservations(String resourceXML, long from, long to, String handle)
          Gets all the current reservations held for a resource within a time period
 String getResourceAvailability(String resourceID, Date fromDate, Date toDate, String handle)
          Gets the periods (timeslots) between 'from' and 'to' when the resource is available
 String getResourceAvailability(String resourceID, long from, long to, String handle)
          Gets the periods (timeslots) between 'from' and 'to' when the resource is available
 String registerStatusChangeListener(String uri, String handle)
          Registers a URI as a listener for status change events.
 void removeStatusChangeListener(String uri, String handle)
          Removes a URI as a listener for status change events.
 String saveReservations(String planXML, boolean checkOnly, String handle)
          Saves all the reservations within a UtilisationPlan (where possible)
 
Methods inherited from class org.yawlfoundation.yawl.engine.interfce.Interface_Client
executeGet, executePost, prepareParamMap, setReadTimeout, stripOuterElement, successful
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceCalendarGatewayClient

public ResourceCalendarGatewayClient()
empty constructor


ResourceCalendarGatewayClient

public ResourceCalendarGatewayClient(String uri)
constructor

Parameters:
uri - the uri of the resourceService's gateway
Method Detail

connect

public String connect(String userID,
                      String password)
               throws IOException
Connects an external entity to the resource service

Parameters:
userID - the userid
password - the corresponding password
Returns:
a sessionHandle if successful, or a failure message if not
Throws:
IOException - if the service can't be reached

checkConnection

public String checkConnection(String handle)
                       throws IOException
Check that a session handle is active

Parameters:
handle - the session handle to check
Returns:
"true" if the id is valid, "false" if otherwise
Throws:
IOException - if the service can't be reached

disconnect

public void disconnect(String handle)
                throws IOException
Disconnects an external entity from the resource service

Parameters:
handle - the sessionHandle to disconnect
Throws:
IOException - if the service can't be reached

registerStatusChangeListener

public String registerStatusChangeListener(String uri,
                                           String handle)
                                    throws IOException
Registers a URI as a listener for status change events. Note that only changes that affect the owner of the handle will receive events via the URI.

Parameters:
uri - the uri to which status change announcements are made
handle - a valid session handle
Returns:
a diagnostic message
Throws:
IOException - if the service can't be reached

removeStatusChangeListener

public void removeStatusChangeListener(String uri,
                                       String handle)
                                throws IOException
Removes a URI as a listener for status change events.

Parameters:
uri - the uri to remove as a listener for status change announcements
handle - a valid session handle
Throws:
IOException - if the service can't be reached

getAvailability

public String getAvailability(String resourceXML,
                              long from,
                              long to,
                              String handle)
                       throws IOException
Gets the periods (timeslots) between 'from' and 'to' when the resource described by the resource record xml, is available

Parameters:
resourceXML - the resource record to check for availability
from - the start of the date/time range
to - the end of the date/time range
handle - a valid session handle
Returns:
an xml string of the resource's available timeslots
Throws:
IOException - if the service can't be reached

getAvailability

public String getAvailability(String resourceXML,
                              Date fromDate,
                              Date toDate,
                              String handle)
                       throws IOException
Gets the periods (timeslots) between 'from' and 'to' when the resource described by the resource record xml, is available

Parameters:
resourceXML - the resource record to check for availability
fromDate - the start of the date/time range
toDate - the end of the date/time range
handle - a valid session handle
Returns:
an xml string of the resource's available timeslots
Throws:
IOException - if the service can't be reached

getResourceAvailability

public String getResourceAvailability(String resourceID,
                                      long from,
                                      long to,
                                      String handle)
                               throws IOException
Gets the periods (timeslots) between 'from' and 'to' when the resource is available

Parameters:
resourceID - the resource to check for availability
from - the start of the date/time range
to - the end of the date/time range
handle - a valid session handle
Returns:
an xml string of the resource's available timeslots
Throws:
IOException - if the service can't be reached

getResourceAvailability

public String getResourceAvailability(String resourceID,
                                      Date fromDate,
                                      Date toDate,
                                      String handle)
                               throws IOException
Gets the periods (timeslots) between 'from' and 'to' when the resource is available

Parameters:
resourceID - the resource to check for availability
fromDate - the start of the date/time range
toDate - the end of the date/time range
handle - a valid session handle
Returns:
an xml string of the resource's available timeslots
Throws:
IOException - if the service can't be reached

getReservations

public String getReservations(String resourceXML,
                              long from,
                              long to,
                              String handle)
                       throws IOException
Gets all the current reservations held for a resource within a time period

Parameters:
resourceXML - the resource(s) to get the reservations for
from - the start of the date/time range
to - the end of the date/time range
handle - a valid session handle
Returns:
an xml string of the resource's reservations
Throws:
IOException - if the service can't be reached

getReservations

public String getReservations(String resourceXML,
                              Date fromDate,
                              Date toDate,
                              String handle)
                       throws IOException
Gets all the current reservations held for a resource within a time period

Parameters:
resourceXML - the resource(s) to get the reservations for
fromDate - the start of the date/time range
toDate - the end of the date/time range
handle - a valid session handle
Returns:
an xml string of the resource's reservations
Throws:
IOException - if the service can't be reached

saveReservations

public String saveReservations(String planXML,
                               boolean checkOnly,
                               String handle)
                        throws IOException
Saves all the reservations within a UtilisationPlan (where possible)

Parameters:
planXML - the UtilisationPlan containing the reservations
checkOnly - if true, will report on the effects only - won't update the reservations
handle - a valid session handle
Returns:
an passed xml plan, updated with messages where appropriate
Throws:
IOException - if the service can't be reached


Copyright © 2004-2012 The YAWL Foundation.