See: Description
Package | Description |
---|---|
com.ibm.tivoli.nm.collectors.framework |
Provides all of the classes necessary to create an ITNM Java™ based collector.
|
com.ibm.tivoli.nm.collectors.framework.collector |
Contains all of the base classes for creating and defining an ITNM Java™ collector.
|
com.ibm.tivoli.nm.collectors.framework.server |
Contains the class required to run any given collector.
|
com.ibm.tivoli.nm.collectors.framework.store |
Provides implementations for the
CollectorDataStore
interface for storing network data collected by a given collector. |
com.ibm.tivoli.nm.collectors.framework.utils |
Contains utility methods for performing common functions within the Java™ collector framework.
|
Package | Description |
---|---|
com.ibm.tivoli.nm.collectors.framework.corba |
Provides the base classes forming a framework used by ITNM Java™ Collectors to query and retrieve data using CORBA.
|
com.ibm.tivoli.nm.collectors.framework.corba.executor |
Interface and factory for the CORBA Executor
|
com.ibm.tivoli.nm.collectors.framework.corba.impl.c3gpp |
Classes providing functionality to support the 3GPP v2.5 CORBA implementation.
|
com.ibm.tivoli.nm.collectors.framework.corba.impl.c3gpp.util |
Utility classes specific for the 3GPP v2.5 CORBA Framework.
|
com.ibm.tivoli.nm.collectors.framework.corba.impl.tmf814 |
Classes providing functionality to support the TMF814 v2.1 CORBA implementation.
|
com.ibm.tivoli.nm.collectors.framework.corba.ior |
Interface and factory for the CORBA Interoperable Object References Processor
|
com.ibm.tivoli.nm.collectors.framework.corba.iterator |
Interface and factory for the CORBA Iterator
|
com.ibm.tivoli.nm.collectors.framework.corba.nameservice |
Interface and factory for the CORBA Name Service Manager
|
com.ibm.tivoli.nm.collectors.framework.corba.orb |
Interface and factory for the CORBA ORB Manager
|
com.ibm.tivoli.nm.collectors.framework.corba.properties |
Interface and factory for the CORBA Properties
|
com.ibm.tivoli.nm.collectors.framework.corba.provider |
Interface and factory for the CORBA Provider
|
com.ibm.tivoli.nm.collectors.framework.corba.session |
Interface and factory for the CORBA Session
|
Package | Description |
---|---|
com.ibm.tivoli.nm.collectors.csv |
Contains an implementation of a generic CSV collector that parses one or more delimited data files for network data.
|
Package | Description |
---|---|
com.ibm.tivoli.nm.collectors.sample |
Contains very simple sample collector implementations to demonstrate how to use the basic functionalities of the Java™ collector framework.
|
Package | Description |
---|---|
com.ibm.tivoli.nm.logging.messages |
ITNM’s Java™ based Collectors are shipped with a Collector framework, which eases development by taking care of XML generation and some ITNM facing tasks. If you are writing a Collector in Java™, you may wish to consider using this library to reduce development and maintenance time. When using the Java™ Collector library, the developer’s responsibility changes from ‘convert EMS data into XML’ to ‘convert EMS data for storing in the Store object’. At present, a Collector support library (or framework) exists for Java™ and Perl based Collectors.
This documentation details this framework and the sample collectors found in com.ibm.tivoli.nm.collectors.sample
illustrate how an ITNM collector can be written using Java™, including how to run a collector and storing collected network data.
This documentation includes:
com.ibm.tivoli.nm.collectors.framework
)com.ibm.tivoli.nm.collectors.framework.corba
)It also includes some Sample Java™ collectors:
com.ibm.tivoli.nm.collectors.sample
)com.ibm.tivoli.nm.collectors.csv
)A developer can use this framework to
CollectorDataStore
to add network data which is automatically validated and converted into valid XML responses as expected by ITNM.
An example of the use of the Java™ collector framework is the CSV collector. The CSVCollector
packaged in csv-collector.jar extends the standard Collector class and makes use of the in-memory data store. Some of the important classes for developing a collector can be seen in Figure 1 below.
The first step in the creation of an ITNM Java™ collector is to write a collector implementation that extends the Collector
class, and can be run (possibly making use of the CollectorEmbeddedServer
class).
A collector implementation will make use of the collector-framework.jar
on its classpath, as well as any other required libraries.
Having written a collector implementation, the next step is to package the collector in an executable JAR file. To do this, you must first provide a manifest file.
The manifest file must identify the class to be run for the collector implementation, as well as any JAR files required on the classpath.
A sample manifest file, sample.manifest
is provided in the samples
directory under the main javaCollectors
directory (see Java™ Collectors Directory Structure for details).
For example, the CSV Collector implemented by the CSVCollector
class is packaged in the csvcollector.jar, whose manifest contains the following entries:
Main-Class: com.ibm.tivoli.nm.collectors.csv.CSVCollector
Class-Path: ../framework/collector-framework.jar
The Main-Class
attribute specifies the collector implementation class that contains the public static void main(String[] args)
method that allows the collector to be run.
The Class-Path
attribute specifies that in this case, the collector-framework jar (containing all of the classes in the com.ibm.tivoli.nm.collectors.framework
package) is required by the collector. A collector that makes use of the CORBA collector framework would also require the corba-collector-framework.jar to be on the classpath.
Note: As all collectors are run from the bin
directory, any classpath references should be relative to the bin
directory (e.g. "../framework/collector-framework.jar"
) (see Java™ Collectors Directory Structure for details).
Next, you must generate a JAR file for the collector. You can either use and modify the sample ant build script (sample_build.xml
) provided under the samples
directory or use the Java™ jar
command to create a collector JAR file, specifying the manifest previously created.
Having generated your collector JAR file, it is then recommended that you copy the JAR file to an appropriate directory under the main javaCollectors
directory. It is recommended that for each collector implementation, a folder is created for that implementation containing the collector JAR file, and optionally, a configuration file. For example:
sample-collector
sample-collector.jar
sample-collector.properties
For more details on the structure of the javaCollectors
directories, see Java™ Collectors Directory Structure.
Having generated and copied your collector implementation to the javaCollectors
directory, the collector implementation can be run using the collector.sh/bat
script as follows:
Unix:
collector.sh -jar collector-implementation-name/collector-implementation.jar -port port_number
Windows:
collector.bat -jar collector-implementation-name/collector-implementation.jar -port port_number
Where:
collector-implementation-name/collector-implementation.jar
is the location of the collector JAR file relative to the javaCollectors
directory.port_number
is the port number on which the collector is to run. This is the port number required by ITNM in the DiscoCollectorFinderSeeds config file to allow the discovery process to connect to the collector.Any changes to the Collector Library are backwards compatible meaning that Collectors written against an earlier release will work with the newer releases. However you may wish to update your Collector to take advantage of any library changes that have been made in more recent releases.
The following table summarises changes since 4.1 GA that may be of particular interest to those considering migrating their custom Collectors. It is not a complete list of changes.
Area | Version Introduced | Summary of Change |
---|---|---|
com.ibm.tivoli.nm.collectors.framework.store
|
4.1.1 GA | Support for LTE data |
com.ibm.tivoli.nm.collectors.framework.store
|
4.2 | New methods in DataStore provide data removal by data type (e.g. vpns, entities..) |
com.ibm.tivoli.nm.collectors.framework.utils
|
4.1.1 GA |
New utility class for working with data files: CollectorFileUtils
|
The Java™ collectors can be found in the $NCHOME/precision/collectors/javaCollectors/
directory.
The contents of the javaCollectors
directory is structured as follows:
bin
- Contains scripts for running the collectors
collector.sh/bat
- Runs an instance of a given Java™ collectorframework
collector-framework.jar
- Collector frameworkcollector.properties.sample
- Sample collector framework configuration filecorba
corba-collector-framework.jar
- CORBA collector frameworkcorbacollector.properties.sample
- Sample CORBA collector framework configuration filesamples
- Contains samples for building your own collectors
sample.manifest
- A sample manifest file for a collector JARsample_build.xml
- A sample ant build script that can be used to build a collectorSampleCollector.java
- Source code for SampleCollector
SampleRANCollector.java
- Source code for SampleRANCollector
collector-implementation-name
- Contains a specific collector implementation
collector-implementation.jar
- Implementation of the collectorcollector-implementation.properties.sample
- Sample configuration file for the collector implementation
Table 2 provides a quick reference showing which CollectorDataStore
and Collector
methods need to be called to satisfy a given XML-RPC request.
For example, if the developer wishes to support the XML-RPC method GetDeviceInfo(), then the Collector would have to populate the store via CollectorDataStore.addDeviceData(int, java.lang.String, java.lang.Object)
, which would automatically return a valid XML response via Collector.GetDeviceInfo(int, java.lang.String)
.