2.17.2: 2011-06-17

net.sf.basedb.ws.server
Class AbstractRPCService

java.lang.Object
  extended by net.sf.basedb.ws.server.AbstractRPCService
Direct Known Subclasses:
AnnotationTypeService, ArrayDesignService, BioAssaySetService, ExperimentService, ProjectService, RawBioAssayService, ReporterService, SessionService

public abstract class AbstractRPCService
extends Object

An abstract class for Web service classes to extend from. This contains common methods and fields for WebService classes on the server side in BASE.

Version:
2.5
Author:
Nicklas, Martin

Field Summary
protected  ServicesUtil util
           
 
Constructor Summary
protected AbstractRPCService()
           
 
Method Summary
protected  org.apache.axiom.om.OMElement attachFile(DataSource dataSource, String elementName)
          Attach a file to an OMElement so it can be sent with webservices.
protected  String getRemoteId()
          Gets the remote id to identify connection with.
protected  SessionControl getSessionControl(String ID)
          Gets the SessionControl for a given session ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

util

protected ServicesUtil util
Constructor Detail

AbstractRPCService

protected AbstractRPCService()
Method Detail

getSessionControl

protected SessionControl getSessionControl(String ID)
Gets the SessionControl for a given session ID.

Parameters:
ID - Id for which SessionControl should be returned.
Returns:
SessionControl object

getRemoteId

protected String getRemoteId()
Gets the remote id to identify connection with.

Returns:
A string with the address to the connected client.

attachFile

protected org.apache.axiom.om.OMElement attachFile(DataSource dataSource,
                                                   String elementName)
Attach a file to an OMElement so it can be sent with webservices. Following code shows an example of how to get to the file on the client side: OMElement response = .....
OMElement fileElement = response.getFirstElement();
OMElement dataElement = fileElement.getFirstElement();
OMText node = (OMText) dataElement.getFirstOMChild();
DataHandler dataHandler = (DataHandler) node.getDataHandler();
InputStream in = dataHandler.getInputStream();

Parameters:
dataSource - A DataSource to be attached to an OMElement.
elementName - The name to call the element by.
Returns:
OMElement where the file is attached to.

2.17.2: 2011-06-17