net.corda.node.services.transactions

## Class BFTSMaRt.Server

- net.corda.node.services.transactions.BFTSMaRt.Server

- Direct Known Subclasses:
    BFTNonValidatingNotaryService.Server
  Enclosing class:
    BFTSMaRt

      public static class BFTSMaRt.Server

  Maintains the commit log and executes commit commands received from the `class BFTSMaRt.Client`.

  The validation logic can be specified by implementing the executeCommand method.

  See Also:
    `class BFTSMaRt.Client`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `Server.Companion`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Server.Companion` | `Companion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Server(int id, org.jetbrains.exposed.sql.Database db, java.lang.String tableName, ServiceHubInternal services, TimestampChecker timestampChecker)` Maintains the commit log and executes commit commands received from the `class BFTSMaRt.Client`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `appExecuteBatch(byte[] command, bftsmart.tom.MessageContext[] mcs)`
    `byte[]` | `appExecuteUnordered(byte[] command, bftsmart.tom.MessageContext msgCtx)`
    `void` | `commitInputStates(java.util.List<net.corda.core.contracts.StateRef> states, SecureHash txId, Party callerIdentity)`
    `byte[]` | `executeCommand(byte[] command)` Implement logic to execute the command and commit the transaction to the log. Helper methods are provided for transaction processing: commitInputStates, `BFTSMaRt.Server.validateTimestamp`, and sign.
    `JDBCHashMap<net.corda.core.contracts.StateRef,net.corda.core.node.services.UniquenessProvider.ConsumingTx>` | `getCommitLog()`
    `org.jetbrains.exposed.sql.Database` | `getDb()`
    `int` | `getId()`
    `ServiceHubInternal` | `getServices()`
    `byte[]` | `getSnapshot()`
    `TimestampChecker` | `getTimestampChecker()`
    `void` | `installSnapshot(byte[] bytes)`
    `DigitalSignature.WithKey` | `sign(byte[] bytes)`
    `void` | `validateTimestamp(Timestamp t)`

- - ### Field Detail

    - #### Companion

          public static Server.Companion Companion

  - ### Constructor Detail

    - #### Server

          public Server(int id,
                        org.jetbrains.exposed.sql.Database db,
                        java.lang.String tableName,
                        ServiceHubInternal services,
                        TimestampChecker timestampChecker)

      Maintains the commit log and executes commit commands received from the `class BFTSMaRt.Client`.

      The validation logic can be specified by implementing the executeCommand method.

      See Also:
        `class BFTSMaRt.Client`

  - ### Method Detail

    - #### getCommitLog

          public JDBCHashMap<net.corda.core.contracts.StateRef,net.corda.core.node.services.UniquenessProvider.ConsumingTx> getCommitLog()

    - #### appExecuteUnordered

          public byte[] appExecuteUnordered(byte[] command,
                                            bftsmart.tom.MessageContext msgCtx)

    - #### appExecuteBatch

          public byte[] appExecuteBatch(byte[] command,
                                        bftsmart.tom.MessageContext[] mcs)

    - #### executeCommand

          public byte[] executeCommand(byte[] command)

      Implement logic to execute the command and commit the transaction to the log. Helper methods are provided for transaction processing: commitInputStates, `BFTSMaRt.Server.validateTimestamp`, and sign.

      See Also:
        `BFTSMaRt.Server.validateTimestamp`

    - #### commitInputStates

          public void commitInputStates(java.util.List<net.corda.core.contracts.StateRef> states,
                                        SecureHash txId,
                                        Party callerIdentity)

    - #### validateTimestamp

          public void validateTimestamp(Timestamp t)

    - #### sign

          public DigitalSignature.WithKey sign(byte[] bytes)

    - #### getSnapshot

          public byte[] getSnapshot()

    - #### installSnapshot

          public void installSnapshot(byte[] bytes)

    - #### getId

          public int getId()

    - #### getDb

          public org.jetbrains.exposed.sql.Database getDb()

    - #### getServices

          public ServiceHubInternal getServices()

    - #### getTimestampChecker

          public TimestampChecker getTimestampChecker()