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

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

public class Result
extends Object

Result class maintains information about individual files.

Version:
$Id: Result.java,v 1.27 2008/04/21 19:30:34 ntt Exp $
Author:
Jeff Jacobson, G. Turek

Constructor Summary
Result(int ftId, String name, String contributor, long size, String qaRelease, byte[] checksum, String note)
          Constructor
Result(int ftId, String name, String contributor, long size, String qaRelease, byte[] checksum, String note, String serverGroup, String fileType, int transId)
          Constructor
Result(jpl.mipl.mdms.FileService.komodo.api.Request request, int errno, String message)
          Constructor
Result(jpl.mipl.mdms.FileService.komodo.api.Request request, String name)
          Constructor
Result(jpl.mipl.mdms.FileService.komodo.api.Request request, String name, long size)
          Constructor
Result(jpl.mipl.mdms.FileService.komodo.api.Request request, String name, long size, Date datetime)
          Constructor
Result(String name, long size)
          Constructor
Result(String vft, String title, String comment, String createdBy, String created, String updatedBy, String updated)
          Constructor for vft information.
Result(String vft, String refName, String refLink, String refFileType, String refFileName, String comment, String updateFileType, String updateFileName, boolean updateRef)
          Constructor for vft reference information.
 
Method Summary
 void commit()
          Method to commit a transaction into the restart file.
 String getArchiveNote()
          Method to return the archive note
 byte[] getChecksum()
          Method to get the file's checksum.
 String getChecksumStr()
          Method to return the checksum string
 String getComment()
          Method to return the comment
 String getCreated()
          Method to get file/vft create time
 String getCreatedBy()
          Method to get vft the name of the agent that created the VFT.
 Date getDate()
          Deprecated. Use getFileModificationTime
 int getErrno()
          Method to get errno for this result
 byte[] getFileBuffer()
          Method to get file buffer
 long getFileBufferSize()
          Method to get file buffer size
 String getFileContributor()
          Method to get contributor name
 Date getFileCreationTime()
          Method to get file creation time
 long getFileId()
          Method to return file id
 Date getFileModificationTime()
          Method to get file's date
 int getFtId()
          Method to get file's internal DBMS id for the file type.
 String getLocalLocation()
          Method to return local file location
 String getMessage()
          Method to return message with time stamp
 String getName()
          Method to get file name
 String getNote()
          Method to return the associated note
 String getQaRelease()
          Method to get the qaDate.
 int getReceiptId()
          Method to return the receipt ID
 String getRefFileName()
          Method to get vft reference file name
 String getRefFileType()
          Method to get vft reference file type
 String getRefLink()
          Method to get vft reference location
 String getRefName()
          Method to get vft reference name
 String getRemoteLocation()
          Method to return file local location
 String getServerGroup()
          Method to return the request server group
 long getSize()
          Method to get file size
 String getTitle()
          Method to return the title
 int getTransactionId()
          Method to get transaction id
 String getType()
          Method to return the request file type
 String getUpdated()
          Method to get vft update time
 String getUpdatedBy()
          Method to get the name of the agent that updated the file/VFT.
 String getUpdateFileName()
          Method to get vft update file name.
 String getUpdateFileType()
          Method to get the file type of the next reference.
 String getVFTHeader()
          Build a VFT header, using all ancillary information.
 String getVFTName()
          Method to get vft name
 boolean secure()
          Was the file transfered is secure mode?
 void setChecksum(byte[] checksum)
          Method to set checksum byte array
 void setChecksum(String checksum)
          Method to set checksum value
 void setClientRestartCache(ClientRestartCache restartCache)
          Method to set restart file
 void setComment(String comment)
          Method to set comment
 void setCreated(String created)
          Method to set file/vft createt time
 void setDate(Date date)
          Deprecated. Use setFileModificationTimeString
 void setFileBuffer(byte[] fileBuffer)
          Method to set file buffer
 void setFileContributor(String contributor)
          Method to set the file contributor name
 void setFileCreationTime(Date created)
          Method to set file creation time
 void setFileId(long fileId)
          Method to set file id
 void setFileModificationTime(Date date)
          Method to set date string.
 void setFtId(int ftId)
          Method to set file's internal DBMS id for the file type.
 void setLocalLocation(String location)
          Method to set local file location
 void setName(String name)
          Method to set file name string.
 void setNote(String note)
          Method to set the associated note
 void setRefFileName(String refFileName)
          Method to set reference file name
 void setRefFileType(String refFileType)
          Method to set ref file type
 void setRefName(String refName)
          Method to set vft reference name
 void setRemoteLocation(String location)
          Method to set file remote location
 void setServerGroup(String serverGroup)
           
 void setSize(long size)
          Method to set file size
 void setType(String fileType)
          Method to set the request file type.
 void setUpdatedBy(String updatedBy)
          Method to set the name of the agent that updated the file/vft
 boolean updateRef()
          Method to return true if an update is pending on this reference.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Result

public Result(String name,
              long size)
Constructor

Parameters:
name - the file's name.
size - the size of the file in bytes.

Result

public Result(jpl.mipl.mdms.FileService.komodo.api.Request request,
              String name)
Constructor

Parameters:
request - the request information, includes, command, type, transaction id.
name - the file's name.

Result

public Result(jpl.mipl.mdms.FileService.komodo.api.Request request,
              String name,
              long size)
Constructor

Parameters:
request - the request information, includes type, transaction id.
name - the file's name.
size - the size of the file in bytes.

Result

public Result(jpl.mipl.mdms.FileService.komodo.api.Request request,
              String name,
              long size,
              Date datetime)
Constructor

Parameters:
request - the request information, includes type, transaction id.
name - the file's name.
size - the size of the file in bytes.
datetime - the file's modification date.

Result

public Result(jpl.mipl.mdms.FileService.komodo.api.Request request,
              int errno,
              String message)
Constructor

Parameters:
request - the request information, includes type, transaction id.
errno - the error status for this file.
message - an error message.

Result

public Result(int ftId,
              String name,
              String contributor,
              long size,
              String qaRelease,
              byte[] checksum,
              String note,
              String serverGroup,
              String fileType,
              int transId)
Constructor

Parameters:
ftId - the internal DBMS id for the file type.
name - the file's name.
contributor - user name of the file's contributor.
size - the file's size in bytes.
qaRelease - the date the file becomes available to the public?
checksum - the file's checksum.
note - a note, or message associated with the file.
serverGroup -
fileType - file type
transId - transaction id

Result

public Result(int ftId,
              String name,
              String contributor,
              long size,
              String qaRelease,
              byte[] checksum,
              String note)
Constructor

Parameters:
ftId - the internal DBMS id for the file type.
name - the file's name.
contributor - user name of the file's contributor.
size - the file's size in bytes.
qaRelease - the date the file becomes available to the public?
checksum - the file's checksum.
note - a note, or message associated with the file.

Result

public Result(String vft,
              String refName,
              String refLink,
              String refFileType,
              String refFileName,
              String comment,
              String updateFileType,
              String updateFileName,
              boolean updateRef)
Constructor for vft reference information.

Parameters:
vft - the virtual file type name
refName - the reference name
refLink - the reference link
refFileType - the reference file type
refFileName - the reference file name
comment - the reference comment
updateFileType - the update reference file type
updateFileName - the update reference file name
updateRef - the update reference flag. Is an update pending?

Result

public Result(String vft,
              String title,
              String comment,
              String createdBy,
              String created,
              String updatedBy,
              String updated)
Constructor for vft information. Used for both current vfts and vft history.

Parameters:
vft - the virtual file type name.
title - the title of the virtual file type.
comment - the comment assoicated with the last update.
createdBy - the agent that created the vft
created - the time vft was created
updatedBy - the agent that updated the vft.
updated - the time of update.
Method Detail

setClientRestartCache

public void setClientRestartCache(ClientRestartCache restartCache)
Method to set restart file

Parameters:
restartInfo - the restart file name for commit.

getMessage

public final String getMessage()
Method to return message with time stamp

Returns:
message associated with this transaction

setComment

public void setComment(String comment)
Method to set comment

Parameters:
comment - the comment associated with this file

getComment

public final String getComment()
Method to return the comment

Returns:
comment associated with this file

getTitle

public final String getTitle()
Method to return the title

Returns:
comment associated with this file

getReceiptId

public final int getReceiptId()
Method to return the receipt ID

Returns:
receipt id associated with this file

getArchiveNote

public final String getArchiveNote()
Method to return the archive note

Returns:
archive note for this file.

getErrno

public final int getErrno()
Method to get errno for this result

Returns:
the errno of a result.

getType

public String getType()
Method to return the request file type

Returns:
file type associated with this transaction

setType

public void setType(String fileType)
Method to set the request file type.

Parameters:
fileType - filetype associated with this transaction

getServerGroup

public String getServerGroup()
Method to return the request server group

Returns:
the server group associated with this transaction

setServerGroup

public void setServerGroup(String serverGroup)

getTransactionId

public int getTransactionId()
Method to get transaction id

Returns:
the transaction id of the request. If this returns -1, and error has occurred.

getVFTName

public final String getVFTName()
Method to get vft name

Returns:
the vft name

getCreatedBy

public final String getCreatedBy()
Method to get vft the name of the agent that created the VFT.

Returns:
the vft creator name

getCreated

public final String getCreated()
Method to get file/vft create time

Returns:
the file/vft created time

setCreated

public final void setCreated(String created)
Method to set file/vft createt time

Parameters:
created - the file/vft create time

getUpdatedBy

public final String getUpdatedBy()
Method to get the name of the agent that updated the file/VFT.

Returns:
the agent that updated the vft

setUpdatedBy

public final void setUpdatedBy(String updatedBy)
Method to set the name of the agent that updated the file/vft

Parameters:
updatedBy - the agent's name

getUpdated

public final String getUpdated()
Method to get vft update time

Returns:
the vft created time

getRefName

public final String getRefName()
Method to get vft reference name

Returns:
the vft reference name

setRefName

public final void setRefName(String refName)
Method to set vft reference name

Parameters:
refName - the reference name string.

getRefFileName

public final String getRefFileName()
Method to get vft reference file name

Returns:
the vft reference file name.

setRefFileName

public final void setRefFileName(String refFileName)
Method to set reference file name

Parameters:
refFileName - reference file name string.

getRefFileType

public final String getRefFileType()
Method to get vft reference file type

Returns:
the vft reference file type.

setRefFileType

public final void setRefFileType(String refFileType)
Method to set ref file type

Parameters:
refFileType - the reference file type string.

getVFTHeader

public String getVFTHeader()
Build a VFT header, using all ancillary information. If this header does not fill the bill, use getVFTName(), getCreatedBy(), etc.

Returns:
null if vft not defined in this result.

updateRef

public final boolean updateRef()
Method to return true if an update is pending on this reference. If so, then use getUpdateFileName () and getUpdateFileType () for the details.

Returns:
update pending flag.

getUpdateFileName

public final String getUpdateFileName()
Method to get vft update file name. If this is null, and an update is pending, then the this reference will be set to null at the next update vft. If not null, then the reference is to be set to this file at the next updateVFT.

Returns:
the references next file name.

getUpdateFileType

public final String getUpdateFileType()
Method to get the file type of the next reference.

Returns:
file type name

getRefLink

public final String getRefLink()
Method to get vft reference location

Returns:
the vft reference location.

getName

public final String getName()
Method to get file name

Returns:
the file name

setName

public final void setName(String name)
Method to set file name string.

Parameters:
name - the file name string.

getSize

public final long getSize()
Method to get file size

Returns:
the file size

getFileBufferSize

public long getFileBufferSize()
Method to get file buffer size

Returns:
the file buffer size, or zero if there is no in-memory file.

getFileBuffer

public final byte[] getFileBuffer()
Method to get file buffer

Returns:
a byte array, the contents of a file.

setFileBuffer

public final void setFileBuffer(byte[] fileBuffer)
Method to set file buffer

Parameters:
fileBuffer - the buffer containing file.

setSize

public final void setSize(long size)
Method to set file size

Parameters:
size - the file size

getDate

public final Date getDate()
Deprecated. Use getFileModificationTime

Method to get file's date

Returns:
the file's date

getFileModificationTime

public final Date getFileModificationTime()
Method to get file's date

Returns:
the file's date

setDate

public final void setDate(Date date)
Deprecated. Use setFileModificationTimeString

Method to set date string.

Parameters:
date - the date string.

setFileModificationTime

public final void setFileModificationTime(Date date)
Method to set date string.

Parameters:
date - the date string.

getFtId

public final int getFtId()
Method to get file's internal DBMS id for the file type.

Returns:
file's internal DBMS id for the file type.

setFtId

public final void setFtId(int ftId)
Method to set file's internal DBMS id for the file type.

Parameters:
ftId - the file's internal DBMS id for the file type.

getFileContributor

public final String getFileContributor()
Method to get contributor name

Returns:
the contributor's name

setFileContributor

public final void setFileContributor(String contributor)
Method to set the file contributor name

Parameters:
contributor - the file contributor

getFileCreationTime

public final Date getFileCreationTime()
Method to get file creation time

Returns:
creation time string

setFileCreationTime

public final void setFileCreationTime(Date created)
Method to set file creation time

Parameters:
created - file creation time

getQaRelease

public final String getQaRelease()
Method to get the qaDate.

Returns:
the date the file becomes available to the public?

getChecksum

public final byte[] getChecksum()
Method to get the file's checksum.

Returns:
the file's checksum byte array

secure

public boolean secure()
Was the file transfered is secure mode?

Returns:
true if checksum was applied during add, replace or get.

getChecksumStr

public String getChecksumStr()
Method to return the checksum string

Returns:
the file's checksum, as a hex string. Returns null otherwise.

setChecksum

public final void setChecksum(byte[] checksum)
Method to set checksum byte array

Parameters:
checksum - the checksum value associated with this transaction

setChecksum

public final void setChecksum(String checksum)
Method to set checksum value

Parameters:
checksum - the checksum from hex ascii string input.

getNote

public final String getNote()
Method to return the associated note

Returns:
note associated with the file.

setNote

public final void setNote(String note)
Method to set the associated note

Parameters:
note - the note to associate with a file.

getRemoteLocation

public final String getRemoteLocation()
Method to return file local location

Returns:
local location of file

setRemoteLocation

public final void setRemoteLocation(String location)
Method to set file remote location

Parameters:
location - the remote location of the file

getLocalLocation

public final String getLocalLocation()
Method to return local file location

Returns:
location of file on local system (if applicable)

setLocalLocation

public final void setLocalLocation(String location)
Method to set local file location

Parameters:
location - the local location of the file

getFileId

public final long getFileId()
Method to return file id

Returns:
file id

setFileId

public final void setFileId(long fileId)
Method to set file id

Parameters:
fileId - the id of the file

commit

public final void commit()
                  throws SessionException
Method to commit a transaction into the restart file. Compares Result.getFileModificationTime() with cache's last query time. If greater, then cache is update to reflect new value before commiting.

Throws:
SessionException - when session failure