Class ServiceArtifactId

java.lang.Object
com.exonum.binding.core.runtime.ServiceArtifactId

public abstract class ServiceArtifactId
extends Object
A service artifact identifier. It consists of the runtime id in which the service shall be deployed and the service artifact name. The name of Java artifacts usually contains the three coordinates identifying any Java artifact: groupId, artifactId and version.

The extensions of this class must be immutable and hence thread-safe.

  • Constructor Details

  • Method Details

    • getRuntimeId

      public abstract int getRuntimeId()
      Returns the runtime id in which the service shall be deployed.
    • getName

      public abstract String getName()
      Returns the full artifact name of this service (e.g., "com.acme:land-registry:1.2.0").
    • parseFrom

      public static ServiceArtifactId parseFrom​(String serviceArtifactId)
      Parses a service id in format "runtimeId:serviceName" as toString() produces.
      Parameters:
      serviceArtifactId - a string in format "runtimeId:serviceName". Whitespace characters, including preceding and trailing, are not allowed
      Returns:
      a ServiceArtifactId with the given coordinates
      Throws:
      IllegalArgumentException - if the format is not correct
    • newJavaId

      public static ServiceArtifactId newJavaId​(String name)
      Creates a new service artifact id of a Java artifact.
      Parameters:
      name - the name of the service; must not be blank
    • valueOf

      public static ServiceArtifactId valueOf​(int runtimeId, String name)
      Creates a new service artifact id.
      Parameters:
      runtimeId - the runtime id in which the service shall be deployed
      name - the name of the service; must not be blank
    • toString

      public final String toString()
      Returns an artifact id in the following format: "runtimeId:serviceName".
      Overrides:
      toString in class Object