forked from asyncapi/jasyncapi
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(AsyncAPI 2.6.0): Channel - Operation
- Operation draft - Channel, Message, Operation Bindings draft asyncapi#126
- Loading branch information
Showing
102 changed files
with
3,587 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
asyncapi-core/src/main/java/com/asyncapi/v2/_6_0/binding/channel/ChannelBinding.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,12 @@ | ||
package com.asyncapi.v2._6_0.binding.channel; | ||
|
||
import lombok.EqualsAndHashCode; | ||
|
||
/** | ||
* Describes AsyncAPI channel binding. | ||
* | ||
* @author Pavel Bodiachevskii | ||
*/ | ||
@EqualsAndHashCode | ||
public class ChannelBinding { | ||
} |
126 changes: 126 additions & 0 deletions
126
...capi-core/src/main/java/com/asyncapi/v2/_6_0/binding/channel/amqp/AMQPChannelBinding.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,126 @@ | ||
package com.asyncapi.v2._6_0.binding.channel.amqp; | ||
|
||
import com.asyncapi.v2._6_0.binding.channel.ChannelBinding; | ||
import lombok.*; | ||
|
||
import javax.annotation.CheckForNull; | ||
|
||
/** | ||
* Describes AMQP 0-9-1 channel binding. | ||
* <p> | ||
* Contains information about the channel representation in AMQP. | ||
* | ||
* @version 0.2.0 | ||
* @see <a href="https://github.com/asyncapi/bindings/tree/master/amqp#channel-binding-object">AMQP channel binding</a> | ||
* @author Pavel Bodiachevskii | ||
*/ | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(callSuper = true) | ||
public class AMQPChannelBinding extends ChannelBinding { | ||
|
||
/** | ||
* Defines what type of channel is it. Can be either queue or routingKey (default). | ||
*/ | ||
@CheckForNull | ||
private String is; | ||
|
||
/** | ||
* When is=routingKey, this object defines the exchange properties. | ||
*/ | ||
@CheckForNull | ||
private ExchangeProperties exchange; | ||
|
||
/** | ||
* When is=queue, this object defines the queue properties. | ||
*/ | ||
@CheckForNull | ||
private QueueProperties queue; | ||
|
||
@CheckForNull | ||
@Builder.Default | ||
private String bindingVersion = "0.2.0"; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode | ||
public static class ExchangeProperties { | ||
|
||
/** | ||
* The name of the exchange. It MUST NOT exceed 255 characters long. | ||
*/ | ||
@CheckForNull | ||
private String name; | ||
|
||
/** | ||
* The type of the exchange. Can be either topic, direct, fanout, default or headers. | ||
*/ | ||
@CheckForNull | ||
private String type; | ||
|
||
/** | ||
* Whether the exchange should survive broker restarts or not. | ||
*/ | ||
@CheckForNull | ||
private Boolean durable; | ||
|
||
/** | ||
* Whether the exchange should be deleted when the last queue is unbound from it. | ||
*/ | ||
@CheckForNull | ||
private Boolean autoDelete; | ||
|
||
/** | ||
* The virtual host of the exchange. Defaults to /. | ||
*/ | ||
@CheckForNull | ||
@Builder.Default | ||
private String vhost = "/"; | ||
|
||
} | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode | ||
public static class QueueProperties { | ||
|
||
/** | ||
* The name of the queue. It MUST NOT exceed 255 characters long. | ||
*/ | ||
@CheckForNull | ||
private String name; | ||
|
||
/** | ||
* Whether the queue should survive broker restarts or not. | ||
*/ | ||
@CheckForNull | ||
private Boolean durable; | ||
|
||
/** | ||
* Whether the queue should be used only by one connection or not. | ||
*/ | ||
@CheckForNull | ||
private Boolean exclusive; | ||
|
||
/** | ||
* Whether the queue should be deleted when the last consumer unsubscribes. | ||
*/ | ||
@CheckForNull | ||
private Boolean autoDelete; | ||
|
||
/** | ||
* The virtual host of the queue. Defaults to /. | ||
*/ | ||
@CheckForNull | ||
@Builder.Default | ||
private String vhost = "/"; | ||
|
||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...pi-core/src/main/java/com/asyncapi/v2/_6_0/binding/channel/amqp1/AMQP1ChannelBinding.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,21 @@ | ||
package com.asyncapi.v2._6_0.binding.channel.amqp1; | ||
|
||
import com.asyncapi.v2.binding.ChannelBinding; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* This class MUST NOT contain any properties. Its name is reserved for future use. | ||
* <p> | ||
* Describes AMQP 1.0 channel binding. | ||
* | ||
* @version 0.1.0 | ||
* @see <a href="https://github.com/asyncapi/bindings/tree/master/amqp1#channel-binding-object">AMQP channel binding</a> | ||
* @author Pavel Bodiachevskii | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
@EqualsAndHashCode(callSuper = true) | ||
public class AMQP1ChannelBinding extends ChannelBinding { | ||
} |
48 changes: 48 additions & 0 deletions
48
...c/main/java/com/asyncapi/v2/_6_0/binding/channel/anypointmq/AnypointMQChannelBinding.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,48 @@ | ||
package com.asyncapi.v2._6_0.binding.channel.anypointmq; | ||
|
||
import com.asyncapi.v2._6_0.binding.channel.ChannelBinding; | ||
import lombok.*; | ||
|
||
import javax.annotation.CheckForNull; | ||
|
||
/** | ||
* Describes Anypoint MQ channel binding. | ||
* | ||
* @version 0.0.1 | ||
* @see <a href="https://github.com/asyncapi/bindings/blob/master/anypointmq/README.md#channel-binding-object">Anypoint MQ channel binding</a> | ||
* @author Pavel Bodiachevskii | ||
*/ | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(callSuper = true) | ||
public class AnypointMQChannelBinding extends ChannelBinding { | ||
|
||
/** | ||
* OPTIONAL, defaults to the channel name. | ||
* <p> | ||
* The destination (queue or exchange) name for this channel. SHOULD only be specified if the channel name differs | ||
* from the actual destination name, such as when the channel name is not a valid destination name in Anypoint MQ. | ||
*/ | ||
@CheckForNull | ||
private String destination; | ||
|
||
/** | ||
* OPTIONAL, defaults to queue. | ||
* <p> | ||
* The type of destination, which MUST be either exchange or queue or fifo-queue. | ||
* SHOULD be specified to document the messaging model (publish/subscribe, point-to-point, strict message ordering) | ||
* supported by this channel. | ||
*/ | ||
@CheckForNull | ||
private String destinationType; | ||
|
||
/** | ||
* OPTIONAL, defaults to latest. The version of this binding. | ||
*/ | ||
@CheckForNull | ||
@Builder.Default | ||
private String bindingVersion = "0.0.1"; | ||
|
||
} |
116 changes: 116 additions & 0 deletions
116
...in/java/com/asyncapi/v2/_6_0/binding/channel/googlepubsub/GooglePubSubChannelBinding.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,116 @@ | ||
package com.asyncapi.v2._6_0.binding.channel.googlepubsub; | ||
|
||
import com.asyncapi.v2._6_0.binding.message.MessageBinding; | ||
import lombok.*; | ||
|
||
import javax.annotation.CheckForNull; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** | ||
* The Channel Bindings Object is used to describe the Google Cloud Pub/Sub specific <a href="https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics/create">Topic</a> details with AsyncAPI. | ||
* <p> | ||
* Describes Google Cloud Pub/Sub channel binding. | ||
* | ||
* @version 0.1.0 | ||
* @see <a href="https://github.com/asyncapi/bindings/tree/master/googlepubsub">Google Cloud Pub/Sub channel binding</a> | ||
* @author Pavel Bodiachevskii | ||
*/ | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode(callSuper = true) | ||
public class GooglePubSubChannelBinding extends MessageBinding { | ||
|
||
/** | ||
* The Google Cloud Pub/Sub Topic name | ||
*/ | ||
private String topic; | ||
|
||
/** | ||
* An object of key-value pairs (These are used to categorize Cloud Resources like Cloud Pub/Sub Topics.) | ||
*/ | ||
@CheckForNull | ||
private Map<String, Object> labels; | ||
|
||
/** | ||
* Indicates the minimum duration to retain a message after it is published to the topic (Must be a valid <a href="https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Duration">Duration</a>.) | ||
*/ | ||
@CheckForNull | ||
private String messageRetentionDuration; | ||
|
||
/** | ||
* Policy constraining the set of Google Cloud Platform regions where messages published to the topic may be stored | ||
*/ | ||
@CheckForNull | ||
private MessageStoragePolicy messageStoragePolicy; | ||
|
||
/** | ||
* Settings for validating messages published against a schema | ||
*/ | ||
@CheckForNull | ||
private SchemaSettings schemaSettings; | ||
|
||
/** | ||
* OPTIONAL, defaults to latest. The version of this binding. | ||
*/ | ||
@CheckForNull | ||
@Builder.Default | ||
private String bindingVersion = "0.1.0"; | ||
|
||
/** | ||
* The Message Storage Policy Object is used to describe the Google Cloud Pub/Sub <a href="https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#MessageStoragePolicy">MessageStoragePolicy</a> Object with AsyncAPI. | ||
*/ | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode | ||
public static class MessageStoragePolicy { | ||
|
||
/** | ||
* A list of IDs of GCP regions where messages that are published to the topic may be persisted in storage | ||
*/ | ||
@CheckForNull | ||
private List<String> allowedPersistenceRegions; | ||
|
||
} | ||
|
||
/** | ||
* The Schema Settings Object is used to describe the Google Cloud Pub/Sub <a href="https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#SchemaSettings">SchemaSettings</a> Object with AsyncAPI. | ||
*/ | ||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@EqualsAndHashCode | ||
public static class SchemaSettings { | ||
|
||
/** | ||
* The encoding of the message (Must be one of the possible <a href="https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#encoding">Encoding</a> values.) | ||
*/ | ||
@CheckForNull | ||
private String encoding; | ||
|
||
/** | ||
* The minimum (inclusive) revision allowed for validating messages | ||
*/ | ||
@CheckForNull | ||
private String firstRevisionId; | ||
|
||
/** | ||
* The maximum (inclusive) revision allowed for validating messages | ||
*/ | ||
@CheckForNull | ||
private String lastRevisionId; | ||
|
||
/** | ||
* The name of the schema that messages published should be validated against (The format is projects/{project}/schemas/{schema}.) | ||
*/ | ||
@CheckForNull | ||
private String name; | ||
|
||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
...capi-core/src/main/java/com/asyncapi/v2/_6_0/binding/channel/http/HTTPChannelBinding.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,21 @@ | ||
package com.asyncapi.v2._6_0.binding.channel.http; | ||
|
||
import com.asyncapi.v2._6_0.binding.channel.ChannelBinding; | ||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* This class MUST NOT contain any properties. Its name is reserved for future use. | ||
* <p> | ||
* Describes HTTP channel binding. | ||
* | ||
* @version 0.1.0 | ||
* @see <a href="https://github.com/asyncapi/bindings/tree/master/http#channel-binding-object">HTTP channel binding</a> | ||
* @author Pavel Bodiachevskii | ||
*/ | ||
@Data | ||
@NoArgsConstructor | ||
@EqualsAndHashCode(callSuper = true) | ||
public class HTTPChannelBinding extends ChannelBinding { | ||
} |
Oops, something went wrong.