View Javadoc

1   package ca.uhn.hl7v2.hoh.hapi.client;
2   
3   import java.net.URL;
4   
5   import ca.uhn.hl7v2.hoh.api.IClientSimple;
6   import ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple;
7   import ca.uhn.hl7v2.parser.Parser;
8   
9   public class HohClientSimple extends AbstractClient<HohRawClientSimple> implements IClientSimple {
10  	/**
11  	 * Constructor
12  	 * 
13  	 * @param theHost
14  	 *            The HOST (name/address). E.g. "192.168.1.1"
15  	 * @param thePort
16  	 *            The PORT. E.g. "8080"
17  	 * @param theUriPath
18  	 *            The URI being requested (must either be blank or start with
19  	 *            '/' and contain a path). E.g. "/Apps/Receiver.jsp"
20  	 */
21  	public HohClientSimple(String theHost, int thePort, String theUriPath) {
22  		super(new HohRawClientSimple(theHost, thePort, theUriPath), null);
23  	}
24  
25  	/**
26  	 * Constructor
27  	 * 
28  	 * @param theHost
29  	 *            The HOST (name/address). E.g. "192.168.1.1"
30  	 * @param thePort
31  	 *            The PORT. E.g. "8080"
32  	 * @param theUriPath
33  	 *            The URI being requested (must either be blank or start with
34  	 *            '/' and contain a path). E.g. "/Apps/Receiver.jsp"
35  	 * @param theParser
36  	 *            The Parser to use, or <code>null</code> in which case a
37  	 *            PipeParser will be used
38  	 */
39  	public HohClientSimple(String theHost, int thePort, String theUriPath, Parser theParser) {
40  		super(new HohRawClientSimple(theHost, thePort, theUriPath), theParser);
41  	}
42  
43  	/**
44  	 * Constructor
45  	 * 
46  	 * @param theUrl
47  	 *            The URL to send messages to
48  	 */
49  	public HohClientSimple(URL theUrl) {
50  		super(new HohRawClientSimple(theUrl), null);
51  	}
52  
53  	/**
54  	 * Constructor
55  	 * 
56  	 * @param theUrl
57  	 *            The URL to send messages to
58  	 * @param theParser
59  	 *            The Parser to use, or <code>null</code> in which case a
60  	 *            PipeParser will be used
61  	 */
62  	public HohClientSimple(URL theUrl, Parser theParser) {
63  		super(new HohRawClientSimple(theUrl), theParser);
64  	}
65  
66  	/**
67  	 * {@inheritDoc}
68  	 */
69  	public void close() {
70  		getRawClient().close();
71  	}
72  
73  	/**
74  	 * {@inheritDoc}
75  	 */
76  	public boolean isAutoClose() {
77  		return getRawClient().isAutoClose();
78  	}
79  
80  	/**
81  	 * {@inheritDoc}
82  	 */
83  	public boolean isConnected() {
84  		return getRawClient().isConnected();
85  	}
86  
87  	/**
88  	 * {@inheritDoc}
89  	 */
90  	public void setAutoClose(boolean theAutoClose) {
91  		getRawClient().setAutoClose(theAutoClose);
92  	}
93  
94  }