From 55d4a1b251e1b2e36b9036b3d0b033abc38acbec Mon Sep 17 00:00:00 2001 From: Ashlee Young Date: Fri, 13 Nov 2015 17:25:44 -0800 Subject: ONOS commit d9df7bd278935c3d72ac6eeb0ff44efe1edde567 Change-Id: I319f3a3765db55034b894238fb9391eee56c6dd4 Signed-off-by: Ashlee Young --- .../messaging/impl/NettyMessagingManager.java | 18 ++++----- .../store/device/impl/GossipDeviceStore.java | 8 ++-- .../store/device/impl/GossipDeviceStoreTest.java | 4 +- .../store/serializers/KryoNamespaces.java | 2 +- .../store/serializers/URISerializer.java | 46 ---------------------- .../store/serializers/UriSerializer.java | 46 ++++++++++++++++++++++ 6 files changed, 62 insertions(+), 62 deletions(-) delete mode 100644 framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/URISerializer.java create mode 100644 framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/UriSerializer.java (limited to 'framework/src/onos/core/store') diff --git a/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/NettyMessagingManager.java b/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/NettyMessagingManager.java index 23c81869..d61d7dcf 100644 --- a/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/NettyMessagingManager.java +++ b/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/cluster/messaging/impl/NettyMessagingManager.java @@ -47,7 +47,7 @@ public class NettyMessagingManager extends NettyMessaging { @Activate public void activate() throws Exception { ControllerNode localNode = clusterMetadataService.getLocalNode(); - getTLSParameters(); + getTlsParameters(); super.start(new Endpoint(localNode.ip(), localNode.tcpPort())); log.info("Started"); } @@ -58,29 +58,29 @@ public class NettyMessagingManager extends NettyMessaging { log.info("Stopped"); } - private void getTLSParameters() { + private void getTlsParameters() { String tempString = System.getProperty("enableNettyTLS"); - enableNettyTLS = Strings.isNullOrEmpty(tempString) ? TLS_DISABLED : Boolean.parseBoolean(tempString); - log.info("enableNettyTLS = {}", enableNettyTLS); - if (enableNettyTLS) { + enableNettyTls = Strings.isNullOrEmpty(tempString) ? TLS_DISABLED : Boolean.parseBoolean(tempString); + log.info("enableNettyTLS = {}", enableNettyTls); + if (enableNettyTls) { ksLocation = System.getProperty("javax.net.ssl.keyStore"); if (Strings.isNullOrEmpty(ksLocation)) { - enableNettyTLS = TLS_DISABLED; + enableNettyTls = TLS_DISABLED; return; } tsLocation = System.getProperty("javax.net.ssl.trustStore"); if (Strings.isNullOrEmpty(tsLocation)) { - enableNettyTLS = TLS_DISABLED; + enableNettyTls = TLS_DISABLED; return; } ksPwd = System.getProperty("javax.net.ssl.keyStorePassword").toCharArray(); if (MIN_KS_LENGTH > ksPwd.length) { - enableNettyTLS = TLS_DISABLED; + enableNettyTls = TLS_DISABLED; return; } tsPwd = System.getProperty("javax.net.ssl.trustStorePassword").toCharArray(); if (MIN_KS_LENGTH > tsPwd.length) { - enableNettyTLS = TLS_DISABLED; + enableNettyTls = TLS_DISABLED; return; } } diff --git a/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java b/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java index 85e67dec..a9a9098e 100644 --- a/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java +++ b/framework/src/onos/core/store/dist/src/main/java/org/onosproject/store/device/impl/GossipDeviceStore.java @@ -1040,7 +1040,7 @@ public class GossipDeviceStore checkArgument(!providerDescs.isEmpty(), "No device descriptions supplied"); - ProviderId primary = pickPrimaryPID(providerDescs); + ProviderId primary = pickPrimaryPid(providerDescs); DeviceDescriptions desc = providerDescs.get(primary); @@ -1103,7 +1103,7 @@ public class GossipDeviceStore private Port composePort(Device device, PortNumber number, Map descsMap) { - ProviderId primary = pickPrimaryPID(descsMap); + ProviderId primary = pickPrimaryPid(descsMap); DeviceDescriptions primDescs = descsMap.get(primary); // if no primary, assume not enabled boolean isEnabled = false; @@ -1149,7 +1149,7 @@ public class GossipDeviceStore /** * @return primary ProviderID, or randomly chosen one if none exists */ - private ProviderId pickPrimaryPID( + private ProviderId pickPrimaryPid( Map providerDescs) { ProviderId fallBackPrimary = null; for (Entry e : providerDescs.entrySet()) { @@ -1165,7 +1165,7 @@ public class GossipDeviceStore private DeviceDescriptions getPrimaryDescriptions( Map providerDescs) { - ProviderId pid = pickPrimaryPID(providerDescs); + ProviderId pid = pickPrimaryPid(providerDescs); return providerDescs.get(pid); } diff --git a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java index 3a168936..5cbf360a 100644 --- a/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java +++ b/framework/src/onos/core/store/dist/src/test/java/org/onosproject/store/device/impl/GossipDeviceStoreTest.java @@ -232,7 +232,7 @@ public class GossipDeviceStoreTest { if (expected == actual) { return; } - assertEquals(expected.deviceURI(), actual.deviceURI()); + assertEquals(expected.deviceUri(), actual.deviceUri()); assertEquals(expected.hwVersion(), actual.hwVersion()); assertEquals(expected.manufacturer(), actual.manufacturer()); assertEquals(expected.serialNumber(), actual.serialNumber()); @@ -247,7 +247,7 @@ public class GossipDeviceStoreTest { if (expected == actual) { return; } - assertEquals(expected.deviceURI(), actual.deviceURI()); + assertEquals(expected.deviceUri(), actual.deviceUri()); assertEquals(expected.hwVersion(), actual.hwVersion()); assertEquals(expected.manufacturer(), actual.manufacturer()); assertEquals(expected.serialNumber(), actual.serialNumber()); diff --git a/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java b/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java index 0312bafd..b2199f70 100644 --- a/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java +++ b/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java @@ -438,7 +438,7 @@ public final class KryoNamespaces { DefaultTableStatisticsEntry.class ) .register(new DefaultApplicationIdSerializer(), DefaultApplicationId.class) - .register(new URISerializer(), URI.class) + .register(new UriSerializer(), URI.class) .register(new NodeIdSerializer(), NodeId.class) .register(new ProviderIdSerializer(), ProviderId.class) .register(new DeviceIdSerializer(), DeviceId.class) diff --git a/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/URISerializer.java b/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/URISerializer.java deleted file mode 100644 index 43969666..00000000 --- a/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/URISerializer.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2014 Open Networking Laboratory - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.onosproject.store.serializers; - -import java.net.URI; - -import com.esotericsoftware.kryo.Kryo; -import com.esotericsoftware.kryo.Serializer; -import com.esotericsoftware.kryo.io.Input; -import com.esotericsoftware.kryo.io.Output; - -/** - * Serializer for {@link URI}. - */ -public class URISerializer extends Serializer { - - /** - * Creates {@link URI} serializer instance. - */ - public URISerializer() { - super(false); - } - - @Override - public void write(Kryo kryo, Output output, URI object) { - output.writeString(object.toString()); - } - - @Override - public URI read(Kryo kryo, Input input, Class type) { - return URI.create(input.readString()); - } -} diff --git a/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/UriSerializer.java b/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/UriSerializer.java new file mode 100644 index 00000000..1d146a55 --- /dev/null +++ b/framework/src/onos/core/store/serializers/src/main/java/org/onosproject/store/serializers/UriSerializer.java @@ -0,0 +1,46 @@ +/* + * Copyright 2014 Open Networking Laboratory + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.onosproject.store.serializers; + +import com.esotericsoftware.kryo.Kryo; +import com.esotericsoftware.kryo.Serializer; +import com.esotericsoftware.kryo.io.Input; +import com.esotericsoftware.kryo.io.Output; + +import java.net.URI; + +/** + * Serializer for {@link URI}. + */ +public class UriSerializer extends Serializer { + + /** + * Creates {@link URI} serializer instance. + */ + public UriSerializer() { + super(false); + } + + @Override + public void write(Kryo kryo, Output output, URI object) { + output.writeString(object.toString()); + } + + @Override + public URI read(Kryo kryo, Input input, Class type) { + return URI.create(input.readString()); + } +} -- cgit 1.2.3-korg