dk.netarkivet.common.distribute
Class RemoteFileFactory

java.lang.Object
  extended by dk.netarkivet.common.utils.SettingsFactory<RemoteFile>
      extended by dk.netarkivet.common.distribute.RemoteFileFactory

public class RemoteFileFactory
extends SettingsFactory<RemoteFile>

Factory for creating remote files.


Constructor Summary
RemoteFileFactory()
           
 
Method Summary
static RemoteFile getCopyfileInstance(java.io.File file)
          Same as getInstance(file, false, false, false, null).
static RemoteFile getCopyfileInstance(java.io.File file, RemoteFileSettings connectionParams)
          Same as getInstance(file, false, false, false, connectionParams).
static RemoteFile getDistributefileInstance(java.io.File file)
          Same as getInstance(file, false, false, false).
static RemoteFile getExtendedInstance(org.archive.io.ArchiveRecord record)
          Get an instance connected to an ArchiveRecord.
static RemoteFile getInstance(java.io.File file, boolean useChecksums, boolean fileDeletable, boolean multipleDownloads)
           
static RemoteFile getInstance(java.io.File file, boolean useChecksums, boolean fileDeletable, boolean multipleDownloads, RemoteFileSettings connectionParams)
          Create a remote file that handles the transport of the remote file data.
static RemoteFile getMovefileInstance(java.io.File file)
          Same as getInstance(file, false, true, false).
static boolean isExtendedRemoteFile()
          Returns true iff the defined RemoteFile class has a factory method with signature public static RemoteFile getInstance(ArchiveRecord record)
 
Methods inherited from class dk.netarkivet.common.utils.SettingsFactory
getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteFileFactory

public RemoteFileFactory()
Method Detail

getInstance

public static RemoteFile getInstance(java.io.File file,
                                     boolean useChecksums,
                                     boolean fileDeletable,
                                     boolean multipleDownloads,
                                     RemoteFileSettings connectionParams)
Create a remote file that handles the transport of the remote file data. This method is used by the sender to prepare the transport over JMS.

Parameters:
file - The File object to make accessable on another machine
useChecksums - Whether transfers should be doublechecked with checksums. Added value is access to checksum of objects.
fileDeletable - If true, the local file will be deleted when it is no longer needed.
multipleDownloads - Whether this file should be allowed to be transferred more than once.
Returns:
A RemoteFile instance encapsulating the file argument.

getInstance

public static RemoteFile getInstance(java.io.File file,
                                     boolean useChecksums,
                                     boolean fileDeletable,
                                     boolean multipleDownloads)

getExtendedInstance

public static RemoteFile getExtendedInstance(org.archive.io.ArchiveRecord record)
Get an instance connected to an ArchiveRecord. Records are not deletable so there is no concept of a "movefile" instance.

Parameters:
record -
Returns:
the file to be copied.

isExtendedRemoteFile

public static boolean isExtendedRemoteFile()
Returns true iff the defined RemoteFile class has a factory method with signature public static RemoteFile getInstance(ArchiveRecord record)

Returns:
true if using an extended remote file.

getMovefileInstance

public static RemoteFile getMovefileInstance(java.io.File file)
Same as getInstance(file, false, true, false).

Parameters:
file - The file to move to another computer.

getCopyfileInstance

public static RemoteFile getCopyfileInstance(java.io.File file)
Same as getInstance(file, false, false, false, null).

Parameters:
file - The file to copy to another computer.

getCopyfileInstance

public static RemoteFile getCopyfileInstance(java.io.File file,
                                             RemoteFileSettings connectionParams)
Same as getInstance(file, false, false, false, connectionParams).

Parameters:
file - The file to copy to another computer.

getDistributefileInstance

public static RemoteFile getDistributefileInstance(java.io.File file)
Same as getInstance(file, false, false, false).

Parameters:
file - The file to copy to another computer.