Fix packaging for shiro bundle
[aaa.git] / aaa-cli / src / main / java / org / opendaylight / aaa / cli / dmstore / RemoveDomain.java
index a2a64235771594f87d667e1eb43f43bb30744dbe..4f72ed47db6c68c63c2d4b2f13eab73d61f0b413 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Inocybe Technologies. and others.  All rights reserved.
+ * Copyright (c) 2016, 2017 Inocybe Technologies. 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,
@@ -10,11 +10,11 @@ package org.opendaylight.aaa.cli.dmstore;
 
 import org.apache.karaf.shell.commands.Command;
 import org.apache.karaf.shell.commands.Option;
-import org.apache.karaf.shell.console.OsgiCommandSupport;
 import org.opendaylight.aaa.api.IIDMStore;
 import org.opendaylight.aaa.cli.AaaCliAbstractCommand;
 import org.opendaylight.aaa.cli.utils.CliUtils;
 import org.opendaylight.aaa.cli.utils.DataStoreUtils;
+import org.opendaylight.aaa.shiro.idm.IdmLightProxy;
 
 @Command(name = "remove-domain", scope = "aaa", description = "Remove domain.")
 
@@ -24,11 +24,8 @@ import org.opendaylight.aaa.cli.utils.DataStoreUtils;
  */
 public class RemoveDomain extends AaaCliAbstractCommand {
 
-    @Option(name = "-name",
-            aliases = { "--domainName" },
-            description = "The domain name",
-            required = true,
-            multiValued = false)
+    @Option(name = "-name", aliases = {
+            "--domainName" }, description = "The domain name", required = true, multiValued = false)
     private String domainName = "";
 
     public RemoveDomain(final IIDMStore identityStore) {
@@ -47,6 +44,7 @@ public class RemoveDomain extends AaaCliAbstractCommand {
         if (identityStore.deleteDomain(domainId) == null) {
             return "Failed to delete domain " + domainName;
         }
+        IdmLightProxy.clearClaimCache();
         return "Domain " + domainName + "has been deleted.";
     }
 }