public void deleteSavedReport(String name) throws RegistryException { getConfigSystemRegistry().delete(REPORTING_CONFIG_PATH + RegistryConstants.PATH_SEPARATOR + name); }
/** * See CMIS 1.0 section 2.2.4.14 deleteObject * * @throws CmisRuntimeException */ public void delete(boolean allVersions, boolean isPwc) { try { String path = resource.getPath(); repository.delete(path); } catch (RegistryException e) { String msg = "Failed to delete the object "; log.error(msg, e); throw new CmisRuntimeException(msg, e); } }
private void deleteChildRecursively(String path,Registry registry) throws RegistryException { Resource currentResource = registry.get(path); if((currentResource instanceof Collection) && ((Collection)currentResource).getChildCount() == 0 ){ String[] childPaths = ((Collection)currentResource).getChildren(); for (String childPath : childPaths) { deleteChildRecursively(childPath,registry); } registry.delete(path); } else { registry.delete(path); } } }
public void removeOpenIDSignUp(String openID) { try { if (registry.resourceExists(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID))) { registry.delete(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID)); } } catch (RegistryException e) { log.error("Error Removing the OpenID", e); } }
public boolean unSubscribeMobileApp(String userId, String appId) throws AppManagementException { String path = "users/" + userId + "/subscriptions/mobileapp/" + appId; boolean isUnSubscribed = false; try { if (registry.resourceExists(path)) { registry.delete(path); isUnSubscribed = true; } } catch (org.wso2.carbon.registry.api.RegistryException e) { handleException("Error occurred while removing subscription registry resource for mobileapp with id :" + appId, e); } return isUnSubscribed; }
public void removeOpenIDSignUp(String openID) { try { if (registry.resourceExists(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID))) { registry.delete(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID)); } } catch (RegistryException e) { log.error("Error Removing the OpenID", e); } }
public void removeOpenIDSignUp(String openID) { try { if (registry.resourceExists(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID))) { registry.delete(IdentityRegistryResources.OPENID_SIGN_UP + getOpenIdModified(openID)); } } catch (RegistryException e) { log.error("Error Removing the OpenID", e); } }
/** * Check if resource has expired and delete. * * @param registry Registry instance to use. * @param resourcePath Path of resource to be deleted. * @throws RegistryException */ private static void checkAndDeleteRegistryResource (Registry registry, String resourcePath) throws RegistryException { Resource resource = registry.get(resourcePath); long currentEpochTime = System.currentTimeMillis(); long resourceExpireTime = Long.parseLong(resource.getProperty(EXPIRE_TIME_PROPERTY)); if (currentEpochTime > resourceExpireTime) { registry.delete(resource.getId()); } }
@Override public void removePolicyData(String policyId) throws EntitlementException { Registry registry = getGovernanceRegistry(); try { String path = policyDataCollection + policyId; if (registry.resourceExists(path)) { registry.delete(path); } } catch (RegistryException e) { log.error("Error while deleting Policy data in policy store ", e); throw new EntitlementException("Error while deleting Policy data in policy store"); } }
@Override public void removePolicyData(String policyId) throws EntitlementException { Registry registry = getGovernanceRegistry(); try { String path = policyDataCollection + policyId; if (registry.resourceExists(path)) { registry.delete(path); } } catch (RegistryException e) { log.error("Error while deleting Policy data in policy store ", e); throw new EntitlementException("Error while deleting Policy data in policy store"); } }
private void deleteResource(String resource) throws RegistryException { registry.beginTransaction(); // Check whether the resource still exists for concurrent cases. if (registry.resourceExists(resource)) { registry.delete(resource); registry.commitTransaction(); } else { // Already deleted by another thread. Do nothing. registry.rollbackTransaction(); if (log.isDebugEnabled()) { log.debug("Confirmation code already deleted in path of resource : " + resource); } } } }
private void deleteRecursively (Registry registry, Resource resource) throws RegistryException { if (resource instanceof Collection) { for(String childResource : ((Collection) resource).getChildren()){ deleteRecursively(registry, registry.get(childResource)); } } registry.delete(resource.getPath()); }
private void deleteRecursively(String path,Registry registry) throws RegistryException { Resource currentResource = registry.get(path); if((currentResource instanceof Collection) && ((Collection)currentResource).getChildCount() == 0 ){ registry.delete(path); deleteRecursively(currentResource.getParentPath(),registry); } }
@Override public void removePolicyData(String policyId) throws EntitlementException { Registry registry = EntitlementServiceComponent. getGovernanceRegistry(CarbonContext.getThreadLocalCarbonContext().getTenantId()); try { String path = policyDataCollection + policyId; if (registry.resourceExists(path)) { registry.delete(path); } } catch (RegistryException e) { log.error("Error while deleting Policy data in policy store ", e); throw new EntitlementException("Error while deleting Policy data in policy store"); } } }
private synchronized void deletedPersistedData(String path) throws EntitlementException { Registry registry = null; int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); try { registry = EntitlementServiceComponent.getRegistryService(). getGovernanceSystemRegistry(tenantId); if (registry.resourceExists(path)) { registry.delete(path); } } catch (RegistryException e) { log.error(e); throw new EntitlementException("Error while persisting policy status", e); } }
private synchronized void deletedPersistedData(String path) throws EntitlementException { Registry registry = null; int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); try { registry = EntitlementServiceComponent.getRegistryService(). getGovernanceSystemRegistry(tenantId); if (registry.resourceExists(path)) { registry.delete(path); } } catch (RegistryException e) { log.error(e); throw new EntitlementException("Error while persisting policy status", e); } }
private synchronized void deletedPersistedData(String path) throws EntitlementException { Registry registry = null; int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); try { registry = EntitlementServiceComponent.getRegistryService(). getGovernanceSystemRegistry(tenantId); if (registry.resourceExists(path)) { registry.delete(path); } } catch (RegistryException e) { log.error(e); throw new EntitlementException("Error while persisting policy status", e); } }
public static void removeRegistryResource(String resourcePath) throws RegistryException { int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); Registry registry = ServiceHolder.getRegistryService().getConfigSystemRegistry(tenantId); if (registry.resourceExists(resourcePath)) { Resource resource = registry.get(resourcePath); registry.delete(resourcePath); } }
private void deleteOldResource(RequestContext context, Resource metaDataResource, WSDLInfo wsdlInfo, String wsdlPath, Resource wsdlResource) throws RegistryException { if(wsdlInfo.isMasterWSDL()){ if (metaDataResource != null) { wsdlResource.setUUID(metaDataResource.getUUID()); } if(!wsdlPath.equals(context.getResourcePath().getPath()) && registry.resourceExists(context.getResourcePath().getPath())){ registry.delete(context.getResourcePath().getPath()); } } }
public static void removeArtifactFromPath(Registry registry, String path) throws GovernanceException { try { if (registry.resourceExists(path)) { deleteLifecycleHistoryFile(path, registry); registry.delete(path); } ArtifactCache artifactCache = ArtifactCacheManager.getCacheManager().getTenantArtifactCache(((UserRegistry) registry).getTenantId()); if (artifactCache != null && path != null && artifactCache.getArtifact(path) != null) { artifactCache.invalidateArtifact(path); } } catch (RegistryException e) { String msg = "Error in deleting the the artifact path:" + path + "."; throw new GovernanceException(msg, e); } }