com.softwareag.ino.sxs
Class ASXJBase

java.lang.Object
  extended by com.softwareag.ino.sxs.ASXJBase
All Implemented Interfaces:
SXJBase

public class ASXJBase
extends java.lang.Object
implements SXJBase


Field Summary
 
Fields inherited from interface com.softwareag.ino.sxs.SXJBase
EVENT_NO_CALLBACK, ILLEGAL_HANDLE_TYPE, ILLEGAL_SQL_COMMAND, INO_ERROR, INVALID_BUFFER, IS_REPLICATION, JVM_USEROPTIONS, NO_CALLBACK_ENVIRON, NO_ODBC_CALLBACK, PASSWORD, PROPERTY_RSP_MEDIATYPE, REQUEST_ACCEPTED_CHARSETS, REQUEST_CLIENT_ADDRESS, REQUEST_CLIENT_HOST, REQUEST_CONTENT_LENGTH, REQUEST_CONTENT_TYPE, REQUEST_DOCUMENT_MEDIATYPE, REQUEST_LENGTH, REQUEST_MEDIATYPE, REQUEST_METHOD, REQUEST_PREFERRED_LANGUAGE, REQUEST_QUERY_STRING, REQUEST_REMOTE_ADDRESS, REQUEST_REMOTE_HOST, REQUEST_SERVER_HOST, REQUEST_STRING, REQUEST_URI, REQUEST_URI_PREFIX, SCHEMA_NODE_INFO, SERVER_READ_ONLY, SERVERURL, SESSIONID, SQL_BIGINT, SQL_BINARY, SQL_BIT, SQL_C_CHAR, SQL_C_DATE, SQL_C_DEFAULT, SQL_C_DOUBLE, SQL_C_FLOAT, SQL_C_LONG, SQL_C_NUMERIC, SQL_C_SHORT, SQL_C_TIME, SQL_C_TIMESTAMP, SQL_CALLB_ERROR, SQL_CHAR, SQL_DATA_AT_EXEC, SQL_DATE, SQL_DATETIME, SQL_DECIMAL, SQL_DIAG_CLASS_ORIGIN, SQL_DIAG_CONNECTION_NAME, SQL_DIAG_DYNAMIC_FUNCTION, SQL_DIAG_DYNAMIC_FUNCTION_CODE, SQL_DIAG_MESSAGE_TEXT, SQL_DIAG_NATIVE, SQL_DIAG_NUMBER, SQL_DIAG_RETURNCODE, SQL_DIAG_ROW_COUNT, SQL_DIAG_SERVER_NAME, SQL_DIAG_SQLSTATE, SQL_DIAG_SUBCLASS_ORIGIN, SQL_DOUBLE, SQL_ERROR, SQL_FLOAT, SQL_GUID, SQL_HANDLE_DBC, SQL_HANDLE_DESC, SQL_HANDLE_ENV, SQL_HANDLE_STMT, SQL_INTEGER, SQL_INTERVAL, SQL_INVALID_HANDLE, SQL_LONGVARBINARY, SQL_LONGVARCHAR, SQL_NEED_DATA, SQL_NO_DATA, SQL_NTS, SQL_NULL_DATA, SQL_NUMERIC, SQL_PARAM_INPUT, SQL_PARAM_INPUT_OUTPUT, SQL_PARAM_OUTPUT, SQL_PARAM_TYPE_UNKNOWN, SQL_REAL, SQL_RESULT_COL, SQL_RETURN_VALUE, SQL_SMALLINT, SQL_STILL_EXECUTING, SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_TIME, SQL_TIMESTAMP, SQL_TINYINT, SQL_TYPE_DATE, SQL_TYPE_TIME, SQL_TYPE_TIMESTAMP, SQL_UNKNOWN_TYPE, SQL_VARBINARY, SQL_VARCHAR, SX_IS_REPLICATION, SX_JVM_USEROPTIONS, SX_PASSWORD, SX_PROPERTY_RSP_MEDIATYPE, SX_SCHEMA_NODE_INFO, SX_SERVER_READ_ONLY, SX_SERVERURL, SX_SESSIONID, SX_USERID, SX_USERURL, SX_XML_CLOSED_CONTENT, SX_XML_DEF_ENCODING, SX_XML_DEF_TOKENIZER, SX_XML_SERVER_VERSION, SX_XNODE_DEF_ENCODING, SX_XTENSION_COM_USAGE, SX_XTENSION_DIRECT_USAGE, SX_XTENSION_JAVA_USAGE, USERID, USERURL, WEBSERVER_ADDRESS, XML_CLOSED_CONTENT, XML_COMMIT, XML_CONNECTION_END, XML_DEF_ENCODING, XML_DEF_TOKENIZER, XML_REQUEST_END, XML_ROLLBACK, XML_SERVER_VERSION, XML_SUB_COMMIT, XML_SUB_ROLLBACK, XNODE_DEF_ENCODING, XTENSION_COM_USAGE, XTENSION_DIRECT_USAGE, XTENSION_JAVA_USAGE
 
Method Summary
static SXSClassLoader changeClassLoader(java.lang.String classPath)
          Creates a new instance of SXSClassLoader to load extension classes.
static ASXJBase createSxsObject(java.lang.String className, java.lang.String extClassPath, long pSink, long pTrace, long pCallerTrace)
          Creates an extension object with particular class path extension.
static SXSClassLoader currentClassLoader()
           
 long getCallbackHandle()
          Return callback handle.
 int pt_c(char[] var, char val)
          Callback method for server trace.
 int pt_decl(char[] pszName, int errlev)
          Callback method for server trace.
 int pt_i(char[] var, int val)
          Callback method for server trace.
 int pt_leave()
          Callback method for server trace.
 int pt_s(char[] var, char[] val)
          Callback method for server trace.
 int pt_text(char[] text)
          Callback method for server trace.
 int pt_ws(char[] var, char[] val)
          Callback method for server trace.
 void resetThreadClassLoader()
           
 void setThreadClassLoader()
           
 void SxsException(int errnr, java.lang.String msg)
          Tells the Tamino server that an exception happened in a Java extension.
 int SxsGetDocument(java.lang.String collection, java.lang.String doctype, int inoid, Result result)
          Get a XML/non-XML document from Tamino based on the ino:id.
 int SxsGetDocument(java.lang.String collection, java.lang.String doctype, java.lang.String documentId, Result result)
          Get a XML/non-XML document from Tamino based on the docname/ino:id.
 int SxsGetHttpHeaderField(java.lang.String attrName, java.lang.StringBuffer value)
          Get an attribute value of the HTTP header of the request
 int SxsGetInoMsgNo()
          Gets the error number if an XML request via callback failed.
 int SxsGetMsgNo()
          Gets the callback error number if a callback method failed.
 java.lang.String SxsGetMsgText()
          Gets the error message if a callback method failed.
 int SxsGetNonXMLDocument(java.lang.String collection, java.lang.String doctype, int inoid, java.io.ByteArrayOutputStream nonXmlDoc)
          Get a NonXML document from Tamino based on the ino:id.
 int SxsGetNonXMLDocument(java.lang.String collection, java.lang.String doctype, java.lang.String documentId, java.io.ByteArrayOutputStream nonXmlDoc)
          Get a NonXML document from Tamino based on the ino:id.
 int SxsGetPasswordAuthentication(SxsPasswordAuthentication auth)
          Get the UserId/Password for the current user as a Java PasswordAuthentication object
 int SxsGetProperty(int property, java.lang.StringBuffer value)
          Get a property via callback.
 int SxsGetSQLMsgNo()
          Gets the error number an SQL query via ODBC callback failed.
 java.lang.String SxsGetStackTrace()
          Gets the stack trace of a call.
 int SxsPutDocument(InputDocument document, java.lang.StringBuffer response)
          Inserts an XML/Non-XML document into the Tamino server via callback.
 int SxsRepairOperation(java.lang.String op, java.lang.String[] data, java.lang.StringBuffer response)
          Perform specified operation for OnStartup repairs.
 int SxsSetProperty(int property, java.lang.String value)
          Set a property via callback.
 int SxsSQLAllocHandle(short HandleType, int InputHandle, IntRef OutputHandle)
          Creates an ODBC statement handle.
 int SxsSQLBindCol(int StatementHandle, short ColumnNumber, short TargetType, byte[] TargetValue, int BufferLength, IntRef StrLen_or_IndPtr)
          Binds a buffer to a result column of an SQL query.
 int SxsSQLBindParameter(int StatementHandle, short ParameterNumber, short InputOutputType, short ValueType, short ParameterType, int ColumnSize, short DecimalDigits, byte[] ParameterValuePtr, int BufferLength, IntRef StrLen_or_IndPtr)
          Binds a buffer to an input parameter of an SQL statement.
 int SxsSQLCloseCursor(int StatementHandle)
          Closes the cursor of an SQL query via ODBC callback.
 int SxsSQLExecute(int StatementHandle)
          Executes an SQL statement via ODBC callback.
 int SxsSQLFetch(int StatementHandle)
          Fetches the next result row of an SQL statement via ODBC callback.
 int SxsSQLFreeHandle(short HandleType, int Handle)
          Drops an ODBC statement handle via callback.
 int SxsSQLGetConnect(java.lang.String dbName, java.lang.String userName, java.lang.String password, IntRef Handle)
          Creates a connection to the OCDC interface of a Tamino server via callback.
 int SxsSQLGetData(int StatementHandle, short ColumnNumber, short TargetType, byte[] TargetValue, int BufferLength, IntRef StrLen_or_IndPtr)
          Writes the value of a result column into a buffer.
 int SxsSQLGetDiagField(short HandleType, int Handle, short RecNumber, short DiagIdentifier, byte[] DiagInfoPtr, short BufferLength, IntRef StringLengthPtr)
          Returns the current value of a field of a record of the diagnostic data structure for a handle.
 int SxsSQLPrepare(int StatementHandle, java.lang.String StatementText)
          Prepares an SQL statement via ODBC callback.
 int SxsSystem(int callType, java.lang.StringBuffer property)
          Get a system property from the Tamino server via callback.
 int SxsTrace(java.lang.String packet)
          Writes a message into the extension trace via callback.
 int SXSTrace(java.lang.String packet)
          Writes a message into the extension trace via callback (spelling like in COM).
 void SxsWarning(int warnNum, java.lang.String msg)
          Informs the Tamino server that a warning has occurred.
 int SxsXMLAdmin(java.lang.String command, java.lang.StringBuffer response)
          Perform an admin command in the Tamino server via callback.
 int SxsXMLDefine(java.lang.String xmlSchema, java.lang.StringBuffer response)
          Defines an XML schema in the Tamino server via callback.
 int SxsXMLDefine(java.lang.String xmlSchema, java.lang.String mode, java.lang.StringBuffer response)
          Defines an XML schema in the Tamino server via callback.
 int SxsXMLDelete(java.lang.String collection, java.lang.String query, java.lang.StringBuffer response)
          Deletes an XML document from the Tamino server via callback.
 int SxsXMLGetMessage(java.lang.StringBuffer msgContent)
          Gets the last message from the Tamino server via callback.
 int SxsXMLProcess(java.lang.String collection, java.lang.String xmlDoc, java.lang.StringBuffer response)
          Inserts an XML document into the Tamino server via callback.
 int SxsXMLProcess(java.lang.String collection, java.lang.String xmlDoc, java.lang.StringBuffer response, boolean hasResultElement)
          Inserts an XML document into the Tamino server via callback.
 int SxsXMLUndefine(java.lang.String collection, java.lang.String schema, java.lang.String doctype, java.lang.StringBuffer response)
          Undefine a collection, schema or doctype in the Tamino server via callback.
 int SxsXMLXql(java.lang.String collection, java.lang.String query, java.lang.StringBuffer response)
          Performs an XQL query in the Tamino server via a callback.
 int SxsXMLXQuery(java.lang.String collection, java.lang.String query, java.util.Map values, Result result)
          Performs an XQuery in the Tamino server via a callback.
 int SxsXMLXQuery(java.lang.String collection, java.lang.String query, java.util.Map values, Result result, boolean hasResultElement)
          Performs an XQuery in the Tamino server via a callback.
 int SxsXMLXQuery(java.lang.String collection, java.lang.String query, Result result)
          Performs an XQuery in the Tamino server via a callback.
 int SxsXMLXQuery(java.lang.String collection, java.lang.String query, Result result, boolean hasResultElement)
          Performs an XQuery in the Tamino server via a callback.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSxsObject

public static ASXJBase createSxsObject(java.lang.String className,
                                       java.lang.String extClassPath,
                                       long pSink,
                                       long pTrace,
                                       long pCallerTrace)
                                throws java.lang.ClassNotFoundException,
                                       java.lang.IllegalAccessException,
                                       java.lang.InstantiationException
Creates an extension object with particular class path extension.

If the corresponding extension class is not yet loaded, this method first creates a new instance of SXSClassLoader with extended class path, and then loads the extension class using this class loader. Finally it creates and initializes an object of this class.

Parameters:
className - the name of the extension class
extClassPath - the extension of the class path for this extension which is appended to the system class path
pSink - the address of the calling server object (required for callbacks)
pTrace - the address of the server trace object
pCallerTrace - the address of the extension trace object used by SxsTrace
Returns:
the new extension object
Throws:
java.lang.ClassNotFoundException - if the extension class could not be found in the extended class path
java.lang.IllegalAccessException - if this method has no access to the constructor of the extension class
java.lang.InstantiationException - if the extension class could not be instantiated

changeClassLoader

public static SXSClassLoader changeClassLoader(java.lang.String classPath)
Creates a new instance of SXSClassLoader to load extension classes.

This method is called by the Tamino server after every deinstallation of a Java extension to force class reloading when a new version of this extension will be reinstalled.

Parameters:
classPath - the classpath for the new class loader
Returns:
the current SXSClassLoader object

currentClassLoader

public static SXSClassLoader currentClassLoader()

SxsException

public void SxsException(int errnr,
                         java.lang.String msg)
Tells the Tamino server that an exception happened in a Java extension.

extensions should call this method instead of throwing Java exceptions to tell the Tamino server that something went wrong. The current transaction will be aborted by this method.

Specified by:
SxsException in interface SXJBase
Parameters:
errnr - an error number for this exception
msg - the error message

SxsWarning

public void SxsWarning(int warnNum,
                       java.lang.String msg)
Informs the Tamino server that a warning has occurred.

Specified by:
SxsWarning in interface SXJBase
Parameters:
warnNum - warning number
msg - warning text

SxsXMLXql

public int SxsXMLXql(java.lang.String collection,
                     java.lang.String query,
                     java.lang.StringBuffer response)
Performs an XQL query in the Tamino server via a callback.

Specified by:
SxsXMLXql in interface SXJBase
Parameters:
collection - the collection for this query
query - the XQL query string
response - the response buffer in which the query result is written (should be initialized with the empty string)
Returns:
0 if the query succeeded or an error number otherwise

SxsXMLXQuery

public int SxsXMLXQuery(java.lang.String collection,
                        java.lang.String query,
                        Result result)
Performs an XQuery in the Tamino server via a callback.

Specified by:
SxsXMLXQuery in interface SXJBase
Parameters:
collection - the collection for this query
query - the XQuery string
result - the result object in which the query result is written
Returns:
0 if the query succeeded or an error number otherwise

SxsXMLXQuery

public int SxsXMLXQuery(java.lang.String collection,
                        java.lang.String query,
                        Result result,
                        boolean hasResultElement)
Performs an XQuery in the Tamino server via a callback.

Specified by:
SxsXMLXQuery in interface SXJBase
Parameters:
collection - the collection for this query
query - the XQuery string
result - the result object in which the query result is written
hasResultElement - if true then wrap result with a result element
Returns:
0 if the query succeeded or an error number otherwise

SxsXMLXQuery

public int SxsXMLXQuery(java.lang.String collection,
                        java.lang.String query,
                        java.util.Map values,
                        Result result)
Performs an XQuery in the Tamino server via a callback.

Specified by:
SxsXMLXQuery in interface SXJBase
Parameters:
collection - the collection for this query
query - the XQuery string
values - Map of values (name/value pairs). The name should be of type String. The value should be of type String (parsed variable) or InputDocument (unparsed variable).
result - the result object in which the query result is written
Returns:
0 if the query succeeded or an error number otherwise

SxsXMLXQuery

public int SxsXMLXQuery(java.lang.String collection,
                        java.lang.String query,
                        java.util.Map values,
                        Result result,
                        boolean hasResultElement)
Performs an XQuery in the Tamino server via a callback.

Specified by:
SxsXMLXQuery in interface SXJBase
Parameters:
collection - the collection for this query
query - the XQuery string
values - Map of values (name/value pairs). The name should be of type String. The value should be of type String (parsed variable) or InputDocument (unparsed variable).
result - the result object in which the query result is written
hasResultElement - if true then wrap result with a result element
Returns:
0 if the query succeeded or an error number otherwise

SxsGetNonXMLDocument

public int SxsGetNonXMLDocument(java.lang.String collection,
                                java.lang.String doctype,
                                int inoid,
                                java.io.ByteArrayOutputStream nonXmlDoc)
Get a NonXML document from Tamino based on the ino:id.

Specified by:
SxsGetNonXMLDocument in interface SXJBase
Parameters:
collection - the collection for this query
doctype - the doctype where the document is in
inoid - the Tamino ino:id of the document
nonXmlDoc - the result buffer in which the Non XML document is written into
Returns:
0 if the query succeeded or an error number otherwise

SxsGetNonXMLDocument

public int SxsGetNonXMLDocument(java.lang.String collection,
                                java.lang.String doctype,
                                java.lang.String documentId,
                                java.io.ByteArrayOutputStream nonXmlDoc)
Get a NonXML document from Tamino based on the ino:id.

Specified by:
SxsGetNonXMLDocument in interface SXJBase
Parameters:
collection - the collection for this query
doctype - the doctype where the document is in
documentId - either "@" or the ino:docname
nonXmlDoc - the result buffer in which the Non XML document is written into
Returns:
0 if the query succeeded or an error number otherwise

SxsGetDocument

public int SxsGetDocument(java.lang.String collection,
                          java.lang.String doctype,
                          int inoid,
                          Result result)
Get a XML/non-XML document from Tamino based on the ino:id.

Specified by:
SxsGetDocument in interface SXJBase
Parameters:
collection - the collection for this query
doctype - the doctype where the document is in
inoid - the Tamino ino:id of the document
result - the result object in which the query result is written
Returns:
0 if the query succeeded or an error number otherwise

SxsGetDocument

public int SxsGetDocument(java.lang.String collection,
                          java.lang.String doctype,
                          java.lang.String documentId,
                          Result result)
Get a XML/non-XML document from Tamino based on the docname/ino:id.

Specified by:
SxsGetDocument in interface SXJBase
Parameters:
collection - the collection for this query
doctype - the doctype where the document is in
documentId - either "@" (without the <>) or the ino:docname
result - the result object in which the query result is written
Returns:
0 if the query succeeded or an error number otherwise

SxsPutDocument

public int SxsPutDocument(InputDocument document,
                          java.lang.StringBuffer response)
Inserts an XML/Non-XML document into the Tamino server via callback.

Specified by:
SxsPutDocument in interface SXJBase
Parameters:
document - document to be inserted
response - the result buffer in which the XML result document is written (should be initialized with the empty string)
Returns:
0 if the insertion succeeded and an error number otherwise

SxsXMLDefine

public int SxsXMLDefine(java.lang.String xmlSchema,
                        java.lang.StringBuffer response)
Defines an XML schema in the Tamino server via callback.

Specified by:
SxsXMLDefine in interface SXJBase
Parameters:
xmlSchema - a string containing the schema
response - the result buffer in which the XML result document is written (should be initialized with the empty string)
Returns:
0 if the definition succeeded or an error number otherwise

SxsXMLDefine

public int SxsXMLDefine(java.lang.String xmlSchema,
                        java.lang.String mode,
                        java.lang.StringBuffer response)
Defines an XML schema in the Tamino server via callback.

Specified by:
SxsXMLDefine in interface SXJBase
Parameters:
xmlSchema - a string containing the schema
mode - mode value to be used (for example "validate")
response - the result buffer in which the XML result document is written (should be initialized with the empty string)
Returns:
0 if the definition succeeded or an error number otherwise

SxsXMLUndefine

public int SxsXMLUndefine(java.lang.String collection,
                          java.lang.String schema,
                          java.lang.String doctype,
                          java.lang.StringBuffer response)
Undefine a collection, schema or doctype in the Tamino server via callback.

Warning: When you delete a collection, schema or doctype, all documents and other data belonging to that collection, schema or doctype are also deleted!

Specified by:
SxsXMLUndefine in interface SXJBase
Parameters:
collection - collection to undefine OR collection of schema/doctype
schema - schema to undefine OR schema of doctype. May be empty string.
doctype - doctype to undefine. May be empty string.
response - the result buffer in which the XML result document is written (should be initialized with the empty string)
Returns:
0 if the definition succeeded or an error number otherwise

SxsXMLProcess

public int SxsXMLProcess(java.lang.String collection,
                         java.lang.String xmlDoc,
                         java.lang.StringBuffer response)
Inserts an XML document into the Tamino server via callback.

Specified by:
SxsXMLProcess in interface SXJBase
Parameters:
collection - the collection into which the document will be inserted
xmlDoc - the XML document to insert
response - the result buffer in which the XML result document is written (should be initialized with the empty string)
Returns:
0 if the insertion succeeded and an error number otherwise

SxsXMLProcess

public int SxsXMLProcess(java.lang.String collection,
                         java.lang.String xmlDoc,
                         java.lang.StringBuffer response,
                         boolean hasResultElement)
Inserts an XML document into the Tamino server via callback.

Specified by:
SxsXMLProcess in interface SXJBase
Parameters:
collection - the collection into which the document will be inserted
xmlDoc - the XML document to insert
response - the result buffer in which the XML result document is written (should be initialized with the empty string)
hasResultElement - if true then wrap result with a result element
Returns:
0 if the insertion succeeded and an error number otherwise

SxsXMLDelete

public int SxsXMLDelete(java.lang.String collection,
                        java.lang.String query,
                        java.lang.StringBuffer response)
Deletes an XML document from the Tamino server via callback.

Specified by:
SxsXMLDelete in interface SXJBase
Parameters:
collection - the collection from which the document will be removed
query - X-Query identifying document to delete
response - the result buffer in which the XML result document is written (should be initialized with the empty string)
Returns:
0 if the deletion succeeded or an error number otherwise

SxsXMLAdmin

public int SxsXMLAdmin(java.lang.String command,
                       java.lang.StringBuffer response)
Perform an admin command in the Tamino server via callback.

Specified by:
SxsXMLAdmin in interface SXJBase
Parameters:
command - admin command to perform
response - the result buffer in which the XML result document is written (should be initialized with the empty string)
Returns:
0 if the definition succeeded or an error number otherwise

SxsXMLGetMessage

public int SxsXMLGetMessage(java.lang.StringBuffer msgContent)
Gets the last message from the Tamino server via callback.

Specified by:
SxsXMLGetMessage in interface SXJBase
Parameters:
msgContent - the buffer in which the message is written (should be initialized with the empty string)
Returns:
0 if the callback succeeded or an error number otherwise

SxsGetPasswordAuthentication

public int SxsGetPasswordAuthentication(SxsPasswordAuthentication auth)
Get the UserId/Password for the current user as a Java PasswordAuthentication object

Specified by:
SxsGetPasswordAuthentication in interface SXJBase
Parameters:
auth - the retrieved userid/password.
Returns:
0 if the callback succeeded or an error number otherwise

SxsRepairOperation

public int SxsRepairOperation(java.lang.String op,
                              java.lang.String[] data,
                              java.lang.StringBuffer response)
Perform specified operation for OnStartup repairs.

Specified by:
SxsRepairOperation in interface SXJBase
Parameters:
op - operation to be performed
data - operation data
response - response of operation (maybe empty)
Returns:
0 if the callback succeeded or an error number otherwise

SxsSystem

public int SxsSystem(int callType,
                     java.lang.StringBuffer property)
Get a system property from the Tamino server via callback.

Specified by:
SxsSystem in interface SXJBase
Parameters:
callType - specifies the system property to be retrieved (SERVERURL, USERID, PASSWORD, USERURL, SESSIONID or SCHEMA_NODE_INFO)
property - the result buffer in which the XML result document is written (should be initialized with the empty string)
Returns:
0 if the callback succeeded or an error number otherwise

SxsSetProperty

public int SxsSetProperty(int property,
                          java.lang.String value)
Set a property via callback.

Specified by:
SxsSetProperty in interface SXJBase
Parameters:
property - specifies the property to be set (SX_PROPERTY_RSP_MEDIATYPE, ...)
value - the new value for the property
Returns:
0 if the callback succeeded or an error number otherwise

SxsGetProperty

public int SxsGetProperty(int property,
                          java.lang.StringBuffer value)
Get a property via callback.

Specified by:
SxsGetProperty in interface SXJBase
Parameters:
property - specifies the property to get (SX_PROPERTY_RSP_MEDIATYPE, ...)
value - the returned value of the property
Returns:
0 if the callback succeeded or an error number otherwise

SxsGetHttpHeaderField

public int SxsGetHttpHeaderField(java.lang.String attrName,
                                 java.lang.StringBuffer value)
Get an attribute value of the HTTP header of the request

Specified by:
SxsGetHttpHeaderField in interface SXJBase
Parameters:
attrName - the name of the attribute to be retrieved
value - the result buffer in which the XML result document is written (should be initialized with the empty string)
Returns:
0 if the callback succeeded or an error number otherwise

SxsSQLGetConnect

public int SxsSQLGetConnect(java.lang.String dbName,
                            java.lang.String userName,
                            java.lang.String password,
                            IntRef Handle)
Creates a connection to the OCDC interface of a Tamino server via callback.

Specified by:
SxsSQLGetConnect in interface SXJBase
Parameters:
dbName - a data source name defined in the ODBC manager
userName - a valid user account
password - the password will not appear in the trace
Handle - the address of the connection handle will be entered here (should be initialized with the default constructor)
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLAllocHandle

public int SxsSQLAllocHandle(short HandleType,
                             int InputHandle,
                             IntRef OutputHandle)
Creates an ODBC statement handle.

In Tamino extensions this method can only create statement handles.

Specified by:
SxsSQLAllocHandle in interface SXJBase
Parameters:
HandleType - the type of the handle to be allocated (must be SQL_HANDLE_STMT)
InputHandle - a connection handle received from SxsSQLGetConnect
OutputHandle - the address of the statement handle will be entered here (should be initialized with the default constructor)
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLFreeHandle

public int SxsSQLFreeHandle(short HandleType,
                            int Handle)
Drops an ODBC statement handle via callback.

Specified by:
SxsSQLFreeHandle in interface SXJBase
Parameters:
HandleType - the type of the Handle (must be SQL_HANDLE_STMT)
Handle - the handle to be freed
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLPrepare

public int SxsSQLPrepare(int StatementHandle,
                         java.lang.String StatementText)
Prepares an SQL statement via ODBC callback.

Specified by:
SxsSQLPrepare in interface SXJBase
Parameters:
StatementHandle - the handle received from SxsSQLAllocHandle
StatementText - the SQL statement to prepare
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLBindParameter

public int SxsSQLBindParameter(int StatementHandle,
                               short ParameterNumber,
                               short InputOutputType,
                               short ValueType,
                               short ParameterType,
                               int ColumnSize,
                               short DecimalDigits,
                               byte[] ParameterValuePtr,
                               int BufferLength,
                               IntRef StrLen_or_IndPtr)
Binds a buffer to an input parameter of an SQL statement.

Before executing the statement the parameter values must be written into the buffers bound with this method. The length of string parameters or the null value indicator must be set in StrLen_or_IndPtr.

Specified by:
SxsSQLBindParameter in interface SXJBase
Parameters:
StatementHandle - a handle received from SxsSQLAllocHandle
ParameterNumber - the number of the parameter within the statement (counting starts with 1)
InputOutputType - one of the types defined in SXJBase
ValueType - the C data type of the parameter
ParameterType - the SQL data type of the parameter
ColumnSize - the size of the column of the corresponding parameter
DecimalDigits - the decimal digits of the column of the corresponding parameter
ParameterValuePtr - a buffer for the parameter value (should be allocated with the length given in BufferLength)
BufferLength - the length of the ParameterValuePtr buffer in bytes
StrLen_or_IndPtr - null value indicator or value length for character or binary data
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLGetData

public int SxsSQLGetData(int StatementHandle,
                         short ColumnNumber,
                         short TargetType,
                         byte[] TargetValue,
                         int BufferLength,
                         IntRef StrLen_or_IndPtr)
Writes the value of a result column into a buffer.

Specified by:
SxsSQLGetData in interface SXJBase
Parameters:
StatementHandle - a handle received from SxsSQLAllocHandle
ColumnNumber - the number of the column within the result table (counting starts with 1)
TargetType - the C data type of the TargetValue
TargetValue - a buffer in which to return the column value (should be allocated with the length given in BufferLength)
BufferLength - the length of the TargetValue buffer in bytes
StrLen_or_IndPtr - null value indicator or value length for character or binary data
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLBindCol

public int SxsSQLBindCol(int StatementHandle,
                         short ColumnNumber,
                         short TargetType,
                         byte[] TargetValue,
                         int BufferLength,
                         IntRef StrLen_or_IndPtr)
Binds a buffer to a result column of an SQL query.

When executing SxsSQLFetch all buffers bound to columns are filled with the values of the corresponding columns.

Specified by:
SxsSQLBindCol in interface SXJBase
Parameters:
StatementHandle - a handle received from SxsSQLAllocHandle
ColumnNumber - the number of the column within the result table (counting starts with 1)
TargetType - the C data type of the TargetValue
TargetValue - a buffer to bind to the column (should be allocated with the length given in BufferLength)
BufferLength - the length of the TargetValue buffer in bytes
StrLen_or_IndPtr - null value indicator or value length for character or binary data
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLGetDiagField

public int SxsSQLGetDiagField(short HandleType,
                              int Handle,
                              short RecNumber,
                              short DiagIdentifier,
                              byte[] DiagInfoPtr,
                              short BufferLength,
                              IntRef StringLengthPtr)
Returns the current value of a field of a record of the diagnostic data structure for a handle.

Specified by:
SxsSQLGetDiagField in interface SXJBase
Parameters:
HandleType - the type of the Handle (must be SQL_HANDLE_STMT
Handle - the handle for which diagnostics are requested
RecNumber - indicates the status record from which diagnostics are requested
DiagIdentifier - indicates the field of the diagnostic whose value is requested
DiagInfoPtr - a buffer in which to return the diagnostic information (should be allocated with the length given in BufferLength)
BufferLength - the length of the DiagInfoPtr buffer in bytes
StringLengthPtr - total number of bytes available in DiagInfoPtr
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLExecute

public int SxsSQLExecute(int StatementHandle)
Executes an SQL statement via ODBC callback.

Specified by:
SxsSQLExecute in interface SXJBase
Parameters:
StatementHandle - the handle received from SxsSQLAllocHandle
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLFetch

public int SxsSQLFetch(int StatementHandle)
Fetches the next result row of an SQL statement via ODBC callback.

After fetching the row its values can be retrieved using SxsSQLGetData or can be read in the buffers bound with SxsSQLBindCol.

Specified by:
SxsSQLFetch in interface SXJBase
Parameters:
StatementHandle - the handle received from SxsSQLAllocHandle
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsSQLCloseCursor

public int SxsSQLCloseCursor(int StatementHandle)
Closes the cursor of an SQL query via ODBC callback.

Specified by:
SxsSQLCloseCursor in interface SXJBase
Parameters:
StatementHandle - the handle received from SxsSQLAllocHandle
Returns:
the return code of the ODBC call (a negative value indicates an error).

SxsTrace

public int SxsTrace(java.lang.String packet)
Writes a message into the extension trace via callback.

Specified by:
SxsTrace in interface SXJBase
Parameters:
packet - the trace message
Returns:
0 if the callback succeeded or an error number otherwise

SXSTrace

public int SXSTrace(java.lang.String packet)
Writes a message into the extension trace via callback (spelling like in COM).

Specified by:
SXSTrace in interface SXJBase
Parameters:
packet - the trace message
Returns:
0 if the callback succeeded or an error number otherwise

SxsGetMsgNo

public int SxsGetMsgNo()
Gets the callback error number if a callback method failed.

Specified by:
SxsGetMsgNo in interface SXJBase
Returns:
the callback error number (0 if no callback error occurred)

SxsGetInoMsgNo

public int SxsGetInoMsgNo()
Gets the error number if an XML request via callback failed.

Specified by:
SxsGetInoMsgNo in interface SXJBase
Returns:
the XML error number (0 if no XML error occurred)

SxsGetSQLMsgNo

public int SxsGetSQLMsgNo()
Gets the error number an SQL query via ODBC callback failed.

Specified by:
SxsGetSQLMsgNo in interface SXJBase
Returns:
the SQL error number (0 if no SQL error occurred)

SxsGetMsgText

public java.lang.String SxsGetMsgText()
Gets the error message if a callback method failed.

Specified by:
SxsGetMsgText in interface SXJBase
Returns:
the callback error message

SxsGetStackTrace

public java.lang.String SxsGetStackTrace()
Gets the stack trace of a call.

Specified by:
SxsGetStackTrace in interface SXJBase
Returns:
the stack trace

pt_decl

public int pt_decl(char[] pszName,
                   int errlev)
Callback method for server trace.

Specified by:
pt_decl in interface SXJBase

pt_s

public int pt_s(char[] var,
                char[] val)
Callback method for server trace.

Specified by:
pt_s in interface SXJBase

pt_ws

public int pt_ws(char[] var,
                 char[] val)
Callback method for server trace.

Specified by:
pt_ws in interface SXJBase

pt_i

public int pt_i(char[] var,
                int val)
Callback method for server trace.

Specified by:
pt_i in interface SXJBase

pt_c

public int pt_c(char[] var,
                char val)
Callback method for server trace.

Specified by:
pt_c in interface SXJBase

pt_text

public int pt_text(char[] text)
Callback method for server trace.

Specified by:
pt_text in interface SXJBase

pt_leave

public int pt_leave()
Callback method for server trace.

Specified by:
pt_leave in interface SXJBase

getCallbackHandle

public long getCallbackHandle()
Return callback handle.


setThreadClassLoader

public void setThreadClassLoader()

resetThreadClassLoader

public void resetThreadClassLoader()