Search in sources :

Example 1 with Relationship

use of org.apache.cxf.ws.addressing.v200408.Relationship in project cxf by apache.

the class VersionTransformer method convert.

/**
 * Convert from 2004/08 Relationship to 2005/08 RelatesToType.
 *
 * @param exposed the 2004/08 Relationship
 * @return an equivalent 2005/08 RelatesToType
 */
public static RelatesToType convert(Relationship exposed) {
    RelatesToType internal = null;
    if (exposed != null) {
        internal = ContextUtils.WSA_OBJECT_FACTORY.createRelatesToType();
        internal.setValue(exposed.getValue());
        QName exposedRelationshipType = exposed.getRelationshipType();
        if (exposedRelationshipType != null) {
            String internalRelationshipType = Names.WSA_REPLY_NAME.equalsIgnoreCase(exposedRelationshipType.getLocalPart()) ? Names.WSA_RELATIONSHIP_REPLY : exposedRelationshipType.toString();
            internal.setRelationshipType(internalRelationshipType);
        }
        internal.getOtherAttributes().putAll(exposed.getOtherAttributes());
    }
    return internal;
}
Also used : AttributedQName(org.apache.cxf.ws.addressing.v200408.AttributedQName) QName(javax.xml.namespace.QName)

Example 2 with Relationship

use of org.apache.cxf.ws.addressing.v200408.Relationship in project cxf by apache.

the class VersionTransformer method convert.

// THERE IS NO ReferenceParametersType for 2004/03
/**
 * Convert from 2005/08 RelatesToType to 2004/08 Relationship.
 *
 * @param internal the 2005/08 RelatesToType
 * @return an equivalent 2004/08 Relationship
 */
public static Relationship convert(RelatesToType internal) {
    Relationship exposed = null;
    if (internal != null) {
        exposed = Names200408.WSA_OBJECT_FACTORY.createRelationship();
        exposed.setValue(internal.getValue());
        String internalRelationshipType = internal.getRelationshipType();
        if (internalRelationshipType != null) {
            QName exposedRelationshipType = null;
            if (!Names.WSA_RELATIONSHIP_REPLY.equals(internalRelationshipType)) {
                exposedRelationshipType = new QName(internalRelationshipType);
            }
            exposed.setRelationshipType(exposedRelationshipType);
        }
        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
    }
    return exposed;
}
Also used : AttributedQName(org.apache.cxf.ws.addressing.v200408.AttributedQName) QName(javax.xml.namespace.QName) Relationship(org.apache.cxf.ws.addressing.v200408.Relationship)

Example 3 with Relationship

use of org.apache.cxf.ws.addressing.v200408.Relationship in project cxf by apache.

the class VersionTransformer method convertTo200403.

/**
 * Convert from 2005/08 RelatesToType to 2004/03 Relationship.
 *
 * @param internal the 2005/08 RelatesToType
 * @return an equivalent 2004/03 Relationship
 */
public static org.apache.cxf.ws.addressing.v200403.Relationship convertTo200403(RelatesToType internal) {
    org.apache.cxf.ws.addressing.v200403.Relationship exposed = null;
    if (internal != null) {
        exposed = Names200403.WSA_OBJECT_FACTORY.createRelationship();
        exposed.setValue(internal.getValue());
        String internalRelationshipType = internal.getRelationshipType();
        if (internalRelationshipType != null) {
            QName exposedRelationshipType = null;
            if (!Names.WSA_RELATIONSHIP_REPLY.equals(internalRelationshipType)) {
                exposedRelationshipType = new QName(internalRelationshipType);
            }
            exposed.setRelationshipType(exposedRelationshipType);
        }
        putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
    }
    return exposed;
}
Also used : AttributedQName(org.apache.cxf.ws.addressing.v200408.AttributedQName) QName(javax.xml.namespace.QName)

Example 4 with Relationship

use of org.apache.cxf.ws.addressing.v200408.Relationship in project cxf by apache.

the class MAPCodecTest method isReply.

private boolean isReply(boolean exposedAsNative) {
    boolean isReply = false;
    if (exposedAsNative) {
        isReply = Names.WSA_RELATIONSHIP_REPLY.equals(((RelatesToType) expectedValues[4]).getRelationshipType());
    } else {
        QName relationship = expectedValues[4] instanceof Relationship ? ((Relationship) expectedValues[4]).getRelationshipType() : ((org.apache.cxf.ws.addressing.v200403.Relationship) expectedValues[4]).getRelationshipType();
        isReply = relationship == null || Names.WSA_REPLY_NAME.equalsIgnoreCase(relationship.getLocalPart());
    }
    return isReply;
}
Also used : RelatesToType(org.apache.cxf.ws.addressing.RelatesToType) QName(javax.xml.namespace.QName) Relationship(org.apache.cxf.ws.addressing.v200408.Relationship)

Example 5 with Relationship

use of org.apache.cxf.ws.addressing.v200408.Relationship in project cxf by apache.

the class VersionTransformer method convert.

/**
 * Convert from 2004/03 Relationship to 2005/08 RelatesToType.
 *
 * @param exposed the 2004/03 Relationship
 * @return an equivalent 2005/08 RelatesToType
 */
public static RelatesToType convert(org.apache.cxf.ws.addressing.v200403.Relationship exposed) {
    RelatesToType internal = null;
    if (exposed != null) {
        internal = ContextUtils.WSA_OBJECT_FACTORY.createRelatesToType();
        internal.setValue(exposed.getValue());
        QName exposedRelationshipType = exposed.getRelationshipType();
        if (exposedRelationshipType != null) {
            String internalRelationshipType = Names.WSA_REPLY_NAME.equals(exposedRelationshipType.getLocalPart()) ? Names.WSA_RELATIONSHIP_REPLY : exposedRelationshipType.toString();
            internal.setRelationshipType(internalRelationshipType);
        }
        internal.getOtherAttributes().putAll(exposed.getOtherAttributes());
    }
    return internal;
}
Also used : AttributedQName(org.apache.cxf.ws.addressing.v200408.AttributedQName) QName(javax.xml.namespace.QName)

Aggregations

QName (javax.xml.namespace.QName)5 AttributedQName (org.apache.cxf.ws.addressing.v200408.AttributedQName)4 Relationship (org.apache.cxf.ws.addressing.v200408.Relationship)2 RelatesToType (org.apache.cxf.ws.addressing.RelatesToType)1