diff --git a/src/main/java/net/floodlightcontroller/core/IOFSwitch.java b/src/main/java/net/floodlightcontroller/core/IOFSwitch.java index 6bc92c98fae1e9866c99606d352f6115d1b0c618..0d823d839a59ac5d705349bddc9fe67b9e71e538 100644 --- a/src/main/java/net/floodlightcontroller/core/IOFSwitch.java +++ b/src/main/java/net/floodlightcontroller/core/IOFSwitch.java @@ -20,7 +20,6 @@ package net.floodlightcontroller.core; import java.io.IOException; import java.net.SocketAddress; import java.util.Collection; -import java.util.Date; import java.util.List; import java.util.Map; import java.util.concurrent.Future; @@ -293,7 +292,7 @@ public interface IOFSwitch { * Retrieves the date the switch connected to this controller * @return the date */ - public Date getConnectedSince(); + public String getConnectedSince(); /** * Returns the next available transaction id diff --git a/src/main/java/net/floodlightcontroller/core/OFSwitchBase.java b/src/main/java/net/floodlightcontroller/core/OFSwitchBase.java index 01fc34d53d3d360d57050c082959563151bc3d4b..8e00a08c82a02f8f2ddf275b20544ecb6fe9685e 100644 --- a/src/main/java/net/floodlightcontroller/core/OFSwitchBase.java +++ b/src/main/java/net/floodlightcontroller/core/OFSwitchBase.java @@ -72,7 +72,7 @@ import org.slf4j.LoggerFactory; public abstract class OFSwitchBase implements IOFSwitch { // TODO: should we really do logging in the class or should we throw // exception that can then be handled by callers? - protected static Logger log = LoggerFactory.getLogger(OFSwitchBase.class); + protected static final Logger log = LoggerFactory.getLogger(OFSwitchBase.class); protected ConcurrentMap<Object, Object> attributes; protected IFloodlightProviderService floodlightProvider; @@ -144,8 +144,8 @@ public abstract class OFSwitchBase implements IOFSwitch { // Defaults properties for an ideal switch this.setAttribute(PROP_FASTWILDCARDS, OFMatch.OFPFW_ALL); - this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, new Boolean(true)); - this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, new Boolean(true)); + this.setAttribute(PROP_SUPPORTS_OFPP_FLOOD, Boolean.valueOf(true)); + this.setAttribute(PROP_SUPPORTS_OFPP_TABLE, Boolean.valueOf(true)); } @@ -440,8 +440,8 @@ public abstract class OFSwitchBase implements IOFSwitch { } @Override - public Date getConnectedSince() { - return connectedSince; + public String getConnectedSince() { + return connectedSince.toString(); } @JsonIgnore diff --git a/src/test/java/net/floodlightcontroller/util/OFMessageDamperMockSwitch.java b/src/test/java/net/floodlightcontroller/util/OFMessageDamperMockSwitch.java index 29191365cddad3344d7390f4d363cfcd0eaf8820..c4f8b83dbdeaac97ead70ea85fd31fcaada827ab 100644 --- a/src/test/java/net/floodlightcontroller/util/OFMessageDamperMockSwitch.java +++ b/src/test/java/net/floodlightcontroller/util/OFMessageDamperMockSwitch.java @@ -21,7 +21,6 @@ import java.io.IOException; import java.net.SocketAddress; import java.util.Collection; -import java.util.Date; import java.util.List; import java.util.Map; import java.util.concurrent.Future; @@ -228,7 +227,7 @@ public class OFMessageDamperMockSwitch implements IOFSwitch { } @Override - public Date getConnectedSince() { + public String getConnectedSince() { assertTrue("Unexpected method call", false); return null; }