Configuring RI_AuditAddressBookManager to Pass Audit Information

The RI_AddressBookManager reference implementation is an example of a published business service that adds an address book record to JD Edwards EnterpriseOne. This section describes how to use the RI_AuditAddressBookManager reference implementation to extend the RI_AddressBookManager so that audit information is passed to an audit record when an address book record is added to the system.

For more information about the RI_AddressBookManager reference implementation, see the JD Edwards EnterpriseOne Tools Interoperability Reference Implementations Guide.

Oracle provides the JPR95001 – RI_AuditAddressBookManager reference implementation, which you can use to extend the RI_AddressBoookManager published business service to pass audit information.

This table describes the components of JPR95001 –RI_AuditAddressBookManager and the location of these components in the JD Edwards EnterpriseOne installation directory:

Reference Implementation Component

Description

Location

RI_AuditAddressBookManager

A published business service class that extends the AddressBookManager reference implementation so that it inserts an address book record with audit information.

B9\STAGINGA\java\source\oracle\e1\bssv\JPR95001

auditAddAddressBook

A method in the RI_AuditAddressBookManager that is used to insert an address book record with audit information. This method uses the addAddressBook method of the RI_AddressBookManager class to insert the address book record.

Same as previous.

RI_AuditAddAddressBook

The value object class that contains get and set methods for the GUID, application ID, workstation name, and IP address.

B9\STAGINGA\java\source\oracle\e1\bssv\JPR95001\valueobject

To configure the RI_AuditAddressBookManager reference implementation to pass audit information:

  1. Create a new value object class that extends the value object class of the existing published business service class.

    For example:

    public class RI_AuditAddAddressBook extends RI_AddAddressBook implements⇒
     Serializable
    

    In this example, RI_AuditAddAddressBook is the new value object class.

    RI_AddAddressBook is the value object class of the RI_AddressBookManager published business service class.

  2. In the RI_AuditAddAddressBook value object, add fields for the GUID, application ID, workstation name, and IP address audit information.

    Generate accessors (get and set methods) for these fields.

  3. Create a new published business service class to extend the existing published business service class.

    For example:

    public class RI_AuditAddressBookManager extends RI_AddressBookManager{
    }
    

    In this example, RI_AuditAddressBookManager is the new published business service class that is extending the existing published business service, RI_AddressBookManager.

    RI_AddressBookManager adds an address book record. RI_AuditAddressBookManager is the class that uses the RI_AddressBookManager class to insert an address book record into the address book table with audit information.

  4. Add the new published business service method that adds an address book record with audit information.

    This new method uses the published method of the existing published business service class to add the address book record. Make the new value object class, which was created to pass the audit information, a parameter of this method.

    For example:

            public RI_ConfirmAddAddressBook 
           auditAddAddressBook(RI_AuditAddAddressBook vo) throws 
          BusinessServiceException
    

    In this example, auditAddAddressBook is the method that is used to add an address book record with the audit information. This method uses the addAddressBook method of the RI_AddressBookManager class to add the address book record.

    The new value object, RI_AuditAddAddressBook, is passed as a parameter of the auditAddAddressBook method. The return value of the auditAddAddressBook method is RI_ConfirmAddAddressBook, which indicates whether the address book record was added successfully or errors occurred.

  5. In the new published business service class, RI_AuditAddressBookManager, create the context. This is where all the audit information is set.

    For example:

    context = startPublishedMethod(context, "addAddressBook",vo);
    
  6. Add code that checks whether a GUID is provided in the request, and if not, generates a GUID in the class.

    For example:

      if(vo.getGuid()== null || vo.getGuid().equals("")) {
                    guid = UniqueKeyGenerator.getNextGuid();
                }
         else {
                       guid = vo.getGuid();
                }
    
  7. Set the audit fields in the context object.

    For example:

    context.setGUID(guid);
      context.setApplicationID(vo.getApplicationID());
          context.setWorkstationName(vo.getWorkstationName());
          context.setIPAddress(vo.getIpaddress());
    
  8. Call the published business service method in the existing business service class and return the response.

    For example:

         RI_ConfirmAddAddressBook confirmVO = this.addAddressBook(context, 
         connection, vo);  
        finishPublishedMethod(context, "auditAddAddressBook");   
        return confirmVO;    
    

    In this example, the RI_AuditAddressBookManager is calling the addAddressBook method of the RI_AddressBookManager to add an address book record with audit information, which is set in the context object. The return value confirmVO indicates whether the record was added successfully or errors occurred.