本文整理汇总了Java中org.apache.neethi.Policy.setId方法的典型用法代码示例。如果您正苦于以下问题:Java Policy.setId方法的具体用法?Java Policy.setId怎么用?Java Policy.setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.neethi.Policy
的用法示例。
在下文中一共展示了Policy.setId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
}
示例3: addPolicyToAllBindings
import org.apache.neethi.Policy; //导入方法依赖的package包/类
public void addPolicyToAllBindings(AxisService axisService, Policy policy)
throws ServerException {
try {
if (policy.getId() == null) {
// Generate an ID
policy.setId(UUIDGenerator.getUUID());
}
Map endPointMap = axisService.getEndpoints();
for (Object o : endPointMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
AxisEndpoint point = (AxisEndpoint) entry.getValue();
AxisBinding binding = point.getBinding();
String bindingName = binding.getName().getLocalPart();
//only UTOverTransport is allowed for HTTP
if (bindingName.endsWith("HttpBinding") &&
(!policy.getAttributes().containsValue("UTOverTransport"))) {
continue;
}
binding.getPolicySubject().attachPolicy(policy);
// Add the new policy to the registry
}
} catch (Exception e) {
log.error("Error in adding security policy to all bindings", e);
throw new ServerException("addPoliciesToService", e);
}
}
示例4: addSecurityPolicyToAllBindings
import org.apache.neethi.Policy; //导入方法依赖的package包/类
/**
* This method add Policy to service at the Registry. Does not add the
* policy to Axis2. To all Bindings available
*
* @param axisService Service
* @param policy Policy
* @throws org.wso2.carbon.utils.ServerException se
*/
public void addSecurityPolicyToAllBindings(AxisService axisService, Policy policy)
throws ServerException {
try {
if (policy.getId() == null) {
policy.setId(UUIDGenerator.getUUID());
}
Map endPointMap = axisService.getEndpoints();
for (Object o : endPointMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
AxisEndpoint point = (AxisEndpoint) entry.getValue();
AxisBinding binding = point.getBinding();
String bindingName = binding.getName().getLocalPart();
//only UTOverTransport is allowed for HTTP
if (bindingName.endsWith("HttpBinding") &&
(!policy.getAttributes().containsValue("UTOverTransport"))) {
continue;
}
binding.getPolicySubject().attachPolicy(policy);
}
} catch (Exception e) {
log.error("Error in adding security policy to all bindings", e);
throw new ServerException("addPoliciesToService", e);
}
}
示例5: addSecurityPolicyToAllBindings
import org.apache.neethi.Policy; //导入方法依赖的package包/类
/**
* This method add Policy to service at the Registry. Does not add the
* policy to Axis2. To all Bindings available
*
* @param axisService Service
* @param policy Policy
* @throws org.wso2.carbon.utils.ServerException se
*/
public void addSecurityPolicyToAllBindings(AxisService axisService, Policy policy)
throws ServerException {
String serviceGroupId = axisService.getAxisServiceGroup().getServiceGroupName();
try {
if (policy.getId() == null) {
policy.setId(UUIDGenerator.getUUID());
}
Map endPointMap = axisService.getEndpoints();
for (Object o : endPointMap.entrySet()) {
Map.Entry entry = (Map.Entry) o;
AxisEndpoint point = (AxisEndpoint) entry.getValue();
AxisBinding binding = point.getBinding();
String bindingName = binding.getName().getLocalPart();
//only UTOverTransport is allowed for HTTP
if (bindingName.endsWith("HttpBinding") &&
(!policy.getAttributes().containsValue("UTOverTransport"))) {
continue;
}
binding.getPolicySubject().attachPolicy(policy);
}
} catch (Exception e) {
log.error("Error in adding security policy to all bindings", e);
throw new ServerException("addPoliciesToService", e);
}
}
示例6: 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);
}
示例7: 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;
}