org.nees.data.service.impl
Class FileManagementServiceImpl

java.lang.Object
  extended byorg.nees.data.service.impl.FileManagementServiceImpl
All Implemented Interfaces:
FileManagementServiceInterface, InstantiationContractInterface

public class FileManagementServiceImpl
extends java.lang.Object
implements FileManagementServiceInterface

Author:
USER

Field Summary
 
Fields inherited from interface org.nees.data.service.FileManagementServiceInterface
__CLASS_KEY, __IO_KEY
 
Constructor Summary
FileManagementServiceImpl()
          Creates a new instance of FileManagmentService
 
Method Summary
 void abortDownload(int transferToken)
          \ Public methods \
 void abortUpload(int transferToken)
           
 void append(LogicalName tailLogicalName, int tailVersion, LogicalName headLogicalName, boolean makeNewHeadVersion)
           
 void copy(LogicalName sourceLogicalName, int sourceVersion, LogicalName targetLogicalName, boolean overwrite, boolean makeNewVersion)
           
 void delete(LogicalName sourceLogicalName, int sourceVersion)
           
 void downloadComplete(int transferToken)
           
protected  NFMSBackendInterface getBackend()
           
protected  AuthenticIdentity getCurrentID()
           
protected  FileLocationManager getFLM()
           
 Identifier getID(LogicalName logicalName)
           
 int getLatestAvailableVersion(LogicalName logicalName)
           
protected  NFMSInitObject getNFMSIO()
           
protected  NMDSAdapter getNMDS()
           
protected  PermanentStorageInterface getPStore()
           
 void initialize(java.util.Properties p, InitializationObjectInterface io)
          This method is to fulfill the instantiation contract.
 boolean isDeleted(LogicalName logicalName, int version)
           
 TransferReturnBean requestDownload(LogicalName logicalName, DownloadOptions downloadOptions)
           
 TransferReturnBean requestDownloadWithOptions(LogicalName logicalName, DownloadOptions[] downloadOptions)
           
 TransferReturnBean requestUpload(LogicalName logicalName, UploadOptions uploadOptions)
           
 TransferReturnBean requestUploadWithOptions(LogicalName logicalName, UploadOptions[] uploadOptions)
           
protected  void setSystemProperties(java.util.Properties p, java.lang.String key, java.lang.String defaultValue)
          Just because this is messy, it is a separate method.
 void uploadComplete(int transferToken)
           
protected  UploadOptions uploadCreationLogic(boolean doesFileExist, UploadOptions uo)
          This exists to winnow out goofy conflicting upload options.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileManagementServiceImpl

public FileManagementServiceImpl()
Creates a new instance of FileManagmentService

Method Detail

abortDownload

public void abortDownload(int transferToken)
                   throws NFMSException
\ Public methods \

Specified by:
abortDownload in interface FileManagementServiceInterface
Throws:
NFMSException

abortUpload

public void abortUpload(int transferToken)
                 throws NFMSException
Specified by:
abortUpload in interface FileManagementServiceInterface
Throws:
NFMSException

append

public void append(LogicalName tailLogicalName,
                   int tailVersion,
                   LogicalName headLogicalName,
                   boolean makeNewHeadVersion)
            throws NFMSException
Specified by:
append in interface FileManagementServiceInterface
Throws:
NFMSException

copy

public void copy(LogicalName sourceLogicalName,
                 int sourceVersion,
                 LogicalName targetLogicalName,
                 boolean overwrite,
                 boolean makeNewVersion)
          throws NFMSException
Specified by:
copy in interface FileManagementServiceInterface
Throws:
NFMSException

delete

public void delete(LogicalName sourceLogicalName,
                   int sourceVersion)
            throws NFMSException
Specified by:
delete in interface FileManagementServiceInterface
Throws:
NFMSException

getLatestAvailableVersion

public int getLatestAvailableVersion(LogicalName logicalName)
                              throws NFMSException
Specified by:
getLatestAvailableVersion in interface FileManagementServiceInterface
Throws:
NFMSException

downloadComplete

public void downloadComplete(int transferToken)
                      throws NFMSException
Specified by:
downloadComplete in interface FileManagementServiceInterface
Throws:
NFMSException

initialize

public void initialize(java.util.Properties p,
                       InitializationObjectInterface io)
                throws java.lang.Exception
This method is to fulfill the instantiation contract.

Specified by:
initialize in interface InstantiationContractInterface
Throws:
java.lang.Exception

setSystemProperties

protected void setSystemProperties(java.util.Properties p,
                                   java.lang.String key,
                                   java.lang.String defaultValue)
                            throws NFMSConfigurationException
Just because this is messy, it is a separate method. It will set the grid and user info values. or warn if the defaults are used Note that this is made to intercept null values, so that if there is no entry in a properties file and the default is null, it is assumed that NFMS cannot run without this and an exception will be thrown.

Throws:
NFMSConfigurationException

isDeleted

public boolean isDeleted(LogicalName logicalName,
                         int version)
                  throws NFMSException
Specified by:
isDeleted in interface FileManagementServiceInterface
Throws:
NFMSException

requestDownload

public TransferReturnBean requestDownload(LogicalName logicalName,
                                          DownloadOptions downloadOptions)
                                   throws NFMSException
Specified by:
requestDownload in interface FileManagementServiceInterface
Throws:
NFMSException

requestDownloadWithOptions

public TransferReturnBean requestDownloadWithOptions(LogicalName logicalName,
                                                     DownloadOptions[] downloadOptions)
                                              throws NFMSException
Specified by:
requestDownloadWithOptions in interface FileManagementServiceInterface
Throws:
NFMSException

requestUpload

public TransferReturnBean requestUpload(LogicalName logicalName,
                                        UploadOptions uploadOptions)
                                 throws NFMSException
Specified by:
requestUpload in interface FileManagementServiceInterface
Throws:
NFMSException

requestUploadWithOptions

public TransferReturnBean requestUploadWithOptions(LogicalName logicalName,
                                                   UploadOptions[] uploadOptions)
                                            throws NFMSException
Specified by:
requestUploadWithOptions in interface FileManagementServiceInterface
Throws:
NFMSException

uploadComplete

public void uploadComplete(int transferToken)
                    throws NFMSException
Specified by:
uploadComplete in interface FileManagementServiceInterface
Throws:
NFMSException

getFLM

protected FileLocationManager getFLM()
                              throws NFMSException
Throws:
NFMSException

getNMDS

protected NMDSAdapter getNMDS()
                       throws NFMSException
Throws:
NFMSException

getPStore

protected PermanentStorageInterface getPStore()
                                       throws NFMSException
Throws:
NFMSException

getNFMSIO

protected NFMSInitObject getNFMSIO()

getBackend

protected NFMSBackendInterface getBackend()

getCurrentID

protected AuthenticIdentity getCurrentID()

uploadCreationLogic

protected UploadOptions uploadCreationLogic(boolean doesFileExist,
                                            UploadOptions uo)
                                     throws NFMSException
This exists to winnow out goofy conflicting upload options. If it does not throw an exception, then all should proceed. Only if the file exists and the new file upload flag is set should an exception be thrown. Otherwise, in all cases, make a new file.

Throws:
NFMSException

getID

public Identifier getID(LogicalName logicalName)
                 throws NFMSException
Specified by:
getID in interface FileManagementServiceInterface
Throws:
NFMSException