import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.commands.Option;
-import org.opendaylight.aaa.api.IIDMStore;
+import org.opendaylight.aaa.api.ClaimCache;
+import org.opendaylight.aaa.api.password.service.PasswordHashService;
import org.opendaylight.aaa.cli.AaaCliAbstractCommand;
import org.opendaylight.aaa.cli.utils.CliUtils;
import org.opendaylight.aaa.cli.utils.DataStoreUtils;
-import org.opendaylight.aaa.impl.shiro.idm.IdmLightProxy;
@Command(name = "remove-role", scope = "aaa", description = "Remove role.")
*/
public class RemoveRole extends AaaCliAbstractCommand {
+ private final ClaimCache claimCache;
+
@Option(name = "-name", aliases = {
"--roleName" }, description = "The role name", required = true, multiValued = false)
- private final String roleName = "";
+ private String roleName;
- public RemoveRole(final IIDMStore identityStore) {
- super(identityStore);
+ public RemoveRole(final ClaimCache claimCache, final PasswordHashService passwordService) {
+ super(passwordService);
+ this.claimCache = claimCache;
}
@Override
if (identityStore.deleteRole(roleId) == null) {
return "Failed to delete role " + roleName;
}
- IdmLightProxy.clearClaimCache();
+ claimCache.clear();
return "Role " + roleName + "has been deleted.";
}
}