From 839cdfb56df36d689cd249b6fc51e85cd0bf81ac Mon Sep 17 00:00:00 2001 From: jfokkan Date: Thu, 8 May 2014 11:32:42 -0400 Subject: [PATCH] added containermanager shell feature PatchSet5: Worked containermanager.shell into distro and pom files so that it both builds and is pulled into the old distribution/opendaylight. Also checked to make sure that it worked there. PatchSet6: Fixed adding of new shell bundle to old distro Change-Id: I7f4d86c9902a7f4a8f6bd4bae74ebe4a9634e3bc Signed-off-by: Jonathan Fok kan Signed-off-by: Ed Warnicke --- features/base/pom.xml | 20 +- features/base/src/main/resources/features.xml | 1 - features/controller/pom.xml | 62 +++ .../src/main/resources/features.xml | 77 ++++ opendaylight/commons/opendaylight/pom.xml | 25 ++ .../IContainerManagerShell.java | 25 ++ .../containermanager/internal/Activator.java | 6 +- .../internal/ContainerManager.java | 285 +++++++++++++- opendaylight/containermanager/shell/pom.xml | 52 +++ .../containermanager/shell/AddContainer.java | 29 ++ .../shell/AddContainerEntry.java | 32 ++ .../shell/AddContainerFlow.java | 32 ++ .../ContainermgrGetAuthorizedGroups.java | 26 ++ .../ContainermgrGetAuthorizedResources.java | 26 ++ .../ContainermgrGetResourcesForGroup.java | 26 ++ .../shell/ContainermgrGetRoles.java | 22 ++ .../shell/ContainermgrGetUserLevel.java | 26 ++ .../shell/ContainermgrGetUserResources.java | 26 ++ .../shell/CreateContainer.java | 29 ++ .../containermanager/shell/Pfc.java | 22 ++ .../containermanager/shell/Psc.java | 22 ++ .../containermanager/shell/Psd.java | 22 ++ .../containermanager/shell/Psm.java | 22 ++ .../containermanager/shell/Psp.java | 22 ++ .../shell/RemoveContainer.java | 26 ++ .../shell/RemoveContainerEntry.java | 32 ++ .../shell/RemoveContainerFlow.java | 29 ++ .../containermanager/shell/SaveConfig.java | 22 ++ .../OSGI-INF/blueprint/blueprint.xml | 123 ++++++ .../shell/ContainerManagerShellTest.java | 368 ++++++++++++++++++ .../distribution/opendaylight-karaf/pom.xml | 4 +- .../src/main/resources/etc/custom.properties | 6 - .../src/main/resources/etc/startup.properties | 2 +- .../src/main/resources/etc/system.properties | 109 ++++++ pom.xml | 2 + 35 files changed, 1630 insertions(+), 30 deletions(-) create mode 100644 features/controller/pom.xml create mode 100644 features/controller/src/main/resources/features.xml create mode 100644 opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/IContainerManagerShell.java create mode 100644 opendaylight/containermanager/shell/pom.xml create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainer.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerEntry.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerFlow.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedGroups.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedResources.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetResourcesForGroup.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetRoles.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserLevel.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserResources.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/CreateContainer.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Pfc.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psc.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psd.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psm.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psp.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainer.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerEntry.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerFlow.java create mode 100644 opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/SaveConfig.java create mode 100644 opendaylight/containermanager/shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml create mode 100644 opendaylight/containermanager/shell/src/test/java/org/opendaylight/controller/containermanager/shell/ContainerManagerShellTest.java create mode 100644 opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/system.properties diff --git a/features/base/pom.xml b/features/base/pom.xml index d12432c6b4..922b2d6bdf 100644 --- a/features/base/pom.xml +++ b/features/base/pom.xml @@ -8,7 +8,7 @@ ../../opendaylight/commons/opendaylight base-features - kar + pom ${project.artifactId} Base Features POM @@ -22,24 +22,6 @@ - - org.apache.karaf.tooling - karaf-maven-plugin - ${karaf.version} - true - - - features-create-kar - - features-create-kar - - - ${project.build.directory}/classes/${features.file} - - - - - org.apache.maven.plugins maven-resources-plugin diff --git a/features/base/src/main/resources/features.xml b/features/base/src/main/resources/features.xml index 23051f5a9a..5677ab66d0 100644 --- a/features/base/src/main/resources/features.xml +++ b/features/base/src/main/resources/features.xml @@ -121,7 +121,6 @@ mvn:orbit/org.apache.juli.extras/7.0.32.v201211081135 mvn:orbit/org.apache.tomcat.api/7.0.32.v201211081135 mvn:orbit/org.apache.tomcat.util/7.0.32.v201211201952 - wrap:mvn:virgomirror/org.eclipse.jdt.core.compiler.batch/3.8.0.I20120518-2145 mvn:org.ow2.asm/asm-all/${asm.version} diff --git a/features/controller/pom.xml b/features/controller/pom.xml new file mode 100644 index 0000000000..ddaf773151 --- /dev/null +++ b/features/controller/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../../opendaylight/commons/opendaylight + + controller-features + pom + ${project.artifactId} + Features POM + + features.xml + + + + + true + src/main/resources + + + + + org.apache.maven.plugins + maven-resources-plugin + + + filter + + resources + + generate-resources + + + + + org.codehaus.mojo + build-helper-maven-plugin + + + attach-artifacts + + attach-artifact + + package + + + + ${project.build.directory}/classes/${features.file} + xml + features + + + + + + + + + diff --git a/features/controller/src/main/resources/features.xml b/features/controller/src/main/resources/features.xml new file mode 100644 index 0000000000..1ae210ac20 --- /dev/null +++ b/features/controller/src/main/resources/features.xml @@ -0,0 +1,77 @@ + + + + + odl-clustering + odl-managers + odl-sal + mvn:org.opendaylight.controller/hosttracker/${hosttracker.api.version} + mvn:org.opendaylight.controller/hosttracker.implementation/${hosttracker.implementation.version} + + + base-felix-dm + mvn:org.apache.commons/commons-lang3/${commons.lang.version} + mvn:org.osgi/org.osgi.compendium/${osgi.compendium.version} + mvn:org.apache.felix/org.apache.felix.dependencymanager/${felix.dependencymanager.version} + mvn:org.opendaylight.controller/sal/${sal.version} + + mvn:org.opendaylight.controller/sal.implementation/${sal.implementation.version} + mvn:org.opendaylight.controller/sal.networkconfiguration/${sal.networkconfiguration.version} + mvn:org.opendaylight.controller/sal.networkconfiguration.implementation/${sal.networkconfiguration.version} + mvn:org.opendaylight.controller/sal.connection/${sal.connection.version} + mvn:org.opendaylight.controller/sal.connection.implementation/${sal.connection.version} + + + transaction + base-felix-dm + base-eclipselink-persistence + odl-sal + mvn:org.opendaylight.controller/clustering.services/${clustering.services.version} + mvn:org.opendaylight.controller/clustering.services-implementation/${clustering.services_implementation.version} + mvn:org.opendaylight.controller/clustering.stub/${clustering.stub.version} + + + odl-sal + mvn:org.opendaylight.controller/configuration/${configuration.version} + mvn:org.opendaylight.controller/configuration.implementation/${configuration.implementation.version} + + + + mvn:org.opendaylight.controller/config-api/${config.version} + mvn:org.opendaylight.controller/config-manager/${config.version} + mvn:org.opendaylight.controller/config-netconf-connector/${netconf.version} + mvn:org.opendaylight.controller/config-persister-api/${config.version} + mvn:org.opendaylight.controller/config-persister-directory-xml-adapter/${config.version} + mvn:org.opendaylight.controller/config-persister-file-xml-adapter/${config.version} + mvn:org.opendaylight.controller/config-persister-impl/${netconf.version} + mvn:org.opendaylight.controller/yang-jmx-generator/${yang-jmx-generator.version} + + + odl-legacy-configuration + base-spring-security + base-felix-dm + odl-clustering + mvn:org.opendaylight.controller.thirdparty/net.sf.jung2/2.0.1 + mvn:org.opendaylight.controller/appauth/${appauth.version} + mvn:org.opendaylight.controller/hosttracker/${hosttracker.api.version} + mvn:org.opendaylight.controller/hosttracker.implementation/${hosttracker.implementation.version} + mvn:org.opendaylight.controller/switchmanager/${switchmanager.api.version} + mvn:org.opendaylight.controller/switchmanager.implementation/${switchmanager.implementation.version} + mvn:org.opendaylight.controller/statisticsmanager/${statisticsmanager.version} + mvn:org.opendaylight.controller/statisticsmanager.implementation/${statisticsmanager.implementation.version} + mvn:org.opendaylight.controller/forwardingrulesmanager/${forwardingrulesmanager.version} + mvn:org.opendaylight.controller/forwardingrulesmanager.implementation/${forwardingrulesmanager.implementation.version} + mvn:org.opendaylight.controller/usermanager/${usermanager.version} + mvn:org.opendaylight.controller/usermanager.implementation/${usermanager.version} + mvn:org.opendaylight.controller/containermanager/${containermanager.version} + mvn:org.opendaylight.controller/containermanager.implementation/${containermanager.version} + mvn:org.opendaylight.controller/topologymanager/${topologymanager.version} + mvn:org.opendaylight.controller/forwarding.staticrouting + mvn:org.opendaylight.controller/routing.dijkstra_implementation + mvn:org.opendaylight.controller/connectionmanager + mvn:org.opendaylight.controller/connectionmanager.implementation + + diff --git a/opendaylight/commons/opendaylight/pom.xml b/opendaylight/commons/opendaylight/pom.xml index c3c8168bd7..59fc760432 100644 --- a/opendaylight/commons/opendaylight/pom.xml +++ b/opendaylight/commons/opendaylight/pom.xml @@ -17,13 +17,17 @@ 1.0.0 0.4.2-SNAPSHOT + 0.0.1-SNAPSHOT 1.1.0 0.5.2-SNAPSHOT + 0.5.2-SNAPSHOT 4.1 1.50 2.4.0 + 0.4.2-SNAPSHOT + 0.4.2-SNAPSHOT 0.4.2-SNAPSHOT 2.10 0.5.1-SNAPSHOT @@ -31,13 +35,19 @@ 0.4.2-SNAPSHOT 0.4.2-SNAPSHOT 0.4.2-SNAPSHOT + 0.0.3-SNAPSHOT 1.7 1.2.2 0.1.2-SNAPSHOT 2.4 3.1 + 0.0.2-SNAPSHOT 3.0.1 + 0.1.2-SNAPSHOT + 0.5.2-SNAPSHOT + 1.4.2-SNAPSHOT + 1.0.2-SNAPSHOT 2.3.2 0.5.2-SNAPSHOT 0.2.5-SNAPSHOT @@ -46,11 +56,13 @@ 0.1.2-SNAPSHOT 0.5.2-SNAPSHOT 0.4.2-SNAPSHOT + 0.5.2-SNAPSHOT 0.5.2-SNAPSHOT 0.0.2-SNAPSHOT 7.0.42 0.2.0 0.4.2-SNAPSHOT + 1.1.0-SNAPSHOT 2.5.0 1.3.1 @@ -79,6 +91,8 @@ 0.5.2-SNAPSHOT 0.4.2-SNAPSHOT 0.4.2-SNAPSHOT + 0.4.2-SNAPSHOT + 0.0.2-SNAPSHOT 2010.09.24.4-SNAPSHOT 2013.10.19.1-SNAPSHOT 2013.10.21.2-SNAPSHOT @@ -97,12 +111,14 @@ 2.8 1.3.3 src/main/yang-gen-config + 0.0.2-SNAPSHOT 1.1.4 2.0.1 1.1.1 2.0 4.8.1 1.0.0-SNAPSHOT + 3.0.0 3.0.1 1.0.9 0.4.2-SNAPSHOT @@ -120,6 +136,9 @@ 0.4.2-SNAPSHOT http://nexus.opendaylight.org/content + 0.4.2-SNAPSHOT + 1.4.2-SNAPSHOT + 1.4.2-SNAPSHOT 2013.08.27.4-SNAPSHOT 20080701 0.0.2-SNAPSHOT @@ -180,6 +199,7 @@ src/main/xtend-gen 2.4.3 2013.09.07.4-SNAPSHOT + 1.0.0-SNAPSHOT 0.6.2-SNAPSHOT @@ -813,6 +833,11 @@ containermanager.northbound ${containermanager.northbound.version} + + org.opendaylight.controller + containermanager.shell + ${containermanager.shell.version} + org.opendaylight.controller controllermanager.northbound diff --git a/opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/IContainerManagerShell.java b/opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/IContainerManagerShell.java new file mode 100644 index 0000000000..2024b1855c --- /dev/null +++ b/opendaylight/containermanager/api/src/main/java/org/opendaylight/controller/containermanager/IContainerManagerShell.java @@ -0,0 +1,25 @@ +package org.opendaylight.controller.containermanager; + +import java.util.List; + +public interface IContainerManagerShell { + public List psc(); + public List pfc(); + public List psd(); + public List psp(); + public List psm(); + public List addContainer(String arg1, String arg2); + public List createContainer(String arg1, String arg2); + public List removeContainerShell(String arg1); + public List addContainerEntry(String arg1, String arg2, String arg3); + public List removeContainerEntry(String arg1, String arg2, String arg3); + public List addContainerFlow(String arg1, String arg2, String arg3); + public List removeContainerFlow(String arg1, String arg2); + public List containermgrGetRoles(); + public List containermgrGetAuthorizedGroups(String arg1); + public List containermgrGetAuthorizedResources(String arg1); + public List containermgrGetResourcesForGroup(String arg1); + public List containermgrGetUserLevel(String arg1); + public List containermgrGetUserResources(String arg1); + public List saveConfig(); +} \ No newline at end of file diff --git a/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/Activator.java b/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/Activator.java index 616a0f24f3..61c8ab6c6e 100644 --- a/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/Activator.java +++ b/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/Activator.java @@ -10,11 +10,14 @@ package org.opendaylight.controller.containermanager.internal; import org.eclipse.osgi.framework.console.CommandProvider; + import java.util.Dictionary; import java.util.HashSet; import java.util.Set; import java.util.Hashtable; + import org.opendaylight.controller.containermanager.IContainerManager; +import org.opendaylight.controller.containermanager.IContainerManagerShell; import org.apache.felix.dm.Component; import org.opendaylight.controller.clustering.services.ICacheUpdateAware; import org.opendaylight.controller.clustering.services.IClusterGlobalServices; @@ -124,7 +127,8 @@ public class Activator extends ComponentActivatorAbstractBase { CommandProvider.class.getName(), IContainerInternal.class.getName(), IContainerAuthorization.class.getName(), - ICacheUpdateAware.class.getName()}, props); + ICacheUpdateAware.class.getName(), + IContainerManagerShell.class.getName()}, props); c.add(createServiceDependency() .setService(IClusterGlobalServices.class) diff --git a/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java b/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java index 0fee183b67..98378e8135 100644 --- a/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java +++ b/opendaylight/containermanager/implementation/src/main/java/org/opendaylight/controller/containermanager/internal/ContainerManager.java @@ -44,6 +44,7 @@ import org.opendaylight.controller.containermanager.ContainerFlowChangeEvent; import org.opendaylight.controller.containermanager.ContainerFlowConfig; import org.opendaylight.controller.containermanager.IContainerAuthorization; import org.opendaylight.controller.containermanager.IContainerManager; +import org.opendaylight.controller.containermanager.IContainerManagerShell; import org.opendaylight.controller.containermanager.NodeConnectorsChangeEvent; import org.opendaylight.controller.sal.authorization.AppRoleLevel; import org.opendaylight.controller.sal.authorization.Privilege; @@ -71,7 +72,7 @@ import org.slf4j.LoggerFactory; public class ContainerManager extends Authorization implements IContainerManager, IObjectReader, CommandProvider, ICacheUpdateAware, IContainerInternal, IContainerAuthorization, - IConfigurationAware { + IConfigurationAware, IContainerManagerShell { private static final Logger logger = LoggerFactory.getLogger(ContainerManager.class); private static String CONTAINERS_FILE_NAME = "containers.conf"; private static final String allContainersGroup = "allContainers"; @@ -1619,4 +1620,286 @@ public class ContainerManager extends Authorization implements IContaine public boolean inContainerMode() { return this.containerConfigs.size() > 0; } + + public List psc() { + List result = new ArrayList(); + for (Map.Entry entry : containerConfigs.entrySet()) { + ContainerConfig sc = entry.getValue(); + result.add(String.format("%s: %s", sc.getContainerName(), sc.toString())); + } + result.add("Total number of containers: " + containerConfigs.entrySet().size()); + return result; + } + + public List pfc() { + List result = new ArrayList(); + for (Map.Entry entry : containerConfigs.entrySet()) { + ContainerConfig sc = entry.getValue(); + result.add(String.format("%s: %s", sc.getContainerName(), sc.getContainerFlowConfigs())); + } + return result; + } + + public List psd() { + List result = new ArrayList(); + for (String containerName : containerData.keySet()) { + ContainerData sd = containerData.get(containerName); + for (Node sid : sd.getSwPorts().keySet()) { + Set s = sd.getSwPorts().get(sid); + result.add("\t" + sid + " : " + s); + } + + for (ContainerFlow s : sd.getContainerFlowSpecs()) { + result.add("\t" + s.toString()); + } + } + return result; + } + + public List psp() { + List result = new ArrayList(); + for (NodeConnector sp : nodeConnectorToContainers.keySet()) { + result.add(nodeConnectorToContainers.get(sp).toString()); + } + return result; + } + + public List psm() { + List result = new ArrayList(); + for (Node sp : nodeToContainers.keySet()) { + result.add(nodeToContainers.get(sp).toString()); + } + return result; + } + + public List addContainer(String arg1, String arg2) { + List result = new ArrayList(); + String containerName = arg1; + if (containerName == null) { + result.add("Container Name not specified"); + return result; + } + String staticVlan = arg2; + ContainerConfig containerConfig = new ContainerConfig(containerName, staticVlan, null, null); + result.add((this.addRemoveContainer(containerConfig, false)).toString()); + return result; + } + + public List createContainer(String arg1, String arg2) { + List result = new ArrayList(); + String containerName = arg1; + if (containerName == null) { + result.add("Container Name not specified"); + return result; + } + String staticVlan = arg2; + if (staticVlan == null) { + result.add("Static Vlan not specified"); + return result; + } + List ports = new ArrayList(); + for (long l = 1L; l < 10L; l++) { + ports.add(NodeConnectorCreator.createOFNodeConnector((short) 1, NodeCreator.createOFNode(l)).toString()); + } + List cFlowList = new ArrayList(); + cFlowList.add(this.createSampleContainerFlowConfig("tcp", true)); + ContainerConfig containerConfig = new ContainerConfig(containerName, staticVlan, ports, cFlowList); + result.add((this.addRemoveContainer(containerConfig, false)).toString()); + return result; + } + + public List removeContainerShell(String arg1) { + List result = new ArrayList(); + String containerName = arg1; + if (containerName == null) { + result.add("Container Name not specified"); + return result; + } + ContainerConfig containerConfig = new ContainerConfig(containerName, "", null, null); + result.add((this.addRemoveContainer(containerConfig, true)).toString()); + return result; + } + + public List addContainerEntry(String arg1, String arg2, String arg3) { + List result = new ArrayList(); + String containerName = arg1; + if (containerName == null) { + result.add("Container Name not specified"); + return result; + } + String nodeId = arg2; + if (nodeId == null) { + result.add("Node Id not specified"); + return result; + } + String portId = arg3; + if (portId == null) { + result.add("Port not specified"); + return result; + } + Node node = NodeCreator.createOFNode(Long.valueOf(nodeId)); + Short port = Short.valueOf(portId); + NodeConnector nc = NodeConnectorCreator.createOFNodeConnector(port, node); + List portList = new ArrayList(1); + portList.add(nc.toString()); + result.add((this.addRemoveContainerEntries(containerName, portList, false)).toString()); + return result; + } + + public List removeContainerEntry(String arg1, String arg2, String arg3) { + List result = new ArrayList(); + String containerName = arg1; + if (containerName == null) { + result.add("Container Name not specified"); + return result; + } + String nodeId = arg2; + if (nodeId == null) { + result.add("Node Id not specified"); + return result; + } + String portId = arg3; + if (portId == null) { + result.add("Port not specified"); + return result; + } + Node node = NodeCreator.createOFNode(Long.valueOf(nodeId)); + Short port = Short.valueOf(portId); + NodeConnector nc = NodeConnectorCreator.createOFNodeConnector(port, node); + List portList = new ArrayList(1); + portList.add(nc.toString()); + result.add((this.addRemoveContainerEntries(containerName, portList, true)).toString()); + return result; + } + public List addContainerFlow(String arg1, String arg2, String arg3) { + List result = new ArrayList(); + String containerName = arg1; + if (containerName == null) { + result.add("Container Name not specified"); + return result; + } + String cflowName = arg2; + if (cflowName == null) { + result.add("cflowName not specified"); + return result; + } + String unidirectional = arg3; + boolean boolUnidirectional = Boolean.parseBoolean(unidirectional); + List list = new ArrayList(); + list.add(createSampleContainerFlowConfig(cflowName, boolUnidirectional)); + result.add((this.addRemoveContainerFlow(containerName, list, false)).toString()); + return result; + } + + public List removeContainerFlow(String arg1, String arg2) { + List result = new ArrayList(); + String containerName = arg1; + if (containerName == null) { + result.add("Container Name not specified"); + return result; + } + String cflowName = arg2; + if (cflowName == null) { + result.add("cflowName not specified"); + return result; + } + Set set = new HashSet(1); + set.add(cflowName); + result.add((this.removeContainerFlows(containerName, set)).toString()); + return result; + } + + public List containermgrGetRoles() { + List result = new ArrayList(); + result.add("Configured roles for Container Mgr:"); + List list = this.getRoles(); + for (String role : list) { + result.add(role + "\t" + roles.get(role)); + } + return result; + } + + public List containermgrGetAuthorizedGroups(String arg1) { + List result = new ArrayList(); + String roleName = arg1; + if (roleName == null || roleName.trim().isEmpty()) { + result.add("Invalid argument"); + result.add("mmGetAuthorizedGroups "); + return result; + } + result.add("Resource Groups associated to role " + roleName + ":"); + List list = this.getAuthorizedGroups(roleName); + for (ResourceGroup group : list) { + result.add(group.toString()); + } + return result; + } + public List containermgrGetAuthorizedResources(String arg1) { + List result = new ArrayList(); + String roleName = arg1; + if (roleName == null || roleName.trim().isEmpty()) { + result.add("Invalid argument"); + result.add("mmGetAuthorizedResources "); + return result; + } + result.add("Resource associated to role " + roleName + ":"); + List list = this.getAuthorizedResources(roleName); + for (Resource resource : list) { + result.add(resource.toString()); + } + return result; + } + public List containermgrGetResourcesForGroup(String arg1) { + List result = new ArrayList(); + String groupName = arg1; + if (groupName == null || groupName.trim().isEmpty()) { + result.add("Invalid argument"); + result.add("containermgrResourcesForGroup "); + return result; + } + result.add("Group " + groupName + " contains the following resources:"); + List resources = this.getResources(groupName); + for (Object resource : resources) { + result.add(resource.toString()); + } + return result; + } + public List containermgrGetUserLevel(String arg1) { + List result = new ArrayList(); + String userName = arg1; + if (userName == null || userName.trim().isEmpty()) { + result.add("Invalid argument"); + result.add("containermgrGetUserLevel "); + return result; + } + result.add("User " + userName + " has level: " + this.getUserLevel(userName)); + return result; + } + public List containermgrGetUserResources(String arg1) { + List result = new ArrayList(); + String userName = arg1; + if (userName == null || userName.trim().isEmpty()) { + result.add("Invalid argument"); + result.add("containermgrGetUserResources "); + return result; + } + result.add("User " + userName + " owns the following resources: "); + Set resources = this.getAllResourcesforUser(userName); + for (Resource resource : resources) { + result.add(resource.toString()); + } + return result; + } + public List saveConfig() { + List result = new ArrayList(); + Status status = new Status(StatusCode.NOSERVICE, "Configuration service not reachable"); + + IConfigurationService configService = (IConfigurationService) ServiceHelper.getGlobalInstance( + IConfigurationService.class, this); + if (configService != null) { + status = configService.saveConfigurations(); + } + result.add(status.toString()); + return result; + } } diff --git a/opendaylight/containermanager/shell/pom.xml b/opendaylight/containermanager/shell/pom.xml new file mode 100644 index 0000000000..1eedd4bc87 --- /dev/null +++ b/opendaylight/containermanager/shell/pom.xml @@ -0,0 +1,52 @@ + + + 4.0.0 + + org.opendaylight.controller + commons.opendaylight + 1.4.2-SNAPSHOT + ../../commons/opendaylight + + containermanager.shell + ${containermanager.shell.version} + bundle + + + junit + junit + + + org.apache.karaf.shell + org.apache.karaf.shell.console + ${karaf.shell.version} + + + org.mockito + mockito-all + + + org.opendaylight.controller + containermanager + ${containermanager.version} + + + + + + + org.apache.felix + maven-bundle-plugin + ${bundle.plugin.version} + + + org.apache.felix.service.command, + org.apache.karaf.shell.commands, + org.apache.karaf.shell.console, + * + + + + + + + diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainer.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainer.java new file mode 100644 index 0000000000..e87682eed5 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainer.java @@ -0,0 +1,29 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "addcontainer", description="Add Container") +public class AddContainer extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false) + String containerName = null; + + @Argument(index=1, name="staticVlan", description="staticVlan", required=true, multiValued=false) + String staticVlan = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.addContainer(containerName, staticVlan)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerEntry.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerEntry.java new file mode 100644 index 0000000000..b7ee4bd69f --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerEntry.java @@ -0,0 +1,32 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "AddContainerEntry", description="add container entry") +public class AddContainerEntry extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false) + String containerName = null; + + @Argument(index=1, name="nodeId", description="node ID", required=true, multiValued=false) + String nodeId = null; + + @Argument(index=2, name="portId", description="portId", required=true, multiValued=false) + String portId = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.addContainerEntry(containerName, nodeId, portId)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerFlow.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerFlow.java new file mode 100644 index 0000000000..03ed94d685 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/AddContainerFlow.java @@ -0,0 +1,32 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "addContainerFlow", description="adds container flow") +public class AddContainerFlow extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false) + String containerName = null; + + @Argument(index=1, name="cflowName", description="c Flow name", required=true, multiValued=false) + String cflowName = null; + + @Argument(index=2, name="unidirectional", description="unidirectional", required=true, multiValued=false) + String unidirectional = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.addContainerFlow(containerName, cflowName, unidirectional)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedGroups.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedGroups.java new file mode 100644 index 0000000000..f78b8569f0 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedGroups.java @@ -0,0 +1,26 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "containermgrGetAuthorizedGroups", description="Get authorized groups") +public class ContainermgrGetAuthorizedGroups extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="roleName", description="role name", required=true, multiValued=false) + String roleName = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.containermgrGetAuthorizedGroups(roleName)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedResources.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedResources.java new file mode 100644 index 0000000000..1ac50fae88 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetAuthorizedResources.java @@ -0,0 +1,26 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "containermgrGetAuthorizedResources", description="Get authorized resources") +public class ContainermgrGetAuthorizedResources extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="roleName", description="role name", required=true, multiValued=false) + String roleName = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.containermgrGetAuthorizedResources(roleName)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetResourcesForGroup.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetResourcesForGroup.java new file mode 100644 index 0000000000..bbccb65893 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetResourcesForGroup.java @@ -0,0 +1,26 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "containermgrGetResourcesForGroup", description="Get resources for group") +public class ContainermgrGetResourcesForGroup extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="groupName", description="group name", required=true, multiValued=false) + String groupName = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.containermgrGetResourcesForGroup(groupName)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetRoles.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetRoles.java new file mode 100644 index 0000000000..38fdb276cd --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetRoles.java @@ -0,0 +1,22 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "containermgrGetRoles", description="Get container mgr roles") +public class ContainermgrGetRoles extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.containermgrGetRoles()) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserLevel.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserLevel.java new file mode 100644 index 0000000000..9ee607ad71 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserLevel.java @@ -0,0 +1,26 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "containermgrGetUserLevel", description="Get user level") +public class ContainermgrGetUserLevel extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="userName", description="user name", required=true, multiValued=false) + String userName = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.containermgrGetUserLevel(userName)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserResources.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserResources.java new file mode 100644 index 0000000000..6a281bda3f --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/ContainermgrGetUserResources.java @@ -0,0 +1,26 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "containermgrGetUserResources", description="Get user resources") +public class ContainermgrGetUserResources extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="userName", description="user name", required=true, multiValued=false) + String userName = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.containermgrGetUserResources(userName)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/CreateContainer.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/CreateContainer.java new file mode 100644 index 0000000000..ef51563a58 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/CreateContainer.java @@ -0,0 +1,29 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "createcontainer", description="create container") +public class CreateContainer extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false) + String containerName = null; + + @Argument(index=1, name="staticVlan", description="staticVlan", required=true, multiValued=false) + String staticVlan = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.createContainer(containerName, staticVlan)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Pfc.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Pfc.java new file mode 100644 index 0000000000..62b4c9a225 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Pfc.java @@ -0,0 +1,22 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "pfc", description="Display pfc") +public class Pfc extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.pfc()) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psc.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psc.java new file mode 100644 index 0000000000..83e649673e --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psc.java @@ -0,0 +1,22 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "psc", description="Display ") +public class Psc extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.psc()) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psd.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psd.java new file mode 100644 index 0000000000..ff8a02424b --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psd.java @@ -0,0 +1,22 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "psd", description="Display psd") +public class Psd extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.psd()) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psm.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psm.java new file mode 100644 index 0000000000..a7c3549fa2 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psm.java @@ -0,0 +1,22 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "psm", description="Display psm") +public class Psm extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.psm()) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psp.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psp.java new file mode 100644 index 0000000000..d221c83293 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/Psp.java @@ -0,0 +1,22 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "psp", description="Display psp") +public class Psp extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.psp()) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainer.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainer.java new file mode 100644 index 0000000000..997ef67ff8 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainer.java @@ -0,0 +1,26 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "removecontainer", description="remove container") +public class RemoveContainer extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false) + String containerName = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.removeContainerShell(containerName)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerEntry.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerEntry.java new file mode 100644 index 0000000000..9413842109 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerEntry.java @@ -0,0 +1,32 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "removeContainerEntry", description="remove container entry") +public class RemoveContainerEntry extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false) + String containerName = null; + + @Argument(index=1, name="nodeId", description="node ID", required=true, multiValued=false) + String nodeId = null; + + @Argument(index=2, name="portId", description="portId", required=true, multiValued=false) + String portId = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.removeContainerEntry(containerName, nodeId, portId)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerFlow.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerFlow.java new file mode 100644 index 0000000000..94cbb19916 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/RemoveContainerFlow.java @@ -0,0 +1,29 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.felix.gogo.commands.Argument; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "removeContainerFlow", description="removes container flow") +public class RemoveContainerFlow extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Argument(index=0, name="containerName", description="container name", required=true, multiValued=false) + String containerName = null; + + @Argument(index=1, name="cflowName", description="c Flow name", required=true, multiValued=false) + String cflowName = null; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.removeContainerFlow(containerName, cflowName)) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/SaveConfig.java b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/SaveConfig.java new file mode 100644 index 0000000000..b96f7697d4 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/java/org/opendaylight/controller/containermanager/shell/SaveConfig.java @@ -0,0 +1,22 @@ +package org.opendaylight.controller.containermanager.shell; + +import org.apache.felix.gogo.commands.Command; +import org.apache.karaf.shell.console.OsgiCommandSupport; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + +@Command(scope = "containermanager", name = "saveConfig", description="Save config") +public class SaveConfig extends OsgiCommandSupport{ + private IContainerManagerShell containerManager; + + @Override + protected Object doExecute() throws Exception { + for(String p : containerManager.saveConfig()) { + System.out.println(p); + } + return null; + } + + public void setContainerManager(IContainerManagerShell containerManager){ + this.containerManager = containerManager; + } +} \ No newline at end of file diff --git a/opendaylight/containermanager/shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml b/opendaylight/containermanager/shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml new file mode 100644 index 0000000000..e7e01f8eb1 --- /dev/null +++ b/opendaylight/containermanager/shell/src/main/resources/OSGI-INF/blueprint/blueprint.xml @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/opendaylight/containermanager/shell/src/test/java/org/opendaylight/controller/containermanager/shell/ContainerManagerShellTest.java b/opendaylight/containermanager/shell/src/test/java/org/opendaylight/controller/containermanager/shell/ContainerManagerShellTest.java new file mode 100644 index 0000000000..f11d1da6da --- /dev/null +++ b/opendaylight/containermanager/shell/src/test/java/org/opendaylight/controller/containermanager/shell/ContainerManagerShellTest.java @@ -0,0 +1,368 @@ +package org.opendaylight.controller.containermanager.shell; + +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.lang.reflect.Field; + +import org.junit.Assert; +import org.junit.Test; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; +import org.opendaylight.controller.containermanager.IContainerManagerShell; + + +public class ContainerManagerShellTest { + private IContainerManagerShell containerManager; + + @Test + public void testAddContainer() throws Exception { + String containerName = "test", staticVlan = "1234"; + AddContainer addConTest = new AddContainer(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + List result2 = new ArrayList(Arrays.asList("Container Name not specified")); + when(containerManager.addContainer(containerName, staticVlan)).thenReturn(result); + when(containerManager.addContainer(null, null)).thenReturn(result2); + + Field cNField = addConTest.getClass().getDeclaredField("containerName"); + cNField.setAccessible(true); + Field sVField = addConTest.getClass().getDeclaredField("staticVlan"); + sVField.setAccessible(true); + + cNField.set(addConTest, "test"); + sVField.set(addConTest, "1234"); + + addConTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + addConTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + baos.reset(); + + cNField.set(addConTest, null); + sVField.set(addConTest, null); + addConTest.doExecute(); + Assert.assertEquals("Container Name not specified\n", baos.toString()); + } + + @Test + public void testAddContainerEntry() throws Exception { + String containerName = "test", nodeId = "1234", portId = "5678"; + AddContainerEntry addConEntTest = new AddContainerEntry(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.addContainerEntry(containerName, nodeId, portId)).thenReturn(result); + + Field cNField = addConEntTest.getClass().getDeclaredField("containerName"); + cNField.setAccessible(true); + Field nIField = addConEntTest.getClass().getDeclaredField("nodeId"); + nIField.setAccessible(true); + Field pIField = addConEntTest.getClass().getDeclaredField("portId"); + pIField.setAccessible(true); + + cNField.set(addConEntTest, "test"); + nIField.set(addConEntTest, "1234"); + pIField.set(addConEntTest, "5678"); + + addConEntTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + addConEntTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testAddContainerFlow() throws Exception { + String containerName = "test", cflowName = "1234", unidirectional = "5678"; + AddContainerFlow addConFlowTest = new AddContainerFlow(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.addContainerFlow(containerName, cflowName, unidirectional)).thenReturn(result); + + Field cNField = addConFlowTest.getClass().getDeclaredField("containerName"); + cNField.setAccessible(true); + Field cfField = addConFlowTest.getClass().getDeclaredField("cflowName"); + cfField.setAccessible(true); + Field unField = addConFlowTest.getClass().getDeclaredField("unidirectional"); + unField.setAccessible(true); + + cNField.set(addConFlowTest, "test"); + cfField.set(addConFlowTest, "1234"); + unField.set(addConFlowTest, "5678"); + + addConFlowTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + addConFlowTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testContainermgrGetAuthorizedGroups() throws Exception { + String roleName = "test"; + ContainermgrGetAuthorizedGroups contmgrGTest = new ContainermgrGetAuthorizedGroups(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.containermgrGetAuthorizedGroups(roleName)).thenReturn(result); + + Field rNField = contmgrGTest.getClass().getDeclaredField("roleName"); + rNField.setAccessible(true); + + rNField.set(contmgrGTest, "test"); + + contmgrGTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + contmgrGTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testContainermgrGetAuthorizedResources() throws Exception { + String roleName = "test"; + ContainermgrGetAuthorizedResources contmgrRTest = new ContainermgrGetAuthorizedResources(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.containermgrGetAuthorizedResources(roleName)).thenReturn(result); + + Field rNField = contmgrRTest.getClass().getDeclaredField("roleName"); + rNField.setAccessible(true); + + rNField.set(contmgrRTest, "test"); + + contmgrRTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + contmgrRTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testContainermgrGetResourcesForGroup() throws Exception { + String groupName = "test"; + ContainermgrGetResourcesForGroup contmgrRTest = new ContainermgrGetResourcesForGroup(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.containermgrGetResourcesForGroup(groupName)).thenReturn(result); + + Field gNField = contmgrRTest.getClass().getDeclaredField("groupName"); + gNField.setAccessible(true); + + gNField.set(contmgrRTest, groupName); + + contmgrRTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + contmgrRTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testContainermgrGetRoles() throws Exception { + ContainermgrGetRoles contmgrRTest = new ContainermgrGetRoles(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.containermgrGetRoles()).thenReturn(result); + + contmgrRTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + contmgrRTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testContainermgrGetUserLevel() throws Exception { + String userName = "test"; + ContainermgrGetUserLevel contmgrUTest = new ContainermgrGetUserLevel(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.containermgrGetUserLevel(userName)).thenReturn(result); + + Field gNField = contmgrUTest.getClass().getDeclaredField("userName"); + gNField.setAccessible(true); + + gNField.set(contmgrUTest, userName); + + contmgrUTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + contmgrUTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testContainermgrGetUserResources() throws Exception { + String userName = "test"; + ContainermgrGetUserResources contmgrUTest = new ContainermgrGetUserResources(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.containermgrGetUserResources(userName)).thenReturn(result); + + Field gNField = contmgrUTest.getClass().getDeclaredField("userName"); + gNField.setAccessible(true); + + gNField.set(contmgrUTest, userName); + + contmgrUTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + contmgrUTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testPfc() throws Exception { + Pfc pfc = new Pfc(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.pfc()).thenReturn(result); + + pfc.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + pfc.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testPsc() throws Exception { + Psc psc = new Psc(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.psc()).thenReturn(result); + + psc.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + psc.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testPsd() throws Exception { + Psd psd = new Psd(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.psd()).thenReturn(result); + + psd.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + psd.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testPsm() throws Exception { + Psm psm = new Psm(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.psm()).thenReturn(result); + + psm.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + psm.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testPsp() throws Exception { + Psp psp = new Psp(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.psp()).thenReturn(result); + + psp.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + psp.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testRemoveContainer() throws Exception { + String containerName = "test"; + RemoveContainer remConTest = new RemoveContainer(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.removeContainerShell(containerName)).thenReturn(result); + + Field cNField = remConTest.getClass().getDeclaredField("containerName"); + cNField.setAccessible(true); + cNField.set(remConTest, "test"); + + remConTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + remConTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testRemoveContainerEntry() throws Exception { + String containerName = "test", nodeId = "1234", portId = "5678"; + RemoveContainerEntry remConEntTest = new RemoveContainerEntry(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.removeContainerEntry(containerName, nodeId, portId)).thenReturn(result); + + Field cNField = remConEntTest.getClass().getDeclaredField("containerName"); + cNField.setAccessible(true); + Field nIField = remConEntTest.getClass().getDeclaredField("nodeId"); + nIField.setAccessible(true); + Field pIField = remConEntTest.getClass().getDeclaredField("portId"); + pIField.setAccessible(true); + + cNField.set(remConEntTest, "test"); + nIField.set(remConEntTest, "1234"); + pIField.set(remConEntTest, "5678"); + + remConEntTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + remConEntTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testRemoveContainerFlow() throws Exception { + String containerName = "test", cflowName = "1234"; + RemoveContainerFlow remConFlowTest = new RemoveContainerFlow(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.removeContainerFlow(containerName, cflowName)).thenReturn(result); + + Field cNField = remConFlowTest.getClass().getDeclaredField("containerName"); + cNField.setAccessible(true); + Field cfField = remConFlowTest.getClass().getDeclaredField("cflowName"); + cfField.setAccessible(true); + + cNField.set(remConFlowTest, "test"); + cfField.set(remConFlowTest, "1234"); + + remConFlowTest.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + remConFlowTest.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } + + @Test + public void testSaveConfig() throws Exception { + SaveConfig saveConfig = new SaveConfig(); + containerManager = mock(IContainerManagerShell.class); + List result = new ArrayList(Arrays.asList("status")); + when(containerManager.saveConfig()).thenReturn(result); + + saveConfig.setContainerManager(containerManager); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + System.setOut(new PrintStream(baos)); + saveConfig.doExecute(); + Assert.assertEquals("status\n", baos.toString()); + } +} \ No newline at end of file diff --git a/opendaylight/distribution/opendaylight-karaf/pom.xml b/opendaylight/distribution/opendaylight-karaf/pom.xml index 67c30454f8..6a6a12d1de 100644 --- a/opendaylight/distribution/opendaylight-karaf/pom.xml +++ b/opendaylight/distribution/opendaylight-karaf/pom.xml @@ -38,11 +38,13 @@ xml runtime + org.opendaylight.controller base-features ${project.version} - kar + pom runtime diff --git a/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/custom.properties b/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/custom.properties index 6c1ca421c2..502e1a261c 100644 --- a/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/custom.properties +++ b/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/custom.properties @@ -1,17 +1,11 @@ # Extra packages to import from the boot class loader org.osgi.framework.system.packages.extra=org.apache.karaf.branding,sun.reflect,sun.reflect.misc,sun.misc,sun.nio.ch -# https://bugs.eclipse.org/bugs/show_bug.cgi?id=325578 -# Extend the framework to avoid the resources to be presented with -# a URL of type bundleresource: but to be presented as file: -osgi.hook.configurators.include=org.eclipse.virgo.kernel.equinox.extensions.hooks.ExtensionsHookConfigurator # Embedded Tomcat configuration File org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -# Use Equinox as default OSGi Framework Implementation -karaf.framework=equinox # Netconf startup configuration netconf.tcp.address=127.0.0.1 diff --git a/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/startup.properties b/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/startup.properties index ca8c83c380..288fe629f8 100644 --- a/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/startup.properties +++ b/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/startup.properties @@ -7,7 +7,7 @@ mvn\:org.ops4j.pax.swissbox/pax-swissbox-bnd/1.7.0 = 5 mvn\:org.ops4j.pax.url/pax-url-maven-commons/1.6.0 = 5 mvn\:org.ops4j.pax.url/pax-url-aether/1.6.0 = 5 mvn\:org.ops4j.pax.url/pax-url-wrap/1.6.0 = 5 -mvn\:javax.annotation/javax.annotation-api/1.2 = 5 +#mvn\:javax.annotation/javax.annotation-api/1.2 = 5 mvn\:org.ops4j.pax.logging/pax-logging-api/1.7.2 = 8 mvn\:org.ops4j.pax.logging/pax-logging-service/1.7.2 = 8 mvn\:org.apache.karaf.service/org.apache.karaf.service.guard/3.0.1 = 10 diff --git a/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/system.properties b/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/system.properties new file mode 100644 index 0000000000..a312d66ad5 --- /dev/null +++ b/opendaylight/distribution/opendaylight-karaf/src/main/resources/etc/system.properties @@ -0,0 +1,109 @@ +# +# The properties defined in this file will be made available through system +# properties at the very beginning of the Karaf's boot process. +# + +# Use Equinox as default OSGi Framework Implementation +karaf.framework=equinox + +# https://bugs.eclipse.org/bugs/show_bug.cgi?id=325578 +# Extend the framework to avoid the resources to be presented with +# a URL of type bundleresource: but to be presented as file: +osgi.hook.configurators.include=org.eclipse.virgo.kernel.equinox.extensions.hooks.ExtensionsHookConfigurator + + +# Log level when the pax-logging service is not available +# This level will only be used while the pax-logging service bundle +# is not fully available. +# To change log levels, please refer to the org.ops4j.pax.logging.cfg file +# instead. +org.ops4j.pax.logging.DefaultServiceLog.level = ERROR + +# +# Name of this Karaf instance. +# +karaf.name = root + +# +# Default repository where bundles will be loaded from before using +# other Maven repositories. For the full Maven configuration, see +# the org.ops4j.pax.url.mvn.cfg file. +# +karaf.default.repository = system + +# +# Location of a shell script that will be run when starting a shell +# session. This script can be used to create aliases and define +# additional commands. +# +karaf.shell.init.script = ${karaf.etc}/shell.init.script + +# +# Sets the maximum size of the shell command history. If not set, +# defaults to 500 entries. Setting to 0 will disable history. +# +# karaf.shell.history.maxSize = 0 + +# +# Deletes the entire karaf.data directory at every start +# +karaf.clean.all = false + +# +# Deletes the karaf.data/cache directory at every start +# +karaf.clean.cache = false + +# +# Roles to use when logging into a local Karaf console. +# +# The syntax is the following: +# [classname:]principal +# where classname is the class name of the principal object +# (defaults to org.apache.karaf.jaas.modules.RolePrincipal) +# and principal is the name of the principal of that class +# (defaults to instance). +# +karaf.local.roles = admin,manager,viewer + +# +# Set this empty property to avoid errors when validating xml documents. +# +xml.catalog.files = + +# +# Suppress the bell in the console when hitting backspace too many times +# for example +# +jline.nobell = true + +# +# ServiceMix specs options +# +org.apache.servicemix.specs.debug = false +org.apache.servicemix.specs.timeout = 0 + +# +# Settings for the OSGi 4.3 Weaving +# By default, we will not weave any classes. Change this setting to include classes +# that you application needs to have woven. +# +org.apache.aries.proxy.weaving.enabled = none +# Classes not to weave - Aries default + Xerces which is known to have issues. +org.apache.aries.proxy.weaving.disabled = org.objectweb.asm.*,org.slf4j.*,org.apache.log4j.*,javax.*,org.apache.xerces.* + +# +# By default, only Karaf shell commands are secured, but additional services can be +# secured by expanding this filter +# +karaf.secured.services = (&(osgi.command.scope=*)(osgi.command.function=*)) + +# +# Security properties +# +# To enable OSGi security, uncomment the properties below, +# install the framework-security feature and restart. +# +#java.security.policy=${karaf.etc}/all.policy +#org.osgi.framework.security=osgi +#org.osgi.framework.trust.repositories=${karaf.etc}/trustStore.ks diff --git a/pom.xml b/pom.xml index 8ad038763c..a26533819c 100644 --- a/pom.xml +++ b/pom.xml @@ -32,6 +32,7 @@ opendaylight/hosttracker_new/implementation opendaylight/containermanager/api opendaylight/containermanager/implementation + opendaylight/containermanager/shell opendaylight/appauth opendaylight/switchmanager/api opendaylight/switchmanager/implementation @@ -126,6 +127,7 @@ features/base + features/controller opendaylight/dummy-console opendaylight/karaf-branding opendaylight/distribution/opendaylight-karaf -- 2.36.6