com.softwareag.tamino.db.api.invocation.wsl
Class WSL

java.lang.Object
  extended by com.softwareag.tamino.db.api.invocation.wsl.WSL

public class WSL
extends java.lang.Object

WSL is the class that provides the webserverless interface to Tamino via a JNI layer that calls C library functions in libWSLImpl & libmodwsl

Version:
$Revision: 1.10 $
Author:
Gerald Ristow

Field Summary
 int handle
           
 
Constructor Summary
WSL()
           
 
Method Summary
 void begin()
          Begins a connection to Tamino by setting up the communication buffer.
protected  void buildXIno()
          Contructs the x-ino field from the key/value pairs in the hashmap
 void close()
          Closes a connection to Tamino by destroying the communication buffer.
 int diagnose(java.lang.String db, java.lang.String command)
           
 void end()
          Ends a connection to Tamino for a given instance of WSL.
 java.lang.String getAcceptCharset()
          Retrieves the value for the desired character encoding in the Tamino communication buffer.
 byte[] getBodyContent()
           
 long getBodyLength()
           
 java.lang.String getContentType()
          Retrieves the value of the mime-type of the body in the Tamino communication buffer.
 java.lang.String getInoHeader(java.lang.String key)
          Retrieves the value from the hashmap for a given key, usually found in the HTTP header
 int getNumProperty(java.lang.String key)
          Retrieves the value of a numerical property.
 java.lang.String getPassword()
          Retrieves the current password header field in the Tamino communication buffer.
 java.lang.String getQueryString()
          Retrieves the query string in the Tamino communication buffer.
 java.lang.String getRequestMethod()
          Retrieves the HTTP-like request method for the Tamino communication.
 byte[] getResponse()
          Retrieves the contents of the Tamino response buffer.
 java.lang.String getTextProperty(java.lang.String key)
          Retrieves the value of a text property, i.e.
 java.lang.String getUri()
          Retrieves the URI of the proposed Tamino request, i.e.
 java.lang.String getUserId()
          Retrieves the current domain+username header field in the Tamino communication buffer.
 java.lang.String getXIno()
          Retrieves the current x-ino header field in the Tamino communication buffer.
 void resetInoHeaders()
          Resets all in header key/value pairs.
 void setAcceptCharset(java.lang.String charset)
          Sets the character encoding for the request and the response from Tamino, e.g.
 void setBody(byte[] buffer, long length)
          Sets the body in the Tamino communication buffer.
 void setContentType(java.lang.String type)
          Sets the mime-type of the body in the Tamino communication buffer.
 int setInoHeader(java.lang.String key, java.lang.String value)
          Fills a hashmap with a key/value pair or deletes a key, usually found in the HTTP header
 void setNumProperty(java.lang.String key, int value)
          Sets the value of a numerical property.
 void setPassword(java.lang.String password)
          Sets the password field in the Tamino communication buffer.
 void setQueryString(java.lang.String query)
          Sets the query string in the Tamino communication buffer, e.g.
 void setRequestMethod(java.lang.String method)
          Sets the value of the HTTP-like request method for the Tamino communication.
 void setUri(java.lang.String uri)
          Sets the URI for the Tamino request in the form /tamino//.
 void setUserId(java.lang.String userId)
          Sets the domain+username field in the Tamino communication buffer.
 void setXIno(java.lang.String xIno)
          Sets the x-ino header field in the Tamino communication buffer.
 int submit()
          Submits a request to Tamino for a given instance of WSL.
 int xql(java.lang.String db, java.lang.String coll, java.lang.String query)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

handle

public int handle
Constructor Detail

WSL

public WSL()
    throws TInvocationException
Throws:
TInvocationException
Method Detail

end

public void end()
Ends a connection to Tamino for a given instance of WSL. It can be restarted by calling begin().


submit

public int submit()
Submits a request to Tamino for a given instance of WSL.

Returns:
a possible error code if not equal to 1.

setNumProperty

public void setNumProperty(java.lang.String key,
                           int value)
Sets the value of a numerical property.

Parameters:
key - is the property name.
value - is the property value.

getNumProperty

public int getNumProperty(java.lang.String key)
Retrieves the value of a numerical property.

Parameters:
key - is the property name.
Returns:
the current value of the property.

getTextProperty

public java.lang.String getTextProperty(java.lang.String key)
Retrieves the value of a text property, i.e. a string.

Parameters:
key - is the property name.
Returns:
the current value of the property.

getResponse

public byte[] getResponse()
Retrieves the contents of the Tamino response buffer.

Returns:
the Tamino response as byte buffer.

diagnose

public int diagnose(java.lang.String db,
                    java.lang.String command)

xql

public int xql(java.lang.String db,
               java.lang.String coll,
               java.lang.String query)

begin

public void begin()
Begins a connection to Tamino by setting up the communication buffer. Must be the first call for a given instance of WSL.


close

public void close()
Closes a connection to Tamino by destroying the communication buffer. Must be the last call for a given instance of WSL. Calling begin() afterwards will restart the Tamino communication.


setUri

public void setUri(java.lang.String uri)
Sets the URI for the Tamino request in the form /tamino//. The part is not required for some requests, e.g. _diagnose=... .

Parameters:
uri - is the path to the Tamino resource starting with /tamino/...

getUri

public java.lang.String getUri()
Retrieves the URI of the proposed Tamino request, i.e. the current value in the communication buffer.

Returns:
the current value for the Tamino URI.

setRequestMethod

public void setRequestMethod(java.lang.String method)
Sets the value of the HTTP-like request method for the Tamino communication. Useful values are GET, PUT, POST and DELETE.

Parameters:
method - specifies the HTTP-like request method.

getRequestMethod

public java.lang.String getRequestMethod()
Retrieves the HTTP-like request method for the Tamino communication.

Returns:
the current value for the HTTP-like request method.

setQueryString

public void setQueryString(java.lang.String query)
Sets the query string in the Tamino communication buffer, e.g. _diagnose=ping.

Parameters:
query - is the Tamino query string.

getQueryString

public java.lang.String getQueryString()
Retrieves the query string in the Tamino communication buffer.

Returns:
the current value of the Tamino query string.

setAcceptCharset

public void setAcceptCharset(java.lang.String charset)
Sets the character encoding for the request and the response from Tamino, e.g. iso-8859-1 or utf-8.

Parameters:
charset - is the desired character set.

getAcceptCharset

public java.lang.String getAcceptCharset()
Retrieves the value for the desired character encoding in the Tamino communication buffer.

Returns:
the current value of the desired character encoding.

setContentType

public void setContentType(java.lang.String type)
Sets the mime-type of the body in the Tamino communication buffer.

Parameters:
type - is the mime-type of the body.

getContentType

public java.lang.String getContentType()
Retrieves the value of the mime-type of the body in the Tamino communication buffer.

Returns:
the current value for the mime-type.

setUserId

public void setUserId(java.lang.String userId)
Sets the domain+username field in the Tamino communication buffer.

Parameters:
userId - is the value of the domain+username field.

getUserId

public java.lang.String getUserId()
Retrieves the current domain+username header field in the Tamino communication buffer.

Returns:
the current value for the domain+username header field.

setPassword

public void setPassword(java.lang.String password)
Sets the password field in the Tamino communication buffer.

Parameters:
password - is the value of the password field.

getPassword

public java.lang.String getPassword()
Retrieves the current password header field in the Tamino communication buffer.

Returns:
the current value for the password header field.

setXIno

public void setXIno(java.lang.String xIno)
Sets the x-ino header field in the Tamino communication buffer. This field might contain the session-id, the session-key and the user authorization.

Parameters:
xIno - is the value of the x-ino header field.

getXIno

public java.lang.String getXIno()
Retrieves the current x-ino header field in the Tamino communication buffer.

Returns:
the current value for the x-ino header field.

setInoHeader

public int setInoHeader(java.lang.String key,
                        java.lang.String value)
Fills a hashmap with a key/value pair or deletes a key, usually found in the HTTP header

Parameters:
key - is the name of the header field, e.g. isolationLevel
value - is the value for the header field, e.g. stableCursor
Returns:
the current number of key/value pairs in the hashmap

getInoHeader

public java.lang.String getInoHeader(java.lang.String key)
Retrieves the value from the hashmap for a given key, usually found in the HTTP header

Parameters:
key - is the name of the header field, e.g. isolationLevel
Returns:
the value of the desired non-null key, null otherwise

resetInoHeaders

public void resetInoHeaders()
Resets all in header key/value pairs.


buildXIno

protected void buildXIno()
Contructs the x-ino field from the key/value pairs in the hashmap


setBody

public void setBody(byte[] buffer,
                    long length)
Sets the body in the Tamino communication buffer.

Parameters:
buffer - is the contents.
length - is the length of the contents in bytes.

getBodyContent

public byte[] getBodyContent()

getBodyLength

public long getBodyLength()


Copyright (c) 2013 Software AG. All Rights Reserved.