Class OAGISMapper

java.lang.Object
com.onenetwork.platform.integ.oagis.OAGISMapper

public abstract class OAGISMapper
extends java.lang.Object
Abstract class for an OAGIS integration mapper. Provides various methods for processing and creating OAGIS messages.

Implement this class to process an inbound OAGIS file or generate an outbound OAGIS file.

Methods used for inbound (listed in order of necessity)

  1. (Required) process(Object) - create a list of models from OAGIS object, persist it in database via actions and return the error model list or null

Outbound methods

  1. (Required) generate(List) - to generate a list of OAGIS files for the list of models

Common methods needed for both inbound and outbound flow

  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected EDIMessagingContext ediMsgContext  
  • Constructor Summary

    Constructors 
    Constructor Description
    OAGISMapper​(EDIMessagingContext ediMsgContext)  
  • Method Summary

    Modifier and Type Method Description
    void addTransactionReferences​(java.util.List<EdiMQTransRef> emqTransRefs, java.lang.Object value)
    This method can be overridden by subclass mappers to provide the implementation for adding one or more EdiMQTransRef entries into the List present in the method parameter with related transaction ref number and it model level type.
    abstract java.util.List<java.lang.Object> generate​(java.util.List<? extends Model> modelList)
    Your implementation should convert the given Models into OAGIS and return the result.
    EDIMessagingContext getEDIMessagingContext()  
    boolean isSkipValidation()
    This method returns boolean value which represents flag for validating OAGIS XML
    abstract void populateRefTransDetailsInEdiMsgQueue​(EdiMessageQueue ediMessageQueue, java.lang.Object oagis)
    This method must be overridden by subclass mappers to provide the implementation for updating the edi message queue with transaction ref numbers (primary, secondary, tertiary) where applicable.
    abstract ModelList process​(java.lang.Object oagis)
    Your implementation should convert the given OAGIS to models, write them and return back the error response as another ModelList.
    void setEDIMessagingContext​(EDIMessagingContext ediMsgContext)
    EDIMessagingContext which captures information about the current OAGIS.
    abstract void setSenderReceiverOrgsOnEMContext​(EDIMessagingContext ediMsgContext, java.lang.Object oagis)
    This method can be overridden by subclass mappers to provide the implementation for adding sender and receiver information into EDIMessagingContext in order to create Application Area by using OAGIS object.
    abstract void setSenderReceiverOrgsOnEMQ​(EdiMessageQueue ediMessageQueue, java.lang.Object oagis)
    Implement this method to populate sender and receiver information on EDIMessageQueue by 1)Use the OAGIS param to derive the senderOrg and receiverOrg based on the sender and receiver of the OAGIS respectively.
    void setSkipValidation​(boolean skipValidation)
    This method is used to set boolean value for flag used for validation of OAGIS XML.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getEDIMessagingContext

      public EDIMessagingContext getEDIMessagingContext()
    • setEDIMessagingContext

      public void setEDIMessagingContext​(EDIMessagingContext ediMsgContext)
      EDIMessagingContext which captures information about the current OAGIS.
      Parameters:
      ediMsgContext - EDIMessagingContext which captures information about the current OAGIS
    • setSenderReceiverOrgsOnEMQ

      public abstract void setSenderReceiverOrgsOnEMQ​(EdiMessageQueue ediMessageQueue, java.lang.Object oagis)
      Implement this method to populate sender and receiver information on EDIMessageQueue by 1)Use the OAGIS param to derive the senderOrg and receiverOrg based on the sender and receiver of the OAGIS respectively. 2)Use any custom lookup OR external reference to get the OrgName~EntName of the sender and populate the same on EMQ 3)Use ant custom lookup OR external reference to get the OrgName~EntName of the receiver and populate the same on EMQ
      Parameters:
      EdiMessageQueue -
      Object - oagis
    • process

      public abstract ModelList process​(java.lang.Object oagis) throws java.lang.Exception
      Your implementation should convert the given OAGIS to models, write them and return back the error response as another ModelList.
      Parameters:
      Object - oagis to be written
      Returns:
      ModelList errors
      Throws:
      java.lang.Exception
    • generate

      public abstract java.util.List<java.lang.Object> generate​(java.util.List<? extends Model> modelList)
      Your implementation should convert the given Models into OAGIS and return the result.
      Parameters:
      modelList - Models to be converted to OAGIS
      Returns:
      List OAGIS derived from the given models
    • populateRefTransDetailsInEdiMsgQueue

      public abstract void populateRefTransDetailsInEdiMsgQueue​(EdiMessageQueue ediMessageQueue, java.lang.Object oagis)
      This method must be overridden by subclass mappers to provide the implementation for updating the edi message queue with transaction ref numbers (primary, secondary, tertiary) where applicable. Populating these values it not required, but highly recommended as it facilitiates searching of OAGIS by transaction reference numbers from the EDI Message Queue page.
      Parameters:
      ediMessageQueue - message
      Object - oagis
    • addTransactionReferences

      public void addTransactionReferences​(java.util.List<EdiMQTransRef> emqTransRefs, java.lang.Object value)
      This method can be overridden by subclass mappers to provide the implementation for adding one or more EdiMQTransRef entries into the List present in the method parameter with related transaction ref number and it model level type. All the entries in the list of EdiMQTransRef will be related to the EdiMessageQueue for the transaction set in picture. If the implementation is not available in the child mapper, the default behavior is to not create any EdiMQTransRef entries for the edi message queue.
      Parameters:
      emqTransRefs -
      transactionSet -
    • setSenderReceiverOrgsOnEMContext

      public abstract void setSenderReceiverOrgsOnEMContext​(EDIMessagingContext ediMsgContext, java.lang.Object oagis)
      This method can be overridden by subclass mappers to provide the implementation for adding sender and receiver information into EDIMessagingContext in order to create Application Area by using OAGIS object.
      Parameters:
      EDIMessagingContext - ediMsgContext
      Object - oagis
    • isSkipValidation

      public boolean isSkipValidation()
      This method returns boolean value which represents flag for validating OAGIS XML
    • setSkipValidation

      public void setSkipValidation​(boolean skipValidation)
      This method is used to set boolean value for flag used for validation of OAGIS XML.
      Parameters:
      boolean - skipValidation