private void setStartClientFields(HandshakerReq.Builder req) {
    // Sets the default values.
    StartClientHandshakeReq.Builder startClientReq =
        StartClientHandshakeReq.newBuilder()
            .setHandshakeSecurityProtocol(HandshakeProtocol.ALTS)
            .addApplicationProtocols(APPLICATION_PROTOCOL)
            .addRecordProtocols(RECORD_PROTOCOL);
    // Sets handshaker options.
    if (handshakerOptions.getRpcProtocolVersions() != null) {
      startClientReq.setRpcVersions(handshakerOptions.getRpcProtocolVersions());
    }
    if (handshakerOptions instanceof AltsClientOptions) {
      AltsClientOptions clientOptions = (AltsClientOptions) handshakerOptions;
      if (!Strings.isNullOrEmpty(clientOptions.getTargetName())) {
        startClientReq.setTargetName(clientOptions.getTargetName());
      }
      for (String serviceAccount : clientOptions.getTargetServiceAccounts()) {
        startClientReq.addTargetIdentitiesBuilder().setServiceAccount(serviceAccount);
      }
    }
    req.setClientStart(startClientReq);
  }
private void setStartClientFields ( HandshakerReq . Builder req ) { StartClientHandshakeReq . Builder startClientReq = StartClientHandshakeReq . newBuilder ( ) . setHandshakeSecurityProtocol ( HandshakeProtocol . ALTS ) . addApplicationProtocols ( APPLICATION_PROTOCOL ) . addRecordProtocols ( RECORD_PROTOCOL ) ; if ( handshakerOptions . getRpcProtocolVersions ( ) != null ) { startClientReq . setRpcVersions ( handshakerOptions . getRpcProtocolVersions ( ) ) ; } if ( handshakerOptions instanceof AltsClientOptions ) { AltsClientOptions clientOptions = ( AltsClientOptions ) handshakerOptions ; if ( ! Strings . isNullOrEmpty ( clientOptions . getTargetName ( ) ) ) { startClientReq . setTargetName ( clientOptions . getTargetName ( ) ) ; } for ( String serviceAccount : clientOptions . getTargetServiceAccounts ( ) ) { startClientReq . addTargetIdentitiesBuilder ( ) . setServiceAccount ( serviceAccount ) ; } } req . setClientStart ( startClientReq ) ; }
Sets the start client fields for the passed handshake request.