Right now that's the only way I am able to perform a cfind():
association.cfind("1.2.840.10008.5.1.4.31",
0x0000, atts, "1.2.840.10008.1.2",
new DimseRSPHandler(assoc.nextMessageID()) {
@Override
public void onDimseRSP(Association as,
Attributes cmd, Attributes data) {
super.onDimseRSP(as, cmd, data);
// Do something with data...
}
});
However, there are other implementations of cfind() that return a DimseRSP object instead of void, but I can't make them work.
DimseRSP rsp = association.cfind("1.2.840.10008.5.1.4.31",
0x0000, atts, "1.2.840.10008.1.2", 0);
Attributes data = rsp.getDataset();
System.out.println(data); // prints null.
cfind() seems to be async and I think this causes the problem, but I don't know how to wait for the response before printing the results. Does anybody have a guess?