Ontimize Web Services 1.003EN

com.ontimize.webservice.prebuiltClient
Class OWSClient

java.lang.Object
  extended by com.ontimize.webservice.prebuiltClient.OWSClient

public class OWSClient
extends java.lang.Object

Java client methods which can be used in an Ontimize enviroment to develop a Ontimize Web Service application. In this case, standars initSession, queries, insertions, updates, and deletes are performed, and also, a generic remote method (calling using the remote utility: execute) is run. The connection through the 4040 port must be used if the package viewer is running (acting as a proxy) and the default one (8081) in other case. Moreover the dump property is setted for debug, and additional debugger information is shown if the OWSClient.DEBUG variable is true


Field Summary
protected  java.lang.String configurationFilePath
           
static boolean DEBUG
           
 
Constructor Summary
OWSClient()
           
OWSClient(java.lang.String configurationFilePath)
           
 
Method Summary
 int connect()
          Connecting to the Ontimize Web Service indicated by the OntimizeWebServiceClient.properties file and calling the init session method in order to connect with the server and obtain the sessionId.
 com.ontimize.db.EntityResult delete(java.util.Hashtable deleteKeys, java.lang.String entityName)
           
 com.ontimize.db.EntityResult execute(java.lang.String interfaceName, java.lang.String methodName, java.util.Vector parameters, int sessionId, java.lang.String entityName, java.lang.String userName)
           
 java.util.Properties getPropertiesFile()
          This method get the client configuration properties file named OntimizeWebServiceClient.properties.
 com.ontimize.db.EntityResult insert(java.util.Hashtable insertValues, java.lang.String entityName)
           
static void printEntityResultInformation(com.ontimize.db.EntityResult result, java.lang.String operation)
          Class to print the entity result content that the operations return
 com.ontimize.db.EntityResult query(java.util.Hashtable keysValues, java.util.Vector attributesValues, java.lang.String entityName)
          This method must implement a standard query operation returning the set of data that matches the conditions specified by the keysValues parameter.
protected  void readPropertiesFile(java.util.Properties properties)
          read the userLogin, userPâssword and urlConnection properties sent in the properties variable which was the result of popullate the variable with the client configuration file.
 com.ontimize.db.EntityResult update(java.util.Hashtable attributesValues, java.util.Hashtable keysValues, java.lang.String entityName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG

configurationFilePath

protected java.lang.String configurationFilePath
Constructor Detail

OWSClient

public OWSClient()

OWSClient

public OWSClient(java.lang.String configurationFilePath)
Method Detail

getPropertiesFile

public java.util.Properties getPropertiesFile()
This method get the client configuration properties file named OntimizeWebServiceClient.properties. In that file, user, password and URLConnection must must be indicated to allow client to connect server.

Returns:

readPropertiesFile

protected void readPropertiesFile(java.util.Properties properties)
read the userLogin, userPâssword and urlConnection properties sent in the properties variable which was the result of popullate the variable with the client configuration file.

Parameters:
properties -

connect

public int connect()
Connecting to the Ontimize Web Service indicated by the OntimizeWebServiceClient.properties file and calling the init session method in order to connect with the server and obtain the sessionId.

Returns:

query

public com.ontimize.db.EntityResult query(java.util.Hashtable keysValues,
                                          java.util.Vector attributesValues,
                                          java.lang.String entityName)
                                   throws java.lang.Exception
This method must implement a standard query operation returning the set of data that matches the conditions specified by the keysValues parameter. The attributes defines which attributes (or columns if data is obtained from a database) must be recovered, and keysValues specifies which set of records must be recovered. Additionally the name of the Ontimize Entity, which will perform the operation, must be indicated

Parameters:
keysValues - - a Hashtable specifying conditions that must comply the set of records returned. Cannot be null.
attributesValues - - a list of columns or attributes that must be recovered for each record returned. Cannot be null. If empty, all attributes should be returned.
entityName - - the name of the Ontimize Entity, which will perform the operation.
Returns:
a EntityResult with the resulting set of data. This result can be empty if no results exist, and, if an error has ocurred, this will be indicated in the result.
Throws:
java.lang.Exception - if any exception happens

insert

public com.ontimize.db.EntityResult insert(java.util.Hashtable insertValues,
                                           java.lang.String entityName)
                                    throws java.lang.Exception
Parameters:
insertValues -
entityName -
Returns:
Throws:
java.lang.Exception - if any exception happens

update

public com.ontimize.db.EntityResult update(java.util.Hashtable attributesValues,
                                           java.util.Hashtable keysValues,
                                           java.lang.String entityName)
                                    throws java.lang.Exception
Parameters:
attributesValues -
keysValues -
entityName -
Returns:
Throws:
java.lang.Exception

delete

public com.ontimize.db.EntityResult delete(java.util.Hashtable deleteKeys,
                                           java.lang.String entityName)
                                    throws java.lang.Exception
Parameters:
deleteKeys -
entityName -
Returns:
Throws:
java.lang.Exception

execute

public com.ontimize.db.EntityResult execute(java.lang.String interfaceName,
                                            java.lang.String methodName,
                                            java.util.Vector parameters,
                                            int sessionId,
                                            java.lang.String entityName,
                                            java.lang.String userName)
                                     throws java.lang.Exception
Parameters:
interfaceName -
methodName -
parameters -
sessionId -
entityName -
userName -
Returns:
Throws:
java.lang.Exception

printEntityResultInformation

public static void printEntityResultInformation(com.ontimize.db.EntityResult result,
                                                java.lang.String operation)
Class to print the entity result content that the operations return

Parameters:
result -
operation -

Ontimize Web Services