1 /*
2  * hunt-amqp: AMQP library for D programming language, based on hunt-net.
3  *
4  * Copyright (C) 2018-2019 HuntLabs
5  *
6  * Website: https://www.huntlabs.net
7  *
8  * Licensed under the Apache-2.0 License.
9  *
10  */
11 module hunt.amqp.ProtonServer;
12 
13 //import io.vertx.core.AsyncResult;
14 //import io.vertx.core.Handler;
15 //import io.vertx.core.Vertx;
16 //import hunt.amqp.sasl.ProtonSaslAuthenticatorFactory;
17 //import hunt.amqp.impl.ProtonServerImpl;
18 //
19 ///**
20 // * @author <a href="http://tfox.org">Tim Fox</a>
21 // */
22 //public interface ProtonServer {
23 //
24 //  /**
25 //   * Create a ProtonServer instance with the given Vertx instance.
26 //   *
27 //   * @param vertx
28 //   *          the vertx instance to use
29 //   * @return the server instance
30 //   */
31 //  static ProtonServer create(Vertx vertx) {
32 //    return new ProtonServerImpl(vertx);
33 //  }
34 //
35 //  /**
36 //   * Create a ProtonServer instance with the given Vertx instance and options.
37 //   *
38 //   * @param vertx
39 //   *          the vertx instance to use
40 //   * @param options
41 //   *          the options to use
42 //   * @return the server instance
43 //   */
44 //  static ProtonServer create(Vertx vertx, ProtonServerOptions options) {
45 //    return new ProtonServerImpl(vertx, options);
46 //  }
47 //
48 //  /**
49 //   * The handler called when a new client connection is accepted.
50 //   *
51 //   * @param handler
52 //   *          the handler
53 //   * @return the server
54 //   */
55 //  ProtonServer connectHandler(Handler<ProtonConnection> handler);
56 //
57 //  /**
58 //   * Returns the current connectHandler.
59 //   *
60 //   * @return the handler
61 //   */
62 //  Handler<ProtonConnection> connectHandler();
63 //
64 //  /**
65 //   * Sets the authenticator factory to be used by the server.
66 //   *
67 //   * @param authenticatorFactory the factory to be used for creating authenticators.
68 //   * @return the server
69 //     */
70 //  ProtonServer saslAuthenticatorFactory(ProtonSaslAuthenticatorFactory authenticatorFactory);
71 //
72 //  /**
73 //   * Gets the actual port being listened on.
74 //   *
75 //   * @return the port
76 //   */
77 //  int actualPort();
78 //
79 //  /**
80 //   * Start listening on the given port and host interface, with the result handler called when the operation completes.
81 //   *
82 //   * @param port
83 //   *          the port to listen on (may be 0 to auto-select port)
84 //   * @param host
85 //   *          the host interface to listen on (may be "0.0.0.0" to indicate all interfaces).
86 //   * @param handler
87 //   *          the result handler
88 //   * @return the server
89 //   */
90 //  ProtonServer listen(int port, String host, Handler<AsyncResult<ProtonServer>> handler);
91 //
92 //  /**
93 //   * Start listening on the given port and host interface "0.0.0.0", with the result handler called when the operation
94 //   * completes.
95 //   *
96 //   * @param port
97 //   *          the port to listen on (may be 0 to auto-select port)
98 //   * @param handler
99 //   *          the result handler
100 //   * @return the server
101 //   */
102 //  ProtonServer listen(int port, Handler<AsyncResult<ProtonServer>> handler);
103 //
104 //  /**
105 //   * Start listening on the host and port configured in the options used when creating the server, with the result
106 //   * handler called when the operation completes.
107 //   *
108 //   * @param handler
109 //   *          the result handler
110 //   * @return the server
111 //   */
112 //  ProtonServer listen(Handler<AsyncResult<ProtonServer>> handler);
113 //
114 //  /**
115 //   * Start listening on the given port, and host interface "0.0.0.0".
116 //   *
117 //   * @param port
118 //   *          the port to listen on (may be 0 to auto-select port)
119 //   * @return the server
120 //   */
121 //  ProtonServer listen(int port);
122 //
123 //  /**
124 //   * Start listening on the given port, and host interface.
125 //   *
126 //   * @param port
127 //   *          the port to listen on (may be 0 to auto-select port)
128 //   * @param host
129 //   *          the host interface to listen on (may be "0.0.0.0" to indicate all interfaces).
130 //   * @return the server
131 //   */
132 //  ProtonServer listen(int port, String host);
133 //
134 //  /**
135 //   * Start listening on the host and port configured in the options used when creating the server.
136 //   *
137 //   * @return the server
138 //   */
139 //  ProtonServer listen();
140 //
141 //  /**
142 //   * Closes the server and any currently open connections. May not complete until after method has returned.
143 //   */
144 //  void close();
145 //
146 //  /**
147 //   * Closes the server and any currently open connections, notifying the given handler when complete.
148 //   *
149 //   * @param handler
150 //   *          the completion handler
151 //   */
152 //  void close(Handler<AsyncResult<Void>> handler);
153 //}