Rational Developer for Power Systems Software
V7.6

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

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

public class ISeriesMemberFilterString
extends ISeriesAbstractFilterString

A class representing an AS/400 Member filter string. This is a name pattern for returning lists of AS/400 members when used as input to the ISeriesListMembers class (specifically the getList methods in this class).

Getting a list of members requires the library and files names to list in, the name pattern for the members and optionally a member type to use in subsetting the returned list.

All this information can be specified by calling setLibrary(String), setFile(String), setMember(String) and the setMemberType(String) methods. Alternatively, it can be set by passing in a filter string in the constructor.

Filter strings for objects are of the form: lib/file(mbr) MBRTYPE(type) where

No MBRTYPE clause is the same as MBRTYPE(*).

The library and file names can also be generic, if you desire a list of members 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 source files and some of the files being data files. By default, you will get back the members for all files that match the name pattern given for the file, and where the member type matches the member type or type pattern (generic name) given.

In this case of a generic file name, you may call the method setObjectType(String) with either "*FILE:PF-SRC" or "*FILE:PF-DTA" as parameters to restrict the list to source files or data files, respectively. NOTE: If you want to include DDM Files, you should also include *FILE:DDMF

Alternatively, in the filter given in this class' constructor, specify the optional filter keyword OBJTYPE. The valid forms of this are OBJTYPE(*FILE:PF-SRC) or OBJTYPE(*FILE:PF-DTA).

For example, to get a list of all members in all source files whose name ends with "ACC" in all libraries in the user part of the library list, specify this on the constructor: *USRLIBL/*ACC(*) MBRTYPE(*) OBJTYPE(*FILE:PF-SRC).

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 ISeriesListMembers.

Valid generic library names, file names and types 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().

See Also:
ISeriesListMembers

Field Summary
static String ALL
          Default value for file name, member name and member type is * (meaning all).
static String Copyright
           
static String DEFAULT_GENERIC_OBJTYPE
          Default value for OBJTYPE when generic library name is *FILE:PF* *FILE:DDMF
static String DEFAULT_LIBRARY
          Default library name is *CURLIB
static String DEFAULT_OBJTYPE
          Default value for OBJTYPE is *FILE:PF*
 
Fields inherited from class com.ibm.etools.iseries.comm.filters.ISeriesAbstractFilterString
QUOTE, WILDCARD
 
Constructor Summary
ISeriesMemberFilterString()
          Constructor to use when there is no existing filter string.
ISeriesMemberFilterString(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 getMember()
          Return the member name part of this filter string.
 String getMemberType()
          Return the member type part of this filter string as a blank delimited list of types.
 String[] getMemberTypeArray()
          Return the member types part of this filter string as an array of Strings, with each String in the array representing a single type like RPGLE.
 String getObjectType()
          Retrieve the object type as specified on the setObjectType(String) method.
 boolean isGeneric()
          Returns true if current filter represents a generic name versus 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 members to list.
 void setLibrary(String lib)
          Set the library name part of this filter string.
 void setMember(String mbr)
          Set the member name part of this filter string.
 void setMemberType(String type)
          Set the member type part of this filter string given a string of blank-delimited types.
 void setMemberTypes(String[] types)
          Set the member type part of this filter string given an array of individual types.
 void setObjectType(String type)
          Specify the type of files to list members in: source or data.
 String toString()
          Convert this filter into a filter string.
static boolean verifyMemberType(String type)
          Verify a member type is valid.
 
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

DEFAULT_OBJTYPE

public static final String DEFAULT_OBJTYPE
Default value for OBJTYPE is *FILE:PF*

See Also:
Constant Field Values

DEFAULT_GENERIC_OBJTYPE

public static final String DEFAULT_GENERIC_OBJTYPE
Default value for OBJTYPE when generic library name is *FILE:PF* *FILE:DDMF

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

ISeriesMemberFilterString

public ISeriesMemberFilterString()
Constructor to use when there is no existing filter string. This results in a default filter of *CURLIB/*(*) MBRTYPE(*) OBJTYPE(*FILE:PF*), which means list all members in all source or data files in the current library. That could be a lot! 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 members in every file found.
  • setFile(String) to set the file name. This can be a simple or generic name. If generic, you will get members from multiple files.
  • setMember(String) to set the member name pattern.. This can be a simple or generic name.
  • setMemberType(String) to set the member type. This will result in a list of members subsetted to only those which have this type. The type can be generic, as in RPG* to get all members whose type starts with "RPG".
  • setObjectType(String) to set the file type when the library or file name is generic. Valid generic names have one or two asterisks anywhere in the name. A single asterisk means all.


  • ISeriesMemberFilterString

    public ISeriesMemberFilterString(String input)
    Constructor to use when filter string already exists. Filter strings for member lists are of the form: lib/file(mbr) MBRTYPE(type) OBJTYPE(*FILE:attr) where:
  • lib is the library containing the file containing the members. 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.
  • file is the file containing the members. This can be a single file name or a generic file name like *A* or *ROLL*.
  • mbr is the name or generic name of the members to list.
  • MBRTYPE specifies a single or generic member type to subset the list, as in RPGLE or RPG* or * for no subsetting by type. You can specify only one type or a list of blank-separated types. Only members whose type matches any one of the given types will be returned in the list from ISeriesListMembers.
  • OBJTYPE is optional and only used when the file name is generic. This tells the list processor what type of files - source or data - to consider when resolving the list of files. Members in all files matching the file name and object type will be returned. The default is to consider both data and source files, but by specifying *FILE:PF-SRC you can restrict it to source files, and by specifying *FILE:PF-DTA you can restrict it to data files. If specified, OBJTYPE must appear physically after the MBRTYPE keyword. Valid generic library names, file names and types 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 back from objects 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.


    getMember

    public String getMember()
    Return the member name part of this filter string.


    getMemberType

    public String getMemberType()
    Return the member type part of this filter string as a blank delimited list of types. Since it is possible to specify multiple member types, blank separated, this is in fact a blank separated list of types. You may find it easier to use getMemberTypeArray() which returns each type as an array of String objects.


    getMemberTypeArray

    public String[] getMemberTypeArray()
    Return the member types part of this filter string as an array of Strings, with each String in the array representing a single type like RPGLE.


    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 members from more than one file.

    See Also:
    ISeriesListMembers

    setFile

    public void setFile(String obj)
    Set the name of the file containing the members 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 members from more than one file.


    setMember

    public void setMember(String mbr)
    Set the member 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.


    setMemberType

    public void setMemberType(String type)
    Set the member type part of this filter string given a string of blank-delimited types. Each type can be simple or generic, where generic is a name containing one or two asterisks anywhere in the name. Use "*" to not subset by type.

    See Also:
    setMemberTypes(String[])

    setMemberTypes

    public void setMemberTypes(String[] types)
    Set the member type part of this filter string given an array of individual types. Each type can be simple or generic, where generic is a name containing one or two asterisks anywhere in the name. Use "*" to not subset by type.

    See Also:
    setMemberType(String)

    setObjectType

    public void setObjectType(String type)
    Specify the type of files to list members in: source or data. This method is only needed when the file name is generic, and is ignored otherwise.

    The default for this is *FILE:PF*.

    Parameters:
    type - The file type and file attribute to use when resolving a generic file name as part of processing this member filter. The only valid values are OBJTYPE(*FILE:PF-SRC), OBJTYPE(*FILE:PF-DTA) or OBJTYPE(*FILE:PF*).

    Other values will be allowed but will just result in an empty list of members if no files are found matching that type. If the type given is not *FILE, then you will probably also get an exception from the getList method when attempting to retrieve the list.

    See Also:
    ISeriesListMembers, ISeriesListObjects, ISeriesObjectFilterString

    getObjectType

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


    toString

    public String toString()
    Convert this filter into a filter string. Filter strings for member lists are of the form: lib/file(mbr) MBRTYPE(type) OBJTYPE(*FILE:attr) where:
  • lib is the library containing the file containing the members. 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.
  • file is the file containing the members. This can be a single file name or a generic file name like *A* or *ROLL*.
  • mbr is the name or generic name of the members to list.
  • MBRTYPE specifies a single or generic member type to subset the list, as in RPGLE or RPG* or * for no subsetting by type. You can specify only one type or a list of blank-separated types. Only members whose type matches any one of the given types will be returned in the list from ISeriesListMembers.
  • OBJTYPE is optional and only included when the file name is generic. This tells the list processor what type of files - source or data - to consider when resolving the list of files. Members in all files matching the file name and object type will be returned.

    Specified by:
    toString in class ISeriesAbstractFilterString

  • isGeneric

    public boolean isGeneric()
    Returns true if current filter represents a generic name versus a scalar name. This is true if the libary name is generic but not *CURLIB, the file name is generic or the member name is generic. The member type is not considered.

    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 members in file QRPGLESRC in all libraries that start with A. This is true if the library name is generic but not *CURLIB, or the file name is generic.

    Specified by:
    isMultiGeneric in class ISeriesAbstractFilterString

    verifyMemberType

    public static boolean verifyMemberType(String type)
    Verify a member type is valid. We cannot be too overzealous in checking for valid types since we can't predict all the types. So we just check the length and ensure it is not quoted.


    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.