Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Distribution License v. 1.0, which is available at
* http://www.eclipse.org/org/documents/edl-v10.php.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
package com.sun.xml.ws.developer;
import com.sun.istack.NotNull;
import com.sun.xml.ws.api.message.Header;
import com.sun.xml.ws.api.message.Headers;
import javax.xml.transform.Source;
import jakarta.xml.ws.EndpointReference;
import jakarta.xml.ws.wsaddressing.W3CEndpointReference;
import java.util.ArrayList;
import java.util.List;
/**
* Represents additional data to be added to EPRs
* created from {@link StatefulWebServiceManager} (for advanced users).
*
*
* Occasionally it is convenient to be able to control the data to be
* present on {@link EndpointReference}s created by {@link StatefulWebServiceManager}.
* You can do so by using this class like this:
*
*
* See
* WS-Addressing EPR information model for more details.
*
* @author Kohsuke Kawaguchi
* @since 2.1.1
* @see StatefulWebServiceManager
* @see Headers
*/
public final class EPRRecipe {
private final List referenceParameters = new ArrayList();
private final List metadata = new ArrayList();
/**
* Gets all the reference parameters added so far.
*/
public @NotNull List getReferenceParameters() {
return referenceParameters;
}
/**
* Gets all the metadata added so far.
*/
public @NotNull List getMetadata() {
return metadata;
}
/**
* Adds a new reference parameter.
*/
public EPRRecipe addReferenceParameter(Header h) {
if(h==null) throw new IllegalArgumentException();
referenceParameters.add(h);
return this;
}
/**
* Adds all the headers as reference parameters.
*/
public EPRRecipe addReferenceParameters(Header... headers) {
for (Header h : headers)
addReferenceParameter(h);
return this;
}
/**
* Adds all the headers as reference parameters.
*/
public EPRRecipe addReferenceParameters(Iterable extends Header> headers) {
for (Header h : headers)
addReferenceParameter(h);
return this;
}
/**
* Adds a new metadata.
*/
public EPRRecipe addMetadata(Source source) {
if(source==null) throw new IllegalArgumentException();
metadata.add(source);
return this;
}
public EPRRecipe addMetadata(Source... sources) {
for (Source s : sources)
addMetadata(s);
return this;
}
public EPRRecipe addMetadata(Iterable extends Source> sources) {
for (Source s : sources)
addMetadata(s);
return this;
}
}