Package com.sun.xml.ws.policy

Examples of com.sun.xml.ws.policy.PolicyException


            } else {
                mp = _policyContainer.getMessagePolicy(false);
            }
        }catch(PolicyGenerationException ex){
            logger.log(Level.SEVERE,LogStringsMessages.SP_0113_UNABLE_TO_DIGEST_POLICY(effectivePolicy),ex);
            throw new PolicyException("Unable to digest SecurityPolicy ");
        }
        //try{
        if(wssAssertion != null){
            try{
                mp.setWSSAssertion(getWssAssertion((com.sun.xml.ws.security.policy.WSSAssertion) wssAssertion));
            } catch (PolicyGenerationException ex) {
                logger.log(Level.SEVERE,LogStringsMessages.SP_0104_ERROR_SIGNATURE_CONFIRMATION_ELEMENT(ex.getMessage()),ex);
                throw new PolicyException(LogStringsMessages.SP_0104_ERROR_SIGNATURE_CONFIRMATION_ELEMENT(ex.getMessage()));
            }
        }
        if(policyBinding!= null && policyBinding.getAlgorithmSuite() != null){
            mp.setAlgorithmSuite(getAlgoSuite(policyBinding.getAlgorithmSuite()));
        }
        if(policyBinding!= null && policyBinding.getLayout()!= null){
            mp.setLayout(getLayout(policyBinding.getLayout()));
        }
        if(isIncoming && reqElements.size() > 0){
            try {
                com.sun.xml.ws.security.impl.policyconv.RequiredElementsProcessor rep =
                        new com.sun.xml.ws.security.impl.policyconv.RequiredElementsProcessor(reqElements, mp);
                rep.process();
            } catch (PolicyGenerationException ex) {
                logger.log(Level.SEVERE,LogStringsMessages.SP_0103_ERROR_REQUIRED_ELEMENTS(ex.getMessage()),ex);
                throw new PolicyException(LogStringsMessages.SP_0103_ERROR_REQUIRED_ELEMENTS(ex.getMessage()));
            }
        }
        if(transportBinding){
            mp.setSSL(transportBinding);
        }
View Full Code Here


            if (configFileIdentifier != null) {
                final StringBuffer buffer = new StringBuffer("wsit-");
                buffer.append(configFileIdentifier).append(".xml");
                return buffer.toString();
            } else {
                throw new PolicyException(LocalizationMessages.WSP_0080_IMPLEMENTATION_EXPECTED_NOT_NULL());
            }
        }
View Full Code Here

        * @throws PolicyException If there already is a policy recorded with the
        *   same id.
        */
       public void setUri(final String uri, final String id) throws PolicyException {
           if (qualifiedPolicyUris.contains(uri)) {
               throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1020_DUPLICATE_ID(id)));
           }
           this.uri = uri;
           qualifiedPolicyUris.add(uri);
       }
View Full Code Here

                for (AssertionSet assertionSet : policy) {
                    for (PolicyAssertion assertion : assertionSet) {
                        Fitness validationResult = validationProcessor.validateServerSide(assertion);
                        if (validationResult != Fitness.SUPPORTED) {
                            throw new PolicyException(PolicyMessages.WSP_1015_SERVER_SIDE_ASSERTION_VALIDATION_FAILED(
                                    assertion.getName(),
                                    validationResult));
                        }
                    }
                }
View Full Code Here

        this.policySubject = policySubject;
    }
   
    final void populate(final PolicyMapExtender policyMapExtender) throws PolicyException {
        if (null == policyMapExtender) {
            throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1006_POLICY_MAP_EXTENDER_CAN_NOT_BE_NULL()));
        }
       
        doPopulate(policyMapExtender);
    }
View Full Code Here

   
    protected abstract void doPopulate(final PolicyMapExtender policyMapExtender) throws PolicyException;
   
    final Collection<Policy> getPolicies() throws PolicyException {
        if (null == policyURIs) {
            throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1004_POLICY_URIS_CAN_NOT_BE_NULL()));
        }
        if (null == policyStore) {
            throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1010_NO_POLICIES_DEFINED()));
        }
       
        final Collection<Policy> result = new ArrayList<Policy>(policyURIs.size());
       
        for (String policyURI : policyURIs) {
            final PolicySourceModel sourceModel = policyStore.get(policyURI);
            if (sourceModel == null) {
                throw LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1005_POLICY_REFERENCE_DOES_NOT_EXIST(policyURI)));
            } else {
                result.add(ModelTranslator.getTranslator().translate(sourceModel));
            }
        }
       
View Full Code Here

            }else if(SecurityPolicyVersion.SECURITYPOLICY200507 == spVersion && (RmProtocolVersion.WSRM200702 == rmVersion )){
                rmMessagePolicy = "rm-msglevel-policy-sx-sp10.xml";
            }
            model = unmarshalPolicy("com/sun/xml/ws/security/impl/policyconv/" + rmMessagePolicy);
        }catch (IOException ex) {
            throw new PolicyException(ex);
        }
        Policy mbp = ModelTranslator.getTranslator().translate(model);
        return mbp;
    }
View Full Code Here

            for (String currentUri : urisToBeSolvedList) {
                if (!isPolicyProcessed(currentUri)) {
                    final PolicyRecord prefetchedRecord = getPolicyRecordsPassedBy().get(currentUri);
                    if (null == prefetchedRecord) {
                        if (policyReader.getUrlsRead().contains(getBaseUrl(currentUri))) { // --> unresolvable policy
                            LOGGER.logSevereException(new PolicyException(PolicyMessages.WSP_1014_CAN_NOT_FIND_POLICY(currentUri)));
                        } else {
                            if (readExternalFile(getBaseUrl(currentUri))) {
                                getUnresolvedUris(false).add(currentUri);
                            }
                        }
View Full Code Here

                                    feature = new AddressingFeature(true, !assertion.isOptional(), AddressingFeature.Responses.NON_ANONYMOUS);
                                } else {
                                    feature = new AddressingFeature(true, !assertion.isOptional());
                                }
                            } catch (NoSuchMethodError e) {
                                throw LOGGER.logSevereException(new PolicyException(ModelerMessages.RUNTIME_MODELER_ADDRESSING_RESPONSES_NOSUCHMETHOD(toJar(Which.which(AddressingFeature.class))), e));
                            }
                            if (LOGGER.isLoggable(Level.FINE)) {
                                LOGGER.fine("Added addressing feature \"" + feature + "\" for element \"" + key + "\"");
                            }
                            features.add(feature);
View Full Code Here

            PolicyMerger pm = PolicyMerger.getMerger();
            Policy ep = pm.merge(pl);
            return ep;
        } catch (Exception e) {
            log.log(Level.SEVERE, LogStringsMessages.WSSTUBE_0007_PROBLEM_GETTING_EFF_BOOT_POLICY(), e);
            throw new PolicyException(LogStringsMessages.WSSTUBE_0007_PROBLEM_GETTING_EFF_BOOT_POLICY(), e);
        }

    }
View Full Code Here

TOP

Related Classes of com.sun.xml.ws.policy.PolicyException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.