org.nees.data.service.impl
Class NMDSAdapterImpl

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

public class NMDSAdapterImpl
extends AbstractNMDSAdapter


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
 
Constructor Summary
NMDSAdapterImpl()
          Required trivial constructor for instantiation contract.
 
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)
          Answers the question "is this version in the repository exist?"
 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 logicalName, int version)
          Before carrying out a download, a user must be checked for having permission to read the file.
 void hasWritePermission(LogicalName logicalName, int version)
          FIX ME!!
 void initialize(java.util.Properties p, InitializationObjectInterface io)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NMDSAdapterImpl

public NMDSAdapterImpl()
Required trivial constructor for instantiation contract.

Method Detail

getID

public Identifier getID(LogicalName logicalName)

initialize

public void initialize(java.util.Properties p,
                       InitializationObjectInterface io)
                throws java.lang.Exception
Throws:
java.lang.Exception

getPermanentLocationURI

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

Specified by:
getPermanentLocationURI in interface NMDSAdapter
Specified by:
getPermanentLocationURI in class AbstractNMDSAdapter
Throws:
NFMSException

hasReadPermission

public void hasReadPermission(LogicalName logicalName,
                              int version)
                       throws NFMSException
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
Specified by:
hasReadPermission in class AbstractNMDSAdapter
Throws:
NFMSException

hasWritePermission

public void hasWritePermission(LogicalName logicalName,
                               int version)
                        throws NFMSException
FIX ME!!

Specified by:
hasWritePermission in interface NMDSAdapter
Specified by:
hasWritePermission in class AbstractNMDSAdapter
Throws:
NFMSException

addFile

public void addFile(UploadRequestRecord urr)
             throws NFMSException
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
Specified by:
addFile in class AbstractNMDSAdapter
Throws:
NFMSException

deleteFile

public void deleteFile(LogicalName logicalName,
                       int version)
                throws NFMSException
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
Specified by:
deleteFile in class AbstractNMDSAdapter
Throws:
NFMSException

exists

public boolean exists(LogicalName logicalName)
               throws NFMSException
This returns true if the given logical name has an entry in the repository.

Specified by:
exists in interface NMDSAdapter
Specified by:
exists in class AbstractNMDSAdapter
Throws:
NFMSException

getLatestVersionNumber

public int getLatestVersionNumber(LogicalName logicalName)
                           throws NFMSException
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
Specified by:
getLatestVersionNumber in class AbstractNMDSAdapter
Throws:
NFMSException

doesVersionExist

public boolean doesVersionExist(LogicalName logicalName,
                                int version)
                         throws NFMSException
Answers the question "is this version in the repository exist?"

Specified by:
doesVersionExist in interface NMDSAdapter
Specified by:
doesVersionExist in class AbstractNMDSAdapter
Throws:
NFMSException