author | Dan Labrecque <dan.labrecque@oracle.com> |
Thu, 19 Jan 2012 16:01:30 -0500 | |
changeset 793 | 0a5a7daf579b |
parent 323 | usr/src/java/scf/common/org/opensolaris/os/scf/common/FMRI.java@497a785649eb |
permissions | -rw-r--r-- |
0 | 1 |
/* |
2 |
* CDDL HEADER START |
|
3 |
* |
|
4 |
* The contents of this file are subject to the terms of the |
|
5 |
* Common Development and Distribution License (the "License"). |
|
6 |
* You may not use this file except in compliance with the License. |
|
7 |
* |
|
8 |
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 |
* or http://www.opensolaris.org/os/licensing. |
|
10 |
* See the License for the specific language governing permissions |
|
11 |
* and limitations under the License. |
|
12 |
* |
|
13 |
* When distributing Covered Code, include this CDDL HEADER in each |
|
14 |
* file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 |
* If applicable, add the following below this CDDL HEADER, with the |
|
16 |
* fields enclosed by brackets "[]" replaced with your own identifying |
|
17 |
* information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 |
* |
|
19 |
* CDDL HEADER END |
|
20 |
*/ |
|
21 |
||
22 |
/* |
|
793
0a5a7daf579b
7130765 - Move old SMF module to VP core package
Dan Labrecque <dan.labrecque@oracle.com>
parents:
323
diff
changeset
|
23 |
* Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. |
0 | 24 |
*/ |
25 |
||
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
26 |
package org.opensolaris.os.scf.common; |
0 | 27 |
|
28 |
import java.net.URI; |
|
29 |
import java.net.URISyntaxException; |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
30 |
import java.beans.ConstructorProperties; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
31 |
import java.util.Map; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
32 |
import java.util.EnumMap; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
33 |
import javax.management.openmbean.*; |
0 | 34 |
|
35 |
/** |
|
36 |
* A basic FMRI class. Probably should be named "SmfFMRI", as |
|
37 |
* legacy-run services aren't an SCF concept. |
|
38 |
*/ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
39 |
public class FMRI implements Comparable<FMRI>, CompositeDataView |
0 | 40 |
{ |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
41 |
/* |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
42 |
* Static data |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
43 |
*/ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
44 |
public static final String SCF_SCOPE_LOCAL = "localhost"; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
45 |
private static final String FORMAT = |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
46 |
"([A-Za-z][_A-Za-z0-9.-]*,)?[_A-Za-z0-9-]*"; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
47 |
private static final Map<FMRIScheme, String> scheme_strings = |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
48 |
new EnumMap<FMRIScheme, String>(FMRIScheme.class); |
0 | 49 |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
50 |
static { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
51 |
scheme_strings.put(FMRIScheme.FILE, "file"); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
52 |
scheme_strings.put(FMRIScheme.LEGACY, "lrc"); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
53 |
scheme_strings.put(FMRIScheme.SERVICE, "svc"); |
0 | 54 |
} |
55 |
||
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
56 |
/* |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
57 |
* FMRI components |
0 | 58 |
*/ |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
59 |
private FMRIScheme scheme_; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
60 |
private String scope_ = null; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
61 |
private String service_ = null; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
62 |
private String instance_ = null; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
63 |
private String pg_ = null; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
64 |
private String property_ = null; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
65 |
private String name_ = null; |
0 | 66 |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
67 |
/* |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
68 |
* Derivative information |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
69 |
*/ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
70 |
private FMRIType svctype_; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
71 |
private String canonicalStr_; |
0 | 72 |
|
73 |
/** |
|
74 |
* Creates an FMRI from a URI. |
|
75 |
*/ |
|
76 |
public FMRI(URI uri) throws URISyntaxException |
|
77 |
{ |
|
78 |
if (!uri.isAbsolute() || uri.isOpaque()) |
|
79 |
throw (new URISyntaxException(uri.toString(), |
|
80 |
"Bad FMRI")); |
|
81 |
||
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
82 |
String scheme = uri.getScheme(); |
0 | 83 |
scope_ = uri.getAuthority(); |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
84 |
if (scope_ == null || scope_.isEmpty() || |
314
8decc90a3ec6
9416 more fully featured FMRI type (fix lint)
David Powell <David.Powell@sun.com>
parents:
310
diff
changeset
|
85 |
scope_.equals(SCF_SCOPE_LOCAL)) |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
86 |
scope_ = null; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
87 |
canonicalStr_ = new URI(uri.getScheme(), scope_, uri.getPath(), |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
88 |
null, null).toString(); |
0 | 89 |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
90 |
if (scheme.equals("svc")) { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
91 |
scheme_ = FMRIScheme.SERVICE; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
92 |
svctype_ = FMRIType.SCOPE; |
0 | 93 |
|
94 |
String[] top = uri.getPath().split("/:properties/", 2); |
|
95 |
||
96 |
String[] next = top[0].split(":", 2); |
|
97 |
/* |
|
98 |
* We can assume the path starts with a slash |
|
99 |
* because we reject relative URIs above. |
|
100 |
*/ |
|
101 |
service_ = next[0].substring(1); |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
102 |
svctype_ = FMRIType.SERVICE; |
0 | 103 |
if (next.length == 2) { |
104 |
instance_ = next[1]; |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
105 |
if (!instance_.matches(FORMAT)) |
0 | 106 |
throw (new URISyntaxException( |
107 |
uri.toString(), |
|
108 |
"Invalid instance: " + instance_)); |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
109 |
svctype_ = FMRIType.INSTANCE; |
0 | 110 |
} |
111 |
||
112 |
if (top.length == 2) { |
|
113 |
next = top[1].split("/", 2); |
|
114 |
pg_ = next[0]; |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
115 |
if (!pg_.matches(FORMAT)) |
0 | 116 |
throw (new URISyntaxException( |
117 |
uri.toString(), |
|
118 |
"Invalid property group: " + pg_)); |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
119 |
svctype_ = FMRIType.PGROUP; |
0 | 120 |
if (next.length == 2) { |
121 |
property_ = next[1]; |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
122 |
if (!property_.matches(FORMAT)) |
0 | 123 |
throw (new URISyntaxException( |
124 |
uri.toString(), |
|
125 |
"Invalid property: " + |
|
126 |
property_)); |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
127 |
svctype_ = FMRIType.PROPERTY; |
0 | 128 |
} |
129 |
} |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
130 |
} else if (scheme.equals("file")) { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
131 |
scheme_ = FMRIScheme.FILE; |
0 | 132 |
name_ = uri.getPath(); |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
133 |
} else if (scheme.equals("lrc")) { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
134 |
scheme_ = FMRIScheme.LEGACY; |
0 | 135 |
name_ = uri.getPath(); |
136 |
} else { |
|
137 |
throw (new URISyntaxException(uri.toString(), |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
138 |
"Invalid FMRI scheme: " + scheme)); |
0 | 139 |
} |
140 |
} |
|
141 |
||
142 |
/** |
|
143 |
* Creates an FMRI from a string. |
|
144 |
*/ |
|
145 |
public FMRI(String fmri) throws URISyntaxException |
|
146 |
{ |
|
147 |
/* Work around bug 6504439 in scf_scope_to_fmri */ |
|
148 |
this(new URI(fmri.equals("svc:") ? "svc:///" : fmri)); |
|
149 |
} |
|
150 |
||
151 |
/** |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
152 |
* Constucts an FMRI from its attributes. Needed for the class to be |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
153 |
* reconstructable. |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
154 |
*/ |
314
8decc90a3ec6
9416 more fully featured FMRI type (fix lint)
David Powell <David.Powell@sun.com>
parents:
310
diff
changeset
|
155 |
@SuppressWarnings({"fallthrough"}) |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
156 |
@ConstructorProperties({"scheme", "svcType", "scope", "name", "service", |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
157 |
"instance", "propertyGroup", "property"}) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
158 |
public FMRI(FMRIScheme scheme, FMRIType type, String scope, String name, |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
159 |
String service, String instance, String pg, String property) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
160 |
{ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
161 |
scheme_ = scheme; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
162 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
163 |
scope_ = scope; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
164 |
if (scope_ == null || scope_.isEmpty() || |
314
8decc90a3ec6
9416 more fully featured FMRI type (fix lint)
David Powell <David.Powell@sun.com>
parents:
310
diff
changeset
|
165 |
scope_.equals(SCF_SCOPE_LOCAL)) |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
166 |
scope_ = null; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
167 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
168 |
String path; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
169 |
if (scheme != FMRIScheme.SERVICE) { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
170 |
svctype_ = FMRIType.NONE; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
171 |
path = name_ = name; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
172 |
} else { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
173 |
svctype_ = type; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
174 |
name_ = null; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
175 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
176 |
path = ""; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
177 |
switch (svctype_) { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
178 |
case PROPERTY: |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
179 |
property_ = property; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
180 |
path = "/" + property + path; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
181 |
case PGROUP: |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
182 |
pg_ = pg; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
183 |
path = "/:properties/" + pg + path; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
184 |
case INSTANCE: |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
185 |
instance_ = instance; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
186 |
path = ":" + instance + path; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
187 |
case SERVICE: |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
188 |
service_ = service; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
189 |
path = "/" + service + path; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
190 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
191 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
192 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
193 |
try { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
194 |
URI uri = new URI(scheme_strings.get(scheme), scope_, |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
195 |
path, null, null); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
196 |
canonicalStr_ = uri.toString(); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
197 |
} catch (URISyntaxException ex) { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
198 |
canonicalStr_ = null; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
199 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
200 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
201 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
202 |
/** |
0 | 203 |
* Returns the FMRI's type (scheme). |
204 |
*/ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
205 |
public FMRIScheme getScheme() |
0 | 206 |
{ |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
207 |
return (scheme_); |
0 | 208 |
} |
209 |
||
210 |
/** |
|
211 |
* Returns a svc: FMRI's type. |
|
212 |
*/ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
213 |
public FMRIType getSvcType() |
0 | 214 |
{ |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
215 |
if (scheme_ != FMRIScheme.SERVICE) |
0 | 216 |
throw (new FMRIException(this, "not a service FMRI")); |
217 |
return (svctype_); |
|
218 |
} |
|
219 |
||
220 |
/** |
|
221 |
* Returns the FMRI's scope. |
|
222 |
*/ |
|
223 |
public String getScope() |
|
224 |
{ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
225 |
return (scope_ == null ? SCF_SCOPE_LOCAL : scope_); |
0 | 226 |
} |
227 |
||
228 |
/** |
|
229 |
* Returns the name of a legacy-run or file FMRI. |
|
230 |
*/ |
|
231 |
public String getName() |
|
232 |
{ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
233 |
if (scheme_ == FMRIScheme.SERVICE) |
0 | 234 |
throw (new FMRIException(this, |
235 |
"not a file or legacy FMRI")); |
|
236 |
return (name_); |
|
237 |
} |
|
238 |
||
239 |
/** |
|
240 |
* Throws an FMRIException from a function which may only be |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
241 |
* called on a svc: FMRI. Takes the FMRIType required by the |
0 | 242 |
* caller. |
243 |
*/ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
244 |
private void checktype(FMRIType svctype) |
0 | 245 |
{ |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
246 |
String prefix = "unable to read " + svctype; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
247 |
if (scheme_ != FMRIScheme.SERVICE) |
0 | 248 |
throw (new FMRIException(this, prefix + |
249 |
" from non-service FMRI")); |
|
250 |
if (svctype_.compareTo(svctype) < 0) |
|
251 |
throw (new FMRIException(this, prefix + |
|
252 |
" from " + svctype_ + "FMRI")); |
|
253 |
} |
|
254 |
||
255 |
/** |
|
256 |
* Returns the service component of a service FMRI. |
|
257 |
*/ |
|
258 |
public String getService() |
|
259 |
{ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
260 |
checktype(FMRIType.SERVICE); |
0 | 261 |
return (service_); |
262 |
} |
|
263 |
||
264 |
/** |
|
265 |
* Returns the instance component of a service FMRI, or {@code |
|
266 |
* null} if there is none. |
|
267 |
*/ |
|
268 |
public String getInstance() |
|
269 |
{ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
270 |
checktype(FMRIType.INSTANCE); |
0 | 271 |
return (instance_); |
272 |
} |
|
273 |
||
274 |
/** |
|
275 |
* Returns the property group component of a service FMRI. |
|
276 |
*/ |
|
277 |
public String getPropertyGroup() |
|
278 |
{ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
279 |
checktype(FMRIType.PGROUP); |
0 | 280 |
return (pg_); |
281 |
} |
|
282 |
||
283 |
/** |
|
284 |
* Returns the property component of a service FMRI. |
|
285 |
*/ |
|
286 |
public String getProperty() |
|
287 |
{ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
288 |
checktype(FMRIType.PROPERTY); |
0 | 289 |
return (property_); |
290 |
} |
|
291 |
||
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
292 |
public FMRI toServiceFMRI() |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
293 |
{ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
294 |
checktype(FMRIType.SERVICE); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
295 |
if (svctype_ == FMRIType.SERVICE) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
296 |
return this; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
297 |
return (new FMRI(scheme_, FMRIType.SERVICE, scope_, null, |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
298 |
service_, null, null, null)); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
299 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
300 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
301 |
public FMRI toInstanceFMRI() |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
302 |
{ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
303 |
checktype(FMRIType.INSTANCE); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
304 |
if (svctype_ == FMRIType.INSTANCE) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
305 |
return this; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
306 |
return (new FMRI(scheme_, FMRIType.INSTANCE, scope_, null, |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
307 |
service_, instance_, null, null)); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
308 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
309 |
|
323
497a785649eb
10071 apply new design to SMF panel
David Powell <David.Powell@sun.com>
parents:
314
diff
changeset
|
310 |
public FMRI toInstanceFMRI(String instanceName) |
497a785649eb
10071 apply new design to SMF panel
David Powell <David.Powell@sun.com>
parents:
314
diff
changeset
|
311 |
{ |
497a785649eb
10071 apply new design to SMF panel
David Powell <David.Powell@sun.com>
parents:
314
diff
changeset
|
312 |
checktype(FMRIType.SERVICE); |
497a785649eb
10071 apply new design to SMF panel
David Powell <David.Powell@sun.com>
parents:
314
diff
changeset
|
313 |
return (new FMRI(scheme_, FMRIType.INSTANCE, scope_, null, |
497a785649eb
10071 apply new design to SMF panel
David Powell <David.Powell@sun.com>
parents:
314
diff
changeset
|
314 |
service_, instanceName, null, null)); |
497a785649eb
10071 apply new design to SMF panel
David Powell <David.Powell@sun.com>
parents:
314
diff
changeset
|
315 |
} |
497a785649eb
10071 apply new design to SMF panel
David Powell <David.Powell@sun.com>
parents:
314
diff
changeset
|
316 |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
317 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
318 |
/* |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
319 |
* CompositeDataView methods |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
320 |
*/ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
321 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
322 |
private static final String[] itemNames = new String[] { "scheme", |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
323 |
"svcType", "scope", "name", "service", "instance", "propertyGroup", |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
324 |
"property" }; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
325 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
326 |
/* |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
327 |
* Manually convert the FMRI to its automatically-determined |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
328 |
* CompositeType. This conversion is normally performed by the |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
329 |
* MXBean implementation, but the automatic conversion uses our |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
330 |
* accessors to inspect the object. Performing the conversion |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
331 |
* manually permits us to circumvent the run-time checking |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
332 |
* performed by our accessors (or to put it differently, permits |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
333 |
* us to leave the run-time checking in place). |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
334 |
*/ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
335 |
public CompositeData toCompositeData(CompositeType ct) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
336 |
{ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
337 |
Object[] itemValues = new Object[] { scheme_.name(), |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
338 |
svctype_.name(), scope_, name_, service_, instance_, pg_, |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
339 |
property_ }; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
340 |
try { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
341 |
return (new CompositeDataSupport(ct, itemNames, |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
342 |
itemValues)); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
343 |
} catch (OpenDataException ex) { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
344 |
throw (new RuntimeException(ex)); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
345 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
346 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
347 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
348 |
// Comparable methods |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
349 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
350 |
private static int strcmp(String a, String b) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
351 |
{ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
352 |
if (a == null) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
353 |
return (b == null ? 0 : 1); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
354 |
if (b == null) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
355 |
return (-1); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
356 |
return (a.compareTo(b)); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
357 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
358 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
359 |
public int compareTo(FMRI f) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
360 |
{ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
361 |
int result = scheme_.compareTo(f.scheme_); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
362 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
363 |
if (result == 0) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
364 |
result = strcmp(scope_, f.scope_); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
365 |
if (scheme_ != FMRIScheme.SERVICE) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
366 |
result = strcmp(name_, f.name_); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
367 |
else { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
368 |
if (result == 0) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
369 |
result = strcmp(service_, f.service_); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
370 |
if (result == 0) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
371 |
result = strcmp(instance_, f.instance_); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
372 |
if (result == 0) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
373 |
result = strcmp(pg_, f.pg_); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
374 |
if (result == 0) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
375 |
result = strcmp(property_, f.property_); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
376 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
377 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
378 |
return (result); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
379 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
380 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
381 |
/* |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
382 |
* Object methods |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
383 |
*/ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
384 |
|
0 | 385 |
/** |
386 |
* Returns the FMRI as a string. |
|
387 |
*/ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
388 |
@Override |
0 | 389 |
public String toString() |
390 |
{ |
|
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
391 |
return (canonicalStr_); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
392 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
393 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
394 |
@Override |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
395 |
public boolean equals(Object o) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
396 |
{ |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
397 |
if (o == null) |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
398 |
return (false); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
399 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
400 |
FMRI f; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
401 |
try { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
402 |
f = (FMRI)o; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
403 |
} catch (ClassCastException e) { |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
404 |
return (false); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
405 |
} |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
406 |
|
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
407 |
return (compareTo(f) == 0); |
0 | 408 |
} |
409 |
||
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
410 |
@Override |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
411 |
public int hashCode() |
0 | 412 |
{ |
310
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
413 |
int hash = 7; |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
414 |
hash = 79 * hash + |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
415 |
(this.scope_ != null ? this.scope_.hashCode() : 0); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
416 |
hash = 79 * hash + |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
417 |
(this.service_ != null ? this.service_.hashCode() : 0); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
418 |
hash = 79 * hash + |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
419 |
(this.instance_ != null ? this.instance_.hashCode() : 0); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
420 |
hash = 79 * hash + |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
421 |
(this.pg_ != null ? this.pg_.hashCode() : 0); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
422 |
hash = 79 * hash + |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
423 |
(this.property_ != null ? this.property_.hashCode() : 0); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
424 |
hash = 79 * hash + |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
425 |
(this.name_ != null ? this.name_.hashCode() : 0); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
426 |
hash = 79 * hash + |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
427 |
(this.scheme_ != null ? this.scheme_.hashCode() : 0); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
428 |
hash = 79 * hash + |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
429 |
(this.svctype_ != null ? this.svctype_.hashCode() : 0); |
643b4561e982
9415 should deliver a gnome schema for svc: URIs
David Powell <David.Powell@sun.com>
parents:
79
diff
changeset
|
430 |
return hash; |
0 | 431 |
} |
432 |
} |