Checkstyle and pmd fixes for new MatchAction service
Change-Id: I13efd4c7a29e19b782c126132d151ac377db3a4c
diff --git a/src/main/java/net/onrc/onos/core/matchaction/SwitchResult.java b/src/main/java/net/onrc/onos/core/matchaction/SwitchResult.java
index b5db2e8..7f9e18a 100644
--- a/src/main/java/net/onrc/onos/core/matchaction/SwitchResult.java
+++ b/src/main/java/net/onrc/onos/core/matchaction/SwitchResult.java
@@ -2,17 +2,34 @@
import net.onrc.onos.core.util.Dpid;
+/**
+ * The result of applying a MatchAction operation to a switch.
+ */
public class SwitchResult {
private Dpid sw;
private Status status;
private MatchActionOperationsId matchSetId;
+ /**
+ * Status of the switch operation.
+ */
public enum Status {
+ /** Installation of the MatchAction was successful. */
SUCCESS,
+
+ /** Installation of the MatchAction failed. */
FAILURE,
+
+ /** No status has been assigned. */
UNKNOWN
}
+ /**
+ * Creates a new SwitchResult object.
+ *
+ * @param match identifier for MatchActionsOperations that was requested
+ * @param sw Dpid of the switch that the operations were applied to
+ */
protected SwitchResult(MatchActionOperationsId match, Dpid sw) {
this.sw = sw;
this.status = Status.UNKNOWN;
@@ -23,21 +40,41 @@
* no-arg constructor for Kryo.
*/
protected SwitchResult() {
-
+ // Needed for Kryo
}
+ /**
+ * Sets the status of the SwitchResult.
+ *
+ * @param newStatus new status
+ */
protected void setStatus(Status newStatus) {
this.status = newStatus;
}
+ /**
+ * Gets the status of the SwitchResult.
+ *
+ * @return status
+ */
protected Status getStatus() {
return this.status;
}
+ /**
+ * Gets the identifier for the set of operations that was requested.
+ *
+ * @return MatchActionOperationsId of the requested set of operations
+ */
protected MatchActionOperationsId getMatchActionOperationsId() {
return this.matchSetId;
}
+ /**
+ * Gets the identifier for the switch that was requested.
+ *
+ * @return Dpid of the requested switch
+ */
protected Dpid getSwitch() {
return this.sw;
}