Package org.dcm4che3.net.pdu

Examples of org.dcm4che3.net.pdu.AAssociateRJ


        assertEquals(SPOOL_DIRECTORY, logger.getSpoolDirectory());
        assertTrue(logger.isIncludeInstanceUID());
        validate(logger.getAuditSuppressCriteriaList());
        Device arrDevice = logger.getAuditRecordRepositoryDevice();
        assertNotNull(arrDevice);
        AuditRecordRepository arr = arrDevice.getDeviceExtension(AuditRecordRepository.class);
        assertNotNull(arr);
        assertEquals(2, arr.getConnections().size());
    }
View Full Code Here


        logger.setIncludeInstanceUID(true);
        logger.addAuditSuppressCriteria(createAuditSuppressCriteria());
    }

    private AuditSuppressCriteria createAuditSuppressCriteria() {
        AuditSuppressCriteria criteria = new AuditSuppressCriteria("AuditSuppressCriteria");
        criteria.setEventIDs(AuditMessages.EventID.ApplicationActivity);
        criteria.setEventActionCodes(AuditMessages.EventActionCode.Execute);
        criteria.setEventTypeCodes(AuditMessages.EventTypeCode.ApplicationStart,
                AuditMessages.EventTypeCode.ApplicationStop);
        criteria.setEventOutcomeIndicators(AuditMessages.EventOutcomeIndicator.Success);
        criteria.setUserIDs("UserID");
        criteria.setAlternativeUserIDs("AltUserID");
        criteria.setNetworkAccessPointIDs("127.0.0.1");
        criteria.setUserRoleIDCodes(AuditMessages.RoleIDCode.ApplicationLauncher);
        criteria.setUserIsRequestor(true);
        return criteria;
    }
View Full Code Here

        assertEquals(2, arr.getConnections().size());
    }

    private void validate(List<AuditSuppressCriteria> criteriaList) {
        assertEquals(1, criteriaList.size());
        AuditSuppressCriteria criteria = criteriaList.get(0);
        assertEquals("AuditSuppressCriteria", criteria.getCommonName());
        EventID[] eventIDs = criteria.getEventIDs();
        assertEquals(1, eventIDs.length);
        assertEquals(AuditMessages.EventID.ApplicationActivity.getCode(),
                eventIDs[0].getCode());
        assertEquals(AuditMessages.EventID.ApplicationActivity.getCodeSystemName(),
                eventIDs[0].getCodeSystemName());
        assertEquals(AuditMessages.EventID.ApplicationActivity.getDisplayName(),
                eventIDs[0].getDisplayName());
        String[] eventActionCodes = criteria.getEventActionCodes();
        assertEquals(1, eventActionCodes.length);
        assertEquals(AuditMessages.EventActionCode.Execute, eventActionCodes[0]);
        EventTypeCode[] eventTypeCodes = criteria.getEventTypeCodes();
        assertEquals(2, eventTypeCodes.length);
        String[] eventOutcomeIndicators = criteria.getEventOutcomeIndicators();
        assertEquals(1, eventOutcomeIndicators.length);
        assertEquals(AuditMessages.EventOutcomeIndicator.Success, eventOutcomeIndicators[0]);
        String[] userIDs = criteria.getUserIDs();
        assertEquals(1, userIDs.length);
        assertEquals("UserID", userIDs[0]);
        String[] altUserIDs = criteria.getAlternativeUserIDs();
        assertEquals(1, altUserIDs.length);
        assertEquals("AltUserID", altUserIDs[0]);
        String[] networkAccessPointIDs = criteria.getNetworkAccessPointIDs();
        assertEquals(1, networkAccessPointIDs.length);
        assertEquals("127.0.0.1", networkAccessPointIDs[0]);
        RoleIDCode[] userRoleIDCodes = criteria.getUserRoleIDCodes();
        assertEquals(1, userRoleIDCodes.length);
        assertEquals(AuditMessages.RoleIDCode.ApplicationLauncher.getCode(),
                userRoleIDCodes[0].getCode());
        assertEquals(AuditMessages.RoleIDCode.ApplicationLauncher.getCodeSystemName(),
                userRoleIDCodes[0].getCodeSystemName());
        assertEquals(AuditMessages.RoleIDCode.ApplicationLauncher.getDisplayName(),
                userRoleIDCodes[0].getDisplayName());
        assertEquals(true, criteria.getUserIsRequestor());
    }
View Full Code Here

    }

    protected AAssociateAC negotiate(Association as, AAssociateRQ rq)
            throws IOException {
        if ((rq.getProtocolVersion() & 1) == 0)
            throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_PERMANENT,
                    AAssociateRJ.SOURCE_SERVICE_PROVIDER_ACSE,
                    AAssociateRJ.REASON_PROTOCOL_VERSION_NOT_SUPPORTED);
        if (!rq.getApplicationContext().equals(
                UID.DICOMApplicationContextName))
            throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_PERMANENT,
                    AAssociateRJ.SOURCE_SERVICE_USER,
                    AAssociateRJ.REASON_APP_CTX_NAME_NOT_SUPPORTED);
        ApplicationEntity ae = as.getApplicationEntity();
        if (ae == null || !ae.getConnections().contains(as.getConnection())
                || !ae.isInstalled() || !ae.isAssociationAcceptor())
            throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_PERMANENT,
                    AAssociateRJ.SOURCE_SERVICE_USER,
                    AAssociateRJ.REASON_CALLED_AET_NOT_RECOGNIZED);
        if (!ae.isAcceptedCallingAETitle(rq.getCallingAET()))
            throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_PERMANENT,
                    AAssociateRJ.SOURCE_SERVICE_USER,
                    AAssociateRJ.REASON_CALLING_AET_NOT_RECOGNIZED);
        UserIdentityAC userIdentity = getUserIdNegotiator() != null
                ? getUserIdNegotiator().negotiate(as, rq.getUserIdentityRQ())
                : null;
        if (ae.getDevice().isLimitOfOpenAssociationsExceeded())
            throw new AAssociateRJ(AAssociateRJ.RESULT_REJECTED_TRANSIENT,
                    AAssociateRJ.SOURCE_SERVICE_PROVIDER_ACSE,
                    AAssociateRJ.REASON_LOCAL_LIMIT_EXCEEDED);
        return makeAAssociateAC(as, rq, userIdentity);
    }
View Full Code Here

            as.onPDataTF();
            return;
        case PDUType.A_ASSOCIATE_RJ:
            checkPDULength(4);
            get();
            as.onAAssociateRJ(new AAssociateRJ(get(), get(), get()));
            break;
        case PDUType.A_RELEASE_RQ:
            checkPDULength(4);
            as.onAReleaseRQ();
            break;
View Full Code Here

        this.status = status;
    }

    public void setTransferSyntaxes(String[] tss) {
        rq.addPresentationContext(
                new PresentationContext(1, UID.VerificationSOPClass,
                        UID.ImplicitVRLittleEndian));
        rq.addPresentationContext(
                new PresentationContext(2,
                        UID.StorageCommitmentPushModelSOPClass,
                        tss));
        ae.addTransferCapability(
                new TransferCapability(null,
                        UID.VerificationSOPClass,
View Full Code Here

            LOG.warn("{}: M-DELETE {} failed!", as, file);
    }

    private DicomServiceRegistry createServiceRegistry() {
        DicomServiceRegistry serviceRegistry = new DicomServiceRegistry();
        serviceRegistry.addDicomService(new BasicCEchoSCP());
        serviceRegistry.addDicomService(cstoreSCP);
        return serviceRegistry;
    }
View Full Code Here

    public StgCmtSCU(ApplicationEntity ae) throws IOException {
        this.remote = new Connection();
        this.ae = ae;
        DicomServiceRegistry serviceRegistry = new DicomServiceRegistry();
        serviceRegistry.addDicomService(new BasicCEchoSCP());
        serviceRegistry.addDicomService(stgcmtResultHandler);
        ae.setDimseRQHandler(serviceRegistry);
    }
View Full Code Here

                    Attributes.createFileMetaInformation(iuid, cuid,
                            UID.ExplicitVRLittleEndian),
                    eventInfo);
        } catch (IOException e) {
            LOG.warn(as + ": Failed to store Storage Commitment Result:", e);
            throw new DicomServiceException(Status.ProcessingFailure, e);
        } finally {
            SafeClose.close(out);
        }
        return null;
    }
View Full Code Here

    @Override
    public void process(Exchange exchange) throws Exception {
        DicomMessage in = exchange.getIn(DicomMessage.class);
        Dimse dimse = in.getHeader("dimse", Dimse.class);
        if (dimse != Dimse.C_ECHO_RQ)
            throw new DicomServiceException(Status.UnrecognizedOperation);
        DicomMessage out = new DicomMessage(
                Dimse.C_ECHO_RSP,
                Commands.mkEchoRSP(in.getCommand(), Status.Success));
        exchange.setOut(out);
    }
View Full Code Here

TOP

Related Classes of org.dcm4che3.net.pdu.AAssociateRJ

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.