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 // ServiceAgent.java: Interface for the SLP Service Agent operations 280Sstevel@tonic-gate // Author: James Kempf 290Sstevel@tonic-gate // Created On: Mon Jul 7 09:05:40 1997 300Sstevel@tonic-gate // Last Modified By: James Kempf 310Sstevel@tonic-gate // Last Modified On: Thu Jan 7 14:17:12 1999 320Sstevel@tonic-gate // Update Count: 16 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 Advertiser interface allows clients to register new service 410Sstevel@tonic-gate * instances with SLP and to change the attributes of existing services. 420Sstevel@tonic-gate * 430Sstevel@tonic-gate * @see ServiceLocationManager 440Sstevel@tonic-gate * 450Sstevel@tonic-gate * @author James Kempf, Erik Guttman 460Sstevel@tonic-gate */ 470Sstevel@tonic-gate 480Sstevel@tonic-gate public interface Advertiser { 490Sstevel@tonic-gate 500Sstevel@tonic-gate /** 510Sstevel@tonic-gate * Return the Advertiser's locale object. 520Sstevel@tonic-gate * 530Sstevel@tonic-gate * @return The Locale object. 540Sstevel@tonic-gate */ 550Sstevel@tonic-gate getLocale()560Sstevel@tonic-gate Locale getLocale(); 570Sstevel@tonic-gate 580Sstevel@tonic-gate /** 590Sstevel@tonic-gate * Register a new service with the service location protocol in 600Sstevel@tonic-gate * the Advertiser's locale. 610Sstevel@tonic-gate * 620Sstevel@tonic-gate * @param URL The service URL for the service. 630Sstevel@tonic-gate * @param serviceLocationAttributes A vector of ServiceLocationAttribute 640Sstevel@tonic-gate * objects describing the service. 650Sstevel@tonic-gate * @exception ServiceLocationException An exception is thrown if the 660Sstevel@tonic-gate * registration fails. 670Sstevel@tonic-gate * @exception IllegalArgumentException A parameter is null or 680Sstevel@tonic-gate * otherwise invalid. 690Sstevel@tonic-gate * 700Sstevel@tonic-gate */ 710Sstevel@tonic-gate register(ServiceURL URL, Vector serviceLocationAttributes)720Sstevel@tonic-gate public void register(ServiceURL URL, 730Sstevel@tonic-gate Vector serviceLocationAttributes) 740Sstevel@tonic-gate throws ServiceLocationException; 750Sstevel@tonic-gate 760Sstevel@tonic-gate /** 770Sstevel@tonic-gate * Deregister a service with the service location protocol. 780Sstevel@tonic-gate * This has the effect of deregistering the service from <b>every</b> 790Sstevel@tonic-gate * Locale and scope under which it was registered. 800Sstevel@tonic-gate * 810Sstevel@tonic-gate * @param URL The service URL for the service. 820Sstevel@tonic-gate * @exception ServiceLocationException An exception is thrown if the 830Sstevel@tonic-gate * deregistration fails. 840Sstevel@tonic-gate */ 850Sstevel@tonic-gate deregister(ServiceURL URL)860Sstevel@tonic-gate public void deregister(ServiceURL URL) 870Sstevel@tonic-gate throws ServiceLocationException; 880Sstevel@tonic-gate 890Sstevel@tonic-gate /** 900Sstevel@tonic-gate * Add attributes to a service URL in the locale of the Advertiser. 910Sstevel@tonic-gate * 920Sstevel@tonic-gate * Note that due to SLP v1 update semantics, the URL will be registered 930Sstevel@tonic-gate * if it is not already. 940Sstevel@tonic-gate * 950Sstevel@tonic-gate * 960Sstevel@tonic-gate * @param URL The service URL for the service. 970Sstevel@tonic-gate * @param serviceLocationAttributes A vector of ServiceLocationAttribute 980Sstevel@tonic-gate * objects to add. 990Sstevel@tonic-gate * @exception ServiceLocationException An exception is thrown if the 1000Sstevel@tonic-gate * operation fails. 1010Sstevel@tonic-gate */ 1020Sstevel@tonic-gate addAttributes(ServiceURL URL, Vector serviceLocationAttributes)1030Sstevel@tonic-gate public void addAttributes(ServiceURL URL, 1040Sstevel@tonic-gate Vector serviceLocationAttributes) 1050Sstevel@tonic-gate throws ServiceLocationException; 1060Sstevel@tonic-gate 1070Sstevel@tonic-gate /** 1080Sstevel@tonic-gate * Delete the attributes from a service URL in the locale of 1090Sstevel@tonic-gate * the Advertiser. The deletions are made for all scopes in 1100Sstevel@tonic-gate * which the URL is registered. 1110Sstevel@tonic-gate * 1120Sstevel@tonic-gate * 1130Sstevel@tonic-gate * @param URL The service URL for the service. 1140Sstevel@tonic-gate * @param attributeIds A vector of Strings indicating 1150Sstevel@tonic-gate * the attributes to remove. 1160Sstevel@tonic-gate * @exception ServiceLocationException An exception is thrown if the 1170Sstevel@tonic-gate * operation fails. 1180Sstevel@tonic-gate */ 1190Sstevel@tonic-gate deleteAttributes(ServiceURL URL, Vector attributeIds)1200Sstevel@tonic-gate public void deleteAttributes(ServiceURL URL, 1210Sstevel@tonic-gate Vector attributeIds) 1220Sstevel@tonic-gate throws ServiceLocationException; 1230Sstevel@tonic-gate } 124