View Javadoc

1   package ca.uhn.hl7v2.hoh.api;
2   
3   public interface IClientSimple extends IClient {
4   
5   	/**
6   	 * If a socket exists and it is connected, closes the socket. Only required
7   	 * if {@link #isAutoClose() auto close} mode is false
8   	 */
9   	public abstract void close();
10  
11  	/**
12  	 * @return Should the socket auto-close
13  	 * @see #setAutoClose(boolean)
14  	 */
15  	public abstract boolean isAutoClose();
16  
17  	/**
18  	 * @return Returns true if there is a socket, and it appears to be connected
19  	 *         and not shut down
20  	 */
21  	public abstract boolean isConnected();
22  
23  	/**
24  	 * <p>
25  	 * Sets the auto-close property. If set to true (which is the default), the
26  	 * client will close the socket between each request. If set to
27  	 * <code>false</code>, the client will keep the socket open between
28  	 * requests.
29  	 * </p>
30  	 * <p>
31  	 * If auto-close is disabled, sockets will never automatically disconnect,
32  	 * which some servers may not like. The socket can still be closed by
33  	 * calling {@link #close()}.
34  	 * </p>
35  	 */
36  	public abstract void setAutoClose(boolean theAutoClose);
37  
38  }