public class Http extends BasicSense
Modifier and Type | Field and Description |
---|---|
static int |
WORKER_THREADS |
conversations, DAY, DEFAULT_SPEAKER, engaged, HOUR, MAX_FILE_SIZE, MINUTE, RETRY
Constructor and Description |
---|
Http() |
Modifier and Type | Method and Description |
---|---|
void |
batchProcessURL(java.net.URL url,
Network network)
Process the URL as part of a batch.
|
Vertex |
convertElement(org.w3c.dom.Element element,
Network network) |
Vertex |
convertElement(java.lang.Object json,
Network network) |
java.lang.String |
convertToJSON(Vertex object) |
void |
convertToJSON(Vertex object,
java.io.Writer writer,
int depth) |
java.util.Map<java.lang.String,java.lang.String> |
convertToMap(Vertex object) |
java.io.StringReader |
convertToXHTML(java.io.InputStream input)
Convert the HTML input stream into DOM parsable XHTML.
|
java.lang.String |
convertToXHTML(java.lang.String html)
Convert the HTML input stream into DOM parsable XHTML.
|
java.lang.String |
convertToXML(Vertex object) |
void |
convertToXML(Vertex object,
java.lang.String elementName,
java.io.Writer writer,
int depth) |
int |
countJSON(java.lang.String url,
java.lang.String attribute,
Network network)
Return the count of the JSON result array.
|
Vertex |
delete(java.lang.String url,
Network network)
Send a DELETE request to the URL.
|
Vertex |
delete(Vertex source,
Vertex url)
Self API.
|
void |
disconnect() |
Vertex |
encode(Vertex source,
Vertex text)
Self API.
|
org.w3c.dom.Node |
findNextTag(java.util.Set<java.lang.String> tags,
java.lang.String value,
org.w3c.dom.Node node,
org.w3c.dom.Node root)
Find the next node for the tag, search children, siblings and cousins.
|
org.w3c.dom.Node |
findTag(java.util.Set<java.lang.String> tags,
java.lang.String value,
org.w3c.dom.Node node)
Find the next node for any of the tags whose text contains the value.
|
org.w3c.dom.Node |
findTag(java.lang.String tag,
org.w3c.dom.Node node)
Find the next node for the tag.
|
org.w3c.dom.Node |
findTag(java.lang.String tag,
java.lang.String value,
org.w3c.dom.Node node)
Find the next node for the tag.
|
java.util.List<java.lang.String> |
getAllBullets(org.w3c.dom.Node node)
Parse the text values from the next bullet list.
|
java.util.List<java.lang.String> |
getAllURLBullets(org.w3c.dom.Node node)
Parse the text values from the next bullet list.
|
java.util.Map<java.lang.String,Http> |
getDomains()
Return the map of registered domain processing senses,
keyed by their URL domains they accept.
|
org.htmlcleaner.HtmlCleaner |
getHtmlCleaner() |
java.util.List<java.lang.String> |
getNextBulletList(org.w3c.dom.Node node)
Parse the text values from the next bullet list.
|
java.util.List<java.lang.String> |
getNextNumberedList(org.w3c.dom.Node node)
Parse the text values from the next numbered list.
|
java.lang.String |
getNextParagraph(org.w3c.dom.Node node)
Parse the text values from the next paragrpah.
|
javax.xml.parsers.DocumentBuilder |
getParser() |
Vertex |
getSentence(org.w3c.dom.Node node,
Network network)
Return a sentence of all the words, or a word is a single word.
|
java.lang.String |
getText(org.w3c.dom.Node node)
Return the complete node text.
|
void |
input(java.util.Collection<java.net.URL> input)
Process the list of URLs as a batch using multi threading.
|
void |
input(java.lang.Object input,
Network network)
Get and process the URL.
|
org.w3c.dom.Node |
nextNode(org.w3c.dom.Node node,
org.w3c.dom.Node root)
Return the next sibling or parent sibling node.
|
void |
output(Vertex output)
Post, process the post request.
|
org.w3c.dom.Element |
parseHTML(java.lang.String html)
Parse the input HTML into a DOM.
|
java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
parseRSSFeed(java.net.URL url,
long fromTime)
Parse RSS feed.
|
org.w3c.dom.Element |
parseURL(java.net.URL url)
Parse the HTML as a DOM.
|
org.w3c.dom.Element |
parseXHTML(java.io.StringReader input)
Parse the input XHTML stream into a DOM.
|
org.w3c.dom.Element |
parseXML(java.io.InputStream input)
Parse the input XML stream into a DOM.
|
org.w3c.dom.Element |
parseXMLURL(java.net.URL url)
Parse the XML as a DOM.
|
void |
pool()
Reset state when instance is pooled.
|
Vertex |
postHTML(java.lang.String url,
Vertex paramsObject,
java.lang.String xpath,
Network network)
Post the HTML forms params and return the HTML data from the URL.
|
Vertex |
postHTML(Vertex source,
Vertex url,
Vertex paramsObject,
Vertex xpath)
Self API.
|
Vertex |
postJSON(java.lang.String url,
Vertex jsonObject,
Network network)
POST the JSON object and return the JSON data from the URL.
|
Vertex |
postJSON(Vertex source,
Vertex url,
Vertex jsonObject)
Self API.
|
Vertex |
postJSONAuth(java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String agent,
Vertex jsonObject,
Network network)
Post the JSON object and return the JSON data from the URL.
|
Vertex |
postJSONAuth(java.lang.String url,
java.lang.String user,
java.lang.String password,
Vertex jsonObject,
Network network)
Post the JSON object and return the JSON data from the URL.
|
Vertex |
postJSONAuth(Vertex source,
Vertex url,
Vertex user,
Vertex password,
Vertex jsonObject)
Self API.
|
Vertex |
postJSONAuth(Vertex source,
Vertex url,
Vertex user,
Vertex password,
Vertex agent,
Vertex jsonObject)
Self API.
|
Vertex |
postXML(java.lang.String url,
Vertex xmlObject,
Network network)
Post the XML document object and return the XML data from the URL.
|
Vertex |
postXML(java.lang.String url,
Vertex xmlObject,
java.lang.String xpath,
Network network)
Post the XML document object and return the XML data from the URL.
|
Vertex |
postXML(Vertex source,
Vertex url,
Vertex xmlObject)
Self API.
|
Vertex |
postXML(Vertex source,
Vertex url,
Vertex xmlObject,
Vertex xpath)
Self API.
|
Vertex |
postXMLAuth(java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String agent,
Vertex xmlObject,
java.lang.String xpath,
Network network)
Post the XML document object and return the XML data from the URL.
|
Vertex |
postXMLAuth(java.lang.String url,
java.lang.String user,
java.lang.String password,
Vertex xmlObject,
java.lang.String xpath,
Network network)
Post the XML document object and return the XML data from the URL.
|
Vertex |
postXMLAuth(Vertex source,
Vertex url,
Vertex user,
Vertex password,
Vertex xmlObject,
Vertex xpath)
Self API.
|
Vertex |
postXMLAuth(Vertex source,
Vertex url,
Vertex user,
Vertex password,
Vertex agent,
Vertex xmlObject,
Vertex xpath)
Self API.
|
static java.lang.String |
printDate(java.util.Date date) |
void |
processHeaders(org.w3c.dom.Node node,
Vertex url,
Network network)
Process the header nodes and associate their topics with the URL.
|
void |
processRoot(org.w3c.dom.Node node,
java.net.URL url,
Network network)
Process the XHTML DOM.
|
Vertex |
putJSON(java.lang.String url,
Vertex jsonObject,
Network network)
PUT the JSON object and return the JSON data from the URL.
|
Vertex |
putJSON(Vertex source,
Vertex url,
Vertex jsonObject)
Self API.
|
Vertex |
requestCSV(java.lang.String url,
Network network)
Return the CSV data object from the URL.
|
Vertex |
requestCSV(Vertex source,
Vertex url)
Self API.
|
Vertex |
requestHTML(java.lang.String url,
java.lang.String xpath,
java.lang.String format,
java.lang.String subformat,
Network network)
Return the HTML data from the URL.
|
Vertex |
requestHTML(Vertex source,
Vertex url,
Vertex xpath)
Self API.
|
Vertex |
requestHTML(Vertex source,
Vertex url,
Vertex xpath,
Vertex format)
Self API.
|
Vertex |
requestHTML(Vertex source,
Vertex url,
Vertex xpath,
Vertex format,
Vertex subformat)
Self API.
|
Vertex |
requestJSON(java.lang.String url,
java.lang.String attribute,
java.util.Map<java.lang.String,java.lang.String> headers,
Network network)
Return the JSON data object from the URL.
|
Vertex |
requestJSON(Vertex source,
Vertex url)
Self API.
|
Vertex |
requestJSON(Vertex source,
Vertex attribute,
Vertex url)
Self API.
|
Vertex |
requestJSON(Vertex source,
Vertex attribute,
Vertex url,
Vertex headerObject)
Self API.
|
Vertex |
requestJSONAuth(java.lang.String url,
java.lang.String user,
java.lang.String password,
Network network)
GET the JSON data from the URL.
|
Vertex |
requestJSONAuth(java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String agent,
Network network)
GET the JSON data from the URL.
|
Vertex |
requestJSONAuth(Vertex source,
Vertex url,
Vertex user,
Vertex password)
Self API.
|
Vertex |
requestJSONAuth(Vertex source,
Vertex url,
Vertex user,
Vertex password,
Vertex agent)
Self API.
|
Vertex |
requestText(java.lang.String url,
java.util.Map<java.lang.String,java.lang.String> headers,
Network network)
Return the text data from the URL.
|
Vertex |
requestText(Vertex source,
Vertex url)
Self API.
|
Vertex |
requestText(Vertex source,
Vertex url,
Vertex headerObject)
Self API.
|
Vertex |
requestXML(java.lang.String url,
java.lang.String xpath,
java.util.Map<java.lang.String,java.lang.String> headers,
Network network)
Return the XML data from the URL.
|
Vertex |
requestXML(Vertex source,
Vertex url)
Self API.
|
Vertex |
requestXML(Vertex source,
Vertex url,
Vertex xpath)
Self API.
|
Vertex |
requestXML(Vertex source,
Vertex url,
Vertex xpath,
Vertex headerObject)
Self API.
|
Vertex |
requestXMLAuth(java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String xpath,
Network network)
GET the XML data from the URL.
|
Vertex |
requestXMLAuth(java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String agent,
java.lang.String xpath,
Network network)
GET the XML data from the URL.
|
Vertex |
requestXMLAuth(Vertex source,
Vertex url,
Vertex user,
Vertex password,
Vertex xpath)
Self API.
|
Vertex |
requestXMLAuth(Vertex source,
Vertex url,
Vertex user,
Vertex password,
Vertex agent,
Vertex xpath)
Self API.
|
Vertex |
rss(Vertex source,
Vertex url)
Self API.
|
Vertex |
rssFeed(Vertex source,
Vertex url)
Self API.
|
void |
shutdown()
Stop sensing.
|
java.lang.String |
stripBrackets(java.lang.String text) |
Vertex |
toJSON(Vertex source,
Vertex jsonObject)
Self API.
|
Vertex |
toXML(Vertex source,
Vertex xmlObject)
Self API.
|
addListener, awake, checkEngaged, checkSentence, discover, discoverSentence, getAction, getBot, getEmotionalState, getLanguageState, getListeners, getName, getPrimitive, getResponseListener, getShortTermMemory, initialize, input, isEnabled, log, log, log, migrateProperties, notifyExceptionListeners, notifyResponseListener, printInput, removeListener, saveProperties, setAction, setBot, setEmotionalState, setIsEnabled, setLanguageState, setName, setResponseListener, toString
public void batchProcessURL(java.net.URL url, Network network)
public java.io.StringReader convertToXHTML(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public java.lang.String convertToXHTML(java.lang.String html) throws java.io.IOException
java.io.IOException
public void shutdown()
shutdown
in interface Sense
shutdown
in class BasicSense
public void pool()
pool
in interface Sense
pool
in class BasicSense
public void disconnect()
public javax.xml.parsers.DocumentBuilder getParser() throws java.lang.Exception
java.lang.Exception
public org.htmlcleaner.HtmlCleaner getHtmlCleaner()
public org.w3c.dom.Element parseHTML(java.lang.String html) throws java.lang.Exception
java.lang.Exception
public org.w3c.dom.Element parseXHTML(java.io.StringReader input) throws java.lang.Exception
java.lang.Exception
public org.w3c.dom.Element parseXML(java.io.InputStream input) throws java.lang.Exception
java.lang.Exception
public void input(java.lang.Object input, Network network) throws java.lang.Exception
input
in interface Sense
input
in class BasicSense
java.lang.Exception
public org.w3c.dom.Element parseURL(java.net.URL url)
public Vertex requestXML(Vertex source, Vertex url, Vertex xpath)
public Vertex requestXML(Vertex source, Vertex url, Vertex xpath, Vertex headerObject)
public Vertex requestXMLAuth(Vertex source, Vertex url, Vertex user, Vertex password, Vertex xpath)
public Vertex requestXMLAuth(Vertex source, Vertex url, Vertex user, Vertex password, Vertex agent, Vertex xpath)
public Vertex requestHTML(Vertex source, Vertex url, Vertex xpath)
public Vertex requestHTML(Vertex source, Vertex url, Vertex xpath, Vertex format)
public Vertex requestHTML(Vertex source, Vertex url, Vertex xpath, Vertex format, Vertex subformat)
public Vertex requestXML(Vertex source, Vertex url)
public Vertex requestXML(java.lang.String url, java.lang.String xpath, java.util.Map<java.lang.String,java.lang.String> headers, Network network)
public Vertex requestText(java.lang.String url, java.util.Map<java.lang.String,java.lang.String> headers, Network network)
public Vertex requestText(Vertex source, Vertex url)
public Vertex requestText(Vertex source, Vertex url, Vertex headerObject)
public Vertex requestHTML(java.lang.String url, java.lang.String xpath, java.lang.String format, java.lang.String subformat, Network network)
public Vertex requestJSON(Vertex source, Vertex url)
public Vertex requestJSONAuth(Vertex source, Vertex url, Vertex user, Vertex password)
public Vertex requestJSONAuth(Vertex source, Vertex url, Vertex user, Vertex password, Vertex agent)
public Vertex requestCSV(Vertex source, Vertex url)
public Vertex requestJSON(Vertex source, Vertex attribute, Vertex url)
public Vertex requestJSON(Vertex source, Vertex attribute, Vertex url, Vertex headerObject)
public Vertex requestCSV(java.lang.String url, Network network)
public Vertex delete(java.lang.String url, Network network)
public Vertex requestJSON(java.lang.String url, java.lang.String attribute, java.util.Map<java.lang.String,java.lang.String> headers, Network network)
public int countJSON(java.lang.String url, java.lang.String attribute, Network network)
public Vertex postJSON(Vertex source, Vertex url, Vertex jsonObject)
public Vertex putJSON(Vertex source, Vertex url, Vertex jsonObject)
public Vertex postJSONAuth(Vertex source, Vertex url, Vertex user, Vertex password, Vertex jsonObject)
public Vertex postJSONAuth(Vertex source, Vertex url, Vertex user, Vertex password, Vertex agent, Vertex jsonObject)
public Vertex postXML(Vertex source, Vertex url, Vertex xmlObject)
public Vertex postXML(java.lang.String url, Vertex xmlObject, Network network)
public Vertex postXMLAuth(java.lang.String url, java.lang.String user, java.lang.String password, Vertex xmlObject, java.lang.String xpath, Network network)
public Vertex postXMLAuth(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String agent, Vertex xmlObject, java.lang.String xpath, Network network)
public Vertex postJSON(java.lang.String url, Vertex jsonObject, Network network)
public Vertex putJSON(java.lang.String url, Vertex jsonObject, Network network)
public Vertex postJSONAuth(java.lang.String url, java.lang.String user, java.lang.String password, Vertex jsonObject, Network network)
public Vertex postJSONAuth(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String agent, Vertex jsonObject, Network network)
public Vertex requestJSONAuth(java.lang.String url, java.lang.String user, java.lang.String password, Network network)
public Vertex requestJSONAuth(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String agent, Network network)
public Vertex requestXMLAuth(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String xpath, Network network)
public Vertex requestXMLAuth(java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String agent, java.lang.String xpath, Network network)
public Vertex postHTML(Vertex source, Vertex url, Vertex paramsObject, Vertex xpath)
public Vertex postHTML(java.lang.String url, Vertex paramsObject, java.lang.String xpath, Network network)
public Vertex postXML(Vertex source, Vertex url, Vertex xmlObject, Vertex xpath)
public Vertex postXMLAuth(Vertex source, Vertex url, Vertex user, Vertex password, Vertex xmlObject, Vertex xpath)
public Vertex postXMLAuth(Vertex source, Vertex url, Vertex user, Vertex password, Vertex agent, Vertex xmlObject, Vertex xpath)
public Vertex toJSON(Vertex source, Vertex jsonObject)
public Vertex toXML(Vertex source, Vertex xmlObject)
public Vertex postXML(java.lang.String url, Vertex xmlObject, java.lang.String xpath, Network network)
public java.lang.String convertToXML(Vertex object)
public java.lang.String convertToJSON(Vertex object)
public static java.lang.String printDate(java.util.Date date)
public void convertToJSON(Vertex object, java.io.Writer writer, int depth) throws java.lang.Exception
java.lang.Exception
public void convertToXML(Vertex object, java.lang.String elementName, java.io.Writer writer, int depth) throws java.lang.Exception
java.lang.Exception
public java.util.Map<java.lang.String,java.lang.String> convertToMap(Vertex object)
public org.w3c.dom.Element parseXMLURL(java.net.URL url)
public java.util.List<java.util.Map<java.lang.String,java.lang.Object>> parseRSSFeed(java.net.URL url, long fromTime)
public void input(java.util.Collection<java.net.URL> input)
public void processRoot(org.w3c.dom.Node node, java.net.URL url, Network network)
public void processHeaders(org.w3c.dom.Node node, Vertex url, Network network)
public org.w3c.dom.Node nextNode(org.w3c.dom.Node node, org.w3c.dom.Node root)
public org.w3c.dom.Node findNextTag(java.util.Set<java.lang.String> tags, java.lang.String value, org.w3c.dom.Node node, org.w3c.dom.Node root)
public org.w3c.dom.Node findTag(java.lang.String tag, org.w3c.dom.Node node)
public org.w3c.dom.Node findTag(java.lang.String tag, java.lang.String value, org.w3c.dom.Node node)
public org.w3c.dom.Node findTag(java.util.Set<java.lang.String> tags, java.lang.String value, org.w3c.dom.Node node)
public java.lang.String getText(org.w3c.dom.Node node)
public Vertex getSentence(org.w3c.dom.Node node, Network network)
public java.lang.String stripBrackets(java.lang.String text)
public java.lang.String getNextParagraph(org.w3c.dom.Node node)
public java.util.List<java.lang.String> getNextBulletList(org.w3c.dom.Node node)
public java.util.List<java.lang.String> getNextNumberedList(org.w3c.dom.Node node)
public java.util.List<java.lang.String> getAllBullets(org.w3c.dom.Node node)
public java.util.List<java.lang.String> getAllURLBullets(org.w3c.dom.Node node)
public void output(Vertex output)
output
in interface Sense
output
in class BasicSense
public java.util.Map<java.lang.String,Http> getDomains()