1 module hunt.proton.Proton;
2 
3 import hunt.proton.amqp.messaging.ApplicationProperties;
4 import hunt.proton.amqp.messaging.DeliveryAnnotations;
5 import hunt.proton.amqp.messaging.Footer;
6 import hunt.proton.amqp.messaging.Header;
7 import hunt.proton.amqp.messaging.MessageAnnotations;
8 import hunt.proton.amqp.messaging.Properties;
9 import hunt.proton.amqp.messaging.Section;
10 import hunt.proton.codec.Codec;
11 import hunt.proton.codec.Data;
12 import hunt.proton.engine.Collector;
13 import hunt.proton.engine.Connection;
14 import hunt.proton.engine.Engine;
15 import hunt.proton.engine.Handler;
16 import hunt.proton.engine.SslDomain;
17 import hunt.proton.engine.SslPeerDetails;
18 import hunt.proton.engine.Transport;
19 import hunt.proton.message.Message;
20 import hunt.proton.engine.Reactor;
21 import hunt.Exceptions;
22 //import hunt.proton.reactor.ReactorOptions;
23 
24 class Proton
25 {
26     this ()
27     {
28     }
29 
30     public static Collector collector()
31     {
32         return Engine.collector();
33     }
34 
35     public static Connection connection()
36     {
37         return Engine.connection();
38     }
39 
40     public static Transport transport()
41     {
42         return Engine.transport();
43     }
44 
45     public static SslDomain sslDomain()
46     {
47         return Engine.sslDomain();
48     }
49 
50     public static SslPeerDetails sslPeerDetails(string hostname, int port)
51     {
52         return Engine.sslPeerDetails(hostname, port);
53     }
54 
55     public static Data data(long capacity)
56     {
57         return Codec.data(capacity);
58     }
59 
60     public static Message message()
61     {
62         return Message.Factory.create();
63     }
64 
65     public static Message message(Header header,
66                       DeliveryAnnotations deliveryAnnotations, MessageAnnotations messageAnnotations,
67                       Properties properties, ApplicationProperties applicationProperties,
68                       Section bd, Footer footer)
69     {
70         return Message.Factory.create(header, deliveryAnnotations,
71                                       messageAnnotations, properties,
72                                       applicationProperties, bd, footer);
73     }
74 
75     public static Reactor reactor(){
76        // return Reactor.Factory.create();
77         implementationMissing(false);
78         return null;
79     }
80 
81     public static Reactor reactor(Handler[] handlers)
82     {
83       implementationMissing(false);
84       return null;
85         //Reactor reactor = Reactor.Factory.create();
86         //foreach (Handler handler ; handlers) {
87         //    reactor.getHandler().add(handler);
88         //}
89         //return reactor;
90     }
91 
92     //public static Reactor reactor(ReactorOptions options)
93     //{
94     //    return Reactor.Factory.create(options);
95     //}
96     //
97     //public static Reactor reactor(ReactorOptions options, Handler [] handlers)
98     //{
99     //    Reactor reactor = Reactor.Factory.create(options);
100     //    foreach (Handler handler ; handlers) {
101     //        reactor.getHandler().add(handler);
102     //    }
103     //    return reactor;
104     //}
105 }
106 
107