325N/A/*
325N/A * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
325N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325N/A *
325N/A * This code is free software; you can redistribute it and/or modify it
325N/A * under the terms of the GNU General Public License version 2 only, as
325N/A * published by the Free Software Foundation. Oracle designates this
325N/A * particular file as subject to the "Classpath" exception as provided
325N/A * by Oracle in the LICENSE file that accompanied this code.
325N/A *
325N/A * This code is distributed in the hope that it will be useful, but WITHOUT
325N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325N/A * version 2 for more details (a copy is included in the LICENSE file that
325N/A * accompanied this code).
325N/A *
325N/A * You should have received a copy of the GNU General Public License version
325N/A * 2 along with this work; if not, write to the Free Software Foundation,
325N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325N/A *
325N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
325N/A * or visit www.oracle.com if you need additional information or have any
325N/A * questions.
325N/A */
325N/A
325N/Apackage com.sun.xml.internal.ws.policy.spi;
325N/A
325N/Aimport com.sun.xml.internal.ws.policy.AssertionSet;
325N/Aimport com.sun.xml.internal.ws.policy.PolicyAssertion;
325N/Aimport com.sun.xml.internal.ws.policy.sourcemodel.AssertionData;
325N/Aimport java.util.Collection;
325N/A
325N/A/**
325N/A * The interface defines contract for custom (domain specific) policy assertion
325N/A * factories. The implementations are discovered using service provider mechanism
325N/A * described in the
325N/A * <a href="http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#Service%20Provider">J2SE JAR File Specification</a>.
325N/A *<p/>
325N/A * Every implementation of policy assertion creator is expected to <b>fully</b>
325N/A * handle the creation of assertions for the domain (namespace) it claims to
325N/A * support by returning the namespace string from the {link #getSupportedDomainNamespaceUri()}
325N/A * method. To handle creation of domain-specific assertions that are not intended
325N/A * to be customized, the default policy assertion creator (passed as one of the
325N/A * input parameters into the {@link #createAssertion(AssertionData, Collection, AssertionSet, PolicyAssertionCreator)} method)
325N/A * shall be used.
325N/A *
325N/A * @author Marek Potociar
325N/A */
325N/Apublic interface PolicyAssertionCreator {
325N/A
325N/A /**
325N/A * This method returns the namespace URIs of the domains that are supported by the implementation of
325N/A * this inteface. There can be multiple URIs supported per single implementation.
325N/A * <p/>
325N/A * Supporting domain namespace URI means that particular {@code PolicyAssertionCreator} implementation
325N/A * is able to create assertion instances for the domains identified by the namespace URIs returned from this
325N/A * method. It is required that each {@code PolicyAssertionCreator} implementation handles the policy
325N/A * assertion creation for <b>each</b> assertion in every domain it claims to support.
325N/A *
325N/A * @return string array representing the namespace URIs of the supported domains. It is expected that multiple calls on this method return the
325N/A * same value each time. <b>Returned string array must be neither {@code null} nor empty. Also each string value in the array must not be {@code null}
325N/A * nor empty.</b>
325N/A *
325N/A */
325N/A String[] getSupportedDomainNamespaceURIs();
325N/A
325N/A /**
325N/A * Creates domain-specific policy assertion instance according to assertion data provided. For the provided
325N/A * assertion data and this policy assertion creator instance, it will allways be true that assertion namespace
325N/A * URI equals to one of supported domain namespace URIs.
325N/A *<p/>
325N/A * Additional method parameter (which must not be {@code null}) supplied by the policy framework specifies a default policy
325N/A * assertion creator that might be used to handle creation of unsupported domain assertion in the default way. This is
325N/A * to give policy assertion creator a chance to handle also creation of "unsupported" domain assertions and to encourage
325N/A * implemetors to use class composition instad of class inheritance.
325N/A *
325N/A * @param data assertion creation data specifying the details of newly created assertion
325N/A * @param assertionParameters collection of assertions parameters of this policy assertion. May be {@code null}.
325N/A * @param nestedAlternative assertion set specifying nested policy alternative. May be {@code null}.
325N/A * @param defaultCreator default policy assertion creator implementation that shall be used to handle creation of assertions
325N/A * which are not explicitly supported by this policy assertion creator implementation
325N/A * @return domain specific policy assertion implementation according to assertion data provided.
325N/A *
325N/A * @throws AssertionCreationException in case of assertion creation failure
325N/A */
325N/A PolicyAssertion createAssertion(AssertionData data, Collection<PolicyAssertion> assertionParameters, AssertionSet nestedAlternative, PolicyAssertionCreator defaultCreator) throws AssertionCreationException;
325N/A}