Package com.exonum.binding.core.runtime
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 Summary
Constructors Constructor Description ServiceArtifactId() -
Method Summary
Modifier and Type Method Description abstract StringgetName()Returns the full artifact name of this service (e.g., "com.acme:land-registry:1.2.0").abstract intgetRuntimeId()Returns the runtime id in which the service shall be deployed.static ServiceArtifactIdnewJavaId(String name)Creates a new service artifact id of a Java artifact.static ServiceArtifactIdparseFrom(String serviceArtifactId)Parses a service id in format "runtimeId:serviceName" astoString()produces.StringtoString()Returns an artifact id in the following format: "runtimeId:serviceName".static ServiceArtifactIdvalueOf(int runtimeId, String name)Creates a new service artifact id.
-
Constructor Details
-
ServiceArtifactId
public ServiceArtifactId()
-
-
Method Details
-
getRuntimeId
public abstract int getRuntimeId()Returns the runtime id in which the service shall be deployed. -
getName
Returns the full artifact name of this service (e.g., "com.acme:land-registry:1.2.0"). -
parseFrom
Parses a service id in format "runtimeId:serviceName" astoString()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
Creates a new service artifact id of a Java artifact.- Parameters:
name- the name of the service; must not be blank
-
valueOf
Creates a new service artifact id.- Parameters:
runtimeId- the runtime id in which the service shall be deployedname- the name of the service; must not be blank
-
toString
Returns an artifact id in the following format: "runtimeId:serviceName".
-