protected String shortenName(int shortenBy) throws VPlexApiException {
  s_logger.info("claimed volume name {} needs to be shortened by {} characters",_volumeInfo.getVolumeNativeId(),shortenBy);
  if (_storageSystemSerialNumber.length() > shortenBy) {
    return assembleDefaultName(_storageSystemSerialNumber.substring(shortenBy),_volumeNativeId);
  }
 else   if (_volumeNativeId.length() > shortenBy) {
    return assembleDefaultName(_storageSystemSerialNumber,_volumeNativeId.substring(shortenBy));
  }
 else {
    s_logger.warn("The storage system serial number {}  and volume native id" + "{} is not long enough to be " + "used for shortening the volume name by {} characters, so we "+ "are going to truncate the beginning of the whole name",_storageSystemSerialNumber,_volumeNativeId,shortenBy);
    String volumeName=assembleDefaultName(_storageSystemSerialNumber,_volumeNativeId);
    return VPlexApiConstants.VOLUME_NAME_PREFIX + volumeName.substring(shortenBy + 1);
  }
}

protected String shortenName ( int shortenBy ) throws VPlexApiException { s_logger . info ( "claimed volume name {} needs to be shortened by {} characters" , _volumeInfo . getVolumeNativeId ( ) , shortenBy ) ; if ( _storageSystemSerialNumber . length ( ) > shortenBy ) { return assembleDefaultName ( _storageSystemSerialNumber . substring ( shortenBy ) , _volumeNativeId ) ; } else if ( _volumeNativeId . length ( ) > shortenBy ) { return assembleDefaultName ( _storageSystemSerialNumber , _volumeNativeId . substring ( shortenBy ) ) ; } else { s_logger . warn ( "The storage system serial number {}  and volume native id" + "{} is not long enough to be " + "used for shortening the volume name by {} characters, so we " + "are going to truncate the beginning of the whole name" , _storageSystemSerialNumber , _volumeNativeId , shortenBy ) ; String volumeName = assembleDefaultName ( _storageSystemSerialNumber , _volumeNativeId ) ; return VPlexApiConstants . VOLUME_NAME_PREFIX + volumeName . substring ( shortenBy + 1 ) ; } }
creates a shortened claimed volume name string if the one generated by default does not fit within the maximum volume name length . can be overridden by child classes to return a custom shortened name format .
