|
Ontimize Web Services 1.003EN | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ontimize.webservice.server.OntimizeWebServiceImpl
public class OntimizeWebServiceImpl
Implements the operations that can be performed in an Ontimize Web Service, such as, standard initSession, query, insert, update and delete, and also a generic method (called execute) which allow developers to run whatever remote method.
| Field Summary | |
|---|---|
static boolean |
DEBUG
|
protected com.ontimize.locator.SecureEntityReferenceLocator |
locator
|
protected java.lang.String |
remoteLocatorRegistryName
|
protected java.lang.String |
webServicehost
|
protected int |
webServicePort
|
| Constructor Summary | |
|---|---|
OntimizeWebServiceImpl()
|
|
| Method Summary | |
|---|---|
protected static boolean |
belongToARemoteInterface(java.lang.String methodName,
java.lang.Class<?> c,
java.lang.Class[] parameterType)
Checks if the remote method belongs to a remote interface. |
protected com.ontimize.db.EntityResult |
createEmptyWrongEntityResult()
Creates a new entity result and set its code to indicated that the operation has been wrong. |
com.ontimize.webservice.server.OWSEntityResult |
delete(java.util.List<com.ontimize.webservice.server.OWSDoubleData> deleteKeys,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
This method performs the standard Ontimize delete. |
java.lang.Integer |
endSession(int sessionId,
int sleepingMiliseconds)
method that ends the Ontimize session for the indicated sessionId. |
com.ontimize.webservice.server.OWSEntityResult |
execute(java.lang.String interfaceName,
java.lang.String methodName,
java.util.List<com.ontimize.webservice.server.OWSComplexData> parameters,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
This method has been developed to allow programmers to execute whatever method (apart from the standard query, insert, update and delete). |
protected java.lang.Object |
getObject(java.lang.String host,
int port,
java.lang.String name)
Get the unique rmi object indicated by the parameters host-port-name. |
protected java.util.Properties |
getPropertiesFile()
This method get the client configuration properties file named webservice.properties. |
java.lang.Integer |
initSession(java.lang.String userLogin,
java.lang.String userPassword,
int sessionId)
This method performs the init session of the client through the web service. |
com.ontimize.webservice.server.OWSEntityResult |
insert(java.util.List<com.ontimize.webservice.server.OWSDoubleData> insertValues,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
This method performs the standard Ontimize insert. |
protected static boolean |
interfaceExtendsInterface(java.lang.Class interfaceClass,
java.lang.String interfaceName)
Checks if the indicated interface class extends interfaceName. |
protected boolean |
isARemoteMethod(java.lang.reflect.Method method,
java.lang.String methodName,
java.lang.Class<?> c,
java.lang.Class[] parameterType)
Return true if the indicated methods is a remote method and which also belong to a remote (or extended remote) interface. |
com.ontimize.webservice.server.OWSEntityResult |
query(java.util.List<com.ontimize.webservice.server.OWSDoubleData> keysValues,
java.util.List<com.ontimize.webservice.server.OWSComplexData> av,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
This method performs the standard Ontimize query. |
protected void |
readProperties()
Read the configuration properties file called webservice.properties to fill the neccesary parameters to be able to init session. |
protected static boolean |
throwsRemoteExceptions(java.lang.reflect.Method method)
Checks if the method throw (remote) exceptions. |
com.ontimize.webservice.server.OWSEntityResult |
update(java.util.List<com.ontimize.webservice.server.OWSDoubleData> attributesValues,
java.util.List<com.ontimize.webservice.server.OWSDoubleData> keysValues,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
This method performs the standard Ontimize update. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean DEBUG
protected com.ontimize.locator.SecureEntityReferenceLocator locator
protected int webServicePort
protected java.lang.String webServicehost
protected java.lang.String remoteLocatorRegistryName
| Constructor Detail |
|---|
public OntimizeWebServiceImpl()
| Method Detail |
|---|
public java.lang.Integer initSession(java.lang.String userLogin,
java.lang.String userPassword,
int sessionId)
WebServicehost - the host in which the web service is runningwebServicePort - the port in which the web service is runningremoteLocatorRegistry - Name in registry the Remote Locator object will have, that is, that indicates the process nameuserLogin - The user's name (login)userPassword - The user's password (login)sessionId - The identifier of this user during the current session
public com.ontimize.webservice.server.OWSEntityResult query(java.util.List<com.ontimize.webservice.server.OWSDoubleData> keysValues,
java.util.List<com.ontimize.webservice.server.OWSComplexData> av,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
keysValues - Hashtable of keys and values which indicates the query restrictions (that is, the 'where' information)av - Vector of objects which contains the column names of the table/view which must be queriedsessionId - The identifier of this user during the current sessionentityName - The entity name in which the query will be madeuserName - The user's name (login)
public com.ontimize.webservice.server.OWSEntityResult delete(java.util.List<com.ontimize.webservice.server.OWSDoubleData> deleteKeys,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
deleteKeys - Hashtable of keys and values which indicates the field that must be removedsessionId - The identifier of this user during the current sessionentityName - The entity name in which the delete will be madeuserName - The user's name (login)
public com.ontimize.webservice.server.OWSEntityResult insert(java.util.List<com.ontimize.webservice.server.OWSDoubleData> insertValues,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
insertValues - Hashtable of keys and values which indicates the field that must be inserted and their valuessessionId - The identifier of this user during the current sessionentityName - The entity name in which the insert will be madeuserName - The user's name (login)
public com.ontimize.webservice.server.OWSEntityResult update(java.util.List<com.ontimize.webservice.server.OWSDoubleData> attributesValues,
java.util.List<com.ontimize.webservice.server.OWSDoubleData> keysValues,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
attributesValues - Hashtable of keys and values which contains the new information that will be settedkeysValues - Hashtable of keys and values which indicates the fields that must be updatedsessionId - The identifier of this user during the current sessionentityName - The entity name in which the update will be madeuserName - The user's name (login)
public com.ontimize.webservice.server.OWSEntityResult execute(java.lang.String interfaceName,
java.lang.String methodName,
java.util.List<com.ontimize.webservice.server.OWSComplexData> parameters,
int sessionId,
java.lang.String entityName,
java.lang.String userName)
entityName - The name of the entity in which this method performs the operationinterfaceName - The name of the remote interface that contains this remote execute methodmethodName - The name of the remote method which will be executed by this generic "execute" methodparameters - A list of OWSComplexData (a vector) which contains to data per item. The first one is the kind of parameters that the execute method recives.
The second one is the value that the method receives. There is one paar(Class, value) per parameter that the execute method receivessessionId - The identifier of this user during the current sessionuserName - The user's name (login)
public java.lang.Integer endSession(int sessionId,
int sleepingMiliseconds)
sessionId - sleepingMiliseconds -
protected void readProperties()
protected java.util.Properties getPropertiesFile()
protected java.lang.Object getObject(java.lang.String host,
int port,
java.lang.String name)
throws java.lang.Exception
host - machine in which the object is runningport - port in which this object can be locatedname - the name of the object
java.lang.Exceptionprotected com.ontimize.db.EntityResult createEmptyWrongEntityResult()
protected boolean isARemoteMethod(java.lang.reflect.Method method,
java.lang.String methodName,
java.lang.Class<?> c,
java.lang.Class[] parameterType)
method - methodName - c - parameterType -
protected static boolean throwsRemoteExceptions(java.lang.reflect.Method method)
method -
protected static boolean belongToARemoteInterface(java.lang.String methodName,
java.lang.Class<?> c,
java.lang.Class[] parameterType)
methodName - c - parameterType -
protected static boolean interfaceExtendsInterface(java.lang.Class interfaceClass,
java.lang.String interfaceName)
interfaceClass - interfaceName -
|
Ontimize Web Services | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||