//Set the service properties to include the containerName
//in the service, that is fundamental for supporting
//multiple services just distinguished via a container
+ @SuppressWarnings("unchecked")
Dictionary<String, String> serviceProps = c
.getServiceProperties();
if (serviceProps != null) {
/**
* Private constructor used for JAXB mapping
*/
+ @SuppressWarnings("unused")
private Edge() {
this.tailNodeConnector = null;
this.headNodeConnector = null;
*
* @param type of node to be set
*/
+ @SuppressWarnings("unused")
private void setType(String type) {
this.nodeType = type;
if (this.nodeIDString != null) {
*
* @param nodeIDString String representation for NodeID
*/
+ @SuppressWarnings("unused")
private void setNodeIDString(String nodeIDString) {
this.nodeIDString = nodeIDString;
if (this.nodeType != null) {
// for Unit Testing coverage
static {
compatibleType.put(CONTROLLER,
- new ImmutablePair(Short.class, null));
+ new ImmutablePair<Class<? extends Object>, String>(Short.class, null));
compatibleType.put(ALL,
- new ImmutablePair(Short.class, null));
+ new ImmutablePair<Class<? extends Object>, String>(Short.class, null));
compatibleType.put(SWSTACK,
- new ImmutablePair(Short.class, null));
+ new ImmutablePair<Class<? extends Object>, String>(Short.class, null));
compatibleType.put(HWPATH,
- new ImmutablePair(Short.class, null));
+ new ImmutablePair<Class<? extends Object>, String>(Short.class, null));
compatibleType.put(OPENFLOW,
- new ImmutablePair(Short.class,
+ new ImmutablePair<Class<? extends Object>, String>(Short.class,
Node.NodeIDType.OPENFLOW));
compatibleType.put(PCEP,
- new ImmutablePair(Integer.class,
+ new ImmutablePair<Class<? extends Object>, String>(Integer.class,
Node.NodeIDType.PCEP));
compatibleType.put(ONEPK,
- new ImmutablePair(String.class,
+ new ImmutablePair<Class<? extends Object>, String>(String.class,
Node.NodeIDType.ONEPK));
compatibleType.put(OPENFLOW2PCEP,
- new ImmutablePair(Short.class,
+ new ImmutablePair<Class<? extends Object>, String>(Short.class,
Node.NodeIDType.OPENFLOW));
compatibleType.put(OPENFLOW2ONEPK,
- new ImmutablePair(Short.class,
+ new ImmutablePair<Class<? extends Object>, String>(Short.class,
Node.NodeIDType.OPENFLOW));
compatibleType.put(PCEP2OPENFLOW,
- new ImmutablePair(Integer.class,
+ new ImmutablePair<Class<? extends Object>, String>(Integer.class,
Node.NodeIDType.PCEP));
compatibleType.put(PCEP2ONEPK,
- new ImmutablePair(Integer.class,
+ new ImmutablePair<Class<? extends Object>, String>(Integer.class,
Node.NodeIDType.PCEP));
compatibleType.put(ONEPK2OPENFLOW,
- new ImmutablePair(String.class,
+ new ImmutablePair<Class<? extends Object>, String>(String.class,
Node.NodeIDType.ONEPK));
compatibleType.put(ONEPK2PCEP,
- new ImmutablePair(String.class,
+ new ImmutablePair<Class<? extends Object>, String>(String.class,
Node.NodeIDType.ONEPK));
compatibleType.put(PRODUCTION,
- new ImmutablePair(String.class,
+ new ImmutablePair<Class<? extends Object>, String>(String.class,
Node.NodeIDType.PRODUCTION));
}
if (compatibleType.get(type) != null) {
return false;
} else {
- compatibleType.put(type, new ImmutablePair(compatibleID,
+ compatibleType.put(type, new ImmutablePair<Class<? extends Object>, String>(compatibleID,
compatibleNode));
return true;
}
*
* @param type of node to be set
*/
+ @SuppressWarnings("unused")
private void setType(String type) {
this.nodeConnectorType = type;
if (this.nodeConnectorIDString != null) {
*
* @param nodeConnectorIDString String representation for NodeConnectorID
*/
+ @SuppressWarnings("unused")
private void setNodeConnectorIDString(String IDStr) {
this.nodeConnectorIDString = IDStr;
if (this.nodeConnectorType != null) {
}
/**
- * @param type the nodeTableType to set
- *
* Private setter for nodeConnectorType to be called by JAXB not by anyone
* else, NodeConnector is immutable
+ *
+ * @param type the nodeTableType to set
*/
+ @SuppressWarnings("unused")
private void setType(String type) {
this.nodeTableType = type;
if (this.nodeTableIDString != null) {
/**
* Private constructor used for JAXB mapping
*/
+ @SuppressWarnings("unused")
private Path() {
this.edges = null;
}
public static boolean registerGlobalService(Class<?> clazz,
Object instance,
Dictionary<String, Object> properties) {
- ServiceRegistration registration = registerGlobalServiceWReg(clazz, instance, properties);
+ ServiceRegistration<?> registration = registerGlobalServiceWReg(clazz, instance, properties);
if (registration == null) {
logger.error("Failed to register {} for instance {}", clazz, instance);
return false;
* registration
* @return the ServiceRegistration if registration happened, null otherwise
*/
- public static ServiceRegistration registerServiceWReg(Class<?> clazz, String containerName,
+ public static ServiceRegistration<?> registerServiceWReg(Class<?> clazz, String containerName,
Object instance, Dictionary<String, Object> properties) {
if (properties == null) {
properties = (Dictionary<String, Object>) new Hashtable<String, Object>();
* registration
* @return the ServiceRegistration if registration happened, null otherwise
*/
- public static ServiceRegistration registerGlobalServiceWReg(Class<?> clazz,
+ public static ServiceRegistration<?> registerGlobalServiceWReg(Class<?> clazz,
Object instance,
Dictionary<String, Object> properties) {
try {
return null;
}
- ServiceRegistration registration = bCtx.registerService(clazz.getName(), instance, properties);
+ ServiceRegistration<?> registration = bCtx.registerService(clazz.getName(), instance, properties);
return registration;
} catch (Exception e) {
logger.error("Exception {} while registering the service {}",
BundleContext bCtx = FrameworkUtil.getBundle(bundle.getClass())
.getBundleContext();
- ServiceReference[] services = null;
+ ServiceReference<?>[] services = null;
if (serviceFilter != null) {
services = bCtx.getServiceReferences(clazz.getName(),
"(&(containerName=" + containerName + ")"
BundleContext bCtx = FrameworkUtil.getBundle(bundle.getClass())
.getBundleContext();
- ServiceReference[] services = bCtx.getServiceReferences(clazz
+ ServiceReference<?>[] services = bCtx.getServiceReferences(clazz
.getName(), serviceFilter);
if (services != null) {
public void testNodeConnectorOpenFlowOfWrongType() {
try {
Node n1 = new Node(Node.NodeIDType.OPENFLOW, new Long(110L));
+ @SuppressWarnings("unused")
NodeConnector of1 = new NodeConnector(
NodeConnector.NodeConnectorIDType.OPENFLOW, new String(
"0xDEADBEEFCAFE0001L"), n1);
public void testNodeConnectorONEPKOfWrongType() {
try {
Node n1 = new Node(Node.NodeIDType.ONEPK, new String("Router1"));
+ @SuppressWarnings("unused")
NodeConnector onepk1 = new NodeConnector(
NodeConnector.NodeConnectorIDType.ONEPK, new Long(
0xDEADBEEFCAFE0001L), n1);
public void testNodeConnectorPCEPOfWrongType() {
try {
Node n1 = new Node(Node.NodeIDType.PCEP, new UUID(0L, 0L));
+ @SuppressWarnings("unused")
NodeConnector pcep1 = new NodeConnector(
NodeConnector.NodeConnectorIDType.PCEP, new Long(
0xDEADBEEFCAFE0001L), n1);
}
}
+ @SuppressWarnings("unused")
@Test
public void testIncompatibleNodes() {
try {
public void testNodeTableOpenFlowOfWrongType() {
try {
Node node = NodeCreator.createOFNode((long) 20);
+ @SuppressWarnings("unused")
NodeTable of1 = new NodeTable(NodeTable.NodeTableIDType.OPENFLOW, "name", node);
// If we reach this point the exception was not raised
@Test
public void testNodeOpenFlowOfWrongType() {
try {
+ @SuppressWarnings("unused")
Node of1 = new Node(Node.NodeIDType.OPENFLOW, new String(
"0xDEADBEEFCAFE0001L"));
@Test
public void testNodeONEPKOfWrongType() {
try {
+ @SuppressWarnings("unused")
Node onepk1 = new Node(Node.NodeIDType.ONEPK, new Long(
0xDEADBEEFCAFE0001L));
@Test
public void testNodePCEPOfWrongType() {
try {
+ @SuppressWarnings("unused")
Node pcep1 = new Node(Node.NodeIDType.PCEP, new Long(
0xDEADBEEFCAFE0001L));
// created
Node.NodeIDType.unRegisterIDType("FOO");
try {
+ @SuppressWarnings("unused")
Node n = new Node("FOO", new Integer(0xCAFE));
// If we reach here, something didn't go fine, an
}
try {
+ @SuppressWarnings("unused")
Path res = new Path(edges);
} catch (ConstructionException e) {
// Exception is NOT expected if raised test will fail
edges.remove(2);
try {
+ @SuppressWarnings("unused")
Path res = new Path(edges);
// Exception is expected if not raised test will fail
Assert.assertTrue(false);
@Test
public void testPathEmpty() {
try {
- Path path = new Path(new LinkedList());
+ @SuppressWarnings("unused")
+ Path path = new Path(new LinkedList<Edge>());
// Exception is expected if not raised test will fail
Assert.assertTrue(false);
} catch (ConstructionException e) {
Edge e0 = new Edge(c0, c1);
+ @SuppressWarnings("unused")
Path path = new Path(Arrays.asList(e0));
} catch (ConstructionException e) {
// Exception is NOT expected if raised test will fail
public class EthernetAddressTest {
@Test
public void testNonValidConstructor() {
+ @SuppressWarnings("unused")
EthernetAddress ea1;
// Null input array
try {