View Javadoc
1   /*
2     ServiceType.java
3   
4     (C) Copyright IBM Corp. 2005, 2009
5   
6     THIS FILE IS PROVIDED UNDER THE TERMS OF THE ECLIPSE PUBLIC LICENSE
7     ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE
8     CONSTITUTES RECIPIENTS ACCEPTANCE OF THE AGREEMENT.
9   
10    You can obtain a current copy of the Eclipse Public License from
11    http://www.opensource.org/licenses/eclipse-1.0.php
12  
13    @author : Roberto Pineiro, IBM, roberto.pineiro@us.ibm.com
14   * @author : Chung-hao Tan, IBM, chungtan@us.ibm.com
15   * 
16   * Change History
17   * Flag       Date        Prog         Description
18   *------------------------------------------------------------------------------- 
19   * 1516246    2006-07-22  lupusalex    Integrate SLP client code
20   * 1804402    2007-09-28  ebak         IPv6 ready SLP
21   * 2003590    2008-06-30  blaschke-oss Change licensing from CPL to EPL
22   * 2524131    2009-01-21  raman_arora  Upgrade client to JDK 1.5 (Phase 1)
23   * 2531371    2009-02-10  raman_arora  Upgrade client to JDK 1.5 (Phase 2) 
24   */
25  
26  package org.metricshub.wbem.sblim.slp;
27  
28  /*-
29   * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
30   * WBEM Java Client
31   * ჻჻჻჻჻჻
32   * Copyright 2023 - 2025 MetricsHub
33   * ჻჻჻჻჻჻
34   * Licensed under the Apache License, Version 2.0 (the "License");
35   * you may not use this file except in compliance with the License.
36   * You may obtain a copy of the License at
37   *
38   *      http://www.apache.org/licenses/LICENSE-2.0
39   *
40   * Unless required by applicable law or agreed to in writing, software
41   * distributed under the License is distributed on an "AS IS" BASIS,
42   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
43   * See the License for the specific language governing permissions and
44   * limitations under the License.
45   * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
46   */
47  
48  import java.util.Locale;
49  import java.util.Vector;
50  
51  /**
52   * The Advertiser is the SA interface, allowing clients to register new service
53   * instances with SLP, to change the attributes of existing services, and to
54   * deregister service instances. New registrations and modifications of
55   * attributes are made in the language locale with which the Advertiser was
56   * created, deregistrations of service instances are made for all locales.
57   */
58  public interface Advertiser {
59  	/**
60  	 * Return the language locale with which this object was created.
61  	 *
62  	 * @return The locale
63  	 */
64  	public abstract Locale getLocale();
65  
66  	/**
67  	 * Register a new service with SLP having the given attributes. The API
68  	 * library is required to perform the operation in all scopes obtained
69  	 * through configuration.
70  	 *
71  	 * @param pURL
72  	 *            The URL for the service.
73  	 * @param pAttributes
74  	 *            A vector of ServiceLocationAttribute objects describing the
75  	 *            service.
76  	 * @throws ServiceLocationException
77  	 */
78  	public abstract void register(ServiceURL pURL, Vector<ServiceLocationAttribute> pAttributes)
79  		throws ServiceLocationException;
80  
81  	/**
82  	 * Deregister a service from the SLP framework. This has the effect of
83  	 * deregistering the service from every language locale. The API library is
84  	 * required to perform the operation in all scopes obtained through
85  	 * configuration.
86  	 *
87  	 * @param pURL
88  	 *            The URL for the service.
89  	 * @throws ServiceLocationException
90  	 */
91  	public abstract void deregister(ServiceURL pURL) throws ServiceLocationException;
92  
93  	/**
94  	 * Update the registration by adding the given attributes. The API library
95  	 * is required to perform the operation in all scopes obtained through
96  	 * configuration.
97  	 *
98  	 * @param pURL
99  	 *            The URL for the service.
100 	 * @param pAttributes
101 	 *            A Vector of ServiceLocationAttribute objects to add to the
102 	 *            existing registration. Use an empty vector to update the URL
103 	 *            alone. May not be null.
104 	 * @throws ServiceLocationException
105 	 */
106 	public abstract void addAttributes(ServiceURL pURL, Vector<ServiceLocationAttribute> pAttributes)
107 		throws ServiceLocationException;
108 
109 	/**
110 	 * Delete the attributes from a URL for the locale with which the Advertiser
111 	 * was created. The API library is required to perform the operation in all
112 	 * scopes obtained through configuration.
113 	 *
114 	 * @param pURL
115 	 *            The URL for the service.
116 	 * @param pAttributeIds
117 	 *            A vector of Strings indicating the ids of the attributes to
118 	 *            remove. The strings may be attribute ids or they may be
119 	 *            wildcard patterns to match ids. See [7] for the syntax of
120 	 *            wildcard patterns. The strings may include SLP reserved
121 	 *            characters, they will be escaped by the API before
122 	 *            transmission. May not be the empty vector or null.
123 	 * @throws ServiceLocationException
124 	 */
125 	public abstract void deleteAttributes(ServiceURL pURL, Vector<String> pAttributeIds) throws ServiceLocationException;
126 }