Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.adapter.cci
Class AbstractDocumentRecordInteraction

    java.lang.Object
      com.bea.adapter.cci.AbstractInteraction
          com.bea.adapter.cci.AbstractDocumentRecordInteraction

All Implemented Interfaces:
  javax.resource.cci.Interaction

public abstract class AbstractDocumentRecordInteraction
extends AbstractInteraction

Provides a base implementation for adapter providers to extend. An `Interaction` enables a component to execute EIS functions. This class makes sure the client passed a com.bea.connector.DocumentRecord.

A DocumentRecord represents a runtime request for a service. A service represents functionality available in an EIS system. A service is comprised of four components:

- Unique Business Name: Every service has a unique business name that indicates its role in an integration solution. For example, in an integration solution involving a Customer Relationship Management (CRM) system, you may have a service named "CreateNewCustomer". It is important to understand that the service name should reflect the business purpose of the service. It is an abstraction from the name of the function(s) your service invokes in the EIS. If the underlying CRM system is SAP R/3, the "CreateNewCustomer" service would map to a BAPI or RFC.
- Request Document Definition: The request document definition describes the input requirements for a service. The com.bea.document.IDocumentDefinition interface embodies all the metadata about a document type. It includes the document schema (structure and usage), and the root element name for all documents of this type. The root element name is needed because an XML schema can define more than one possible root element.
- Response Document Definition: The response document definition describes the output for a service.
- Additional Metadata: A service is a higher-order component in an integration solution that hides most of the complexity involved in executing functionality in an EIS. In other words, a service does not expose many of the details required to interact with the EIS in its public interface. This implies there is some amount of information that is required to invoke a function in an EIS that is not provided by the client in the request. Consequently, most services need to store additional metadata. In WLAI, this additional metadata is encapuslated by a resource adapter's javax.resource.cci.InteractionSpec implementation class.

Author:
  Copyright (c) 1998-2000 by BEA Systems, Inc. All Rights Reserved.

Field Summary

Fields inherited from class com.bea.adapter.cci.AbstractInteraction
`m_warning`

Constructor Summary
`AbstractDocumentRecordInteraction(AbstractConnection connectionHandle)` Constructs an instance

Method Summary
`boolean` | `allowsNamespacesInRequest()` Indicates whether this adapter allows namespace information in the request documents it receives.
`boolean` | `allowsNullRequest()` Indicates whether this adapter can allow null request records.
`boolean` | `allowsNullResponse()` Indicates whether this adapter can return null response records.
`protected abstract DocumentRecord` | `execute(javax.resource.cci.InteractionSpec ixSpec, DocumentRecord inputDoc)` Adapter developers must provide an implementation for this method rather than overriding execute(InteractionSpec, Record)
`protected abstract boolean` | `execute(javax.resource.cci.InteractionSpec ixSpec, DocumentRecord inputDoc, DocumentRecord outputDoc)` Adapter developers must provide an implementation for this method rather than execute(InteractionSpec, Record, Record).
`javax.resource.cci.Record` | `execute(javax.resource.cci.InteractionSpec ixSpec, javax.resource.cci.Record input)` Executes the EIS function represented by the `InteractionSpec` and produces the output `Record` as a return value.
`boolean` | `execute(javax.resource.cci.InteractionSpec ixSpec, javax.resource.cci.Record input, javax.resource.cci.Record output)` Executes the EIS function represented by the `InteractionSpec` and updates the output `Record`.
`protected String` | `getContent(DocumentRecord rec, String strPath, boolean bIsMandatory)` A convenience method for retrieving String content from a DocumentRecord.
`protected Calendar` | `getDateContent(DocumentRecord rec, String strPath, boolean bIsMandatory)` A convenience method for retrieving date content as a Java Calendar from a DocumentRecord.
`protected Calendar` | `getDateTimeContent(DocumentRecord rec, String strPath, boolean bIsMandatory)` A convenience method for retrieving dateTime content as a Java Calendar from a DocumentRecord.
`protected Calendar` | `getTimeContent(DocumentRecord rec, String strPath, boolean bIsMandatory)` A convenience method for retrieving time content as a Java Calendar from a DocumentRecord.
`protected void` | `validateRequestDocument(DocumentInteractionSpec ixSpec, DocumentRecord inputDoc)` Convenience method for validating request documents

Methods inherited from class com.bea.adapter.cci.AbstractInteraction
`clearWarnings, getConnection, getLogContext, getLogger, getRecordFactory, getWarnings`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface javax.resource.cci.Interaction
`close`

Constructor Detail

### AbstractDocumentRecordInteraction

    public AbstractDocumentRecordInteraction(AbstractConnection connectionHandle)
                                      throws javax.resource.ResourceException

  Constructs an instance

Parameters:
  `connectionHandle` - - the connection to execute an EIS function against must not be null.
Throws:
  `javax.resource.ResourceException` - - the supplied handle or the log context object is null

Method Detail

### allowsNullRequest

    public boolean allowsNullRequest()

  Indicates whether this adapter can allow null request records. Subclasses should override this method to return true if they can accept null request records. By default this method returns false.

### allowsNullResponse

    public boolean allowsNullResponse()

  Indicates whether this adapter can return null response records. Subclasses should override this method to return true if they can return null response records. By default this method returns false.

### allowsNamespacesInRequest

    public boolean allowsNamespacesInRequest()

  Indicates whether this adapter allows namespace information in the request documents it receives. By default, this method searches the wlai-config properties file in the adapter's EAR archive for a property named 'wlai_disallows_namespaces_in_request'. If such a property is found this method will return its value. Otherwise it will return true. Thus, the default case is to have this option on, indicating that adapters generally can accept namespace information in request documents. For adapters that have this flag turned off, request documents will be scrubbed to remove namespace information before the request document is delivered to the adapter. This is quite costly, as it essentially parses (using SAX) the entire request document. Subclasses should override this method if the default handling of this option is not sufficient.

### execute

    public boolean execute(javax.resource.cci.InteractionSpec ixSpec,
                           javax.resource.cci.Record input,
                           javax.resource.cci.Record output)
                    throws javax.resource.ResourceException

  Executes the EIS function represented by the `InteractionSpec` and updates the output `Record`. Specifically, this method ensures that the input and output records are DocumentRecords.

  Throws:
    `javax.resource.ResourceException`

### execute

    protected abstract boolean execute(javax.resource.cci.InteractionSpec ixSpec,
                                       DocumentRecord inputDoc,
                                       DocumentRecord outputDoc)
                                throws javax.resource.ResourceException

  Adapter developers must provide an implementation for this method rather than execute(InteractionSpec, Record, Record).

  Throws:
    `javax.resource.ResourceException`

### execute

    public javax.resource.cci.Record execute(javax.resource.cci.InteractionSpec ixSpec,
                                             javax.resource.cci.Record input)
                                      throws javax.resource.ResourceException

  Executes the EIS function represented by the `InteractionSpec` and produces the output `Record` as a return value.

  Throws:
    `javax.resource.ResourceException`

### execute

    protected abstract DocumentRecord execute(javax.resource.cci.InteractionSpec ixSpec,
                                              DocumentRecord inputDoc)
                                       throws javax.resource.ResourceException

  Adapter developers must provide an implementation for this method rather than overriding execute(InteractionSpec, Record)

  Throws:
    `javax.resource.ResourceException`

### validateRequestDocument

    protected void validateRequestDocument(DocumentInteractionSpec ixSpec,
                                           DocumentRecord inputDoc)
                                    throws javax.resource.ResourceException

  Convenience method for validating request documents

  Throws:
    `javax.resource.ResourceException`

### getContent

    protected String getContent(DocumentRecord rec,
                                String strPath,
                                boolean bIsMandatory)
                         throws javax.resource.ResourceException

  A convenience method for retrieving String content from a DocumentRecord.

  Parameters:
    `rec` - - the DocumentRecord with the desired content
    `strPath` - - a valid XPath in the Document
    `bIsMandatory` - - a flag to indicate if the value is mandatory.
  Throws:
    `javax.resource.ResourceException` - if the DocumentRecord does not contain mandatory content, i.e. if the String value is null or empty.

### getDateContent

    protected Calendar getDateContent(DocumentRecord rec,
                                      String strPath,
                                      boolean bIsMandatory)
                               throws javax.resource.ResourceException

  A convenience method for retrieving date content as a Java Calendar from a DocumentRecord.

  Parameters:
    `rec` - - the DocumentRecord with the desired content
    `strPath` - - a valid XPath in the Document
    `bIsMandatory` - - a flag to indicate if the value is mandatory.
  Throws:
    `javax.resource.ResourceException` - if the DocumentRecord does not contain mandatory content, i.e. if the String value is null or empty.

### getDateTimeContent

    protected Calendar getDateTimeContent(DocumentRecord rec,
                                          String strPath,
                                          boolean bIsMandatory)
                                   throws javax.resource.ResourceException

  A convenience method for retrieving dateTime content as a Java Calendar from a DocumentRecord.

  Parameters:
    `rec` - - the DocumentRecord with the desired content
    `strPath` - - a valid XPath in the Document
    `bIsMandatory` - - a flag to indicate if the value is mandatory.
  Throws:
    `javax.resource.ResourceException` - if the DocumentRecord does not contain mandatory content, i.e. if the String value is null or empty.

### getTimeContent

    protected Calendar getTimeContent(DocumentRecord rec,
                                      String strPath,
                                      boolean bIsMandatory)
                               throws javax.resource.ResourceException

  A convenience method for retrieving time content as a Java Calendar from a DocumentRecord.

  Parameters:
    `rec` - - the DocumentRecord with the desired content
    `strPath` - - a valid XPath in the Document
    `bIsMandatory` - - a flag to indicate if the value is mandatory.
  Throws:
    `javax.resource.ResourceException` - if the DocumentRecord does not contain mandatory content, i.e. if the String value is null or empty.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD