Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions exonum-java-binding/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ stable Exonum release. See [release notes][exonum-1.0.0-rc.1] for details.
- Java 11 is the minimum required version to run Exonum services.
_Client_ libraries: `exonum-messages` and `exonum-java-binding-common` remain
Java 8 compatible.
- ServiceArtifactId and RuntimeId are moved to
`com.exonum.binding.common.runtime` package. (#1452)

### Removed
- Classes supporting no longer used tree-like list proof representation.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2019 The Exonum Team
* Copyright 2020 The Exonum Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.exonum.binding.core.runtime;
package com.exonum.binding.common.runtime;

import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2019 The Exonum Team
* Copyright 2020 The Exonum Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.exonum.binding.core.runtime;
package com.exonum.binding.common.runtime;

/**
* Represents well-known runtime ids, as assigned by the Exonum core.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2019 The Exonum Team
* Copyright 2020 The Exonum Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,12 +14,11 @@
* limitations under the License.
*/

package com.exonum.binding.core.runtime;
package com.exonum.binding.common.runtime;

import static com.exonum.binding.core.runtime.RuntimeId.JAVA;
import static com.exonum.binding.common.runtime.RuntimeId.JAVA;
import static com.google.common.base.Preconditions.checkArgument;
import static java.lang.Integer.parseInt;
import static org.apache.logging.log4j.util.Strings.isNotBlank;

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

private static boolean isNotBlank(String s) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... to enforce the said invariant?

return !s.trim().isEmpty();
}

/**
* Creates a new service artifact from the given artifact id message.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2019 The Exonum Team
* Copyright 2020 The Exonum Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,9 +14,9 @@
* limitations under the License.
*/

package com.exonum.binding.core.runtime;
package com.exonum.binding.common.runtime;

import static com.exonum.binding.core.runtime.JavaArtifactUtils.checkNoForbiddenChars;
import static com.exonum.binding.common.runtime.JavaArtifactUtils.checkNoForbiddenChars;
import static org.junit.jupiter.api.Assertions.assertThrows;

import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2019 The Exonum Team
* Copyright 2020 The Exonum Team
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.exonum.binding.core.runtime;
package com.exonum.binding.common.runtime;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.exonum.binding.core.runtime;

import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.service.ServiceModule;
import com.google.auto.value.AutoValue;
import java.util.function.Supplier;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@

package com.exonum.binding.core.runtime;

import static com.exonum.binding.core.runtime.RuntimeId.JAVA;
import static com.exonum.binding.common.runtime.RuntimeId.JAVA;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull;
import static com.google.common.base.Preconditions.checkState;

import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.service.ServiceModule;
import com.google.common.base.MoreObjects;
import com.google.inject.Inject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
package com.exonum.binding.core.runtime;

import com.exonum.binding.common.message.TransactionMessage;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.google.auto.value.AutoValue;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.exonum.binding.core.runtime;

import com.exonum.binding.common.runtime.ServiceArtifactId;
import java.nio.file.Path;
import java.util.Optional;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.exonum.binding.common.crypto.PublicKey;
import com.exonum.binding.common.hash.HashCode;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.blockchain.BlockchainData;
import com.exonum.binding.core.service.BlockCommittedEvent;
import com.exonum.binding.core.service.BlockCommittedEventImpl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.exonum.binding.common.crypto.PublicKey;
import com.exonum.binding.common.hash.HashCode;
import com.exonum.binding.common.messages.DeployArguments;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.blockchain.BlockchainData;
import com.exonum.binding.core.proxy.Cleaner;
import com.exonum.binding.core.proxy.CloseFailuresException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.mock;

import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.service.AbstractServiceModule;
import com.exonum.binding.core.service.Node;
import com.exonum.binding.core.service.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;

import com.exonum.binding.common.runtime.RuntimeId;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.service.Service;
import com.exonum.binding.core.service.ServiceModule;
import com.exonum.binding.test.runtime.ServiceArtifactBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import static org.mockito.Mockito.when;

import com.exonum.binding.common.messages.DeployArguments;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.blockchain.BlockchainData;
import com.exonum.binding.core.proxy.Cleaner;
import com.exonum.binding.core.proxy.CloseFailuresException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;

import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.blockchain.BlockchainData;
import com.exonum.binding.core.proxy.Cleaner;
import com.exonum.binding.core.storage.database.Fork;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@

import com.exonum.binding.common.crypto.PublicKey;
import com.exonum.binding.common.hash.HashCode;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.blockchain.BlockchainData;
import com.exonum.binding.core.proxy.Cleaner;
import com.exonum.binding.core.proxy.CloseFailuresException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import com.exonum.binding.common.crypto.PublicKey;
import com.exonum.binding.common.hash.HashCode;
import com.exonum.binding.common.hash.Hashing;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.blockchain.BlockchainData;
import com.exonum.binding.core.service.Configurable;
import com.exonum.binding.core.service.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.runtime.ServiceInstanceSpec;
import io.vertx.ext.web.Router;
import org.junit.jupiter.api.Test;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import static com.google.common.base.Preconditions.checkState;

import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.google.common.base.Strings;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.runtime.ServiceInstanceSpec;
import com.exonum.binding.core.service.Service;
import com.google.inject.AbstractModule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.exonum.binding.common.blockchain.CallInBlocks;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.blockchain.Blockchain;
import com.exonum.binding.core.blockchain.BlockchainData;
import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.core.service.AbstractServiceModule;
import com.exonum.binding.core.service.Node;
import com.exonum.binding.core.service.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import static com.google.common.base.Preconditions.checkState;

import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.google.common.base.Strings;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.exonum.binding.qaservice;

import static com.exonum.binding.core.runtime.RuntimeId.JAVA;
import static com.exonum.binding.common.runtime.RuntimeId.JAVA;
import static com.exonum.binding.qaservice.QaArtifactInfo.ARTIFACT_ID;
import static com.exonum.binding.qaservice.QaArtifactInfo.QA_SERVICE_ID;
import static com.exonum.binding.qaservice.QaArtifactInfo.QA_SERVICE_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import static com.google.common.base.Preconditions.checkState;

import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.qaservice.Config.QaConfiguration;
import com.exonum.binding.testkit.TestKit;
import com.exonum.binding.testkit.TestKit.Builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.exonum.binding.qaservice;

import static com.exonum.binding.core.runtime.RuntimeId.JAVA;
import static com.exonum.binding.common.runtime.RuntimeId.JAVA;
import static com.exonum.binding.qaservice.QaArtifactInfo.ARTIFACT_ID;
import static com.exonum.binding.qaservice.QaArtifactInfo.QA_SERVICE_ID;
import static com.exonum.binding.qaservice.QaArtifactInfo.QA_SERVICE_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import static org.hamcrest.Matchers.equalTo;

import com.exonum.binding.core.blockchain.Blockchain;
import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.testkit.TestKit;
import com.google.common.base.Strings;
import java.nio.file.Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import static com.google.common.base.Preconditions.checkState;

import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.google.common.base.Strings;
import java.nio.file.Path;
import java.nio.file.Paths;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
import com.exonum.binding.common.blockchain.ExecutionStatuses;
import com.exonum.binding.common.crypto.KeyPair;
import com.exonum.binding.common.message.TransactionMessage;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.blockchain.Block;
import com.exonum.binding.core.blockchain.Blockchain;
import com.exonum.binding.core.blockchain.BlockchainData;
import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.core.storage.indices.MapIndex;
import com.exonum.binding.fakeservice.FakeSchema;
import com.exonum.binding.fakeservice.Transactions.PutTransactionArgs;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.exonum.binding.common.hash.HashCode;
import com.exonum.binding.common.message.TransactionMessage;
import com.exonum.binding.common.messages.DeployArguments;
import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.common.serialization.Serializer;
import com.exonum.binding.core.blockchain.Block;
import com.exonum.binding.core.blockchain.Blockchain;
Expand All @@ -35,7 +36,6 @@
import com.exonum.binding.core.proxy.CloseFailuresException;
import com.exonum.binding.core.runtime.DispatcherSchema;
import com.exonum.binding.core.runtime.FrameworkModule;
import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.core.runtime.ServiceRuntimeAdapter;
import com.exonum.binding.core.service.BlockCommittedEvent;
import com.exonum.binding.core.service.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import static org.assertj.core.api.Assertions.assertThat;

import com.exonum.binding.common.runtime.ServiceArtifactId;
import com.exonum.binding.core.runtime.DispatcherSchema;
import com.exonum.binding.core.runtime.ServiceArtifactId;
import com.exonum.binding.core.storage.database.Snapshot;
import com.exonum.binding.core.storage.indices.MapIndex;
import com.exonum.binding.test.runtime.ServiceArtifactBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
import static java.lang.String.format;

import com.exonum.binding.common.crypto.PublicKey;
import com.exonum.binding.common.runtime.RuntimeId;
import com.exonum.binding.common.serialization.Serializer;
import com.exonum.binding.common.serialization.StandardSerializers;
import com.exonum.binding.core.blockchain.BlockchainData;
import com.exonum.binding.core.runtime.RuntimeId;
import com.exonum.binding.core.storage.database.Prefixed;
import com.exonum.binding.core.storage.indices.IndexAddress;
import com.exonum.binding.core.storage.indices.MapIndex;
Expand Down