1 /*
2 ServiceLocationAttributeDescriptor.java
3
4 (C) Copyright IBM Corp. 2005, 2009
5
6 THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
7 ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
8 CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
9
10 You can obtain a current copy of the Eclipse Public License from
11 http://www.opensource.org/licenses/eclipse-1.0.php
12
13 @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
14 * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
15 *
16 * Change History
17 * Flag Date Prog Description
18 *-------------------------------------------------------------------------------
19 * 1516246 2006-07-22 lupusalex Integrate SLP client code
20 * 2003590 2008-06-30 blaschke-oss Change licensing from CPL to EPL
21 * 2524131 2009-01-21 raman_arora Upgrade client to JDK 1.5 (Phase 1)
22 * 2531371 2009-02-10 raman_arora Upgrade client to JDK 1.5 (Phase 2)
23 */
24
25 package org.metricshub.wbem.sblim.slp;
26
27 /*-
28 * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
29 * WBEM Java Client
30 * ჻჻჻჻჻჻
31 * Copyright 2023 - 2025 MetricsHub
32 * ჻჻჻჻჻჻
33 * Licensed under the Apache License, Version 2.0 (the "License");
34 * you may not use this file except in compliance with the License.
35 * You may obtain a copy of the License at
36 *
37 * http://www.apache.org/licenses/LICENSE-2.0
38 *
39 * Unless required by applicable law or agreed to in writing, software
40 * distributed under the License is distributed on an "AS IS" BASIS,
41 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
42 * See the License for the specific language governing permissions and
43 * limitations under the License.
44 * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
45 */
46
47 import java.util.Enumeration;
48
49 /**
50 * The ServiceLocationAttributeDescriptor interface provides introspection on a
51 * template attribute definition (see RFC 2609). Classes implementing the
52 * ServiceLocationAttributeDescriptor interface return information on a
53 * particular service location attribute definition from the service template.
54 * This information is primarily for GUI tools. Programmatic attribute
55 * verification should be done through the ServiceLocationAttributeVerifier.
56 *
57 */
58 public interface ServiceLocationAttributeDescriptor {
59 /**
60 * Return a String containing the attribute's id.
61 *
62 * @return The id
63 */
64 public abstract String getId();
65
66 /**
67 * Returns a String containing the fully package-qualified Java type of the
68 * attribute. SLP types are translated into Java types as follows: <br />
69 * <br />
70 * <table border="1">
71 * <tr>
72 * <th>SLP</th>
73 * <th>Java</th>
74 * </tr>
75 * <tr>
76 * <td>STRING</td>
77 * <td>"java.lang.String"</td>
78 * </tr>
79 * <tr>
80 * <td>INTEGER</td>
81 * <td>"java.lang.Integer"</td>
82 * </tr>
83 * <tr>
84 * <td>BOOLEAN</td>
85 * <td>"java.lang.Boolean"</td>
86 * </tr>
87 * <tr>
88 * <td>OPAQUE</td>
89 * <td>"[B" (byte[])</td>
90 * </tr>
91 * <tr>
92 * <td>KEYWORD</td>
93 * <td>"" (empty string)</td>
94 * </tr>
95 * </table>
96 *
97 * @return The Java type
98 */
99 public abstract String getValueType();
100
101 /**
102 * Return a String containing the attribute's help text.
103 *
104 * @return The description
105 */
106 public abstract String getDescription();
107
108 /**
109 * Return an Enumeration of allowed values for the attribute type. For
110 * keyword attributes returns null. For no allowed values (i.e.
111 * unrestricted) returns an empty Enumeration.
112 *
113 * @return The allowed values
114 */
115 public abstract Enumeration<?> getAllowedValues();
116
117 /**
118 * Return an Enumeration of default values for the attribute type. For
119 * keyword attributes returns null. For no allowed values (i.e.
120 * unrestricted) returns an empty Enumeration.
121 *
122 * @return The default values
123 */
124 public abstract Enumeration<?> getDefaultValues();
125
126 /**
127 * Returns true if the "X" flag is set, indicating that the attribute should
128 * be included in an any Locator.findServices() request search filter.
129 *
130 * @return <code>true</code> if "X" is set, <code>false</code> otherwise
131 */
132 public abstract boolean getRequiresExplicitMatch();
133
134 /**
135 * Returns true if the "M" flag is set.
136 *
137 * @return <code>true</code> if "M" is set, <code>false</code> otherwise
138 */
139 public abstract boolean getIsMultivalued();
140
141 /**
142 * Returns true if the "O"" flag is set.
143 *
144 * @return <code>true</code> if "O" is set, <code>false</code> otherwise
145 */
146 public abstract boolean getIsOptional();
147
148 /**
149 * Returns true if the "L" flag is set.
150 *
151 * @return <code>true</code> if "L" is set, <code>false</code> otherwise
152 */
153 public abstract boolean getIsLiteral();
154
155 /**
156 * Returns true if the attribute is a keyword attribute.
157 *
158 * @return <code>true</code> if the attribute is a keyword,
159 * <code>false</code> otherwise
160 */
161 public abstract boolean getIsKeyword();
162 }