com.ibm.iseries.collectionservices
Interface DataCollectionProgram
- public interface DataCollectionProgram
This interface defines methods which Java data collection program
must implement to interface to Collection Services support for
user-defined categories.
Java class, which implements this interface, must provide
a no-arg constructor. This constructor will be called to create
an object of the class. All further interaction between data
collection program and Collection Servics will be via this object.
For more information about user-defined categories and
Collection Services support for data collection programs written in Java,
go to iSeries Information Center.
Information, common for all methods:
- All methods take the same type of parameter - an object of
class DataCollectionRequest.
- All methods return an int value.
Based on this return code, Collection Services will take an appropriate
action. Return code is ignored for doShutdown() method.
For other methods return codes can have the following values:
- 0 - data collection request was performed successfully
- > 0 - data collection request encountered recoverable
errors. Non-zero return code will be logged in a job log.
Action taken by Collection Services depends on the method:
- for doBegin() and doEnd() methods,
Collection Services will assume that no data can be collected for
this category and data collection for this category will be ended.
- for doCollect() method, Collection Services will assume
that future requests may still be successful.
No data will be stored for this method call.
However, Collection Services will continue collecting data for this
category.
- < 0 - data collection request encountered unrecoverable
errors. Collection Services will assume that no further data
collection is possible for this category, and data collection
for the category will be ended.
Methods can use negative return code to cause immediate
termination of data collection for user-defined category.
- Since:
- V5R2M0
doBegin
public int doBegin(DataCollectionRequest req)
- Start Collection request.
This is the first request data collection program will receive
in a data collection session. When receiving this request,
data collection program is expected to initialize whatever interfaces
it uses to collect the data. It is also used to initialize an object
of a class.
Optionally, this method can return collection control information
to be stored in a collection control record in a repository
of a Management Collection Object.
See class preface for explanation of method parameter
and return value.
doEnd
public int doEnd(DataCollectionRequest req)
- End Collection request.
This is the last request data collection program will receive
in a data collection session. When receiving this request,
data collection program is expected to close whatever interfaces
it uses to collect the data, release resources etc.
Optionally, this method can return collection control information
to be stored in a collection control record in a repository
of a Management Collection Object.
See class preface for explanation of method parameter
and return value.
doCollect
public int doCollect(DataCollectionRequest req)
- Interval Collection request.
Data collection program will receive request of this type
each time interval collection for this user-defined category
is scheduled. Time between interval collection requests
(collection interval) is specified in Collection Services collector
configuration.
When receiving this request, data collection program is expected
to perform its regular collection of performance data and return
collected data. The returned data will be stored in an interval record
in a repository of a Management Collection Object.
See class preface for explanation of method parameter
and return value.
doShutdown
public int doShutdown(DataCollectionRequest req)
- Cleanup and Terminate (Shutdown) request.
Data collection program will receive request of this type
when Collection Services cannot continue data collection.
An example of such problem is a loss of contact with a Collection
Services collector job.
When receiving this request, data collection program is expected
to perform necessary cleanup, release resources etc.
Any data returned by this method will be ignored.
See class preface for explanation of method parameter
and return value.