X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=opendaylight%2Fcontainermanager%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcontainermanager%2Finternal%2FContainerImpl.java;fp=opendaylight%2Fcontainermanager%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcontainermanager%2Finternal%2FContainerImpl.java;h=0000000000000000000000000000000000000000;hb=42c32160bfd41de57189bb246fec5ffb48ed8e9e;hp=cb2a289af33ca6be2b099efdf7b066484cccec9c;hpb=edf5bfcee83c750853253ccfd991ba7000f5f65b;p=controller.git diff --git a/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerImpl.java b/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerImpl.java deleted file mode 100644 index cb2a289af3..0000000000 --- a/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerImpl.java +++ /dev/null @@ -1,125 +0,0 @@ - -/* - * Copyright (c) 2013 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, - * and is available at http://www.eclipse.org/legal/epl-v10.html - */ - -/** - * @file ContainerImpl.java - * - * @brief Class that instantiated per-container implements the - * interface IContainer - * - */ -package org.opendaylight.controller.containermanager.internal; - -import java.util.ArrayList; -import java.util.Dictionary; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentMap; - -import org.apache.felix.dm.Component; -import org.opendaylight.controller.containermanager.ContainerData; -import org.opendaylight.controller.sal.core.ContainerFlow; -import org.opendaylight.controller.sal.core.IContainer; -import org.opendaylight.controller.sal.core.Node; -import org.opendaylight.controller.sal.core.NodeConnector; - -public class ContainerImpl implements IContainer { - private String containerName = null; - private IContainerInternal iContainerInternal = null; - - public void setIContainerInternal(IContainerInternal s) { - this.iContainerInternal = s; - } - - public void unsetIContainerInternal(IContainerInternal s) { - if (this.iContainerInternal == s) { - this.iContainerInternal = null; - } - } - - /** - * Function called by the dependency manager when all the required - * dependencies are satisfied - * - */ - void init(Component c) { - Dictionary props = c.getServiceProperties(); - if (props != null) { - this.containerName = (String) props.get("containerName"); - } - } - - @Override - public String getName() { - return this.containerName; - } - - @Override - public List getContainerFlows() { - List list = new ArrayList(); - - ContainerData d = this.iContainerInternal.getContainerData(this.containerName); - if (d != null) { - list.addAll(d.getContainerFlowSpecs()); - } - return list; - } - - @Override - public short getTag(Node n) { - ContainerData d = this.iContainerInternal.getContainerData(this.containerName); - if (d != null) { - return d.getStaticVlan(); - } - // Return 0 because in containerData that means an unassigned tag - return (short) 0; - } - - @Override - public Set getNodeConnectors() { - Set set = new HashSet(); - - ContainerData d = this.iContainerInternal.getContainerData(this.containerName); - if (d != null) { - ConcurrentMap> m = d.getSwPorts(); - if (m != null) { - for (Map.Entry> entry : m.entrySet()) { - set.addAll(entry.getValue()); - } - } - } - return set; - } - - @Override - public Set getNodes() { - Set set = new HashSet(); - - ContainerData d = this.iContainerInternal.getContainerData(this.containerName); - if (d != null) { - ConcurrentMap> m = d.getSwPorts(); - if (m != null) { - set.addAll(m.keySet()); - } - } - return set; - } - - @Override - public String getContainerAdminRole() { - return iContainerInternal.getContainerData(containerName).getContainerAdminRole(); - } - - @Override - public String getContainerOperatorRole() { - return iContainerInternal.getContainerData(containerName).getContainerOperatorRole(); - } -}