-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2191 from commercetools/jvm-maintainance
Jvm sdk mantainance
- Loading branch information
Showing
81 changed files
with
7,892 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,16 @@ jobs: | |
distribution: 'adopt' | ||
java-version: '8' | ||
|
||
- run: mvn clean install javadoc:aggregate -DskipTests --no-transfer-progress -Pjavadoc-jdk-8u121 | ||
- run: mvn clean install javadoc:aggregate -DskipTests --no-transfer-progress -Pjavadoc-jdk-8u121,third-party-licenses | ||
- run: mvn exec:java -pl commercetools-internal-docs -Dexec.mainClass="introspection.rules.RulesMain" -Dexec.classpathScope="test" | ||
- run: mvn exec:java -pl commercetools-models -Dexec.mainClass="io.sphere.sdk.client.MainMethodThreadLeakTest" -Dexec.classpathScope="test" | ||
- run: mvn test verify --no-transfer-progress -Djava.util.logging.config.file=src/test/resources/logging.properties | ||
|
||
- uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
file_pattern: 'licenses/*' | ||
disable_globbing: true | ||
commit_message: "Update licenses" | ||
commit_user_name: Auto Mation | ||
commit_user_email: [email protected] | ||
commit_author: Auto Mation <[email protected]> |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you 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 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.5.4/apache-maven-3.5.4-bin.zip | ||
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
...ls/src/main/java/io/sphere/sdk/carts/commands/updateactions/SetLineItemSupplyChannel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package io.sphere.sdk.carts.commands.updateactions; | ||
|
||
import io.sphere.sdk.carts.Cart; | ||
import io.sphere.sdk.channels.Channel; | ||
import io.sphere.sdk.commands.UpdateActionImpl; | ||
import io.sphere.sdk.models.Reference; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* Sets the supply channel of the given LineItem. | ||
* The LineItem price is updated as described in LineItem Price selection. | ||
* | ||
* {@doc.gen intro} | ||
* | ||
* {@include.example io.sphere.sdk.carts.commands.CartUpdateCommandIntegrationTest} | ||
*/ | ||
public final class SetLineItemSupplyChannel extends UpdateActionImpl<Cart> { | ||
|
||
final private String lineItemId; | ||
@Nullable | ||
final private Reference<Channel> supplyChannel; | ||
|
||
private SetLineItemSupplyChannel(final String lineItemId, @Nullable final Reference<Channel> supplyChannel) { | ||
super("setLineItemSupplyChannel"); | ||
this.lineItemId = lineItemId; | ||
this.supplyChannel = supplyChannel; | ||
} | ||
|
||
public static SetLineItemSupplyChannel of(final String lineItemId, @Nullable final Reference<Channel> supplyChannel) { | ||
return new SetLineItemSupplyChannel(lineItemId, supplyChannel); | ||
} | ||
|
||
public String getLineItemId() { | ||
return lineItemId; | ||
} | ||
|
||
@Nullable | ||
public Reference<Channel> getSupplyChannel() { | ||
return supplyChannel; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...cetools-models/src/main/java/io/sphere/sdk/customers/messages/CustomerDeletedMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package io.sphere.sdk.customers.messages; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import io.sphere.sdk.customers.Customer; | ||
import io.sphere.sdk.messages.GenericMessageImpl; | ||
import io.sphere.sdk.messages.MessageDerivateHint; | ||
import io.sphere.sdk.messages.UserProvidedIdentifiers; | ||
|
||
import java.time.ZonedDateTime; | ||
|
||
@JsonDeserialize(as = CustomerDeletedMessage.class)//important to override annotation in Message class | ||
public final class CustomerDeletedMessage extends GenericMessageImpl<Customer> { | ||
public static final String MESSAGE_TYPE = "CustomerDeleted"; | ||
public static final MessageDerivateHint<CustomerDeletedMessage> MESSAGE_HINT = | ||
MessageDerivateHint.ofSingleMessageType(MESSAGE_TYPE, CustomerDeletedMessage.class, Customer.referenceTypeId()); | ||
|
||
private final Customer customer; | ||
|
||
@JsonCreator | ||
private CustomerDeletedMessage(final String id, final Long version, final ZonedDateTime createdAt, final ZonedDateTime lastModifiedAt, final JsonNode resource, final Long sequenceNumber, final Long resourceVersion, final String type, final UserProvidedIdentifiers resourceUserProvidedIdentifiers, final Customer customer) { | ||
super(id, version, createdAt, lastModifiedAt, resource, sequenceNumber, resourceVersion, type,resourceUserProvidedIdentifiers, Customer.class); | ||
this.customer = customer; | ||
} | ||
|
||
/** | ||
* Gets the Customer at creation time | ||
* | ||
* @return the created Customer at creation time | ||
*/ | ||
public Customer getCustomer() { | ||
return customer; | ||
} | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
...dels/src/main/java/io/sphere/sdk/inventory/messages/InventoryEntryQuantitySetMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package io.sphere.sdk.inventory.messages; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.databind.JsonNode; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import io.sphere.sdk.channels.Channel; | ||
import io.sphere.sdk.inventory.InventoryEntry; | ||
import io.sphere.sdk.messages.GenericMessageImpl; | ||
import io.sphere.sdk.messages.MessageDerivateHint; | ||
import io.sphere.sdk.messages.UserProvidedIdentifiers; | ||
import io.sphere.sdk.models.Reference; | ||
|
||
import javax.annotation.Nullable; | ||
import java.time.ZonedDateTime; | ||
|
||
@JsonDeserialize(as = InventoryEntryQuantitySetMessage.class)//important to override annotation in Message class | ||
public final class InventoryEntryQuantitySetMessage extends GenericMessageImpl<InventoryEntry> { | ||
public static final String MESSAGE_TYPE = "InventoryEntryQuantitySet"; | ||
public static final MessageDerivateHint<InventoryEntryQuantitySetMessage> MESSAGE_HINT = | ||
MessageDerivateHint.ofSingleMessageType(MESSAGE_TYPE, InventoryEntryQuantitySetMessage.class, InventoryEntry.referenceTypeId()); | ||
|
||
private final Long oldQuantityOnStock; | ||
private final Long newQuantityOnStock; | ||
private final Long oldAvailableQuantity; | ||
private final Long newAvailableQuantity; | ||
@Nullable | ||
private final Reference<Channel> supplyChannel; | ||
|
||
@JsonCreator | ||
private InventoryEntryQuantitySetMessage(final String id, final Long version, final ZonedDateTime createdAt, final ZonedDateTime lastModifiedAt, final JsonNode resource, final Long sequenceNumber, final Long resourceVersion, final String type, final UserProvidedIdentifiers resourceUserProvidedIdentifiers, Long oldQuantityOnStock, Long newQuantityOnStock, Long oldAvailableQuantity, Long newAvailableQuantity, final Reference<Channel> supplyChannel) { | ||
super(id, version, createdAt, lastModifiedAt, resource, sequenceNumber, resourceVersion, type,resourceUserProvidedIdentifiers, InventoryEntry.class); | ||
this.oldQuantityOnStock = oldQuantityOnStock; | ||
this.newQuantityOnStock = newQuantityOnStock; | ||
this.oldAvailableQuantity = oldAvailableQuantity; | ||
this.newAvailableQuantity = newAvailableQuantity; | ||
this.supplyChannel = supplyChannel; | ||
} | ||
|
||
public Long getOldQuantityOnStock() { | ||
return oldQuantityOnStock; | ||
} | ||
|
||
public Long getNewQuantityOnStock() { | ||
return newQuantityOnStock; | ||
} | ||
|
||
public Long getOldAvailableQuantity() { | ||
return oldAvailableQuantity; | ||
} | ||
|
||
public Long getNewAvailableQuantity() { | ||
return newAvailableQuantity; | ||
} | ||
|
||
@Nullable | ||
public Reference<Channel> getSupplyChannel() { | ||
return supplyChannel; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
commercetools-models/src/main/java/io/sphere/sdk/models/ContainerAndKey.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package io.sphere.sdk.models; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
|
||
@JsonDeserialize(as= ContainerAndKeyImpl.class) | ||
public interface ContainerAndKey { | ||
String getContainer(); | ||
String getKey(); | ||
|
||
static ContainerAndKey of(final String container, final String key) { | ||
return ContainerAndKeyImpl.of(container, key); | ||
} | ||
|
||
@JsonIgnore | ||
static ContainerAndKey ofContainerAndKey(final String container, final String key) { | ||
return of(container, key); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
commercetools-models/src/main/java/io/sphere/sdk/models/ContainerAndKeyImpl.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.sphere.sdk.models; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
|
||
final class ContainerAndKeyImpl extends Base implements ContainerAndKey{ | ||
private final String container; | ||
private final String key; | ||
|
||
@JsonCreator | ||
public ContainerAndKeyImpl(String container, String key) { | ||
this.container = container; | ||
this.key = key; | ||
} | ||
|
||
@JsonIgnore | ||
public static ContainerAndKey of(final String container, final String key) { | ||
return new ContainerAndKeyImpl(container, key); | ||
} | ||
|
||
@Override | ||
public String getContainer() { | ||
return container; | ||
} | ||
|
||
@Override | ||
public String getKey() { | ||
return key; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
.../java/io/sphere/sdk/orderedits/commands/stagedactions/SetLineItemDistributionChannel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package io.sphere.sdk.orderedits.commands.stagedactions; | ||
|
||
import com.fasterxml.jackson.annotation.JsonCreator; | ||
import io.sphere.sdk.channels.Channel; | ||
import io.sphere.sdk.models.ResourceIdentifier; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
public final class SetLineItemDistributionChannel extends OrderEditStagedUpdateActionBase { | ||
|
||
private final String lineItemId; | ||
@Nullable | ||
private final ResourceIdentifier<Channel> distributionChannel; | ||
|
||
@JsonCreator | ||
private SetLineItemDistributionChannel(final String lineItemId, @Nullable final ResourceIdentifier<Channel> distributionChannel) { | ||
super("setLineItemDistributionChannel"); | ||
this.lineItemId = lineItemId; | ||
this.distributionChannel = distributionChannel; | ||
} | ||
|
||
public static SetLineItemDistributionChannel of(final String lineItemId) { | ||
return new SetLineItemDistributionChannel(lineItemId, null); | ||
} | ||
|
||
public String getLineItemId() { | ||
return lineItemId; | ||
} | ||
|
||
@Nullable | ||
public ResourceIdentifier<Channel> getDistributionChannel() { | ||
return distributionChannel; | ||
} | ||
|
||
public SetLineItemDistributionChannel withDistributionChannel(@Nullable final ResourceIdentifier<Channel> distributionChannel) { | ||
return new SetLineItemDistributionChannel(getLineItemId(), distributionChannel); | ||
} | ||
} |
Oops, something went wrong.