| java.lang.Object com.hp.hpl.jena.reasoner.dig.DIGConnection
DIGConnection | public class DIGConnection (Code) | |
Encapsulates the connection to a DIG reasoner.
author: Ian Dickinson, HP Labs (email) version: Release @release@ ($Id: DIGConnection.java,v 1.16 2008/01/02 12:07:11 andy_seaborne Exp $) |
DEFAULT_REASONER_URL | final public static String DEFAULT_REASONER_URL(Code) | | Default URL for connecting to a local DIG reasoner on port 8081
|
m_extReasonerURL | protected String m_extReasonerURL(Code) | | The URL to connect to, initialised to the default URL
|
m_logCommunications | protected boolean m_logCommunications(Code) | | Flag to control whether we log incoming and outgoing messages
|
bindKB | public void bindKB(boolean rebind, DIGProfile profile)(Code) | | Bind a DIG KB to this adapter, by requesting a KB URI through the newKB
verb. If there is already a binding, do nothing unless rebind is true.
Parameters: rebind - If true, any existing KB will be released before bindingto a new KB |
createDigVerb | protected Document createDigVerb(String verbName, DIGProfile profile)(Code) | | Create a DIG verb as an xml element in a new document object.
Parameters: verbName - The name of the DIG verb, as a string An XML DOM element representing the DIG verb |
createXMLFormatter | protected OutputFormat createXMLFormatter(Document doc)(Code) | | Answer an XML formatter object for the given document
Parameters: doc - The XML document to be serialised An XML formatter object for the document |
errorCheck | public void errorCheck(Document response, DIGProfile profile)(Code) | | Check the response from the DIG server to see if there is an error code,
and raise an excption if so.
Parameters: response - The response from the DIG server |
getDigResponse | protected Document getDigResponse(HttpURLConnection conn)(Code) | | Answer the XML document object that resulted from the most recent request.
Parameters: conn - The current HTTP connection The response from the DIG reasoner, as an XML object exception: DigReasonerException - if the underling connection or XML parser raisesan error. |
getReasonerURL | public String getReasonerURL()(Code) | | Answer the URL of the external reasoner this connection is bound to.
The current external reasoner URL |
getWarnings | public Iterator getWarnings()(Code) | | Answer an iterator over the warnings received since the last tell operation
An iterator over warnings |
logMessage | protected void logMessage(boolean outgoing, Document msg)(Code) | | Log the messages going to and from DIG
Parameters: outgoing - True for send, false for receive Parameters: msg - The document sent or received. |
release | public void release()(Code) | | Release this connection back to the connection pool.
|
sendDigVerb | public Document sendDigVerb(Document digVerb, DIGProfile profile)(Code) | | Send a verb to the attached DIG reasoner and answer the result. The verb is encoded as an XML
document object.
Parameters: digVerb - A DIG verb (information request, ask or tell) as an XML document The resulting XML document formed from the response from the reasoner exception: DigReasonerException - for any errors in XML encoding or HTTP transmission |
serialiseDocument | public void serialiseDocument(Document doc, Writer out)(Code) | | Serialise the given document to the given output writer.
Parameters: doc - An XML document to serialise Parameters: out - A writer that will consume the seralised form of the document |
setReasonerURL | public void setReasonerURL(String url)(Code) | | Set the URL of the external reasoner with which this connection communicates.
Parameters: url - The URL of the new external reasoner connection point |
warningCheck | public boolean warningCheck(Document response)(Code) | | Append any warning messages from this response to the list of recent warnings,
which is first cleared.
Parameters: response - The response from the DIG server True if any warnings were detected. |
|
|