/** * Returns the combined length of all contained IDENTIFICATION DESCRIPTORs. * * @return the combined length of all contained IDENTIFICATION DESCRIPTORs */ private short getPageLength () { short pageLength = 0; for (int i = 0; i < identificationDescriptors.length; ++i) { pageLength += identificationDescriptors[i].size(); } return pageLength; }
public DeviceIdentificationVpdPage (TargetServer target) { /* * For each logical unit that is not a well known logical unit, the Device Identification VPD page shall include * at least one identification descriptor in which a logical unit name (see SAM-3) is indicated. */ final ProtocolIdentifier protocolIdentifier = ProtocolIdentifier.INTERNET_SCSI; final CodeSet codeSet = CodeSet.UTF8_CODES; final boolean protocolIdentifierValid = true; final Association association = Association.SCSI_TARGET_DEVICE; final IdentifierType identifierType = IdentifierType.SCSI_NAME_STRING; String[] targetNames = target.getTargetNames(); identificationDescriptors = new IdentificationDescriptor[targetNames.length]; for (int curTargetNum = 0; curTargetNum < targetNames.length; curTargetNum++) { final IdentificationDescriptor identDescriptor = new IdentificationDescriptor(protocolIdentifier, codeSet, protocolIdentifierValid, association, identifierType, new ScsiNameStringIdentifier(targetNames[curTargetNum])); identificationDescriptors[curTargetNum] = identDescriptor; } }