Interface EDIService
- All Superinterfaces:
Service
public interface EDIService extends Service
EDIService is used when generating and processing EDI messages.
It covers activities such as:
- creating an EDI Envelope
- sending an EDI
- getting EDI Delimiters
- getting EDI envelopeInfo
- enqueueing an outbound EDI message
-
Method Summary
Modifier and Type Method Description void
buildDataElementsForSegment(com.americancoders.edi.Segment segment)
Builds the dataElements using the template corresponding to the segment specifiedjava.lang.String
convertEnvelopeToString(com.americancoders.edi.Envelope envelope, EDIEnvelopeInfo ediEnvelopeInfo, EDIMessagingContext ediMessagingContext)
This method converts the envelope into a formatted Stringjava.lang.String
convertEnvelopeToString(com.americancoders.edi.Envelope envelope, EDIMessagingContext ediMessagingContext)
Deprecated.com.americancoders.edi.Envelope
createEnvelope(java.util.List<com.americancoders.edi.TransactionSet> transactionSets, InterchangeInfo interchangeInfo, EDIEnvelopeInfo ediEnvelopeInfo, EDIMessagingContext ediMessagingContext)
This method creates a default OBOE envelope based on the EDI Format - either X12 / EDIFACT with Interchange Control Version Number 00401 and default sender and receiver as "OneNetwork" and "Client"EDIDelimiters
getDefaultEDIDelimiters(java.lang.String ediType)
Returns the default EDI delimiters applicable based on the EDI type (X12 or EDIFact) EDIDelimeters object contains information regarding group, segment, line and other delimiters.EDIDelimiters
getEDIDelimiters(com.americancoders.edi.Envelope envelope)
This method returns the EDIDelimeters object containing information regarding group, segment, line and other delimiters for the EDI Envelope.EDIEnvelopeInfo
getEDIEnvelopeInfo(com.americancoders.edi.Envelope envelope, EDIDelimiters ediDelimiters, EDIMessagingContext ediMessagingContext)
This method creates EDIEnvelope object consisting of delimiters , control numbers information for the envelopecom.americancoders.edi.Envelope
getEnvelope(java.lang.String ediContent)
Converts EDI Content in string representation into Envelope object.EDIMessage
send(com.americancoders.edi.Envelope envelope, EDIEnvelopeInfo ediEnvelopeInfo, QueueRef queue, boolean createEdiMsgQueueEntries, EDIMessagingContext ediMessagingContext)
This method is used to send an outbound EDI envelope to the outbox queue returned by the mapper.EDIMessage
send(com.americancoders.edi.Envelope envelope, QueueRef queue, boolean createEdiMsgQueueEntries, EDIMessagingContext ediMessagingContext)
Deprecated.
-
Method Details
-
createEnvelope
com.americancoders.edi.Envelope createEnvelope(java.util.List<com.americancoders.edi.TransactionSet> transactionSets, InterchangeInfo interchangeInfo, EDIEnvelopeInfo ediEnvelopeInfo, EDIMessagingContext ediMessagingContext)This method creates a default OBOE envelope based on the EDI Format - either X12 / EDIFACT with Interchange Control Version Number 00401 and default sender and receiver as "OneNetwork" and "Client"- Parameters:
transactionSets
- - List of transactionSet objects to be used for creating the envelopeediMessagingContext
- -EDIMessagingContext
which has the EDI context detailsinterchangeInfo
- -InterchangeInfo
object consisting of Sender/Receiver GS and ISA IDs and qualifier informationediEnvelopeInfo
- -EDIEnvelopeInfo
object consisting of delimiters , control numbers information for the envelope- Returns:
- the EDI Envelope object.
-
convertEnvelopeToString
@Deprecated java.lang.String convertEnvelopeToString(com.americancoders.edi.Envelope envelope, EDIMessagingContext ediMessagingContext)Deprecated.This method is deprecated. Please useconvertEnvelopeToString(Envelope, EDIEnvelopeInfo, EDIMessagingContext)
- Parameters:
envelope
- - Envelope object to be converted into text representationediMessagingContext
- -EDIMessagingContext
which has the EDI context details- Returns:
- string representation of Envelope as formatted text
-
convertEnvelopeToString
java.lang.String convertEnvelopeToString(com.americancoders.edi.Envelope envelope, EDIEnvelopeInfo ediEnvelopeInfo, EDIMessagingContext ediMessagingContext)This method converts the envelope into a formatted String- Parameters:
envelope
- - Envelope object to be converted into text representationediEnvelopeInfo
- - - EDIEnvelopeInfo object consisting of delimiters & control header information for the envelopeediMessagingContext
- -EDIMessagingContext
which has the EDI context details- Returns:
- string representation of Envelope as formatted text
-
getEnvelope
com.americancoders.edi.Envelope getEnvelope(java.lang.String ediContent) throws java.lang.ExceptionConverts EDI Content in string representation into Envelope object.- Parameters:
ediContent
- - String representation of Envelope- Returns:
- Envelope object
- Throws:
java.lang.Exception
- - throws Exception when EDI cannot be parsed
-
getEDIDelimiters
This method returns the EDIDelimeters object containing information regarding group, segment, line and other delimiters for the EDI Envelope.- Parameters:
envelope
- - Envelope object- Returns:
EDIDelimiters
object for the envelope
-
getEDIEnvelopeInfo
EDIEnvelopeInfo getEDIEnvelopeInfo(com.americancoders.edi.Envelope envelope, EDIDelimiters ediDelimiters, EDIMessagingContext ediMessagingContext)This method creates EDIEnvelope object consisting of delimiters , control numbers information for the envelope- Parameters:
envelope
- - the EDI envelopeediDelimiters
- -EDIDelimiters
object for the envelopeediMessagingContext
- -EDIMessagingContext
which has the EDI context details- Returns:
-
send
EDIMessage send(com.americancoders.edi.Envelope envelope, EDIEnvelopeInfo ediEnvelopeInfo, QueueRef queue, boolean createEdiMsgQueueEntries, EDIMessagingContext ediMessagingContext) throws java.lang.ExceptionThis method is used to send an outbound EDI envelope to the outbox queue returned by the mapper.Default behavior is to enqueue it to the oubox/EDI queue.
- Parameters:
envelope
- - the EDI envelope to sendediEnvelopInfo
- - EDIEnvelopeInfo object consisting of delimiters & control header information for the envelopequeue
- - the outbox EDI queue to usecreateEdiMsgQueueEntries
- - boolean flag which determines whether to update the EDIMessageQueue entry after sending the EDIediMessagingContext
- -EDIMessagingContext
which has the EDI context details- Returns:
- - the
EDIMessage
object which contains the platform Message object and the Envelope object both. - Throws:
java.lang.Exception
-
send
@Deprecated EDIMessage send(com.americancoders.edi.Envelope envelope, QueueRef queue, boolean createEdiMsgQueueEntries, EDIMessagingContext ediMessagingContext) throws java.lang.ExceptionDeprecated.This method is deprecated. Please usesend(Envelope, EDIEnvelopeInfo, QueueRef, boolean, EDIMessagingContext)
- Parameters:
envelope
- - the EDI envelope to sendqueue
- - the outbox EDI queue to usecreateEdiMsgQueueEntries
- - boolean flag which determines whether to update the EDIMessageQueue entry after sending the EDIediMessagingContext
- -EDIMessagingContext
which has the EDI context details- Returns:
- - the
EDIMessage
object which contains the platform Message object and the Envelope object both. - Throws:
java.lang.Exception
-
getDefaultEDIDelimiters
Returns the default EDI delimiters applicable based on the EDI type (X12 or EDIFact) EDIDelimeters object contains information regarding group, segment, line and other delimiters.- Parameters:
ediType
- - X12 or EDIFact referEDIConstants
- Returns:
- default
EDIDelimiters
applicable
-
buildDataElementsForSegment
void buildDataElementsForSegment(com.americancoders.edi.Segment segment)Builds the dataElements using the template corresponding to the segment specified- Parameters:
segment
- - Segment whose template needs to be used.
-