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