001    /*
002     *  Licensed to the Apache Software Foundation (ASF) under one
003     *  or more contributor license agreements.  See the NOTICE file
004     *  distributed with this work for additional information
005     *  regarding copyright ownership.  The ASF licenses this file
006     *  to you under the Apache License, Version 2.0 (the
007     *  "License"); you may not use this file except in compliance
008     *  with the License.  You may obtain a copy of the License at
009     *  
010     *    http://www.apache.org/licenses/LICENSE-2.0
011     *  
012     *  Unless required by applicable law or agreed to in writing,
013     *  software distributed under the License is distributed on an
014     *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015     *  KIND, either express or implied.  See the License for the
016     *  specific language governing permissions and limitations
017     *  under the License. 
018     *  
019     */
020    package org.apache.directory.server.kerberos.shared.messages.application;
021    
022    
023    import org.apache.directory.server.kerberos.shared.messages.value.HostAddress;
024    import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
025    
026    
027    /**
028     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
029     * @version $Rev: 540371 $, $Date: 2007-05-22 02:00:43 +0200 (Tue, 22 May 2007) $
030     */
031    public class SafeBody
032    {
033        private byte[] userData;
034        private KerberosTime timestamp; //optional
035        private Integer usec; //optional
036        private Integer seqNumber; //optional
037        private HostAddress sAddress; //optional
038        private HostAddress rAddress; //optional
039    
040    
041        /**
042         * Creates a new instance of SafeBody.
043         *
044         * @param userData
045         * @param timestamp
046         * @param usec
047         * @param seqNumber
048         * @param sAddress
049         * @param rAddress
050         */
051        public SafeBody( byte[] userData, KerberosTime timestamp, Integer usec, Integer seqNumber, HostAddress sAddress,
052            HostAddress rAddress )
053        {
054            this.userData = userData;
055            this.timestamp = timestamp;
056            this.usec = usec;
057            this.seqNumber = seqNumber;
058            this.sAddress = sAddress;
059            this.rAddress = rAddress;
060        }
061    
062    
063        /**
064         * Returns the "R" {@link HostAddress}.
065         *
066         * @return The "R" {@link HostAddress}.
067         */
068        public HostAddress getRAddress()
069        {
070            return rAddress;
071        }
072    
073    
074        /**
075         * Returns the "S" {@link HostAddress}.
076         *
077         * @return The "S" {@link HostAddress}.
078         */
079        public HostAddress getSAddress()
080        {
081            return sAddress;
082        }
083    
084    
085        /**
086         * Returns the sequence number.
087         *
088         * @return The sequence number.
089         */
090        public Integer getSeqNumber()
091        {
092            return seqNumber;
093        }
094    
095    
096        /**
097         * Returns the {@link KerberosTime} timestamp.
098         *
099         * @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    }