use of org.geotoolkit.sml.xml.v101.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;
}
use of org.geotoolkit.sml.xml.v101.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;
}
use of org.geotoolkit.sml.xml.v101.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;
}
use of org.geotoolkit.sml.xml.v101.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;
}
use of org.geotoolkit.sml.xml.v101.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);
}
Aggregations