|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jpl.mipl.mdms.FileService.komodo.api.FileType
public class FileType
Purpose: This class defines all operations that can be performed on a file type.
Copyright 2005, California Institute of Technology. ALL RIGHTS RESERVED. U.S. Government Sponsorship acknowledge. 2005.
============================================================================ Modification History : ---------------------- Date Who What ---------------------------------------------------------------------------- 01/01/0001 Turek Initial release. 06/01/2005 Nick Initial documentation. 06/02/2005 Nick Added subscribePush() method. 07/15/2005 Nick get(String) and get(String[]) required CRC and RESTART to create restart file. Now, RESTART alone is sufficient. 07/25/2005 Nick subscribe() uses date param, restart time if RESTART, otherwise, current time. ============================================================================
Constructor Summary | |
---|---|
FileType(Session session,
FileTypeInfo ftInfo)
Constructor |
Method Summary | |
---|---|
protected void |
_configureForReplication(jpl.mipl.mdms.FileService.komodo.api.Request cmd)
If command has replication enabled, then the session is queried for a replication root directory. |
int |
add(String regexp)
Method to add with regular expression |
int |
add(String[] fileNames)
Method to add a list of files |
int |
add(String[] fileNames,
String comment)
Method to add a list of files with comment |
int |
add(String fileName,
byte[] buffer,
long length,
String comment)
Method to add in-memory file. |
int |
add(String regexp,
String comment)
Method to add file with regular expression |
int |
addAndRef(String regexp,
String vft,
String linkDirectory)
Method to add and reference files with regular expression. |
int |
archive(String fileName)
Method to remove archive notation from a file |
int |
archive(String fileName,
String comment)
Method to archive a file |
int |
close()
Method to close this file type. |
int |
comment(String fileName)
Method to remove comment from a file |
int |
comment(String fileName,
String comment)
Method to add comment to a file |
int |
delete(String regexp)
Method to delete a file |
static String |
extractFiletype(String fullFiletype)
Extracts filetype from a full filetype. |
static String |
extractServerGroup(String fullFiletype)
Extracts server group from a full filetype. |
int |
get(String regexp)
Method to get files according to a regular expression |
int |
get(String[] fileNames)
Method to get a file |
int |
get(String[] fileNames,
OutputStream out)
Method to get a file and return it on the output stream specified. |
int |
getAfter(Date datetime)
Method to get files of this file type after a given date. |
int |
getAfter(Date datetime,
String regexp)
Method to get files of this file type after a given date. |
int |
getBetween(Date begDate,
Date endDate)
Method to get files of this file type between two dates |
int |
getBetween(Date begDate,
Date endDate,
String regexp)
Method to get files of this file type between two dates |
int |
getFileFromPath(String filePath)
Method to get a file from a Komodo server based on an absolute path. |
String |
getGroup()
Accessor method to get the name of this file type. |
int |
getLatest()
Method to get the latest file |
int |
getLatest(String regexp)
Method to get latest file according to a regular expression |
String |
getName()
Accessor method to get the name of this file type. |
int |
getSince(Date datetime)
Method to get files of this file type since a given date |
int |
getSince(Date datetime,
String regexp)
Method to get files of this file type since a given date |
int |
ignore(String[] fileNames)
Method to ignore a file |
static boolean |
isFullFiletype(String filetype)
Examines argument string and determines if it satisfies the rules of a full filetype. |
int |
lock(String mode)
Method to lock file type |
static void |
main(String[] args)
|
int |
memGet(String regexp)
Method to get files according to a regular expression into memory |
int |
memGet(String[] fileNames)
Method to get file in memory |
int |
memGetBetween(Date begDate,
Date endDate)
Method to get files of this file type between two dates into memory |
int |
memGetSince(Date datetime)
Method to get files of this file type since a given date |
int |
register(String[] fileNames,
boolean replace,
boolean force,
String comment)
Method to register a file |
int |
rename(String oldFile,
String newFile)
Method to rename a file |
int |
replace(String regexp)
Replace with regular expression |
int |
replace(String[] fileNames)
Method to replace a file |
int |
replace(String[] fileNames,
String comment)
Method to replace a file |
int |
replace(String fileName,
byte[] buffer,
long length,
String comment)
Method to replace in-memory file. |
int |
replace(String regexp,
String comment)
Replace with regular expression |
int |
show()
Method to show all files of this file type |
int |
show(String regexp)
Method to show files according to regular expression |
int |
show(String[] fileNames)
Method to show given files in the server |
int |
showAfter(Date datetime)
Method to show files of this file type after a given date |
int |
showAfter(Date datetime,
String regexp)
Method to show files of this file type after a given date |
int |
showBetween(Date begDate,
Date endDate)
Method to show files of this file type between two dates |
int |
showBetween(Date begDate,
Date endDate,
String regexp)
Method to show files of this file type between two dates |
int |
showCapabilities()
Method to show all the user's file type capabilities on the server associated with this file type. |
int |
showLatest()
Method to show the latest file for this type. |
int |
showLatest(String regexp)
Method to show files according to regular expression |
int |
showSince(Date datetime)
Method to show files of this file type since a given date |
int |
stopSubscribe()
Method to subscribe to files of this file type after a given date. |
int |
subscribe(char operation,
boolean commit)
Method to subscribe to files of this file type. |
int |
subscribe(Date datetime,
String regexp,
char operation,
boolean commit)
Method to subscribe to files of this file type after a given date. |
static String |
toFullFiletype(String servergroup,
String filetype)
Forms full filetype name using the servergroup and filetype arguments. |
int |
unlock(String mode)
Method to unlock file type |
int |
unregister(String regexp)
Method to unregister a file |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileType(Session session, FileTypeInfo ftInfo) throws SessionException
session
- a transfer session, for maintaining file types and
connections.ftInfo
- a file type
SessionException
- when session failure.
If unable to connect to server, errno = CONN_FAILED. If
authentication error, errno = INVALID_LOGIN.Method Detail |
---|
public final String getName()
public final String getGroup()
public int comment(String fileName) throws SessionException
fileName
- a file name
SessionException
- when session
failurepublic int comment(String fileName, String comment) throws SessionException
fileName
- a file namecomment
- the comment that goes along with file(s)
SessionException
- when session
failurepublic int archive(String fileName) throws SessionException
fileName
- a file name
SessionException
- when session
failurepublic int archive(String fileName, String comment) throws SessionException
fileName
- a file namecomment
- the optional comment for the file
SessionException
- when session
failurepublic int add(String regexp) throws SessionException
regexp
- a regular expression
SessionException
- when session
failurepublic int add(String regexp, String comment) throws SessionException
regexp
- a regular expressioncomment
- a comment to associated with each file
SessionException
- when session
failurepublic int add(String[] fileNames) throws SessionException
fileNames
- an array of file names
SessionException
- when session
failurepublic int add(String[] fileNames, String comment) throws SessionException
fileNames
- an array of file namescomment
- a comment to associated with each file
SessionException
- when session
failurepublic int addAndRef(String regexp, String vft, String linkDirectory) throws SessionException
regexp
- a regular expressionvft
- virtual file type in created reference.linkDirectory
- where file system soft link directory.
SessionException
- when session
failurepublic int add(String fileName, byte[] buffer, long length, String comment) throws SessionException
fileName
- a file namebuffer
- in-memory file contentslength
- amount of data in the buffer to be sent as a filecomment
- a comment to associated with each file, or null
SessionException
- when session
failurepublic int replace(String regexp) throws SessionException
regexp
- a regular expression
SessionException
- when session
failurepublic int replace(String regexp, String comment) throws SessionException
regexp
- a regular expressioncomment
- a comment to associated with each file
SessionException
- when session
failurepublic int replace(String[] fileNames) throws SessionException
fileNames
- an array of file names
SessionException
- when session
failurepublic int replace(String[] fileNames, String comment) throws SessionException
fileNames
- an array of file namescomment
- a comment to associated with each file
SessionException
- when session
failurepublic int replace(String fileName, byte[] buffer, long length, String comment) throws SessionException
fileName
- a file namebuffer
- in-memory file contentslength
- amount of data in the buffer to be sent as a filecomment
- a comment to associated with each file, or null
SessionException
- when session
failurepublic int delete(String regexp) throws SessionException
regexp
- The regular expression file selector
SessionException
- when session
failurepublic int ignore(String[] fileNames) throws SessionException
fileNames
- an array of file names
SessionException
- when session
failurepublic int rename(String oldFile, String newFile) throws SessionException
oldFile
- the old file namenewFile
- the new file name
SessionException
- when session
failurepublic int showCapabilities() throws SessionException
SessionException
- when session
failurepublic int show() throws SessionException
SessionException
- when session
failurepublic int show(String regexp) throws SessionException
regexp
- a regular expression
SessionException
- when session
failurepublic int show(String[] fileNames) throws SessionException
fileNames
- an array of file names
SessionException
- when session
failurepublic int showSince(Date datetime) throws SessionException
datetime
- the date cutoff for file show
SessionException
- when session
failurepublic int showAfter(Date datetime) throws SessionException
datetime
- the date cutoff for file show
SessionException
- when session
failurepublic int showAfter(Date datetime, String regexp) throws SessionException
datetime
- the date cutoff for file showregexp
- the file name regular expression
SessionException
- when session
failurepublic int subscribe(char operation, boolean commit) throws SessionException
operation
- Char constant of operation, one of AUTO{GET|SHOW}FILES.
`* @param commit Flag indicating whether Result state will be
persisted to restart cache
SessionException
- when session failurepublic int subscribe(Date datetime, String regexp, char operation, boolean commit) throws SessionException
datetime
- the date cutoff for file show, can be nullregexp
- the file name regular expressionoperation
- Char constant of operation, one of AUTO{GET|SHOW}FILES.commit
- Flag indicating whether Result state will be
persisted to restart cache
SessionException
- when session failurepublic int stopSubscribe() throws SessionException
datetime
- the date cutoff for file show, can be nullregexp
- the file name regular expression
SessionException
- when session failurepublic int showBetween(Date begDate, Date endDate) throws SessionException
begDate
- the beginning DateendDate
- the last Date
SessionException
- when session
failurepublic int showBetween(Date begDate, Date endDate, String regexp) throws SessionException
begDate
- the beginning DateendDate
- the last Dateregexp
- the file name regular expression
SessionException
- when session
failurepublic int showLatest() throws SessionException
SessionException
- when session
failurepublic int showLatest(String regexp) throws SessionException
regexp
- a regular expression
SessionException
- when session
failurepublic int getFileFromPath(String filePath) throws SessionException
filePath
- the location to files
SessionException
- when session
failurepublic int get(String regexp) throws SessionException
regexp
- a regular expression
SessionException
- when session
failurepublic int get(String[] fileNames) throws SessionException
fileNames
- an array of file names
SessionException
- when session
failurepublic int get(String[] fileNames, OutputStream out) throws SessionException
fileNames
- an array of file namesout
- the output stream to return the data on. Stream left
open on return.
SessionException
- when session
failurepublic int getAfter(Date datetime) throws SessionException
datetime
- the date overrides restart file date.
SessionException
- when session
failurepublic int getAfter(Date datetime, String regexp) throws SessionException
datetime
- the date overrides restart file date.regexp
- the file name regular expression
SessionException
- when session
failurepublic int getSince(Date datetime) throws SessionException
datetime
- to date cutoff for file get
SessionException
- when session
failurepublic int getSince(Date datetime, String regexp) throws SessionException
datetime
- to date cutoff for file getregexp
- the file name regular expression
SessionException
- when session
failurepublic int getBetween(Date begDate, Date endDate) throws SessionException
begDate
- the beginning dateendDate
- the last date
SessionException
- when session
failurepublic int getBetween(Date begDate, Date endDate, String regexp) throws SessionException
begDate
- the beginning dateendDate
- the last dateregexp
- the file name regular expression
SessionException
- when session
failurepublic int getLatest() throws SessionException
SessionException
- when session
failurepublic int getLatest(String regexp) throws SessionException
regexp
- a regular expression
SessionException
- when session
failurepublic int memGet(String regexp) throws SessionException
regexp
- a regular expression
SessionException
- when session
failurepublic int memGet(String[] fileNames) throws SessionException
fileNames
- - an array of file names
SessionException
- when session
failurepublic int memGetSince(Date datetime) throws SessionException
datetime
- the date cutoff for file get
SessionException
- when session
failurepublic int memGetBetween(Date begDate, Date endDate) throws SessionException
begDate
- the beginning dateendDate
- the last date
SessionException
- when session
failurepublic int lock(String mode) throws SessionException
mode
- the lock mode
SessionException
- when session
failurepublic int unlock(String mode) throws SessionException
mode
- the lock mode
SessionException
- when session
failurepublic int register(String[] fileNames, boolean replace, boolean force, String comment) throws SessionException
fileNames
- an array of file namesreplace
- flag indicating that file metadata should be re-registeredforce
- flag indicating that all file metadata should be re-registered,
including locationcomment
- a comment to associated with each file
SessionException
- when session
failurepublic int unregister(String regexp) throws SessionException
regexp
- The regular expression file selector
SessionException
- when session
failurepublic int close()
close
in interface Closable
protected void _configureForReplication(jpl.mipl.mdms.FileService.komodo.api.Request cmd)
cmd
- The Request to be configured for replicationpublic static String extractServerGroup(String fullFiletype)
fullFiletype
- Full filetype name
public static String extractFiletype(String fullFiletype)
fullFiletype
- Full filetype name
public static String toFullFiletype(String servergroup, String filetype)
servergroup
- Server group, can be nullfiletype
- Filetype name
public static boolean isFullFiletype(String filetype)
filetype
- Potential full filetype string
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |