diff --git a/core/src/main/kotlin/core/node/services/IdentityService.kt b/core/src/main/kotlin/core/node/services/IdentityService.kt index 506f3e7e6b..e89f3ca80b 100644 --- a/core/src/main/kotlin/core/node/services/IdentityService.kt +++ b/core/src/main/kotlin/core/node/services/IdentityService.kt @@ -9,7 +9,6 @@ import java.security.PublicKey * service would provide. */ interface IdentityService { - object Type : ServiceType("corda.identity") fun partyFromKey(key: PublicKey): Party? fun partyFromName(name: String): Party? } diff --git a/core/src/main/kotlin/core/node/services/ServiceType.kt b/core/src/main/kotlin/core/node/services/ServiceType.kt index e8635002e5..85295b2eef 100644 --- a/core/src/main/kotlin/core/node/services/ServiceType.kt +++ b/core/src/main/kotlin/core/node/services/ServiceType.kt @@ -9,7 +9,9 @@ package core.node.services /** - * Identifier for service types a node can expose. + * Identifier for service types a node can expose over the network to other peers. These types are placed into network + * map advertisements. Services that are purely local and are not providing functionality to other parts of the network + * don't need a declared service type. */ abstract class ServiceType(val id: String) { init { @@ -28,6 +30,5 @@ abstract class ServiceType(val id: String) { } override fun hashCode(): Int = id.hashCode() - override fun toString(): String = id.toString() } \ No newline at end of file diff --git a/src/main/kotlin/core/node/services/NetworkMapCache.kt b/src/main/kotlin/core/node/services/NetworkMapCache.kt index 2fc1fc3bec..ae135c53ff 100644 --- a/src/main/kotlin/core/node/services/NetworkMapCache.kt +++ b/src/main/kotlin/core/node/services/NetworkMapCache.kt @@ -1,11 +1,6 @@ package core.node.services -import core.Party -import core.crypto.DummyPublicKey -import core.messaging.SingleMessageRecipient import core.node.NodeInfo -import core.node.PhysicalLocation -import java.util.* /** * A network map contains lists of nodes on the network along with information about their identity keys, services @@ -17,7 +12,6 @@ import java.util.* * This interface assumes fast, synchronous access to an in-memory map. */ interface NetworkMapCache { - object Type : ServiceType("corda.network_map") val timestampingNodes: List<NodeInfo> val ratesOracleNodes: List<NodeInfo> val partyNodes: List<NodeInfo> diff --git a/src/main/kotlin/core/node/services/Services.kt b/src/main/kotlin/core/node/services/Services.kt index 8bc9fbfd44..28156265cb 100644 --- a/src/main/kotlin/core/node/services/Services.kt +++ b/src/main/kotlin/core/node/services/Services.kt @@ -47,7 +47,6 @@ data class Wallet(val states: List<StateAndRef<ContractState>>) { * consumed by someone else first! */ interface WalletService { - object Type : ServiceType("corda.wallet") /** * Returns a read-only snapshot of the wallet at the time the call is made. Note that if you consume states or * keys in this wallet, you must inform the wallet service so it can update its internal state. @@ -102,7 +101,6 @@ inline fun <reified T : LinearState> WalletService.linearHeadsOfType() = linearH * interface if/when one is developed. */ interface KeyManagementService { - object Type : ServiceType("corda.key_management") /** Returns a snapshot of the current pubkey->privkey mapping. */ val keys: Map<PublicKey, PrivateKey> @@ -118,7 +116,6 @@ interface KeyManagementService { * anything like that, this interface is only big enough to support the prototyping work. */ interface StorageService { - object Type : ServiceType("corda.storage") /** * A map of hash->tx where tx has been signature/contract validated and the states are known to be correct. * The signatures aren't technically needed after that point, but we keep them around so that we can relay @@ -143,9 +140,7 @@ interface StorageService { * Provides access to various metrics and ways to notify monitoring services of things, for sysadmin purposes. * This is not an interface because it is too lightweight to bother mocking out. */ -class MonitoringService(val metrics: MetricRegistry) { - object Type : ServiceType("corda.monitoring") -} +class MonitoringService(val metrics: MetricRegistry) /** * A service hub simply vends references to the other services a node has. Some of those services may be missing or