com.ibm.as400.access.list

Class AspOpenList

  • All Implemented Interfaces:
    java.io.Serializable


    public class AspOpenList
    extends OpenList
    An OpenList implementation that generates lists of AspListItem objects.
       AS400 system = new AS400("mySystem", "myUserID", "myPassword");
       //Return all ASPs list with format FORMAT_0100(YASP0100)
       AspOpenList list = new AspOpenList(system);
       list.open();
       Enumeration items = list.getItems();
       while (items.hasMoreElements())
       {
           AspListItem item = (AspListItem)items.nextElement();
           System.out.println(item.getASPNumber() + "/" + item.getResourceName() + "/" + item.getVersion() + " - " + item.getASPUsage() + ", " + item.getASPStatus());
       }
       list.close();
    
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String ALL_ASP_SELECTED 
      static java.lang.String ALL_IASP_SELECTED 
      static java.lang.String ALL_USER_ASP_SELECTED 
      static java.lang.String ASP_NUMBER
      Content indicate what kind of ASP or what ASP information is returned.
      static java.lang.String DATABASE_NAME 
      static java.lang.String DEVICEDESCRIPTION_NAME 
      static java.lang.String FORMAT_0100
      Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0100 format of the underlying API.
      static java.lang.String FORMAT_0200
      Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0200 format of the underlying API.
      static java.lang.String FORMAT_0300
      Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0300 format of the underlying API.
      static java.lang.String FORMAT_0400
      Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0400 format of the underlying API.
      static java.lang.String FORMAT_0500
      Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0500 format of the underlying API.
      static java.lang.String FORMAT_0600
      Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0600 format of the underlying API.
      static java.lang.String RESOURCE_NAME 
      static java.lang.String UNASSIGNED_DISK 
    • Constructor Summary

      Constructors 
      Constructor and Description
      AspOpenList(AS400 system)
      Constructs a AspOpenList object with the given system.
      AspOpenList(AS400 system, java.lang.String format)
      Constructs a AspOpenList object with the given system. this list will generate a list of AspOpenList objects for all ASPs on the system using the format.
      AspOpenList(AS400 system, java.lang.String format, int aspNumber)
      Constructs a AspOpenList object with the given system, format, ASP number. this list will generate a list of AspOpenList objects for the ASP Number using the format.
      AspOpenList(AS400 system, java.lang.String format, java.lang.String filterDataType)
      Constructs a AspOpenList object with the given system, format, filter data type.
      AspOpenList(AS400 system, java.lang.String format, java.lang.String filterDataType, java.lang.String name)
      Constructs a AspOpenList object with the given system, format, filterDataType and ASP name. this list will generate a list of AspOpenList objects for the ASP name using the format.
    • Field Detail

      • FORMAT_0100

        public static final java.lang.String FORMAT_0100
        Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0100 format of the underlying API.
        See Also:
        setFormat(java.lang.String), Constant Field Values
      • FORMAT_0200

        public static final java.lang.String FORMAT_0200
        Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0200 format of the underlying API.
        See Also:
        setFormat(java.lang.String), Constant Field Values
      • FORMAT_0300

        public static final java.lang.String FORMAT_0300
        Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0300 format of the underlying API.
        See Also:
        setFormat(java.lang.String), Constant Field Values
      • FORMAT_0400

        public static final java.lang.String FORMAT_0400
        Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0400 format of the underlying API.
        See Also:
        setFormat(java.lang.String), Constant Field Values
      • FORMAT_0500

        public static final java.lang.String FORMAT_0500
        Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0500 format of the underlying API.
        See Also:
        setFormat(java.lang.String), Constant Field Values
      • FORMAT_0600

        public static final java.lang.String FORMAT_0600
        Constant indicating that this list will accept parameters for, and, generate SpooledFileListItem objects in accordance with, the YASP0600 format of the underlying API.
        See Also:
        setFormat(java.lang.String), Constant Field Values
      • DEVICEDESCRIPTION_NAME

        public static final java.lang.String DEVICEDESCRIPTION_NAME
        See Also:
        Constant Field Values
      • ALL_USER_ASP_SELECTED

        public static final java.lang.String ALL_USER_ASP_SELECTED
        See Also:
        Constant Field Values
      • ALL_IASP_SELECTED

        public static final java.lang.String ALL_IASP_SELECTED
        See Also:
        Constant Field Values
    • Constructor Detail

      • AspOpenList

        public AspOpenList(AS400 system)
        Constructs a AspOpenList object with the given system. By default, this list will generate a list of AspOpenList objects for all ASPs on the system using the default format of FORMAT_0100.
        Parameters:
        system - The system object representing the system on which the ASP exists
      • AspOpenList

        public AspOpenList(AS400 system,
                   java.lang.String format)
        Constructs a AspOpenList object with the given system. this list will generate a list of AspOpenList objects for all ASPs on the system using the format.
        Parameters:
        system - The system object representing the system on which the ASP exists
        format - The format of ASP information being returned. Support: YASP0100, YASP0200, YASP0300, YASP0400, YASP0500, YASP0600 and UNASSIGNED_DISK
        See Also:
        setFormat(java.lang.String)
      • AspOpenList

        public AspOpenList(AS400 system,
                   java.lang.String format,
                   java.lang.String filterDataType)
        Constructs a AspOpenList object with the given system, format, filter data type. This list will generate a list of AspOpenList objects for specific type ASPs on the system using the format.
        Parameters:
        system - The system object representing the system on which the ASP exists
        format - The format of ASP information being returned. Possible values are: FORMAT_0100, FORMAT_0200, FORMAT_0300, FORMAT_0400, FORMAT_0500 and FORMAT_0600
        filterDataType - Filter data type for filter information. Possible values are: ALL_ASP_SELECTED, ALL_USER_ASP_SELECTED and ALL_IASP_SELECTED.
        See Also:
        setFormat(java.lang.String)
      • AspOpenList

        public AspOpenList(AS400 system,
                   java.lang.String format,
                   int aspNumber)
        Constructs a AspOpenList object with the given system, format, ASP number. this list will generate a list of AspOpenList objects for the ASP Number using the format.
        Parameters:
        system - The system object representing the system on which the ASP exists
        format - The format of ASP information being returned. Possible values are: FORMAT_0100, FORMAT_0200, FORMAT_0300, FORMAT_0400, FORMAT_0500 and FORMAT_0600
        aspNumber - the ASP number.
        See Also:
        setFormat(java.lang.String), setASPNumber(int)
      • AspOpenList

        public AspOpenList(AS400 system,
                   java.lang.String format,
                   java.lang.String filterDataType,
                   java.lang.String name)
        Constructs a AspOpenList object with the given system, format, filterDataType and ASP name. this list will generate a list of AspOpenList objects for the ASP name using the format.
        Parameters:
        system - The system object representing the system on which the ASP exists
        format - The format of ASP information being returned. Possible values are: FORMAT_0100, FORMAT_0200, FORMAT_0300, FORMAT_0400, FORMAT_0500 and FORMAT_0600
        filterDataType - The ASP filter data type, Possible values are: RESOURCE_NAME, DEVICE_DESCRIPTION_NAME and DATABASE_NAME
        name - The ASP name
        See Also:
        setFormat(java.lang.String), setFilterKey(java.lang.String), setASPName(java.lang.String)
    • Method Detail

      • setASPNumber

        public void setASPNumber(int aspNumber)
        Set ASP number for filter information, filterkey sets to 1.
        Parameters:
        aspNumber -
      • setASPName

        public void setASPName(java.lang.String name)
        Set ASP Name for filter information.
        Parameters:
        name - The ASP name
        • ASP resource name
        • ASP device description name
        • database name
        See Also:
        setFilterKey(String)
      • formatOutputData

        protected java.lang.Object[] formatOutputData(byte[] data,
                                          int recordsReturned,
                                          int recordLength)
                                               throws AS400SecurityException,
                                                      ErrorCompletingRequestException,
                                                      java.lang.InterruptedException,
                                                      java.io.IOException,
                                                      ObjectDoesNotExistException
        Formats the data from QGY/QGYOLSPL.
        Specified by:
        formatOutputData in class OpenList
        Parameters:
        data - The output data from the receiver variable from the call to the QGYGTLE (Get List Entries) API.
        recordsReturned - The number of records returned, as reported in the open list information returned on the call to QGYGTLE.
        recordLength - The length of a record, in bytes, as reported in the open list information returned on the call to QGYGTLE.
        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.
      • getBestGuessReceiverSize

        protected int getBestGuessReceiverSize(int number)
        Returns receiver variable size based on format used.
        Specified by:
        getBestGuessReceiverSize in class OpenList
        Parameters:
        number - The number of records in the list on the system. This is useful if the subclass needs to return a receiver size based on how many records are in the list.
        Returns:
        The number of bytes to allocate for the receiver variable when the QGYGTLE (Get List Entries) API is called. This number does not have to be calculated exactly, as QGYGTLE will be called repeatedly until the correct size is known. This number is just for the initial call to QGYGTLE. Too low of a value may result in extra API calls, too high of a value may result in wasted bytes being sent and received.
      • getAspNumber

        public int getAspNumber()
        Returns:
        ASP number
      • getAspName

        public java.lang.String getAspName()
        Returns:
        ASP name
      • getFilterKey

        public int getFilterKey()
        Returns:
        ASP filter key
      • getFilterDataType

        public java.lang.String getFilterDataType()
        Returns:
        ASP filter data type