com.zion.jbuddy.bots
Class BotAction

java.lang.Object
  extended by com.zion.jbuddy.bots.BotAction
All Implemented Interfaces:
BotCall

public class BotAction
extends Object
implements BotCall

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

BotAction

public BotAction(BotActionType type,
                 String path)
Creates an action.

Method Detail

getType

public BotActionType getType()
Returns this action's type.


setType

public void setType(BotActionType type)
Sets this action's type.


getPath

public String getPath()
Returns this action's path.


setPath

public void setPath(String path)
Sets this action's path.

If type is:

This value can contain content variables.


getDescription

public RichContent getDescription()
Returns this action's description.


setDescription

public void setDescription(RichContent description)
Sets this action's 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.


getResultType

public BotActionResultType getResultType()
Returns this action's result type.


setResultType

public void setResultType(BotActionResultType resultType)
Sets this action's result type. The engine sends different result content to the user depending on an action's result type.

If a result type is not specified, the default behavior depends on the action's type:


getTimeout

public long getTimeout()
Returns this action's timeout value, in milliseconds.


setTimeout

public void setTimeout(long timeout)
Sets this action's timeout value, in milliseconds.

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.


getTransformPath

public String getTransformPath()
Returns this action's XSLT path.


setTransformPath

public void setTransformPath(String path)
Sets this action's XSLT path. The value must be a relative or fully-qualified URL to an XSL transform file.

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.


getHTMLTidyMode

public BotHTMLTidyMode getHTMLTidyMode()
Returns the HTML Tidy mode to use.


setHTMLTidyMode

public void setHTMLTidyMode(BotHTMLTidyMode htmlTidyMode)
Sets the 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.


getHTTPMethod

public BotHTTPMethod getHTTPMethod()
Returns the HTTP/1.1 request method to use.


setHTTPMethod

public void setHTTPMethod(BotHTTPMethod httpMethod)
Sets the HTTP/1.1 request method to use.

This is valid only for URL actions using HTTP.


getHTTPCompressionType

public BotHTTPCompressionType getHTTPCompressionType()
Returns the requested HTTP compression type to use.


setHTTPCompressionType

public void setHTTPCompressionType(BotHTTPCompressionType httpCompressionType)
Sets the requested HTTP compression type to use. Compression is used with HTTP to increase performance and lower bandwidth usage by compressing content.

This is valid only for URL actions using HTTP.


getHTTPUserAgent

public String getHTTPUserAgent()
Returns the HTTP User-Agent value to use.


setHTTPUserAgent

public void setHTTPUserAgent(String httpUserAgent)
Sets the HTTP 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.


clone

public Object clone()
Returns an exact copy of this action.

Overrides:
clone in class Object


JBuddy is a trademark of Zion Software, LLC in the US and other countries.
Copyright 2000-2008 Zion Software, LLC All Rights Reserved.