use of org.apache.cxf.ws.rm.v200702.Identifier in project cxf by apache.
the class RMTxStore method createSourceSequence.
public void createSourceSequence(SourceSequence seq) {
String sequenceIdentifier = seq.getIdentifier().getValue();
String endpointIdentifier = seq.getEndpointIdentifier();
String protocolVersion = encodeProtocolVersion(seq.getProtocol());
if (LOG.isLoggable(Level.FINE)) {
LOG.fine("Creating source sequence: " + sequenceIdentifier + ", (endpoint: " + endpointIdentifier + ")");
}
Connection con = verifyConnection();
PreparedStatement stmt = null;
SQLException conex = null;
try {
beginTransaction();
stmt = getStatement(con, CREATE_SRC_SEQUENCE_STMT_STR);
stmt.setString(1, sequenceIdentifier);
Date expiry = seq.getExpires();
stmt.setLong(2, expiry == null ? 0 : expiry.getTime());
Identifier osid = seq.getOfferingSequenceIdentifier();
stmt.setString(3, osid == null ? null : osid.getValue());
stmt.setString(4, endpointIdentifier);
stmt.setString(5, protocolVersion);
stmt.execute();
commit(con);
} catch (SQLException ex) {
conex = ex;
abort(con);
throw new RMStoreException(ex);
} finally {
releaseResources(stmt, null);
updateConnectionState(con, conex);
}
}
use of org.apache.cxf.ws.rm.v200702.Identifier in project cxf by apache.
the class EncoderDecoder10AImpl method buildHeaderFaultObject.
@Override
protected Object buildHeaderFaultObject(SequenceFault sf) {
org.apache.cxf.ws.rm.v200502wsa15.SequenceFaultType flt = new org.apache.cxf.ws.rm.v200502wsa15.SequenceFaultType();
flt.setFaultCode(sf.getFaultCode());
Object detail = sf.getDetail();
if (detail instanceof Element) {
flt.getAny().add(detail);
} else if (detail instanceof Identifier) {
flt.getAny().add(VersionTransformer.convert200502wsa15((Identifier) detail));
} else if (detail instanceof SequenceAcknowledgement) {
flt.getAny().add(VersionTransformer.convert200502wsa15((SequenceAcknowledgement) detail));
}
Element data = sf.getExtraDetail();
if (data != null) {
flt.getAny().add(data);
}
return flt;
}
use of org.apache.cxf.ws.rm.v200702.Identifier in project cxf by apache.
the class ManagedRMEndpoint method getSourceSeq.
private SourceSequence getSourceSeq(String sid) {
Source source = endpoint.getSource();
Identifier identifier = RMUtils.getWSRMFactory().createIdentifier();
identifier.setValue(sid);
return source.getSequence(identifier);
}
use of org.apache.cxf.ws.rm.v200702.Identifier in project cxf by apache.
the class ManagedRMEndpoint method getDestinationSequenceAcknowledgedRange.
@ManagedOperation(description = "Destination Sequence Acknowledged Range")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "sequenceId", description = "The sequence identifier") })
public Long[] getDestinationSequenceAcknowledgedRange(String sid) {
DestinationSequence ds = getDestinationSeq(sid);
if (null == ds) {
throw new IllegalArgumentException("no sequence");
}
List<Long> list = new ArrayList<>();
for (AcknowledgementRange r : ds.getAcknowledgment().getAcknowledgementRange()) {
list.add(r.getLower());
list.add(r.getUpper());
}
return list.toArray(new Long[0]);
}
use of org.apache.cxf.ws.rm.v200702.Identifier in project cxf by apache.
the class ManagedRMEndpoint method getSourceSequenceAcknowledgedRange.
@ManagedOperation(description = "Source Sequence Acknowledged Range")
@ManagedOperationParameters({ @ManagedOperationParameter(name = "sequenceId", description = "The sequence identifier") })
public Long[] getSourceSequenceAcknowledgedRange(String sid) {
SourceSequence ss = getSourceSeq(sid);
if (null == ss) {
throw new IllegalArgumentException("no sequence");
}
List<Long> list = new ArrayList<>();
for (AcknowledgementRange r : ss.getAcknowledgement().getAcknowledgementRange()) {
list.add(r.getLower());
list.add(r.getUpper());
}
return list.toArray(new Long[0]);
}
Aggregations