From: Ed Warnicke Date: Tue, 11 Feb 2014 01:47:28 +0000 (+0000) Subject: Merge "Remove deprecated API elements from protocol framework" X-Git-Tag: autorelease-tag-v20140601202136_82eb3f9~484 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=d6bcfc09131a675cdf198a3fb9b4fac653daf19b;hp=15cbdc938e9991c2067002b042af40188e3965ab Merge "Remove deprecated API elements from protocol framework" --- diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index 73630575ed..fb548d4acd 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -4,7 +4,6 @@ 3.0 - org.opendaylight.controller commons.opendaylight 1.4.2-SNAPSHOT pom @@ -57,11 +56,11 @@ -Xmx1024m -XX:MaxPermSize=256m 14.0.1 5.0.0 - 2010.09.24.3 - 2010.09.24.3 - 2013.10.21.1 - 2013.08.27.3 - 2013.09.07.3 + 2010.09.24.4-SNAPSHOT + 2010.09.24.4-SNAPSHOT + 2013.10.21.2-SNAPSHOT + 2013.08.27.4-SNAPSHOT + 2013.09.07.4-SNAPSHOT 3.17.1-GA 2.3.2 3.1 @@ -759,6 +758,12 @@ yang-model-api ${yangtools.version} + + org.opendaylight.yangtools + yang-model-util + ${yangtools.version} + + org.opendaylight.controller hosttracker diff --git a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/TransactionIdentifier.java b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/TransactionIdentifier.java index 5ab09bea11..28bd613648 100644 --- a/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/TransactionIdentifier.java +++ b/opendaylight/config/config-manager/src/main/java/org/opendaylight/controller/config/manager/impl/TransactionIdentifier.java @@ -10,7 +10,7 @@ package org.opendaylight.controller.config.manager.impl; import org.opendaylight.yangtools.concepts.Identifier; public class TransactionIdentifier implements Identifier { - + private static final long serialVersionUID = 1L; private final String name; public TransactionIdentifier(String name) { diff --git a/opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/model/PersistException.java b/opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/model/PersistException.java index 29d623274c..a0ccdb8e2e 100644 --- a/opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/model/PersistException.java +++ b/opendaylight/config/config-persister-file-xml-adapter/src/main/java/org/opendaylight/controller/config/persist/storage/file/xml/model/PersistException.java @@ -8,6 +8,7 @@ package org.opendaylight.controller.config.persist.storage.file.xml.model; final class PersistException extends RuntimeException { + private static final long serialVersionUID = 1L; public PersistException(String s, Exception e) { super(s, e); diff --git a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/NameConflictException.java b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/NameConflictException.java index 2ae70562cf..ec2d985339 100644 --- a/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/NameConflictException.java +++ b/opendaylight/config/yang-jmx-generator/src/main/java/org/opendaylight/controller/config/yangjmxgenerator/plugin/util/NameConflictException.java @@ -10,7 +10,7 @@ package org.opendaylight.controller.config.yangjmxgenerator.plugin.util; import org.opendaylight.yangtools.yang.common.QName; public class NameConflictException extends RuntimeException { - + private static final long serialVersionUID = 1L; private static final String messageBlueprint = "Name conflict for name: %s, first defined in: %s, then defined in: %s"; private final String conflictingName; private final QName secondParentQName; diff --git a/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/SchemaContextTest.java b/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/SchemaContextTest.java index 14ec7e0fdc..1837bac266 100644 --- a/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/SchemaContextTest.java +++ b/opendaylight/config/yang-jmx-generator/src/test/java/org/opendaylight/controller/config/yangjmxgenerator/SchemaContextTest.java @@ -100,12 +100,15 @@ public class SchemaContextTest extends AbstractYangTest { @Test public void testReadingIdentities_threadsJavaModule() { - Map> expectedIdentitiesToBases = new HashMap(){{ + Map> expectedIdentitiesToBases = new HashMap>(){ + private static final long serialVersionUID = 1L; + + { put(ModuleMXBeanEntryTest.EVENTBUS_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME)); put(ModuleMXBeanEntryTest.ASYNC_EVENTBUS_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME)); put(ModuleMXBeanEntryTest.THREADFACTORY_NAMING_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME)); put(ModuleMXBeanEntryTest.THREADPOOL_DYNAMIC_MXB_NAME, Optional.of(MODULE_TYPE_Q_NAME)); - put("thread-rpc-context", Optional.absent()); + put("thread-rpc-context", Optional.absent()); put(ModuleMXBeanEntryTest.THREADPOOL_REGISTRY_IMPL_NAME, Optional.of(MODULE_TYPE_Q_NAME)); }}; diff --git a/opendaylight/md-sal/model/model-flow-base/pom.xml b/opendaylight/md-sal/model/model-flow-base/pom.xml index a7c74c573b..d7d678d89a 100644 --- a/opendaylight/md-sal/model/model-flow-base/pom.xml +++ b/opendaylight/md-sal/model/model-flow-base/pom.xml @@ -19,7 +19,6 @@ org.opendaylight.yangtools.model opendaylight-l2-types - 2013.08.27.3 ${project.groupId} diff --git a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-match-types.yang b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-match-types.yang index 321e054097..b02b0dc25c 100644 --- a/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-match-types.yang +++ b/opendaylight/md-sal/model/model-flow-base/src/main/yang/opendaylight-match-types.yang @@ -8,7 +8,7 @@ module opendaylight-match-types { import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} revision "2013-10-26" { - description "Initial revision of macth types"; + description "Initial revision of match types"; } grouping "mac-address-filter" { diff --git a/opendaylight/md-sal/model/model-flow-service/pom.xml b/opendaylight/md-sal/model/model-flow-service/pom.xml index 55837564c3..5604ea98cf 100644 --- a/opendaylight/md-sal/model/model-flow-service/pom.xml +++ b/opendaylight/md-sal/model/model-flow-service/pom.xml @@ -29,7 +29,6 @@ org.opendaylight.yangtools.model opendaylight-l2-types - 2013.08.27.3 bundle diff --git a/opendaylight/md-sal/pom.xml b/opendaylight/md-sal/pom.xml index 2f594148c9..8b4e478429 100644 --- a/opendaylight/md-sal/pom.xml +++ b/opendaylight/md-sal/pom.xml @@ -102,24 +102,14 @@ UTF-8 - http://nexus.opendaylight.org/content - - 1.7 - 1.7 2.4.0 - 2.3.2 + 2.5 - 1.7.2 - 14.0.1 - 5.0.0 - 4.8.1 1.9.5 2.4.3 - 2.5 - 0.5.3.201107060350 jacoco @@ -133,82 +123,6 @@ 0.7.1-SNAPSHOT - - - - opendaylight-mirror - opendaylight-mirror - ${nexusproxy}/groups/public/ - - false - - - true - never - - - - - opendaylight-snapshot - opendaylight-snapshot - ${nexusproxy}/repositories/opendaylight.snapshot/ - - true - - - false - - - - - - - - - opendaylight-mirror - opendaylight-mirror - ${nexusproxy}/groups/public/ - - false - - - true - never - - - - - opendaylight-snapshot - opendaylight-snapshot - ${nexusproxy}/repositories/opendaylight.snapshot/ - - true - - - false - - - - - - - - opendaylight-release - ${nexusproxy}/repositories/opendaylight.release/ - - - - opendaylight-snapshot - ${nexusproxy}/repositories/opendaylight.snapshot/ - - - - website - ${sitedeploy} - - - - @@ -217,42 +131,6 @@ 1.4.01 - - - org.opendaylight.yangtools - yang-binding - ${yangtools.version} - - - org.opendaylight.yangtools - yang-model-util - ${yangtools.version} - - - org.opendaylight.yangtools - yang-common - ${yangtools.version} - - - org.opendaylight.yangtools - yang-data-api - ${yangtools.version} - - - org.opendaylight.yangtools - yang-data-impl - ${yangtools.version} - - - org.opendaylight.yangtools - yang-model-api - ${yangtools.version} - - - org.opendaylight.yangtools - yang-data-util - ${yangtools.version} - ${project.groupId} @@ -277,11 +155,6 @@ slf4j-api ${slf4j.version} - - com.google.guava - guava - ${guava.version} - org.eclipse.xtend org.eclipse.xtend.lib @@ -292,19 +165,6 @@ org.osgi.core ${osgi.core.version} - - - junit - junit - ${junit.version} - test - - - org.mockito - mockito-all - ${mockito.version} - test - org.opendaylight.yangtools binding-generator-impl @@ -315,16 +175,19 @@ yang-parser-impl ${yangtools.version} + + + + org.mockito + mockito-all + ${mockito.version} + test + - - org.apache.maven.plugins - maven-release-plugin - ${releaseplugin.version} - org.apache.felix maven-bundle-plugin diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java index a5da8a0cb1..e98d5b9942 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/sal/binding/impl/RpcProviderRegistryImpl.java @@ -93,7 +93,6 @@ public class RpcProviderRegistryImpl implements // @Override public final T getRpcService(Class type) { - @SuppressWarnings("unchecked") T potentialProxy = (T) publicProxies.get(type); if (potentialProxy != null) { return potentialProxy; @@ -151,7 +150,7 @@ public class RpcProviderRegistryImpl implements // } - private void notifyListenersRoutedCreated(RpcRouter router) { + private void notifyListenersRoutedCreated(RpcRouter router) { for (ListenerRegistration listener : routerInstantiationListener) { try { diff --git a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/mock/ReferencableObjectKey.java b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/mock/ReferencableObjectKey.java index 7ab489a9f5..68d7f6cd9e 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/mock/ReferencableObjectKey.java +++ b/opendaylight/md-sal/sal-binding-broker/src/test/java/org/opendaylight/controller/sal/binding/test/mock/ReferencableObjectKey.java @@ -10,9 +10,9 @@ package org.opendaylight.controller.sal.binding.test.mock; import org.opendaylight.yangtools.yang.binding.Identifier; public class ReferencableObjectKey implements Identifier { - + private static final long serialVersionUID = 1L; final Integer value; - + public ReferencableObjectKey(Integer _value) { this.value = _value; } @@ -46,6 +46,6 @@ public class ReferencableObjectKey implements Identifier { public String toString() { return "ReferencableObjectKey [value=" + value + "]"; } - - + + } diff --git a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java index f7fc714025..f303941871 100644 --- a/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java +++ b/opendaylight/md-sal/sal-common-util/src/main/java/org/opendaylight/controller/sal/common/util/Rpcs.java @@ -34,7 +34,7 @@ public class Rpcs { } private static class RpcResultTO implements RpcResult, Serializable, Immutable { - + private static final long serialVersionUID = 1L; private final Collection errors; private final T result; private final boolean successful; diff --git a/opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/sample/toaster/provider/impl/ToastConsumerImpl.java b/opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/sample/toaster/provider/impl/ToastConsumerImpl.java index fde60d64ce..87e5787ef5 100644 --- a/opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/sample/toaster/provider/impl/ToastConsumerImpl.java +++ b/opendaylight/md-sal/samples/toaster-consumer/src/main/java/org/opendaylight/controller/sample/toaster/provider/impl/ToastConsumerImpl.java @@ -11,18 +11,14 @@ import java.util.Hashtable; import java.util.concurrent.ExecutionException; import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareConsumer; +import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext; import org.opendaylight.controller.sal.binding.api.BindingAwareConsumer; import org.opendaylight.controller.sal.binding.api.NotificationListener; import org.opendaylight.controller.sal.binding.api.NotificationService; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext; -import org.opendaylight.controller.sal.binding.api.data.DataBrokerService; -import org.opendaylight.controller.sal.common.GlobalDataStore; import org.opendaylight.controller.sample.toaster.provider.api.ToastConsumer; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.MakeToastInputBuilder; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToastDone; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToastType; -import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.Toaster; -import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterData; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterService; import org.opendaylight.yangtools.yang.common.RpcResult; import org.osgi.framework.BundleActivator; @@ -71,7 +67,7 @@ public class ToastConsumerImpl extends AbstractBindingAwareConsumer implements B public void onSessionInitialized(ConsumerContext session) { this.session = session; NotificationService notificationService = session.getSALService(NotificationService.class); - notificationService.addNotificationListener(ToastDone.class, this); + notificationService.registerNotificationListener(ToastDone.class, this); } @Override diff --git a/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/ToasterProvider.java b/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/ToasterProvider.java index 5ba67474b3..ae482ed978 100644 --- a/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/ToasterProvider.java +++ b/opendaylight/md-sal/samples/toaster-provider/src/main/java/org/opendaylight/controller/sample/toaster/provider/ToasterProvider.java @@ -11,16 +11,10 @@ import java.util.Collection; import java.util.Collections; import org.opendaylight.controller.sal.binding.api.AbstractBindingAwareProvider; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker; -import org.opendaylight.controller.sal.binding.api.BindingAwareProvider; -import org.opendaylight.controller.sal.binding.api.NotificationProviderService; -import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ConsumerContext; import org.opendaylight.controller.sal.binding.api.BindingAwareBroker.ProviderContext; +import org.opendaylight.controller.sal.binding.api.NotificationProviderService; import org.opendaylight.yang.gen.v1.http.netconfcentral.org.ns.toaster.rev091120.ToasterService; import org.opendaylight.yangtools.yang.binding.RpcService; -import org.osgi.framework.BundleActivator; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,7 +22,7 @@ public class ToasterProvider extends AbstractBindingAwareProvider { private static final Logger log = LoggerFactory.getLogger(ToasterProvider.class); private ProviderContext providerContext; - private OpendaylightToaster toaster; + private final OpendaylightToaster toaster; public ToasterProvider() { toaster = new OpendaylightToaster(); diff --git a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/AttributeIfcSwitchStatement.java b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/AttributeIfcSwitchStatement.java index 502d581220..54d24a4cec 100644 --- a/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/AttributeIfcSwitchStatement.java +++ b/opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/mapping/attributes/AttributeIfcSwitchStatement.java @@ -8,6 +8,11 @@ package org.opendaylight.controller.netconf.confignetconfconnector.mapping.attributes; +import javax.management.openmbean.ArrayType; +import javax.management.openmbean.CompositeType; +import javax.management.openmbean.OpenType; +import javax.management.openmbean.SimpleType; + import org.opendaylight.controller.config.yangjmxgenerator.attribute.AttributeIfc; import org.opendaylight.controller.config.yangjmxgenerator.attribute.DependencyAttribute; import org.opendaylight.controller.config.yangjmxgenerator.attribute.JavaAttribute; @@ -16,11 +21,6 @@ import org.opendaylight.controller.config.yangjmxgenerator.attribute.ListDepende import org.opendaylight.controller.config.yangjmxgenerator.attribute.TOAttribute; import org.opendaylight.yangtools.yang.model.api.type.BinaryTypeDefinition; -import javax.management.openmbean.ArrayType; -import javax.management.openmbean.CompositeType; -import javax.management.openmbean.OpenType; -import javax.management.openmbean.SimpleType; - public abstract class AttributeIfcSwitchStatement { protected AttributeIfc lastAttribute; @@ -102,6 +102,8 @@ public abstract class AttributeIfcSwitchStatement { protected abstract T caseListDependeciesAttribute(ArrayType openType); private static class UnknownOpenTypeException extends RuntimeException { + private static final long serialVersionUID = 1L; + public UnknownOpenTypeException(String message) { super(message); } diff --git a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java index 6c747dbe24..4770cb128f 100644 --- a/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java +++ b/opendaylight/netconf/netconf-api/src/main/java/org/opendaylight/controller/netconf/api/NetconfSession.java @@ -8,26 +8,30 @@ package org.opendaylight.controller.netconf.api; import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; + +import java.io.IOException; + import org.opendaylight.protocol.framework.AbstractProtocolSession; import org.opendaylight.protocol.framework.SessionListener; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; - public abstract class NetconfSession extends AbstractProtocolSession { - protected final Channel channel; - private final SessionListener sessionListener; + private static final Logger logger = LoggerFactory.getLogger(NetconfSession.class); + private final SessionListener sessionListener; private final long sessionId; private boolean up = false; - private static final Logger logger = LoggerFactory.getLogger(NetconfSession.class); - protected NetconfSession(SessionListener sessionListener, Channel channel, long sessionId) { + protected final Channel channel; + + protected NetconfSession(SessionListener sessionListener, Channel channel, long sessionId) { this.sessionListener = sessionListener; this.channel = channel; this.sessionId = sessionId; logger.debug("Session {} created", toString()); } + @Override public void close() { channel.close(); @@ -41,8 +45,8 @@ public abstract class NetconfSession extends AbstractProtocolSession POSSIBLE_ENDS = ImmutableList.of( - "]\n".getBytes(Charsets.UTF_8), "]\r\n".getBytes(Charsets.UTF_8)); + new byte[] { ']', '\n' }, + new byte[] { ']', '\r', '\n' }); private static final List POSSIBLE_STARTS = ImmutableList.of( - "[".getBytes(Charsets.UTF_8), "\r\n[".getBytes(Charsets.UTF_8), "\n[".getBytes(Charsets.UTF_8)); + new byte[] { '[' }, + new byte[] { '\r', '\n', '[' }, + new byte[] { '\n', '[' }); @Override @VisibleForTesting @@ -57,6 +59,10 @@ public final class NetconfXMLToMessageDecoder extends ByteToMessageDecoder { String additionalHeader = null; + // FIXME: this has to be moved into the negotiator and explained as to what the heck + // is going on. This is definitely not specified in NETCONF and has no place here. It + // requires reading all data and incurs inefficiency by being unable to pipe the ByteBuf + // directly into the XML decoder. if (startsWithAdditionalHeader(bytes)) { // Auth information containing username, ip address... extracted for monitoring int endOfAuthHeader = getAdditionalHeaderEndIndex(bytes); diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/ssh/virtualsocket/VirtualSocketException.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/ssh/virtualsocket/VirtualSocketException.java index 46fdbb83e7..5907ea8f13 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/ssh/virtualsocket/VirtualSocketException.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/handler/ssh/virtualsocket/VirtualSocketException.java @@ -12,4 +12,5 @@ package org.opendaylight.controller.netconf.util.handler.ssh.virtualsocket; * Exception class which provides notification about exceptional situations at the virtual socket layer. */ public class VirtualSocketException extends RuntimeException { + private static final long serialVersionUID = 1L; } diff --git a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java index 86081b7f81..ba6364662c 100644 --- a/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java +++ b/opendaylight/netconf/netconf-util/src/main/java/org/opendaylight/controller/netconf/util/mapping/AbstractNetconfOperation.java @@ -8,6 +8,8 @@ package org.opendaylight.controller.netconf.util.mapping; +import java.util.Map; + import org.opendaylight.controller.netconf.api.NetconfDocumentedException; import org.opendaylight.controller.netconf.api.NetconfOperationRouter; import org.opendaylight.controller.netconf.mapping.api.HandlingPriority; @@ -20,8 +22,6 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import java.util.Map; - public abstract class AbstractNetconfOperation implements NetconfOperation { private final String netconfSessionIdForReporting; @@ -29,7 +29,7 @@ public abstract class AbstractNetconfOperation implements NetconfOperation { this.netconfSessionIdForReporting = netconfSessionIdForReporting; } - public String getNetconfSessionIdForReporting() { + public final String getNetconfSessionIdForReporting() { return netconfSessionIdForReporting; } @@ -67,7 +67,7 @@ public abstract class AbstractNetconfOperation implements NetconfOperation { protected abstract HandlingPriority canHandle(String operationName, String netconfOperationNamespace); @Override - public Document handle(Document message, NetconfOperationRouter opRouter) throws NetconfDocumentedException { + public final Document handle(Document message, NetconfOperationRouter opRouter) throws NetconfDocumentedException { XmlElement requestElement = getRequestElementWithCheck(message); diff --git a/opendaylight/networkconfiguration/neutron/implementation/pom.xml b/opendaylight/networkconfiguration/neutron/implementation/pom.xml index 83e251aed8..821ac92021 100644 --- a/opendaylight/networkconfiguration/neutron/implementation/pom.xml +++ b/opendaylight/networkconfiguration/neutron/implementation/pom.xml @@ -34,7 +34,6 @@ ${sitedeploy} - org.opendaylight.controller networkconfig.neutron.implementation 0.4.2-SNAPSHOT bundle diff --git a/opendaylight/networkconfiguration/neutron/pom.xml b/opendaylight/networkconfiguration/neutron/pom.xml index fc728dc89f..27588b8bee 100644 --- a/opendaylight/networkconfiguration/neutron/pom.xml +++ b/opendaylight/networkconfiguration/neutron/pom.xml @@ -33,7 +33,6 @@ ${sitedeploy} - org.opendaylight.controller networkconfig.neutron 0.4.2-SNAPSHOT bundle diff --git a/opendaylight/northbound/containermanager/pom.xml b/opendaylight/northbound/containermanager/pom.xml index 2d980910f4..48dee485ae 100644 --- a/opendaylight/northbound/containermanager/pom.xml +++ b/opendaylight/northbound/containermanager/pom.xml @@ -14,7 +14,6 @@ HEAD - org.opendaylight.controller containermanager.northbound 0.4.2-SNAPSHOT bundle diff --git a/opendaylight/northbound/integrationtest/pom.xml b/opendaylight/northbound/integrationtest/pom.xml index a6b3855d1f..2789526668 100644 --- a/opendaylight/northbound/integrationtest/pom.xml +++ b/opendaylight/northbound/integrationtest/pom.xml @@ -14,7 +14,6 @@ HEAD - org.opendaylight.controller northbound.integrationtest 0.4.2-SNAPSHOT diff --git a/opendaylight/northbound/networkconfiguration/neutron/pom.xml b/opendaylight/northbound/networkconfiguration/neutron/pom.xml index a6596f886d..7590a976b6 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/pom.xml +++ b/opendaylight/northbound/networkconfiguration/neutron/pom.xml @@ -34,7 +34,6 @@ ${sitedeploy} - org.opendaylight.controller networkconfig.neutron.northbound 0.4.2-SNAPSHOT bundle diff --git a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java index 642b3bb197..c26e0229d0 100644 --- a/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java +++ b/opendaylight/northbound/networkconfiguration/neutron/src/main/java/org/opendaylight/controller/networkconfig/neutron/northbound/NeutronPortsNorthbound.java @@ -60,6 +60,8 @@ import org.opendaylight.controller.sal.utils.ServiceHelper; @Path("/ports") public class NeutronPortsNorthbound { + final String mac_regex="^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$"; + private NeutronPort extractFields(NeutronPort o, List fields) { return o.extractFields(fields); } @@ -207,7 +209,7 @@ public class NeutronPortsNorthbound { return Response.status(404).build(); } if (singleton.getMacAddress() == null || - !singleton.getMacAddress().matches("^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$")) { + !singleton.getMacAddress().matches(mac_regex)) { return Response.status(400).build(); } if (portInterface.macInUse(singleton.getMacAddress())) { @@ -298,7 +300,7 @@ public class NeutronPortsNorthbound { if (!networkInterface.networkExists(test.getNetworkUUID())) { return Response.status(404).build(); } - if (!test.getMacAddress().matches("^([0-9A-F]{2}[:-]){5}([0-9A-F]{2})$")) { + if (!test.getMacAddress().matches(mac_regex)) { return Response.status(400).build(); } if (portInterface.macInUse(test.getMacAddress())) { diff --git a/opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java b/opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java index 8eff06a763..662af723ed 100644 --- a/opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java +++ b/opendaylight/northbound/switchmanager/src/main/java/org/opendaylight/controller/switchmanager/northbound/SwitchNorthbound.java @@ -416,7 +416,7 @@ public class SwitchNorthbound { * {@link org.opendaylight.controller.sal.core.Property} attached to * it. * - *
+     * 
      *
      * Example:
      *
@@ -540,8 +540,10 @@ public class SwitchNorthbound {
      *            Type of the node connector being programmed (Eg. 'OF')
      * @param nodeConnectorId
      *            NodeConnector Identifier as specified by
-     *            {@link org.opendaylight.controller.sal.core.NodeConnector}
-     *            (Eg. '2')
+     *            {@link org.opendaylight.controller.sal.core.NodeConnector}.
+     *            (Eg. '2'). If nodeConnecterId contains forward slash(/),
+     *            replace forward slash with underscore(_) in the URL. (Eg. for
+     *            Ethernet1/2, use Ethernet1_2)
      * @param propertyName
      *            Name of the Property specified by
      *            {@link org.opendaylight.controller.sal.core.Property} and its
@@ -552,7 +554,7 @@ public class SwitchNorthbound {
      *            extended classes
      * @return Response as dictated by the HTTP Response Status code
      *
-     *         
+     * 
      *
      * Example:
      *
@@ -592,6 +594,10 @@ public class SwitchNorthbound {
         handleNodeAvailability(containerName, nodeType, nodeId);
         Node node = Node.fromString(nodeType, nodeId);
 
+        if (nodeConnectorId.contains("_")) {
+            nodeConnectorId = nodeConnectorId.replace("_", "/");
+        }
+
         handleNodeConnectorAvailability(containerName, node, nodeConnectorType, nodeConnectorId);
         NodeConnector nc = NodeConnector.fromStringNoNode(nodeConnectorType, nodeConnectorId, node);
 
@@ -625,14 +631,16 @@ public class SwitchNorthbound {
      * @param nodeConnectorId
      *            NodeConnector Identifier as specified by
      *            {@link org.opendaylight.controller.sal.core.NodeConnector}
-     *            (Eg. '1')
+     *            (Eg. '1'). If nodeConnecterId contains forward slash(/),
+     *            replace forward slash with underscore(_) in the URL. (Eg. for
+     *            Ethernet1/2, use Ethernet1_2)
      * @param propertyName
      *            Name of the Property specified by
      *            {@link org.opendaylight.controller.sal.core.Property} and its
      *            extended classes. Property that can be deleted is bandwidth
      * @return Response as dictated by the HTTP Response Status code
      *
-     *         
+     * 
      *
      * Example:
      *
@@ -670,6 +678,10 @@ public class SwitchNorthbound {
         handleNodeAvailability(containerName, nodeType, nodeId);
         Node node = Node.fromString(nodeType, nodeId);
 
+        if (nodeConnectorId.contains("_")) {
+            nodeConnectorId = nodeConnectorId.replace("_", "/");
+        }
+
         handleNodeConnectorAvailability(containerName, node, nodeConnectorType, nodeConnectorId);
         NodeConnector nc = NodeConnector.fromStringNoNode(nodeConnectorType, nodeConnectorId, node);
         Status ret = switchManager.removeNodeConnectorProp(nc, propertyName);
diff --git a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/NetUtils.java b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/NetUtils.java
index 6c3424c616..dc341625af 100644
--- a/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/NetUtils.java
+++ b/opendaylight/sal/api/src/main/java/org/opendaylight/controller/sal/utils/NetUtils.java
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2013-2014 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -482,7 +482,7 @@ public abstract class NetUtils {
      * @return the int variable containing the unsigned byte value
      */
     public static int getUnsignedByte(byte b) {
-        return (b > 0) ? (int) b : (b & 0x7F | 0x80);
+        return b & 0xFF;
     }
 
     /**
@@ -493,7 +493,7 @@ public abstract class NetUtils {
      * @return the int variable containing the unsigned short value
      */
     public static int getUnsignedShort(short s) {
-        return (s > 0) ? (int) s : (s & 0x7FFF | 0x8000);
+        return s & 0xFFFF;
     }
 
     /**
@@ -520,5 +520,4 @@ public abstract class NetUtils {
     public static byte[] getBroadcastMACAddr() {
         return Arrays.copyOf(BroadcastMACAddr, BroadcastMACAddr.length);
     }
-
 }
diff --git a/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/utils/NetUtilsTest.java b/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/utils/NetUtilsTest.java
index b8bc6fb447..a2b12782ac 100644
--- a/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/utils/NetUtilsTest.java
+++ b/opendaylight/sal/api/src/test/java/org/opendaylight/controller/sal/utils/NetUtilsTest.java
@@ -1,6 +1,5 @@
-
 /*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
+ * Copyright (c) 2013-2014 Cisco Systems, Inc. and others.  All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
@@ -449,4 +448,24 @@ public class NetUtilsTest {
         Assert.assertTrue(NetUtils
                 .isIPAddressValid("2001:420:281:1004:407a:57f4:4d15:c355"));
     }
+
+    @Test
+    public void testGetUnsignedByte() {
+        Assert.assertEquals(0,   NetUtils.getUnsignedByte((byte) 0x00));
+        Assert.assertEquals(1,   NetUtils.getUnsignedByte((byte) 0x01));
+        Assert.assertEquals(127, NetUtils.getUnsignedByte((byte) 0x7f));
+
+        Assert.assertEquals(128, NetUtils.getUnsignedByte((byte) 0x80));
+        Assert.assertEquals(255, NetUtils.getUnsignedByte((byte) 0xff));
+    }
+
+    @Test
+    public void testGetUnsignedShort() {
+        Assert.assertEquals(0,     NetUtils.getUnsignedShort((short) 0x0000));
+        Assert.assertEquals(1,     NetUtils.getUnsignedShort((short) 0x0001));
+        Assert.assertEquals(32767, NetUtils.getUnsignedShort((short) 0x7fff));
+
+        Assert.assertEquals(32768, NetUtils.getUnsignedShort((short) 0x8000));
+        Assert.assertEquals(65535, NetUtils.getUnsignedShort((short) 0xffff));
+    }
 }