org.neociclo.accord.odetteftp.camel
Class OdetteOperations

java.lang.Object
  extended by org.neociclo.accord.odetteftp.camel.OdetteOperations
All Implemented Interfaces:
EventListener, OftpletListener, OftpletSpeaker, OftpletEventListener

public class OdetteOperations
extends Object
implements OftpletEventListener


Field Summary
protected  org.apache.commons.logging.Log log
           
 
Constructor Summary
OdetteOperations(OdetteEndpoint odetteEndpoint)
           
 
Method Summary
 StartFileResponse acceptStartFile(VirtualFile incomingFile)
           
 void awaitDisconnect()
           
 void configure(OdetteFtpSession session)
           
 boolean deleteFile(String path)
           
 void deleteTemporaryFileIfNeeded(VirtualFile virtualFile)
           
 void destroy()
           
 boolean existsFile(String absoluteFilePath)
           
protected  org.apache.camel.Exchange findLockedExchange(VirtualFile virtualFile)
           
 boolean hasOutgoingObjects()
           
 void init(OdetteFtpSession session)
           
 boolean isConnected()
           
 OdetteFtpObject nextOftpObjectToSend()
           
 void notifyOfTemporaryFile(VirtualFile virtualFile)
           
 void offer(DeliveryNotification notification)
           
 void offer(VirtualFile payload, org.apache.camel.Exchange lockable)
           
 void onDataReceived(VirtualFile virtualFile, long totalOctetsReceived)
           
 void onDataSent(VirtualFile virtualFile, long totalOctetsSent)
           
 void onExceptionCaught(Throwable cause)
           
 void onNotificationReceived(DeliveryNotification notif)
           
 void onNotificationSent(DeliveryNotification notif)
           
 EndFileResponse onReceiveFileEnd(VirtualFile virtualFile, long recordCount, long unitCount)
           
 void onReceiveFileError(VirtualFile virtualFile, AnswerReasonInfo reason)
           
 void onReceiveFileStart(VirtualFile virtualFile, long answerCount)
           
 void onSendFileEnd(VirtualFile virtualFile)
           
 void onSendFileError(VirtualFile virtualFile, AnswerReasonInfo reason, boolean retryLater)
           
 void onSendFileStart(VirtualFile virtualFile, long answerCount)
           
 void onSessionEnd()
           
 void onSessionStart()
           
 void pollServer()
           Starts polling files and notifications from Odette server.
 void setHasInQueue()
           
 void setHasOutQueue()
           
 boolean storeTempFile(File source, File file, org.apache.camel.Exchange exchange)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected final transient org.apache.commons.logging.Log log
Constructor Detail

OdetteOperations

public OdetteOperations(OdetteEndpoint odetteEndpoint)
                 throws Exception
Throws:
Exception
Method Detail

isConnected

public boolean isConnected()

pollServer

public void pollServer()
                throws Exception

Starts polling files and notifications from Odette server. If Producer has added any file/notification to be sent, will do during this session.

Throws:
Exception
ClientException

awaitDisconnect

public void awaitDisconnect()

setHasInQueue

public void setHasInQueue()

setHasOutQueue

public void setHasOutQueue()

offer

public void offer(DeliveryNotification notification)

offer

public void offer(VirtualFile payload,
                  org.apache.camel.Exchange lockable)

findLockedExchange

protected org.apache.camel.Exchange findLockedExchange(VirtualFile virtualFile)

storeTempFile

public boolean storeTempFile(File source,
                             File file,
                             org.apache.camel.Exchange exchange)

deleteTemporaryFileIfNeeded

public void deleteTemporaryFileIfNeeded(VirtualFile virtualFile)

notifyOfTemporaryFile

public void notifyOfTemporaryFile(VirtualFile virtualFile)

hasOutgoingObjects

public boolean hasOutgoingObjects()

acceptStartFile

public StartFileResponse acceptStartFile(VirtualFile incomingFile)
Specified by:
acceptStartFile in interface OftpletListener

onReceiveFileStart

public void onReceiveFileStart(VirtualFile virtualFile,
                               long answerCount)
Specified by:
onReceiveFileStart in interface OftpletListener

onReceiveFileEnd

public EndFileResponse onReceiveFileEnd(VirtualFile virtualFile,
                                        long recordCount,
                                        long unitCount)
Specified by:
onReceiveFileEnd in interface OftpletListener

onDataSent

public void onDataSent(VirtualFile virtualFile,
                       long totalOctetsSent)
Specified by:
onDataSent in interface OftpletSpeaker

onSendFileEnd

public void onSendFileEnd(VirtualFile virtualFile)
Specified by:
onSendFileEnd in interface OftpletSpeaker

onSendFileError

public void onSendFileError(VirtualFile virtualFile,
                            AnswerReasonInfo reason,
                            boolean retryLater)
Specified by:
onSendFileError in interface OftpletSpeaker

onNotificationReceived

public void onNotificationReceived(DeliveryNotification notif)
Specified by:
onNotificationReceived in interface OftpletListener

nextOftpObjectToSend

public OdetteFtpObject nextOftpObjectToSend()
Specified by:
nextOftpObjectToSend in interface OftpletSpeaker

onSendFileStart

public void onSendFileStart(VirtualFile virtualFile,
                            long answerCount)
Specified by:
onSendFileStart in interface OftpletSpeaker

onNotificationSent

public void onNotificationSent(DeliveryNotification notif)
Specified by:
onNotificationSent in interface OftpletSpeaker

onDataReceived

public void onDataReceived(VirtualFile virtualFile,
                           long totalOctetsReceived)
Specified by:
onDataReceived in interface OftpletListener

onReceiveFileError

public void onReceiveFileError(VirtualFile virtualFile,
                               AnswerReasonInfo reason)
Specified by:
onReceiveFileError in interface OftpletListener

onSessionStart

public void onSessionStart()
Specified by:
onSessionStart in interface OftpletEventListener

onSessionEnd

public void onSessionEnd()
Specified by:
onSessionEnd in interface OftpletEventListener

onExceptionCaught

public void onExceptionCaught(Throwable cause)
Specified by:
onExceptionCaught in interface OftpletEventListener

destroy

public void destroy()
Specified by:
destroy in interface OftpletEventListener

init

public void init(OdetteFtpSession session)
          throws OdetteFtpException
Specified by:
init in interface OftpletEventListener
Throws:
OdetteFtpException

existsFile

public boolean existsFile(String absoluteFilePath)

deleteFile

public boolean deleteFile(String path)

configure

public void configure(OdetteFtpSession session)
Specified by:
configure in interface OftpletEventListener


ACCORD