main.setRspHandlerFactory(new MppsSCU.RSPHandlerFactory() {
@Override
public DimseRSPHandler createDimseRSPHandlerForNCreate(final MppsSCU.MppsWithIUID mppsWithUID) {
return new DimseRSPHandler(0) {
@Override
public void onDimseRSP(Association as, Attributes cmd,
Attributes data) {
switch(cmd.getInt(Tag.Status, -1)) {
case Status.Success:
case Status.AttributeListError:
case Status.AttributeValueOutOfRange:
mppsWithUID.iuid = cmd.getString(
Tag.AffectedSOPInstanceUID, mppsWithUID.iuid);
main.addCreatedMpps(mppsWithUID);
}
super.onDimseRSP(as, cmd, data);
MppsTest.this.onNCreateRSP(cmd);
}
};
}
@Override
public DimseRSPHandler createDimseRSPHandlerForNSet() {
return new DimseRSPHandler(0) {
@Override
public void onDimseRSP(Association as, Attributes cmd, Attributes data) {
super.onDimseRSP(as, cmd, data);