|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| package org.globus.cas.impl.service; |
|
12 |
| |
|
13 |
| import org.globus.cas.impl.CasConstants; |
|
14 |
| |
|
15 |
| import org.globus.wsrf.Resource; |
|
16 |
| import org.globus.wsrf.ResourceProperty; |
|
17 |
| import org.globus.wsrf.ResourceProperties; |
|
18 |
| import org.globus.wsrf.ResourcePropertySet; |
|
19 |
| |
|
20 |
| import org.globus.wsrf.impl.SimpleResourceProperty; |
|
21 |
| import org.globus.wsrf.impl.SimpleResourcePropertySet; |
|
22 |
| |
|
23 |
| import org.globus.mds.usefulrp.ServiceMetaDataResourceProperty; |
|
24 |
| |
|
25 |
| import javax.xml.namespace.QName; |
|
26 |
| |
|
27 |
| import org.apache.commons.logging.Log; |
|
28 |
| import org.apache.commons.logging.LogFactory; |
|
29 |
| |
|
30 |
| public class CasResource implements Resource, ResourceProperties { |
|
31 |
| |
|
32 |
| static Log logger = LogFactory.getLog(CasResource.class.getName()); |
|
33 |
| |
|
34 |
| public static final javax.xml.namespace.QName RP_SET = |
|
35 |
| new QName(CasConstants.CAS_NS, "CasRPSet"); |
|
36 |
| |
|
37 |
| protected Object key; |
|
38 |
| private ResourcePropertySet propSet; |
|
39 |
| ResourceProperty serverDNProp = null; |
|
40 |
| ServiceMetaDataResourceProperty metadata = null; |
|
41 |
| int maxAssertionLifetime = -1; |
|
42 |
| String voDescription; |
|
43 |
| String serverDN; |
|
44 |
| |
|
45 |
0
| public CasResource(int maxLifetime, String voDesc) {
|
|
46 |
0
| this.maxAssertionLifetime = maxLifetime;
|
|
47 |
0
| this.voDescription = voDesc;
|
|
48 |
0
| this.propSet = new SimpleResourcePropertySet(RP_SET);
|
|
49 |
0
| ResourceProperty prop =
|
|
50 |
| new SimpleResourceProperty(new QName(CasConstants.CAS_NS, |
|
51 |
| "VoDescription")); |
|
52 |
0
| prop.add(this.voDescription);
|
|
53 |
0
| this.propSet.add(prop);
|
|
54 |
0
| serverDNProp =
|
|
55 |
| new SimpleResourceProperty(new QName(CasConstants.CAS_NS, |
|
56 |
| "ServerDN")); |
|
57 |
0
| this.propSet.add(serverDNProp);
|
|
58 |
| |
|
59 |
| |
|
60 |
0
| try {
|
|
61 |
0
| metadata=new ServiceMetaDataResourceProperty();
|
|
62 |
0
| this.propSet.add(metadata);
|
|
63 |
| } catch(Exception e) { |
|
64 |
0
| logger.warn(e);
|
|
65 |
| } |
|
66 |
| } |
|
67 |
| |
|
68 |
| |
|
69 |
0
| public void setRPs() {
|
|
70 |
| } |
|
71 |
| |
|
72 |
0
| public ResourcePropertySet getResourcePropertySet() {
|
|
73 |
0
| return this.propSet;
|
|
74 |
| } |
|
75 |
| |
|
76 |
0
| public int getMaxAssertionLifetime() {
|
|
77 |
0
| return this.maxAssertionLifetime;
|
|
78 |
| } |
|
79 |
| |
|
80 |
0
| public String getVoDescription() {
|
|
81 |
0
| return this.voDescription;
|
|
82 |
| } |
|
83 |
| |
|
84 |
0
| public String getServerDN() {
|
|
85 |
0
| return this.serverDN;
|
|
86 |
| } |
|
87 |
| |
|
88 |
0
| public void setServerDN(String serverDN) {
|
|
89 |
0
| this.serverDN = serverDN;
|
|
90 |
0
| if (this.serverDNProp != null) {
|
|
91 |
0
| this.serverDNProp.add(this.serverDN);
|
|
92 |
| } |
|
93 |
| } |
|
94 |
| |
|
95 |
0
| public void setVersion(String version) {
|
|
96 |
0
| this.metadata.setVersion(version);
|
|
97 |
| } |
|
98 |
| } |