|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.biomoby.client.MobyRequest
public class MobyRequest
This class handles the WSDL transaction to request a response from a remote SOAP Web service that handles the MOBY format. It depends on having already retrieved the definition of the Web service via the MOBY central registry using the jMOBY API, and for now it uses the Apache Axis Web services framework, as well as Apache Xalan. There are code comments for the few lines that rely on Axis classes rather than the JAX-RPC interfaces.
Constructor Summary | |
---|---|
MobyRequest(Central central)
Default constructor. |
Method Summary | |
---|---|
void |
addEventHandler(MobyRequestEventHandler h)
|
String |
convertMOBYDataToMOBYRequest(MobyContentInstance data)
Creates an XML representation of the data, renamed to fit the needs of the service if necessary, and adding any secondary parameter default values if not already specified in the incoming data. |
String |
convertMOBYDataToMOBYRequest(MobyDataInstance data)
|
Element |
decodeSOAPMessage(Element n,
StringBuffer contentsXMLOutput,
String inputXML)
|
Element |
decodeSOAPMessage(Element n,
StringBuffer contentsXMLOutput,
String inputXML,
boolean async)
Isolates the MOBY Data from the SOAP message returned by the remote service host. |
Central |
getCentralImpl()
|
MobyContentInstance |
getInput()
|
MobyContentInstance |
getOutput()
|
String |
getResponseXML()
|
MobyService |
getService()
|
MobyContentInstance |
invokeService()
The main method of the class. |
int |
invokeService(MobyRequestEventHandler handler)
Asynchronous call to invokeService. |
void |
removeEventHandler(MobyRequestEventHandler h)
|
void |
sendResponse(MobyRequestEvent mre)
|
void |
setAuthentication(String user,
String password)
|
void |
setDebugMode(boolean mode)
|
void |
setDebugPrintStream(PrintStream ps)
Standard error is used unless this method is called. |
void |
setInput(MobyContentInstance data)
Sets the input data for the MOBY service request. |
void |
setInput(MobyDataInstance datum)
Convenience method to run services that take one argument. |
void |
setInput(MobyDataInstance[] data)
Takes the data in the array, with their current articleNames, as input for the service |
void |
setInput(MobyDataInstance datum,
String paramName)
Convenience method to run services that take one named argument. |
void |
setSecondaryInput(Collection<MobyDataSecondaryInstance> secondaryData)
Same functionality as setSecondaryInput(MobyDataSecondaryInstance[]) |
void |
setSecondaryInput(MobyDataSecondaryInstance[] secondaryData)
This method will assign the provided secondary parameters to all primary input data currently in this object. |
void |
setService(MobyService mobyservice)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MobyRequest(Central central) throws ParserConfigurationException
central
- An instance of a Moby central object so we can make requests about object types, etc.
ParserConfigurationException
- if JAXP doesn't have any valid DOM-building XML parsers set up for useMethod Detail |
---|
public void setAuthentication(String user, String password)
public void setDebugMode(boolean mode)
mode
- if true, debugging information is printed to the stream returned by getDebugOutputStreampublic void setDebugPrintStream(PrintStream ps) throws IllegalArgumentException
ps
- the OutputStream to which debugging information is sent.
IllegalArgumentException
- if the stream is nullpublic Central getCentralImpl()
public void setService(MobyService mobyservice)
mobyservice
- the MobyService that should be executed when invokeService is calledpublic MobyService getService()
public String getResponseXML()
public void setInput(MobyContentInstance data) throws MobyException
IllegalArgumentException
- if the input does not fit the criteria of the service (e.g. wrong data type)
MobyException
public void setInput(MobyDataInstance[] data) throws MobyException
MobyException
public void setInput(MobyDataInstance datum) throws MobyException
MobyException
public void setInput(MobyDataInstance datum, String paramName) throws MobyException
MobyException
public MobyContentInstance getInput()
public void setSecondaryInput(Collection<MobyDataSecondaryInstance> secondaryData) throws MobyException
MobyException
public void setSecondaryInput(MobyDataSecondaryInstance[] secondaryData) throws MobyException
MobyException
- if a parameter name is blank, or overrides a primary parameterpublic MobyContentInstance getOutput() throws MobyException
MobyException
- if you try to get the results before calling InvokeServicepublic MobyContentInstance invokeService() throws Exception, MobyException, SOAPException, NoSuccessException
MobyException
- i.e. there was something wrong with the input, output or remote service's logic
SOAPException
- i.e. there was a problem with the underlying transaction/transport layer
Exception
NoSuccessException
public int invokeService(MobyRequestEventHandler handler)
public void addEventHandler(MobyRequestEventHandler h)
public void removeEventHandler(MobyRequestEventHandler h)
public void sendResponse(MobyRequestEvent mre)
public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML) throws SOAPException, MobyException
SOAPException
MobyException
public Element decodeSOAPMessage(Element n, StringBuffer contentsXMLOutput, String inputXML, boolean async) throws SOAPException, MobyException
SOAPException
- if the MOBY payload cannot be found in the SOAP message
MobyException
- if the MOBY message is not well-formed XMLpublic String convertMOBYDataToMOBYRequest(MobyDataInstance data) throws MobyException
MobyException
public String convertMOBYDataToMOBYRequest(MobyContentInstance data) throws MobyException
data
- the array of input parameters to put in a MOBY XML request
MobyException
|
Version: 1.1.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |