Package org.jscsi.target.scsi

Examples of org.jscsi.target.scsi.IResponseData


            public ProtocolDataUnit check (final Connection pConnection) throws InterruptedException , IOException , InternetSCSIException {
                ProtocolDataUnit responsePdu;
                final BasicHeaderSegment bhs = new ProtocolDataUnitFactory().create(false, true, OperationCode.SCSI_COMMAND, "None", "None").getBasicHeaderSegment();
                final SCSICommandParser parser = (SCSICommandParser) bhs.getParser();
                final InquiryCDB cdb = new InquiryCDB(parser.getCDB());
                IResponseData responseData = null;

                if (!cdb.getEnableVitalProductData()) {
                    responseData = StandardInquiryData.getInstance();
                } else {
                    final VitalProductDataPageName pageName = cdb.getPageCode().getVitalProductDataPageName();

                    switch (pageName) {// is never null
                        case SUPPORTED_VPD_PAGES :
                            responseData = SupportedVpdPages.getInstance();
                            break;
                        case DEVICE_IDENTIFICATION :
                            responseData = session.getTargetServer().getDeviceIdentificationVpdPage();
                            break;
                        default :
                            throw new InternetSCSIException();
                    }
                }

                // The part from the targetfullfeaturephase

                final ByteBuffer fullBuffer = ByteBuffer.allocate(responseData.size());
                responseData.serialize(fullBuffer, 0);

                ByteBuffer trimmedBuffer;
                if (fullBuffer.capacity() <= parser.getExpectedDataTransferLength()) {
                    trimmedBuffer = fullBuffer;
                } else {
View Full Code Here


        } else {
            // PDU is okay
            // carry out command

            IResponseData responseData = null;

            // "If the EVPD bit is set to zero, ...
            if (!cdb.getEnableVitalProductData()) {
                // ... the device server shall return the standard INQUIRY
                // data."
View Full Code Here

TOP

Related Classes of org.jscsi.target.scsi.IResponseData

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.