KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > carol > util > csiv2 > struct > AsStruct


1 /**
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 2004 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * --------------------------------------------------------------------------
22  * $Id: AsStruct.java,v 1.1 2004/12/13 16:24:13 benoitf Exp $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.carol.util.csiv2.struct;
26
27 import java.io.Serializable JavaDoc;
28
29 import org.objectweb.carol.util.csiv2.gss.GSSHelper;
30
31 /**
32  * Cannot extends final class AS_ContextSec
33  * @author Florent Benoit
34 */

35 public class AsStruct implements Serializable JavaDoc {
36
37     /**
38      * Target supports for this mech
39      */

40     private short targetSupports = 0;
41
42     /**
43      * Target requires for this mech
44      */

45     private short targetRequires = 0;
46
47     /**
48      * Name of target
49      */

50     private byte[] targetName = new byte[0];
51
52     /**
53      * @return the targetName.
54      */

55     public byte[] getTargetName() {
56         return targetName;
57     }
58
59     /**
60      * @param targetName The targetName to set.
61      */

62     public void setTargetName(String JavaDoc targetName) {
63         this.targetName = GSSHelper.encodeExported(targetName);
64     }
65
66     /**
67      * @return client authentication mech
68      */

69     public byte[] getClientAuthenticationMech() {
70         if (targetName.length != 0) {
71             return GSSHelper.getMechOidDer();
72         } else {
73             return new byte[0];
74         }
75     }
76
77     /**
78      * @return the targetRequires.
79      */

80     public short getTargetRequires() {
81         return targetRequires;
82     }
83
84     /**
85      * @param targetRequires The targetRequires to set.
86      */

87     public void setTargetRequires(int targetRequires) {
88         this.targetRequires = (short) targetRequires;
89     }
90
91     /**
92      * @return the targetSupports.
93      */

94     public short getTargetSupports() {
95         return targetSupports;
96     }
97
98     /**
99      * @param targetSupports The targetSupports to set.
100      */

101     public void setTargetSupports(int targetSupports) {
102         this.targetSupports = (short) targetSupports;
103     }
104
105 }
Popular Tags