com.ibm.iseries.collectionservices
Class MgtcolObj

java.lang.Object
  |
  +--com.ibm.iseries.collectionservices.MgtcolObj

public class MgtcolObj
extends java.lang.Object

MgtcolObj class is a Java equivalent of Collection Services Collection Object APIs.
For more information about Collection Object APIs, go to iSeries Information Center.

Since:
V5R2M0

Field Summary
static java.lang.String copyright
           
 
Constructor Summary
MgtcolObj(java.lang.String objectName, java.lang.String libraryName)
           
 
Method Summary
 void close()
          This method will close Management Collection Object, previously opened by open() method.
 void closeRepository(int repositoryHandle)
          This method will close repository of Management Collection Object, previously opened by openRepository() method.
 java.lang.String getLibrary()
           
 java.lang.String getName()
           
 void open()
          This method will open Management Collection Object for processing.
 int openRepository(java.lang.String repositoryName, java.lang.String format)
          This method will open repository of Management Collection Object for processing.
 void readData(int repositoryHandle, MgtcolObjReadOptions readOptions, MgtcolObjRecInfo recInfo, byte[] recordData)
          This method will position to a specified record of a repository in a Management Collection Object, return information about this record and return specified part of record data for this record.
static MgtcolObj rtvActive()
          This method creates an object of MgtcolObj class, representing an active Management Collection Object.
 MgtcolObjAttributes rtvAttributes(java.lang.String format)
          This method returns information about attributes of a Management Collection Object and its repositories.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Constructor Detail

MgtcolObj

public MgtcolObj(java.lang.String objectName,
                 java.lang.String libraryName)
Parameters:
objectName - Name of the Management Collection Object, being represented by this object of MgtcolObj class
libraryName - Name of the library where Management Collection Object resides
Method Detail

getName

public java.lang.String getName()
Returns:
name of the Management Collection Object represented by this object of MgtcolObj class.

getLibrary

public java.lang.String getLibrary()
Returns:
library of the Management Collection Object represented by this object of MgtcolObj class.

rtvActive

public static MgtcolObj rtvActive()
                           throws MgtcolObjException
This method creates an object of MgtcolObj class, representing an active Management Collection Object. Active Management Collection Object is the one, which is currently used by Collection Services collector.

rtvActive() method is a Java counterpart of Retrieve Active Management Collection Object Name (QpmRtvActiveMgtcolName) API.

Returns:
object of MgtcolObj class.
Throws:
MgtcolObjException - if collector is not running or errors are encountered in the process.

rtvAttributes

public MgtcolObjAttributes rtvAttributes(java.lang.String format)
                                  throws MgtcolObjException
This method returns information about attributes of a Management Collection Object and its repositories.

rtvAttributes() method is a Java counterpart of Retrieve Management Collection Object Attributes (QpmRtvMgtcolAttrs) API.

Parameters:
format - format of information to return. Two formats are defined:
  • "MCOA0100" - return attributes of a Management Collection Object
  • "MCOA0200" - return attributes of a Management Collection Object itself and attributes of all repositories in this Management Collection Object
Returns:
object of class MgtcolObjAttributes - this object will contain all available information.
Throws:
MgtcolObjException - if errors are encountered in the process.

open

public void open()
          throws MgtcolObjException
This method will open Management Collection Object for processing.
If object was already open, this method will do nothing.

open() method is a Java counterpart of Open Management Collection Object (QpmOpenMgtcol) API.

Throws:
MgtcolObjException - if not able to open Management Collection Object, identified by this object of MgtcolObj class

openRepository

public int openRepository(java.lang.String repositoryName,
                          java.lang.String format)
                   throws MgtcolObjException,
                          MgtcolObjNotOpen
This method will open repository of Management Collection Object for processing.

openRepository() method is a Java counterpart of Open Management Collection Object Repository (QpmOpenMgtcolRepo) API.

Parameters:
repositoryName - 10 character name of a repository of a Management Collection Object
format - this parameter defines what kind of processing readData() method will perform on repository records, what kind of information it will return and what kind of control information can be passed to it. The only supported format in V5R2 is "MCOD0100".
Returns:
repository handle - a value which is used by closeRepository() and readData() methods to uniquely identify an open repository.
Throws:
MgtcolObjNotOpen - if method is called for an object which was not previously opened.
MgtcolObjException - if not able to open repository of a Management Collection Object.

close

public void close()
This method will close Management Collection Object, previously opened by open() method. This method will also close all open repositories.
If object was not open, this method will do nothing.

close() method is a Java counterpart of Close Management Collection Object (QpmCloseMgtcol) API.


closeRepository

public void closeRepository(int repositoryHandle)
This method will close repository of Management Collection Object, previously opened by openRepository() method.

closeRepository() method is a Java counterpart of Close Management Collection Object Repository (QpmCloseMgtcolRepo) API.

Parameters:
repositoryHandle - repository handle, which uniquely identifies repository

readData

public void readData(int repositoryHandle,
                     MgtcolObjReadOptions readOptions,
                     MgtcolObjRecInfo recInfo,
                     byte[] recordData)
              throws MgtcolObjException,
                     MgtcolObjNotOpen,
                     MgtcolObjRepoNotOpen
This method will position to a specified record of a repository in a Management Collection Object, return information about this record and return specified part of record data for this record.

readData() method is a Java counterpart of Read Management Collection Object Data (QpmReadMgtcolData) API.

Parameters:
repositoryHandle - repository handle, which uniquely identifies repository
readOptions - object of MgtcolObjReadOptions class, which defines numerous processing options for the method.
recInfo - object of MgtcolObjRecInfo class, in which method will return information about processed repository record and overall results of a method call.
recordDara - byte array to receive data from a record. Length of data to be returned in this array is controlled by a length field in an object of MgtcolObjReadOptions class (see second parameter).
Throws:
MgtcolObjNotOpen - if method is called for an object which was not previously opened
MgtcolObjRepoNotOpen - if method is called for a repository, which was not previously opened
MgtcolObjException - if not able to process repository record