All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.as400.access.LogicalDataArea

java.lang.Object
   |
   +----com.ibm.as400.access.DataArea
           |
           +----com.ibm.as400.access.LogicalDataArea

public class LogicalDataArea
extends DataArea
implements Serializable
The LogicalDataArea class represents a logical data area on the AS/400.

The following example demonstrates the use of LogicalDataArea:

// Establish a connection to the AS/400 "My400".
AS400 system = new AS400("My400");
// Create a LogicalDataArea object.
QSYSObjectPathName path = new QSYSObjectPathName("MYLIB", "MYDATA", "DTAARA");
LogicalDataArea dataArea = new LogicalDataArea(system, path.getPath());
// Create the logical data area on the AS/400 using default values.
dataArea.create();
// Clear the data area.
dataArea.clear();
// Write to the data area.
dataArea.write(true);
// Read from the data area.
boolean data = dataArea.read();
// Delete the data area from the AS/400.
dataArea.delete();


Constructor Index

 o LogicalDataArea()
Constructs a LogicalDataArea object.
 o LogicalDataArea(AS400, String)
Constructs a LogicalDataArea object.

Method Index

 o clear()
Clears the data area.
 o create()
Creates a logical data area on the AS/400.
 o create(boolean, String, String)
Creates a logical data area with the specified attributes.
 o delete()
Removes the data area from the system.
 o getPath()
Returns the integrated file system path name of the object represented by the data area.
 o read()
Returns the value in the data area.
 o setPath(String)
Sets the fully qualified data area name.
 o write(boolean)
Writes the value in data to the data area.

Constructors

 o LogicalDataArea
 public LogicalDataArea()
Constructs a LogicalDataArea object. It creates a default LogicalDataArea object. The system and path properties must be set before attempting a connection.

 o LogicalDataArea
 public LogicalDataArea(AS400 system,
                        String path)
Constructs a LogicalDataArea object. It creates a LogicalDataArea instance that represents the data area path on system.

Parameters:
system - The AS/400 that contains the data area.
path - The fully qualified integrated file system path name. The integrated file system file extension for a data area is DTAARA. An example of a fully qualified integrated file system path to a data area "MYDATA" in library "MYLIB" is: /QSYS.LIB/MYLIB.LIB/MYDATA.DTAARA

Methods

 o clear
 public void clear() throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, PropertyVetoException, ServerStartupException, UnknownHostException
Clears the data area. This method resets the data area to contain the default value of false.

Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: PropertyVetoException
If the change is vetoed.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o create
 public void create() throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectAlreadyExistsException, ObjectDoesNotExistException, PropertyVetoException, ServerStartupException, UnknownHostException
Creates a logical data area on the AS/400. This method uses the following default property values. Note the length of a LogicalDataArea is always 1.

Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectAlreadyExistsException
If the AS/400 object already exists.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: PropertyVetoException
If the change is vetoed.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o create
 public void create(boolean initialValue,
                    String textDescription,
                    String authority) throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectAlreadyExistsException, ObjectDoesNotExistException, PropertyVetoException, ServerStartupException, UnknownHostException
Creates a logical data area with the specified attributes.

Parameters:
initialValue - The initial value for the data area.
textDescription - The text description for the data area. The maximum length is 50 characters.
authority - The public authority level for the data area. Valid values are *ALL, *CHANGE, *EXCLUDE, *LIBCRTAUT, *USE, or the name of an authorization list. The maximum length is 10 characters.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectAlreadyExistsException
If the AS/400 object already exists.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: PropertyVetoException
If the change is vetoed.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
 o delete
 public void delete() throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, PropertyVetoException, ServerStartupException, UnknownHostException
Removes the data area from the system.

Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the object does not exist.
Throws: PropertyVetoException
If the change is vetoed.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.
Overrides:
delete in class DataArea
 o getPath
 public String getPath()
Returns the integrated file system path name of the object represented by the data area.

Returns:
The integrated file system path name of the object represented by the data area.
Overrides:
getPath in class DataArea
 o read
 public boolean read() throws AS400SecurityException, ErrorCompletingRequestException, IllegalObjectTypeException, InterruptedException, IOException, ObjectDoesNotExistException, PropertyVetoException
Returns the value in the data area.

Returns:
The data read from the data area.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: IllegalObjectTypeException
If the AS/400 object is not the required type.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: PropertyVetoException
If the change is vetoed.
 o setPath
 public void setPath(String path) throws PropertyVetoException
Sets the fully qualified data area name. The following example demonstrates the use of setPath:
// Create a LogicalDataArea object.
LogicalDataArea dataArea = new LogicalDataArea();
// Set its path to be the data area "MYDATA" in the library "MYLIB".
dataArea.setPath("/QSYS.LIB/MYLIB.LIB/MYDATA.DTAARA");

Parameters:
path - The fully qualified integrated file system path name of the data area.
Throws: PropertyVetoException
If the change is vetoed.
Overrides:
setPath in class DataArea
 o write
 public void write(boolean data) throws AS400SecurityException, ConnectionDroppedException, ErrorCompletingRequestException, InterruptedException, IOException, ObjectDoesNotExistException, PropertyVetoException, ServerStartupException, UnknownHostException
Writes the value in data to the data area.

Parameters:
data - The data to be written.
Throws: AS400SecurityException
If a security or authority error occurs.
Throws: ConnectionDroppedException
If the connection is dropped unexpectedly.
Throws: ErrorCompletingRequestException
If an error occurs before the request is completed.
Throws: InterruptedException
If this thread is interrupted.
Throws: IOException
If an error occurs while communicating with the AS/400.
Throws: ObjectDoesNotExistException
If the AS/400 object does not exist.
Throws: PropertyVetoException
If the change is vetoed.
Throws: ServerStartupException
If the AS/400 server cannot be started.
Throws: UnknownHostException
If the AS/400 system cannot be located.

All Packages  Class Hierarchy  This Package  Previous  Next  Index