View Javadoc
1   /*
2     ServiceLocationAttributeVerifier.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  import java.util.Locale;
49  import java.util.Vector;
50  
51  /**
52   * The ServiceLocationAttributeVerifier provides access to service templates.
53   * Classes implementing this interface parse SLP template definitions, provide
54   * information on attribute definitions for service types, and verify whether a
55   * ServiceLocationAttribute object matches a template for a particular service
56   * type. Clients obtain ServiceLocationAttributeVerifier objects for specific
57   * SLP service types through the TemplateRegistry.
58   *
59   *
60   */
61  public interface ServiceLocationAttributeVerifier {
62  	/**
63  	 * Returns the SLP service type for which this is the verifier.
64  	 *
65  	 * @return The service type
66  	 */
67  	public abstract ServiceType getServiceType();
68  
69  	/**
70  	 * Return the language locale of the template.
71  	 *
72  	 * @return The locale
73  	 */
74  	public abstract Locale getLocale();
75  
76  	/**
77  	 * Return the template version number identifier.
78  	 *
79  	 * @return The version
80  	 */
81  	public abstract String getVersion();
82  
83  	/**
84  	 * Return the URL syntax expression for the service: URL.
85  	 *
86  	 * @return The url syntax
87  	 */
88  	public abstract String getURLSyntax();
89  
90  	/**
91  	 * Return the descriptive help text for the template.
92  	 *
93  	 * @return The description
94  	 */
95  	public abstract String getDescription();
96  
97  	/**
98  	 * Return the ServiceLocationAttributeDescriptor for the attribute having
99  	 * the named id. If no such attribute exists in this template, return null.
100 	 * This method is primarily for GUI tools to display attribute information.
101 	 * Programmatic verification of attributes should use the verifyAttribute()
102 	 * method.
103 	 *
104 	 * @param pAttributeId
105 	 *            The attribute id
106 	 * @return The descriptor
107 	 */
108 	public abstract ServiceLocationAttributeDescriptor getAttributeDescriptor(String pAttributeId);
109 
110 	/**
111 	 * Returns an Enumeration allowing introspection on the attribute definition
112 	 * in the service template. The Enumeration returns
113 	 * ServiceLocationAttributeDescriptor objects for the attributes. This
114 	 * method is primarily for GUI tools to display attribute information.
115 	 * Programmatic verification of attributes should use the verifyAttribute()
116 	 * method.
117 	 *
118 	 * @return Enumeration of attribute descriptors
119 	 */
120 	public abstract Enumeration<?> getAttributeDescriptors();
121 
122 	/**
123 	 * Verify that the attribute matches the template definition. If the
124 	 * attribute doesn't match, ServiceLocationException is thrown with the
125 	 * error code as ServiceLocationException.PARSE_ERROR.
126 	 *
127 	 * @param pAttribute
128 	 *            The ServiceLocationAttribute object to be verified.
129 	 * @throws ServiceLocationException
130 	 *             if validation failed
131 	 *
132 	 */
133 	public abstract void verifyAttribute(ServiceLocationAttribute pAttribute) throws ServiceLocationException;
134 
135 	/**
136 	 * Verify that the Vector of ServiceLocationAttribute objects matches the
137 	 * template for this service type. The vector must contain all the required
138 	 * attributes, and all attributes must match their template definitions. If
139 	 * the attributes don't match, ServiceLocationException is thrown with the
140 	 * error code as ServiceLocationException.PARSE_ERROR
141 	 *
142 	 * @param pAttributeVector
143 	 *            A Vector of ServiceLocationAttribute objects for the
144 	 *            registration.
145 	 * @throws ServiceLocationException
146 	 *             if attributes don't match
147 	 */
148 	public abstract void verifyRegistration(Vector<?> pAttributeVector) throws ServiceLocationException;
149 }