com.ibm.as400.access
Class SystemValue

java.lang.Object
  extended by com.ibm.as400.access.SystemValue
All Implemented Interfaces:
Serializable

public class SystemValue
extends Object
implements Serializable

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

See Also:
Serialized Form

Constructor Summary
SystemValue()
          Constructs a SystemValue object.
SystemValue(AS400 system, String name)
          Constructs a SystemValue object.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 void addSystemValueListener(SystemValueListener listener)
          Adds an SystemValueListener.
 void addVetoableChangeListener(VetoableChangeListener listener)
          Adds a VetoableChangeListener.
 void clear()
          Clears this system value from the cache.
 String getDescription()
          Returns the description for this system value.
 int getGroup()
          Returns the system value group to which this system value belongs.
 String getGroupDescription()
          Returns the user-defined group description.
 String getGroupName()
          Returns the user-defined group name.
 String getName()
          Returns the name of this system value.
 int getRelease()
          Returns the supported release for this system value.
 int getSize()
          Returns the length (in bytes) of this system value's data value component.
 AS400 getSystem()
          Returns the system object representing the system on which the system value exists.
 int getType()
          Returns the type for this system value.
 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(PropertyChangeListener listener)
          Removes the PropertyChangeListener.
 void removeSystemValueListener(SystemValueListener listener)
          Removes the SystemValueListener.
 void removeVetoableChangeListener(VetoableChangeListener listener)
          Removes the VetoableChangeListener.
 void setName(String name)
          Sets the system value name.
 void setSystem(AS400 system)
          Sets the system object representing the system on which the system value exists.
 void setValue(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,
                   String name)
Constructs a SystemValue object. It creates a SystemValue instance that represents the system value name on system.

Parameters:
system - The system object representing the system on which the system value exists.
name - The name of the system value.
Method Detail

addSystemValueListener

public void addSystemValueListener(SystemValueListener listener)
Adds an SystemValueListener. The specified SystemValueListener's systemValueChanged method will be called each time a system value has been changed. The SystemValueListener object is added to a list of SystemValueListeners managed by this SystemValue. It can be removed with removeSystemValueListener.

Parameters:
listener - The listener object.

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. The PropertyChangeListener object is added to a list of PropertyChangeListeners managed by this SystemValue. It can be removed with removePropertyChangeListener.

Parameters:
listener - The listener object.

addVetoableChangeListener

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

Parameters:
listener - The listener object.

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 system instead of from the cache.


getDescription

public 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 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 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 String getName()
Returns the name of this system value. If the name has not been set null is returned.

Returns:
The name of the system value.

getRelease

public int getRelease()
Returns the supported release for this system value. The returned value is the earliest version of IBM i under which the system value is supported. If the system value is supported in a release prior to V4R2M0, then V4R2M0 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 object representing the system on which the system value exists.

Returns:
The system object representing the system on which the system value exists. If the system has not been set, null is returned.

getType

public int getType()
Returns the type for this system value. Possible values are:

Returns:
The return type.
See Also:
SystemValueList

getValue

public Object getValue()
                throws AS400SecurityException,
                       ErrorCompletingRequestException,
                       InterruptedException,
                       IOException,
                       ObjectDoesNotExistException,
                       RequestNotSupportedException
Returns the current value of this system value. Use getType() to determine the type of the returned object. For example, some system values are represented as arrays of String.

Returns:
The data. Never returns null.
Throws:
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 system.
ObjectDoesNotExistException - If the object does not exist on the system.
RequestNotSupportedException - If the IBM i release level of the system does not support the system value.
See Also:
getType()

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 the SystemValueListener. If the SystemValueListener is not on the list, nothing is done.

Parameters:
listener - The listener object.

removePropertyChangeListener

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

Parameters:
listener - The listener object.

removeVetoableChangeListener

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

Parameters:
listener - The listener object.

setName

public void setName(String name)
             throws PropertyVetoException
Sets the system value name.

Parameters:
name - The system value.
Throws:
PropertyVetoException - If any of the registered listeners vetos the property change.

setSystem

public void setSystem(AS400 system)
               throws PropertyVetoException
Sets the system object representing the system on which the system value exists.

Parameters:
system - The system object representing the system on which the system value exists.
Throws:
PropertyVetoException - If any of the registered listeners vetos the property change.

setValue

public void setValue(Object value)
              throws AS400SecurityException,
                     ErrorCompletingRequestException,
                     InterruptedException,
                     IOException,
                     RequestNotSupportedException
Sets the value for this system value. Use getType() to determine the type of object to set. For example, some system values are represented as arrays of String.

Parameters:
value - The data.
Throws:
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 system.
RequestNotSupportedException - If the IBM i release level of the system does not support the system value.
See Also:
getType()