|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.jzos.CatalogSearch
public class CatalogSearch
A class that provides a Java interface to the z/OS Catalog Search Interface.
Usage Information:
addFieldName(String)
.
search()
method.
Iterator
interface, so next()
and hasNext() can be used to iterate over the returned results.
next()
returns a CatalogSearch.Entry
. This entry is either
a catalog entry or dataset entry. A catalog entry is returned at the beginning of
each work area and whenever a new catalog is encountered by the
Catalog Search Interface (CSI). Dataset entries are returned for each dataset that
matches the filter key.
CatalogSearch.Entry.getField(String)
method can be
used to retrieve any of the fields requested with the search criteria. Fields are
returned as instances of CatalogSearchField
.
hasNext()
returns false.
Error handling: This class provides access to all of the error information emitted by the Catalog Search Interface.
RcException
is thrown. If the
return code is either 4 or 8, additional information can be obtained by examining
the catalog search reason area (methods getRc()
and getReason()
).
In order to interpret these codes, the IBM
lookat facility
can be used along with message ID IDC3009I.
CatalogSearch.Entry.hasError()
, CatalogSearch.Entry.getRc()
, and CatalogSearch.Entry.getReason()
can be used to obtain more information about entry level errors.
For detailed information on the Catalog Search Interface, see Appendix C of the following:
This Uses JNI wrappers to the Catalog Search Interface (IGGCSI00).
Nested Class Summary | |
---|---|
class |
CatalogSearch.Entry
A static inner class of CatalogSearch which holds a catalog search entry. |
Field Summary | |
---|---|
static byte |
CATALOG_TYPE
|
static int |
DEFAULT_WORK_AREA_LENGTH
|
static byte |
FLAG_CSICERR
|
static byte |
FLAG_CSICERRP
|
static byte |
FLAG_CSIEDATA
|
static byte |
FLAG_CSIENTER
|
static byte |
FLAG_CSINOENT
|
static byte |
FLAG_CSINTCMP
|
static byte |
FLAG_CSINTICF
|
static byte |
FLAG_CSIPMENT
|
static int |
MAX_FIELD_NAMES
|
static int |
MAX_WORK_AREA_LENGTH
|
static int |
MIN_WORK_AREA_LENGTH
|
Constructor Summary | |
---|---|
CatalogSearch(java.lang.String filterKey)
Construct a CatalogSearch with a filterKey and default work area. |
|
CatalogSearch(java.lang.String filterKey,
int workAreaLength)
Construct a CatalogSearch with a filterKey and custom work area. |
Method Summary | |
---|---|
void |
addFieldName(java.lang.String fieldName)
Specify a field name to be returned with the search results. |
java.util.List |
getFieldNames()
Return the list of field names that have been set via addFieldName(String) . |
java.lang.String |
getModuleId()
Return the reason area reason code. |
int |
getRc()
Return the reason area return code. |
int |
getReason()
Return the reason area reason code. |
boolean |
hasNext()
Return true if there is at least one more entry available from the search, false otherwise |
java.lang.Object |
next()
Return the next Entry from the search. |
void |
remove()
Unsupported Iterator interface method |
void |
search()
Initiate the catalog search. |
void |
setCatalogName(java.lang.String catalogName)
Set the name of the catalog to search. |
void |
setEntryTypes(java.lang.String entryTypes)
|
void |
setFullwordLengths(boolean fullwordLengths)
Specify whether the data lengths for variable field data are 4 bytes or 2 bytes. |
void |
setSingleCatalog(boolean singleCatalog)
Specify whether a single catalog is to be searched. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte CATALOG_TYPE
public static final byte FLAG_CSINTICF
public static final byte FLAG_CSINOENT
public static final byte FLAG_CSINTCMP
public static final byte FLAG_CSICERR
public static final byte FLAG_CSICERRP
public static final byte FLAG_CSIPMENT
public static final byte FLAG_CSIENTER
public static final byte FLAG_CSIEDATA
public static final int DEFAULT_WORK_AREA_LENGTH
public static final int MIN_WORK_AREA_LENGTH
public static final int MAX_WORK_AREA_LENGTH
public static final int MAX_FIELD_NAMES
Constructor Detail |
---|
public CatalogSearch(java.lang.String filterKey)
filterKey
- the search string.public CatalogSearch(java.lang.String filterKey, int workAreaLength)
filterKey
- the search string.workAreaLength
- the size of the work area to be returned by the
catalog search interface.
java.lang.IllegalArgumentException
- if the workAreaLength is too small or
too large.Method Detail |
---|
public void setCatalogName(java.lang.String catalogName)
catalogName
- the catalogName to search. If null (the default), Catalog Management
will attempt to use the high-level qualifier of the filter key to locate an alias that
matches. If an alias is found, the user catalog for that alias will be searched; then,
the master catalog will be searched. The master catalog will not be searched if
single catalog searching is set. If no alias is found, only the master catalog will be searched.
java.lang.IllegalStateException
- if called on an active searchsetSingleCatalog(boolean)
public void setEntryTypes(java.lang.String entryTypes)
entryTypes
- determines what type of catalog entries will be returned.
Valid types for CSIDTYPS are:
The valid types can be mixed and in any order. Blanks cannot separate the types. For instance, “ABH� might be specified to get only the non-VSAM, generation data group and generation data set entries. All other positions in CSIDTYPS must be blanks (X'40') when the types are specified. The default (null) will get types A, B, C, G, H, R, X, U. These are the catalog types. L and W must be explicitly specified in order to get the Tape Volume Catalog entries.
java.lang.IllegalStateException
- if called on an active searchpublic void addFieldName(java.lang.String fieldName)
fieldName
- a field to return in the search results.
java.lang.IllegalArgumentException
- if more than MAX_FIELD_NAMES
fields are added.
java.lang.IllegalStateException
- if called on an active searchpublic void setFullwordLengths(boolean fullwordLengths)
fullwordLengths
- if true, 4 byte data lengths will be used. If false (the default)
2 bytes lengths will be used.
java.lang.IllegalStateException
- if called on an active searchpublic void setSingleCatalog(boolean singleCatalog)
singleCatalog
- if true, only a single catalog will be searched. If false
(the default) multiple catalogs will be searched.
java.lang.IllegalStateException
- if called on an active searchsetCatalogName(String)
public void search()
hasNext()
and next()
can be used.
RcException
- if an error is encountered. See the class comment and the
Catalog Search documentation for more information on how to interpret the error
information.public int getRc()
public int getReason()
public java.lang.String getModuleId()
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
RcException
- if an error is encountered. See the class comment and the
Catalog Search documentation for more information on how to interpret the error
information.public void remove()
remove
in interface java.util.Iterator
public java.util.List getFieldNames()
addFieldName(String)
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |