use of org.dcm4chee.arc.ups.UPSContext in project dcm4chee-arc-light by dcm4che.
the class UPSServiceEJB method createOnStore.
private UPSContext createOnStore(String iuid, StoreContext storeCtx, Calendar now, UPSOnStore rule) {
UPSContext ctx = new UPSContextImpl(storeCtx, rule);
ctx.setUPSInstanceUID(iuid);
ctx.setAttributes(createOnStore(storeCtx, now, rule));
createUPS(ctx);
return ctx;
}
use of org.dcm4chee.arc.ups.UPSContext in project dcm4chee-arc-light by dcm4che.
the class UpsRS method changeUPSState.
private Response changeUPSState(String iuid, String requester, Attributes attrs) {
UPSContext ctx = service.newUPSContext(HttpServletRequestInfo.valueOf(request), getArchiveAE());
ctx.setUPSInstanceUID(iuid);
ctx.setRequesterAET(requester);
ctx.setAttributes(attrs);
try {
service.changeUPSState(ctx);
} catch (DicomServiceException e) {
return errResponse(UpsRS::changeStateFailed, e);
}
Response.ResponseBuilder ok = Response.ok();
switch(ctx.getStatus()) {
case Status.UPSAlreadyInRequestedStateOfCanceled:
ok.header("Warning", toWarning("The UPS is already in the requested state of CANCELED."));
break;
case Status.UPSAlreadyInRequestedStateOfCompleted:
ok.header("Warning", toWarning("The UPS is already in the requested state of COMPLETED."));
break;
}
return ok.build();
}
use of org.dcm4chee.arc.ups.UPSContext in project dcm4chee-arc-light by dcm4che.
the class UpsRS method subscribe.
@POST
@Path("/workitems/{workitem}/subscribers/{SubscriberAET}")
public Response subscribe(@PathParam("workitem") String iuid, @PathParam("SubscriberAET") String subscriber) {
UPSContext ctx = service.newUPSContext(HttpServletRequestInfo.valueOf(request), getArchiveAE());
ctx.setUPSInstanceUID(iuid);
ctx.setSubscriberAET(subscriber);
ctx.setDeletionLock(Boolean.parseBoolean(deletionlock));
ctx.setAttributes(matchKeys);
try {
service.createSubscription(ctx);
} catch (DicomServiceException e) {
return errResponse(UpsRS::subscriptionFailed, e);
}
return Response.created(websocketOf(ctx)).build();
}
use of org.dcm4chee.arc.ups.UPSContext in project dcm4chee-arc-light by dcm4che.
the class UPSPushSCP method get.
private Attributes get(Association as, Attributes rq, Attributes rqAttrs, Attributes rsp) throws DicomServiceException {
UPSContext ctx = service.newUPSContext(as);
ctx.setUPSInstanceUID(rq.getString(Tag.RequestedSOPInstanceUID));
service.findUPS(ctx);
return filter(ctx.getAttributes(), rq.getInts(Tag.AttributeIdentifierList));
}
use of org.dcm4chee.arc.ups.UPSContext in project dcm4chee-arc-light by dcm4che.
the class UPSPushSCP method create.
private Attributes create(Association as, Attributes rq, Attributes rqAttrs, Attributes rsp) throws DicomServiceException {
UPSContext ctx = service.newUPSContext(as);
ctx.setUPSInstanceUID(rq.getString(Tag.AffectedSOPInstanceUID));
ctx.setAttributes(rqAttrs);
service.createUPS(ctx);
return null;
}
Aggregations