net.corda.node.internal

## Class CordaRPCOpsImpl

- net.corda.node.internal.CordaRPCOpsImpl

- All Implemented Interfaces:
    CordaRPCOps, RPCOps

      public class CordaRPCOpsImpl
      implements CordaRPCOps

  Server side implementations of RPCs available to MQ based client tools. Execution takes place on the server thread (i.e. serially). Arguments are serialised and deserialised automatically.

- - ### Nested Class Summary

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

  - ### Field Summary

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

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CordaRPCOpsImpl(ServiceHub services, StateMachineManager smm, org.jetbrains.exposed.sql.Database database)` Server side implementations of RPCs available to MQ based client tools. Execution takes place on the server thread (i.e. serially). Arguments are serialised and deserialised automatically.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addVaultTransactionNote(SecureHash txnId, java.lang.String txnNote)`
    `boolean` | `attachmentExists(SecureHash id)` Checks whether an attachment with the given hash is stored on the node.
    `void` | `authoriseContractUpgrade(StateAndRef<?> state, java.lang.Class<? extends net.corda.core.contracts.UpgradedContract<?,?>> upgradedContractClass)` Authorise a contract state upgrade. This will store the upgrade authorisation in the vault, and will be queried by ContractUpgradeFlow.Acceptor during contract upgrade process. Invoking this method indicate the node is willing to upgrade the state using the upgradedContractClass. This method will NOT initiate the upgrade process. To start the upgrade process, see ContractUpgradeFlow.Instigator.
    `java.time.Instant` | `currentNodeTime()` Returns the node's current time.
    `void` | `deauthoriseContractUpgrade(StateAndRef<?> state)` Authorise a contract state upgrade. This will remove the upgrade authorisation from the vault.
    `java.util.Map<java.util.Currency,net.corda.core.contracts.Amount>` | `getCashBalances()`
    `org.jetbrains.exposed.sql.Database` | `getDatabase()`
    `int` | `getProtocolVersion()` Returns the RPC protocol version. Exists since version 0 so guaranteed to be present.
    `ServiceHub` | `getServices()`
    `StateMachineManager` | `getSmm()`
    `java.lang.Iterable<java.lang.String>` | `getVaultTransactionNotes(SecureHash txnId)`
    `kotlin.Pair<java.util.List,rx.Observable>` | `networkMapUpdates()` Returns all parties currently visible on the network with their advertised services and an observable of future updates to the network.
    `NodeInfo` | `nodeIdentity()` Returns Node's identity, assuming this will not change while the node is running.
    `java.io.InputStream` | `openAttachment(SecureHash id)` Download an attachment JAR by ID
    `Party` | `partyFromKey(CompositeKey key)` Returns the Party corresponding to the given key, if found.
    `Party` | `partyFromName(java.lang.String name)` Returns the Party with the given name as it's Party.name
    `<T> FlowHandle<T>` | `startFlowDynamic(java.lang.Class<? extends net.corda.core.flows.FlowLogic<? extends T>> logicType, java.lang.Object args)` Start the given flow with the given arguments, returning an Observable with a single observation of the result of running the flow.
    `kotlin.Pair<java.util.List,rx.Observable>` | `stateMachineRecordedTransactionMapping()` Returns a snapshot list of existing state machine id - recorded transaction hash mappings, and a stream of future such mappings as well.
    `kotlin.Pair<java.util.List,rx.Observable>` | `stateMachinesAndUpdates()` Returns a pair of currently in-progress state machine infos and an observable of future state machine adds/removes.
    `SecureHash` | `uploadAttachment(java.io.InputStream jar)` Uploads a jar to the node, returns it's hash.
    `java.lang.String` | `uploadFile(java.lang.String dataType, java.lang.String name, java.io.InputStream file)`
    `kotlin.Pair<java.util.List,rx.Observable>` | `vaultAndUpdates()` Returns a pair of head states in the vault and an observable of future updates to the vault.
    `kotlin.Pair<java.util.List,rx.Observable>` | `verifiedTransactions()` Returns a pair of all recorded transactions and an observable of future recorded ones.
    `com.google.common.util.concurrent.ListenableFuture<kotlin.Unit>` | `waitUntilRegisteredWithNetworkMap()` Returns a ListenableFuture which completes when the node has registered wih the network map service. It can also complete with an exception if it is unable to.

    - ### Methods inherited from interface net.corda.core.messaging.CordaRPCOps

      `addVaultTransactionNote, attachmentExists, authoriseContractUpgrade, currentNodeTime, deauthoriseContractUpgrade, getCashBalances, getVaultTransactionNotes, networkMapUpdates, nodeIdentity, openAttachment, partyFromKey, partyFromName, startFlowDynamic, stateMachineRecordedTransactionMapping, stateMachinesAndUpdates, uploadAttachment, uploadFile, vaultAndUpdates, verifiedTransactions, waitUntilRegisteredWithNetworkMap`

    - ### Methods inherited from interface net.corda.core.messaging.RPCOps

      `getProtocolVersion`

- - ### Field Detail

    - #### Companion

          public static CordaRPCOpsImpl.Companion Companion

  - ### Constructor Detail

    - #### CordaRPCOpsImpl

          public CordaRPCOpsImpl(ServiceHub services,
                                 StateMachineManager smm,
                                 org.jetbrains.exposed.sql.Database database)

      Server side implementations of RPCs available to MQ based client tools. Execution takes place on the server thread (i.e. serially). Arguments are serialised and deserialised automatically.

  - ### Method Detail

    - #### getProtocolVersion

          public int getProtocolVersion()

      Returns the RPC protocol version. Exists since version 0 so guaranteed to be present.

    - #### networkMapUpdates

          public kotlin.Pair<java.util.List,rx.Observable> networkMapUpdates()

      Returns all parties currently visible on the network with their advertised services and an observable of future updates to the network.

    - #### vaultAndUpdates

          public kotlin.Pair<java.util.List,rx.Observable> vaultAndUpdates()

      Returns a pair of head states in the vault and an observable of future updates to the vault.

    - #### verifiedTransactions

          public kotlin.Pair<java.util.List,rx.Observable> verifiedTransactions()

      Returns a pair of all recorded transactions and an observable of future recorded ones.

    - #### stateMachinesAndUpdates

          public kotlin.Pair<java.util.List,rx.Observable> stateMachinesAndUpdates()

      Returns a pair of currently in-progress state machine infos and an observable of future state machine adds/removes.

    - #### stateMachineRecordedTransactionMapping

          public kotlin.Pair<java.util.List,rx.Observable> stateMachineRecordedTransactionMapping()

      Returns a snapshot list of existing state machine id - recorded transaction hash mappings, and a stream of future such mappings as well.

    - #### nodeIdentity

          public NodeInfo nodeIdentity()

      Returns Node's identity, assuming this will not change while the node is running.

    - #### addVaultTransactionNote

          public void addVaultTransactionNote(SecureHash txnId,
                                              java.lang.String txnNote)

    - #### getVaultTransactionNotes

          public java.lang.Iterable<java.lang.String> getVaultTransactionNotes(SecureHash txnId)

    - #### getCashBalances

          public java.util.Map<java.util.Currency,net.corda.core.contracts.Amount> getCashBalances()

    - #### startFlowDynamic

          public <T> FlowHandle<T> startFlowDynamic(java.lang.Class<? extends net.corda.core.flows.FlowLogic<? extends T>> logicType,
                                                    java.lang.Object args)

      Start the given flow with the given arguments, returning an Observable with a single observation of the result of running the flow.

    - #### attachmentExists

          public boolean attachmentExists(SecureHash id)

      Checks whether an attachment with the given hash is stored on the node.

    - #### openAttachment

          public java.io.InputStream openAttachment(SecureHash id)

      Download an attachment JAR by ID

    - #### uploadAttachment

          public SecureHash uploadAttachment(java.io.InputStream jar)

      Uploads a jar to the node, returns it's hash.

    - #### authoriseContractUpgrade

          public void authoriseContractUpgrade(StateAndRef<?> state,
                                               java.lang.Class<? extends net.corda.core.contracts.UpgradedContract<?,?>> upgradedContractClass)

      Authorise a contract state upgrade. This will store the upgrade authorisation in the vault, and will be queried by ContractUpgradeFlow.Acceptor during contract upgrade process. Invoking this method indicate the node is willing to upgrade the state using the upgradedContractClass. This method will NOT initiate the upgrade process. To start the upgrade process, see ContractUpgradeFlow.Instigator.

      See Also:
        ContractUpgradeFlow.Acceptor, ContractUpgradeFlow.Instigator

    - #### deauthoriseContractUpgrade

          public void deauthoriseContractUpgrade(StateAndRef<?> state)

      Authorise a contract state upgrade. This will remove the upgrade authorisation from the vault.

    - #### currentNodeTime

          public java.time.Instant currentNodeTime()

      Returns the node's current time.

    - #### uploadFile

          public java.lang.String uploadFile(java.lang.String dataType,
                                             java.lang.String name,
                                             java.io.InputStream file)

    - #### waitUntilRegisteredWithNetworkMap

          public com.google.common.util.concurrent.ListenableFuture<kotlin.Unit> waitUntilRegisteredWithNetworkMap()

      Returns a ListenableFuture which completes when the node has registered wih the network map service. It can also complete with an exception if it is unable to.

      See Also:
        ListenableFuture

    - #### partyFromKey

          public Party partyFromKey(CompositeKey key)

      Returns the Party corresponding to the given key, if found.

      See Also:
        Party

    - #### partyFromName

          public Party partyFromName(java.lang.String name)

      Returns the Party with the given name as it's Party.name

      See Also:
        Party, Party.name

    - #### getServices

          public ServiceHub getServices()

    - #### getSmm

          public StateMachineManager getSmm()

    - #### getDatabase

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