com.ibm.xdms.function
Interface DatastoreHelper

All Superinterfaces:
Function

public interface DatastoreHelper
extends Function


Field Summary
 
Fields inherited from interface com.ibm.xdms.function.Function
COPYRIGHT
 
Method Summary
 void beginTransaction(javax.transaction.UserTransaction trans, java.lang.String method)
          Begins the transaction associated with the Datastore
 void checkAccess(java.lang.String documentSelectorString, java.security.Principal principal, boolean isSuperAdminUser, boolean isAnonymousUser, int permission)
          Checks if the principal in the request has permission to have the specified access to the specified node selector
 void checkAccess(XcapServerRequest request, com.ibm.xcap.DocumentSelector documentSelector, int permission)
          Checks if the principal in the request has permission to have the specified access to the specified node selector
 void checkReadAccess(XcapServerRequest request, java.lang.String documentSelector)
          Checks if the principal in the request has permission to have read access to the specified node selector
 void closeConnection(java.sql.Connection con)
          Closes db connection
 void commitTransaction(XcapServerRequest request)
          Commits the transaction associated with the Datastore
 org.w3c.dom.Document dxpCreateDocument(DomXmlProcessor dxp, java.lang.String documentString, boolean enableSchemaValidation, java.sql.Connection con, java.sql.PreparedStatement ps, javax.transaction.UserTransaction trans)
          document = dxp.createDocument(documentString, enableSchemaValidation)
 boolean enableSchemaValidation()
          Queries the AuidConfig to determine if schema validation is enabled.
 java.sql.Connection getConnection(javax.sql.DataSource dataSource)
          Returns a db connection
 long getETag(java.lang.String documentSelector, java.sql.Connection con, javax.servlet.sip.SipServletRequest request)
          Retrieves the ETag for a document, using an existing connection
 long getETag(java.lang.String documentSelector, java.sql.Connection con, XcapServerRequest request)
          Retrieves the ETag for a document, using an existing connection
 long getETag(java.lang.String documentSelector, javax.sql.DataSource dataSource, java.sql.Connection con, XcapServerRequest request)
          Retrieves the ETag for a document
 int getMaxSearchResults()
          Queries the AuidConfig to determine the maxSearchResults
 javax.transaction.UserTransaction getTransaction(XcapServerRequest request)
          Returns the current transaction for this request.
 void recordAlarmAndFaultLogger(java.lang.Exception e, java.lang.String METHOD, java.lang.String documentSelector, java.lang.String xdmsErrorMsg)
           
 void rollbackTransaction(javax.transaction.UserTransaction trans, java.lang.String method)
          Rolls back the transaction associated with the Datastore
 void rollbackTransaction(XcapServerRequest request)
          Rolls back the transaction associated with the Datastore
 javax.sql.DataSource setUpDataSource()
          Gets the dataSource
 com.ibm.xcap.DocumentSelector transformNodeAttribute(com.ibm.xcap.DocumentSelector documentSelector)
          Transforms the nodeAttribute of a DocumentSelector to match the format for
 java.lang.String validateGINodeSelectorAttr(java.lang.String method, com.ibm.xcap.NodeSelector nodeSelector, java.lang.String globalIndexPM)
           
 
Methods inherited from interface com.ibm.xdms.function.Function
getApplicationUsage, init
 

Method Detail

recordAlarmAndFaultLogger

void recordAlarmAndFaultLogger(java.lang.Exception e,
                               java.lang.String METHOD,
                               java.lang.String documentSelector,
                               java.lang.String xdmsErrorMsg)
                               throws XcapException
Throws:
XcapException

setUpDataSource

javax.sql.DataSource setUpDataSource()
Gets the dataSource

Parameters:
appUsage - The ApplicationUsage information.
Returns:
String dataSource
Throws:
java.sql.SQLException

getConnection

java.sql.Connection getConnection(javax.sql.DataSource dataSource)
                                  throws XcapException
Returns a db connection

Returns:
Database connection
Throws:
XcapException

closeConnection

void closeConnection(java.sql.Connection con)
                     throws XcapException
Closes db connection

Throws:
XcapException

getTransaction

javax.transaction.UserTransaction getTransaction(XcapServerRequest request)
                                                 throws XcapException
Returns the current transaction for this request. If one does not exist, this method creates one and places it as an attribute in the request

Parameters:
request - XcapServerRequest
Returns:
The UserTransaction to use
Throws:
XcapException

beginTransaction

void beginTransaction(javax.transaction.UserTransaction trans,
                      java.lang.String method)
                      throws XcapException
Begins the transaction associated with the Datastore

Parameters:
trans -
METHOD -
Throws:
XcapException

commitTransaction

void commitTransaction(XcapServerRequest request)
                       throws XcapException
Commits the transaction associated with the Datastore

Parameters:
request - XcapServerRequest object
Throws:
XcapException

rollbackTransaction

void rollbackTransaction(XcapServerRequest request)
                         throws XcapException
Rolls back the transaction associated with the Datastore

Parameters:
request - XcapServerRequest object
Throws:
XcapException

rollbackTransaction

void rollbackTransaction(javax.transaction.UserTransaction trans,
                         java.lang.String method)
                         throws XcapException
Rolls back the transaction associated with the Datastore

Parameters:
trans - UserTransaction object
method - METHOD calling the rollback
Throws:
XcapException

enableSchemaValidation

boolean enableSchemaValidation()
Queries the AuidConfig to determine if schema validation is enabled.

Returns:
Returns true or false if schema validation is enabled.

getMaxSearchResults

int getMaxSearchResults()
Queries the AuidConfig to determine the maxSearchResults

Returns:
Returns true or false if schema validation is enabled.

dxpCreateDocument

org.w3c.dom.Document dxpCreateDocument(DomXmlProcessor dxp,
                                       java.lang.String documentString,
                                       boolean enableSchemaValidation,
                                       java.sql.Connection con,
                                       java.sql.PreparedStatement ps,
                                       javax.transaction.UserTransaction trans)
                                       throws java.sql.SQLException,
                                              XcapException
document = dxp.createDocument(documentString, enableSchemaValidation)

Parameters:
dxp -
documentString -
enableSchemaValidation -
con -
ps -
trans -
Returns:
Document
Throws:
java.sql.SQLException
XcapException

getETag

long getETag(java.lang.String documentSelector,
             javax.sql.DataSource dataSource,
             java.sql.Connection con,
             XcapServerRequest request)
             throws XcapException
Retrieves the ETag for a document

Parameters:
documentSelector -
dataSource -
con -
Returns:
ETag of the document, -1 if the document was not found
Throws:
XcapException - error retrieving the document from the database

getETag

long getETag(java.lang.String documentSelector,
             java.sql.Connection con,
             XcapServerRequest request)
             throws XcapException
Retrieves the ETag for a document, using an existing connection

Parameters:
documentSelector - Document Selector
con - JDBC Connection
Returns:
ETag of the document, -1 if the document was not found
Throws:
XcapException - error retrieving the document from the database

getETag

long getETag(java.lang.String documentSelector,
             java.sql.Connection con,
             javax.servlet.sip.SipServletRequest request)
             throws XcapException
Retrieves the ETag for a document, using an existing connection

Parameters:
documentSelector - Document Selector
con - JDBC Connection
Returns:
ETag of the document, -1 if the document was not found
Throws:
XcapException - error retrieving the document from the database

checkReadAccess

void checkReadAccess(XcapServerRequest request,
                     java.lang.String documentSelector)
                     throws XdmsException
Checks if the principal in the request has permission to have read access to the specified node selector

Parameters:
request -
documentSelector -
Throws:
XdmsException
UnauthorizedException

checkAccess

void checkAccess(XcapServerRequest request,
                 com.ibm.xcap.DocumentSelector documentSelector,
                 int permission)
                 throws XdmsException
Checks if the principal in the request has permission to have the specified access to the specified node selector

Parameters:
request - Request
documentSelector - Document Selector
Throws:
XdmsException
UnauthorizedException

checkAccess

void checkAccess(java.lang.String documentSelectorString,
                 java.security.Principal principal,
                 boolean isSuperAdminUser,
                 boolean isAnonymousUser,
                 int permission)
                 throws XdmsException,
                        java.net.MalformedURLException
Checks if the principal in the request has permission to have the specified access to the specified node selector

Parameters:
request - Request
documentSelector - Document Selector
Throws:
XdmsException
XdmsException
UnauthorizedException - If the user is not authorized
XdmsException
java.net.MalformedURLException

validateGINodeSelectorAttr

java.lang.String validateGINodeSelectorAttr(java.lang.String method,
                                            com.ibm.xcap.NodeSelector nodeSelector,
                                            java.lang.String globalIndexPM)
                                            throws LocalConstraintFailureException,
                                                   XcapException
Throws:
LocalConstraintFailureException
XcapException

transformNodeAttribute

com.ibm.xcap.DocumentSelector transformNodeAttribute(com.ibm.xcap.DocumentSelector documentSelector)
                                                     throws java.net.MalformedURLException,
                                                            XcapException
Transforms the nodeAttribute of a DocumentSelector to match the format for

Parameters:
documentSelector - DocumentSelector
Returns:
Transformed documentSelector
Throws:
XcapException, - MalformedURLException
java.net.MalformedURLException
XcapException