本文整理汇总了Java中org.apache.neethi.Policy.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Policy.getName方法的具体用法?Java Policy.getName怎么用?Java Policy.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.neethi.Policy
的用法示例。
在下文中一共展示了Policy.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setPolicy
import org.apache.neethi.Policy; //导入方法依赖的package包/类
/**
* @param policy
* @see org.apache.axis2.description.PolicySubject#attachPolicy(Policy)
* @see org.apache.axis2.description.PolicySubject#clear()
* @deprecated As of 1.4 release, replaced by
* {@link PolicySubject #attachPolicy(Policy)} Use
* {@link PolicySubject #clear()} beforehand effective policy of
* {@link AxisDescription} has to be set as the argument.
*
*/
public void setPolicy(Policy policy) {
wrapperElements.clear();
if (policy.getName() == null && policy.getId() == null) {
policy.setId(UIDGenerator.generateUID());
}
Wrapper wrapper = new Wrapper(PolicyInclude.ANON_POLICY, policy);
if (policy.getName() != null) {
wrapperElements.put(policy.getName(), wrapper);
} else {
wrapperElements.put(policy.getId(), wrapper);
}
if (description != null) {
description.getPolicySubject().clear();
description.getPolicySubject().attachPolicy(policy);
}
}
示例2: updatePolicy
import org.apache.neethi.Policy; //导入方法依赖的package包/类
/**
* @deprecated As of 1.4 release, replaced by
* {@link PolicySubject #updatePolicy(Policy)}.
*/
public void updatePolicy(Policy policy) {
String key;
if ((key = policy.getName()) == null && (key = policy.getId()) == null) {
// TODO throw more meaningful exception ..
throw new RuntimeException("policy doesn't have a name or an id ");
}
Wrapper wrapper = (Wrapper) wrapperElements.get(key);
wrapper.value = policy;
if (description != null) {
description.getPolicySubject().updatePolicy(policy);
}
}
示例3: addPolicyElement
import org.apache.neethi.Policy; //导入方法依赖的package包/类
/**
* @deprecated As of 1.4 release, replaced by
* {@link PolicySubject #attachPolicy(Policy)}
*/
public void addPolicyElement(int type, Policy policy) {
String key;
if ((key = policy.getName()) == null && (key = policy.getId()) == null) {
policy.setId(UIDGenerator.generateUID());
}
key = (policy.getName() != null) ? policy.getName() : policy.getId();
Wrapper wrapper = new Wrapper(type, policy);
wrapperElements.put(key, wrapper);
reg.register(key, policy);
if (description != null) {
description.getPolicySubject().attachPolicy(policy);
}
}
示例4: attachPolicy
import org.apache.neethi.Policy; //导入方法依赖的package包/类
public void attachPolicy(Policy policy) {
String key = policy.getName();
if (key == null) {
key = policy.getId();
if (key == null) {
key = UIDGenerator.generateUID();
policy.setId(key);
}
}
attachPolicyComponent(key, policy);
}
示例5: updatePolicy
import org.apache.neethi.Policy; //导入方法依赖的package包/类
public void updatePolicy(Policy policy) {
String key = (policy.getName() != null) ? policy.getName() : policy
.getId();
if (key == null) {
throw new IllegalArgumentException(
"policy doesn't have a name or an id ");
}
attachedPolicyComponents.put(key, policy);
setLastUpdatedTime(new Date());
if (!isUpdated()) {
setUpdated(true);
}
}
示例6: createPolicyReference
import org.apache.neethi.Policy; //导入方法依赖的package包/类
public static PolicyReference createPolicyReference(Policy policy) {
PolicyReference policyReference = new PolicyReference();
String key = policy.getName();
if (key == null) {
key = policy.getId();
if (key == null) {
key = UIDGenerator.generateUID();
policy.setId(key);
}
policyReference.setURI("#" + key);
} else {
policyReference.setURI(key);
}
return policyReference;
}