wt.workflow.robots
Class WfURLRobotConnection

java.lang.Object
  extended bywt.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

Field Summary
static int _FILE_
           
static int _FTP_
           
static int _GET_
           
static int _HEAD_
           
static int _HTTP_
           
static int _HTTPS_
           
static int _POST_
           
static int _PUT_
           
protected  String encoding
           
protected  int method
           
protected  int protocol
           
private static String RESOURCE
           
protected  boolean saveResp
           
protected  boolean verboseExecution
           
 
Constructor Summary
WfURLRobotConnection()
           
 
Method Summary
abstract  void closeConnection()
           
abstract  String getContentType()
           
 OutputStream getOutputStream()
           
abstract  int getResponseCode()
           
abstract  String getResponseContent()
           
abstract  String getResponseMsg()
           
abstract  void openConnection()
           
abstract  void setMethod(URL url)
           
abstract  void setProtocol(String _protocol)
           
 void setSaveResponseMsg(boolean save_resp)
           
 void setVerboseExecution(boolean verbose_execution)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_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
Constructor Detail

WfURLRobotConnection

public WfURLRobotConnection()
Method Detail

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