com.pushtotest.tool.protocolhandler
Class FileProtocol

java.lang.Object
  extended by com.pushtotest.tool.protocolhandler.ProtocolWrapper
      extended by com.pushtotest.tool.protocolhandler.FileProtocol
All Implemented Interfaces:
Protocol, java.lang.Runnable

public class FileProtocol
extends ProtocolWrapper

This is an interface that should be implemented to allow Protocol specific access to a web service, etc.


Field Summary
 
Fields inherited from class com.pushtotest.tool.protocolhandler.ProtocolWrapper
body, errno, header, host, name, pass, path, port, proxyHost, proxyPass, proxyPort, proxyUser, query, response, running, scheme, timeout, type, url
 
Fields inherited from interface com.pushtotest.tool.protocolhandler.Protocol
IOERROR, NOERROR, NOTREADY, OTHER, TIMEOUT
 
Constructor Summary
FileProtocol()
           
 
Method Summary
 Response connect()
          Calling this method actually causes the connection to be made.
 java.lang.String id()
          Returns an id for this protocol.
 void send()
          Calling this method actually causes the connection to be made.
 
Methods inherited from class com.pushtotest.tool.protocolhandler.ProtocolWrapper
getBody, getErrno, getHost, getPassword, getResponse, getTimeout, getUrl, getUrl, getURL, getUsername, isRunning, parseUrl, run, setBody, setErrno, setHeader, setHost, setPassword, setPath, setPort, setProxyHost, setProxyPass, setProxyPort, setProxyUser, setQueryString, setScheme, setTimeout, setType, setUrl, setUsername, supports, supportsBody, supportsHeader, supportsResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileProtocol

public FileProtocol()
Method Detail

id

public java.lang.String id()
Returns an id for this protocol. The id is a string that will be used to uniquily identify the protocol. For example :// would be appropriate (without the "://").

Specified by:
id in interface Protocol
Specified by:
id in class ProtocolWrapper
Returns:
The id for this Protocol.

connect

public Response connect()
                 throws NotReadyException,
                        ConnectionTimeoutException,
                        NoSuchClassException,
                        ToolException
Calling this method actually causes the connection to be made. It will do the work of making the connection, gathering the response, etc. This version takes a type param to allow different types of connection to be made with a given Protocol. E.g. an HTTPProtocol could define GET and POST to determine what type of HTTP request it should send.

Specified by:
connect in interface Protocol
Specified by:
connect in class ProtocolWrapper
Parameters:
type - This will allow you to make a Protocol specific switch of the type of connection to make.
Returns:
The response object that is the appropriate type for this Protocol.
Throws:
NotReadyException - If the connect is called without all of the proper pieces set that it needs to connect to the given protocol.
ConnectionTimeoutException - If a timeout was set and that timeout is reached before the connection is completed.
NoSuchClassException
ToolException

send

public void send()
Description copied from class: ProtocolWrapper
Calling this method actually causes the connection to be made. This is the same as the connect() method, however, send is meant for asynchronous calls to a host that does not expect a response value.

Specified by:
send in class ProtocolWrapper