Commit 90397b97 authored by michael.simon's avatar michael.simon
Browse files

Delete PAOS package. Should be included in opensaml now.

parent c48878ea
/*
* Copyright 2010 Jonathan Tellier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package edu.kit.scc.paos;
import javax.xml.namespace.QName;
import org.opensaml.common.SAMLObject;
import org.opensaml.common.xml.SAMLConstants;
import org.opensaml.ws.soap.soap11.ActorBearing;
import org.opensaml.ws.soap.soap11.MustUnderstandBearing;
/**
* Liberty Alliance PAOS Request header.
*/
public interface Request extends SAMLObject, MustUnderstandBearing,
ActorBearing {
/** Element local name. */
public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Request";
/** Default element name. */
public static final QName DEFAULT_ELEMENT_NAME =
new QName(SAMLConstants.PAOS_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.PAOS_PREFIX);
/** Local name of the XSI type. */
public static final String TYPE_LOCAL_NAME = "RequestType";
/** QName of the XSI type. */
public static final QName TYPE_NAME =
new QName(SAMLConstants.PAOS_NS, TYPE_LOCAL_NAME, SAMLConstants.PAOS_PREFIX);
/** responseConsumerURL attribute name. */
public static final String RESPONSE_CONSUMER_URL_ATTRIB_NAME = "responseConsumerURL";
/** service attribute name. */
public static final String SERVICE_ATTRIB_NAME = "service";
/** messageID attribute name. */
public static final String MESSAGE_ID_ATTRIB_NAME = "messageID";
/**
* Get the responseConsumerURL attribute value.
*
* @return the responseConsumerURL attribute value
*/
public String getResponseConsumerURL();
/**
* Set the responseConsumerURL attribute value.
*
* @param newResponseConsumerURL the new responseConsumerURL attribute value
*/
public void setResponseConsumerURL(String newResponseConsumerURL);
/**
* Get the service attribute value.
*
* @return the service attribute value
*/
public String getService();
/**
* Set the service attribute value.
*
* @param newService the new service attribute value
*/
public void setService(String newService);
/**
* Get the messageID attribute value.
*
* @return the messageID attribute value
*/
public String getMessageID();
/**
* Set the messageID attribute value.
*
* @param newMessageID the new messageID attribute value
*/
public void setMessageID(String newMessageID);
}
/*
* Copyright 2011 Jonathan Tellier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package edu.kit.scc.paos;
import javax.xml.namespace.QName;
import org.opensaml.common.SAMLObject;
import org.opensaml.common.xml.SAMLConstants;
import org.opensaml.ws.soap.soap11.ActorBearing;
import org.opensaml.ws.soap.soap11.MustUnderstandBearing;
/**
* Liberty Alliance PAOS Response header.
*/
public interface Response extends SAMLObject, MustUnderstandBearing,
ActorBearing {
/** Element local name. */
public static final String DEFAULT_ELEMENT_LOCAL_NAME = "Response";
/** Default element name. */
public static final QName DEFAULT_ELEMENT_NAME =
new QName(SAMLConstants.PAOS_NS, DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.PAOS_PREFIX);
/** Local name of the XSI type. */
public static final String TYPE_LOCAL_NAME = "ResponseType";
/** QName of the XSI type. */
public static final QName TYPE_NAME =
new QName(SAMLConstants.PAOS_NS, TYPE_LOCAL_NAME, SAMLConstants.PAOS_PREFIX);
/** messageID attribute name. */
public static final String REF_TO_MESSAGE_ID_ATTRIB_NAME = "refToMessageID";
/**
* Get the refToMessageID attribute value.
*
* @return the refToMessageID attribute value
*/
public String getRefToMessageID();
/**
* Set the refToMessageID attribute value.
*
* @param newRefToMessageID the new refToMessageID attribute value
*/
public void setRefToMessageID(String newRefToMessageID);
}
/*
* Copyright 2010 Jonathan Tellier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package edu.kit.scc.paos.impl;
import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
import org.opensaml.common.xml.SAMLConstants;
import edu.kit.scc.paos.Request;
public class RequestBuilder extends AbstractSAMLObjectBuilder<Request> {
/**
* Constructor.
*/
public RequestBuilder() {
}
/** {@inheritDoc} */
@Override
public Request buildObject() {
return buildObject(SAMLConstants.PAOS_NS, Request.DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.PAOS_PREFIX);
}
/** {@inheritDoc} */
@Override
public Request buildObject(String namespaceURI, String localName, String namespacePrefix) {
return new RequestImpl(namespaceURI, localName, namespacePrefix);
}
}
/*
* Copyright 2010 Jonathan Tellier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package edu.kit.scc.paos.impl;
import java.util.List;
import org.opensaml.common.impl.AbstractSAMLObject;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.schema.XSBooleanValue;
import edu.kit.scc.paos.Request;
public class RequestImpl extends AbstractSAMLObject implements Request {
/** responseConsumerURL attribute */
private String responseConsumerURL;
/** service attribute */
private String service;
/** messageID attribute */
private String messageID;
/** soap11:actor attribute. */
private String soap11Actor;
/** soap11:mustUnderstand. */
private XSBooleanValue soap11MustUnderstand;
/**
* Constructor.
*
* @param namespaceURI the namespace the element is in
* @param elementLocalName the local name of the XML element this Object represents
* @param namespacePrefix the prefix for the given namespace
*/
protected RequestImpl(String namespaceURI, String elementLocalName,
String namespacePrefix) {
super(namespaceURI, elementLocalName, namespacePrefix);
}
/** {@inheritDoc} */
public String getMessageID() {
return messageID;
}
/** {@inheritDoc} */
public String getResponseConsumerURL() {
return responseConsumerURL;
}
/** {@inheritDoc} */
public String getService() {
return service;
}
/** {@inheritDoc} */
public void setMessageID(String newMessageID) {
messageID = prepareForAssignment(messageID, newMessageID);
}
/** {@inheritDoc} */
public void setResponseConsumerURL(String newResponseConsumerURL) {
responseConsumerURL = prepareForAssignment(responseConsumerURL,
newResponseConsumerURL);
}
/** {@inheritDoc} */
public void setService(String newService) {
service = prepareForAssignment(service, newService);
}
/** {@inheritDoc} */
public List<XMLObject> getOrderedChildren() {
// No elements
return null;
}
/** {@inheritDoc} */
public Boolean isSOAP11MustUnderstand() {
if (soap11MustUnderstand != null) {
return soap11MustUnderstand.getValue();
}
return Boolean.FALSE;
}
/** {@inheritDoc} */
public XSBooleanValue isSOAP11MustUnderstandXSBoolean() {
return soap11MustUnderstand;
}
/** {@inheritDoc} */
public void setSOAP11MustUnderstand(Boolean newMustUnderstand) {
if (newMustUnderstand != null) {
soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand,
new XSBooleanValue(newMustUnderstand, true));
} else {
soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand, null);
}
}
/** {@inheritDoc} */
public void setSOAP11MustUnderstand(XSBooleanValue newMustUnderstand) {
soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand,
newMustUnderstand);
}
/** {@inheritDoc} */
public String getSOAP11Actor() {
return soap11Actor;
}
/** {@inheritDoc} */
public void setSOAP11Actor(String newActor) {
soap11Actor = prepareForAssignment(soap11Actor, newActor);
}
}
/*
* Copyright 2010 Jonathan Tellier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package edu.kit.scc.paos.impl;
import org.opensaml.common.impl.AbstractSAMLObjectMarshaller;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.io.MarshallingException;
import org.opensaml.xml.util.XMLHelper;
import org.w3c.dom.Element;
import edu.kit.scc.paos.Request;
/**
* Marshaller for instances of {@link Request}.
*/
public class RequestMarshaller extends AbstractSAMLObjectMarshaller {
/** {@inheritDoc} */
protected void marshallAttributes(XMLObject xmlObject, Element domElement)
throws MarshallingException {
Request request = (Request) xmlObject;
if (request.getResponseConsumerURL() != null) {
domElement.setAttributeNS(null, Request.RESPONSE_CONSUMER_URL_ATTRIB_NAME,
request.getResponseConsumerURL());
}
if (request.getService() != null) {
domElement.setAttributeNS(null, Request.SERVICE_ATTRIB_NAME, request.getService());
}
if (request.getMessageID() != null) {
domElement.setAttributeNS(null, Request.MESSAGE_ID_ATTRIB_NAME,
request.getMessageID());
}
if (request.isSOAP11MustUnderstandXSBoolean() != null) {
XMLHelper.marshallAttribute(Request.SOAP11_MUST_UNDERSTAND_ATTR_NAME,
request.isSOAP11MustUnderstandXSBoolean().toString(), domElement, false);
}
if (request.getSOAP11Actor() != null) {
XMLHelper.marshallAttribute(Request.SOAP11_ACTOR_ATTR_NAME,
request.getSOAP11Actor(), domElement, false);
}
}
}
/*
* Copyright 2010 Jonathan Tellier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package edu.kit.scc.paos.impl;
import javax.xml.namespace.QName;
import org.opensaml.common.impl.AbstractSAMLObjectUnmarshaller;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.io.UnmarshallingException;
import org.opensaml.xml.schema.XSBooleanValue;
import org.opensaml.xml.util.XMLHelper;
import org.w3c.dom.Attr;
import edu.kit.scc.paos.Request;
/**
* Unmarshaller for instances of {@link Request}.
*/
public class RequestUnmarshaller extends AbstractSAMLObjectUnmarshaller {
/** {@inheritDoc} */
protected void processAttribute(XMLObject samlObject, Attr attribute)
throws UnmarshallingException {
Request request = (Request) samlObject;
QName attrName = XMLHelper.getNodeQName(attribute);
if (Request.SOAP11_MUST_UNDERSTAND_ATTR_NAME.equals(attrName)) {
request.setSOAP11MustUnderstand(XSBooleanValue.valueOf(attribute.getValue()));
} else if (Request.SOAP11_ACTOR_ATTR_NAME.equals(attrName)) {
request.setSOAP11Actor(attribute.getValue());
} else if (Request.RESPONSE_CONSUMER_URL_ATTRIB_NAME.equals(attribute.getLocalName())) {
request.setResponseConsumerURL(attribute.getValue());
} else if (Request.SERVICE_ATTRIB_NAME.equals(attribute.getLocalName())) {
request.setService(attribute.getValue());
} else if (Request.MESSAGE_ID_ATTRIB_NAME.equals(attribute.getLocalName())) {
request.setMessageID(attribute.getValue());
} else {
super.processAttribute(samlObject, attribute);
}
}
}
/*
* Copyright 2011 Jonathan Tellier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package edu.kit.scc.paos.impl;
import org.opensaml.common.impl.AbstractSAMLObjectBuilder;
import org.opensaml.common.xml.SAMLConstants;
import edu.kit.scc.paos.Response;
public class ResponseBuilder extends AbstractSAMLObjectBuilder<Response> {
/**
* Constructor.
*/
public ResponseBuilder() {
}
/** {@inheritDoc} */
@Override
public Response buildObject() {
return buildObject(SAMLConstants.PAOS_NS, Response.DEFAULT_ELEMENT_LOCAL_NAME,
SAMLConstants.PAOS_PREFIX);
}
/** {@inheritDoc} */
@Override
public Response buildObject(String namespaceURI, String localName,
String namespacePrefix) {
return new ResponseImpl(namespaceURI, localName, namespacePrefix);
}
}
/*
* Copyright 2011 Jonathan Tellier
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package edu.kit.scc.paos.impl;
import java.util.List;
import org.opensaml.common.impl.AbstractSAMLObject;
import org.opensaml.xml.XMLObject;
import org.opensaml.xml.schema.XSBooleanValue;
import edu.kit.scc.paos.Response;
public class ResponseImpl extends AbstractSAMLObject implements Response {
/** refToMessageID attribute */
private String refToMessageID;
/** soap11:actor attribute. */
private String soap11Actor;
/** soap11:mustUnderstand. */
private XSBooleanValue soap11MustUnderstand;
/**
* Constructor.
*
* @param namespaceURI the namespace the element is in
* @param elementLocalName the local name of the XML element this Object represents
* @param namespacePrefix the prefix for the given namespace
*/
protected ResponseImpl(String namespaceURI, String elementLocalName,
String namespacePrefix) {
super(namespaceURI, elementLocalName, namespacePrefix);
}
/** {@inheritDoc} */
public String getRefToMessageID() {
return refToMessageID;
}
/** {@inheritDoc} */
public void setRefToMessageID(String newRefToMessageID) {
refToMessageID = prepareForAssignment(refToMessageID, newRefToMessageID);
}
/** {@inheritDoc} */
public List<XMLObject> getOrderedChildren() {
// No elements
return null;
}
/** {@inheritDoc} */
public Boolean isSOAP11MustUnderstand() {
if (soap11MustUnderstand != null) {
return soap11MustUnderstand.getValue();
}
return Boolean.FALSE;
}
/** {@inheritDoc} */
public XSBooleanValue isSOAP11MustUnderstandXSBoolean() {
return soap11MustUnderstand;
}
/** {@inheritDoc} */
public void setSOAP11MustUnderstand(Boolean newMustUnderstand) {
if (newMustUnderstand != null) {
soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand,
new XSBooleanValue(newMustUnderstand, true));
} else {
soap11MustUnderstand = prepareForAssignment(soap11MustUnderstand, null);
}
}
/** {@inheritDoc} */