| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| DiscoveryEvent |
|
| 0.0;0 |
| 1 | /* | |
| 2 | Copyright (C) 2007 Grid Systems, S.A. | |
| 3 | ||
| 4 | This library is free software; you can redistribute it and/or | |
| 5 | modify it under the terms of the GNU Lesser General Public | |
| 6 | License as published by the Free Software Foundation; either | |
| 7 | version 2.1 of the License, or (at your option) any later version. | |
| 8 | ||
| 9 | This library is distributed in the hope that it will be useful, | |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 12 | Lesser General Public License for more details. | |
| 13 | ||
| 14 | You should have received a copy of the GNU Lesser General Public | |
| 15 | License along with this library; if not, write to the Free Software | |
| 16 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
| 17 | */ | |
| 18 | package nextgrid.api.pem; | |
| 19 | ||
| 20 | import java.util.List; | |
| 21 | ||
| 22 | import nextgrid.api.env.DiscoveryException; | |
| 23 | import nextgrid.api.env.ProcessDiscoverer; | |
| 24 | import nextgrid.api.pom.Process; | |
| 25 | ||
| 26 | /** | |
| 27 | * Encapsulates information about a discovery-related event. | |
| 28 | * | |
| 29 | * @author Rodrigo Ruiz | |
| 30 | */ | |
| 31 | public final class DiscoveryEvent extends POMEvent { | |
| 32 | ||
| 33 | /** | |
| 34 | * The discoverer instance. | |
| 35 | */ | |
| 36 | private final ProcessDiscoverer discoverer; | |
| 37 | ||
| 38 | /** | |
| 39 | * The list of discovered candidates. | |
| 40 | */ | |
| 41 | private final List<Process> candidates; | |
| 42 | ||
| 43 | /** | |
| 44 | * The cause of the discovery failure. | |
| 45 | */ | |
| 46 | private final DiscoveryException exception; | |
| 47 | ||
| 48 | /** | |
| 49 | * Creates an instance. | |
| 50 | * | |
| 51 | * @param discoverer The discoverer instance | |
| 52 | */ | |
| 53 | public DiscoveryEvent(ProcessDiscoverer discoverer) { | |
| 54 | 0 | this(discoverer, null, null, null); |
| 55 | 0 | } |
| 56 | ||
| 57 | /** | |
| 58 | * Creates an instance. | |
| 59 | * | |
| 60 | * @param discoverer The discoverer instance | |
| 61 | * @param process The process being discovered, if apply | |
| 62 | */ | |
| 63 | public DiscoveryEvent(ProcessDiscoverer discoverer, | |
| 64 | Process process) { | |
| 65 | 0 | this(discoverer, process, null, null); |
| 66 | 0 | } |
| 67 | ||
| 68 | /** | |
| 69 | * Creates an instance. | |
| 70 | * | |
| 71 | * @param discoverer The discoverer instance | |
| 72 | * @param process The process being discovered, if apply | |
| 73 | * @param candidates The list of candidates, if apply | |
| 74 | */ | |
| 75 | public DiscoveryEvent(ProcessDiscoverer discoverer, | |
| 76 | Process process, List<Process> candidates) { | |
| 77 | 0 | this(discoverer, process, candidates, null); |
| 78 | 0 | } |
| 79 | ||
| 80 | /** | |
| 81 | * Creates an instance. | |
| 82 | * | |
| 83 | * @param discoverer The discoverer instance | |
| 84 | * @param process The process being discovered, if apply | |
| 85 | * @param candidates The list of candidates, if apply | |
| 86 | * @param exception The exception thrown, if apply | |
| 87 | */ | |
| 88 | public DiscoveryEvent(ProcessDiscoverer discoverer, Process process, | |
| 89 | List<Process> candidates, DiscoveryException exception) { | |
| 90 | 0 | super(process); |
| 91 | 0 | this.discoverer = discoverer; |
| 92 | 0 | this.candidates = candidates; |
| 93 | 0 | this.exception = exception; |
| 94 | 0 | } |
| 95 | ||
| 96 | /** | |
| 97 | * Gets the value of candidates. | |
| 98 | * | |
| 99 | * @return the candidates | |
| 100 | */ | |
| 101 | public List<Process> getCandidates() { | |
| 102 | 0 | return this.candidates; |
| 103 | } | |
| 104 | ||
| 105 | /** | |
| 106 | * Gets the value of discoverer. | |
| 107 | * | |
| 108 | * @return the discoverer | |
| 109 | */ | |
| 110 | public ProcessDiscoverer getDiscoverer() { | |
| 111 | 0 | return this.discoverer; |
| 112 | } | |
| 113 | ||
| 114 | /** | |
| 115 | * Gets the value of exception. | |
| 116 | * | |
| 117 | * @return the exception | |
| 118 | */ | |
| 119 | public DiscoveryException getException() { | |
| 120 | 0 | return this.exception; |
| 121 | } | |
| 122 | } |