com.ibm.as400.access

Class ValidationListAttribute



  • public class ValidationListAttribute
    extends Object
    Represents an attribute assigned to an entry in a validation list. Each validation list entry may contain one or more attributes. For each attribute, there is an associated value.
    Author:
    Thomas Johnson (tom.johnson@kingland.com), Kingland Systems Corporation
    • Constructor Detail

      • ValidationListAttribute

        public ValidationListAttribute()
        Constructs a validation list attribute.
      • ValidationListAttribute

        public ValidationListAttribute(AS400 as400)
        Constructs a validation list attribute.

        The as400 is used to translate the assigned identifier when converted to IBM i bytes.

        Parameters:
        as400 - com.ibm.as400.access.AS400

    • Method Detail

      • getAS400

        public AS400 getAS400()
        Returns the system assigned to the attribute.

        Used to translate the assigned identifier when converted to IBM i bytes.

        Returns:
        com.ibm.as400.access.AS400
      • getByteLength

        public int getByteLength()
        Returns the total length of the corresponding structure when this object is written to IBM i bytes for use by the validation list APIs.

        The size varies based on usage of the receiver. If there is no associated data, it is assumed that the structure being written is to identify an attribute to be retrieved (eg. find an entry). If there is associated data, it is assumed the structure will be used when adding a new entry or changing an existing entry.

        Returns:
        int
      • getData

        public ValidationListAttributeData getData()
        Returns the data associated with the attribute.

        This value is required when the attribute is referenced to add a new entry or change an existing entry. It should not be set when the attribute is used to identify values to retrieve (eg. when finding an entry).

        Returns:
        ValidationListAttributeData
      • getIdentifier

        public String getIdentifier()
        Returns the identifier of the attribute.

        For system-defined attributes, the allowed values are:

        • QsyEncryptData - Associated with the data to encrypt.

          If the QsyEncryptData attribute is set to 0, the data to be encrypted can only be used to verify an entry and cannot be retrieved later. This is the default.

          If the attribute is set to 1, the data to be encrypted can be used to verify an entry and can potentially be returned on a find operation. The system value QRETSVRSEC (Retain system security data) has the final say in determining if the data can be retrieved from the entry. If the system value is set to 0 (Do not retain data), the entry will be added, but the data to be encrypted will not be stored with the entry and cannot be retrieved. If the system value is set to 1 (Retain data), then the data to be encrypted will be stored (in encrypted form) with the entry and can be retrieved.

        Returns:
        java.lang.String
      • getLocation

        public int getLocation()
        Indicates where the attribute should be stored. The allowed values are:
        • 0 - The attribute is stored in the validation list object.
        Returns:
        int
      • getMaximumValueLength

        public int getMaximumValueLength()
        Returns the maximum length of the value associated with the attribute.

        This value is referenced when invoking APIs that need to indicate a length for the buffer used to retrieve the attribute value.

        Returns:
        int
      • getType

        public int getType()
        Returns the attribute type. The allowed values are:
        • 0 - This is a system-defined attribute.
        Returns:
        int
      • setAS400

        public void setAS400(AS400 as400)
        Sets the system assigned to the attribute.

        Used to translate the assigned identifier when converted to IBM i bytes.

        Parameters:
        as400 - com.ibm.as400.access.AS400
      • setData

        public void setData(ValidationListAttributeData data)
        Sets the data associated with the attribute.

        This value is required when the attribute is referenced to add a new entry or change an existing entry. It should not be set when the attribute is used to identify values to retrieve (eg. when finding an entry).

        Parameters:
        data - ValidationListAttributeData
      • setIdentifier

        public void setIdentifier(String s)
        Sets the identifier of the attribute.

        For system-defined attributes, the allowed values are:

        • QsyEncryptData - Associated with the data to encrypt.

          If the QsyEncryptData attribute is set to 0, the data to be encrypted can only be used to verify an entry and cannot be retrieved later. This is the default.

          If the attribute was set to 1, the data to be encrypted can be used to verify an entry and can potentially be returned on a find operation. The system value QRETSVRSEC (Retain system security data) has the final say in determining if the data can be retrieved from the entry. If the system value is set to 0 (Do not retain data), the entry will be added, but the data to be encrypted will not be stored with the entry and cannot be retrieved. If the system value is set to 1 (Retain data), then the data to be encrypted will be stored (in encrypted form) with the entry and can be retrieved.

        Parameters:
        s - java.lang.String
      • setLocation

        public void setLocation(int location)
        Indicates where the attribute should be stored. The allowed values are:
        • 0 - The attribute is stored in the validation list object.
        Parameters:
        location - int
      • setMaximumValueLength

        public void setMaximumValueLength(int length)
        Sets the maximum length of the value associated with the attribute.

        This value is referenced when invoking APIs that need to indicate a length for the buffer used to retrieve the attribute value.

        Parameters:
        length - int
      • setType

        public void setType(int type)
        Returns the attribute type. The allowed values are:
        • 0 - This is a system-defined attribute.
        Parameters:
        type - int
      • toBytes

        public byte[] toBytes()
        Returns the byte array resulting from converting this object to a structure usable by the system APIs.
        Returns:
        byte[]
      • toBytes

        public int toBytes(byte[] buffer,
                  int offset)
        Converts this object to a structure usable by the system APIs.

        The IBM i bytes are inserted into the buffer starting at the given offset. The total number of bytes inserted is returned.

        Parameters:
        buffer - byte[]
        offset - int
        Returns:
        int