当前位置: 首页>>代码示例>>Java>>正文


Java Policy.setId方法代码示例

本文整理汇总了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);
}
  }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:30,代码来源:PolicyInclude.java

示例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);
}
  }
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:23,代码来源:PolicyInclude.java

示例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);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:28,代码来源:SecurityDeploymentInterceptor.java

示例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);
    }
}
 
开发者ID:wso2,项目名称:carbon-identity-framework,代码行数:36,代码来源:SecurityServiceAdmin.java

示例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);
    }
}
 
开发者ID:wso2-attic,项目名称:carbon-identity,代码行数:37,代码来源:SecurityServiceAdmin.java

示例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);
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:12,代码来源:PolicySubject.java

示例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;
}
 
开发者ID:wso2,项目名称:wso2-axis2,代码行数:16,代码来源:PolicyUtil.java


注:本文中的org.apache.neethi.Policy.setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。