Skip to content

Commit d6b3b21

Browse files
Move ServiceArtifactId to common: [ECR-4279] (#1452)
It might be used by some clients (e.g., the Java service launcher) to parse the SAID.
1 parent 9ae3c88 commit d6b3b21

File tree

32 files changed

+51
-33
lines changed

32 files changed

+51
-33
lines changed

exonum-java-binding/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ stable Exonum release. See [release notes][exonum-1.0.0-rc.1] for details.
121121
- Java 11 is the minimum required version to run Exonum services.
122122
_Client_ libraries: `exonum-messages` and `exonum-java-binding-common` remain
123123
Java 8 compatible.
124+
- ServiceArtifactId and RuntimeId are moved to
125+
`com.exonum.binding.common.runtime` package. (#1452)
124126

125127
### Removed
126128
- Classes supporting no longer used tree-like list proof representation.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2019 The Exonum Team
2+
* Copyright 2020 The Exonum Team
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.exonum.binding.core.runtime;
17+
package com.exonum.binding.common.runtime;
1818

1919
import java.util.regex.Matcher;
2020
import java.util.regex.Pattern;

exonum-java-binding/core/src/main/java/com/exonum/binding/core/runtime/RuntimeId.java renamed to exonum-java-binding/common/src/main/java/com/exonum/binding/common/runtime/RuntimeId.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2019 The Exonum Team
2+
* Copyright 2020 The Exonum Team
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.exonum.binding.core.runtime;
17+
package com.exonum.binding.common.runtime;
1818

1919
/**
2020
* Represents well-known runtime ids, as assigned by the Exonum core.
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2019 The Exonum Team
2+
* Copyright 2020 The Exonum Team
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,12 +14,11 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.exonum.binding.core.runtime;
17+
package com.exonum.binding.common.runtime;
1818

19-
import static com.exonum.binding.core.runtime.RuntimeId.JAVA;
19+
import static com.exonum.binding.common.runtime.RuntimeId.JAVA;
2020
import static com.google.common.base.Preconditions.checkArgument;
2121
import static java.lang.Integer.parseInt;
22-
import static org.apache.logging.log4j.util.Strings.isNotBlank;
2322

2423
import com.exonum.messages.core.runtime.Base.ArtifactId;
2524
import com.google.auto.value.AutoValue;
@@ -94,6 +93,10 @@ public static ServiceArtifactId valueOf(int runtimeId, String name, String versi
9493
return new AutoValue_ServiceArtifactId(runtimeId, name, version);
9594
}
9695

96+
private static boolean isNotBlank(String s) {
97+
return !s.trim().isEmpty();
98+
}
99+
97100
/**
98101
* Creates a new service artifact from the given artifact id message.
99102
*/
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2019 The Exonum Team
2+
* Copyright 2020 The Exonum Team
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,9 +14,9 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.exonum.binding.core.runtime;
17+
package com.exonum.binding.common.runtime;
1818

19-
import static com.exonum.binding.core.runtime.JavaArtifactUtils.checkNoForbiddenChars;
19+
import static com.exonum.binding.common.runtime.JavaArtifactUtils.checkNoForbiddenChars;
2020
import static org.junit.jupiter.api.Assertions.assertThrows;
2121

2222
import org.junit.jupiter.api.Test;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
/*
2-
* Copyright 2019 The Exonum Team
2+
* Copyright 2020 The Exonum Team
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
66
* You may obtain a copy of the License at
77
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
8+
* https://www.apache.org/licenses/LICENSE-2.0
99
*
1010
* Unless required by applicable law or agreed to in writing, software
1111
* distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package com.exonum.binding.core.runtime;
17+
package com.exonum.binding.common.runtime;
1818

1919
import static org.assertj.core.api.Assertions.assertThat;
2020
import static org.junit.jupiter.api.Assertions.assertThrows;

exonum-java-binding/core/src/main/java/com/exonum/binding/core/runtime/LoadedServiceDefinition.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.exonum.binding.core.runtime;
1818

19+
import com.exonum.binding.common.runtime.ServiceArtifactId;
1920
import com.exonum.binding.core.service.ServiceModule;
2021
import com.google.auto.value.AutoValue;
2122
import java.util.function.Supplier;

exonum-java-binding/core/src/main/java/com/exonum/binding/core/runtime/Pf4jServiceLoader.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616

1717
package com.exonum.binding.core.runtime;
1818

19-
import static com.exonum.binding.core.runtime.RuntimeId.JAVA;
19+
import static com.exonum.binding.common.runtime.RuntimeId.JAVA;
2020
import static com.google.common.base.Preconditions.checkArgument;
2121
import static com.google.common.base.Preconditions.checkNotNull;
2222
import static com.google.common.base.Preconditions.checkState;
2323

24+
import com.exonum.binding.common.runtime.ServiceArtifactId;
2425
import com.exonum.binding.core.service.ServiceModule;
2526
import com.google.common.base.MoreObjects;
2627
import com.google.inject.Inject;

exonum-java-binding/core/src/main/java/com/exonum/binding/core/runtime/ServiceInstanceSpec.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package com.exonum.binding.core.runtime;
1818

1919
import com.exonum.binding.common.message.TransactionMessage;
20+
import com.exonum.binding.common.runtime.ServiceArtifactId;
2021
import com.google.auto.value.AutoValue;
2122

2223
/**

exonum-java-binding/core/src/main/java/com/exonum/binding/core/runtime/ServiceLoader.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package com.exonum.binding.core.runtime;
1818

19+
import com.exonum.binding.common.runtime.ServiceArtifactId;
1920
import java.nio.file.Path;
2021
import java.util.Optional;
2122

0 commit comments

Comments
 (0)