org.jboss.soa.esb.listeners.gateway.remotestrategies
Class ReadOnlyRemoteFileSystemStrategy

java.lang.Object
  extended by org.jboss.soa.esb.listeners.gateway.remotestrategies.ReadOnlyRemoteFileSystemStrategy
All Implemented Interfaces:
RemoteFileSystemStrategy

public class ReadOnlyRemoteFileSystemStrategy
extends java.lang.Object
implements RemoteFileSystemStrategy

Read-only implementation of RemoteFileSystemStrategy.

An instance of this class can be used when a remote file system does not support write operations.

Author:
Daniel Bevenius

Constructor Summary
ReadOnlyRemoteFileSystemStrategy()
           
 
Method Summary
 boolean deleteFile(java.io.File file)
          Do nothing
 void destroy()
          Clean upp anything that needs to be perforemed upon destruction.
 java.io.File[] filterFileList(java.io.File[] files)
          Returns a File[] that only contains files that have not previously been through this method.
 java.util.Map getCacheListeners()
           
 java.io.File getWorkFileName(java.io.File file, java.lang.String suffix)
          This method simply returns the file without a worksuffix.
 void init(java.lang.String configFile)
          Configures and starts the underlying FtpFileCache
 void removeAllData()
           
 boolean renameFile(java.io.File from, java.io.File to)
          Do nothing
 void setCacheListener(java.lang.Class cacheListenerClass)
           
 void setDeleteOnEviction()
           
 void stop()
          Stop of clean upp anything that needs to be perforemed upon shutdown.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyRemoteFileSystemStrategy

public ReadOnlyRemoteFileSystemStrategy()
Method Detail

init

public void init(java.lang.String configFile)
          throws RemoteFileSystemStrategyException
Configures and starts the underlying FtpFileCache

Specified by:
init in interface RemoteFileSystemStrategy
Throws:
RemoteFileSystemStrategyException

deleteFile

public boolean deleteFile(java.io.File file)
                   throws RemoteFileSystemStrategyException
Do nothing

Specified by:
deleteFile in interface RemoteFileSystemStrategy
Parameters:
file - the file to delete. Ignored
Returns:
true always returns true without deleting the filee
Throws:
RemoteFileSystemStrategyException

renameFile

public boolean renameFile(java.io.File from,
                          java.io.File to)
                   throws RemoteFileSystemStrategyException
Do nothing

Specified by:
renameFile in interface RemoteFileSystemStrategy
Parameters:
from - the file to be renamed. Ignored
to - the new file. Ignored
Returns:
true always returns true without deleting the filee
Throws:
RemoteFileSystemStrategyException

getWorkFileName

public java.io.File getWorkFileName(java.io.File file,
                                    java.lang.String suffix)
This method simply returns the file without a worksuffix. This is useful when the remote system does not allow one to rename the file.

Specified by:
getWorkFileName in interface RemoteFileSystemStrategy
Parameters:
file - the file to work with
suffix - the suffix. This will be ignored
Returns:
File the file untouched

filterFileList

public java.io.File[] filterFileList(java.io.File[] files)
                              throws RemoteFileSystemStrategyException
Returns a File[] that only contains files that have not previously been through this method.

Specified by:
filterFileList in interface RemoteFileSystemStrategy
Returns:
File[] list of files that should worked on
Throws:
RemoteFileSystemStrategyException

removeAllData

public void removeAllData()
                   throws org.jboss.cache.CacheException
Throws:
org.jboss.cache.CacheException

stop

public void stop()
Description copied from interface: RemoteFileSystemStrategy
Stop of clean upp anything that needs to be perforemed upon shutdown.

Specified by:
stop in interface RemoteFileSystemStrategy

destroy

public void destroy()
Description copied from interface: RemoteFileSystemStrategy
Clean upp anything that needs to be perforemed upon destruction.

Specified by:
destroy in interface RemoteFileSystemStrategy

setDeleteOnEviction

public void setDeleteOnEviction()

getCacheListeners

public java.util.Map getCacheListeners()

setCacheListener

public void setCacheListener(java.lang.Class cacheListenerClass)
                      throws RemoteFileSystemStrategyException
Throws:
RemoteFileSystemStrategyException