<prerequisites>
<maven>3.0</maven>
</prerequisites>
- <groupId>org.opendaylight.controller</groupId>
<artifactId>commons.opendaylight</artifactId>
<version>1.4.2-SNAPSHOT</version>
<packaging>pom</packaging>
<artifactId>yang-model-api</artifactId>
<version>${yangtools.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.opendaylight.yangtools</groupId>
+ <artifactId>yang-model-util</artifactId>
+ <version>${yangtools.version}</version>
+ </dependency>
+
<dependency>
<groupId>org.opendaylight.controller</groupId>
<artifactId>hosttracker</artifactId>
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) {
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);
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;
@Test
public void testReadingIdentities_threadsJavaModule() {
- Map<String /* identity name */, Optional<QName>> expectedIdentitiesToBases = new HashMap(){{
+ Map<String /* identity name */, Optional<QName>> expectedIdentitiesToBases = new HashMap<String, Optional<QName>>(){
+ 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.<QName>absent());
put(ModuleMXBeanEntryTest.THREADPOOL_REGISTRY_IMPL_NAME, Optional.of(MODULE_TYPE_Q_NAME));
}};
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <nexusproxy>http://nexus.opendaylight.org/content</nexusproxy>
- <!-- Java Versions -->
- <maven.compiler.source>1.7</maven.compiler.source>
- <maven.compiler.target>1.7</maven.compiler.target>
<!-- Plugin Versions -->
<bundle.plugin.version>2.4.0</bundle.plugin.version>
- <releaseplugin.version>2.3.2</releaseplugin.version>
+ <maven.clean.plugin.version>2.5</maven.clean.plugin.version>
<!-- Dependency Versions -->
- <slf4j.version>1.7.2</slf4j.version>
- <guava.version>14.0.1</guava.version>
- <osgi.core.version>5.0.0</osgi.core.version>
- <junit.version>4.8.1</junit.version>
<mockito.version>1.9.5</mockito.version>
<xtend.version>2.4.3</xtend.version>
- <maven.clean.plugin.version>2.5</maven.clean.plugin.version>
- <jacoco.version>0.5.3.201107060350</jacoco.version>
<!-- Sonar properties using jacoco to retrieve integration test results -->
<sonar.java.coveragePlugin>jacoco</sonar.java.coveragePlugin>
<sal.version>0.7.1-SNAPSHOT</sal.version>
</properties>
- <pluginRepositories>
- <!-- OpenDayLight Repo Mirror -->
- <pluginRepository>
- <id>opendaylight-mirror</id>
- <name>opendaylight-mirror</name>
- <url>${nexusproxy}/groups/public/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </releases>
- </pluginRepository>
- <!-- OpenDayLight Snapshot artifact -->
- <pluginRepository>
- <id>opendaylight-snapshot</id>
- <name>opendaylight-snapshot</name>
- <url> ${nexusproxy}/repositories/opendaylight.snapshot/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </pluginRepository>
- </pluginRepositories>
-
-
- <repositories>
- <!-- OpenDayLight Repo Mirror -->
- <repository>
- <id>opendaylight-mirror</id>
- <name>opendaylight-mirror</name>
- <url>${nexusproxy}/groups/public/</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- <releases>
- <enabled>true</enabled>
- <updatePolicy>never</updatePolicy>
- </releases>
- </repository>
- <!-- OpenDayLight Snapshot artifact -->
- <repository>
- <id>opendaylight-snapshot</id>
- <name>opendaylight-snapshot</name>
- <url> ${nexusproxy}/repositories/opendaylight.snapshot/</url>
- <snapshots>
- <enabled>true</enabled>
- </snapshots>
- <releases>
- <enabled>false</enabled>
- </releases>
- </repository>
- </repositories>
-
- <distributionManagement>
- <!-- OpenDayLight Released artifact -->
- <repository>
- <id>opendaylight-release</id>
- <url>${nexusproxy}/repositories/opendaylight.release/</url>
- </repository>
- <!-- OpenDayLight Snapshot artifact -->
- <snapshotRepository>
- <id>opendaylight-snapshot</id>
- <url>${nexusproxy}/repositories/opendaylight.snapshot/</url>
- </snapshotRepository>
- <!-- Site deployment -->
- <site>
- <id>website</id>
- <url>${sitedeploy}</url>
- </site>
- </distributionManagement>
-
-
<dependencyManagement>
<dependencies>
<dependency>
<version>1.4.01</version>
</dependency>
- <!-- YANG Tools Dependencies -->
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-binding</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-model-util</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-common</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-api</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-impl</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-model-api</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
- <dependency>
- <groupId>org.opendaylight.yangtools</groupId>
- <artifactId>yang-data-util</artifactId>
- <version>${yangtools.version}</version>
- </dependency>
<!-- SAL Dependencies -->
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- <version>${guava.version}</version>
- </dependency>
<dependency>
<groupId>org.eclipse.xtend</groupId>
<artifactId>org.eclipse.xtend.lib</artifactId>
<artifactId>org.osgi.core</artifactId>
<version>${osgi.core.version}</version>
</dependency>
- <!-- Testing Dependencies -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>${junit.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-all</artifactId>
- <version>${mockito.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.opendaylight.yangtools</groupId>
<artifactId>binding-generator-impl</artifactId>
<artifactId>yang-parser-impl</artifactId>
<version>${yangtools.version}</version>
</dependency>
+
+ <!-- Testing Dependencies -->
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-all</artifactId>
+ <version>${mockito.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-release-plugin</artifactId>
- <version>${releaseplugin.version}</version>
- </plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
@Override
public final <T extends RpcService> T getRpcService(Class<T> type) {
- @SuppressWarnings("unchecked")
T potentialProxy = (T) publicProxies.get(type);
if (potentialProxy != null) {
return potentialProxy;
}
- private void notifyListenersRoutedCreated(RpcRouter router) {
+ private void notifyListenersRoutedCreated(RpcRouter<?> router) {
for (ListenerRegistration<RouterInstantiationListener> listener : routerInstantiationListener) {
try {
import org.opendaylight.yangtools.yang.binding.Identifier;
public class ReferencableObjectKey implements Identifier<ReferencableObject> {
-
+ private static final long serialVersionUID = 1L;
final Integer value;
-
+
public ReferencableObjectKey(Integer _value) {
this.value = _value;
}
public String toString() {
return "ReferencableObjectKey [value=" + value + "]";
}
-
-
+
+
}
}
private static class RpcResultTO<T> implements RpcResult<T>, Serializable, Immutable {
-
+ private static final long serialVersionUID = 1L;
private final Collection<RpcError> errors;
private final T result;
private final boolean successful;
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;
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
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;
private static final Logger log = LoggerFactory.getLogger(ToasterProvider.class);
private ProviderContext providerContext;
- private OpendaylightToaster toaster;
+ private final OpendaylightToaster toaster;
public ToasterProvider() {
toaster = new OpendaylightToaster();
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;
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<T> {
protected AttributeIfc lastAttribute;
protected abstract T caseListDependeciesAttribute(ArrayType<?> openType);
private static class UnknownOpenTypeException extends RuntimeException {
+ private static final long serialVersionUID = 1L;
+
public UnknownOpenTypeException(String message) {
super(message);
}
* Exception class which provides notification about exceptional situations at the virtual socket layer.
*/
public class VirtualSocketException extends RuntimeException {
+ private static final long serialVersionUID = 1L;
}
<url>${sitedeploy}</url>
</site>
</distributionManagement>
- <groupId>org.opendaylight.controller</groupId>
<artifactId>networkconfig.neutron.implementation</artifactId>
<version>0.4.2-SNAPSHOT</version>
<packaging>bundle</packaging>
<url>${sitedeploy}</url>
</site>
</distributionManagement>
- <groupId>org.opendaylight.controller</groupId>
<artifactId>networkconfig.neutron</artifactId>
<version>0.4.2-SNAPSHOT</version>
<packaging>bundle</packaging>
<tag>HEAD</tag>
</scm>
- <groupId>org.opendaylight.controller</groupId>
<artifactId>containermanager.northbound</artifactId>
<version>0.4.2-SNAPSHOT</version>
<packaging>bundle</packaging>
<tag>HEAD</tag>
</scm>
- <groupId>org.opendaylight.controller</groupId>
<artifactId>northbound.integrationtest</artifactId>
<version>0.4.2-SNAPSHOT</version>
<pluginRepositories>
<url>${sitedeploy}</url>
</site>
</distributionManagement>
- <groupId>org.opendaylight.controller</groupId>
<artifactId>networkconfig.neutron.northbound</artifactId>
<version>0.4.2-SNAPSHOT</version>
<packaging>bundle</packaging>
@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<String> fields) {
return o.extractFields(fields);
}
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())) {
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())) {
* {@link org.opendaylight.controller.sal.core.Property} attached to
* it.
*
- * <pre>
+ * <pre>
*
* Example:
*
* 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
* extended classes
* @return Response as dictated by the HTTP Response Status code
*
- * <pre>
+ * <pre>
*
* Example:
*
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);
* @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
*
- * <pre>
+ * <pre>
*
* Example:
*
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);
/*
- * 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,
* @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;
}
/**
* @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;
}
/**
public static byte[] getBroadcastMACAddr() {
return Arrays.copyOf(BroadcastMACAddr, BroadcastMACAddr.length);
}
-
}
-
/*
- * 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,
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));
+ }
}