|
|
|
@ -232,11 +232,11 @@ public abstract class AbstractResourceManager {
|
|
|
|
|
LOG_PREFIX,
|
|
|
|
|
"[BIND-SCOPE-ENTER] Adding " + this.getType() + " " + this.getID() + " to scope [" +
|
|
|
|
|
targetScope.toString() + "]");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
System.out.println("***\n\n[BIND-SCOPE-ENTER] Adding " + this.getType() + " " + this.getID() + " to scope [" +
|
|
|
|
|
targetScope.toString() + "]");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
targetScope.toString() + "]");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String curr = ScopeProvider.instance.get();
|
|
|
|
|
ScopeProvider.instance.set(targetScope.toString());
|
|
|
|
|
|
|
|
|
@ -261,7 +261,7 @@ public abstract class AbstractResourceManager {
|
|
|
|
|
} else
|
|
|
|
|
ScopeProvider.instance.set(targetScope);
|
|
|
|
|
System.out.println("***\n\nCalling manager.addResources(addParam) addParam.toString()=" + addParam.toString());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String reportID = manager.addResources(addParam);
|
|
|
|
|
|
|
|
|
|
ServerConsole.trace(
|
|
|
|
@ -270,8 +270,8 @@ public abstract class AbstractResourceManager {
|
|
|
|
|
targetScope.toString() + "]... reportID: " + reportID);
|
|
|
|
|
|
|
|
|
|
System.out.println("***\n\n[BIND-SCOPE-EXIT] Applyed Adding " + this.getType() + " " + this.getID() + " to scope [" +
|
|
|
|
|
targetScope.toString() + "]... reportID: " + reportID);
|
|
|
|
|
|
|
|
|
|
targetScope.toString() + "]... reportID: " + reportID);
|
|
|
|
|
|
|
|
|
|
RMReportingLibrary pt = this.getReportResourceManager(scope.toString());
|
|
|
|
|
|
|
|
|
|
String toReturn = pt.getReport(reportID);
|
|
|
|
@ -485,6 +485,7 @@ public abstract class AbstractResourceManager {
|
|
|
|
|
* @param nestingRemoval true for resources different from gHN and RI
|
|
|
|
|
*/
|
|
|
|
|
public final String removeFromScope(final ScopeBean scope) throws AbstractResourceException {
|
|
|
|
|
ServerConsole.trace(LOG_PREFIX, "[BASIC-FROM-SCOPE] Removing from scope [" + scope.toString() + "] " + this.getType() + " " + this.getID());
|
|
|
|
|
Assertion<AbstractResourceException> checker = new Assertion<AbstractResourceException>();
|
|
|
|
|
checker.validate(scope != null, new ResourceParameterException("Invalid parameter scope. null not allowed."));
|
|
|
|
|
checker.validate(this.getID() != null, new ResourceOperationException("Invalid ID. null not allowed."));
|
|
|
|
@ -557,14 +558,17 @@ public abstract class AbstractResourceManager {
|
|
|
|
|
|
|
|
|
|
ServerConsole.trace(LOG_PREFIX, "[DELETE] " + this.getType() + " " + this.getID() + " is bound to (" + boundedScopes.size() + ") scopes");
|
|
|
|
|
|
|
|
|
|
if (boundedScopes.size() > 1)
|
|
|
|
|
if (boundedScopes.size() > 1) {
|
|
|
|
|
ServerConsole.trace(LOG_PREFIX, "[DELETE] [DELETE-BRANCH] deleting resource is a remove from scope since more than 1 scope is present " + resStub.id());
|
|
|
|
|
else if (boundedScopes.size() == 1)
|
|
|
|
|
this.basicRemoveFromScope(scope);
|
|
|
|
|
}
|
|
|
|
|
else if (boundedScopes.size() == 1) {
|
|
|
|
|
ServerConsole.trace(LOG_PREFIX, "[DELETE] [DELETE-BRANCH] deleting resource since is bound to 1 scope only " + resStub.id());
|
|
|
|
|
try {
|
|
|
|
|
this.getRegistryPublisher().remove(resStub);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ScopeProvider.instance.set(currScope);
|
|
|
|
|
try {
|
|
|
|
|
this.getRegistryPublisher().remove(resStub);
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
ScopeProvider.instance.set(currScope);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ScopeProvider.instance.set(currScope);
|
|
|
|
|
}
|
|
|
|
|