Search in sources :

Example 6 with AcksPolicyType

use of org.apache.cxf.ws.rm.manager.AcksPolicyType in project cxf by apache.

the class ServantTest method verifyCreateSequenceExpiresSetAtSource.

private void verifyCreateSequenceExpiresSetAtSource(Servant servant, RMManager manager) throws SequenceFault {
    DestinationPolicyType dp = RMMANGER_FACTORY.createDestinationPolicyType();
    AcksPolicyType ap = RMMANGER_FACTORY.createAcksPolicyType();
    dp.setAcksPolicy(ap);
    manager.setDestinationPolicy(dp);
    Expires expires = new Expires();
    expires.setValue(DURATION_SHORT);
    Message message = createTestCreateSequenceMessage(expires, null);
    CreateSequenceResponseType csr = (CreateSequenceResponseType) servant.createSequence(message);
    Expires expires2 = csr.getExpires();
    assertNotNull(expires2);
    assertEquals(DURATION_SHORT, expires2.getValue());
}
Also used : AcksPolicyType(org.apache.cxf.ws.rm.manager.AcksPolicyType) Message(org.apache.cxf.message.Message) DestinationPolicyType(org.apache.cxf.ws.rm.manager.DestinationPolicyType) Expires(org.apache.cxf.ws.rm.v200502.Expires) CreateSequenceResponseType(org.apache.cxf.ws.rm.v200502.CreateSequenceResponseType)

Example 7 with AcksPolicyType

use of org.apache.cxf.ws.rm.manager.AcksPolicyType in project cxf by apache.

the class ServantTest method verifyCreateSequenceExpiresSetAtBoth.

private void verifyCreateSequenceExpiresSetAtBoth(Servant servant, RMManager manager) throws SequenceFault {
    DestinationPolicyType dp = RMMANGER_FACTORY.createDestinationPolicyType();
    AcksPolicyType ap = RMMANGER_FACTORY.createAcksPolicyType();
    dp.setAcksPolicy(ap);
    dp.setSequenceExpiration(DURATION_SHORT);
    manager.setDestinationPolicy(dp);
    Expires expires = new Expires();
    expires.setValue(DURATION_VERY_SHORT);
    Message message = createTestCreateSequenceMessage(expires, null);
    CreateSequenceResponseType csr = (CreateSequenceResponseType) servant.createSequence(message);
    Expires expires2 = csr.getExpires();
    assertNotNull(expires2);
    assertEquals(DURATION_VERY_SHORT, expires2.getValue());
}
Also used : AcksPolicyType(org.apache.cxf.ws.rm.manager.AcksPolicyType) Message(org.apache.cxf.message.Message) DestinationPolicyType(org.apache.cxf.ws.rm.manager.DestinationPolicyType) Expires(org.apache.cxf.ws.rm.v200502.Expires) CreateSequenceResponseType(org.apache.cxf.ws.rm.v200502.CreateSequenceResponseType)

Example 8 with AcksPolicyType

use of org.apache.cxf.ws.rm.manager.AcksPolicyType in project cxf by apache.

the class ServantTest method verifyTerminateSequenceDefault.

private void verifyTerminateSequenceDefault(Servant servant, RMManager manager, String sidstr, ProtocolVariation protocol) throws SequenceFault {
    DestinationPolicyType dp = RMMANGER_FACTORY.createDestinationPolicyType();
    AcksPolicyType ap = RMMANGER_FACTORY.createAcksPolicyType();
    dp.setAcksPolicy(ap);
    manager.setDestinationPolicy(dp);
    Message message = createTestTerminateSequenceMessage(sidstr, protocol);
    Object tsr = servant.terminateSequence(message);
    if (ProtocolVariation.RM10WSA200408.getWSRMNamespace().equals(protocol.getWSRMNamespace())) {
        // rm 1.0
        assertNull(tsr);
    } else {
        // rm 1.1
        assertTrue(tsr instanceof TerminateSequenceResponseType);
        org.apache.cxf.ws.rm.v200702.Identifier sid = ((TerminateSequenceResponseType) tsr).getIdentifier();
        assertNotNull(sid);
        assertEquals(sidstr, sid.getValue());
    }
}
Also used : TerminateSequenceResponseType(org.apache.cxf.ws.rm.v200702.TerminateSequenceResponseType) AcksPolicyType(org.apache.cxf.ws.rm.manager.AcksPolicyType) Message(org.apache.cxf.message.Message) DestinationPolicyType(org.apache.cxf.ws.rm.manager.DestinationPolicyType)

Example 9 with AcksPolicyType

use of org.apache.cxf.ws.rm.manager.AcksPolicyType in project cxf by apache.

the class WSRM12ServerCycleTest method wsrm.

public static RMFeature wsrm(long brtxInterval, long ackInterval) {
    RMAssertion.BaseRetransmissionInterval baseRetransmissionInterval = new RMAssertion.BaseRetransmissionInterval();
    baseRetransmissionInterval.setMilliseconds(Long.valueOf(brtxInterval));
    RMAssertion.AcknowledgementInterval acknowledgementInterval = new RMAssertion.AcknowledgementInterval();
    acknowledgementInterval.setMilliseconds(Long.valueOf(ackInterval));
    RMAssertion rmAssertion = new RMAssertion();
    rmAssertion.setAcknowledgementInterval(acknowledgementInterval);
    rmAssertion.setBaseRetransmissionInterval(baseRetransmissionInterval);
    AcksPolicyType acksPolicy = new AcksPolicyType();
    acksPolicy.setIntraMessageThreshold(0);
    DestinationPolicyType destinationPolicy = new DestinationPolicyType();
    destinationPolicy.setAcksPolicy(acksPolicy);
    RMFeature feature = new RMFeature();
    feature.setRMAssertion(rmAssertion);
    feature.setDestinationPolicy(destinationPolicy);
    feature.setRMNamespace(RM11Constants.NAMESPACE_URI);
    return feature;
}
Also used : AcksPolicyType(org.apache.cxf.ws.rm.manager.AcksPolicyType) RMAssertion(org.apache.cxf.ws.rmp.v200502.RMAssertion) RMFeature(org.apache.cxf.ws.rm.feature.RMFeature) DestinationPolicyType(org.apache.cxf.ws.rm.manager.DestinationPolicyType)

Aggregations

AcksPolicyType (org.apache.cxf.ws.rm.manager.AcksPolicyType)9 DestinationPolicyType (org.apache.cxf.ws.rm.manager.DestinationPolicyType)7 Message (org.apache.cxf.message.Message)5 CreateSequenceResponseType (org.apache.cxf.ws.rm.v200502.CreateSequenceResponseType)4 Expires (org.apache.cxf.ws.rm.v200502.Expires)4 ArrayList (java.util.ArrayList)1 PostConstruct (javax.annotation.PostConstruct)1 JMException (javax.management.JMException)1 DOMSource (javax.xml.transform.dom.DOMSource)1 Dispatch (javax.xml.ws.Dispatch)1 Endpoint (javax.xml.ws.Endpoint)1 InstrumentationManager (org.apache.cxf.management.InstrumentationManager)1 DeliveryAssurance (org.apache.cxf.ws.rm.RMConfiguration.DeliveryAssurance)1 RMEndpoint (org.apache.cxf.ws.rm.RMEndpoint)1 RMFeature (org.apache.cxf.ws.rm.feature.RMFeature)1 RedeliveryQueueImpl (org.apache.cxf.ws.rm.soap.RedeliveryQueueImpl)1 RetransmissionQueueImpl (org.apache.cxf.ws.rm.soap.RetransmissionQueueImpl)1 TerminateSequenceResponseType (org.apache.cxf.ws.rm.v200702.TerminateSequenceResponseType)1 RMAssertion (org.apache.cxf.ws.rmp.v200502.RMAssertion)1 Test (org.junit.Test)1