com.ibm.as400.access

Class MemberDescription

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


  • public class MemberDescription
    extends java.lang.Object
    Represents a database file member and its attributes. MemberDescription objects can be constructed individually, or generated by MemberList.getMemberDescriptions(). A member's attributes can be retrieved by calling getValue() and passing one of the attribute identifier constants defined in this class.

    Note: String data is always stored and returned without trailing blanks.

    Performance hint: If you anticipate retrieving multiple attributes for a given member, first call refresh(), which will make a single API call to retrieve (and cache) all of the member's attribute values.

    Implementation note: This class internally calls the "Retrieve Member Description" (QUSRMBRD) API. Information from formats MBRD0100, MBRD0200, and MBRD0300 is retrieved.

    This class is mostly based on a prototype contributed by Mihael Schmidt.

    See Also:
    MemberList, AS400File, ObjectDescription
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int ACCESS_PATH_MAINTENANCE
      Specifies, for files with key fields or join logical files, the type of access path maintenance used for all members of the physical or logical file.
      static int ACCESS_PATH_SIZE
      The access path size in bytes for this file member.
      static int ACCESS_PATH_SIZE_MULTIPLIER
      The value to multiply the access path size by to get its true size.
      static int ALLOW_DELETE_OPERATION
      Whether records in this file can be deleted.
      static int ALLOW_READ_OPERATION
      Whether records in the physical file can be read.
      static int ALLOW_UPDATE_OPERATION
      Whether records in this file can be updated.
      static int ALLOW_WRITE_OPERATION
      Whether records can be written to the file.
      static int CHANGE_DATE_AND_TIME
      The date and time this member was changed.
      static int CREATION_DATE_TIME
      The date and time the member was created.
      static int CURRENT_NUMBER_OF_INCREMENTS
      The number of increments that have been added to the member size (data space size).
      static int CURRENT_NUMBER_OF_RECORDS
      The number of records that currently exist in this member.
      static int DATA_SPACE_SIZE
      The size of the space that contains the data of the file member, in bytes.
      static int DATA_SPACE_SIZE_MULTIPLIER
      The value to multiply the data space size by to get its true size.
      static int DATE_LAST_USED
      The century and date this member was last used.
      static int EXPIRATION_DATE
      The date that this member expires.
      static int FILE_ATTRIBUTE
      The type of file found.
      static int FILE_NAME
      The name of the database file whose member names are placed in the list.
      static int INCREMENT_NUMBER_OF_RECORDS
      The maximum number of records that are automatically added to the member when the number of records in the member is greater than the initial member size.
      static int INITIAL_NUMBER_OF_RECORDS
      The number of records that can be written to each member of the file before the member size is automatically extended.
      static int JOIN_MEMBER
      Whether the member's logical file member combines (in one record format) fields from two or more physical file members (true = join member, false = not a join member).
      static int LAST_SOURCE_CHANGE_DATE
      For source files, the date and time that this source member was last changed.
      static int LIBRARY_NAME
      The name of the library where the database file is located.
      static int LOGICAL_FILE
      Whether the database file is a logical or physical file (true = logical file, false = physical file).
      static int MAXIMUM_NUMBER_OF_INCREMENTS
      The maximum number of increments automatically added to the member size.
      static int MAXIMUM_PERCENT_DELETED_RECORDS_ALLOWED
      The maximum allowed percentage of deleted records for each member in the physical file.
      static int MEMBER_NAME
      The name of a member found in the database file.
      static int MEMBER_TEXT_DESCRIPTION
      Description of the member found in the database file.
      static int MEMBER_TEXT_DESCRIPTION_CCSID
      The CCSID for the member text description.
      static int NUMBER_OF_BASED_ON_PHYICAL_FILE_MEMBERS
      The number of database file members for the logical file member.
      static int NUMBER_OF_DAYS_USED
      The number of days the member has been used.
      static int NUMBER_OF_DELETED_RECORDS
      The number of deleted records returned in the file member.
      static int ODP_SHARING
      Whether the open data path (ODP) allows sharing with other programs in the same job (true = ODP sharing is allowed, false = ODP sharing is not allowed).
      static int RECORD_CAPACITY
      The actual number of records this member can contain.
      static int RECORD_FORMAT_SELECTOR_LIBRARY_NAME
      The library in which the record format selector program resides.
      static int RECORD_FORMAT_SELECTOR_PROGRAM_NAME
      The name of a record format selector program that is called when the logical file member contains more than one logical record format.
      static int RECORDS_TO_FORCE_A_WRITE
      The number of inserted, updated, or deleted records that are processed before the records are forced into auxiliary storage.
      static int REMOTE_FILE
      Whether the database file is a remote file (true = remote file, false = local file).
      static int RESTORE_DATE_AND_TIME
      The date and time that the member was last restored.
      static int SAVE_DATE_AND_TIME
      The date and time that this member was last saved.
      static int SOURCE_FILE
      Whether the database file is a source file or a data file.
      static int SOURCE_TYPE
      The type of source member if this is a source file.
      static int SQL_FILE_TYPE
      The kind of SQL file type the file is.
      static int USE_RESET_DATE
      The century and date when the days-used count was last set to 0.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      java.lang.String getPath()
      Returns the IFS path of this member.
      java.lang.Object getValue(int attribute)
      Returns the requested member attribute information object.
      void refresh()
      Retrieves (and caches) all attributes of this member from the system.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • FILE_NAME

        public static final int FILE_NAME
        The name of the database file whose member names are placed in the list. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
      • LIBRARY_NAME

        public static final int LIBRARY_NAME
        The name of the library where the database file is located. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
      • MEMBER_NAME

        public static final int MEMBER_NAME
        The name of a member found in the database file. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
      • FILE_ATTRIBUTE

        public static final int FILE_ATTRIBUTE
        The type of file found. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
      • SOURCE_TYPE

        public static final int SOURCE_TYPE
        The type of source member if this is a source file. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
      • CREATION_DATE_TIME

        public static final int CREATION_DATE_TIME
        The date and time the member was created. Attribute type: java.util.Date.
        See Also:
        Constant Field Values
      • LAST_SOURCE_CHANGE_DATE

        public static final int LAST_SOURCE_CHANGE_DATE
        For source files, the date and time that this source member was last changed. For SQL materialized query tables, the date and time that the last SQL Refresh Table statement refreshed this member. Attribute type: java.util.Date (may be null).
        See Also:
        Constant Field Values
      • MEMBER_TEXT_DESCRIPTION

        public static final int MEMBER_TEXT_DESCRIPTION
        Description of the member found in the database file. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
      • SOURCE_FILE

        public static final int SOURCE_FILE
        Whether the database file is a source file or a data file. Attribute type: java.lang.Boolean.
        See Also:
        Constant Field Values
      • REMOTE_FILE

        public static final int REMOTE_FILE
        Whether the database file is a remote file (true = remote file, false = local file). Attribute type: java.lang.Boolean.
        See Also:
        Constant Field Values
      • LOGICAL_FILE

        public static final int LOGICAL_FILE
        Whether the database file is a logical or physical file (true = logical file, false = physical file). Attribute type: java.lang.Boolean.
        See Also:
        Constant Field Values
      • ODP_SHARING

        public static final int ODP_SHARING
        Whether the open data path (ODP) allows sharing with other programs in the same job (true = ODP sharing is allowed, false = ODP sharing is not allowed). Attribute type: java.lang.Boolean.
        See Also:
        Constant Field Values
      • CURRENT_NUMBER_OF_RECORDS

        public static final int CURRENT_NUMBER_OF_RECORDS
        The number of records that currently exist in this member. A logical member returns the summarization of index entries. If the requested physical file member is suspended, the value 0 is returned. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • DATA_SPACE_SIZE

        public static final int DATA_SPACE_SIZE
        The size of the space that contains the data of the file member, in bytes. A logical file returns a 0. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • ACCESS_PATH_SIZE

        public static final int ACCESS_PATH_SIZE
        The access path size in bytes for this file member. If the file member is not keyed, the value 0 is returned. DDM files, which are not from a System/38 or iSeries system, return value 0. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • NUMBER_OF_BASED_ON_PHYICAL_FILE_MEMBERS

        public static final int NUMBER_OF_BASED_ON_PHYICAL_FILE_MEMBERS
        The number of database file members for the logical file member. If the member is a physical file member, the value is 0. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • CHANGE_DATE_AND_TIME

        public static final int CHANGE_DATE_AND_TIME
        The date and time this member was changed. The value contains null if the member was never changed. Attribute type: java.util.Date.
        See Also:
        Constant Field Values
      • SAVE_DATE_AND_TIME

        public static final int SAVE_DATE_AND_TIME
        The date and time that this member was last saved. The value contains null if the member was never saved. Attribute type: java.util.Date.
        See Also:
        Constant Field Values
      • RESTORE_DATE_AND_TIME

        public static final int RESTORE_DATE_AND_TIME
        The date and time that the member was last restored. The value contains null if the member was never restored. Attribute type: java.util.Date.
        See Also:
        Constant Field Values
      • EXPIRATION_DATE

        public static final int EXPIRATION_DATE
        The date that this member expires. Attribute type: java.util.Date.
        See Also:
        Constant Field Values
      • NUMBER_OF_DAYS_USED

        public static final int NUMBER_OF_DAYS_USED
        The number of days the member has been used. If the member does not have a last-used date, the value 0 is returned. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • DATE_LAST_USED

        public static final int DATE_LAST_USED
        The century and date this member was last used. The value contains null if the member was never used. Attribute type: java.util.Date.
        See Also:
        Constant Field Values
      • USE_RESET_DATE

        public static final int USE_RESET_DATE
        The century and date when the days-used count was last set to 0. If the date is not available the value contains null. Attribute type: java.util.Date.
        See Also:
        Constant Field Values
      • DATA_SPACE_SIZE_MULTIPLIER

        public static final int DATA_SPACE_SIZE_MULTIPLIER
        The value to multiply the data space size by to get its true size. Typically this is 1, but for large files, the value may be greater than 1. If the data space size multiplier is greater than 1, then the value in the data space size field is not the actual size of the file. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • ACCESS_PATH_SIZE_MULTIPLIER

        public static final int ACCESS_PATH_SIZE_MULTIPLIER
        The value to multiply the access path size by to get its true size. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • MEMBER_TEXT_DESCRIPTION_CCSID

        public static final int MEMBER_TEXT_DESCRIPTION_CCSID
        The CCSID for the member text description. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • NUMBER_OF_DELETED_RECORDS

        public static final int NUMBER_OF_DELETED_RECORDS
        The number of deleted records returned in the file member. Keyed logical files return a 0. DDM files that are not from a System/38 or iSeries system return a 0. If the requested physical file member is suspended, the value 0 is returned. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • JOIN_MEMBER

        public static final int JOIN_MEMBER
        Whether the member's logical file member combines (in one record format) fields from two or more physical file members (true = join member, false = not a join member). Attribute type: java.lang.Boolean.
        See Also:
        Constant Field Values
      • ACCESS_PATH_MAINTENANCE

        public static final int ACCESS_PATH_MAINTENANCE
        Specifies, for files with key fields or join logical files, the type of access path maintenance used for all members of the physical or logical file. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
      • SQL_FILE_TYPE

        public static final int SQL_FILE_TYPE
        The kind of SQL file type the file is. If the file isn't an SQL file, blank is returned. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
      • ALLOW_READ_OPERATION

        public static final int ALLOW_READ_OPERATION
        Whether records in the physical file can be read. Values: Y/N. Attribute type: java.lang.Boolean.
        See Also:
        Constant Field Values
      • ALLOW_WRITE_OPERATION

        public static final int ALLOW_WRITE_OPERATION
        Whether records can be written to the file. Values: Y/N. Attribute type: java.lang.Boolean.
        See Also:
        Constant Field Values
      • ALLOW_UPDATE_OPERATION

        public static final int ALLOW_UPDATE_OPERATION
        Whether records in this file can be updated. Values: Y/N. Attribute type: java.lang.Boolean.
        See Also:
        Constant Field Values
      • ALLOW_DELETE_OPERATION

        public static final int ALLOW_DELETE_OPERATION
        Whether records in this file can be deleted. Values: Y/N. Attribute type: java.lang.Boolean.
        See Also:
        Constant Field Values
      • RECORDS_TO_FORCE_A_WRITE

        public static final int RECORDS_TO_FORCE_A_WRITE
        The number of inserted, updated, or deleted records that are processed before the records are forced into auxiliary storage. A 0 indicates that records are not forced into auxiliary storage. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • MAXIMUM_PERCENT_DELETED_RECORDS_ALLOWED

        public static final int MAXIMUM_PERCENT_DELETED_RECORDS_ALLOWED
        The maximum allowed percentage of deleted records for each member in the physical file. The percentage check is made when the member is closed. If the percentage of deleted records is greater than the value shown, a message is sent to the history log. This field only applies to physical files and is 0 when either no deleted records are allowed or the file is a logical file. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • INITIAL_NUMBER_OF_RECORDS

        public static final int INITIAL_NUMBER_OF_RECORDS
        The number of records that can be written to each member of the file before the member size is automatically extended. This field applies only to physical files and is 0 for logical files. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • INCREMENT_NUMBER_OF_RECORDS

        public static final int INCREMENT_NUMBER_OF_RECORDS
        The maximum number of records that are automatically added to the member when the number of records in the member is greater than the initial member size. This field applies only to physical files and is 0 for logical files. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • MAXIMUM_NUMBER_OF_INCREMENTS

        public static final int MAXIMUM_NUMBER_OF_INCREMENTS
        The maximum number of increments automatically added to the member size. This field only applies to physical files and is 0 for a logical file. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • CURRENT_NUMBER_OF_INCREMENTS

        public static final int CURRENT_NUMBER_OF_INCREMENTS
        The number of increments that have been added to the member size (data space size). This field is 0 for logical files because the number of increments only applies to physical files. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • RECORD_CAPACITY

        public static final int RECORD_CAPACITY
        The actual number of records this member can contain. The value is calculated by multiplying the increment number of records by the maximum number of increments, and adding the initial number of records. This field only applies to a physical file and is 0 for a logical file. Attribute type: java.lang.Integer.
        See Also:
        Constant Field Values
      • RECORD_FORMAT_SELECTOR_PROGRAM_NAME

        public static final int RECORD_FORMAT_SELECTOR_PROGRAM_NAME
        The name of a record format selector program that is called when the logical file member contains more than one logical record format. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
      • RECORD_FORMAT_SELECTOR_LIBRARY_NAME

        public static final int RECORD_FORMAT_SELECTOR_LIBRARY_NAME
        The library in which the record format selector program resides. This field is blank for physical files. Attribute type: java.lang.String.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MemberDescription

        public MemberDescription(AS400 system,
                         java.lang.String path)
        Constructs an MemberDescription.
        Parameters:
        system - The system.
        path - The fully-qualified integrated file system path to the database file member. Consider using QSYSObjectPathName to compose the fully-qualified path string, or using MemberDescription(AS400,QSYSObjectPathName) instead.
      • MemberDescription

        public MemberDescription(AS400 system,
                         QSYSObjectPathName path)
        Constructs a MemberDescription object.
        Parameters:
        system - The system.
        path - The fully-qualified integrated file system path to the database file member. Consider using QSYSObjectPathName to compose the fully-qualified path string.
      • MemberDescription

        public MemberDescription(AS400 system,
                         java.lang.String libraryName,
                         java.lang.String objectName,
                         java.lang.String memberName)
        Constructs a MemberDescription object.
        Parameters:
        system - AS400 system object
        libraryName - Library where the database file is located.
        objectName - The name of the database file.
        memberName - The name of the member within the database file.