|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.as400.access.SaveFile
Represents a save file on a server.
Field Summary | |
static int |
CLS
Special value for the "waitTime" property. |
static String |
CURRENT_RELEASE
Value for the "targetRelease" property, indicating "current release". |
static int |
DEFAULT
Special value for the "maximumNumberOfRecords", "waitTime", and "asp" properties. |
static int |
IMMED
Value for the "waitTime" property, indicating "immediate". |
static long |
NO_MAX
Value for the "maximumNumberOfRecords" property, indicating that the system maximum is used. |
static String |
PREVIOUS_RELEASE
Value for the "targetRelease" property, indicating "previous release". |
Constructor Summary | |
SaveFile(AS400 system,
String library,
String name)
Constructs a SaveFile object. |
Method Summary | |
void |
clear()
Clears all existing records from the save file and reduces the amount of storage used by this file. |
void |
copyTo(String library,
String name)
Copies the save file to another save file on the same system. |
void |
create()
Creates a save file on the server. |
void |
create(long maxRecords,
int asp,
int waitTime,
boolean shared,
String authority,
String description)
Creates a save file on the server. |
void |
delete()
Deletes the save file. |
boolean |
equals(Object obj)
Determines whether this SaveFile object is equal to another object. |
boolean |
exists()
Determines if the save file currently exists on the system. |
int |
getASP()
Returns the auxiliary storage pool ID for the save file. |
long |
getCurrentNumberOfRecords()
Returns the current number of records in the save file. |
String |
getDescription()
Returns the text description of the save file. |
long |
getLength()
Returns the current total size (in bytes) of the save file. |
String |
getLibrary()
Returns the name of the library where the save file is located on the server. |
long |
getMaximumNumberOfRecords()
Returns the capacity (maximum number of records) of the save file. |
String |
getName()
Returns the name of the save file on the server. |
ObjectDescription |
getObjectDescription()
Returns an ObjectDescription instance representing the save file. |
String |
getPath()
Returns the fully-qualifed IFS pathname of the save file. |
AS400 |
getSystem()
Returns the system where the save file is located. |
String |
getTargetRelease()
Returns the target release level of the operating system on which you intend to restore and use the object(s) saved in the save file by a subsequent invocation of one of the save() methods. |
int |
getWaitTime()
Returns the wait time for the save file. |
boolean |
isSaveOutput()
Indicates whether output from called API's will be saved in the job's spooled output. |
boolean |
isShared()
Reports whether the open data path (ODP) for the save file is shared with other programs in the routing step. |
SaveFileEntry[] |
listEntries()
Lists the contents of the save file. |
Product[] |
listProducts()
Lists the product loads in the save file. |
void |
refresh()
Purges any cached attribute information about the save file. |
void |
renameTo(String name)
Renames the save file. |
void |
restore(Product product)
Restores a licenced program product that was saved into the save file. |
void |
restore(String libraryName)
Restores a library that was saved into the save file. |
void |
restore(String libraryName,
String[] objectList,
String toLibraryName)
Restores objects that were saved into the save file. |
void |
save(Product product)
Saves a copy of all of the objects that make up a licenced program product, into the save file. |
void |
save(String libraryName)
Saves a library into the save file. |
void |
save(String[] pathList)
Saves files from the root file system into the save file. |
void |
save(String libraryName,
String[] objectList)
Saves objects into the save file. |
void |
setDescription(String description)
Sets the text description of the save file. |
void |
setMaximumNumberOfRecords(long maximumNumberOfRecords)
Sets the capacity (maximum number of records) of the save file. |
void |
setSaveOutput(boolean save)
Indicates whether output from called API's will be saved in the job's spooled output. |
void |
setShared(boolean shared)
Sets whether the open data path (ODP) for the save file is shared with other programs in the routing step. |
void |
setTargetRelease(String targetRelease)
Sets the target release level of the operating system on which you intend to restore and use the object(s) saved in the save file by a subsequent invocation of one of the save() methods. |
void |
setWaitTime(int seconds)
Sets the number of seconds to wait for the file resources and session resources to be allocated when the save file is opened, or for the device or session resources to be allocated when an acquire operation is performed to the save file. |
String |
toString()
Returns the String representation of this object. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final String CURRENT_RELEASE
public static final String PREVIOUS_RELEASE
public static final long NO_MAX
public static final int IMMED
public static final int CLS
public static final int DEFAULT
Constructor Detail |
public SaveFile(AS400 system, String library, String name)
create()
or create()
.
system
- The server where the save file is located.library
- The library (on the server) where the save file is located. Example: "MYLIB1". Case is preserved.name
- The name of the save file. Example: "MYFILE1". Case is preserved.Method Detail |
public void clear() throws AS400SecurityException, ErrorCompletingRequestException, IOException, InterruptedException, ObjectDoesNotExistException
A save file must be cleared before it can be used again to receive data from a save command or to receive another save file.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void copyTo(String library, String name) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
library
- The library of the target save file. Example: "MYLIB1". Case is preserved.name
- The name of the target save file. Example: "MYFILE1". Case is preserved.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void create() throws AS400SecurityException, ErrorCompletingRequestException, IOException, InterruptedException, ObjectDoesNotExistException, ObjectAlreadyExistsException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectAlreadyExistsException
- If the save file already exists on the server.
ObjectDoesNotExistException
- If the server API that queries save file description information is missing.public void create(long maxRecords, int asp, int waitTime, boolean shared, String authority, String description) throws AS400SecurityException, ErrorCompletingRequestException, IOException, InterruptedException, ObjectDoesNotExistException, ObjectAlreadyExistsException
maxRecords
- The maximum number of records the save file can hold. If NO_MAX
is specified, the system maximum is used.asp
- The auxiliary storage pool (ASP) in which the system creates the save file. If DEFAULT
is specified, the save file is created in the same ASP as the one containing the library holding the file.waitTime
- The number of seconds that the program waits for the file resources
and session resources to be allocated when the file is opened, or for
the device or session resources to be allocated when an acquire
operation is performed to the file. Special values: CLS
, IMMED
shared
- Specifies whether the open data path (ODP) for the save file is
shared with other programs in the routing step. When an ODP is shared,
the programs accessing the file share facilities such as the file
status and the buffer. Default is false.authority
- The authority given to users who do not have specific authority to
the save file, who are not on an authorization list, and whose user
group has no specific authority to the save file. Defaults to *EXCLUDE
if null.description
- The text that briefly describes the save file. Defaults to blank if null.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectAlreadyExistsException
- If the save file already exists on the server.
ObjectDoesNotExistException
- If the server API that queries save file description information is missing.public void delete() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, IOException, InterruptedException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.public boolean equals(Object obj)
equals
in class Object
public boolean exists() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the server API that queries save file description information is missing.public int getASP() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public long getCurrentNumberOfRecords() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public String getDescription() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public long getLength() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public String getLibrary()
public long getMaximumNumberOfRecords() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
NO_MAX
if there is no maximum.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public String getName()
public ObjectDescription getObjectDescription() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public String getPath()
public AS400 getSystem()
public String getTargetRelease()
CURRENT_RELEASE
and PREVIOUS_RELEASE
. The default is CURRENT_RELEASE.
public int getWaitTime() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
IMMED
, CLS
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public boolean isSaveOutput()
public boolean isShared() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public SaveFileEntry[] listEntries() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, UnsupportedEncodingException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.
UnsupportedEncodingException
public Product[] listProducts() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void refresh() throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void renameTo(String name) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
name
- The new name for the save file. Example: "MYFILE1".
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void restore(String libraryName) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
libraryName
- The library to be restored.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void restore(String libraryName, String[] objectList, String toLibraryName) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
libraryName
- The library from which the object was saved.objectList
- The objects to be restored. Objects are specified by simple object name. For example: MYPROG1 or MYFILE2.toLibraryName
- The library to which to restore the object. If null, restores to the
original library, that is, the library from which the object was saved.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void restore(Product product) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
product
- The product to be restored.
AS400Exception
- If the product is already installed, or if the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void save(String libraryName) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
libraryName
- The library to be saved.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void save(String libraryName, String[] objectList) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
libraryName
- The library where the object resides.objectList
- The objects to be saved. Objects are specified by simple object name. For example: MYPROG1 or MYFILE2.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void save(String[] pathList) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
pathList
- The objects to be saved; objects are specified by path. For example: "/myDirectory/myFile" or "/myDirectory/*".
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void save(Product product) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
product
- The product to be saved.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void setDescription(String description) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
description
- The description.
Maximum length is 50 characters.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void setMaximumNumberOfRecords(long maximumNumberOfRecords) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
NO_MAX
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void setSaveOutput(boolean save)
save
- Whether output should be saved.public void setShared(boolean shared) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
shared
- Whether ODP is shared.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public void setTargetRelease(String targetRelease)
CURRENT_RELEASE
and PREVIOUS_RELEASE
. The default is CURRENT_RELEASE.
targetRelease
- The target release.public void setWaitTime(int seconds) throws AS400Exception, AS400SecurityException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException
IMMED
.
seconds
- The wait time.
AS400Exception
- If the program call returns error messages.
AS400SecurityException
- If a security or authority error occurs.
ErrorCompletingRequestException
- If an error occurs before the request is completed.
InterruptedException
- If this thread is interrupted.
IOException
- If an error occurs while communicating with the server.
ObjectDoesNotExistException
- If the object does not exist on the server.public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |