com.ibm.as400.access
Class DataArea

java.lang.Object
  extended by com.ibm.as400.access.DataArea
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
CharacterDataArea, DecimalDataArea, LocalDataArea, LogicalDataArea

public abstract class DataArea
extends Object
implements Serializable

The DataArea class is an abstract base class that represents a data area object.

DataArea objects generate the following events:

See Also:
Serialized Form

Constructor Summary
Constructor and Description
DataArea()
          Constructs a DataArea object.
DataArea(AS400 system, String path)
          Constructs a DataArea object.
 
Method Summary
Modifier and Type Method and Description
 void addDataAreaListener(DataAreaListener listener)
          Adds a data area listener to receive data area events from this data area.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 void addVetoableChangeListener(VetoableChangeListener listener)
          Adds the VetoableChangeListener.
 int getLength()
          Returns the size of the data area.
 String getName()
          Returns the data area name.
 AS400 getSystem()
          Returns the AS400 system object for the data area.
 void refreshAttributes()
          Refreshes the attributes of the data area.
 void removeDataAreaListener(DataAreaListener listener)
          Removes the DataAreaListener from the internal list.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the PropertyChangeListener from the internal list.
 void removeVetoableChangeListener(VetoableChangeListener listener)
          Removes the VetoableChangeListener from the internal list.
 void setSystem(AS400 system)
          Sets the system on which the data area exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataArea

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


DataArea

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

Parameters:
system - The system 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
Method Detail

addDataAreaListener

public void addDataAreaListener(DataAreaListener listener)
Adds a data area listener to receive data area events from this data area.

Parameters:
listener - The data area listener.
See Also:
removeDataAreaListener(com.ibm.as400.access.DataAreaListener)

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener. The specified PropertyChangeListener's propertyChange method will be called each time the value of any bound property is changed.

Parameters:
listener - The PropertyChangeListener.
See Also:
removePropertyChangeListener(java.beans.PropertyChangeListener)

addVetoableChangeListener

public void addVetoableChangeListener(VetoableChangeListener listener)
Adds the VetoableChangeListener. The specified VetoableChangeListener's vetoableChange method will be called each time the value of any constrained property is changed.

Parameters:
listener - The VetoableChangeListener.
See Also:
removeVetoableChangeListener(java.beans.VetoableChangeListener)

getLength

public int getLength()
              throws AS400SecurityException,
                     ErrorCompletingRequestException,
                     IllegalObjectTypeException,
                     InterruptedException,
                     IOException,
                     ObjectDoesNotExistException
Returns the size of the data area.

Returns:
The size of the data area, in bytes.
Throws:
AS400SecurityException - If a security or authority error occurs.
ErrorCompletingRequestException - If an error occurs before the request is completed.
IllegalObjectTypeException - If the system object is not the required type.
InterruptedException - If this thread is interrupted.
IOException - If an error occurs while communicating with the system.
ObjectDoesNotExistException - If the system object does not exist.

getName

public String getName()
Returns the data area name.

Returns:
The name of the data area.

getSystem

public AS400 getSystem()
Returns the AS400 system object for the data area.

Returns:
The AS400 system object for the data area.

refreshAttributes

public void refreshAttributes()
                       throws AS400SecurityException,
                              ErrorCompletingRequestException,
                              IllegalObjectTypeException,
                              InterruptedException,
                              IOException,
                              ObjectDoesNotExistException
Refreshes the attributes of the data area. This method should be called if the underlying system data area has changed and it is desired that this object should reflect those changes.

Throws:
AS400SecurityException - If a security or authority error occurs.
ErrorCompletingRequestException - If an error occurs before the request is completed.
IllegalObjectTypeException - If the system object is not the required type.
InterruptedException - If this thread is interrupted.
IOException - If an error occurs while communicating with the system.
ObjectDoesNotExistException - If the system object does not exist.

removeDataAreaListener

public void removeDataAreaListener(DataAreaListener listener)
Removes the DataAreaListener from the internal list. If the DataAreaListener is not on the list, nothing is done.

Parameters:
listener - The data area listener.
See Also:
addDataAreaListener(com.ibm.as400.access.DataAreaListener)

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list. If the PropertyChangeListener is not on the list, nothing is done.

Parameters:
listener - The PropertyChangeListener.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

removeVetoableChangeListener

public void removeVetoableChangeListener(VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list. If the VetoableChangeListener is not on the list, nothing is done.

Parameters:
listener - The VetoableChangeListener.
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener)

setSystem

public void setSystem(AS400 system)
               throws PropertyVetoException
Sets the system on which the data area exists. The system cannot be set if a connection has already been established.

Parameters:
system - The system on which the data area exists.
Throws:
PropertyVetoException - If the change is vetoed.