public abstract class CellClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Li2b2Client |
client |
protected URL |
serviceUrl |
| Constructor and Description |
|---|
CellClient(Li2b2Client client,
URL serviceUrl) |
| Modifier and Type | Method and Description |
|---|---|
protected Element |
appendOptionalElement(Element parent,
String name,
String value)
Convenience method to append a text element to another element
if and only if the supplied value is not
null. |
protected Element |
appendTextElement(Element parent,
String name,
String value)
Convenience method to append a text element to another element
|
protected HttpURLConnection |
createConnection(HiveRequest HiveRequest,
URL requestUrl)
Create the HTTP connection.
|
protected URL |
createRequest(String path) |
protected HiveRequest |
createRequestMessage() |
protected HiveRequest |
createRequestMessage(DocumentBuilder builder)
Create a new HiveRequest message.
|
protected HiveRequest |
createRequestMessage(String bodyXML) |
protected String |
getOutputCharset() |
URL |
getServiceURL() |
protected DocumentBuilder |
newBuilder() |
protected HiveResponse |
submitRequest(DocumentBuilder b,
HiveRequest request,
URL requestUrl) |
protected HiveResponse |
submitRequest(HiveRequest HiveRequest,
String method) |
protected Element |
submitRequestWithResponseContent(HiveRequest HiveRequest,
String restMethod,
String responseNS,
String responseElement)
Submit a HiveRequest and expect the HiveResponse body to contain
the specified XML element.
|
protected Li2b2Client client
protected URL serviceUrl
public CellClient(Li2b2Client client, URL serviceUrl)
public URL getServiceURL()
protected String getOutputCharset()
protected URL createRequest(String path) throws MalformedURLException
MalformedURLExceptionprotected DocumentBuilder newBuilder()
protected HiveRequest createRequestMessage(DocumentBuilder builder)
builder - document builderprotected HiveRequest createRequestMessage()
protected HiveRequest createRequestMessage(String bodyXML) throws SAXException, IOException
SAXExceptionIOExceptionprotected HttpURLConnection createConnection(HiveRequest HiveRequest, URL requestUrl) throws IOException
This method will also prepare the returned connection for
the URLConnection.connect() call. Specifically,
the HiveRequest method will be set to POST, and the
Content-Type header will be set to application/xml
with output charset.
HiveRequest - HiveRequestrequestUrl - URLIOException - io errorprotected HiveResponse submitRequest(HiveRequest HiveRequest, String method) throws HiveException
HiveExceptionprotected HiveResponse submitRequest(DocumentBuilder b, HiveRequest request, URL requestUrl) throws HiveException
HiveExceptionprotected Element submitRequestWithResponseContent(HiveRequest HiveRequest, String restMethod, String responseNS, String responseElement) throws HiveException
HiveRequest - HiveRequestrestMethod - RESTful methodresponseNS - HiveResponse body namespaceresponseElement - HiveResponse body elementHiveException will be thrown.HiveException - server HiveRequest or HiveResponse errorprotected Element appendTextElement(Element parent, String name, String value)
parent - parent to which the new element will be added as a childname - element namevalue - element valueprotected Element appendOptionalElement(Element parent, String name, String value)
null.parent - parent to which the new element will be added as a childname - element namevalue - element value. If the value is null, the element is not created/appendednull if the value was nullCopyright © 2013–2020 R.W.Majeed. All rights reserved.