goldengate.ftp.core.session
Class FtpSessionReference

java.lang.Object
  extended by goldengate.ftp.core.session.FtpSessionReference

public class FtpSessionReference
extends Object

Class that allows to retrieve a session when a connection occurs on the Data network based on the InetAddress of the remote client and the InetSocketAddress of the server for Passive and reverse for Active connections. This is particularly useful for Passive mode connection since there is no way to pass the session to the connected channel without this reference.

Author:
Frederic Bregier

Nested Class Summary
 class FtpSessionReference.P2PAddress
          Index of FtpSession References
 
Constructor Summary
FtpSessionReference()
          Constructor
 
Method Summary
 boolean contains(InetAddress ipOnly, InetSocketAddress fullIp)
          Test if the couple of addresses is already in the hashmap (only for Active)
 void delFtpSession(InetAddress ipOnly, InetSocketAddress fullIp)
          Remove the FtpSession from couple of addresses
 FtpSession getActiveFtpSession(org.jboss.netty.channel.Channel channel)
          Return and remove the FtpSession
 FtpSession getPassiveFtpSession(org.jboss.netty.channel.Channel channel)
          Return and remove the FtpSession
 int sessionsNumber()
           
 void setNewFtpSession(InetAddress ipOnly, InetSocketAddress fullIp, FtpSession session)
          Add a session from a couple of addresses
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FtpSessionReference

public FtpSessionReference()
Constructor

Method Detail

setNewFtpSession

public void setNewFtpSession(InetAddress ipOnly,
                             InetSocketAddress fullIp,
                             FtpSession session)
Add a session from a couple of addresses

Parameters:
ipOnly -
fullIp -
session -

getActiveFtpSession

public FtpSession getActiveFtpSession(org.jboss.netty.channel.Channel channel)
Return and remove the FtpSession

Parameters:
channel -
Returns:
the FtpSession if it exists associated to this channel

getPassiveFtpSession

public FtpSession getPassiveFtpSession(org.jboss.netty.channel.Channel channel)
Return and remove the FtpSession

Parameters:
channel -
Returns:
the FtpSession if it exists associated to this channel

delFtpSession

public void delFtpSession(InetAddress ipOnly,
                          InetSocketAddress fullIp)
Remove the FtpSession from couple of addresses

Parameters:
ipOnly -
fullIp -

contains

public boolean contains(InetAddress ipOnly,
                        InetSocketAddress fullIp)
Test if the couple of addresses is already in the hashmap (only for Active)

Parameters:
ipOnly -
fullIp -
Returns:
True if already presents

sessionsNumber

public int sessionsNumber()
Returns:
the number of active sessions


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.