ca.uhn.hl7v2.protocol.impl
Class InitiatorImpl

java.lang.Object
  extended by ca.uhn.hl7v2.protocol.impl.InitiatorImpl
All Implemented Interfaces:
Initiator

public class InitiatorImpl
extends java.lang.Object
implements 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
InitiatorImpl(Parser theParser, Processor theProcessor)
          Creates an instance that uses the given Parser
InitiatorImpl(Processor theProcessor)
          Creates an instance that uses a GenericParser
 
Method Summary
 int getMaxRetries()
           
 java.util.List getMetadataFields()
           
 Parser getParser()
           
 long getReceiveTimeout()
           
 long getRetryInterval()
           
 Processor getUnderlyingProcessor()
           
 Message sendAndReceive(Message theMessage)
          Encodes a message, sends it to a remote system, awaits the response, parses it, and returns it.
 void setMaxRetries(int theMaxRetries)
           
 void setReceiveTimeout(long theReceiveTimeout)
           
 void setRetryInterval(long theRetryIntervalMillis)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitiatorImpl

public InitiatorImpl(Processor theProcessor)
Creates an instance that uses a GenericParser

Parameters:
theProcessor - the Processor used to communicate with the remote system

InitiatorImpl

public InitiatorImpl(Parser theParser,
                     Processor theProcessor)
Creates an instance that uses the given Parser

Parameters:
theParser - parser to use for parsing and encoding messages
theProcessor - the Processor used to communicate with the remote system
Method Detail

setMaxRetries

public void setMaxRetries(int theMaxRetries)
Parameters:
theMaxRetries - max number of retries for initial message delivery

getMaxRetries

public int getMaxRetries()

setRetryInterval

public void setRetryInterval(long theRetryIntervalMillis)
Parameters:
theRetryIntervalMillis - milliseconds between retries of message delivery

getRetryInterval

public long getRetryInterval()

setReceiveTimeout

public void setReceiveTimeout(long theReceiveTimeout)
Parameters:
theReceiveTimeout - the length of time we wait for responses (defaults to 10 seconds)

getReceiveTimeout

public long getReceiveTimeout()

sendAndReceive

public Message sendAndReceive(Message theMessage)
                       throws HL7Exception
Description copied from interface: Initiator
Encodes 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:
sendAndReceive in interface Initiator
Parameters:
theMessage - the message to send to the remote system
Returns:
the response from the remote system
Throws:
HL7Exception
See Also:
Initiator.sendAndReceive(ca.uhn.hl7v2.model.Message)

getParser

public Parser getParser()
Specified by:
getParser in interface Initiator
Returns:
the Parser that is used to encode outbound messages and parse inbound ones. It may be of interest to set certain parameters of this parser, for example whether to use XML encoding.
See Also:
Initiator.getParser()

getUnderlyingProcessor

public Processor getUnderlyingProcessor()
Specified by:
getUnderlyingProcessor in interface Initiator
Returns:
the Processor instance that is used to perform the message exchange
See Also:
Initiator.getUnderlyingProcessor()

getMetadataFields

public java.util.List getMetadataFields()
Specified by:
getMetadataFields in interface Initiator
Returns:
the list of fields that will be included as metadata when a Message is converted to a Transportable. Each field is a Terser path (type String).
See Also:
Initiator.getMetadataFields()


Copyright © 2001-2011 University Health Network. All Rights Reserved.