public class DSTools extends Object
Constructor and Description |
---|
DSTools() |
Modifier and Type | Method and Description |
---|---|
static void |
abortBoxcar(DataService dataService)
This method aborts the current boxcarring session
|
static org.apache.axiom.om.OMElement |
accessResource(DataService dataService,
String resourcePath,
Map<String,ParamValue> params,
String accessMethod)
This method accesses a resource defined in the data service.
|
static void |
beginBoxcar(DataService dataService)
This method begins a boxcarring session.
|
static DataService |
createDataService(org.apache.axiom.om.OMElement dbsElement,
String dsLocation)
This method creates a DataService object, given the data services descriptor information.
|
static org.apache.axiom.om.OMElement |
endBoxcar(DataService dataService)
This method ends and commits a boxcarring session.
|
static void |
invokeOperation(DataService dataService,
String operationName,
List<Map<String,ParamValue>> batchParams)
This method invokes the batch version of the operation defined in the given data service.
|
static org.apache.axiom.om.OMElement |
invokeOperation(DataService dataService,
String operationName,
Map<String,ParamValue> params)
This method invokes a single operation defined in the given data service.
|
static org.apache.axiom.om.OMElement |
serializeDataService(DataService dataService)
This method serializes the given DataService object to a data services configuration document
(.dbs XML file format).
|
static void |
setDataServicesUser(DataServiceUser user)
This method sets the current active data services user.
|
public static DataService createDataService(org.apache.axiom.om.OMElement dbsElement, String dsLocation) throws DataServiceFault
dbsElement
- The OMElement of the DBS file root element.dsLocation
- The location of the DBS file, this is purely used for informational
purposes and can be null.DataServiceFault
- The exception is thrown if the DataService cannot be initialized,
i.e. authentication problems, cannot create database connections etc.public static org.apache.axiom.om.OMElement serializeDataService(DataService dataService)
dataService
- The DataService object to be serialized.public static void setDataServicesUser(DataServiceUser user)
user
- This represents the data service objects which contains the username and user roles.public static void beginBoxcar(DataService dataService) throws DataServiceFault
dataService
- The DataService object which represents the data serviceDataServiceFault
- thrown if an error condition occurs in executing the operationpublic static org.apache.axiom.om.OMElement endBoxcar(DataService dataService) throws DataServiceFault
dataService
- The DataService object which represents the data serviceDataServiceFault
- thrown if an error condition occurs in executing the operationpublic static void abortBoxcar(DataService dataService) throws DataServiceFault
dataService
- The DataService object which represents the data serviceDataServiceFault
- thrown if an error condition occurs in executing the operationpublic static org.apache.axiom.om.OMElement invokeOperation(DataService dataService, String operationName, Map<String,ParamValue> params) throws DataServiceFault
dataService
- The DataService object which represents the data service.operationName
- The name of the operation.params
- The parameters destined for the operation.DataServiceFault
- thrown if an error condition occurs in executing the operation.invokeOperation(DataService, String, List)
public static void invokeOperation(DataService dataService, String operationName, List<Map<String,ParamValue>> batchParams) throws DataServiceFault
dataService
- The DataService object which represents the data service.operationName
- The name of the operation.params
- The lists of parameters destined for the operation.DataServiceFault
- thrown if an error condition occurs in executing the batch operation.invokeOperation(DataService, String, Map)
public static org.apache.axiom.om.OMElement accessResource(DataService dataService, String resourcePath, Map<String,ParamValue> params, String accessMethod) throws DataServiceFault
dataService
- The DataService object which represents the data service.resourcePath
- The resource path of the data service resource.params
- The parameters destined for the resource.accessMethod
- The HTTP access method defined in the data service resource.DataServiceFault
- thrown if an error condition occurs in accessing the resource.Copyright © 2019 WSO2. All rights reserved.