com.ibm.as400.access
Class DataArea
- java.lang.Object
-
- com.ibm.as400.access.DataArea
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- CharacterDataArea, DecimalDataArea, LocalDataArea, LogicalDataArea
public abstract class DataArea extends java.lang.Object implements java.io.Serializable
The DataArea class is an abstract base class that represents a data area object.DataArea objects generate the following events:
- DataAreaEvent
- DA_CLEARED
- DA_CREATED
- DA_DELETED
- DA_READ
- DA_WRITTEN
- PropertyChangeEvent
- VetoableChangeEvent
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DataArea()
Constructs a DataArea object.DataArea(AS400 system, java.lang.String path)
Constructs a DataArea object.
-
Method Summary
Methods 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(java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener.void
addVetoableChangeListener(java.beans.VetoableChangeListener listener)
Adds the VetoableChangeListener.int
getLength()
Returns the size of the data area.java.lang.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(java.beans.PropertyChangeListener listener)
Removes the PropertyChangeListener from the internal list.void
removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes the VetoableChangeListener from the internal list.void
setSystem(AS400 system)
Sets the system on which the data area exists.
-
-
-
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, java.lang.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(java.beans.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(java.beans.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, java.lang.InterruptedException, java.io.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.java.lang.InterruptedException
- If this thread is interrupted.java.io.IOException
- If an error occurs while communicating with the system.ObjectDoesNotExistException
- If the system object does not exist.
-
getName
public java.lang.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, java.lang.InterruptedException, java.io.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.java.lang.InterruptedException
- If this thread is interrupted.java.io.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(java.beans.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(java.beans.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 java.beans.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:
java.beans.PropertyVetoException
- If the change is vetoed.
-
-