goldengate.ftp.core.utils
Class FtpChannelUtils

java.lang.Object
  extended by goldengate.ftp.core.utils.FtpChannelUtils
All Implemented Interfaces:
Runnable

public class FtpChannelUtils
extends Object
implements Runnable

Some useful functions related to Channel of Netty

Author:
Frederic Bregier

Constructor Summary
FtpChannelUtils(FtpConfiguration configuration)
           
 
Method Summary
static void addCommandChannel(org.jboss.netty.channel.Channel channel, FtpConfiguration configuration)
          Add a command channel into the list
static void addDataChannel(org.jboss.netty.channel.Channel channel, FtpConfiguration configuration)
          Add a data channel into the list
static String get2428Address(InetSocketAddress address)
          Return the (RFC2428) Address in the format compatible with FTP (RFC2428)
static InetSocketAddress get2428InetSocketAddress(String arg)
          Get the (RFC2428) InetSocketAddress corresponding to the FTP format of address (RFC2428)
static String getAddress(InetSocketAddress address)
          Return the Address in the format compatible with FTP argument
static InetSocketAddress getInetSocketAddress(String arg)
          Get the InetSocketAddress corresponding to the FTP format of address
static InetAddress getLocalInetAddress(org.jboss.netty.channel.Channel channel)
          Get the Local InetAddress
static InetSocketAddress getLocalInetSocketAddress(org.jboss.netty.channel.Channel channel)
          Get the Local InetSocketAddress
static InetAddress getRemoteInetAddress(org.jboss.netty.channel.Channel channel)
          Get the Remote InetAddress
static InetSocketAddress getRemoteInetSocketAddress(org.jboss.netty.channel.Channel channel)
          Get the Remote InetSocketAddress
static int nbCommandChannels(FtpConfiguration configuration)
          Return the current number of command connections
static int nbDataChannels(FtpConfiguration configuration)
          Return the current number of data connections
 void run()
           
static void stopLogger()
           
static void teminateServer(FtpConfiguration configuration)
          This function is the top function to be called when the server is to be shutdown.
static int validCommandChannels(FtpConfiguration configuration)
          Return the number of still positive command connections
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FtpChannelUtils

public FtpChannelUtils(FtpConfiguration configuration)
Method Detail

getRemoteInetAddress

public static InetAddress getRemoteInetAddress(org.jboss.netty.channel.Channel channel)
Get the Remote InetAddress

Parameters:
channel -
Returns:
the remote InetAddress

getLocalInetAddress

public static InetAddress getLocalInetAddress(org.jboss.netty.channel.Channel channel)
Get the Local InetAddress

Parameters:
channel -
Returns:
the local InetAddress

getRemoteInetSocketAddress

public static InetSocketAddress getRemoteInetSocketAddress(org.jboss.netty.channel.Channel channel)
Get the Remote InetSocketAddress

Parameters:
channel -
Returns:
the remote InetSocketAddress

getLocalInetSocketAddress

public static InetSocketAddress getLocalInetSocketAddress(org.jboss.netty.channel.Channel channel)
Get the Local InetSocketAddress

Parameters:
channel -
Returns:
the local InetSocketAddress

getInetSocketAddress

public static InetSocketAddress getInetSocketAddress(String arg)
Get the InetSocketAddress corresponding to the FTP format of address

Parameters:
arg -
Returns:
the InetSocketAddress or null if an error occurs

getAddress

public static String getAddress(InetSocketAddress address)
Return the Address in the format compatible with FTP argument

Parameters:
address -
Returns:
the String representation of the address

get2428InetSocketAddress

public static InetSocketAddress get2428InetSocketAddress(String arg)
Get the (RFC2428) InetSocketAddress corresponding to the FTP format of address (RFC2428)

Parameters:
arg -
Returns:
the InetSocketAddress or null if an error occurs

get2428Address

public static String get2428Address(InetSocketAddress address)
Return the (RFC2428) Address in the format compatible with FTP (RFC2428)

Parameters:
address -
Returns:
the String representation of the address

nbCommandChannels

public static int nbCommandChannels(FtpConfiguration configuration)
Return the current number of command connections

Parameters:
configuration -
Returns:
the current number of command connections

nbDataChannels

public static int nbDataChannels(FtpConfiguration configuration)
Return the current number of data connections

Parameters:
configuration -
Returns:
the current number of data connections

validCommandChannels

public static int validCommandChannels(FtpConfiguration configuration)
Return the number of still positive command connections

Parameters:
configuration -
Returns:
the number of positive command connections

teminateServer

public static void teminateServer(FtpConfiguration configuration)
This function is the top function to be called when the server is to be shutdown.

Parameters:
configuration -

addCommandChannel

public static void addCommandChannel(org.jboss.netty.channel.Channel channel,
                                     FtpConfiguration configuration)
Add a command channel into the list

Parameters:
channel -
configuration -

addDataChannel

public static void addDataChannel(org.jboss.netty.channel.Channel channel,
                                  FtpConfiguration configuration)
Add a data channel into the list

Parameters:
channel -
configuration -

run

public void run()
Specified by:
run in interface Runnable

stopLogger

public static void stopLogger()


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