Class PolicyMerger


  • public final class PolicyMerger
    extends Object
    Merge policies and return the effective policy. WS-PolicyAttachment defines a merge algorithm for WSDL 1.1 policy attachments.
    • Method Detail

      • getMerger

        public static PolicyMerger getMerger()
        Factory method for obtaining thread-safe policy merger instance.
        Returns:
        policy merger instance.
      • merge

        public Policy merge​(Collection<Policy> policies)
        Takes collection of policies and merges them into a single policy using algorithm described in WS-PolicyAttachment specification. None of the original policies in the collection are modified in any way. The newly created policy has an ID that is a concatentation of all merged policy IDs.
        Parameters:
        policies - collection of policies to be merged. The collection must not contain 'null' elements!
        Returns:
        merged policy containing combination of policy alternatives stored in all input policies. If provided collection of policies is null or empty, returns null. If provided collection of policies contains only single policy, the policy is returned.