Skip Headers
Oracle® Communications Network Integrity Developer's Guide
Release 7.1

E23701-03
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

30 JCA Resource Adapters

This chapter provides overview information about the J2EE Connector Architecture (JCA) SNMP resource adapter included with Network Integrity and other third party or customized JCA resource adapters that may be used with Network Integrity.

About Resource Adapters

A JCA resource adapter is a system-level software driver used by a Java application to connect to an Enterprise Information System (EIS). The resource adapter can be configured to use any protocol required by the EIS for connectivity. The resource adapter plugs into an application server (for example Oracle Fusion Middleware) and provides connectivity between an EIS (for example, a database system), the application server, and the enterprise application (see Figure 30-1).

JCA defined a standard architecture for connecting a J2EE platform to heterogeneous EISs. Examples of EISs include Enterprise Resource Planning (ERP) and mainframe transaction processing (TP). The connector architecture defines a Common Client Interface (CCI) for EIS access. The CCI defines a client API for interacting with heterogeneous EISs and enables an EIS vendor to provide a standard resource adapter for its EIS.

An application server that support JCA, like Fusion Middleware, can ensure seamless connectivity to multiple EISs. In the same way, any EIS with a JCA resource adapter can plug into an application server that supports JCA.

For details about the JCA 1.5 specification and additional JCA documentation, see:

http://www.oracle.com/technetwork/java/index.html

Figure 30-1 JCA Functional Blocks

Illustrates JCA functional blocks

Understanding JCA Resource Adapter Connectivity Options

A resource adapter provides the following types of connectivity between an application and an EIS.

  • Outbound communication: The resource adapter allows an application to connect to an EIS system and perform work. The application initiates all communication. The resource adapter serves as a passive library for connecting to an EIS, and executes in the context of the application threads.

  • Inbound communication: The resource adapter allows an EIS to call application components and perform work. The EIS initiates all communication. The resource adapter can request threads from the application server or create its own threads.

  • Bi-directional communication: The resource adapter supports both outbound and inbound communication.

Understanding JCA Resource Adapters with Network Integrity

This chapter describes productized SNMP JCA resource adapter and 3rd party or customized JCA resource adapters, and their use within Network Integrity.

Network Integrity administrators can configure the productized SNMP JCA resource adapter included with the Network Integrity software. Network Integrity system integrators can extend this SNMP JCA resource adapter with additional MIB files at run time to poll additional SNMP object identifiers (OIDs).

In addition to the productized JCA resource adapter for use with SNMP, Network Integrity system integrators can also use any standard J2EE JCA resource adapters (3rd party or customized) in their customized Network Integrity Cartridge. They can deploy these resource adapters wherever the Network Integrity application is deployed. These adapters can be standalone, or clustered within a Weblogic server.

Network Integrity Cartridges can:

  • use a deployed resource adapter

  • communicate with various network devices

  • send commands

  • collect data through various protocols (for example, SNMP, TLI, or CORBA)

See Design Studio Developer Guide for details on creating a Network Integrity Cartridge. See Network Integrity Installation Guide for details on deploying an SNMP JCA resource adapter.

About Productized SNMP JCA Resource Adapter

The SNMP discovery processor uses the SNMP JCA resource adapter, contained in the Network Integrity software to poll the SNMP enabled network devices.

The SNMP JCA resource adapter implements the connector architecture to provide SNMP functions for Network Integrity. Oracle Fusion Middleware (the application server) is the container for the SNMP JCA resource adapter and provides connection pool management. The SNMP JCA resource adapter provides outbound communication only to Enterprise Information Systems (network devices) and transaction management is not required.

The SNMP JCA resource adapter supports all SNMP-enabled network devices provided a proper set of MIB files are installed.

SNMP JCA resource adapter has record and playback functions for user who want to collect and view raw SNMP data and later reuse the data for testing purposes. For details on how to configure the SNMP resource adapter to run in record and playback mode, see "Record and Playback Mode".

Installing the SNMP JCA Resource Adapter

The SNMP resource adapter installs as part of the Network Integrity Installer. See Network Integrity Installation Guide for more details.

Extending the SNMP JCA Resource Adapter

The SNMP resource adapter is installed with the following pre-bundled MIB files:

  • ATM-MIB

  • ATM-TC-MIB

  • CISCO-CONFIG-MAN-MIB

  • CISCO-ENTITY-VENDORTYPE-OID-MIB

  • CISCO-FRAME-RELAY-MIB

  • CISCO-PRODUCTS-MIB

  • CISCO-SMI

  • CISCO-TC

  • CISCO-VLAN-IFTABLE-RELATIONSHIP-MIB

  • CISCO-VTP-MIB

  • ENTITY-MIB

  • IANAifType-MIB

  • IF-MIB

  • INET-ADDRESS-MIB

  • IP-MIB

  • RFC1155-SMI

  • RFC1213-MIB

  • RFC1315-MIB

  • RMON-MIB

  • SNMP-FRAMEWORK-MIB

  • SNMPv2-CONF

  • SNMPv2-MIB

  • SNMPv2-SMI

  • SNMPv2-TC

  • enterprise-numbers.txt

If a device is not supported by the MIB files included with the SNMP JCA resource adapter, then the user must install additional MIB file(s) that support such a device. These additional MIB files provide the corresponding MIB OIDs and definitions for the device that the user wants to poll. Ensure that the same MIB file(s) are available in Design Studio for the corresponding cartridge development. The MIB file(s) on both Studio and the SNMP JCA resource adapter must match. Manually copy these MIB files to the SNMP JCA resource adapter.

To copy new MIB files to the SNMP JCA resource adapter, use the following steps:

  1. Log in to the server where Network Integrity is installed.

  2. Go to directory <NI_HOME>/ integrity/snmpAdapter/mibs. <NI_HOME> is the location chosen using the NI installer during the Network Integrity installation.

  3. Copy the new MIB files to this directory.

    Tip:

    There is no need to restart the server. The SNMP JCA resource adapter automatically loads the new MIB files when needed.
  4. Perform an update operation of 'snmpadapter' application in Admin console.

Record and Playback Mode

SNMP JCA resource adapter supports record and playback mode.

When the SNMP JCA resource adapter is configured to run in record mode, the resource adapter polls a network device, and the device returns the polled data to the resource adapter. The SNMP JCA adapter then returns the SNMP data to the discovery cartridge and also writes the SNMP data to a file that it stores on a local hard drive.

When the SNMP JCA resource adapter is configured to run in playback mode, the resource adapter does not require a connection to the network device. Instead the resource adapter reads the SNMP data file (created in Record mode and stored on the local hard drive) and sends the SNMP data back to discovery cartridge.

To switch the mode of SNMP resource adapter, use the following steps to create a configuration file.:

  1. Log in to the server where Network Integrity is installed.

  2. Go to directory <NI_DOMAIN_HOME>/ config.

  3. Create a directory called snmpAdapterConfig.

  4. Within the new directory, create a file called snmpAdapter.properties.

  5. Add the following content to the file:

    #MODE=normal
    MODE=record
    #MODE=playback
    

    Tip:

    Enable a mode by removing the comment symbol (#) from the beginning of the line. In the above example, record mode is enabled.

The SNMP JCA resource adapter creates the record files in NI_Domain/snmpData. The exact directory and filename depends on the IP address. For example, device 10.156.66.191 is stored at NI_Domain/snmpData/10/156/66/191/10.156.66.191_XXXXX.rec, where XXXX is the name of the request set by the scan element.

Playback mode loads recorded SNMP results and send them back to the Network Integrity cartridge without actually polling the network devices.

There is no need to restart the Weblogic server after changing the SNMP resource adapter properties file. SNMP JCA resource adapter dynamically switches the mode based on the current configuration in the properties file.

For clustered environment, the user manually creates and modifies the properties file for every SNMP JCA resource adapter installed on every node.

Invoking the SNMP JCA Resource Adapter in a Network Integrity Cartridge

Design Studio creates (code-generates) the complete implementation of the SNMP processor for discovery action. This SNMP Processor can perform SNMP discoveries of SNMP enabled network devices.

After the SNMP processor discovers a device, the processor can use the SNMP JCA resource adapter to perform SNMP polling on the discovered network devices.

There is no coding effort to use the SNMP resource adapter in a Network Integrity cartridge.

About Third Party or Customized JCA Resource Adapters

The following sections provides information on building JCA resource adapters and on invoking third party or custom Resource adapters.

Building a JCA Resource Adapter in Weblogic

To create a JCA resource adapter for use in a customized Network Integrity cartridge, see:

http://download.oracle.com/docs/cd/E12839_01/web.1111/e13732/toc.htm

This Fusion Middleware document provides detailed instructions for creating a resource adapter in Weblogic.

Invoking a Third Party or Customized JCA Resource Adapter

The following workflow describes the steps required to implement third party or customized JCA resource adapters in Network Integrity.

  1. Deploy third party or customized JCA resource adapters into the Network Integrity system.

  2. Implement a Design Studio discovery processor to invoke the third party or customized JCA resource adapter.

    1. Locate the following code auto-generated from the discovery processor.

      @Override
      public SampleProcessorResponse invoke(DiscoveryProcessorContext context
                      SampleProcessorRequest request) throws ProcessorException {
           // TODO Auto-generated method stub
       return null;
      } 
      
    2. Use the SampleProcessorRequest generated class to obtain the address scope, property group, and other attributes.

      Tip:

      This class provides important elements used when invoking a resource adapter. For example, to use a TL1 resource adapter to make a TL1 request, the TL1 resource adapter needs to know which device it should communication with. This information is obtained from the SampleProcessorRequest in the following sources:
      • IP address: available from the address scope

      • port number: available from the property group

      • login information for the TL1 session including username and password: available from the property group

    3. Use the data provided by SampleProcessorRequest to implement the Java code to invoke the JCA resource adapter.

Depending on the resource adapter, the way to invoke a resource adapter can different. Typically the invoke process requires several JNDI name lookups to get some JCA Connection Factory and Interaction Specification classes. From the JCA Connection Factory, the user can create Interaction. Next is to do the execution from Interaction by passing the Interaction Specification.

If user is using an existing 3rd party resource adapter, it should come with a developer guide that provides the detailed instruction on how to implement the client code to invoke this resource adapter. If a user creates a customized resource adapter from scratch, the user should have all the knowledge on how to invoke this customized JCA resource adapter.

The following code snippet demonstrates how to invoke a JCA resource adapter that implements Common Client Interface (CCI):

…
context = new InitialContext();            
SampleAdapterConnectionSpecImpl cspec =
                (SampleAdapterConnectionSpecImpl)context.lookup(JNDI_SAMPLE_CONN_SPEC);
cxFactory = (ConnectionFactory) context.lookup(JNDI_SAMPLE_CONN_FACTORY);
connection = cxFactory.getConnection(cspec);
ispec = (SampleAdapterInteractionSpec)context.lookup(JNDI_SAMPLE_INTER_SPEC);
interaction = connection.createInteraction();
RecordFactory recordFactory = cxFactory.getRecordFactory();
IndexedRecord input = recordFactory.createIndexedRecord(SampleAdapterIndexedRecord.INPUT);
input.add(request);
IndexedRecord output = recordFactory.createIndexedRecord(SampleAdapterIndexedRecord.OUTPUT);
interaction.execute(ispec, input, output);
out=(String)output.get(SampleAdapterIndexedRecord.MESSAGE_FIELD);    
…

In this example, the ”out” contains the collected results as an XML document as String. However, different resource adapter have different output. To detail all possible kinds of output is beyond the scope of this document.

The final output should be wrapped inside the SampleProcessorResponse class (code-generated) and return as the returned value of this invoke method.