com.r3corda.protocols / FetchDataProtocol / <init>

# <init>

`FetchDataProtocol(requests: Set<SecureHash>, otherSide: SingleMessageRecipient)`

An abstract protocol for fetching typed data from a remote peer.

Given a set of hashes (IDs), either loads them from local disk or asks the remote peer to provide them.

A malicious response in which the data provided by the remote peer does not hash to the requested hash results in DownloadedVsRequestedDataMismatch being thrown. If the remote peer doesnt have an entry, it results in a HashNotFound exception being thrown.

By default this class does not insert data into any local database, if you want to do that after missing items were fetched then override maybeWriteToDisk. You must override load and queryTopic. If the wire type is not the same as the ultimate type, you must also override convert.

### Parameters

`T` - The ultimate type of the data being fetched.
`W` - The wire type of the data being fetched, for when it isnt the same as the ultimate type.