本文整理了Java中org.wso2.carbon.registry.core.Registry.delete
方法的一些代码示例,展示了Registry.delete
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Registry.delete
方法的具体详情如下:
包路径:org.wso2.carbon.registry.core.Registry
类名称:Registry
方法名:delete
暂无
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.reporting
public void deleteSavedReport(String name)
throws RegistryException {
getConfigSystemRegistry().delete(REPORTING_CONFIG_PATH +
RegistryConstants.PATH_SEPARATOR + name);
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis
/**
* 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);
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
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);
}
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.core
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);
}
}
代码示例来源:origin: org.wso2.carbon.appmgt/org.wso2.carbon.appmgt.impl
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;
}
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.core
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);
}
}
代码示例来源:origin: wso2/carbon-identity-framework
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);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.mgt
/**
* 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());
}
}
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.entitlement
@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");
}
}
代码示例来源:origin: wso2/carbon-identity-framework
@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");
}
}
代码示例来源:origin: wso2/carbon-identity-framework
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);
}
}
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
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());
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
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);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement
@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");
}
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.entitlement
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);
}
}
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.identity.entitlement
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);
}
}
代码示例来源:origin: wso2/carbon-identity-framework
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);
}
}
代码示例来源:origin: org.wso2.carbon.analytics/org.wso2.carbon.analytics.dashboard
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);
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
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());
}
}
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.api
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);
}
}
内容来源于网络,如有侵权,请联系作者删除!