|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.zion.jbuddy.bots.BotAction
public class BotAction
An external process carried out by the bot engine.
See BotActionResultType
for information on how
to process an action's results.
Constructor Summary | |
---|---|
BotAction(BotActionType type,
String path)
Creates an action. |
Method Summary | |
---|---|
Object |
clone()
Returns an exact copy of this action. |
RichContent |
getDescription()
Returns this action's description. |
BotHTMLTidyMode |
getHTMLTidyMode()
Returns the HTML Tidy mode to use. |
BotHTTPCompressionType |
getHTTPCompressionType()
Returns the requested HTTP compression type to use. |
BotHTTPMethod |
getHTTPMethod()
Returns the HTTP/1.1 request method to use. |
String |
getHTTPUserAgent()
Returns the HTTP User-Agent value to use. |
String |
getPath()
Returns this action's path. |
BotActionResultType |
getResultType()
Returns this action's result type. |
long |
getTimeout()
Returns this action's timeout value, in milliseconds. |
String |
getTransformPath()
Returns this action's XSLT path. |
BotActionType |
getType()
Returns this action's type. |
void |
setDescription(RichContent description)
Sets this action's description. |
void |
setHTMLTidyMode(BotHTMLTidyMode htmlTidyMode)
Sets the HTML Tidy mode to use. |
void |
setHTTPCompressionType(BotHTTPCompressionType httpCompressionType)
Sets the requested HTTP compression type to use. |
void |
setHTTPMethod(BotHTTPMethod httpMethod)
Sets the HTTP/1.1 request method to use. |
void |
setHTTPUserAgent(String httpUserAgent)
Sets the HTTP User-Agent value to use. |
void |
setPath(String path)
Sets this action's path. |
void |
setResultType(BotActionResultType resultType)
Sets this action's result type. |
void |
setTimeout(long timeout)
Sets this action's timeout value, in milliseconds. |
void |
setTransformPath(String path)
Sets this action's XSLT path. |
void |
setType(BotActionType type)
Sets this action's type. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BotAction(BotActionType type, String path)
Method Detail |
---|
public BotActionType getType()
public void setType(BotActionType type)
public String getPath()
public void setPath(String path)
If type
is:
URL
, this must be a relative or
fully-qualified URL. If relative, it must point to a local resource,
such as a file or resource within the
Java Runtime Environment
's current classpath. If
fully-qualified, the URL protocol must refer to a networking
protocol supported by the Java Runtime Environment
being used. Most runtime environments support at least
file
, ftp
, jar
,
http
, and https
protocols.
JAVA
, this must be a fully-qualified
class name which refers to a BotActionTask
implementation.
An instance of that class is instantiated and executed.
SYSTEM
, this must be a path to a system
command or executable.
This value can contain content variables.
public RichContent getDescription()
public void setDescription(RichContent description)
If resultType
is FILE
,
this description is set on the BotFile
that is sent to
the user. This property isn't currently used for anything else.
public BotActionResultType getResultType()
public void setResultType(BotActionResultType resultType)
If a result type is not specified, the default behavior depends on the action's type:
URL
actions using HTTP, a result type
is used that best matches the HTTP Content-Type.
Content-Type | Result Type |
text/html | html |
text/plain | string |
application/xhtml+xml | xhtml |
text/xhtml | xhtml |
text/xml | xml |
text/*
content types not listed above are returned as
STRING
results. All other content
types are returned as FILE
results.
JAVA
actions, the returned value is
converted to a string and sent to the user. For more information,
see BotActionTask
.
SYSTEM
actions, results are
returned as a string.
public long getTimeout()
public void setTimeout(long timeout)
If an action takes longer than its specified timeout to finish
executing, the associated process or thread is canceled, and an error
message is sent to the user. If a timeout is not specified
(timeout <= 0
), an action is allowed to take any amount
of time to complete.
The default value is 0
.
public String getTransformPath()
public void setTransformPath(String path)
This action's results will be transformed using the rules specified in
the XSLT. HTML content can also be transformed; it will be first
converted to an XML document using HTML Tidy
so it can be
processed. This can be especially useful to dynamically extract content
from HTML-based web sites.
public BotHTMLTidyMode getHTMLTidyMode()
HTML Tidy
mode to use.
public void setHTMLTidyMode(BotHTMLTidyMode htmlTidyMode)
HTML Tidy
mode to use. HTML Tidy
is
used with actions to convert HTML documents into valid XML documents.
This is required if an HTML document is to be transformed with XSLT, as
most HTML documents are not valid XML.
public BotHTTPMethod getHTTPMethod()
public void setHTTPMethod(BotHTTPMethod httpMethod)
This is valid only for URL
actions using HTTP.
public BotHTTPCompressionType getHTTPCompressionType()
public void setHTTPCompressionType(BotHTTPCompressionType httpCompressionType)
This is valid only for URL
actions using HTTP.
public String getHTTPUserAgent()
User-Agent
value to use.
public void setHTTPUserAgent(String httpUserAgent)
User-Agent
value to use. This is important
for web sites that serve content depending on browser version
information contained in the value.
This is valid only for URL
actions using HTTP.
public Object clone()
clone
in class Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |