goldengate.ftp.core.config
Class FtpInternalConfiguration

java.lang.Object
  extended by goldengate.ftp.core.config.FtpInternalConfiguration

public class FtpInternalConfiguration
extends Object

Internal configuration of the FTP server, related to Netty

Author:
Frederic Bregier

Nested Class Summary
 class FtpInternalConfiguration.BindAddress
           
 
Field Summary
static int BUFFERSIZEDEFAULT
          Default size for buffers (NIO)
static Boolean ISUNIX
          Hack to say Windows or Unix (USR1 not OK on Windows)
static long RETRYINMS
          Time elapse for retry in ms
static int RETRYNB
          Number of retry before error
static long WAITFORNETOP
          Time elapse for WRITE OR CLOSE WAIT elaps in ms
 
Constructor Summary
FtpInternalConfiguration(FtpConfiguration configuration)
          Constructor
 
Method Summary
 void bindPassive(InetSocketAddress address)
          Try to add a Passive Channel listening to the specified local address
 void delFtpSession(InetAddress ipOnly, InetSocketAddress fullIp)
          Remove the FtpSession
 org.jboss.netty.bootstrap.ClientBootstrap getActiveBootstrap()
           
 org.jboss.netty.channel.ChannelFactory getCommandChannelFactory()
           
 org.jboss.netty.channel.group.ChannelGroup getCommandChannelGroup()
           
 org.jboss.netty.channel.ChannelFactory getDataActiveChannelFactory()
           
 org.jboss.netty.channel.group.ChannelGroup getDataChannelGroup()
           
 org.jboss.netty.channel.ChannelFactory getDataPassiveChannelFactory()
           
 org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor getDataPipelineExecutor()
          Return the associated PipelineExecutor for Data Pipeline
 FtpSession getFtpSession(org.jboss.netty.channel.Channel channel, boolean active)
          Return and remove the FtpSession
 org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler getGlobalTrafficShapingHandler()
           
 int getNbBindedPassive()
           
 int getNumberSessions()
           
 org.jboss.netty.util.ObjectSizeEstimator getObjectSizeEstimator()
           
 org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor getPipelineExecutor()
          Return the associated PipelineExecutor for Command Pipeline
 ExecutorService getWorker()
           
 boolean hasFtpSession(InetAddress ipOnly, InetSocketAddress fullIp)
          Test if the couple of addresses is already in the context
 org.jboss.netty.handler.traffic.ChannelTrafficShapingHandler newChannelTrafficShapingHandler()
           
 void releaseResources()
           
 void serverStartup()
          Startup the server
 void setNewFtpSession(InetAddress ipOnly, InetSocketAddress fullIp, FtpSession session)
          Add a session from a couple of addresses
 void unbindPassive(InetSocketAddress address)
          Try to unbind (closing the parent channel) the Passive Channel listening to the specified local address if the last one.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RETRYINMS

public static final long RETRYINMS
Time elapse for retry in ms

See Also:
Constant Field Values

RETRYNB

public static final int RETRYNB
Number of retry before error

See Also:
Constant Field Values

WAITFORNETOP

public static final long WAITFORNETOP
Time elapse for WRITE OR CLOSE WAIT elaps in ms

See Also:
Constant Field Values

ISUNIX

public static Boolean ISUNIX
Hack to say Windows or Unix (USR1 not OK on Windows)


BUFFERSIZEDEFAULT

public static final int BUFFERSIZEDEFAULT
Default size for buffers (NIO)

See Also:
Constant Field Values
Constructor Detail

FtpInternalConfiguration

public FtpInternalConfiguration(FtpConfiguration configuration)
Constructor

Parameters:
configuration -
Method Detail

serverStartup

public void serverStartup()
Startup the server


getWorker

public ExecutorService getWorker()
Returns:
an ExecutorService

setNewFtpSession

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

Parameters:
ipOnly -
fullIp -
session -

getFtpSession

public FtpSession getFtpSession(org.jboss.netty.channel.Channel channel,
                                boolean active)
Return and remove the FtpSession

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

delFtpSession

public void delFtpSession(InetAddress ipOnly,
                          InetSocketAddress fullIp)
Remove the FtpSession

Parameters:
ipOnly -
fullIp -

hasFtpSession

public boolean hasFtpSession(InetAddress ipOnly,
                             InetSocketAddress fullIp)
Test if the couple of addresses is already in the context

Parameters:
ipOnly -
fullIp -
Returns:
True if the couple is present

getNumberSessions

public int getNumberSessions()
Returns:
the number of Active Sessions

bindPassive

public void bindPassive(InetSocketAddress address)
                 throws goldengate.common.command.exception.Reply425Exception
Try to add a Passive Channel listening to the specified local address

Parameters:
address -
Throws:
goldengate.common.command.exception.Reply425Exception - in case the channel cannot be opened

unbindPassive

public void unbindPassive(InetSocketAddress address)
Try to unbind (closing the parent channel) the Passive Channel listening to the specified local address if the last one. It returns only when the underlying parent channel is closed if this was the last session that wants to open on this local address.

Parameters:
address -

getNbBindedPassive

public int getNbBindedPassive()
Returns:
the number of Binded Passive Connections

getPipelineExecutor

public org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor getPipelineExecutor()
Return the associated PipelineExecutor for Command Pipeline

Returns:
the Command Pipeline Executor

getDataPipelineExecutor

public org.jboss.netty.handler.execution.OrderedMemoryAwareThreadPoolExecutor getDataPipelineExecutor()
Return the associated PipelineExecutor for Data Pipeline

Returns:
the Data Pipeline Executor

getActiveBootstrap

public org.jboss.netty.bootstrap.ClientBootstrap getActiveBootstrap()
Returns:
the ActiveBootstrap

getCommandChannelFactory

public org.jboss.netty.channel.ChannelFactory getCommandChannelFactory()
Returns:
the commandChannelFactory

getCommandChannelGroup

public org.jboss.netty.channel.group.ChannelGroup getCommandChannelGroup()
Returns:
the commandChannelGroup

getDataPassiveChannelFactory

public org.jboss.netty.channel.ChannelFactory getDataPassiveChannelFactory()
Returns:
the dataPassiveChannelFactory

getDataActiveChannelFactory

public org.jboss.netty.channel.ChannelFactory getDataActiveChannelFactory()
Returns:
the dataActiveChannelFactory

getDataChannelGroup

public org.jboss.netty.channel.group.ChannelGroup getDataChannelGroup()
Returns:
the dataChannelGroup

getObjectSizeEstimator

public org.jboss.netty.util.ObjectSizeEstimator getObjectSizeEstimator()
Returns:
the objectSizeEstimator

getGlobalTrafficShapingHandler

public org.jboss.netty.handler.traffic.GlobalTrafficShapingHandler getGlobalTrafficShapingHandler()
Returns:
The TrafficCounterFactory

newChannelTrafficShapingHandler

public org.jboss.netty.handler.traffic.ChannelTrafficShapingHandler newChannelTrafficShapingHandler()
Returns:
a new ChannelTrafficShapingHandler

releaseResources

public void releaseResources()


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