return cloudServiceConfigs.get(cloudServiceName);
}
public static void setCloudServiceActive(boolean active, String cloudServiceName,
int tenantId)throws Exception {
CloudServiceConfig cloudServiceConfig = getCloudServiceConfig(cloudServiceName);
if (cloudServiceConfig.getLabel() == null) {
// for the non-labeled services, we are not setting/unsetting the service active
return;
}
UserRegistry tenantZeroSystemGovernanceRegistry;
UserRegistry systemConfigRegistry;
try {
tenantZeroSystemGovernanceRegistry = Util.getTenantZeroSystemGovernanceRegistry();
systemConfigRegistry = Util.getSystemConfigRegistry(tenantId);
} catch (RegistryException e) {
String msg = "Error in getting the tenant 0 system config registry";
log.error(msg, e);
throw new Exception(msg, e);
}
String cloudServiceInfoPath =
Constants.CLOUD_SERVICE_INFO_STORE_PATH + RegistryConstants.PATH_SEPARATOR +
tenantId + RegistryConstants.PATH_SEPARATOR + cloudServiceName;
Resource cloudServiceInfoResource;
if (tenantZeroSystemGovernanceRegistry.resourceExists(cloudServiceInfoPath)) {
cloudServiceInfoResource = tenantZeroSystemGovernanceRegistry.get(cloudServiceInfoPath);
} else {
cloudServiceInfoResource = tenantZeroSystemGovernanceRegistry.newCollection();
}
cloudServiceInfoResource.setProperty(Constants.CLOUD_SERVICE_IS_ACTIVE_PROP_KEY,
active ? "true" : "false");
tenantZeroSystemGovernanceRegistry.put(cloudServiceInfoPath, cloudServiceInfoResource);
// then we will copy the permissions
List<PermissionConfig> permissionConfigs = cloudServiceConfig.getPermissionConfigs();
for (PermissionConfig permissionConfig : permissionConfigs) {
String path = permissionConfig.getPath();
String name = permissionConfig.getName();
if (active) {
if (!systemConfigRegistry.resourceExists(path)) {