Package org.apache.cxf.ws.addressing
Class VersionTransformer
- java.lang.Object
-
- org.apache.cxf.ws.addressing.VersionTransformer
-
public class VersionTransformer extends Object
This class is responsible for transforming between the native WS-Addressing schema version (i.e. 2005/08) and exposed version (currently may be 2005/08 or 2004/08).The native version is that used throughout the stack, were the WS-A types are represented via the JAXB generated types for the 2005/08 schema.
The exposed version is that used when the WS-A types are externalized, i.e. are encoded in the headers of outgoing messages. For outgoing requests, the exposed version is determined from configuration. For outgoing responses, the exposed version is determined by the exposed version of the corresponding request.
The motivation for using different native and exposed types is usually to facilitate a WS-* standard based on an earlier version of WS-Adressing (for example WS-RM depends on the 2004/08 version).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVersionTransformer.Names200403Holder for 2004/03 Namesstatic classVersionTransformer.Names200408Holder for 2004/08 Names
-
Field Summary
Fields Modifier and Type Field Description protected static StringNATIVE_VERSION
-
Constructor Summary
Constructors Modifier Constructor Description protectedVersionTransformer()Constructor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AttributedURIconvert(AttributedURIType internal)Convert from 2005/08 AttributedURI to 2004/08 AttributedURI.static EndpointReferenceTypeconvert(EndpointReferenceType internal)Convert from 2005/08 EndpointReferenceType to 2004/08 EndpointReferenceType.static ReferenceParametersTypeconvert(ReferenceParametersType internal)Convert from 2005/08 ReferenceParametersType to 2004/08 ReferenceParametersType.static Relationshipconvert(RelatesToType internal)Convert from 2005/08 RelatesToType to 2004/08 Relationship.static AttributedURITypeconvert(AttributedURI exposed)Convert from 2004/03 AttributedURI to 2005/08 AttributedURI.static EndpointReferenceTypeconvert(EndpointReferenceType exposed)Convert from 2004/03 EndpointReferenceType to 2005/08 EndpointReferenceType.static RelatesToTypeconvert(Relationship exposed)Convert from 2004/03 Relationship to 2005/08 RelatesToType.static AttributedURITypeconvert(AttributedURI exposed)Convert from 2004/08 AttributedURI to 2005/08 AttributedURI.static EndpointReferenceTypeconvert(EndpointReferenceType exposed)Convert from 2004/08 EndpointReferenceType to 2005/08 EndpointReferenceType.static ReferenceParametersTypeconvert(ReferenceParametersType exposed)Convert from 2004/08 ReferenceParametersType to 2005/08 ReferenceParametersType.static RelatesToTypeconvert(Relationship exposed)Convert from 2004/08 Relationship to 2005/08 RelatesToType.static AttributedURIconvertTo200403(AttributedURIType internal)Convert from 2005/08 AttributedURI to 2004/03 AttributedURI.static EndpointReferenceTypeconvertTo200403(EndpointReferenceType internal)Convert from 2005/08 EndpointReferenceType to 2004/03 EndpointReferenceType.static RelationshipconvertTo200403(RelatesToType internal)Convert from 2005/08 RelatesToType to 2004/03 Relationship.static EndpointReferenceTypeconvertToNative(Object exposed)Converts a version specific EndpointReferenceType to the native version used internally by CXFstatic javax.xml.bind.JAXBContextgetExposedJAXBContext(String exposedURI)static Class<?>getExposedReferenceType(String exposedURI)Gets the Class representing the EndpointReferenceType that is used for the specific WS-Addressing versionstatic booleanisSupported(String namespace)static EndpointReferenceTypeparseEndpointReference(Element ref)Parse an EndpointReferenceType from a DOM element.
-
-
-
Field Detail
-
NATIVE_VERSION
protected static final String NATIVE_VERSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
isSupported
public static boolean isSupported(String namespace)
- Parameters:
namespace- a namspace URI to consider- Returns:
- true if th WS-Addressing version specified by the namespace URI is supported
-
convert
public static AttributedURI convert(AttributedURIType internal)
Convert from 2005/08 AttributedURI to 2004/08 AttributedURI.- Parameters:
internal- the 2005/08 AttributedURIType- Returns:
- an equivalent 2004/08 AttributedURI
-
convertTo200403
public static AttributedURI convertTo200403(AttributedURIType internal)
Convert from 2005/08 AttributedURI to 2004/03 AttributedURI.- Parameters:
internal- the 2005/08 AttributedURIType- Returns:
- an equivalent 2004/08 or 2004/03 AttributedURI
-
convert
public static AttributedURIType convert(AttributedURI exposed)
Convert from 2004/08 AttributedURI to 2005/08 AttributedURI.- Parameters:
exposed- the 2004/08 AttributedURI- Returns:
- an equivalent 2005/08 AttributedURIType
-
convert
public static AttributedURIType convert(AttributedURI exposed)
Convert from 2004/03 AttributedURI to 2005/08 AttributedURI.- Parameters:
exposed- the 2004/03 AttributedURI- Returns:
- an equivalent 2005/08 AttributedURIType
-
convert
public static EndpointReferenceType convert(EndpointReferenceType internal)
Convert from 2005/08 EndpointReferenceType to 2004/08 EndpointReferenceType.- Parameters:
internal- the 2005/08 EndpointReferenceType- Returns:
- an equivalent 2004/08 EndpointReferenceType
-
convertTo200403
public static EndpointReferenceType convertTo200403(EndpointReferenceType internal)
Convert from 2005/08 EndpointReferenceType to 2004/03 EndpointReferenceType.- Parameters:
internal- the 2005/08 EndpointReferenceType- Returns:
- an equivalent 2004/03 EndpointReferenceType
-
convert
public static EndpointReferenceType convert(EndpointReferenceType exposed)
Convert from 2004/08 EndpointReferenceType to 2005/08 EndpointReferenceType.- Parameters:
exposed- the 2004/08 EndpointReferenceType- Returns:
- an equivalent 2005/08 EndpointReferenceType
-
convert
public static EndpointReferenceType convert(EndpointReferenceType exposed)
Convert from 2004/03 EndpointReferenceType to 2005/08 EndpointReferenceType.- Parameters:
exposed- the 2004/03 EndpointReferenceType- Returns:
- an equivalent 2005/08 EndpointReferenceType
-
convert
public static ReferenceParametersType convert(ReferenceParametersType internal)
Convert from 2005/08 ReferenceParametersType to 2004/08 ReferenceParametersType.- Parameters:
internal- the 2005/08 ReferenceParametersType- Returns:
- an equivalent 2004/08 ReferenceParametersType
-
convert
public static ReferenceParametersType convert(ReferenceParametersType exposed)
Convert from 2004/08 ReferenceParametersType to 2005/08 ReferenceParametersType.- Parameters:
exposed- the 2004/08 ReferenceParametersType- Returns:
- an equivalent 2005/08 ReferenceParametersType
-
convert
public static Relationship convert(RelatesToType internal)
Convert from 2005/08 RelatesToType to 2004/08 Relationship.- Parameters:
internal- the 2005/08 RelatesToType- Returns:
- an equivalent 2004/08 Relationship
-
convertTo200403
public static Relationship convertTo200403(RelatesToType internal)
Convert from 2005/08 RelatesToType to 2004/03 Relationship.- Parameters:
internal- the 2005/08 RelatesToType- Returns:
- an equivalent 2004/03 Relationship
-
convert
public static RelatesToType convert(Relationship exposed)
Convert from 2004/08 Relationship to 2005/08 RelatesToType.- Parameters:
exposed- the 2004/08 Relationship- Returns:
- an equivalent 2005/08 RelatesToType
-
convert
public static RelatesToType convert(Relationship exposed)
Convert from 2004/03 Relationship to 2005/08 RelatesToType.- Parameters:
exposed- the 2004/03 Relationship- Returns:
- an equivalent 2005/08 RelatesToType
-
parseEndpointReference
public static EndpointReferenceType parseEndpointReference(Element ref) throws javax.xml.bind.JAXBException
Parse an EndpointReferenceType from a DOM element. Handles all of the WS-Addressing namespaces currently supported.- Parameters:
ref-- Throws:
javax.xml.bind.JAXBException
-
convertToNative
public static EndpointReferenceType convertToNative(Object exposed)
Converts a version specific EndpointReferenceType to the native version used internally by CXF- Parameters:
exposed-
-
getExposedReferenceType
public static Class<?> getExposedReferenceType(String exposedURI)
Gets the Class representing the EndpointReferenceType that is used for the specific WS-Addressing version- Parameters:
exposedURI-
-
getExposedJAXBContext
public static javax.xml.bind.JAXBContext getExposedJAXBContext(String exposedURI) throws javax.xml.bind.JAXBException
- Parameters:
exposedURI- specifies the version WS-Addressing- Returns:
- JABXContext for the exposed namespace URI
- Throws:
javax.xml.bind.JAXBException
-
-