xref: /illumos-gate/usr/src/lib/libslp/javalib/com/sun/slp/ServiceLocationAttributeVerifier.java (revision b31b5de1357c915fe7dab4d9646d9d84f9fe69bc)
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  * Copyright (c) 1999 by Sun Microsystems, Inc.
23  * All rights reserved.
24  *
25  */
26 
27 //  ServiceLocationAttributeVerifier.java: Attribute parser for SLP templates.
28 //  Author:           James Kempf
29 //  Created On:       Thu Jun 19 10:20:25 1997
30 //  Last Modified By: James Kempf
31 //  Last Modified On: Wed Jun 24 15:50:43 1998
32 //  Update Count:     22
33 //
34 
35 package com.sun.slp;
36 
37 import java.util.*;
38 
39 /**
40  * Classes implementing the <b>ServiceLocationAttributeVerifier</b> interface
41  * parse SLP template definitions, provide information on attribute
42  * definitions for service types, and verify whether a
43  * <b>ServiceLocationAttribute</b> object matches a template for a particular
44  * service type. Clients obtain <b>ServiceLocationAttributeVerifier</b>
45  * objects for specific SLP service types through the <b>TemplateRegistry</b>.
46  *
47  * @author James Kempf
48  *
49  */
50 
51 public interface ServiceLocationAttributeVerifier {
52 
53     /**
54      * Returns the SLP service type for which this is the verifier.
55      *
56      * @return The SLP service type name.
57      */
58 
59     public ServiceType getServiceType();
60 
61     /**
62      * Returns the SLP language locale of this is the verifier.
63      *
64      * @return The SLP language locale.
65      */
66 
67     public Locale getLocale();
68 
69     /**
70      * Returns the SLP version of this is the verifier.
71      *
72      * @return The SLP version.
73      */
74 
75     public String getVersion();
76 
77     /**
78      * Returns the SLP URL syntax of this is the verifier.
79      *
80      * @return The SLP URL syntax.
81      */
82 
83     public String getURLSyntax();
84 
85     /**
86      * Returns the SLP description of this is the verifier.
87      *
88      * @return The SLP description.
89      */
90 
91     public String getDescription();
92 
93     /**
94      * Returns the <b>ServiceLocationAttributeDescriptor</b> object for the
95      * attribute having the named id. IF no such attribute exists in the
96      * template, returns null. This method is primarily for GUI tools to
97      * display attribute information. Programmatic verification of attributes
98      * should use the <b>verifyAttribute()</b> method.
99      *
100      * @param attrId Id of attribute to return.
101      * @return The <b>ServiceLocationAttributeDescriptor<b> object
102      * 	       corresponding to the parameter, or null if none.
103      */
104 
105     public ServiceLocationAttributeDescriptor
106 	getAttributeDescriptor(String attrId);
107 
108     /**
109      * Returns an <b>Enumeration</b> of
110      * <b>ServiceLocationAttributeDescriptors</b> for the template. This method
111      * is primarily for GUI tools to display attribute information.
112      * Programmatic verification of attributes should use the
113      * <b>verifyAttribute()</b> method. Note that small memory implementations
114      * may want to implement the <b>Enumeration</b> so that attributes are
115      * parsed on demand rather than at creation time.
116      *
117      * @return A <b>Dictionary</b> with attribute id's as the keys and
118      *	      <b>ServiceLocationAttributeDescriptor</b> objects for the
119      *	      attributes as the values.
120      */
121 
122     public Enumeration getAttributeDescriptors();
123 
124     /**
125      * Verify that the attribute parameter is a valid SLP attribute.
126      *
127      * @param <i>attribute</i> The <b>ServiceLocationAttribute</b> to be
128      *			      verified.
129      * @exception ServiceLocationException Thrown if the
130      *		 attribute vector is not valid. The message contains
131      *		 information on the attribute name and problem, and
132      *		 the error code is <b>ServiceLocation.PARSE_ERROR</b>.
133      */
134 
135     public void verifyAttribute(ServiceLocationAttribute attribute)
136 	throws ServiceLocationException;
137 
138     /**
139      * Verify that the set of registration attributes matches the
140      * required attributes for the service.
141      *
142      * @param <i>attributeVector</i> A <b>Vector</b> of
143      *				    <b>ServiceLocationAttribute</b> objects
144      *				    for the registration.
145      * @exception ServiceLocationException Thrown if the
146      *		 attribute vector is not valid. The message contains
147      *		 information on the attribute name and problem, and
148      *		 the error code is <b>ServiceLocation.PARSE_ERROR</b>.
149      */
150 
151     public void verifyRegistration(Vector attributeVector)
152 	throws ServiceLocationException;
153 }
154