Showing
1 changed file
with
22 additions
and
12 deletions
... | @@ -5,7 +5,17 @@ import java.util.Objects; | ... | @@ -5,7 +5,17 @@ import java.util.Objects; |
5 | import static com.google.common.base.MoreObjects.toStringHelper; | 5 | import static com.google.common.base.MoreObjects.toStringHelper; |
6 | 6 | ||
7 | /** | 7 | /** |
8 | - * Notion of provider identity. | 8 | + * External identity of a {@link org.onlab.onos.net.provider.Provider} family. |
9 | + * It also carriers two designations of external characteristics, the URI | ||
10 | + * scheme and primary/ancillary indicator. | ||
11 | + * <p/> | ||
12 | + * The device URI scheme is used to determine applicability of a provider to | ||
13 | + * operations on a specific device. The ancillary indicator serves to designate | ||
14 | + * a provider as a primary or ancillary. | ||
15 | + * | ||
16 | + * A {@link org.onlab.onos.net.provider.ProviderRegistry} uses this designation | ||
17 | + * to permit only one primary provider per device URI scheme. Multiple | ||
18 | + * ancillary providers can register with the same device URI scheme however. | ||
9 | */ | 19 | */ |
10 | public class ProviderId { | 20 | public class ProviderId { |
11 | 21 | ||
... | @@ -14,12 +24,12 @@ public class ProviderId { | ... | @@ -14,12 +24,12 @@ public class ProviderId { |
14 | private final boolean ancillary; | 24 | private final boolean ancillary; |
15 | 25 | ||
16 | /** | 26 | /** |
17 | - * Creates a new provider identifier from the specified string. | 27 | + * Creates a new primary provider identifier from the specified string. |
18 | * The providers are expected to follow the reverse DNS convention, e.g. | 28 | * The providers are expected to follow the reverse DNS convention, e.g. |
19 | * {@code org.onlab.onos.provider.of.device} | 29 | * {@code org.onlab.onos.provider.of.device} |
20 | * | 30 | * |
21 | - * @param scheme device URI scheme to which this provider is bound, e.g. "of", "snmp" | 31 | + * @param scheme device URI scheme to which this provider is bound, e.g. "of", "snmp" |
22 | - * @param id string identifier | 32 | + * @param id string identifier |
23 | */ | 33 | */ |
24 | public ProviderId(String scheme, String id) { | 34 | public ProviderId(String scheme, String id) { |
25 | this(scheme, id, false); | 35 | this(scheme, id, false); |
... | @@ -50,21 +60,21 @@ public class ProviderId { | ... | @@ -50,21 +60,21 @@ public class ProviderId { |
50 | } | 60 | } |
51 | 61 | ||
52 | /** | 62 | /** |
53 | - * Indicates whether the provider id belongs to an ancillary provider. | 63 | + * Returns the device URI scheme specific id portion. |
54 | * | 64 | * |
55 | - * @return true for ancillary; false for primary provider | 65 | + * @return id |
56 | */ | 66 | */ |
57 | - public boolean isAncillary() { | 67 | + public String id() { |
58 | - return ancillary; | 68 | + return id; |
59 | } | 69 | } |
60 | 70 | ||
61 | /** | 71 | /** |
62 | - * Returns the device URI scheme specific id portion. | 72 | + * Indicates whether this identifier designates an ancillary providers. |
63 | * | 73 | * |
64 | - * @return id | 74 | + * @return true if the provider is ancillary; false if primary |
65 | */ | 75 | */ |
66 | - public String id() { | 76 | + public boolean isAncillary() { |
67 | - return id; | 77 | + return ancillary; |
68 | } | 78 | } |
69 | 79 | ||
70 | @Override | 80 | @Override | ... | ... |
-
Please register or login to post a comment