Rational Developer for Power Systems Software
V7.6

com.ibm.etools.iseries.comm.filters
Class ISeriesRecordFilterString

java.lang.Object
  extended by com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString
      extended by com.ibm.etools.iseries.comm.filters.ISeriesRecordFilterString

public class ISeriesRecordFilterString
extends ISeriesAbstractFilterString

A class representing an AS/400 Record filter string. This is a name pattern for returning lists of AS/400 records. Getting a list of records requires the library and file names to list in, and the name pattern for the records.

All this information can be specified by calling the setLibrary(String), setFile(String) and setRecord(String) methods. Alternatively, it can be set by passing in a filter string in the constructor. Filter strings for records are of the form: lib/file RCDNAME(rcd) where rcd is either an explicit record name or a generic record name.

The library and file names can also be generic, if you desire a list of records from more than one file. If the file name is generic , then it is possible multiple files from the same library will match the generic file name, with some of the files being data files and some of the files being device files. By default, you will get back the records for all files that match the name pattern given for the file.

In this case of a generic file name, you may call the method setObjectType(String) with "*FILE:" as the prefix and a file attribute name or generic name appended. For example, "*FILE:PF-DTA" or "*FILE:DSPF". These attributes are used restrict the list to specific file types. You can also specify multiple type:attr pairs as in setObjectType("*FILE:DSPF *FILE:PRTF");. Alternatively, in the filter given in this class' constructor, specify the optional filter keyword OBJTYPE. The valid forms of this are the same as the setObjectType method. For example, to get a list of all records in all data files whose name ends with "ACC" in all libraries in the user part of the library list, specify this on the constructor: *USRLIBL/*ACC(*) RCDNAME(*) OBJTYPE(*FILE:PF-DTA).

Note that OBJTYPE syntax follows the rules of the ISeriesObjectFilterString class, and indeed generic file names result in a call to the getList method of ISeriesListObjects to resolve the list of files, as part of the processing in the getList method of ISeriesListRecords.

Valid generic library, file, record and attribute names are names with one or two asterisks anywhere in the name, as in: ABC* or *ABC or A*C *ABC* or *A*C or A*C*

To get the actual filter string from objects of this class, just call toString().

Objects of this class are used in the ISeriesListRecords class for returning a list of information about each record meeting the filter's criteria.

See Also:
ISeriesListRecords

Field Summary
static String ALL
          Default value for file name, member name and member type is * (meaning all).
static String Copyright
           
static String DEFAULT_LIBRARY
          Default library name is *CURLIB
 
Fields inherited from class com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString
QUOTE, WILDCARD
 
Constructor Summary
ISeriesRecordFilterString()
          Constructor to use when there is no existing filter string.
ISeriesRecordFilterString(String input)
          Constructor to use when filter string already exists.
 
Method Summary
 String getFile()
          Return the file name part of this filter string.
 String getLibrary()
          Return the library name part of this filter string.
 String getObjectType()
          Retrieve the object type as specified on the setObjectType(String) method.
 String getRecord()
          Return the record name part of this filter string.
 boolean isGeneric()
          Returns true if current filter represents a generic name or vs a scalar name.
 boolean isMultiGeneric()
          Returns true if current filter represents a generic name that has more than one generic name part.
 void setFile(String obj)
          Set the name of the file containing the records to list.
 void setLibrary(String lib)
          Set the library name part of this filter string.
 void setObjectType(String type)
          Specify the type of files to list records in: data or device say.
 void setRecord(String rcd)
          Set the record name part of this filter string.
 String toString()
          Convert this filter into a filter string.
 
Methods inherited from class com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString
addQuotes, clone, countHostOccurrencesOf, countOccurrencesOf, createFilterStringObject, equals, hashCode, hostIndexOf, hostIndexOf, isGenericLibraryName, isGenericName, isQuoted, stripQuotes, verifyGenericName, verifyGenericNameAdvanced, verifyGenericNameAdvancedQuoted, verifyGenericNameQuoted
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values

DEFAULT_LIBRARY

public static final String DEFAULT_LIBRARY
Default library name is *CURLIB

See Also:
Constant Field Values

ALL

public static final String ALL
Default value for file name, member name and member type is * (meaning all).

See Also:
Constant Field Values
Constructor Detail

ISeriesRecordFilterString

public ISeriesRecordFilterString()
Constructor to use when there is no existing filter string. This results in a default filter of *CURLIB/* RCDNAME(*) OBJTYPE(*FILE:PF-DTA), which means list all records in all data files in the current library. To change any of the default values, after instantiation call:
  • setLibrary(String) to set the library name. Note this can be generic too, but this will result in a call to retrieve files in every library matching the library name pattern, and a subsequent call to retrieve records in every file found.
  • setFile(String) to set the file name. This can be a simple or generic name. If generic, you will get records from multiple files.
  • setRecord(String) to set the record name. This can be a simple record name or *FIRST or a generic name.
  • setObjectType(String) to set the file type. Ignored unless the file name is generic.


  • ISeriesRecordFilterString

    public ISeriesRecordFilterString(String input)
    Constructor to use when filter string already exists. Filter strings for records are of the form: lib/file RCDNAME(rcd) OBJTYPE(*FILE:attr) where :
  • lib is the library containing the file containing the records. This can be a single library name or a generic library name like *ABC or *ROLL*. Special values supported for library are *LIBL, *CURLIB, *USRLIBL and *ALLUSR. Note that *LIBL means all files matching the file name pattern, not the first library containing a match.
  • file is the file containing the records. This can be a single file name or a generic file name like *A* or *ROLL*.
  • rcd is the name or generic name of the records to list.
  • OBJTYPE is optional and only used when the file name is generic. This tells the list processor what type of files - data or device - to consider when resolving the list of files. Records in all files matching the file name and object type will be returned. The default is to consider only data files, but by specifying *FILE:PF-DSPF you can restrict it to display files, say. To get the actual filter string from object of this class, just call toString().

  • Method Detail

    getLibrary

    public String getLibrary()
    Return the library name part of this filter string.


    getFile

    public String getFile()
    Return the file name part of this filter string.


    getRecord

    public String getRecord()
    Return the record name part of this filter string.


    setLibrary

    public void setLibrary(String lib)
    Set the library name part of this filter string. This can be simple or generic, where generic is a name containing one or two asterisks anywhere in the name. If a generic library, such as *LIBL or A*, is specified then you will have a "multi-generic" filter that will result in a list containing records from more than one file.

    See Also:
    ISeriesListRecords

    setFile

    public void setFile(String obj)
    Set the name of the file containing the records to list. This can be simple or generic, where generic is a name containing one or two asterisks anywhere in the name. If generic, then you will have a "multi-generic" filter that will result in a list containing record from more than one file.


    setRecord

    public void setRecord(String rcd)
    Set the record name part of this filter string. This can be simple or generic, where generic is a name containing one or two asterisks anywhere in the name. It can also be *FIRST to indicate the first record.


    setObjectType

    public void setObjectType(String type)
    Specify the type of files to list records in: data or device say. This method is only needed when the file name is generic, and is ignored otherwise. The default for this is *FILE:PF-DTA.

    Parameters:
    type - The file type and file attribute to use when resolving a generic file name as part of processing this record filter. The type part must be *FILE, while the attribute part can be any database or device file attribute such as PF-DTA or DSPF. OBJTYPE(*FILE:PF-DTA) or OBJTYPE(*FILE:DSPF). Other values will be allowed but will just result in an empty list of records if no files are found matching that type. If the type given is not *FILE, or the attribute isn't data or device attributes, then you will probably also get an exception from the getList method when attempting to retrieve the list.
    See Also:
    ISeriesObjectFilterString

    getObjectType

    public String getObjectType()
    Retrieve the object type as specified on the setObjectType(String) method. This is only used when processing lists of fields where the file name is generic.


    toString

    public String toString()
    Convert this filter into a filter string. Filter strings for records are of the form: lib/file RCDNAME(rcd) where rcd is either an explicit record name or a generic record name or *FIRST to get the first record.

    Specified by:
    toString in class ISeriesAbstractFilterString

    isGeneric

    public boolean isGeneric()
    Returns true if current filter represents a generic name or vs a scalar name.

    Specified by:
    isGeneric in class ISeriesAbstractFilterString

    isMultiGeneric

    public boolean isMultiGeneric()
    Returns true if current filter represents a generic name that has more than one generic name part. For example, a multi-generic filter might ask to list all records in file QMYDATA in all libraries that start with A.

    Specified by:
    isMultiGeneric in class ISeriesAbstractFilterString

    Rational Developer for Power Systems Software
    V7.6

    Copyright 2011 IBM Corp. All Rights Reserved.

    Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.