com.ibm.as400.access
Class SystemValueGroup

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

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

The SystemValueGroup class represents a user-defined collection of system values and network attributes. It is not as much a container for SystemValue objects as it is a factory for generating collections of SystemValues having certain attributes.

See Also:
SystemValue, SystemValueList, Serialized Form

Constructor Summary
SystemValueGroup()
          Constructs a SystemValueGroup object.
SystemValueGroup(AS400 system, java.lang.String groupName, java.lang.String groupDescription)
          Constructs a SystemValueGroup object.
SystemValueGroup(AS400 system, java.lang.String groupName, java.lang.String groupDescription, int group)
          Constructs a SystemValueGroup object.
SystemValueGroup(AS400 system, java.lang.String groupName, java.lang.String groupDescription, java.lang.String[] names)
          Constructs a SystemValueGroup object.
 
Method Summary
 void add(java.lang.String name)
          Adds a system value name to this group.
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a PropertyChangeListener.
 void addVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Adds a VetoableChangeListener.
 boolean contains(java.lang.String name)
          Determines if a system value name is part of this group.
 java.lang.String getGroupDescription()
          Returns the user-defined description for this group.
 java.lang.String getGroupName()
          Returns the user-defined name for this group.
 java.lang.String[] getNames()
          Returns the system value names that are currently part of this group.
 AS400 getSystem()
          Returns the system object for this group.
 java.util.Vector getSystemValues()
          Returns newly-generated SystemValue objects representing the system values in this group.
static void refresh(java.util.Vector systemValues)
          Retrieves new values for the SystemValue objects in the Vector.
 boolean remove(java.lang.String name)
          Removes a system value name from this group.
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes the listener from being notified when a bound property changes.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
          Removes the listener from being notified when a constrained property changes.
 void setGroupDescription(java.lang.String groupDescription)
          Sets the user-defined group description for any SystemValue objects generated by this group.
 void setGroupName(java.lang.String groupName)
          Sets the user-defined group name for any SystemValue objects generated by this group.
 void setSystem(AS400 system)
          Sets the system for any SystemValue objects generated by this group.
 java.lang.String toString()
          Returns a String representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SystemValueGroup

public SystemValueGroup()
Constructs a SystemValueGroup object. The system property must be set before attempting a connection.
See Also:
setSystem(com.ibm.as400.access.AS400)

SystemValueGroup

public SystemValueGroup(AS400 system,
                        java.lang.String groupName,
                        java.lang.String groupDescription)
Constructs a SystemValueGroup object. The group of system value names is initialized to be empty.
Parameters:
system - The AS/400 that this group of system value names references.
groupName - The user-defined group name to be used.
groupDescription - The user-defined group description to be used.

SystemValueGroup

public SystemValueGroup(AS400 system,
                        java.lang.String groupName,
                        java.lang.String groupDescription,
                        java.lang.String[] names)
Constructs a SystemValueGroup object. The group of system value names is initialized to contain the system value names in names.
Parameters:
system - The AS/400 that this group of system value names references.
groupName - The user-defined group name to be used.
groupDescription - The user-defined group description to be used.
names - The array of system value names to be initially added to this group.

SystemValueGroup

public SystemValueGroup(AS400 system,
                        java.lang.String groupName,
                        java.lang.String groupDescription,
                        int group)
Constructs a SystemValueGroup object. The group of system value names is initialized to contain all of the system value names in the system-defined group groupIndicator. For example, specifying SystemValueList.GROUP_ALL for groupIndicator would result in this group of system value names being initialized to contain all system value and network attribute names.
Parameters:
system - The AS/400 that this group of system values references.
groupName - The user-defined group name to be used.
groupDescription - The user-defined group description to be used.
group - The system value group constant indicating the set of system value names to be initially added to this group. Valid constants are defined in the SystemValueList class.
See Also:
SystemValueList, SystemValueList.GROUP_ALL
Method Detail

add

public void add(java.lang.String name)
Adds a system value name to this group. All names in this group must be unique, so if name already exists in this group, it is ignored.
Parameters:
name - The system value name to be added to this group.
See Also:
contains(java.lang.String), getNames(), remove(java.lang.String)

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 a 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)

contains

public boolean contains(java.lang.String name)
Determines if a system value name is part of this group.
Parameters:
name - The system value name in question.
Returns:
Returns true if the system value is part of this group; false otherwise.
See Also:
add(java.lang.String), getNames(), remove(java.lang.String)

getGroupDescription

public java.lang.String getGroupDescription()
Returns the user-defined description for this group.
Returns:
The group description.
See Also:
setGroupDescription(java.lang.String)

getGroupName

public java.lang.String getGroupName()
Returns the user-defined name for this group.
Returns:
The group name.
See Also:
setGroupName(java.lang.String)

getNames

public java.lang.String[] getNames()
Returns the system value names that are currently part of this group.
Returns:
An array of system value names.
See Also:
add(java.lang.String), contains(java.lang.String), remove(java.lang.String)

getSystem

public AS400 getSystem()
Returns the system object for this group.
Returns:
The AS400 system object.

getSystemValues

public java.util.Vector getSystemValues()
                                 throws AS400SecurityException,
                                        ErrorCompletingRequestException,
                                        java.lang.InterruptedException,
                                        java.io.IOException,
                                        ObjectDoesNotExistException,
                                        java.net.UnknownHostException
Returns newly-generated SystemValue objects representing the system values in this group. The SystemValue objects in the Vector are sorted by system value name.

If any value in this group is not supported by this group's system, its corresponding SystemValue object will not be returned in the Vector. Therefore, the number of SystemValue objects in the returned Vector may not be the same as the number of system value names represented by this group.

To refresh the values in a Vector of SystemValues, use the refresh() method.

Returns:
A Vector of SystemValue objects.
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.
java.net.UnknownHostException - If the AS/400 system cannot be located.
See Also:
refresh(java.util.Vector)

refresh

public static void refresh(java.util.Vector systemValues)
                    throws AS400SecurityException,
                           ErrorCompletingRequestException,
                           java.lang.InterruptedException,
                           java.io.IOException,
                           ObjectDoesNotExistException,
                           java.net.UnknownHostException
Retrieves new values for the SystemValue objects in the Vector. The SystemValue objects in systemValues have their values refreshed from their respective systems. This method does not create new SystemValue objects; rather, it refreshes all SystemValue objects at once for a given system, which is more efficient than calling clear() on each SystemValue. All objects in systemValues must be SystemValue objects.
Parameters:
values - The group of SystemValue objects to be refreshed.
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.
java.net.UnknownHostException - If the AS/400 system cannot be located.
See Also:
SystemValue.clear()

remove

public boolean remove(java.lang.String name)
Removes a system value name from this group.
Parameters:
name - The system value name to be removed from this group.
Returns:
Returns true if the system value was successfully removed; false otherwise.
See Also:
add(java.lang.String), contains(java.lang.String), getNames()

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes the 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 the listener from being notified when a constrained property changes.
Parameters:
listener - The VetoableChangeListener.
See Also:
addVetoableChangeListener(java.beans.VetoableChangeListener)

setGroupDescription

public void setGroupDescription(java.lang.String groupDescription)
                         throws java.beans.PropertyVetoException
Sets the user-defined group description for any SystemValue objects generated by this group.
Parameters:
groupDescription - The group description.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.
See Also:
getGroupDescription()

setGroupName

public void setGroupName(java.lang.String groupName)
                  throws java.beans.PropertyVetoException
Sets the user-defined group name for any SystemValue objects generated by this group.
Parameters:
groupName - The group name.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.
See Also:
getGroupName()

setSystem

public void setSystem(AS400 system)
               throws java.beans.PropertyVetoException
Sets the system for any SystemValue objects generated by this group.
Parameters:
system - The AS400 system object.
Throws:
java.beans.PropertyVetoException - If the change is vetoed.
See Also:
getSystem()

toString

public java.lang.String toString()
Returns a String representation of this object.
Overrides:
toString in class java.lang.Object
Returns:
A String representing this SystemValueGroup object.