1 /* 2 ServiceLocationEnumeration.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 * 1949918 2008-04-08 raman_arora Malformed service URL crashes SLP discovery 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.Enumeration; 49 import java.util.NoSuchElementException; 50 51 /** 52 * The ServiceLocationEnumeration class is the return type for all Locator SLP 53 * operations. The Java API library may implement this class to block until 54 * results are available from the SLP operation, so that the client can achieve 55 * asynchronous operation by retrieving results from the enumeration in a 56 * separate thread. Clients use the superclass nextElement() method if they are 57 * unconcerned with SLP exceptions (this method will never ever throw one). 58 */ 59 public interface ServiceLocationEnumeration extends Enumeration<Object> { 60 /** 61 * Return the next value or block until it becomes available. 62 * 63 * @return The next value 64 * @throws ServiceLocationException 65 * Thrown if the SLP operation encounters an error. 66 * @throws NoSuchElementException 67 * If there are no more elements to return. 68 */ 69 public abstract Object next() throws ServiceLocationException, NoSuchElementException; 70 71 /** 72 * @return next Object in Exception table 73 * @throws NoSuchElementException 74 * 75 * This in internal implementation to get list of all exceptions 76 * thrown/caught by parser This can throw RuntimeExceptions. 77 * They can be ignored or used for analysis. 78 * 79 * use hasNextException to check whether there exists another 80 * element in Exception table 81 */ 82 public abstract Object nextException() throws NoSuchElementException; 83 84 /** 85 * @return true if there exists another element in Exception table 86 * 87 */ 88 public abstract boolean hasMoreExceptions(); 89 }