Skip to content

Commit 593f5fe

Browse files
committed
Seal AugmentationPath
Drop the use of InstanceIdentifier, as the method is not used and seal the interface, making sure it is the marker it was intented to be (I guess). Change-Id: I88f47e3eabf37d14078ba5550b9f0ab71783de36 Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
1 parent e644fd0 commit 593f5fe

4 files changed

Lines changed: 16 additions & 66 deletions

File tree

extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/path/ActionPath.java

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@
77
*/
88
package org.opendaylight.openflowplugin.extension.api.path;
99

10-
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
11-
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
12-
1310
/**
1411
* Enumerates the extension action paths.
1512
*
1613
* @author msunal
1714
*/
1815
public enum ActionPath implements AugmentationPath {
19-
2016
/**
2117
* openflowplugin-extension-general.yang.
2218
* <pre>
@@ -34,7 +30,7 @@ public enum ActionPath implements AugmentationPath {
3430
* | | | | +--rw (action)?
3531
* </pre>
3632
     */
37-
INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS(null),
33+
INVENTORY_FLOWNODE_TABLE_WRITE_ACTIONS,
3834

3935
/**
4036
* openflowplugin-extension-general.yang.
@@ -54,7 +50,7 @@ public enum ActionPath implements AugmentationPath {
5450
*
5551
* </pre>
5652
     */
57-
INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS(null),
53+
INVENTORY_FLOWNODE_TABLE_APPLY_ACTIONS,
5854

5955
/**
6056
* openflowplugin-extension-general.yang.
@@ -72,7 +68,7 @@ public enum ActionPath implements AugmentationPath {
7268
* | | | | +--ro (action)?
7369
* </pre>
7470
*/
75-
FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS(null),
71+
FLOWS_STATISTICS_UPDATE_WRITE_ACTIONS,
7672

7773
/**
7874
* openflowplugin-extension-general.yang.
@@ -90,7 +86,7 @@ public enum ActionPath implements AugmentationPath {
9086
* | | | | +--ro (action)?
9187
* </pre>
9288
*/
93-
FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS(null),
89+
FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS,
9490

9591
/**
9692
* openflowplugin-extension-general.yang.
@@ -105,7 +101,7 @@ public enum ActionPath implements AugmentationPath {
105101
* | | +--ro (action)?
106102
* </pre>
107103
*/
108-
GROUP_DESC_STATS_UPDATED_BUCKET_ACTION(null),
104+
GROUP_DESC_STATS_UPDATED_BUCKET_ACTION,
109105

110106
/**
111107
* openflowplugin-extension-general.yang.
@@ -123,7 +119,7 @@ public enum ActionPath implements AugmentationPath {
123119
* | | | | +--ro (action)?
124120
* </pre>
125121
*/
126-
FLOWS_STATISTICS_RPC_WRITE_ACTIONS(null),
122+
FLOWS_STATISTICS_RPC_WRITE_ACTIONS,
127123

128124
/**
129125
* openflowplugin-extension-general.yang.
@@ -141,16 +137,5 @@ public enum ActionPath implements AugmentationPath {
141137
* | | | | +--ro (action)?
142138
* </pre>
143139
*/
144-
FLOWS_STATISTICS_RPC_APPLY_ACTIONS(null);
145-
146-
private final InstanceIdentifier<Extension> iid;
147-
148-
ActionPath(final InstanceIdentifier<Extension> iid) {
149-
this.iid = iid;
150-
}
151-
152-
@Override
153-
public final InstanceIdentifier<Extension> getInstanceIdentifier() {
154-
return iid;
155-
}
140+
FLOWS_STATISTICS_RPC_APPLY_ACTIONS;
156141
}

extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/path/AugmentationPath.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@
77
*/
88
package org.opendaylight.openflowplugin.extension.api.path;
99

10-
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
11-
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
12-
1310
/**
1411
* Interface for an extension augmentation path.
1512
*
1613
* @author msunal
1714
*/
18-
public interface AugmentationPath {
19-
20-
InstanceIdentifier<Extension> getInstanceIdentifier();
15+
public sealed interface AugmentationPath permits ActionPath, MatchPath, MessagePath {
16+
// nothing else
2117
}

extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/path/MatchPath.java

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,12 @@
77
*/
88
package org.opendaylight.openflowplugin.extension.api.path;
99

10-
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
11-
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
12-
1310
/**
1411
* Enumerates the match paths.
1512
*
1613
* @author msunal
1714
*/
1815
public enum MatchPath implements AugmentationPath {
19-
2016
/**
2117
* openflowplugin-extension-general.yang.
2218
* <pre>
@@ -26,7 +22,7 @@ public enum MatchPath implements AugmentationPath {
2622
* | +--ro match
2723
* </pre>
2824
*/
29-
SWITCH_FLOW_REMOVED_MATCH(null),
25+
SWITCH_FLOW_REMOVED_MATCH,
3026

3127
/**
3228
* openflowplugin-extension-general.yang.
@@ -37,7 +33,7 @@ public enum MatchPath implements AugmentationPath {
3733
* +--ro match
3834
* </pre>
3935
*/
40-
PACKET_RECEIVED_MATCH(null),
36+
PACKET_RECEIVED_MATCH,
4137

4238
/**
4339
* openflowplugin-extension-general.yang.
@@ -48,7 +44,7 @@ public enum MatchPath implements AugmentationPath {
4844
* +--ro match
4945
* </pre>
5046
*/
51-
PACKET_IN_MESSAGE_MATCH(null),
47+
PACKET_IN_MESSAGE_MATCH,
5248

5349
/**
5450
* openflowplugin-extension-general.yang.
@@ -60,7 +56,7 @@ public enum MatchPath implements AugmentationPath {
6056
* | | +--ro match
6157
* </pre>
6258
*/
63-
FLOWS_STATISTICS_UPDATE_MATCH(null),
59+
FLOWS_STATISTICS_UPDATE_MATCH,
6460

6561
/**
6662
* openflowplugin-extension-general.yang.
@@ -72,17 +68,5 @@ public enum MatchPath implements AugmentationPath {
7268
* | | +--ro match
7369
* </pre>
7470
*/
75-
FLOWS_STATISTICS_RPC_MATCH(null);
76-
77-
private final InstanceIdentifier<Extension> iid;
78-
79-
MatchPath(InstanceIdentifier<Extension> iid) {
80-
this.iid = iid;
81-
}
82-
83-
@Override
84-
public final InstanceIdentifier<Extension> getInstanceIdentifier() {
85-
return iid;
86-
}
87-
71+
FLOWS_STATISTICS_RPC_MATCH;
8872
}

extension/openflowplugin-extension-api/src/main/java/org/opendaylight/openflowplugin/extension/api/path/MessagePath.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,10 @@
77
*/
88
package org.opendaylight.openflowplugin.extension.api.path;
99

10-
import org.opendaylight.yang.gen.v1.urn.opendaylight.openflowplugin.extension.general.rev140714.general.extension.grouping.Extension;
11-
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
12-
1310
/**
1411
* List of augmentation points available for experimenter symmetric message and multipart message.
1512
*/
1613
public enum MessagePath implements AugmentationPath {
17-
1814
/**
1915
* <pre>
2016
* module: sal-experimenter-message.
@@ -23,7 +19,7 @@ public enum MessagePath implements AugmentationPath {
2319
* +--ro (experimenter-message-of-choice)?module: sal-flow
2420
* </pre>
2521
*/
26-
MESSAGE_NOTIFICATION(null),
22+
MESSAGE_NOTIFICATION,
2723

2824
/**
2925
* <pre>
@@ -34,16 +30,5 @@ public enum MessagePath implements AugmentationPath {
3430
* +--ro (experimenter-message-of-choice)?notifications:
3531
* </pre>
3632
*/
37-
MPMESSAGE_RPC_OUTPUT(null);
38-
39-
private final InstanceIdentifier<Extension> iid;
40-
41-
MessagePath(InstanceIdentifier<Extension> iid) {
42-
this.iid = iid;
43-
}
44-
45-
@Override
46-
public final InstanceIdentifier<Extension> getInstanceIdentifier() {
47-
return iid;
48-
}
33+
MPMESSAGE_RPC_OUTPUT;
4934
}

0 commit comments

Comments
 (0)