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: %W% %G% 31 // ServiceAgent.java: Interface for the SLP Service Agent operations 32 // Author: James Kempf 33 // Created On: Mon Jul 7 09:05:40 1997 34 // Last Modified By: James Kempf 35 // Last Modified On: Thu Jan 7 14:17:12 1999 36 // Update Count: 16 37 // 38 39 package com.sun.slp; 40 41 import java.util.*; 42 43 /** 44 * The Advertiser interface allows clients to register new service 45 * instances with SLP and to change the attributes of existing services. 46 * 47 * @see ServiceLocationManager 48 * 49 * @version %R%.%L% %D% 50 * @author James Kempf, Erik Guttman 51 */ 52 53 public interface Advertiser { 54 55 /** 56 * Return the Advertiser's locale object. 57 * 58 * @return The Locale object. 59 */ 60 61 Locale getLocale(); 62 63 /** 64 * Register a new service with the service location protocol in 65 * the Advertiser's locale. 66 * 67 * @param URL The service URL for the service. 68 * @param serviceLocationAttributes A vector of ServiceLocationAttribute 69 * objects describing the service. 70 * @exception ServiceLocationException An exception is thrown if the 71 * registration fails. 72 * @exception IllegalArgumentException A parameter is null or 73 * otherwise invalid. 74 * 75 */ 76 77 public void register(ServiceURL URL, 78 Vector serviceLocationAttributes) 79 throws ServiceLocationException; 80 81 /** 82 * Deregister a service with the service location protocol. 83 * This has the effect of deregistering the service from <b>every</b> 84 * Locale and scope under which it was registered. 85 * 86 * @param URL The service URL for the service. 87 * @exception ServiceLocationException An exception is thrown if the 88 * deregistration fails. 89 */ 90 91 public void deregister(ServiceURL URL) 92 throws ServiceLocationException; 93 94 /** 95 * Add attributes to a service URL in the locale of the Advertiser. 96 * 97 * Note that due to SLP v1 update semantics, the URL will be registered 98 * if it is not already. 99 * 100 * 101 * @param URL The service URL for the service. 102 * @param serviceLocationAttributes A vector of ServiceLocationAttribute 103 * objects to add. 104 * @exception ServiceLocationException An exception is thrown if the 105 * operation fails. 106 */ 107 108 public void addAttributes(ServiceURL URL, 109 Vector serviceLocationAttributes) 110 throws ServiceLocationException; 111 112 /** 113 * Delete the attributes from a service URL in the locale of 114 * the Advertiser. The deletions are made for all scopes in 115 * which the URL is registered. 116 * 117 * 118 * @param URL The service URL for the service. 119 * @param attributeIds A vector of Strings indicating 120 * the attributes to remove. 121 * @exception ServiceLocationException An exception is thrown if the 122 * operation fails. 123 */ 124 125 public void deleteAttributes(ServiceURL URL, 126 Vector attributeIds) 127 throws ServiceLocationException; 128 } 129