Class DelegatingPolicyContextHandler

  • All Implemented Interfaces:
    javax.security.jacc.PolicyContextHandler

    public class DelegatingPolicyContextHandler
    extends Object
    implements javax.security.jacc.PolicyContextHandler
    A PolicyContextHandler which delegates to a preferred implementation if we have a SecurityIdentity, otherwise it falls back to an alternative.
    Author:
    Darran Lofthouse
    • Field Detail

      • key

        private final String key
      • preferred

        private final javax.security.jacc.PolicyContextHandler preferred
      • fallBack

        private final javax.security.jacc.PolicyContextHandler fallBack
    • Constructor Detail

      • DelegatingPolicyContextHandler

        public DelegatingPolicyContextHandler​(String key,
                                              javax.security.jacc.PolicyContextHandler preferred,
                                              javax.security.jacc.PolicyContextHandler fallBack)
    • Method Detail

      • supports

        public boolean supports​(String key)
                         throws javax.security.jacc.PolicyContextException
        Specified by:
        supports in interface javax.security.jacc.PolicyContextHandler
        Throws:
        javax.security.jacc.PolicyContextException
      • getKeys

        public String[] getKeys()
                         throws javax.security.jacc.PolicyContextException
        Specified by:
        getKeys in interface javax.security.jacc.PolicyContextHandler
        Throws:
        javax.security.jacc.PolicyContextException
      • getContext

        public Object getContext​(String key,
                                 Object data)
                          throws javax.security.jacc.PolicyContextException
        Specified by:
        getContext in interface javax.security.jacc.PolicyContextHandler
        Throws:
        javax.security.jacc.PolicyContextException