View Javadoc

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.shared.messages.application;
21  
22  
23  import org.apache.directory.server.kerberos.shared.KerberosMessageType;
24  import org.apache.directory.server.kerberos.shared.messages.KerberosMessage;
25  import org.apache.directory.server.kerberos.shared.messages.value.Checksum;
26  import org.apache.directory.server.kerberos.shared.messages.value.HostAddress;
27  import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
28  
29  
30  /**
31   * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
32   * @version $Rev: 589780 $, $Date: 2007-10-29 19:14:59 +0100 (Mo, 29 Okt 2007) $
33   */
34  public class SafeMessage extends KerberosMessage
35  {
36      private SafeBody safeBody;
37      private Checksum cksum;
38  
39  
40      /**
41       * Creates a new instance of SafeMessage.
42       *
43       * @param safeBody
44       * @param cksum
45       */
46      public SafeMessage( SafeBody safeBody, Checksum cksum )
47      {
48          super( KerberosMessageType.KRB_SAFE );
49          this.safeBody = safeBody;
50          this.cksum = cksum;
51      }
52  
53  
54      /**
55       * Returns the {@link Checksum}.
56       *
57       * @return The {@link Checksum}.
58       */
59      public Checksum getCksum()
60      {
61          return cksum;
62      }
63  
64  
65      // SafeBody delegate methods
66  
67      /**
68       * Returns the "R" {@link HostAddress}.
69       *
70       * @return The "R" {@link HostAddress}.
71       */
72      public HostAddress getRAddress()
73      {
74          return safeBody.getRAddress();
75      }
76  
77  
78      /**
79       * Returns the "S" {@link HostAddress}.
80       *
81       * @return The "S" {@link HostAddress}.
82       */
83      public HostAddress getSAddress()
84      {
85          return safeBody.getSAddress();
86      }
87  
88  
89      /**
90       * Returns the sequence number.
91       *
92       * @return The sequence number.
93       */
94      public Integer getSeqNumber()
95      {
96          return safeBody.getSeqNumber();
97      }
98  
99  
100     /**
101      * Returns the {@link KerberosTime} timestamp.
102      *
103      * @return The {@link KerberosTime} timestamp.
104      */
105     public KerberosTime getTimestamp()
106     {
107         return safeBody.getTimestamp();
108     }
109 
110 
111     /**
112      * Returns the microsecond.
113      *
114      * @return The microsecond.
115      */
116     public Integer getUsec()
117     {
118         return safeBody.getUsec();
119     }
120 
121 
122     /**
123      * Returns the user data.
124      *
125      * @return The user data.
126      */
127     public byte[] getUserData()
128     {
129         return safeBody.getUserData();
130     }
131 }