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

      Constructors 
      Constructor and Description
      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

      Methods 
      Modifier and Type Method and Description
      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 representing the system on which the system value group exists.
      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 PropertyChangeListener.
      void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
      Removes the VetoableChangeListener.
      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 object representing the system on which the system value group exists.
      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 system 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 system 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.

        Note: This constructor now makes a connection to the system in order to retrieve the IBM i release level of the system.

        Parameters:
        system - The system 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. The PropertyChangeListener object is added to a list of PropertyChangeListeners managed by this SystemValueGroup. It can be removed with removePropertyChangeListener.
        Parameters:
        listener - The listener object.
      • 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 listener object.
      • 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)
      • getSystem

        public AS400 getSystem()
        Returns the system object representing the system on which the system value group exists.
        Returns:
        The system object representing the system on which the system value group exists. If the system has not been set, null is returned.
      • getSystemValues

        public java.util.Vector getSystemValues()
                                         throws AS400SecurityException,
                                                ErrorCompletingRequestException,
                                                java.lang.InterruptedException,
                                                java.io.IOException,
                                                ObjectDoesNotExistException
        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 system.
        ObjectDoesNotExistException - If the object does not exist on the system.
        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
        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:
        systemValues - 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 system.
        ObjectDoesNotExistException - If the object does not exist on the system.
        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 PropertyChangeListener. If the PropertyChangeListener is not on the list, nothing is done.
        Parameters:
        listener - The listener object.
      • removeVetoableChangeListener

        public void removeVetoableChangeListener(java.beans.VetoableChangeListener listener)
        Removes the VetoableChangeListener. If the VetoableChangeListener is not on the list, nothing is done.
        Parameters:
        listener - The listener object.
      • 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 any of the registered listeners vetos the property change.
        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 any of the registered listeners vetos the property change.
        See Also:
        getGroupName()
      • setSystem

        public void setSystem(AS400 system)
                       throws java.beans.PropertyVetoException
        Sets the system object representing the system on which the system value group exists.
        Parameters:
        system - The system object representing the system on which the system value group exists.
        Throws:
        java.beans.PropertyVetoException - If any of the registered listeners vetos the property change.
      • 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.