src/main/java/software/amazon/qldb/Session.java
static Session startSession(String ledgerName, QldbSessionClient client) {
        final StartSessionRequest request = StartSessionRequest.builder().ledgerName(ledgerName).build();
        final SendCommandRequest command = SendCommandRequest.builder().startSession(request).build();

        logger.debug("Sending start session request: {}", command);
        final SendCommandResponse result = client.sendCommand(command);
        final String sessionToken = result.startSession().sessionToken();
        final String sessionId = result.responseMetadata().requestId();

        return new Session(ledgerName, sessionToken, sessionId, client);
    }
/**
     * Factory method for constructing a new Session, creating a new session to the QLDB on construction.
     *
     * @param ledgerName
     *              The name of the ledger to create a session to.
     * @param client
     *              The low-level session used for communication with QLDB.
     *
     * @return A newly created {@link Session}.
     */
Factory method for constructing a new Session, creating a new session to the QLDB on construction.
@param ledgerName
The name of the ledger to create a session to.
@param client
The low-level session used for communication with QLDB.

@return A newly created  Session.
Factory method for constructing a new Session creating a new session to the QLDB on construction . @param ledgerName The name of the ledger to create a session to . @param client The low - level session used for communication with QLDB . @return A newly created Session .
static Session startSession(String ledgerName, QldbSessionClient client) {
        final StartSessionRequest request = StartSessionRequest.builder().ledgerName(ledgerName).build();
        final SendCommandRequest command = SendCommandRequest.builder().startSession(request).build();
        logger.debug("Sending start session request: {}", command);
        final SendCommandResponse result = client.sendCommand(command);
        final String sessionToken = result.startSession().sessionToken();
        final String sessionId = result.responseMetadata().requestId();
        return new Session(ledgerName, sessionToken, sessionId, client);
    }
static Session startSession ( String ledgerName , QldbSessionClient client ) { final StartSessionRequest request = StartSessionRequest . builder ( ) . ledgerName ( ledgerName ) . build ( ) ; final SendCommandRequest command = SendCommandRequest . builder ( ) . startSession ( request ) . build ( ) ; logger . debug ( "Sending start session request: {}" , command ) ; final SendCommandResponse result = client . sendCommand ( command ) ; final String sessionToken = result . startSession ( ) . sessionToken ( ) ; final String sessionId = result . responseMetadata ( ) . requestId ( ) ; return new Session ( ledgerName , sessionToken , sessionId , client ) ; }
Factory method for constructing a new Session, creating a new session to the QLDB on construction.
Factory method for constructing a new Session creating a new session to the QLDB on construction .