jpl.mipl.mdms.FileService.komodo.api
Class VFT

java.lang.Object
  extended by jpl.mipl.mdms.FileService.komodo.api.VFT

public class VFT
extends Object

This class contains all actions that can be take on a VFT by a user.

Version:
$Id: VFT.java,v 1.10 2004/12/03 01:06:33 txh Exp $
Author:
J. Jacobson, G. Turek, T. Huang

Constructor Summary
VFT(Session session, boolean mustBeAdmin)
          Constructor
 
Method Summary
 int addRef(String vft, String reference, String link, String comment)
          Method to create the a reference in the supplied vft.
 int addVFT(String vft, String title, boolean notify)
          Method to add a vft to the database.
 int addVFTReader(String vft, String user)
          Method to add vft reader
 int cancelReference(String vft, String reference)
          Method to cancel a reference change before doing a vft update.
 int close()
          Method to close this vft channel.
 int deleteRef(String vft, String ref)
          Method to delete the a reference within the supplied virtual file type
 int deleteVFT(String vft)
          Method to delete a the current virutal file type
 int delVFTReader(String vft, String user)
          Method to remove a reader from the supplied vft
 int getReference(String vft, String reference)
          Method to get the file associated with a virtual file type reference.
 int getReferenceAt(String vft, String reference, Date datetime)
          Method to get the file associated with a virtual file type reference at a specified date.
 String getServerName()
          Accessor method to return the vft server name
 int getVFT(String vft)
          Method to get all files associated with a VFT.
 int getVFTAt(String vft, Date datetime)
          Method to get all files that were associated with a VFT at a particular date.
 int setReference(String vft, String reference, String fileType, String fileName)
          Method to set a reference to point to a new file on next vftUpdate.
 int showReference(String vft, String ref, Date datetime)
          Method to show information about the supplied vft references.
 int showVFT(String vft, Date datetime)
          Method to show information about the supplied vft.
 int showVFTReaders(String vft, String user)
          Method to show readers allowed to access the supplied vft.
 int update(String vft, String comment)
          Method to update the current VFT.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VFT

public VFT(Session session,
           boolean mustBeAdmin)
    throws SessionException
Constructor

Parameters:
session - a transfer session, for maintining file types and connections.
mustBeAdmin - if true, connect on admin port
Throws:
SessionException - when session failure
Method Detail

getServerName

public final String getServerName()
Accessor method to return the vft server name

Returns:
the vft server name

getVFT

public final int getVFT(String vft)
                 throws SessionException
Method to get all files associated with a VFT. Thes files are placed under the current directory and take the name of the reference. If files already exist, new files follow the file-replace policy set by Session options. See Session.setOption().

Parameters:
vft - the virtual file type
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

getVFTAt

public final int getVFTAt(String vft,
                          Date datetime)
                   throws SessionException
Method to get all files that were associated with a VFT at a particular date. These files are placed under the current directory and take the name of the reference. If files already exist, new files follow the file-replace policy set by Session options. See Session.setOption().

Parameters:
vft - the virtual file type
datetime - the date these files were in effect.
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

getReference

public final int getReference(String vft,
                              String reference)
                       throws SessionException
Method to get the file associated with a virtual file type reference.

Parameters:
vft - the vitual file type
reference - the reference name
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

getReferenceAt

public final int getReferenceAt(String vft,
                                String reference,
                                Date datetime)
                         throws SessionException
Method to get the file associated with a virtual file type reference at a specified date.

Parameters:
vft - the virtual file type
reference - the reference name
datetime - the date filter
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

setReference

public final int setReference(String vft,
                              String reference,
                              String fileType,
                              String fileName)
                       throws SessionException
Method to set a reference to point to a new file on next vftUpdate.

Parameters:
vft - the virtual file type
reference - the reference name
fileType - the name of file type
fileName - the name of file to reference
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

showVFT

public final int showVFT(String vft,
                         Date datetime)
                  throws SessionException
Method to show information about the supplied vft. If vft is null, show information about all vfts. If date is not null, show information for the supplied date time.

Parameters:
vft - the virtual file type
datetime - the optional date filter
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

showReference

public final int showReference(String vft,
                               String ref,
                               Date datetime)
                        throws SessionException
Method to show information about the supplied vft references. If ref is null, show information about all the vft's references. If date is not null, show information for the supplied date time.

Parameters:
vft - the virtual file type
ref - the reference name
datetime - the optional date filter
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

cancelReference

public final int cancelReference(String vft,
                                 String reference)
                          throws SessionException
Method to cancel a reference change before doing a vft update.

Parameters:
vft - the virtual file type
reference - the reference name
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

addVFTReader

public final int addVFTReader(String vft,
                              String user)
                       throws SessionException
Method to add vft reader

Parameters:
vft - the virtual file type
user - the vft reader name
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

showVFTReaders

public final int showVFTReaders(String vft,
                                String user)
                         throws SessionException
Method to show readers allowed to access the supplied vft.

Parameters:
vft - the virtual file type
user - the vft reader name
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

delVFTReader

public final int delVFTReader(String vft,
                              String user)
                       throws SessionException
Method to remove a reader from the supplied vft

Parameters:
vft - the virtual file type
user - the vft reader.
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

close

public final int close()
Method to close this vft channel. Do this by appending the close command at the head of the requests queue. The ServerProxy will then remove any admin requests for from the request queue. If all references, file types and admin for this server have been closed, then the connection to the server will be gracefully closed.

Returns:
the transaction id for tracking this command.

addVFT

public final int addVFT(String vft,
                        String title,
                        boolean notify)
                 throws SessionException
Method to add a vft to the database. This VFT will be created on the server associated with this file type.

Parameters:
vft - the virtual file type
title - the optional title, may be null.
notify - if true, notify a list of email addresses on update vft
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

deleteVFT

public final int deleteVFT(String vft)
                    throws SessionException
Method to delete a the current virutal file type

Parameters:
vft - the virtual file type
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

addRef

public final int addRef(String vft,
                        String reference,
                        String link,
                        String comment)
                 throws SessionException
Method to create the a reference in the supplied vft.

Parameters:
vft - the virtual file type
reference - new reference name
link - the optional link
comment - the optional comment
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

deleteRef

public final int deleteRef(String vft,
                           String ref)
                    throws SessionException
Method to delete the a reference within the supplied virtual file type

Parameters:
vft - the virtual file type
ref - the reference name
Returns:
the transaction id for tracking this command.
Throws:
SessionException - when session failure

update

public final int update(String vft,
                        String comment)
Method to update the current VFT.

Parameters:
vft - the virtual file type
comment - the optional comment (may be null)
Returns:
the transaction id for tracking this command.