Add CordaRPCOps.notaryPartyFromX500Name (#1786)

This commit is contained in:
Ross Nicoll 2017-10-03 10:52:57 +01:00
parent dd3d8ba626
commit 5b79def791
2 changed files with 10 additions and 0 deletions

View File

@ -256,6 +256,14 @@ interface CordaRPCOps : RPCOps {
/** Returns the [Party] with the X.500 principal as it's [Party.name]. */
fun wellKnownPartyFromX500Name(x500Name: CordaX500Name): Party?
/**
* Get a notary identity by name.
*
* @return the notary identity, or null if there is no notary by that name. Note that this will return null if there
* is a peer with that name but they are not a recognised notary service.
*/
fun notaryPartyFromX500Name(x500Name: CordaX500Name): Party?
/**
* Returns a list of candidate matches for a given string, with optional fuzzy(ish) matching. Fuzzy matching may
* get smarter with time e.g. to correct spelling errors, so you should not hard-code indexes into the results

View File

@ -200,6 +200,8 @@ class CordaRPCOpsImpl(
}
}
override fun notaryPartyFromX500Name(x500Name: CordaX500Name): Party? = services.networkMapCache.getNotary(x500Name)
override fun partiesFromName(query: String, exactMatch: Boolean): Set<Party> {
return database.transaction {
services.identityService.partiesFromName(query, exactMatch)