1 /*
2  * hunt-proton: AMQP Protocol library for D programming language.
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 
12 
13 module hunt.proton.amqp.security.SaslInit;
14 
15 import hunt.proton.amqp.Binary;
16 import hunt.proton.amqp.Symbol;
17 import hunt.proton.amqp.security.SaslFrameBody;
18 import hunt.logging;
19 import hunt.String;
20 
21 
22 class SaslInit : SaslFrameBody
23 {
24 
25     private Symbol _mechanism;
26     private Binary _initialResponse;
27     private String _hostname;
28 
29     public Symbol getMechanism()
30     {
31         return _mechanism;
32     }
33 
34     public void setMechanism(Symbol mechanism)
35     {
36         if( mechanism is null )
37         {
38             logError("the mechanism field is mandatory");
39         }
40 
41         _mechanism = mechanism;
42     }
43 
44     public Binary getInitialResponse()
45     {
46         return _initialResponse;
47     }
48 
49     public void setInitialResponse(Binary initialResponse)
50     {
51         _initialResponse = initialResponse;
52     }
53 
54     public String getHostname()
55     {
56         return _hostname;
57     }
58 
59     public void setHostname(String hostname)
60     {
61         _hostname = hostname;
62     }
63 
64 
65     public void invoke(E)(SaslFrameBodyHandler!E handler, Binary payload, E context)
66     {
67         handler.handleInit(this, payload, context);
68     }
69 
70 }