org.yawlfoundation.yawl.engine.interfce.interfaceA
Class InterfaceA_EnvironmentBasedClient

java.lang.Object
  extended by org.yawlfoundation.yawl.engine.interfce.Interface_Client
      extended by org.yawlfoundation.yawl.engine.interfce.interfaceA.InterfaceA_EnvironmentBasedClient

public class InterfaceA_EnvironmentBasedClient
extends Interface_Client

/** A client side API for the management of processes, services and users

Author:
Lachlan Aldred Date: 16/04/2004 Time: 16:15:02, Michael Adams (refactored for v2.0, 06/2008, and v2.1 11/2009)

Constructor Summary
InterfaceA_EnvironmentBasedClient(String backEndURIStr)
          Constructor
 
Method Summary
 String addClientAccount(String name, String password, String documentation, String sessionHandle)
          Creates a new user inside the engine.
 String addClientAccount(YExternalClient client, String sessionHandle)
           
 String addYAWLService(YAWLServiceReference service, String sessionHandle)
          Registers a new custom YAWL service woth the engine.
 String changePassword(String password, String sessionHandle)
          Change the password of a service or client account on the engine, the account being the owner of the session handle.
 String checkConnection(String sessionHandle)
          Checks that a session handle is active
 String connect(String userID, String password)
          Creates a user session with the engine.
 String getBackEndURI()
           
 String getBuildProperties(String sessionHandle)
           
 YExternalClient getClientAccount(String userID, String sessionHandle)
           
 Set<YExternalClient> getClientAccounts(String sessionHandle)
          Gets all the client accounts registered in the engine
 String getExternalDBGateways(String sessionHandle)
           
 String getHibernateStatistics(String sessionHandle)
           
 String getPassword(String userid, String sessionHandle)
           
 Set<YAWLServiceReference> getRegisteredYAWLServices(String sessionHandle)
          Returns a list of YAWL service objects registered with the engine.
 String getRegisteredYAWLServicesAsXML(String sessionHandle)
          Returns an XML string list of YAWL services registered with the engine.
 YAWLServiceReference getYAWLService(String serviceURI, String sessionHandle)
           
 String isHibernateStatisticsEnabled(String sessionHandle)
           
 String removeClientAccount(String name, String sessionHandle)
          Delete an external client account PREcondition: cannot delete self
 String removeYAWLService(String serviceURI, String sessionHandle)
          Removes a YAWL service from the engine.
 String setHibernateStatisticsEnabled(boolean enabled, String sessionHandle)
           
 String unloadSpecification(String specID, String sessionHandle)
          Deprecated. superceded by unloadSpecification(YSpecificationID, String) - this version is appropriate for pre-2.0 schema-based specs only
 String unloadSpecification(YSpecificationID specID, String sessionHandle)
          Unloads a loaded specification from the engine
 String updateClientAccount(String name, String password, String documentation, String sessionHandle)
           
 String uploadSpecification(File file, String sessionHandle)
          Uploads a specification into the engine.
 String uploadSpecification(String specification, String sessionHandle)
          Uploads a specification into the engine.
 String uploadSpecification(String specification, String filename, String sessionHandle)
          Deprecated. use uploadSpecification(String, String) instead (since 2.0)
 
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

InterfaceA_EnvironmentBasedClient

public InterfaceA_EnvironmentBasedClient(String backEndURIStr)
Constructor

Parameters:
backEndURIStr - the back end uri of where to find the engine. In a default deployment, this value is "http://localhost:8080/yawl/ia" but it can be changed.
Method Detail

getBackEndURI

public String getBackEndURI()

connect

public String connect(String userID,
                      String password)
               throws IOException
Creates a user session with the engine. Returns a sessionhandle for use in all other engine access methods.

Parameters:
userID - a valid user ID
password - a valid password
Returns:
the sessionHandle - expires after one hour.
Throws:
IOException - if there's a problem connecting to the engine

checkConnection

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

Parameters:
sessionHandle - the handle to check
Returns:
true if the handle is active, false if not
Throws:
IOException - if there's a problem connecting to the engine

addYAWLService

public String addYAWLService(YAWLServiceReference service,
                             String sessionHandle)
                      throws IOException
Registers a new custom YAWL service woth the engine.

Parameters:
service - the service.
sessionHandle - a valid sessionhandle
Returns:
a diagnostic XML message.
Throws:
IOException - if something goes awry.

removeYAWLService

public String removeYAWLService(String serviceURI,
                                String sessionHandle)
                         throws IOException
Removes a YAWL service from the engine.

Parameters:
serviceURI - the service URI.
sessionHandle - a valid sessionhandle.
Returns:
a diagnostic XML result message.
Throws:
IOException - if bad connection.

getYAWLService

public YAWLServiceReference getYAWLService(String serviceURI,
                                           String sessionHandle)
                                    throws IOException
Throws:
IOException

getRegisteredYAWLServices

public Set<YAWLServiceReference> getRegisteredYAWLServices(String sessionHandle)
Returns a list of YAWL service objects registered with the engine.

Parameters:
sessionHandle - a valid session handle
Returns:
the set of active yawl services

getRegisteredYAWLServicesAsXML

public String getRegisteredYAWLServicesAsXML(String sessionHandle)
                                      throws IOException
Returns an XML string list of YAWL services registered with the engine.

Parameters:
sessionHandle - an active handle
Returns:
XML string list of services or a diagnostic error message
Throws:
IOException - if there's a problem connecting to the engine

uploadSpecification

public String uploadSpecification(String specification,
                                  String sessionHandle)
                           throws IOException
Uploads a specification into the engine.

Parameters:
specification - this is *not* a file name, this is the entire specification xml file in string format.
sessionHandle - a sessionhandle.
Returns:
a diagnostic XML result message.
Throws:
IOException - if bad connection.

uploadSpecification

public String uploadSpecification(String specification,
                                  String filename,
                                  String sessionHandle)
                           throws IOException
Deprecated. use uploadSpecification(String, String) instead (since 2.0)

Uploads a specification into the engine.

Parameters:
specification - this is *not* a file name, this is the entire specification xml file in string format.
filename - the file name of the specification xml file (no longer used since 2.0)
sessionHandle - a sessionhandle.
Returns:
a diagnostic XML result message.
Throws:
IOException - if bad connection.

uploadSpecification

public String uploadSpecification(File file,
                                  String sessionHandle)
                           throws IOException
Uploads a specification into the engine.

Parameters:
file - the file name of the specification xml file
sessionHandle - a sessionhandle.
Returns:
a diagnostic XML result message.
Throws:
IOException - if bad connection.

unloadSpecification

public String unloadSpecification(String specID,
                                  String sessionHandle)
                           throws IOException
Deprecated. superceded by unloadSpecification(YSpecificationID, String) - this version is appropriate for pre-2.0 schema-based specs only

Unloads a loaded specification from the engine

Parameters:
specID - the id of the specification to unload
sessionHandle - a sessionhandle.
Returns:
a diagnostic XML result message.
Throws:
IOException - if bad connection.

unloadSpecification

public String unloadSpecification(YSpecificationID specID,
                                  String sessionHandle)
                           throws IOException
Unloads a loaded specification from the engine

Parameters:
specID - the id of the specification to unload
sessionHandle - a sessionhandle.
Returns:
a diagnostic XML result message.
Throws:
IOException - if bad connection.

addClientAccount

public String addClientAccount(String name,
                               String password,
                               String documentation,
                               String sessionHandle)
                        throws IOException
Creates a new user inside the engine.

Parameters:
name - the new username
password - the new password
documentation - some descriptive text about the account
sessionHandle - a current valid sessionhandle
Returns:
a diagnostic XML result message.
Throws:
IOException - if bad connection.

addClientAccount

public String addClientAccount(YExternalClient client,
                               String sessionHandle)
                        throws IOException
Throws:
IOException

updateClientAccount

public String updateClientAccount(String name,
                                  String password,
                                  String documentation,
                                  String sessionHandle)
                           throws IOException
Throws:
IOException

getClientAccounts

public Set<YExternalClient> getClientAccounts(String sessionHandle)
                                       throws IOException
Gets all the client accounts registered in the engine

Parameters:
sessionHandle - a current valid sessionhandle of an admin type user.
Returns:
a diagnostic XML result message.
Throws:
IOException - if bad connection.

getClientAccount

public YExternalClient getClientAccount(String userID,
                                        String sessionHandle)
                                 throws IOException
Throws:
IOException

removeClientAccount

public String removeClientAccount(String name,
                                  String sessionHandle)
                           throws IOException
Delete an external client account PREcondition: cannot delete self

Parameters:
name - the user to delete
sessionHandle - an active handle
Returns:
diagnostic string of results from engine.
Throws:
IOException - if there's a problem connecting to the engine

changePassword

public String changePassword(String password,
                             String sessionHandle)
                      throws IOException
Change the password of a service or client account on the engine, the account being the owner of the session handle.

Parameters:
password - the new password
sessionHandle - an active handle
Returns:
diagnostic string of results from engine.
Throws:
IOException - if there's a problem connecting to the engine

getPassword

public String getPassword(String userid,
                          String sessionHandle)
                   throws IOException
Throws:
IOException

getBuildProperties

public String getBuildProperties(String sessionHandle)
                          throws IOException
Throws:
IOException

getExternalDBGateways

public String getExternalDBGateways(String sessionHandle)
                             throws IOException
Throws:
IOException

setHibernateStatisticsEnabled

public String setHibernateStatisticsEnabled(boolean enabled,
                                            String sessionHandle)
                                     throws IOException
Throws:
IOException

isHibernateStatisticsEnabled

public String isHibernateStatisticsEnabled(String sessionHandle)
                                    throws IOException
Throws:
IOException

getHibernateStatistics

public String getHibernateStatistics(String sessionHandle)
                              throws IOException
Throws:
IOException


Copyright © 2004-2012 The YAWL Foundation.