org.apache.camel.component.file.remote
Class RemoteFileProducer<T>

java.lang.Object
  extended by org.apache.camel.support.ServiceSupport
      extended by org.apache.camel.impl.DefaultProducer
          extended by org.apache.camel.component.file.GenericFileProducer<T>
              extended by org.apache.camel.component.file.remote.RemoteFileProducer<T>
All Implemented Interfaces:
org.apache.camel.IsSingleton, org.apache.camel.Processor, org.apache.camel.Producer, org.apache.camel.Service, org.apache.camel.ServicePoolAware, org.apache.camel.ShutdownableService, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

public class RemoteFileProducer<T>
extends org.apache.camel.component.file.GenericFileProducer<T>
implements org.apache.camel.ServicePoolAware

Generic remote file producer for all the FTP variations.


Field Summary
 
Fields inherited from class org.apache.camel.component.file.GenericFileProducer
endpoint, log, operations
 
Fields inherited from class org.apache.camel.support.ServiceSupport
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
 
Constructor Summary
protected RemoteFileProducer(RemoteFileEndpoint<T> endpoint, RemoteFileOperations<T> operations)
           
 
Method Summary
protected  void connectIfNecessary()
           
 void disconnect()
           
protected  void doStart()
           
protected  void doStop()
           
 RemoteFileEndpoint<T> getEndpoint()
           
 String getFileSeparator()
           
protected  RemoteFileOperations<T> getOperations()
           
 void handleFailedWrite(org.apache.camel.Exchange exchange, Exception exception)
          The file could not be written.
 boolean isSingleton()
           
 String normalizePath(String name)
           
 void postWriteCheck()
           
 void preWriteCheck()
           
 void process(org.apache.camel.Exchange exchange)
           
protected  void recoverableConnectIfNecessary()
           
 String toString()
           
 
Methods inherited from class org.apache.camel.component.file.GenericFileProducer
createFileName, createTempFileName, processExchange, setOperations, writeFile
 
Methods inherited from class org.apache.camel.impl.DefaultProducer
createExchange, createExchange, createExchange
 
Methods inherited from class org.apache.camel.support.ServiceSupport
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.camel.Service
start, stop
 

Constructor Detail

RemoteFileProducer

protected RemoteFileProducer(RemoteFileEndpoint<T> endpoint,
                             RemoteFileOperations<T> operations)
Method Detail

getFileSeparator

public String getFileSeparator()
Overrides:
getFileSeparator in class org.apache.camel.component.file.GenericFileProducer<T>

normalizePath

public String normalizePath(String name)
Overrides:
normalizePath in class org.apache.camel.component.file.GenericFileProducer<T>

process

public void process(org.apache.camel.Exchange exchange)
             throws Exception
Specified by:
process in interface org.apache.camel.Processor
Overrides:
process in class org.apache.camel.component.file.GenericFileProducer<T>
Throws:
Exception

getOperations

protected RemoteFileOperations<T> getOperations()

getEndpoint

public RemoteFileEndpoint<T> getEndpoint()
Specified by:
getEndpoint in interface org.apache.camel.Producer
Overrides:
getEndpoint in class org.apache.camel.impl.DefaultProducer

handleFailedWrite

public void handleFailedWrite(org.apache.camel.Exchange exchange,
                              Exception exception)
                       throws Exception
The file could not be written. We need to disconnect from the remote server.

Overrides:
handleFailedWrite in class org.apache.camel.component.file.GenericFileProducer<T>
Throws:
Exception

disconnect

public void disconnect()
                throws org.apache.camel.component.file.GenericFileOperationFailedException
Throws:
org.apache.camel.component.file.GenericFileOperationFailedException

preWriteCheck

public void preWriteCheck()
                   throws Exception
Overrides:
preWriteCheck in class org.apache.camel.component.file.GenericFileProducer<T>
Throws:
Exception

postWriteCheck

public void postWriteCheck()
Overrides:
postWriteCheck in class org.apache.camel.component.file.GenericFileProducer<T>

doStart

protected void doStart()
                throws Exception
Overrides:
doStart in class org.apache.camel.component.file.GenericFileProducer<T>
Throws:
Exception

doStop

protected void doStop()
               throws Exception
Overrides:
doStop in class org.apache.camel.component.file.GenericFileProducer<T>
Throws:
Exception

recoverableConnectIfNecessary

protected void recoverableConnectIfNecessary()
                                      throws Exception
Throws:
Exception

connectIfNecessary

protected void connectIfNecessary()
                           throws org.apache.camel.component.file.GenericFileOperationFailedException
Throws:
org.apache.camel.component.file.GenericFileOperationFailedException

isSingleton

public boolean isSingleton()
Specified by:
isSingleton in interface org.apache.camel.IsSingleton
Overrides:
isSingleton in class org.apache.camel.impl.DefaultProducer

toString

public String toString()
Overrides:
toString in class org.apache.camel.impl.DefaultProducer


Apache Camel