xref: /onnv-gate/usr/src/lib/libslp/javalib/com/sun/slp/Locator.java (revision 7298:b69e27387f74)
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 //  UserAgent.java:   Interface for the SLP User Agent operations
280Sstevel@tonic-gate //  Author:           James Kempf
290Sstevel@tonic-gate //  Created On:       Mon Jul  7 09:15:56 1997
300Sstevel@tonic-gate //  Last Modified By: James Kempf
310Sstevel@tonic-gate //  Last Modified On: Wed May 13 17:46:29 1998
320Sstevel@tonic-gate //  Update Count:     17
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  * The Locator interface allows clients to query SLP for existing
410Sstevel@tonic-gate  * services, scopes, and service instances, and to query about attributes
420Sstevel@tonic-gate  * of a particular service instance.
430Sstevel@tonic-gate  *
440Sstevel@tonic-gate  * @see ServiceLocationManager
450Sstevel@tonic-gate  *
460Sstevel@tonic-gate  * @author James Kempf, Erik Guttman
470Sstevel@tonic-gate  */
480Sstevel@tonic-gate 
490Sstevel@tonic-gate public interface Locator {
500Sstevel@tonic-gate 
510Sstevel@tonic-gate     /**
520Sstevel@tonic-gate      * Return the Locator's locale object.
530Sstevel@tonic-gate      *
540Sstevel@tonic-gate      * @return The Locale object.
550Sstevel@tonic-gate      */
560Sstevel@tonic-gate 
getLocale()570Sstevel@tonic-gate     Locale getLocale();
580Sstevel@tonic-gate 
590Sstevel@tonic-gate     /**
600Sstevel@tonic-gate      * Return an enumeration of known service types for this scope and naming
610Sstevel@tonic-gate      * authority.  Unless a proprietary or experimental service is being
620Sstevel@tonic-gate      * discovered, the namingAuthority parameter should be the empty
630Sstevel@tonic-gate      * string, "".
640Sstevel@tonic-gate      *
650Sstevel@tonic-gate      * @param namingAuthority	The naming authority, "" for default,
660Sstevel@tonic-gate      *                           '*' for any naming authority.
670Sstevel@tonic-gate      * @param scopes	The SLP scopes of the types.
680Sstevel@tonic-gate      * @return ServiceLocationEnumeration of ServiceType objects for
690Sstevel@tonic-gate      *	      the service type names.
700Sstevel@tonic-gate      * @exception IllegalArgumentException If any of the parameters are
710Sstevel@tonic-gate      *					  null or syntactically incorrect.
720Sstevel@tonic-gate      * @exception ServiceLocationException An exception is thrown if the
730Sstevel@tonic-gate      *					  operation fails.
740Sstevel@tonic-gate      */
750Sstevel@tonic-gate 
findServiceTypes(String namingAuthority, Vector scopes)760Sstevel@tonic-gate     public ServiceLocationEnumeration findServiceTypes(String namingAuthority,
770Sstevel@tonic-gate 						       Vector scopes)
780Sstevel@tonic-gate 	throws ServiceLocationException;
790Sstevel@tonic-gate 
800Sstevel@tonic-gate     /**
810Sstevel@tonic-gate      * Return an enumeration of ServiceURL objects for services matching
820Sstevel@tonic-gate      * the query. The services are returned from the locale of the
830Sstevel@tonic-gate      * locator.
840Sstevel@tonic-gate      *
850Sstevel@tonic-gate      * @param type	The type of the service (e.g. printer, etc.).
860Sstevel@tonic-gate      * @param scopes	The SLP scopes of the service types.
870Sstevel@tonic-gate      * @param query		A string with the SLP query.
880Sstevel@tonic-gate      * @return ServiceLocationEnumeration of ServiceURL objects for
890Sstevel@tonic-gate      *	      services matching the
900Sstevel@tonic-gate      *         attributes.
910Sstevel@tonic-gate      * @exception ServiceLocationException An exception is returned if the
920Sstevel@tonic-gate      *					  operation fails.
930Sstevel@tonic-gate      * @see ServiceURL
940Sstevel@tonic-gate      */
950Sstevel@tonic-gate 
findServices(ServiceType type, Vector scopes, String query)960Sstevel@tonic-gate     public ServiceLocationEnumeration findServices(ServiceType type,
970Sstevel@tonic-gate 						   Vector scopes,
980Sstevel@tonic-gate 						   String query)
990Sstevel@tonic-gate 	throws ServiceLocationException;
1000Sstevel@tonic-gate 
1010Sstevel@tonic-gate     /**
1020Sstevel@tonic-gate      * Return the attributes for the service URL, using the locale
1030Sstevel@tonic-gate      * of the locator.
1040Sstevel@tonic-gate      *
1050Sstevel@tonic-gate      * @param URL	The service URL.
1060Sstevel@tonic-gate      * @param scopes	The SLP scopes of the service.
1070Sstevel@tonic-gate      * @param attributeIds A vector of strings identifying the desired
1080Sstevel@tonic-gate      *			  attributes. A null value means return all
1090Sstevel@tonic-gate      *			  the attributes.  <b>Partial id strings</b> may
1100Sstevel@tonic-gate      *                     begin with '*' to match all ids which end with
1110Sstevel@tonic-gate      *                     the given suffix, or end with '*' to match all
1120Sstevel@tonic-gate      *                     ids which begin with a given prefix, or begin
1130Sstevel@tonic-gate      *                     and end with '*' to do substring matching for
1140Sstevel@tonic-gate      *                     ids containing the given partial id.
1150Sstevel@tonic-gate      * @return ServiceLocationEnumeration of ServiceLocationAttribute
1160Sstevel@tonic-gate      *         objects matching the ids.
1170Sstevel@tonic-gate      * @exception ServiceLocationException An exception is returned if the
1180Sstevel@tonic-gate      *					  operation fails.
1190Sstevel@tonic-gate      * @exception IllegalArgumentException If any of the parameters are
1200Sstevel@tonic-gate      *					  null or syntactically incorrect.
1210Sstevel@tonic-gate      * @see ServiceLocationAttribute
1220Sstevel@tonic-gate      *
1230Sstevel@tonic-gate      */
1240Sstevel@tonic-gate 
findAttributes(ServiceURL URL, Vector scopes, Vector attributeIds)1250Sstevel@tonic-gate     public ServiceLocationEnumeration findAttributes(ServiceURL URL,
1260Sstevel@tonic-gate 						     Vector scopes,
1270Sstevel@tonic-gate 						     Vector attributeIds)
1280Sstevel@tonic-gate 	throws ServiceLocationException;
1290Sstevel@tonic-gate 
1300Sstevel@tonic-gate     /**
1310Sstevel@tonic-gate      * Return all attributes for all service URL's having this
1320Sstevel@tonic-gate      * service type in the locale of the Locator.
1330Sstevel@tonic-gate      *
1340Sstevel@tonic-gate      * @param type The service type.
1350Sstevel@tonic-gate      * @param scopes	The SLP scopes of the service type.
1360Sstevel@tonic-gate      * @param attributeIds A vector of strings identifying the desired
1370Sstevel@tonic-gate      *			  attributes. A null value means return all
1380Sstevel@tonic-gate      *			  the attributes.  <b>Partial id strings</b> may
1390Sstevel@tonic-gate      *                     begin with '*' to match all ids which end with
1400Sstevel@tonic-gate      *                     the given suffix, or end with '*' to match all
1410Sstevel@tonic-gate      *                     ids which begin with a given prefix, or begin
1420Sstevel@tonic-gate      *                     and end with '*' to do substring matching for
1430Sstevel@tonic-gate      *                     ids containing the given partial id.
1440Sstevel@tonic-gate      * @return ServiceLocationEnumeration of ServiceLocationAttribute
1450Sstevel@tonic-gate      *         objects matching the ids.
1460Sstevel@tonic-gate      * @exception ServiceLocationException An exception is returned if the
1470Sstevel@tonic-gate      *					  operation fails.
1480Sstevel@tonic-gate      * @exception IllegalArgumentException If any of the parameters are
1490Sstevel@tonic-gate      *					  null or syntactically incorrect.
1500Sstevel@tonic-gate      * @see ServiceLocationAttribute
1510Sstevel@tonic-gate      *
1520Sstevel@tonic-gate      */
1530Sstevel@tonic-gate 
findAttributes(ServiceType type, Vector scopes, Vector attributeIds)1540Sstevel@tonic-gate     public ServiceLocationEnumeration findAttributes(ServiceType type,
1550Sstevel@tonic-gate 						     Vector scopes,
1560Sstevel@tonic-gate 						     Vector attributeIds)
1570Sstevel@tonic-gate 	throws ServiceLocationException;
1580Sstevel@tonic-gate 
1590Sstevel@tonic-gate 
1600Sstevel@tonic-gate }
161