You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2014/01/09 21:24:59 UTC

[1/2] git commit: [KARAF-2433] Add cave:repository-destroy command

Updated Branches:
  refs/heads/master cd86ef14d -> 11f8946d7


[KARAF-2433] Add cave:repository-destroy command


Project: http://git-wip-us.apache.org/repos/asf/karaf-cave/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-cave/commit/636c1095
Tree: http://git-wip-us.apache.org/repos/asf/karaf-cave/tree/636c1095
Diff: http://git-wip-us.apache.org/repos/asf/karaf-cave/diff/636c1095

Branch: refs/heads/master
Commit: 636c1095425c20c742e3399747a231d0fdc54c7c
Parents: cd86ef1
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Thu Jan 9 21:21:49 2014 +0100
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Thu Jan 9 21:23:34 2014 +0100

----------------------------------------------------------------------
 .../command/RepositoryDestroyCommand.java       | 40 ++++++++++++++++++++
 .../OSGI-INF/blueprint/cave-server-commands.xml |  5 +++
 2 files changed, 45 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-cave/blob/636c1095/server/command/src/main/java/org/apache/karaf/cave/server/command/RepositoryDestroyCommand.java
----------------------------------------------------------------------
diff --git a/server/command/src/main/java/org/apache/karaf/cave/server/command/RepositoryDestroyCommand.java b/server/command/src/main/java/org/apache/karaf/cave/server/command/RepositoryDestroyCommand.java
new file mode 100644
index 0000000..d5259bf
--- /dev/null
+++ b/server/command/src/main/java/org/apache/karaf/cave/server/command/RepositoryDestroyCommand.java
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.karaf.cave.server.command;
+
+import org.apache.felix.gogo.commands.Argument;
+import org.apache.felix.gogo.commands.Command;
+
+/**
+ * Destroy a Cave repository
+ */
+@Command(scope = "cave", name = "repository-destroy", description = "Destroy a Cave repository from the registry, including delete of storage")
+public class RepositoryDestroyCommand extends CaveRepositoryCommandSupport {
+
+    @Argument(index = 0, name = "name", description = "The name of the repository", required = true, multiValued = false)
+    String name = null;
+
+    protected Object doExecute() throws Exception {
+        if (getCaveRepositoryService().getRepository(name) == null) {
+            System.err.println("Cave repository " + name + " doesn't exist");
+            return null;
+        }
+        getCaveRepositoryService().destroy(name);
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/karaf-cave/blob/636c1095/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml
----------------------------------------------------------------------
diff --git a/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml b/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml
index 193c6ed..21583a4 100644
--- a/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml
+++ b/server/command/src/main/resources/OSGI-INF/blueprint/cave-server-commands.xml
@@ -32,6 +32,11 @@
                 <property name="caveRepositoryService" ref="caveRepositoryService"/>
             </action>
         </command>
+        <command name="cave/repository-destroy">
+            <action class="org.apache.karaf.cave.server.command.RepositoryDestroyCommand">
+                <property name="CaveRepositoryService" ref="caveRepositoryService"/>
+            </action>
+        </command>
         <command name="cave/repository-uninstall">
             <action class="org.apache.karaf.cave.server.command.RepositoryUninstallCommand">
                 <property name="caveRepositoryService" ref="caveRepositoryService"/>


[2/2] git commit: [KARAF-2433] Add cave:repository-destroy command

Posted by jb...@apache.org.
[KARAF-2433] Add cave:repository-destroy command


Project: http://git-wip-us.apache.org/repos/asf/karaf-cave/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf-cave/commit/11f8946d
Tree: http://git-wip-us.apache.org/repos/asf/karaf-cave/tree/11f8946d
Diff: http://git-wip-us.apache.org/repos/asf/karaf-cave/diff/11f8946d

Branch: refs/heads/master
Commit: 11f8946d7a34bb3ef86a6df4a78abf0f29ccd335
Parents: 636c109
Author: Jean-Baptiste Onofré <jb...@apache.org>
Authored: Thu Jan 9 21:21:49 2014 +0100
Committer: Jean-Baptiste Onofré <jb...@apache.org>
Committed: Thu Jan 9 21:24:35 2014 +0100

----------------------------------------------------------------------
 .gitignore | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf-cave/blob/11f8946d/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index e45abe8..169ddd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,7 @@
+*.i??
+.idea
+.project
+.classpath
+.settings
 target
-*.i??
\ No newline at end of file
+eclipse-classes