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