本文整理了Java中org.wso2.carbon.registry.core.Resource.removeProperty
方法的一些代码示例,展示了Resource.removeProperty
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Resource.removeProperty
方法的具体详情如下:
包路径:org.wso2.carbon.registry.core.Resource
类名称:Resource
方法名:removeProperty
暂无
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions
public void dissociate(RequestContext context) {
Resource resource = context.getResource();
if (resource != null) {
resource.removeProperty(stateProperty);
resource.removeProperty(lifecycleProperty);
}
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions
@Override
public void dissociate(RequestContext requestContext) {
Resource resource = requestContext.getResource();
if (resource != null) {
resource.removeProperty(stateProperty);
resource.removeProperty(lifecycleProperty);
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
public void dissociate(RequestContext context) {
Resource resource = context.getResource();
if (resource != null) {
resource.removeProperty(stateProperty);
resource.removeProperty(lifecyleProperty);
}
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions
public static void clearTransitionApprovals(Resource resource, String aspectName) {
Properties properties = (Properties) resource.getProperties().clone();
for (Object o : properties.keySet()) {
String key = (String) o;
if (key.startsWith(LifecycleConstants.REGISTRY_CUSTOM_LIFECYCLE_VOTES_OPTION + aspectName)) {
resource.removeProperty(key);
} else if (key.startsWith(LifecycleConstants.REGISTRY_CUSTOM_LIFECYCLE_USER_VOTE + aspectName)) {
resource.removeProperty(key);
}
}
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions
public static void clearCheckItems(Resource resource, String aspectName){
Properties properties = (Properties) resource.getProperties().clone();
for (Object o : properties.keySet()) {
String key = (String) o;
if(key.startsWith(LifecycleConstants.REGISTRY_CUSTOM_LIFECYCLE_CHECKLIST_OPTION + aspectName +
LifecycleConstants.DOT)){
resource.removeProperty(key);
}
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
public void dissociate(RequestContext context) {
context.getResource().removeProperty(PHASE_PROPERTY);
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions
/**
* This method is used to update checkpoint current state duration information.
*
* @param resource registry resource.
* @param nextState next lifecycle state.
* @throws RegistryException
*/
private void updateCheckpointProperties(Resource resource, String nextState)
throws RegistryException {
String checkpointProperty = LifecycleConstants.REGISTRY_LIFECYCLE + aspectName + LifecycleConstants.CHECKPOINT;
List<String> checkpoints = resource.getPropertyValues(checkpointProperty);
if (checkpoints != null && !checkpoints.isEmpty()) {
for (String checkpoint : checkpoints) {
resource.removeProperty(checkpointProperty + LifecycleConstants.DOT + checkpoint);
}
}
resource.removeProperty(checkpointProperty);
addCheckPointProperties(resource, nextState);
}
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions
public static void addTransitionUI(Resource resource,Map<String,String> transitionUI, String aspectName){
List<String> tobeRemoved = new ArrayList<String>();
Properties properties = resource.getProperties();
for (Object key : properties.keySet()) {
if(key.toString().startsWith(LifecycleConstants.REGISTRY_CUSTOM_LIFECYCLE_CHECKLIST_TRANSITION_UI + aspectName)){
tobeRemoved.add(key.toString());
}
}
for (String key : tobeRemoved) {
resource.removeProperty(key);
}
if (transitionUI != null) {
for (Map.Entry<String, String> entry : transitionUI.entrySet()) {
resource.setProperty(
LifecycleConstants.REGISTRY_CUSTOM_LIFECYCLE_CHECKLIST_TRANSITION_UI + aspectName + "." + entry.getKey()
,entry.getValue());
}
}
}
代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.mashup.javascript.hostobjects.registry
public static void jsFunction_removeProperty(Context cx, Scriptable thisObj, Object[] arguments,
Function funObj) throws CarbonException {
ResourceHostObject resourceHostObject = (ResourceHostObject) thisObj;
if (arguments.length == 1) {
if (arguments[0] instanceof String) {
resourceHostObject.resource.removeProperty((String) arguments[0]);
} else {
throw new CarbonException("Invalid argument type for removeProperty() method");
}
} else {
throw new CarbonException("Invalid no. of arguments for removeProperty() method");
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.core
/**
* @param parameterDO
* @throws IdentityException
*/
public void removeParameter(ParameterDO parameterDO) throws IdentityException {
String path = null;
Resource resource = null;
if (log.isDebugEnabled()) {
log.debug("Removing parameter");
}
try {
path = IdentityRegistryResources.CARD_ISSUER;
if (registry.resourceExists(path)) {
resource = registry.get(path);
if (resource != null) {
resource.removeProperty(parameterDO.getName());
registry.put(path, resource);
}
}
} catch (RegistryException e) {
log.error("Error while removing parameter", e);
throw IdentityException.error("Error while removing parameter", e);
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.cmis
/**
* Remove a property from a GREG node
*/
public static void removeProperty(Registry repository,Resource resource, PropertyData<?> propertyData) throws RegistryException {
String id = propertyData.getId();
if(resource.getPropertyValues(id) != null ){ //has property
resource.removeProperty(id);
repository.put(resource.getPath(), resource);
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.jcr
public static void removeRetentionPolicies(RegistrySession session) throws RepositoryException {
try {
if(session.getUserRegistry().resourceExists("/jcr_system/workspaces/default_workspace/testroot")) {
Resource r = session.getUserRegistry().get("/jcr_system/workspaces/default_workspace/testroot");
r.removeProperty("org.wso2.carbon.registry.jcr.retention.policy");
r.removeProperty("org.wso2.carbon.registry.jcr.retention.holds");
session.getUserRegistry().put(r.getPath(),r);
}
} catch (RegistryException e) {
throw new RepositoryException("Unable to remove TCK retention test data");
}
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.jcr
public static void removeRetentionPolicyFromRegistry(RegistrySession session, String s) throws RepositoryException {
Resource resource = null;
try {
resource = session.getUserRegistry().get(s);
resource.removeProperty("org.wso2.carbon.registry.jcr.retention.policy");
session.getUserRegistry().put(s, resource);
} catch (RegistryException e) {
throw new RepositoryException("Registry level exception when setting retention policy at " + s);
}
}
代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.security.mgt
private void removeTrustedService(String groupName, String serviceName, String trustedService)
throws SecurityConfigException {
Registry registry;
String resourcePath;
Resource resource;
try {
resourcePath = RegistryResources.SERVICE_GROUPS + groupName
+ RegistryResources.SERVICES + serviceName + "/trustedServices";
registry = getConfigSystemRegistry(); //TODO: Multitenancy
if (registry != null && registry.resourceExists(resourcePath)) {
resource = registry.get(resourcePath);
if (resource.getProperty(trustedService) != null) {
resource.removeProperty(trustedService);
}
registry.put(resourcePath, resource);
}
} catch (Exception e) {
log.error("Error occured while removing trusted service for STS", e);
throw new SecurityConfigException("Error occured while adding trusted service for STS",
e);
}
}
代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.security.mgt
private void removeTrustedService(String groupName, String serviceName, String trustedService)
throws SecurityConfigException {
Registry registry;
String resourcePath;
Resource resource;
try {
resourcePath = RegistryResources.SERVICE_GROUPS + groupName
+ RegistryResources.SERVICES + serviceName + "/trustedServices";
registry = getConfigSystemRegistry(); //TODO: Multitenancy
if (registry != null && registry.resourceExists(resourcePath)) {
resource = registry.get(resourcePath);
if (resource.getProperty(trustedService) != null) {
resource.removeProperty(trustedService);
}
registry.put(resourcePath, resource);
}
} catch (Exception e) {
log.error("Error occured while removing trusted service for STS", e);
throw new SecurityConfigException("Error occured while adding trusted service for STS",
e);
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.extensions
public void removeProperty(String path, String key) {
try {
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
Resource resource = registry.get(path);
resource.removeProperty(key);
registry.put(path, resource);
} catch (RegistryException e) {
String msg = "Unable to remove property.";
log.error(msg, e);
// we are unable to throw a customized exception or an exception with the cause or if
// not, JConsole needs additional Jars to marshall exceptions.
throw new RuntimeException(Utils.buildMessageForRuntimeException(e, msg));
} finally {
PrivilegedCarbonContext.endTenantFlow();
}
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.jcr
public void removeVersionLabel(String s) throws VersionException, RepositoryException {
try {
Resource res = ((RegistrySession) session).getUserRegistry().get(
RegistryJCRSpecificStandardLoderUtil.
getSystemConfigVersionLabelPath((RegistrySession) session));
if (res.getProperty(s) != null) {
res.removeProperty(s);
}
((RegistrySession) session).getUserRegistry().put(RegistryJCRSpecificStandardLoderUtil.
getSystemConfigVersionLabelPath((RegistrySession) session), res);
} catch (RegistryException e) {
throw new RepositoryException("Exception occurred in registry level " + s);
}
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.properties
/**
* Method to remove property.
*
* @param path path of the resource.
* @param name property name.
*
* @throws RegistryException throws if there is an error.
*/
public void removeProperty(String path, String name) throws RegistryException {
UserRegistry registry = (UserRegistry) getRootRegistry();
if (RegistryUtils.isRegistryReadOnly(registry.getRegistryContext())) {
return;
}
Resource resource = registry.get(path);
resource.removeProperty(name);
registry.put(resource.getPath(), resource);
resource.discard();
}
代码示例来源:origin: org.wso2.carbon.registry/org.wso2.carbon.registry.jcr
public void remove() throws VersionException, LockException, ConstraintViolationException, AccessDeniedException, RepositoryException {
RegistryJCRItemOperationUtil.validateReadOnlyItemOpr(session);
RegistryJCRItemOperationUtil.checkRetentionPolicy(session, getNodePath());
RegistryJCRItemOperationUtil.checkRetentionHold(session, getNodePath());
try {
if (isResource) {
session.getUserRegistry().delete(path);
} else {
Resource node = session.getUserRegistry().get(path);
node.removeProperty(name);
session.getUserRegistry().put(path, node);
}
} catch (RegistryException e) {
String msg = "failed to remove the property " + this;
log.debug(msg);
throw new RepositoryException(msg, e);
}
}
代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.eventing.impl
/**
* Update the topic index by holding the thread
*
* @param mode Insert | Delete
* @param id subscription id
* @param topic topic name
* @throws Exception RegistryException
*/
private synchronized void updateTopicIndex(boolean mode, String id, String topic)
throws RegistryException {
if (mode) {
resTopicIndex = registry.get(getTopicIndexPath());
resTopicIndex.addProperty(id, topic + "/" + SUBSCRIPTION_COLLECTION_NAME);
registry.put(getTopicIndexPath(), resTopicIndex);
} else {
resTopicIndex = registry.get(getTopicIndexPath());
resTopicIndex.removeProperty(id);
registry.put(getTopicIndexPath(), resTopicIndex);
}
}
内容来源于网络,如有侵权,请联系作者删除!