use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project ORCID-Source by ORCID.
the class NotificationsApiServiceDelegatorImpl method findPermissionNotification.
@Override
@AccessControl(requiredScope = ScopePathType.PREMIUM_NOTIFICATION)
public Response findPermissionNotification(String orcid, Long id) {
checkIfProfileDeprecated(orcid);
Notification notification = notificationManager.findByOrcidAndId(orcid, id);
if (notification != null) {
checkSource(notification);
return Response.ok(notification).build();
} else {
Map<String, String> params = new HashMap<String, String>();
params.put("orcid", orcid);
params.put("id", String.valueOf(id));
throw new OrcidNotificationNotFoundException(params);
}
}
use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project universa by UniversaBlockchain.
the class NetworkV2 method unpack.
private List<Notification> unpack(byte[] packedNotifications) throws IOException {
List<Notification> nn = new ArrayList<>();
try {
// packet type code
Boss.Reader r = new Boss.Reader(packedNotifications);
if (r.readInt() != 1)
throw new IOException("invalid packed notification type code");
// from node number
int number = r.readInt();
NodeInfo from = getInfo(number);
if (from == null)
throw new IOException(myInfo.getNumber() + ": unknown node number: " + number);
// number of notifications in the packet
int count = r.readInt();
if (count < 0 || count > 1000)
throw new IOException("unvalid packed notifications count: " + count);
for (int i = 0; i < count; i++) {
nn.add(Notification.read(from, r));
}
return nn;
} catch (Exception e) {
// e.printStackTrace();
report(getLabel(), "failed to unpack notification: " + e, DatagramAdapter.VerboseLevel.BASE);
throw new IOException("failed to unpack notifications", e);
}
}
use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project narayana by jbosstm.
the class CompletionCoordinatorClient method sendRollback.
/**
* Send a rollback request.
* @param map addressing context initialised with to and message ID.
* @param identifier The identifier of the initiator.
* @throws com.arjuna.webservices.SoapFault For any errors.
* @throws java.io.IOException for any transport errors.
*/
public void sendRollback(final W3CEndpointReference endpoint, final MAP map, final InstanceIdentifier identifier) throws SoapFault, IOException {
MAPEndpoint initiator = getCompletionInitiator(endpoint);
AddressingHelper.installFromFaultTo(map, initiator, identifier);
CompletionCoordinatorPortType port = getPort(endpoint, map, rollbackAction);
Notification rollback = new Notification();
port.rollbackOperation(rollback);
}
use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project narayana by jbosstm.
the class ParticipantClient method sendRollback.
/**
* Send a rollback request.
* @param map addressing context initialised with to and message ID.
* @param identifier The identifier of the initiator.
* @throws com.arjuna.webservices.SoapFault For any errors.
* @throws java.io.IOException for any transport errors.
*/
public void sendRollback(final W3CEndpointReference endpoint, final MAP map, final InstanceIdentifier identifier) throws SoapFault, IOException {
MAPEndpoint coordinator = getCoordinator(endpoint, map);
AddressingHelper.installFromFaultTo(map, coordinator, identifier);
ParticipantPortType port = getPort(endpoint, map, rollbackAction);
Notification rollback = new Notification();
port.rollbackOperation(rollback);
}
use of org.oasis_open.docs.ws_tx.wsat._2006._06.Notification in project narayana by jbosstm.
the class ParticipantClient method sendCommit.
/**
* Send a commit request.
* @param map addressing context initialised with to and message ID.
* @param identifier The identifier of the initiator.
* @throws com.arjuna.webservices.SoapFault For any errors.
* @throws java.io.IOException for any transport errors.
*/
public void sendCommit(final W3CEndpointReference endpoint, final MAP map, final InstanceIdentifier identifier) throws SoapFault, IOException {
MAPEndpoint coordinator = getCoordinator(endpoint, map);
AddressingHelper.installFromFaultTo(map, coordinator, identifier);
ParticipantPortType port = getPort(endpoint, map, commitAction);
Notification commit = new Notification();
port.commitOperation(commit);
}
Aggregations