com.ibm.as400.access

Class ValidationList

  • java.lang.Object
    • com.ibm.as400.access.ValidationList


  • public class ValidationList
    extends java.lang.Object
    Represents a system validation list object.

    Note: The ability to find and modify the list is dependent on the access rights of the signed-on user profile to the validation list.

    Author:
    Thomas Johnson (tom.johnson@kingland.com), Kingland Systems Corporation
    • Constructor Detail

      • ValidationList

        public ValidationList()
        Constructs a validation list.

        Note: The AS400 and Path properties must be set prior to taking action against the object.

      • ValidationList

        public ValidationList(AS400 as400)
        Constructs a validation list for the given system.

        Note: The Path property must be set prior to taking action against the object.

        Parameters:
        as400 - the system
      • ValidationList

        public ValidationList(AS400 as400,
                      QSYSObjectPathName path)
        Constructs a validation list for the given system and path.
        Parameters:
        as400 - com.ibm.as400.access.AS400
        path - com.ibm.as400.access.QSYSObjectPathName
      • ValidationList

        public ValidationList(AS400 as400,
                      java.lang.String obj,
                      java.lang.String lib)
        Constructs a validation list for the given system and object/library names.
        Parameters:
        as400 - com.ibm.as400.access.AS400
        obj - java.lang.String
        lib - java.lang.String
    • Method Detail

      • findEntry

        public ValidationListEntry findEntry(java.lang.String identifier,
                                    int ccsid)
                                      throws PersistenceException
        Returns an entry from the validation list with the given identifier.

        The ccsid parameter indicates the ccsid used to store the identifier in the entry on the IBM i system. This apparently needs to be an exact match in order to find the entry as it was originally inserted.

        No attribute values are retrieved for the entry.

        Parameters:
        identifier - java.lang.String
        ccsid - int
        Returns:
        ValidationListEntry
        Throws:
        PersistenceException - If an error occurs while calling the IBM i APIs.
      • findEntry

        public ValidationListEntry findEntry(java.lang.String identifier,
                                    int ccsid,
                                    ValidationListAttribute[] attributes)
                                      throws PersistenceException
        Returns an entry from the validation list with the given identifier and attributes.

        The ccsid parameter indicates the ccsid used to store the identifier in the entry on the IBM i system. This apparently needs to be an exact match in order to find the entry as it was originally inserted.

        The attributes parameter indicates the list of attributes to retrieve for the entry. Each attribute specified must contain a valid identifier.

        Parameters:
        identifier - java.lang.String
        ccsid - int
        attributes - ValidationListAttribute[]
        Returns:
        ValidationListEntry
        Throws:
        PersistenceException - If an error occurs while calling the IBM i APIs.
      • getAS400

        public AS400 getAS400()
        Returns the IBM i system containing the validation list.
        Returns:
        com.ibm.as400.access.AS400
      • getDescription

        public java.lang.String getDescription()
        Returns the text description for the validation list object.

        Note: Only returned if set by the setDescription() method.

        Returns:
        java.lang.String
      • getEntries

        public ValidationListEntry[] getEntries()
                                         throws PersistenceException
        Returns all entries from the validation list.

        Note: The list is opened by the initial call to the list API. In doing so, the entire contents of the list is retrieved as a snapshot and stored in a buffer on the IBM i system. The list contents can then be retrieved from the pre-filled buffer, in whole or in part, at the convenience of the application by using a system-provided handle. The handle is used to close the list when the application has completed processing of all entries.

        Currently the entire list is built and retrieved synchronously by this method. This could potentially be changed to allow for additional processing options, such as asynchronous building of the list, retrieving only a subset of entries, etc. For now we just keep it simple.

        Throws:
        PersistenceException - If an error occurs while calling the IBM i APIs.
      • getNumberOfEntries

        public int getNumberOfEntries()
                               throws PersistenceException
        Returns the number of entries in the validation list.
        Throws:
        PersistenceException - If an error occurs while calling the IBM i APIs.
      • getPath

        public QSYSObjectPathName getPath()
        Returns the location (library context) of the validation list.
        Returns:
        com.ibm.as400.access.QSYSObjectPathName
      • getQualifiedNameParm

        protected ProgramParameter getQualifiedNameParm()
        Returns a program parameter to be used for IBM i Toolbox program calls that require the qualifed name of the validation list.

        The object name is set into the first 10 bytes of the parameter value. The library name is set into the next 10 bytes of the parameter value.

        Returns:
        com.ibm.as400.access.ProgramParameter
      • removeEntry

        public void removeEntry(ValidationListEntry entry)
                         throws PersistenceException
        Deletes the entry from the validation list.

        Note: The AS400 and Path properties must be set prior to calling this method.

        Parameters:
        entry - ValidationListEntry
        Throws:
        PersistenceException - If an error occurs while calling the IBM i validation list APIs.
      • setAS400

        public void setAS400(AS400 as400)
        Sets the IBM i system containing the validation list.
        Parameters:
        as400 - com.ibm.as400.access.AS400
      • setDescription

        public void setDescription(java.lang.String s)
        Sets the text description for the validation list object.

        Note: Only recognized if set prior to invoking the create() method.

        Parameters:
        s - java.lang.String
      • setPath

        public void setPath(QSYSObjectPathName path)
        Sets the location (library context) of the validation list.
        Parameters:
        path - com.ibm.as400.access.QSYSObjectPathName
      • verifyEntry

        public boolean verifyEntry(ValidationListEntry entry)
                            throws PersistenceException
        Verify that the encrypted information specified for the given entry is correct.

        The EntryID and DataToEncrypt must be specified for the entry prior to verification. Returns true if the data to encrypt matches the data already encrypted for the entry at that ID on the IBM i; otherwise returns false.

        Parameters:
        entry - ValidationListEntry
        Returns:
        boolean
        Throws:
        PersistenceException - If an error occurs while calling the IBM i APIs.