private NetworkApplicationEntity mkStgCmtAE(Association as) { NetworkApplicationEntity stgcmtAE = new NetworkApplicationEntity(); NetworkConnection stgcmtNC = new NetworkConnection(); stgcmtNC.setHostname(as.getSocket().getInetAddress().getHostAddress()); stgcmtNC.setPort(stgcmtPort); stgcmtNC.setTlsCipherSuite(nc.getTlsCipherSuite()); stgcmtAE.setNetworkConnection(stgcmtNC); stgcmtAE.setAETitle(as.getRemoteAET()); stgcmtAE.setTransferCapability( new TransferCapability[] { new TransferCapability( UID.StorageCommitmentPushModelSOPClass, ONLY_DEF_TS, TransferCapability.SCU) }); return stgcmtAE; }
public final void setSocketCloseDelay(int delay) { nc.setSocketCloseDelay(delay); }
public final void setReleaseTimeout(int timeout) { nc.setReleaseTimeout(timeout); }
public final void setRequestTimeout(int timeout) { nc.setRequestTimeout(timeout); }
public final void setAcceptTimeout(int timeout) { nc.setAcceptTimeout(timeout); }
public final void setTcpNoDelay(boolean tcpNoDelay) { nc.setTcpNoDelay(tcpNoDelay); }
public final void setConnectTimeout(int connectTimeout) { nc.setConnectTimeout(connectTimeout); }
public final void setTlsAES_128_CBC() { nc.setTlsAES_128_CBC(); }
public final void setTlsWithoutEncyrption() { nc.setTlsWithoutEncyrption(); }
public final void setTls3DES_EDE_CBC() { nc.setTls3DES_EDE_CBC(); }
public final void setTlsProtocol(String[] tlsProtocol) { nc.setTlsProtocol(tlsProtocol); }
public final void setPort(int port) { nc.setPort(port); }
public final void setHostname(String hostname) { nc.setHostname(hostname); }
public final void setReceiveBufferSize(int bufferSize) { nc.setReceiveBufferSize(bufferSize); }
public final void setTlsNeedClientAuth(boolean needClientAuth) { nc.setTlsNeedClientAuth(needClientAuth); }
public final void setSendBufferSize(int bufferSize) { nc.setSendBufferSize(bufferSize); }
public void testRetrieveInputObjectsFromObjectStore() { String[] DEF_TS = {UID.ImplicitVRLittleEndian, UID.ExplicitVRLittleEndian}; PlanArchiveSim pas = new PlanArchiveSim("PAS", "localhost", 40406); try { pas.start(); } catch (IOException e1) { e1.printStackTrace(); assertTrue(false); } PlanHolderSim phs = new PlanHolderSim("PHS", "localhost", 40407); try { phs.start(); } catch (IOException e1) { e1.printStackTrace(); assertTrue(false); } String name = "TestSCUCMovePlan"; Device device = new Device(name); Executor executor = new NewThreadExecutor(name); NetworkApplicationEntity ae = new NetworkApplicationEntity(); NetworkConnection localConn = new NetworkConnection(); device.setNetworkApplicationEntity(ae); device.setNetworkConnection(localConn); ae.setNetworkConnection(localConn); ae.setAssociationInitiator(true); ae.setAssociationAcceptor(false); ae.setAETitle(name); ae.setTransferCapability( new TransferCapability[] { new TransferCapability( UID.StudyRootQueryRetrieveInformationModelMOVE, DEF_TS, TransferCapability.SCU) }); NetworkApplicationEntity remoteAE = new NetworkApplicationEntity(); NetworkConnection remoteConn = new NetworkConnection(); remoteAE.setInstalled(true); remoteAE.setAssociationAcceptor(true); remoteConn.setHostname("localhost"); remoteConn.setPort(40406); remoteAE.setNetworkConnection(remoteConn); remoteAE.setAETitle("PAS"); // ** // start Cmove Association // ** String abstractSyntaxUID = UID.StudyRootQueryRetrieveInformationModelMOVE; DicomObject attrs = setCmoveAttributes(); String transferSyntaxUid = UID.ImplicitVRLittleEndian; DimseRSP rsp = null; String movedUID = ""; Association assoc = null; try { assoc = ae.connect(remoteAE, executor); } catch (ConfigurationException e) { assertTrue(false); } catch (IOException e) { e.printStackTrace(); assertTrue(false); } catch (InterruptedException e) { assertTrue(false); } movedUID = phs.getPlanUID(); assertTrue(movedUID.equalsIgnoreCase("empty")); try { rsp = assoc.cmove(abstractSyntaxUID, 0, attrs, transferSyntaxUid, "PHS"); while (!rsp.next()) {} } catch (IOException e) { System.out.println(e.getMessage()); assertTrue(false); } catch (InterruptedException e) { System.out.println(e.getMessage()); assertTrue(false); } movedUID = phs.getPlanUID(); assertTrue(movedUID.equalsIgnoreCase("1.2.34.56")); phs.stop(); pas.stop(); }