1 Overview

This document provides information that you can use when working with the Oracle Communications MetaSolv Solution (MSS) Enterprise JavaBeans (EJB) application program interfaces (APIs).

About the MSS EJB APIs

This section provides an overview of EBJ APIs. You can use the EJB APIs to reconcile data from third-party applications into MSS.

Working with Connection EJB APIs

The "Working with Connections" chapter provides the set of EJB APIs that are related to connections, such as creating and updating connections, assigning and un-assigning ports, and also provisioning assignments. The following summarizes the APIs:

Working with Engineering Work Orders

The "Working with Engineering Work Orders" chapter provides the set of EJB APIs that are related to Engineering Work Orders, creating and updating work orders and their notes, associating connections and equipment to work orders, and also processing due date supplements. The following summarizes the EJB APIs:

Overview of EJB API Content

This document includes the following:

  • Information about each MSS EJB API, which describes API usage patterns for implementing common business scenarios.

  • Examples that show correct usage setting parameters for the APIs.

  • Input information for an API.

  • Output information received from an API, including the following:

    • Data that has reconciled successfully into MSS.

    • Data that failed to reconcile with MSS. In this case, all the validation errors are displayed based on the input provided.

  • Working with transactions. A transaction provides information about:

    • Whether or not a specific API participates in the client's transaction

    • How the input data is reconciled by the API

Calling an API

This section provides information about the steps that are required to call an API.

Calling an API typically includes:

  • Getting the initial context

  • Looking up the context with the Java Naming and Directory Interface (JNDI) name

  • Calling the specific API on the business interface reference

  • Getting the results from the API output.

  • Getting the error codes/messages from the API.

  • Adding the following JVM options to the JDeveloper client before calling the EJB APIs that are deployed in an SSL environment:

    -Dweblogic.security.SSL.ignoreHostnameVerification=true
    -Dweblogic.security.SSL.trustedCAKeyStore=C:\MSSSSL\trust.jks
    

Note:

The MSS application implements security for EJB methods. You must add a registered user to the Global Role MSSRole to access the EJB methods externally. See MSS Security Guide for more information.

For each API the parameters are listed and indicate whether each is mandatory or optional. If you do not provide a mandatory parameter, the API fails and returns an error. For all parameters, if you provide a value that does not exist in MSS for a parameter where a valid value or identifier is applicable, the API fails and returns an error message.

Example 1-1 shows the information required to call an API.

Example 1-1 Sample Code for an API Call

// Gets the initial context.
// Context.INITIAL_CONTEXT_FACTORY is a constant that holds the initial context 
// factory to use.
// Context.PROVIDER_URL is a constant that holds the information for the service 
// provider to use.
// IP_Address is the IP address of the system where the WebLogic server is
// running for MSS.
// WebLogic_Domain_Port is the port of the server on which the WebLogic server is
// running.
// Context.SECURITY_PRINCIPAL is a constant that holds the user name for
// authenticating to the service.
// Context.SECURITY_CREDENTIALS is a constant that holds the password of the user 
// for authenticating to the service.
Properties h = new Properties();
h.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
h.put(Context.PROVIDER_URL, "t3://IP_Address:WebLogic_Domain_Port"); 
h.put(Context.SECURITY_PRINCIPAL, "LoginId");
h.put(Context.SECURITY_CREDENTIALS, "password");
Context ctx = new InitialContext(h);

// Looks up the context with the JNDI name and gets the reference of 
// ConnectionAccessManagerRemote business interface object.
ConnectionAccessManagerRemote remote = (ConnectionAccessManagerRemote) = ctx.lookup("nrm/resource/entity/connection/ConnectionAccessManager");

// Calls the corresponding API on the remote object to import the required
// data.
// API_CALL can be, for example, createVirtualConnection(Connection[]
// conns, User user).
remote.API_CALL
// Gets the results from the remote object reference.
results.getReturnObject();
// The resultant must be converted to the corresponding object type based on the 
// calling API. For example:
ArrayList keys = 
        (ArrayList)results.getReturnObject();
          for (int i = 0; i < keys.size(); i++) {
            System.out.println(keys.get(i));
          }

// Gets the error messages from the API.
results.getMessages();
// Always returns a vector of the results. For example:
Vector errorMessages = (Vector)results.getMessages();
         Iterator errorIterator = errorMessages.iterator();
          while (errorIterator.hasNext()) {
            MSLVException mslvExcep = (MSLVException)errorIterator.next();
            System.out.println("Error code: "+ mslvExcep.getCode() + ", Error   
                          message : " + mslvExcep.getMessage());
          }