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 (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 /* 22 * Copyright (c) 1999 by Sun Microsystems, Inc. 23 * All rights reserved. 24 * 25 */ 26 27 // ServiceAgent.java: Interface for the SLP Service Agent operations 28 // Author: James Kempf 29 // Created On: Mon Jul 7 09:05:40 1997 30 // Last Modified By: James Kempf 31 // Last Modified On: Thu Jan 7 14:17:12 1999 32 // Update Count: 16 33 // 34 35 package com.sun.slp; 36 37 import java.util.*; 38 39 /** 40 * The Advertiser interface allows clients to register new service 41 * instances with SLP and to change the attributes of existing services. 42 * 43 * @see ServiceLocationManager 44 * 45 * @author James Kempf, Erik Guttman 46 */ 47 48 public interface Advertiser { 49 50 /** 51 * Return the Advertiser's locale object. 52 * 53 * @return The Locale object. 54 */ 55 getLocale()56 Locale getLocale(); 57 58 /** 59 * Register a new service with the service location protocol in 60 * the Advertiser's locale. 61 * 62 * @param URL The service URL for the service. 63 * @param serviceLocationAttributes A vector of ServiceLocationAttribute 64 * objects describing the service. 65 * @exception ServiceLocationException An exception is thrown if the 66 * registration fails. 67 * @exception IllegalArgumentException A parameter is null or 68 * otherwise invalid. 69 * 70 */ 71 register(ServiceURL URL, Vector serviceLocationAttributes)72 public void register(ServiceURL URL, 73 Vector serviceLocationAttributes) 74 throws ServiceLocationException; 75 76 /** 77 * Deregister a service with the service location protocol. 78 * This has the effect of deregistering the service from <b>every</b> 79 * Locale and scope under which it was registered. 80 * 81 * @param URL The service URL for the service. 82 * @exception ServiceLocationException An exception is thrown if the 83 * deregistration fails. 84 */ 85 deregister(ServiceURL URL)86 public void deregister(ServiceURL URL) 87 throws ServiceLocationException; 88 89 /** 90 * Add attributes to a service URL in the locale of the Advertiser. 91 * 92 * Note that due to SLP v1 update semantics, the URL will be registered 93 * if it is not already. 94 * 95 * 96 * @param URL The service URL for the service. 97 * @param serviceLocationAttributes A vector of ServiceLocationAttribute 98 * objects to add. 99 * @exception ServiceLocationException An exception is thrown if the 100 * operation fails. 101 */ 102 addAttributes(ServiceURL URL, Vector serviceLocationAttributes)103 public void addAttributes(ServiceURL URL, 104 Vector serviceLocationAttributes) 105 throws ServiceLocationException; 106 107 /** 108 * Delete the attributes from a service URL in the locale of 109 * the Advertiser. The deletions are made for all scopes in 110 * which the URL is registered. 111 * 112 * 113 * @param URL The service URL for the service. 114 * @param attributeIds A vector of Strings indicating 115 * the attributes to remove. 116 * @exception ServiceLocationException An exception is thrown if the 117 * operation fails. 118 */ 119 deleteAttributes(ServiceURL URL, Vector attributeIds)120 public void deleteAttributes(ServiceURL URL, 121 Vector attributeIds) 122 throws ServiceLocationException; 123 } 124