org.fossilec.odettej
Class Session

java.lang.Object
  extended by org.fossilec.odettej.Session

public final class Session
extends java.lang.Object

The Session class represents a session between Odette FTP entities and is not subclassed.

Author:
Rafael Marins

Method Summary
 OdetteFTPEntity acceptConnection(Transport transport)
           
 OdetteFTPEntity connect(java.lang.String address, java.lang.String userCode, java.lang.String password)
           
 TransferMode getCapableTransferMode()
           
static Session getInstance(java.util.Properties props)
          Get a new Session object.
static Session getInstance(java.util.Properties props, boolean restart)
           
static Session getInstance(java.util.Properties props, TransferMode mode)
           
static Session getInstance(java.util.Properties props, TransferMode mode, boolean restart)
           
 int getMaxBuffer()
           
 int getMaxWindow()
           
 java.util.Properties getProperties()
           
 java.lang.String getProperty(java.lang.String key)
          Searches for the property with the specified key in local constants and session property list.
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
          Searches for the property with the specified key in local constants and session property list.
 Service getService()
           
 boolean isCompressionCapable()
           
 boolean isRestartCapable()
           
 void setAuthenticator(PeerAuthenticator provider)
           
 java.lang.Object setProperty(java.lang.String key, java.lang.String value)
          Set a property in Session and return the previous property value.
 void setReceivingSupport(ListenerTemplate provider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static Session getInstance(java.util.Properties props)
Get a new Session object.

Parameters:
props - Properties object that holds relevant properties.
Returns:
A new Session object.

getInstance

public static Session getInstance(java.util.Properties props,
                                  TransferMode mode)

getInstance

public static Session getInstance(java.util.Properties props,
                                  boolean restart)

getInstance

public static Session getInstance(java.util.Properties props,
                                  TransferMode mode,
                                  boolean restart)

getMaxBuffer

public int getMaxBuffer()

getMaxWindow

public int getMaxWindow()

isCompressionCapable

public boolean isCompressionCapable()

isRestartCapable

public boolean isRestartCapable()

getCapableTransferMode

public TransferMode getCapableTransferMode()
                                    throws OdetteFTPException
Throws:
OdetteFTPException

setReceivingSupport

public void setReceivingSupport(ListenerTemplate provider)

setAuthenticator

public void setAuthenticator(PeerAuthenticator provider)

getService

public Service getService()

getProperty

public java.lang.String getProperty(java.lang.String key)
Searches for the property with the specified key in local constants and session property list. If it is not found, the default property value is returned. This method return null if the property is not found.

Parameters:
key - Key name of the property.
Returns:
The value of this property by the specified key.

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Searches for the property with the specified key in local constants and session property list. If it is not found, the default property value is returned. This method return the specified default value if the property is not found.

Parameters:
key - Key name of the property.
defaultValue - Default value which is returned.
Returns:
The value of this property by the specified key.

setProperty

public java.lang.Object setProperty(java.lang.String key,
                                    java.lang.String value)
Set a property in Session and return the previous property value. Giving a null value remove the existing property if exists.
If the specified key correspond to any local constant this method will set nothing and return null.

Parameters:
key - Key name of the property.
value - The value attribute to the specified key.
Returns:
Previous value of the specified property, or null if it did not have one.

getProperties

public java.util.Properties getProperties()

acceptConnection

public OdetteFTPEntity acceptConnection(Transport transport)
                                 throws OdetteFTPException
Throws:
OdetteFTPException

connect

public OdetteFTPEntity connect(java.lang.String address,
                               java.lang.String userCode,
                               java.lang.String password)
                        throws OdetteFTPException
Throws:
OdetteFTPException


Copyright © 2005 ObjectWeb Consortium. All Rights Reserved.