10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*7298SMark.J.Nelson@Sun.COM  * Common Development and Distribution License (the "License").
6*7298SMark.J.Nelson@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
220Sstevel@tonic-gate  * Copyright (c) 1999 by Sun Microsystems, Inc.
230Sstevel@tonic-gate  * All rights reserved.
240Sstevel@tonic-gate  *
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate //  ServiceLocationAttributeVerifier.java: Attribute parser for SLP templates.
280Sstevel@tonic-gate //  Author:           James Kempf
290Sstevel@tonic-gate //  Created On:       Thu Jun 19 10:20:25 1997
300Sstevel@tonic-gate //  Last Modified By: James Kempf
310Sstevel@tonic-gate //  Last Modified On: Wed Jun 24 15:50:43 1998
320Sstevel@tonic-gate //  Update Count:     22
330Sstevel@tonic-gate //
340Sstevel@tonic-gate 
350Sstevel@tonic-gate package com.sun.slp;
360Sstevel@tonic-gate 
370Sstevel@tonic-gate import java.util.*;
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /**
400Sstevel@tonic-gate  * Classes implementing the <b>ServiceLocationAttributeVerifier</b> interface
410Sstevel@tonic-gate  * parse SLP template definitions, provide information on attribute
420Sstevel@tonic-gate  * definitions for service types, and verify whether a
430Sstevel@tonic-gate  * <b>ServiceLocationAttribute</b> object matches a template for a particular
440Sstevel@tonic-gate  * service type. Clients obtain <b>ServiceLocationAttributeVerifier</b>
450Sstevel@tonic-gate  * objects for specific SLP service types through the <b>TemplateRegistry</b>.
460Sstevel@tonic-gate  *
470Sstevel@tonic-gate  * @author James Kempf
480Sstevel@tonic-gate  *
490Sstevel@tonic-gate  */
500Sstevel@tonic-gate 
510Sstevel@tonic-gate public interface ServiceLocationAttributeVerifier {
520Sstevel@tonic-gate 
530Sstevel@tonic-gate     /**
540Sstevel@tonic-gate      * Returns the SLP service type for which this is the verifier.
550Sstevel@tonic-gate      *
560Sstevel@tonic-gate      * @return The SLP service type name.
570Sstevel@tonic-gate      */
580Sstevel@tonic-gate 
getServiceType()590Sstevel@tonic-gate     public ServiceType getServiceType();
600Sstevel@tonic-gate 
610Sstevel@tonic-gate     /**
620Sstevel@tonic-gate      * Returns the SLP language locale of this is the verifier.
630Sstevel@tonic-gate      *
640Sstevel@tonic-gate      * @return The SLP language locale.
650Sstevel@tonic-gate      */
660Sstevel@tonic-gate 
getLocale()670Sstevel@tonic-gate     public Locale getLocale();
680Sstevel@tonic-gate 
690Sstevel@tonic-gate     /**
700Sstevel@tonic-gate      * Returns the SLP version of this is the verifier.
710Sstevel@tonic-gate      *
720Sstevel@tonic-gate      * @return The SLP version.
730Sstevel@tonic-gate      */
740Sstevel@tonic-gate 
getVersion()750Sstevel@tonic-gate     public String getVersion();
760Sstevel@tonic-gate 
770Sstevel@tonic-gate     /**
780Sstevel@tonic-gate      * Returns the SLP URL syntax of this is the verifier.
790Sstevel@tonic-gate      *
800Sstevel@tonic-gate      * @return The SLP URL syntax.
810Sstevel@tonic-gate      */
820Sstevel@tonic-gate 
getURLSyntax()830Sstevel@tonic-gate     public String getURLSyntax();
840Sstevel@tonic-gate 
850Sstevel@tonic-gate     /**
860Sstevel@tonic-gate      * Returns the SLP description of this is the verifier.
870Sstevel@tonic-gate      *
880Sstevel@tonic-gate      * @return The SLP description.
890Sstevel@tonic-gate      */
900Sstevel@tonic-gate 
getDescription()910Sstevel@tonic-gate     public String getDescription();
920Sstevel@tonic-gate 
930Sstevel@tonic-gate     /**
940Sstevel@tonic-gate      * Returns the <b>ServiceLocationAttributeDescriptor</b> object for the
950Sstevel@tonic-gate      * attribute having the named id. IF no such attribute exists in the
960Sstevel@tonic-gate      * template, returns null. This method is primarily for GUI tools to
970Sstevel@tonic-gate      * display attribute information. Programmatic verification of attributes
980Sstevel@tonic-gate      * should use the <b>verifyAttribute()</b> method.
990Sstevel@tonic-gate      *
1000Sstevel@tonic-gate      * @param attrId Id of attribute to return.
1010Sstevel@tonic-gate      * @return The <b>ServiceLocationAttributeDescriptor<b> object
1020Sstevel@tonic-gate      * 	       corresponding to the parameter, or null if none.
1030Sstevel@tonic-gate      */
1040Sstevel@tonic-gate 
1050Sstevel@tonic-gate     public ServiceLocationAttributeDescriptor
getAttributeDescriptor(String attrId)1060Sstevel@tonic-gate 	getAttributeDescriptor(String attrId);
1070Sstevel@tonic-gate 
1080Sstevel@tonic-gate     /**
1090Sstevel@tonic-gate      * Returns an <b>Enumeration</b> of
1100Sstevel@tonic-gate      * <b>ServiceLocationAttributeDescriptors</b> for the template. This method
1110Sstevel@tonic-gate      * is primarily for GUI tools to display attribute information.
1120Sstevel@tonic-gate      * Programmatic verification of attributes should use the
1130Sstevel@tonic-gate      * <b>verifyAttribute()</b> method. Note that small memory implementations
1140Sstevel@tonic-gate      * may want to implement the <b>Enumeration</b> so that attributes are
1150Sstevel@tonic-gate      * parsed on demand rather than at creation time.
1160Sstevel@tonic-gate      *
1170Sstevel@tonic-gate      * @return A <b>Dictionary</b> with attribute id's as the keys and
1180Sstevel@tonic-gate      *	      <b>ServiceLocationAttributeDescriptor</b> objects for the
1190Sstevel@tonic-gate      *	      attributes as the values.
1200Sstevel@tonic-gate      */
1210Sstevel@tonic-gate 
getAttributeDescriptors()1220Sstevel@tonic-gate     public Enumeration getAttributeDescriptors();
1230Sstevel@tonic-gate 
1240Sstevel@tonic-gate     /**
1250Sstevel@tonic-gate      * Verify that the attribute parameter is a valid SLP attribute.
1260Sstevel@tonic-gate      *
1270Sstevel@tonic-gate      * @param <i>attribute</i> The <b>ServiceLocationAttribute</b> to be
1280Sstevel@tonic-gate      *			      verified.
1290Sstevel@tonic-gate      * @exception ServiceLocationException Thrown if the
1300Sstevel@tonic-gate      *		 attribute vector is not valid. The message contains
1310Sstevel@tonic-gate      *		 information on the attribute name and problem, and
1320Sstevel@tonic-gate      *		 the error code is <b>ServiceLocation.PARSE_ERROR</b>.
1330Sstevel@tonic-gate      */
1340Sstevel@tonic-gate 
verifyAttribute(ServiceLocationAttribute attribute)1350Sstevel@tonic-gate     public void verifyAttribute(ServiceLocationAttribute attribute)
1360Sstevel@tonic-gate 	throws ServiceLocationException;
1370Sstevel@tonic-gate 
1380Sstevel@tonic-gate     /**
1390Sstevel@tonic-gate      * Verify that the set of registration attributes matches the
1400Sstevel@tonic-gate      * required attributes for the service.
1410Sstevel@tonic-gate      *
1420Sstevel@tonic-gate      * @param <i>attributeVector</i> A <b>Vector</b> of
1430Sstevel@tonic-gate      *				    <b>ServiceLocationAttribute</b> objects
1440Sstevel@tonic-gate      *				    for the registration.
1450Sstevel@tonic-gate      * @exception ServiceLocationException Thrown if the
1460Sstevel@tonic-gate      *		 attribute vector is not valid. The message contains
1470Sstevel@tonic-gate      *		 information on the attribute name and problem, and
1480Sstevel@tonic-gate      *		 the error code is <b>ServiceLocation.PARSE_ERROR</b>.
1490Sstevel@tonic-gate      */
1500Sstevel@tonic-gate 
verifyRegistration(Vector attributeVector)1510Sstevel@tonic-gate     public void verifyRegistration(Vector attributeVector)
1520Sstevel@tonic-gate 	throws ServiceLocationException;
1530Sstevel@tonic-gate }
154