1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 *
19 */
20 package org.apache.directory.server.kerberos.kdc;
21
22
23 import java.net.InetAddress;
24
25 import org.apache.directory.server.kerberos.shared.crypto.encryption.CipherTextHandler;
26 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
27 import org.apache.directory.server.kerberos.shared.messages.KdcRequest;
28 import org.apache.directory.server.kerberos.shared.messages.KerberosMessage;
29 import org.apache.directory.server.kerberos.shared.store.PrincipalStore;
30
31
32 /**
33 * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
34 * @version $Rev: 583938 $, $Date: 2007-10-11 21:57:20 +0200 (Do, 11 Okt 2007) $
35 */
36 public class KdcContext
37 {
38 private static final long serialVersionUID = 6490030984626825108L;
39
40 private KdcServer config;
41 private PrincipalStore store;
42 private KdcRequest request;
43 private KerberosMessage reply;
44 private InetAddress clientAddress;
45 private CipherTextHandler cipherTextHandler;
46 private EncryptionType encryptionType;
47
48
49 /**
50 * @return Returns the config.
51 */
52 public KdcServer getConfig()
53 {
54 return config;
55 }
56
57
58 /**
59 * @param config The config to set.
60 */
61 public void setConfig( KdcServer config )
62 {
63 this.config = config;
64 }
65
66
67 /**
68 * @return Returns the store.
69 */
70 public PrincipalStore getStore()
71 {
72 return store;
73 }
74
75
76 /**
77 * @param store The store to set.
78 */
79 public void setStore( PrincipalStore store )
80 {
81 this.store = store;
82 }
83
84
85 /**
86 * @return Returns the request.
87 */
88 public KdcRequest getRequest()
89 {
90 return request;
91 }
92
93
94 /**
95 * @param request The request to set.
96 */
97 public void setRequest( KdcRequest request )
98 {
99 this.request = request;
100 }
101
102
103 /**
104 * @return Returns the reply.
105 */
106 public KerberosMessage getReply()
107 {
108 return reply;
109 }
110
111
112 /**
113 * @param reply The reply to set.
114 */
115 public void setReply( KerberosMessage reply )
116 {
117 this.reply = reply;
118 }
119
120
121 /**
122 * @return Returns the clientAddress.
123 */
124 public InetAddress getClientAddress()
125 {
126 return clientAddress;
127 }
128
129
130 /**
131 * @param clientAddress The clientAddress to set.
132 */
133 public void setClientAddress( InetAddress clientAddress )
134 {
135 this.clientAddress = clientAddress;
136 }
137
138
139 /**
140 * @return Returns the {@link CipherTextHandler}.
141 */
142 public CipherTextHandler getCipherTextHandler()
143 {
144 return cipherTextHandler;
145 }
146
147
148 /**
149 * @param cipherTextHandler The {@link CipherTextHandler} to set.
150 */
151 public void setCipherTextHandler( CipherTextHandler cipherTextHandler )
152 {
153 this.cipherTextHandler = cipherTextHandler;
154 }
155
156
157 /**
158 * Returns the encryption type to use for this session.
159 *
160 * @return The encryption type.
161 */
162 public EncryptionType getEncryptionType()
163 {
164 return encryptionType;
165 }
166
167
168 /**
169 * Sets the encryption type to use for this session.
170 *
171 * @param encryptionType The encryption type to set.
172 */
173 public void setEncryptionType( EncryptionType encryptionType )
174 {
175 this.encryptionType = encryptionType;
176 }
177 }