usr/src/lib/libslp/javalib/com/sun/slp/Locator.java
author Mark J. Nelson <Mark.J.Nelson@Sun.COM>
Wed, 06 Aug 2008 16:29:39 -0600
changeset 7298 b69e27387f74
parent 0 68f95e015346
permissions -rw-r--r--
6733918 Teamware has retired, please welcome your new manager, Mercurial 4758439 some files use "current date" sccs keywords 6560843 asm sources should not rely on .file "%M%" for naming STT_FILE symbols 6560958 Solaris:: perl modules should not use SCCS keywords in version information 6729074 webrev doesn't deal well with remote ssh hg parents
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     1
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     2
 * CDDL HEADER START
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     3
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
7298
b69e27387f74 6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 0
diff changeset
     5
 * Common Development and Distribution License (the "License").
b69e27387f74 6733918 Teamware has retired, please welcome your new manager, Mercurial
Mark J. Nelson <Mark.J.Nelson@Sun.COM>
parents: 0
diff changeset
     6
 * You may not use this file except in compliance with the License.
0
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     7
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    11
 * and limitations under the License.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    12
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    18
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    19
 * CDDL HEADER END
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    20
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    21
/*
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    22
 * Copyright (c) 1999 by Sun Microsystems, Inc.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    23
 * All rights reserved.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    24
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    25
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    26
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    27
//  UserAgent.java:   Interface for the SLP User Agent operations
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    28
//  Author:           James Kempf
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    29
//  Created On:       Mon Jul  7 09:15:56 1997
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    30
//  Last Modified By: James Kempf
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    31
//  Last Modified On: Wed May 13 17:46:29 1998
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    32
//  Update Count:     17
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    33
//
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    34
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    35
package com.sun.slp;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    36
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    37
import java.util.*;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    38
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    39
/**
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    40
 * The Locator interface allows clients to query SLP for existing
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    41
 * services, scopes, and service instances, and to query about attributes
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    42
 * of a particular service instance.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    43
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    44
 * @see ServiceLocationManager
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    45
 *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    46
 * @author James Kempf, Erik Guttman
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    47
 */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    48
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    49
public interface Locator {
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    50
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    51
    /**
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    52
     * Return the Locator's locale object. 
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    53
     *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    54
     * @return The Locale object.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    55
     */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    56
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    57
    Locale getLocale();
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    58
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    59
    /**
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    60
     * Return an enumeration of known service types for this scope and naming
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    61
     * authority.  Unless a proprietary or experimental service is being
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    62
     * discovered, the namingAuthority parameter should be the empty
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    63
     * string, "".
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    64
     *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    65
     * @param namingAuthority	The naming authority, "" for default,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    66
     *                           '*' for any naming authority.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    67
     * @param scopes	The SLP scopes of the types.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    68
     * @return ServiceLocationEnumeration of ServiceType objects for 
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    69
     *	      the service type names.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    70
     * @exception IllegalArgumentException If any of the parameters are
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    71
     *					  null or syntactically incorrect.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    72
     * @exception ServiceLocationException An exception is thrown if the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    73
     *					  operation fails.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    74
     */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    75
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    76
    public ServiceLocationEnumeration findServiceTypes(String namingAuthority,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    77
						       Vector scopes)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    78
	throws ServiceLocationException;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    79
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    80
    /**
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    81
     * Return an enumeration of ServiceURL objects for services matching
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    82
     * the query. The services are returned from the locale of the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    83
     * locator.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    84
     *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    85
     * @param type	The type of the service (e.g. printer, etc.).
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    86
     * @param scopes	The SLP scopes of the service types.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    87
     * @param query		A string with the SLP query.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    88
     * @return ServiceLocationEnumeration of ServiceURL objects for 
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    89
     *	      services matching the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    90
     *         attributes. 
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    91
     * @exception ServiceLocationException An exception is returned if the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    92
     *					  operation fails.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    93
     * @see ServiceURL
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    94
     */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    95
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    96
    public ServiceLocationEnumeration findServices(ServiceType type,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    97
						   Vector scopes,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    98
						   String query)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
    99
	throws ServiceLocationException;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   100
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   101
    /**
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   102
     * Return the attributes for the service URL, using the locale
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   103
     * of the locator.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   104
     *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   105
     * @param URL	The service URL.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   106
     * @param scopes	The SLP scopes of the service.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   107
     * @param attributeIds A vector of strings identifying the desired
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   108
     *			  attributes. A null value means return all
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   109
     *			  the attributes.  <b>Partial id strings</b> may
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   110
     *                     begin with '*' to match all ids which end with
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   111
     *                     the given suffix, or end with '*' to match all
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   112
     *                     ids which begin with a given prefix, or begin
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   113
     *                     and end with '*' to do substring matching for
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   114
     *                     ids containing the given partial id.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   115
     * @return ServiceLocationEnumeration of ServiceLocationAttribute 
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   116
     *         objects matching the ids.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   117
     * @exception ServiceLocationException An exception is returned if the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   118
     *					  operation fails.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   119
     * @exception IllegalArgumentException If any of the parameters are
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   120
     *					  null or syntactically incorrect.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   121
     * @see ServiceLocationAttribute
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   122
     *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   123
     */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   124
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   125
    public ServiceLocationEnumeration findAttributes(ServiceURL URL,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   126
						     Vector scopes,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   127
						     Vector attributeIds)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   128
	throws ServiceLocationException;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   129
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   130
    /**
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   131
     * Return all attributes for all service URL's having this
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   132
     * service type in the locale of the Locator. 
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   133
     *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   134
     * @param type The service type.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   135
     * @param scopes	The SLP scopes of the service type.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   136
     * @param attributeIds A vector of strings identifying the desired
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   137
     *			  attributes. A null value means return all
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   138
     *			  the attributes.  <b>Partial id strings</b> may
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   139
     *                     begin with '*' to match all ids which end with
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   140
     *                     the given suffix, or end with '*' to match all
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   141
     *                     ids which begin with a given prefix, or begin
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   142
     *                     and end with '*' to do substring matching for
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   143
     *                     ids containing the given partial id.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   144
     * @return ServiceLocationEnumeration of ServiceLocationAttribute 
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   145
     *         objects matching the ids.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   146
     * @exception ServiceLocationException An exception is returned if the
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   147
     *					  operation fails.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   148
     * @exception IllegalArgumentException If any of the parameters are
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   149
     *					  null or syntactically incorrect.
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   150
     * @see ServiceLocationAttribute
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   151
     *
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   152
     */
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   153
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   154
    public ServiceLocationEnumeration findAttributes(ServiceType type,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   155
						     Vector scopes,
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   156
						     Vector attributeIds)
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   157
	throws ServiceLocationException;
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   158
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   159
68f95e015346 OpenSolaris Launch
stevel@tonic-gate
parents:
diff changeset
   160
}