Search in sources :

Example 36 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.Identifier in project cxf by apache.

the class VersionTransformer method convert.

/**
 * Convert 200502 wsrm:Identifier with 200508 WS-Addressing namespace to internal form.
 *
 * @param exposed (may be <code>null</code>)
 * @return converted (<code>null</code> if exposed is <code>null</code>)
 */
public static Identifier convert(org.apache.cxf.ws.rm.v200502wsa15.Identifier exposed) {
    if (exposed == null) {
        return null;
    }
    Identifier internal = new Identifier();
    internal.setValue(exposed.getValue());
    putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
    return internal;
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier)

Example 37 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.Identifier in project cxf by apache.

the class VersionTransformer method convert.

/**
 * Convert 200502 wsrm:Identifier with 200408 WS-Addressing namespace to internal form.
 *
 * @param exposed (may be <code>null</code>)
 * @return converted (<code>null</code> if exposed is <code>null</code>)
 */
public static Identifier convert(org.apache.cxf.ws.rm.v200502.Identifier exposed) {
    if (exposed == null) {
        return null;
    }
    Identifier internal = new Identifier();
    internal.setValue(exposed.getValue());
    putAll(exposed.getOtherAttributes(), internal.getOtherAttributes());
    return internal;
}
Also used : Identifier(org.apache.cxf.ws.rm.v200702.Identifier)

Example 38 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.Identifier in project cxf by apache.

the class ServantTest method createTestCloseSequenceMessage.

private static Message createTestCloseSequenceMessage(String sidstr) {
    Message message = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    exchange.setInMessage(message);
    message.put(Message.REQUESTOR_ROLE, Boolean.FALSE);
    AddressingProperties maps = new AddressingProperties();
    String msgId = "urn:uuid:12345-" + Math.random();
    AttributedURIType id = ContextUtils.getAttributedURI(msgId);
    maps.setMessageID(id);
    maps.setAction(ContextUtils.getAttributedURI(RM10Constants.INSTANCE.getTerminateSequenceAction()));
    maps.setTo(ContextUtils.getAttributedURI(SERVICE_URL));
    maps.setReplyTo(RMUtils.createReference(DECOUPLED_URL));
    message.put(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND, maps);
    CloseSequenceType cs = new CloseSequenceType();
    org.apache.cxf.ws.rm.v200702.Identifier sid = new org.apache.cxf.ws.rm.v200702.Identifier();
    sid.setValue(sidstr);
    cs.setIdentifier(sid);
    MessageContentsList contents = new MessageContentsList();
    contents.add(cs);
    message.setContent(List.class, contents);
    RMContextUtils.setProtocolVariation(message, ProtocolVariation.RM11WSA200508);
    return message;
}
Also used : Message(org.apache.cxf.message.Message) MessageContentsList(org.apache.cxf.message.MessageContentsList) AttributedURIType(org.apache.cxf.ws.addressing.AttributedURIType) Exchange(org.apache.cxf.message.Exchange) Identifier(org.apache.cxf.ws.rm.v200502.Identifier) CloseSequenceType(org.apache.cxf.ws.rm.v200702.CloseSequenceType) AddressingProperties(org.apache.cxf.ws.addressing.AddressingProperties) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Example 39 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.Identifier in project cxf by apache.

the class ServantTest method createTestTerminateSequenceMessage.

private static Message createTestTerminateSequenceMessage(String sidstr, ProtocolVariation protocol) {
    Message message = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    exchange.setInMessage(message);
    message.put(Message.REQUESTOR_ROLE, Boolean.FALSE);
    AddressingProperties maps = new AddressingProperties();
    String msgId = "urn:uuid:12345-" + Math.random();
    AttributedURIType id = ContextUtils.getAttributedURI(msgId);
    maps.setMessageID(id);
    maps.setAction(ContextUtils.getAttributedURI(RM10Constants.INSTANCE.getTerminateSequenceAction()));
    maps.setTo(ContextUtils.getAttributedURI(SERVICE_URL));
    maps.setReplyTo(RMUtils.createReference(DECOUPLED_URL));
    message.put(JAXWSAConstants.ADDRESSING_PROPERTIES_INBOUND, maps);
    TerminateSequenceType ts = new TerminateSequenceType();
    Identifier sid = new Identifier();
    sid.setValue(sidstr);
    ts.setIdentifier(sid);
    Object tst = ProtocolVariation.RM10WSA200408.getWSRMNamespace().equals(protocol.getWSRMNamespace()) ? ts : ProtocolVariation.RM10WSA200408.getCodec().convertReceivedTerminateSequence(ts);
    MessageContentsList contents = new MessageContentsList();
    contents.add(tst);
    message.setContent(List.class, contents);
    RMContextUtils.setProtocolVariation(message, protocol);
    return message;
}
Also used : Exchange(org.apache.cxf.message.Exchange) Identifier(org.apache.cxf.ws.rm.v200502.Identifier) Message(org.apache.cxf.message.Message) MessageContentsList(org.apache.cxf.message.MessageContentsList) AttributedURIType(org.apache.cxf.ws.addressing.AttributedURIType) TerminateSequenceType(org.apache.cxf.ws.rm.v200502.TerminateSequenceType) AddressingProperties(org.apache.cxf.ws.addressing.AddressingProperties) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Example 40 with Identifier

use of org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.linkstate.rev200120.Identifier in project cxf by apache.

the class RMTxStoreTestBase method testUpdateDestinationSequence.

@Test
public void testUpdateDestinationSequence() throws SQLException, IOException {
    DestinationSequence seq = control.createMock(DestinationSequence.class);
    Identifier sid1 = new Identifier();
    sid1.setValue("sequence1");
    EndpointReferenceType epr = RMUtils.createAnonymousReference();
    EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
    EasyMock.expect(seq.getAcksTo()).andReturn(epr);
    EasyMock.expect(seq.getEndpointIdentifier()).andReturn(SERVER_ENDPOINT_ID);
    EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);
    control.replay();
    store.createDestinationSequence(seq);
    control.verify();
    control.reset();
    EasyMock.expect(seq.getLastMessageNumber()).andReturn(Long.valueOf(0));
    EasyMock.expect(seq.getAcknowledgment()).andReturn(ack1);
    EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
    EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);
    control.replay();
    Connection con = getConnection();
    try {
        store.beginTransaction();
        store.updateDestinationSequence(con, seq);
        store.abort(con);
    } finally {
        releaseConnection(con);
    }
    control.reset();
    EasyMock.expect(seq.getLastMessageNumber()).andReturn(TEN);
    EasyMock.expect(seq.getAcknowledgment()).andReturn(ack1);
    EasyMock.expect(seq.getIdentifier()).andReturn(sid1);
    EasyMock.expect(seq.getProtocol()).andReturn(ProtocolVariation.RM10WSA200408);
    control.replay();
    con = getConnection();
    try {
        store.beginTransaction();
        store.updateDestinationSequence(con, seq);
        store.abort(con);
    } finally {
        releaseConnection(con);
    }
    store.removeDestinationSequence(sid1);
}
Also used : DestinationSequence(org.apache.cxf.ws.rm.DestinationSequence) Identifier(org.apache.cxf.ws.rm.v200702.Identifier) EndpointReferenceType(org.apache.cxf.ws.addressing.EndpointReferenceType) Connection(java.sql.Connection) Test(org.junit.Test)

Aggregations

Identifier (org.apache.cxf.ws.rm.v200702.Identifier)72 ArrayList (java.util.ArrayList)71 Uint64 (org.opendaylight.yangtools.yang.common.Uint64)59 Test (org.junit.Test)52 Uuid (org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid)50 InstanceIdentifier (org.opendaylight.yangtools.yang.binding.InstanceIdentifier)50 ExecutionException (java.util.concurrent.ExecutionException)38 Uint32 (org.opendaylight.yangtools.yang.common.Uint32)37 Logger (org.slf4j.Logger)35 LoggerFactory (org.slf4j.LoggerFactory)35 Inject (javax.inject.Inject)32 Singleton (javax.inject.Singleton)32 DataBroker (org.opendaylight.mdsal.binding.api.DataBroker)32 LogicalDatastoreType (org.opendaylight.mdsal.common.api.LogicalDatastoreType)32 PreDestroy (javax.annotation.PreDestroy)30 ManagedNewTransactionRunner (org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunner)30 ManagedNewTransactionRunnerImpl (org.opendaylight.mdsal.binding.util.ManagedNewTransactionRunnerImpl)30 Executors (org.opendaylight.infrautils.utils.concurrent.Executors)28 CONFIGURATION (org.opendaylight.mdsal.binding.util.Datastore.CONFIGURATION)27 AbstractAsyncDataTreeChangeListener (org.opendaylight.serviceutils.tools.listener.AbstractAsyncDataTreeChangeListener)26