CLIUtils.configure(conn, cl);
device.addConnection(conn);
device.addApplicationEntity(ae);
ae.addConnection(conn);
final MppsSCU mppsscu = new MppsSCU(ae);
final StoreSCU storescu = new StoreSCU(ae);
final StgCmtSCU stgcmtscu = new StgCmtSCU(ae);
CLIUtils.configureConnect(mppsscu.getRemoteConnection(), mppsscu.getAAssociateRQ(), cl);
CLIUtils.configureConnect(stgcmtscu.getRemoteConnection(), stgcmtscu.getAAssociateRQ(), cl);
CLIUtils.configureConnect(storescu.getRemoteConnection(), storescu.getAAssociateRQ(), cl);
calledAET = storescu.getAAssociateRQ().getCalledAET();
mppsscu.setTransferSyntaxes(CLIUtils.transferSyntaxesOf(cl));
mppsscu.setCodes(CLIUtils.loadProperties(
cl.getOptionValue("code-config", "resource:code.properties"), null));
if (cl.hasOption("dc"))
mppsscu.setFinalStatus("DISCONTINUED");
if (cl.hasOption("dc-reason"))
mppsscu.setDiscontinuationReason(cl.getOptionValue("dc-reason"));
stgcmtscu.setTransferSyntaxes(CLIUtils.transferSyntaxesOf(cl));
stgcmtscu.setStorageDirectory(StgCmtSCU.getStorageDirectory(cl));
StoreSCU.configureRelatedSOPClass(storescu, cl);
storescu.setUIDSuffix(StoreSCU.uidSuffixOf(cl));
Attributes attrs = new Attributes();
CLIUtils.addAttributes(attrs, cl.getOptionValues("s"));
mppsscu.setAttributes(attrs);
storescu.setAttributes(attrs);
stgcmtscu.setAttributes(attrs);
setTlsParams(mppsscu.getRemoteConnection(), conn);
setTlsParams(storescu.getRemoteConnection(), conn);
setTlsParams(stgcmtscu.getRemoteConnection(), conn);
String tmpPrefix = "iocmtest-";
String tmpSuffix = null;
File tmpDir = null;
configureTmpFile(storescu, tmpPrefix, tmpSuffix, tmpDir, cl);
String mppsiuid = UIDUtils.createUID();
mppsscu.setPPSUID(mppsiuid);
if(cl.hasOption("kos-title")) {
List<String> fname = Arrays.asList(mkkos(cl));
scanFiles(fname, tmpPrefix, tmpSuffix, tmpDir, mppsscu, storescu, stgcmtscu);
} else {
stgcmtscu.setUIDSuffix(cl.getOptionValue("uid-suffix"));
storescu.setUIDSuffix(cl.getOptionValue("uid-suffix"));
mppsscu.setUIDSuffix(cl.getOptionValue("uid-suffix"));
scanFiles(cl.getArgList(), tmpPrefix, tmpSuffix, tmpDir, mppsscu, storescu, stgcmtscu);
}
ExecutorService executorService =
Executors.newCachedThreadPool();