wttools.protocols.sunp
Class ProtocolImpl

java.lang.Object
  |
  +--wttools.protocols.AbstractProtocol
        |
        +--wttools.protocols.sunp.ProtocolImpl
All Implemented Interfaces:
ProtocolIfc

public class ProtocolImpl
extends AbstractProtocol

Class FTPImpl implements

Version:
$Revision: 1.7 $
Author:
Artur Hefczyc

Fields inherited from class wttools.protocols.AbstractProtocol
allowAllCookies, allowRedirect, allowUserInteraction, bytesDownloaded, clientId, debug, inputBufferSize, keepAlive, requestData, streamReadTimeout, uri, userName, userPassword
 
Fields inherited from interface wttools.protocols.ifc.ProtocolIfc
CODE_BAD_REQUEST, CODE_CONNECTION_ERROR, CODE_CONNECTION_OK, CODE_FORBIDDEN, CODE_HOST_NOT_FOUND, CODE_INTERNAL_SERVER_ERROR, CODE_LENGTH_REQUIRED, CODE_NETWORK_NOT_REACHABLE, CODE_NO_CONTENT, CODE_NOT_FOUND, CODE_NOT_INITIALIZED, CODE_PARTIAL_CONTENT, CODE_REDIRECT, CODE_REQUEST_TIMEOUT, CODE_SERVER_NOT_REACHABLE, CODE_UNAUTHORIZED, CODE_VERSION_NOT_SUPPORTED, METHOD_GET, METHOD_HEAD
 
Constructor Summary
ProtocolImpl()
           
 
Method Summary
 void connect()
          connect method performs
 void disconnect()
          disconnect method performs
 java.util.HashMap getAllHeaders()
          getAllHeaders method performs
 java.lang.Object getConnectionInfo()
          getConnectionInfo method performs
 int getConnectionResult()
          getConnectionResult method performs
 java.util.List getConnectionStatuses()
          getConnectionStatuses method calculates and returns connection statuses in List.
 long getContentLength()
          getContentLength method performs
 java.lang.String getContentType()
          getContentType method performs
 URI getEffectiveURI()
          getEffectiveURI returns effective uri of requested resource.
 long getHeaderIntValue(java.lang.String headerKey)
          getHeaderIntValue method performs
 java.lang.String getHeaderStrValue(java.lang.String headerKey)
          getHeaderStrValue method performs
 java.io.InputStream getInputStream()
          getInputStream method performs
 java.lang.String getProtocolType()
          getProtocolType method performs
 java.lang.String getServerId()
          getServerId method performs
 float getTransferSpeed()
          getTransferSpeed method performs
protected  void initialize()
          initialize method performs
 void setURI(URI v)
          setURI method performs
 
Methods inherited from class wttools.protocols.AbstractProtocol
deb, getClientId, getContentData, getInputBufferSize, getRealContentSize, getRequestData, getStreamReadTimeout, getURI, getUserName, getUserPassword, isAllowAllCookies, isAllowRedirect, isAllowUserInteraction, isDebug, isErrorRecoverable, isKeepAlive, saveContent, saveContent, setAllowAllCookies, setAllowRedirect, setAllowUserInteraction, setClientId, setDebug, setInputBufferSize, setKeepAlive, setRequestData, setStreamReadTimeout, setUserName, setUserPassword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProtocolImpl

public ProtocolImpl()
Method Detail

getConnectionResult

public int getConnectionResult()
                        throws java.io.IOException
getConnectionResult method performs
Returns:
an int value
Throws:
java.io.IOException - if an error occurs

initialize

protected void initialize()
                   throws java.io.IOException
initialize method performs
Throws:
java.io.IOException - if an error occurs

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException
getInputStream method performs
Returns:
Throws:
java.io.IOException - if an error occurs

connect

public void connect()
             throws java.io.IOException
connect method performs
Throws:
java.io.IOException - if an error occurs

disconnect

public void disconnect()
                throws java.io.IOException
disconnect method performs
Throws:
java.io.IOException - if an error occurs

getConnectionInfo

public java.lang.Object getConnectionInfo()
getConnectionInfo method performs
Returns:

getConnectionStatuses

public java.util.List getConnectionStatuses()
Description copied from interface: ProtocolIfc
getConnectionStatuses method calculates and returns connection statuses in List. All objects stored in returned List should have implemented String toString() method to allow displaing info.
As statuses should be put info about transmision: average transfer speed, bytes received, transfer time and so on.
Returns:

getContentType

public java.lang.String getContentType()
getContentType method performs
Returns:
a String value

getContentLength

public long getContentLength()
getContentLength method performs
Returns:
a long value

setURI

public void setURI(URI v)
            throws java.io.IOException
setURI method performs
Overrides:
setURI in class AbstractProtocol
Parameters:
v - an URI value
Throws:
java.io.IOException - if an error occurs

getProtocolType

public java.lang.String getProtocolType()
getProtocolType method performs
Returns:
a String value

getTransferSpeed

public float getTransferSpeed()
getTransferSpeed method performs
Returns:
a float value

getServerId

public java.lang.String getServerId()
getServerId method performs
Returns:
a String value

getHeaderStrValue

public java.lang.String getHeaderStrValue(java.lang.String headerKey)
getHeaderStrValue method performs
Parameters:
headerKey - a String value
Returns:
a String value

getHeaderIntValue

public long getHeaderIntValue(java.lang.String headerKey)
getHeaderIntValue method performs
Overrides:
getHeaderIntValue in class AbstractProtocol
Parameters:
headerKey - a String value
Returns:
a long value

getAllHeaders

public java.util.HashMap getAllHeaders()
getAllHeaders method performs
Returns:
a HashMap value

getEffectiveURI

public URI getEffectiveURI()
                    throws java.io.IOException
Description copied from interface: ProtocolIfc
getEffectiveURI returns effective uri of requested resource. If during connecting to web server redirection response occurs it means that effective URI is different then original.
Following copied from interface: wttools.protocols.ifc.ProtocolIfc
Returns:
an URI value of effective resource URI.


Copyright GNU, wttools developers Team.