-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aab76e1
commit 339841c
Showing
20 changed files
with
1,279 additions
and
789 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
<!DOCTYPE HTML> | ||
<html lang="en"> | ||
<head> | ||
<!-- Generated by javadoc (17) --> | ||
<title>Subscriptions (commercetools Java SDK)</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<meta name="description" content="declaration: package: com.commercetools.docs.meta, class: Subscriptions"> | ||
<meta name="generator" content="javadoc/ClassWriterImpl"> | ||
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> | ||
<link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style"> | ||
<link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style"> | ||
<script type="text/javascript" src="../../../../script.js"></script> | ||
<script type="text/javascript" src="../../../../script-dir/jquery-3.6.1.min.js"></script> | ||
<script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script> | ||
</head> | ||
<body class="class-declaration-page"> | ||
<script type="text/javascript">var pathtoroot = "../../../../"; | ||
loadScripts(document, 'script');</script> | ||
<noscript> | ||
<div>JavaScript is disabled on your browser.</div> | ||
</noscript> | ||
<div class="flex-box"> | ||
<header role="banner" class="flex-header"> | ||
<nav role="navigation"> | ||
<!-- ========= START OF TOP NAVBAR ======= --> | ||
<div class="top-nav" id="navbar-top"> | ||
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> | ||
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> | ||
<li><a href="../../../../index.html">Overview</a></li> | ||
<li><a href="package-summary.html">Package</a></li> | ||
<li class="nav-bar-cell1-rev">Class</li> | ||
<li><a href="../../../../deprecated-list.html">Deprecated</a></li> | ||
<li><a href="../../../../index-files/index-1.html">Index</a></li> | ||
<li><a href="../../../../help-doc.html#class">Help</a></li> | ||
</ul> | ||
</div> | ||
<div class="sub-nav"> | ||
<div> | ||
<ul class="sub-nav-list"> | ||
<li>Summary: </li> | ||
<li>Nested | </li> | ||
<li>Field | </li> | ||
<li>Constr | </li> | ||
<li><a href="#method-summary">Method</a></li> | ||
</ul> | ||
<ul class="sub-nav-list"> | ||
<li>Detail: </li> | ||
<li>Field | </li> | ||
<li>Constr | </li> | ||
<li>Method</li> | ||
</ul> | ||
</div> | ||
<div class="nav-list-search"><label for="search-input">SEARCH:</label> | ||
<input type="text" id="search-input" value="search" disabled="disabled"> | ||
<input type="reset" id="reset-button" value="reset" disabled="disabled"> | ||
</div> | ||
</div> | ||
<!-- ========= END OF TOP NAVBAR ========= --> | ||
<span class="skip-nav" id="skip-navbar-top"></span></nav> | ||
</header> | ||
<div class="flex-content"> | ||
<main role="main"> | ||
<!-- ======== START OF CLASS DATA ======== --> | ||
<div class="header"> | ||
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">com.commercetools.docs.meta</a></div> | ||
<h1 title="Class Subscriptions" class="title">Class Subscriptions</h1> | ||
</div> | ||
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a> | ||
<div class="inheritance">com.commercetools.docs.meta.Subscriptions</div> | ||
</div> | ||
<section class="class-description" id="class-description"> | ||
<hr> | ||
<div class="type-signature"><span class="modifiers">public final class </span><span class="element-name type-name-label">Subscriptions</span> | ||
<span class="extends-implements">extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div> | ||
<div class="block"><b>Table of content</b><ul><li><a href="#subscriptions">Subscriptions</a></li><ul><li><a href="#delivery-payloads">Delivery Payloads</a></li><ul><li><a href="#message-payloads">Message Payloads</a></li><li><a href="#change-payloads">Change Payloads</a></li></ul></ul></ul> | ||
<h2 id="subscriptions">Subscriptions</h2> | ||
|
||
<h3 id="delivery-payloads">Delivery Payloads</h3> | ||
<p>The SDK provides the JsonUtils class which can be used to deserialize the delivery payload sent | ||
by a subscription. Using the <a href="../../api/models/subscription/DeliveryPayload.html" title="interface in com.commercetools.api.models.subscription"><code>DeliveryPayload</code></a> class | ||
it will deserialize it correctly to a <a href="../../api/models/subscription/MessageDeliveryPayload.html" title="interface in com.commercetools.api.models.subscription"><code>MessageDeliveryPayload</code></a>, | ||
<a href="../../api/models/subscription/ResourceCreatedDeliveryPayload.html" title="interface in com.commercetools.api.models.subscription"><code>ResourceCreatedDeliveryPayload</code></a>, | ||
<a href="../../api/models/subscription/ResourceUpdatedDeliveryPayload.html" title="interface in com.commercetools.api.models.subscription"><code>ResourceUpdatedDeliveryPayload</code></a>, or | ||
<a href="../../api/models/subscription/ResourceDeletedDeliveryPayload.html" title="interface in com.commercetools.api.models.subscription"><code>ResourceDeletedDeliveryPayload</code></a></p> | ||
|
||
<div id="example-SerializationTest-deliveryPayloads--%s" class=code-example><pre><code class='java'>DeliveryPayload delivery = JsonUtils.fromJsonString(stringFromResource("messagedeliverypayload.json"), | ||
DeliveryPayload.class); | ||
assertThat(delivery).isInstanceOf(DeliveryPayload.class); | ||
assertThat(delivery).isInstanceOf(MessageDeliveryPayload.class); | ||
</code><p>See the <a href="https://github.com/commercetools/commercetools-sdk-java-v2/blob/master/commercetools/internal-docs/src/test/java/example/SerializationTest.java" target="_blank">test code</a>.</pre></div> | ||
|
||
<h4 id="message-payloads">Message Payloads</h4> | ||
<p>The <a href="../../api/models/subscription/MessageDeliveryPayload.html" title="interface in com.commercetools.api.models.subscription"><code>MessageDeliveryPayload</code></a> include a helper method to | ||
cast to the inner message delivery and return the wrapped message.</p> | ||
|
||
<div id="example-SerializationTest-messageDeliveryPayloads--%s" class=code-example><pre><code class='java'>DeliveryPayload delivery = JsonUtils.fromJsonString(stringFromResource("messagedeliverypayload.json"), | ||
DeliveryPayload.class); | ||
|
||
assertThat(delivery).isInstanceOf(MessageDeliveryPayload.class); | ||
MessageDeliveryPayload messageDelivery = (MessageDeliveryPayload) delivery; | ||
|
||
assertThat(messageDelivery.getMessagePayload()).isInstanceOf(CustomerLastNameSetMessagePayload.class); | ||
|
||
assertThat(messageDelivery.getMessagePayload().as(CustomerLastNameSetMessagePayload.class)) | ||
.isInstanceOf(CustomerLastNameSetMessagePayload.class); | ||
|
||
assertThat(messageDelivery.hasCompleteMessage()).isTrue(); | ||
|
||
assertThatThrownBy(() -> messageDelivery.getMessagePayload().as(CustomerFirstNameSetMessagePayload.class)) | ||
.isInstanceOf(IllegalArgumentException.class); | ||
</code><p>See the <a href="https://github.com/commercetools/commercetools-sdk-java-v2/blob/master/commercetools/internal-docs/src/test/java/example/SerializationTest.java" target="_blank">test code</a>.</pre></div> | ||
|
||
<h4 id="change-payloads">Change Payloads</h4> | ||
<p></p> | ||
|
||
<div id="example-SerializationTest-changeDeliveryPayloads--%s" class=code-example><pre><code class='java'>DeliveryPayload delivery = JsonUtils.fromJsonString(stringFromResource("changedeliverypayload.json"), | ||
DeliveryPayload.class); | ||
|
||
assertThat(delivery).isInstanceOf(ResourceCreatedDeliveryPayload.class); | ||
</code><p>See the <a href="https://github.com/commercetools/commercetools-sdk-java-v2/blob/master/commercetools/internal-docs/src/test/java/example/SerializationTest.java" target="_blank">test code</a>.</pre></div></div> | ||
</section> | ||
<section class="summary"> | ||
<ul class="summary-list"> | ||
<!-- ========== METHOD SUMMARY =========== --> | ||
<li> | ||
<section class="method-summary" id="method-summary"> | ||
<h2>Method Summary</h2> | ||
<div class="inherited-list"> | ||
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> | ||
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-" title="class or interface in java.lang" class="external-link">wait</a></code></div> | ||
</section> | ||
</li> | ||
</ul> | ||
</section> | ||
<!-- ========= END OF CLASS DATA ========= --> | ||
</main> | ||
<footer role="contentinfo"> | ||
<hr> | ||
<p class="legal-copy"><small><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.8.0/styles/default.min.css"><script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.8.0/highlight.min.js"></script><script>hljs.initHighlightingOnLoad();</script><span id="custom-javascripts"></span><script src="../../../../resources/javascripts/main.js"></script><link rel="stylesheet" href="../../../../resources/stylesheets/main.css"></small></p> | ||
</footer> | ||
</div> | ||
</div> | ||
</body> | ||
</html> |
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
Oops, something went wrong.