Package ca.uhn.hl7v2.protocol.impl
Class InitiatorImpl
java.lang.Object
ca.uhn.hl7v2.protocol.impl.InitiatorImpl
- All Implemented Interfaces:
Initiator
Default implementation of
Initiator.- Version:
- $Revision: 1.1 $ updated on $Date: 2007-02-19 02:24:26 $ by $Author: jamesagnew $
- Author:
- Bryan Tripp
-
Constructor Summary
ConstructorsConstructorDescriptionInitiatorImpl(Parser theParser, Processor theProcessor) Creates an instance that uses the givenParserInitiatorImpl(Processor theProcessor) Creates an instance that uses aGenericParser -
Method Summary
Modifier and TypeMethodDescriptionintlonglongsendAndReceive(Message theMessage) Encodes a message, sends it to a remote system, awaits the response, parses it, and returns it.voidsetMaxRetries(int theMaxRetries) voidsetReceiveTimeout(long theReceiveTimeout) voidsetRetryInterval(long theRetryIntervalMillis)
-
Constructor Details
-
InitiatorImpl
Creates an instance that uses aGenericParser- Parameters:
theProcessor- theProcessorused to communicate with the remote system
-
InitiatorImpl
Creates an instance that uses the givenParser- Parameters:
theParser- parser to use for parsing and encoding messagestheProcessor- theProcessorused to communicate with the remote system
-
-
Method Details
-
setMaxRetries
- Parameters:
theMaxRetries- max number of retries for initial message delivery
-
getMaxRetries
-
setRetryInterval
- Parameters:
theRetryIntervalMillis- milliseconds between retries of message delivery
-
getRetryInterval
-
setReceiveTimeout
- Parameters:
theReceiveTimeout- the length of time we wait for responses (defaults to 10 seconds)
-
getReceiveTimeout
-
sendAndReceive
Description copied from interface:InitiatorEncodes a message, sends it to a remote system, awaits the response, parses it, and returns it. The response may be null if the message doesn't require an application-level acknowledgement.- Specified by:
sendAndReceivein interfaceInitiator- Parameters:
theMessage- the message to send to the remote system- Returns:
- the response from the remote system
- Throws:
HL7Exception- See Also:
-
getParser
-
getUnderlyingProcessor
- Specified by:
getUnderlyingProcessorin interfaceInitiator- Returns:
- the
Processorinstance that is used to perform the message exchange - See Also:
-
getMetadataFields
- Specified by:
getMetadataFieldsin interfaceInitiator- Returns:
- the list of fields that will be included as metadata when a
Messageis converted to aTransportable. Each field is aTerserpath (type String). - See Also:
-