com.ibm.as400.access
Class SystemValue

java.lang.Object
  |
  +--com.ibm.as400.access.SystemValue
All Implemented Interfaces:
java.io.Serializable

public class SystemValue
extends java.lang.Object
implements java.io.Serializable

The SystemValue class represents a system value or network attribute on the AS/400.

See Also:
Serialized Form

Constructor Summary
SystemValue()
          Constructs a SystemValue object.
SystemValue(AS400 system, java.lang.String name)
          Constructs a SystemValue object.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a listener to be notified when the value of any bound property is changed.
 void addSystemValueListener(SystemValueListener listener)
          Adds a system value listener to receive system value events from this system value.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds a listener to be notified when the value of any constrained property is changed.
 void clear()
          Clears this system value from the cache.
 java.lang.String getDescription()
          Returns the description for this system value.
 int getGroup()
          Returns the system value group to which this system value belongs.
 java.lang.String getGroupDescription()
          Returns the user-defined group description.
 java.lang.String getGroupName()
          Returns the user-defined group name.
 java.lang.String getName()
          Returns the name of this system value.
 int getRelease()
          Returns the supported release version for this system value.
 int getSize()
          Returns the length (in bytes) of this system value's data value component.
 AS400 getSystem()
          Returns the system.
 int getType()
          Returns the type for this system value.
 java.lang.Object getValue()
          Returns the current value of this system value.
 boolean isReadOnly()
          Indicates if this system value is read only or if it can be set by the user.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes this listener from being notified when a bound property changes.
 void removeSystemValueListener(SystemValueListener listener)
          Removes a listener from the SystemValue listeners list.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes this listener from being notified when a constrained property changes.
 void setName(java.lang.String name)
          Sets the system value name.
 void setSystem(AS400 system)
          Sets the system.
 void setValue(java.lang.Object value)
          Sets the value for this system value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemValue

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

SystemValue

public SystemValue(AS400 system,
                   java.lang.String name)
Constructs a SystemValue object. It creates a SystemValue instance that represents the system value name on system.
Parameters:
system - The AS/400 that this system value references.
name - The name of the system value.
Method Detail

addSystemValueListener

public void addSystemValueListener(SystemValueListener listener)
Adds a system value listener to receive system value events from this system value.
Parameters:
listener - The system value listener.
See Also:
removeSystemValueListener(com.ibm.as400.access.SystemValueListener)

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener to be notified when 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 a listener to be notified when the value of any constrained property is changed.
Parameters:
listener - The VetoableChangeListener.
See Also:
removeVetoableChangeListener(java.beans.VetoableChangeListener)

clear

public void clear()
Clears this system value from the cache. The next time a getValue() is performed on this system value, the value will be retrieved from the AS/400 instead of from the cache.

getDescription

public java.lang.String getDescription()
Returns the description for this system value.
Returns:
The description for the system value.

getGroup

public int getGroup()
Returns the system value group to which this system value belongs. Possible values are:
Returns:
The system value group.
See Also:
SystemValueList

getGroupDescription

public java.lang.String getGroupDescription()
Returns the user-defined group description. If this system value was not generated by the SystemValueGroup class, then null is returned.
Returns:
The group description.

getGroupName

public java.lang.String getGroupName()
Returns the user-defined group name. If this system value was not generated by the SystemValueGroup class, then null is returned.
Returns:
The group name.

getName

public java.lang.String getName()
Returns the name of this system value.
Returns:
The name of the system value.

getRelease

public int getRelease()
Returns the supported release version for this system value. The returned value is the earliest version of OS/400 under which the system value is supported. If the system value is supported in a release prior to V4R2, then V4R2 is returned.
Returns:
The release.
See Also:
AS400.generateVRM(int, int, int)

getSize

public int getSize()
Returns the length (in bytes) of this system value's data value component. For system values that are of type TYPE_ARRAY, this method returns the total size of the data value.
Returns:
The size.

getSystem

public AS400 getSystem()
Returns the system.
Returns:
The AS/400.

getType

public int getType()
Returns the type for this system value. Possible values are:
Returns:
The return type.
See Also:
SystemValueList

getValue

public java.lang.Object getValue()
                          throws AS400SecurityException,
                                 ErrorCompletingRequestException,
                                 java.lang.InterruptedException,
                                 java.io.IOException,
                                 ObjectDoesNotExistException,
                                 RequestNotSupportedException,
                                 java.net.UnknownHostException
Returns the current value of this system value.
Returns:
The data.
Throws:
AS400SecurityException - If a security or authority error occurs.
ErrorCompletingRequestException - If an error occurs before the request is completed.
java.lang.InterruptedException - If this thread is interrupted.
java.io.IOException - If an error occurs while communicating with the AS/400.
ObjectDoesNotExistException - If the AS/400 object does not exist.
RequestNotSupportedException - If the release level of the AS/400 does not support the system value.
java.net.UnknownHostException - If the AS/400 system cannot be located.

isReadOnly

public boolean isReadOnly()
Indicates if this system value is read only or if it can be set by the user.
Returns:
true if the system value is read only; false otherwise.

removeSystemValueListener

public void removeSystemValueListener(SystemValueListener listener)
Removes a listener from the SystemValue listeners list.
Parameters:
listener - The system value listener.
See Also:
addSystemValueListener(com.ibm.as400.access.SystemValueListener)

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes this listener from being notified when a bound property changes.
Parameters:
listener - The PropertyChangeListener.
See Also:
addPropertyChangeListener(java.beans.PropertyChangeListener)

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
Removes this listener from being notified when a constrained property changes.
Parameters:
listener - The VetoableChangeListener.
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener)

setName

public void setName(java.lang.String name)
             throws java.beans.PropertyVetoException
Sets the system value name.
Parameters:
name - The system value.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.

setSystem

public void setSystem(AS400 system)
               throws java.beans.PropertyVetoException
Sets the system.
Parameters:
system - The AS/400.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.

setValue

public void setValue(java.lang.Object value)
              throws AS400SecurityException,
                     ErrorCompletingRequestException,
                     java.lang.InterruptedException,
                     java.io.IOException,
                     RequestNotSupportedException,
                     java.net.UnknownHostException
Sets the value for this system value.
Parameters:
value - The data.
Throws:
AS400SecurityException - If a security or authority error occurs.
ErrorCompletingRequestException - If an error occurs before the request is completed.
java.lang.InterruptedException - If this thread is interrupted.
java.io.IOException - If an error occurs while communicating with the AS/400.
RequestNotSupportedException - If the release level of the AS/400 does not support the system value.
java.net.UnknownHostException - If the AS/400 system cannot be located.