wt.workflow.robots
Class WfURLRobotConnection
java.lang.Object
wt.workflow.robots.WfURLRobotConnection
- Direct Known Subclasses:
- WfURLRobotHttpConnection
- public abstract class WfURLRobotConnection
- extends Object
This class is the abstraction layer for our various
connection schemes between the method server's URLRobot
and the target server. The connection
factory, in this package, returns the proper derived
class of this parentage.
The usage of this class should look the same for almost all
purposes
Example:
try {
WfURLRobotConnection roboConn = null;
WfURLRobot wur = (WfURLRobot)this; //cast our task robot
roboConn = URLRobotConnectionFactory.createConnection( protocol );
roboConn.setVerboseExecution( VERBOSE_EXECUTION );
roboConn.setSaveResponseMsg( saveResp );
roboConn.openConnection();
switch(protocol) {
case _HTTP_:
switch(method) {
case _PUT_:
case _POST_:
wur.writeHeader();
wur.writeContenet();
wur.writeFooter();
case _GET_:
default:
}
case _FTP_:
default:
}
// Wait for the status to come back indicating
// that indexing is complete.
String accStatus = roboConn.getStatus();
if (!( accStatus.equals(SUCCESS_STATUS))) {
Object args[] = { identity };
throw new FailedURLException( RESOURCE, robotsResource.URL_FAILURE, args );
}
}
finally {
roboConn.closeConnection( );
}
Supported API: true
Extendable: false
- See Also:
wt.index.URLRobotFactory
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_HTTP_
public static final int _HTTP_
- See Also:
- Constant Field Values
_HTTPS_
public static final int _HTTPS_
- See Also:
- Constant Field Values
_FTP_
public static final int _FTP_
- See Also:
- Constant Field Values
_FILE_
public static final int _FILE_
- See Also:
- Constant Field Values
_GET_
public static final int _GET_
- See Also:
- Constant Field Values
_HEAD_
public static final int _HEAD_
- See Also:
- Constant Field Values
_POST_
public static final int _POST_
- See Also:
- Constant Field Values
_PUT_
public static final int _PUT_
- See Also:
- Constant Field Values
protocol
protected int protocol
method
protected int method
verboseExecution
protected boolean verboseExecution
saveResp
protected boolean saveResp
encoding
protected String encoding
RESOURCE
private static final String RESOURCE
- See Also:
- Constant Field Values
WfURLRobotConnection
public WfURLRobotConnection()
openConnection
public abstract void openConnection()
throws FailedURLException
- Throws:
FailedURLException
closeConnection
public abstract void closeConnection()
getResponseCode
public abstract int getResponseCode()
getResponseMsg
public abstract String getResponseMsg()
getContentType
public abstract String getContentType()
getResponseContent
public abstract String getResponseContent()
setMethod
public abstract void setMethod(URL url)
throws FailedURLException
- Throws:
FailedURLException
setProtocol
public abstract void setProtocol(String _protocol)
setVerboseExecution
public void setVerboseExecution(boolean verbose_execution)
setSaveResponseMsg
public void setSaveResponseMsg(boolean save_resp)
getOutputStream
public OutputStream getOutputStream()
throws IOException
- Throws:
IOException