public class Main { public static void main(String[] args) { EntityManagerFactory emf = Persistence.createEntityManagerFactory("wifi-dbPU"); DeviceJpaController deviceController = new DeviceJpaController(emf); NetworkInterfaceJpaController netController = new NetworkInterfaceJpaController(emf); Device device = new Device("laptop"); // 1 deviceController.create(device); // 2 NetworkInterface net = new NetworkInterface("eth0"); // 3 net.setDeviceId(device.getId()); // 4 netController.create(net); // 5 // The parent collection is updated by the above create } }
public void naction(String asuid, String cuid, String iuid, int actionTypeId, Attributes data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(asuid, tsuid); checkIsSCU(cuid); Attributes nactionrq = Commands.mkNActionRQ(rspHandler.getMessageID(), cuid, iuid, actionTypeId, data); invoke(pc, nactionrq, DataWriterAdapter.forAttributes(data), rspHandler, conn.getResponseTimeout()); }
public void cget(String cuid, int priority, Attributes data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(cuid, tsuid); checkIsSCU(cuid); Attributes cgetrq = Commands.mkCGetRQ(rspHandler.getMessageID(), cuid, priority); invoke(pc, cgetrq, new DataWriterAdapter(data), rspHandler, conn.getRetrieveTimeout(), !conn.isRetrieveTimeoutTotal()); }
public DimseRSP cecho(String cuid) throws IOException, InterruptedException { FutureDimseRSP rsp = new FutureDimseRSP(nextMessageID()); PresentationContext pc = pcFor(cuid, null); checkIsSCU(cuid); Attributes cechorq = Commands.mkCEchoRQ(rsp.getMessageID(), cuid); invoke(pc, cechorq, null, rsp, conn.getResponseTimeout()); return rsp; }
public CompatibleConnection findCompatibleConnection(ApplicationEntity remote) throws IncompatibleConnectionException { for (Connection remoteConn : remote.conns) if (remoteConn.isInstalled() && remoteConn.isServer()) for (Connection conn : conns) if (conn.isInstalled() && conn.isCompatible(remoteConn)) return new CompatibleConnection(conn, remoteConn); throw new IncompatibleConnectionException( "No compatible connection to " + remote.getAETitle() + " available on " + aet); }
public void nget(String asuid, String cuid, String iuid, int[] tags, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(asuid, null); checkIsSCU(cuid); Attributes ngetrq = Commands.mkNGetRQ(rspHandler.getMessageID(), cuid, iuid, tags); invoke(pc, ngetrq, null, rspHandler, conn.getResponseTimeout()); }
public void cstore(String cuid, String iuid, int priority, String moveOriginatorAET, int moveOriginatorMsgId, DataWriter data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(cuid, tsuid); Attributes cstorerq = Commands.mkCStoreRQ(rspHandler.getMessageID(), cuid, iuid, priority, moveOriginatorAET, moveOriginatorMsgId); invoke(pc, cstorerq, data, rspHandler, conn.getResponseTimeout()); }
public void cfind(String cuid, int priority, Attributes data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(cuid, tsuid); checkIsSCU(cuid); Attributes cfindrq = Commands.mkCFindRQ(rspHandler.getMessageID(), cuid, priority); invoke(pc, cfindrq, new DataWriterAdapter(data), rspHandler, conn.getResponseTimeout()); }
public void cmove(String cuid, int priority, Attributes data, String tsuid, String destination, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(cuid, tsuid); checkIsSCU(cuid); Attributes cmoverq = Commands.mkCMoveRQ(rspHandler.getMessageID(), cuid, priority, destination); invoke(pc, cmoverq, new DataWriterAdapter(data), rspHandler, conn.getRetrieveTimeout(), !conn.isRetrieveTimeoutTotal()); }
public void neventReport(String asuid, String cuid, String iuid, int eventTypeId, Attributes data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(asuid, tsuid); checkIsSCP(cuid); Attributes neventrq = Commands.mkNEventReportRQ(rspHandler.getMessageID(), cuid, iuid, eventTypeId, data); invoke(pc, neventrq, DataWriterAdapter.forAttributes(data), rspHandler, conn.getResponseTimeout()); }
public void ncreate(String asuid, String cuid, String iuid, Attributes data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(asuid, tsuid); checkIsSCU(cuid); Attributes ncreaterq = Commands.mkNCreateRQ(rspHandler.getMessageID(), cuid, iuid); invoke(pc, ncreaterq, DataWriterAdapter.forAttributes(data), rspHandler, conn.getResponseTimeout()); }
public void ndelete(String asuid, String cuid, String iuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(asuid, null); checkIsSCU(cuid); Attributes ndeleterq = Commands.mkNDeleteRQ(rspHandler.getMessageID(), cuid, iuid); invoke(pc, ndeleterq, null, rspHandler, conn.getResponseTimeout()); }
public void nset(String asuid, String cuid, String iuid, DataWriter data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(asuid, tsuid); checkIsSCU(cuid); Attributes nsetrq = Commands.mkNSetRQ(rspHandler.getMessageID(), cuid, iuid); invoke(pc, nsetrq, data, rspHandler, conn.getResponseTimeout()); }
public void invoke(PresentationContext pc, Attributes cmd, DataWriter data, DimseRSPHandler rspHandler, int rspTimeout, boolean stopOnPending) throws IOException, InterruptedException { stopTimeout(); checkException(); rspHandler.setPC(pc); addDimseRSPHandler(rspHandler); encoder.writeDIMSE(pc, cmd, data); startTimeout(rspHandler.getMessageID(), rspTimeout, stopOnPending); }
protected void onClose(Association as) { DimseRQHandler tmp = as.getApplicationEntity().getDimseRQHandler(); if (tmp != null) tmp.onClose(as); }
public void naction(String asuid, String cuid, String iuid, int actionTypeId, Attributes data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(asuid, tsuid); checkIsSCU(cuid); Attributes nactionrq = Commands.mkNActionRQ(rspHandler.getMessageID(), cuid, iuid, actionTypeId, data); invoke(pc, nactionrq, DataWriterAdapter.forAttributes(data), rspHandler, conn.getResponseTimeout()); }
public void nget(String asuid, String cuid, String iuid, int[] tags, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(asuid, null); checkIsSCU(cuid); Attributes ngetrq = Commands.mkNGetRQ(rspHandler.getMessageID(), cuid, iuid, tags); invoke(pc, ngetrq, null, rspHandler, conn.getResponseTimeout()); }
public void cstore(String cuid, String iuid, int priority, DataWriter data, String tsuid, DimseRSPHandler rspHandler) throws IOException, InterruptedException { PresentationContext pc = pcFor(cuid, tsuid); checkIsSCU(cuid); Attributes cstorerq = Commands.mkCStoreRQ(rspHandler.getMessageID(), cuid, iuid, priority); invoke(pc, cstorerq, data, rspHandler, conn.getResponseTimeout()); }