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: @(#)Locator.java 2.2 10/07/97 31 // UserAgent.java: Interface for the SLP User Agent operations 32 // Author: James Kempf 33 // Created On: Mon Jul 7 09:15:56 1997 34 // Last Modified By: James Kempf 35 // Last Modified On: Wed May 13 17:46:29 1998 36 // Update Count: 17 37 // 38 39 package com.sun.slp; 40 41 import java.util.*; 42 43 /** 44 * The Locator interface allows clients to query SLP for existing 45 * services, scopes, and service instances, and to query about attributes 46 * of a particular service instance. 47 * 48 * @see ServiceLocationManager 49 * 50 * @version %R%.%L% %D% 51 * @author James Kempf, Erik Guttman 52 */ 53 54 public interface Locator { 55 56 /** 57 * Return the Locator's locale object. 58 * 59 * @return The Locale object. 60 */ 61 62 Locale getLocale(); 63 64 /** 65 * Return an enumeration of known service types for this scope and naming 66 * authority. Unless a proprietary or experimental service is being 67 * discovered, the namingAuthority parameter should be the empty 68 * string, "". 69 * 70 * @param namingAuthority The naming authority, "" for default, 71 * '*' for any naming authority. 72 * @param scopes The SLP scopes of the types. 73 * @return ServiceLocationEnumeration of ServiceType objects for 74 * the service type names. 75 * @exception IllegalArgumentException If any of the parameters are 76 * null or syntactically incorrect. 77 * @exception ServiceLocationException An exception is thrown if the 78 * operation fails. 79 */ 80 81 public ServiceLocationEnumeration findServiceTypes(String namingAuthority, 82 Vector scopes) 83 throws ServiceLocationException; 84 85 /** 86 * Return an enumeration of ServiceURL objects for services matching 87 * the query. The services are returned from the locale of the 88 * locator. 89 * 90 * @param type The type of the service (e.g. printer, etc.). 91 * @param scopes The SLP scopes of the service types. 92 * @param query A string with the SLP query. 93 * @return ServiceLocationEnumeration of ServiceURL objects for 94 * services matching the 95 * attributes. 96 * @exception ServiceLocationException An exception is returned if the 97 * operation fails. 98 * @see ServiceURL 99 */ 100 101 public ServiceLocationEnumeration findServices(ServiceType type, 102 Vector scopes, 103 String query) 104 throws ServiceLocationException; 105 106 /** 107 * Return the attributes for the service URL, using the locale 108 * of the locator. 109 * 110 * @param URL The service URL. 111 * @param scopes The SLP scopes of the service. 112 * @param attributeIds A vector of strings identifying the desired 113 * attributes. A null value means return all 114 * the attributes. <b>Partial id strings</b> may 115 * begin with '*' to match all ids which end with 116 * the given suffix, or end with '*' to match all 117 * ids which begin with a given prefix, or begin 118 * and end with '*' to do substring matching for 119 * ids containing the given partial id. 120 * @return ServiceLocationEnumeration of ServiceLocationAttribute 121 * objects matching the ids. 122 * @exception ServiceLocationException An exception is returned if the 123 * operation fails. 124 * @exception IllegalArgumentException If any of the parameters are 125 * null or syntactically incorrect. 126 * @see ServiceLocationAttribute 127 * 128 */ 129 130 public ServiceLocationEnumeration findAttributes(ServiceURL URL, 131 Vector scopes, 132 Vector attributeIds) 133 throws ServiceLocationException; 134 135 /** 136 * Return all attributes for all service URL's having this 137 * service type in the locale of the Locator. 138 * 139 * @param type The service type. 140 * @param scopes The SLP scopes of the service type. 141 * @param attributeIds A vector of strings identifying the desired 142 * attributes. A null value means return all 143 * the attributes. <b>Partial id strings</b> may 144 * begin with '*' to match all ids which end with 145 * the given suffix, or end with '*' to match all 146 * ids which begin with a given prefix, or begin 147 * and end with '*' to do substring matching for 148 * ids containing the given partial id. 149 * @return ServiceLocationEnumeration of ServiceLocationAttribute 150 * objects matching the ids. 151 * @exception ServiceLocationException An exception is returned if the 152 * operation fails. 153 * @exception IllegalArgumentException If any of the parameters are 154 * null or syntactically incorrect. 155 * @see ServiceLocationAttribute 156 * 157 */ 158 159 public ServiceLocationEnumeration findAttributes(ServiceType type, 160 Vector scopes, 161 Vector attributeIds) 162 throws ServiceLocationException; 163 164 165 } 166