org.nees.data.service.impl
Class PseudoNMDSAdapterImpl

java.lang.Object
  extended byorg.nees.data.service.impl.PseudoNMDSAdapterImpl
All Implemented Interfaces:
InstantiationContractInterface, NFMSConstants, NMDSAdapter

public class PseudoNMDSAdapterImpl
extends java.lang.Object
implements NMDSAdapter, NFMSConstants

Author:
USER

Field Summary
 
Fields inherited from interface org.nees.data.service.impl.NMDSAdapter
__CLASS_KEY, __IO_KEY, NFMS_LOGICAL_NAME_ID_NAMESPACE, NFMS_LOGICAL_NAME_ID_PREFIX, NMDS_GRID_SERVICE_HANDLE_KEY
 
Fields inherited from interface org.nees.data.service.impl.NFMSConstants
FILE_VERSION_UNAVAILABLE, LATEST_FILE_VERSION, NFMS_DEFAULT_EXPIRATION_TIMEOUT, NFMS_EXPIRATION_TIMEOUT_KEY, NONEXISTENT_FILE_VERSION, PROTOCOL_FILE, PROTOCOL_FTP, PROTOCOL_GRIDFTP, PROTOCOL_HTTP
 
Constructor Summary
PseudoNMDSAdapterImpl()
          Creates a new instance of PseudoNMDSAdapterImpl
 
Method Summary
 void addFile(UploadRequestRecord urr)
          Creates a new file entry from the upload request, setting permissions as needed or versioning if so required by the request.
 void deleteFile(LogicalName logicalName, int version)
          Deletes the specified version of the file.
 boolean doesVersionExist(LogicalName logicalName, int version)
          Available means that this version exists.
 boolean exists(LogicalName logicalName)
          This returns true if the given logical name has an entry in the repository.
 Identifier getID(LogicalName logicalName)
           
 int getLatestVersionNumber(LogicalName logicalName)
          Ask the repository what the most recent version of this file is that is available.
 java.net.URI getPermanentLocationURI(LogicalName ln, int version)
          This will retrieve the valid permanent location for the given file with the given version number.
 void hasReadPermission(LogicalName ln, int version)
          Before carrying out a download, a user must be checked for having permission to read the file.
 void hasWritePermission(LogicalName ln, int version)
          Checks that the user has write permission on the file.
 void initialize(java.util.Properties p, InitializationObjectInterface io)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PseudoNMDSAdapterImpl

public PseudoNMDSAdapterImpl()
Creates a new instance of PseudoNMDSAdapterImpl

Method Detail

addFile

public void addFile(UploadRequestRecord urr)
             throws NFMSException
Description copied from interface: NMDSAdapter
Creates a new file entry from the upload request, setting permissions as needed or versioning if so required by the request. This also sets the physical location.

Specified by:
addFile in interface NMDSAdapter
Throws:
NFMSException

deleteFile

public void deleteFile(LogicalName logicalName,
                       int version)
                throws NFMSException
Description copied from interface: NMDSAdapter
Deletes the specified version of the file. No exception is thrown if the stated version does not exist. All this does is mark it as deleted if there is such a version.

Specified by:
deleteFile in interface NMDSAdapter
Throws:
NFMSException

getLatestVersionNumber

public int getLatestVersionNumber(LogicalName logicalName)
                           throws NFMSException
Description copied from interface: NMDSAdapter
Ask the repository what the most recent version of this file is that is available. The very first version is indexed starting at zero. If there is no available entry, then the value of NFMSConstants.FILE_VERSION_UNAVAILABLE is returned. Note that this version will be the latest, if that is not marked as unavailable.

Specified by:
getLatestVersionNumber in interface NMDSAdapter
Throws:
NFMSException

getPermanentLocationURI

public java.net.URI getPermanentLocationURI(LogicalName ln,
                                            int version)
                                     throws NFMSException
Description copied from interface: NMDSAdapter
This will retrieve the valid permanent location for the given file with the given version number.

Specified by:
getPermanentLocationURI in interface NMDSAdapter
Throws:
NFMSException

initialize

public void initialize(java.util.Properties p,
                       InitializationObjectInterface io)
                throws java.lang.Exception
Specified by:
initialize in interface InstantiationContractInterface
Throws:
java.lang.Exception

exists

public boolean exists(LogicalName logicalName)
               throws NFMSException
Description copied from interface: NMDSAdapter
This returns true if the given logical name has an entry in the repository.

Specified by:
exists in interface NMDSAdapter
Throws:
NFMSException

doesVersionExist

public boolean doesVersionExist(LogicalName logicalName,
                                int version)
                         throws NFMSException
Available means that this version exists.

Specified by:
doesVersionExist in interface NMDSAdapter
Throws:
NFMSException

toString

public java.lang.String toString()

hasReadPermission

public void hasReadPermission(LogicalName ln,
                              int version)
                       throws NFMSException
Description copied from interface: NMDSAdapter
Before carrying out a download, a user must be checked for having permission to read the file. This method will throw an exception if the user fails to have the correct permissions and succeed otherwise.

Specified by:
hasReadPermission in interface NMDSAdapter
Throws:
NFMSException

hasWritePermission

public void hasWritePermission(LogicalName ln,
                               int version)
                        throws NFMSException
Description copied from interface: NMDSAdapter
Checks that the user has write permission on the file. This is needed before certain append or copy operations. This throws an exception if the user fails to have the correct permissions and succeeds otherwise.

Specified by:
hasWritePermission in interface NMDSAdapter
Throws:
NFMSException

getID

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