Skip to content

Commit

Permalink
tests(bindings): AMQP 0.1.0, 0.2.0, 0.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Pakisan committed Apr 26, 2024
1 parent 64ebecb commit 718a49e
Show file tree
Hide file tree
Showing 132 changed files with 2,551 additions and 188 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.asyncapi.bindings;

import com.asyncapi.bindings.amqp.v0._2_0.channel.AMQPChannelBinding;
import com.asyncapi.bindings.amqp.AMQPChannelBinding;
import com.asyncapi.bindings.amqp1.v0._1_0.channel.AMQP1ChannelBinding;
import com.asyncapi.bindings.anypointmq.v0._0_1.channel.AnypointMQChannelBinding;
import com.asyncapi.bindings.googlepubsub.v0._1_0.channel.GooglePubSubChannelBinding;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.asyncapi.bindings;

import com.asyncapi.bindings.amqp.v0._2_0.message.AMQPMessageBinding;
import com.asyncapi.bindings.amqp.AMQPMessageBinding;
import com.asyncapi.bindings.amqp1.v0._1_0.message.AMQP1MessageBinding;
import com.asyncapi.bindings.anypointmq.v0._0_1.message.AnypointMQMessageBinding;
import com.asyncapi.bindings.googlepubsub.v0._1_0.message.GooglePubSubMessageBinding;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.asyncapi.bindings;

import com.asyncapi.bindings.amqp.v0._2_0.operation.AMQPOperationBinding;
import com.asyncapi.bindings.amqp.AMQPOperationBinding;
import com.asyncapi.bindings.amqp1.v0._1_0.operation.AMQP1OperationBinding;
import com.asyncapi.bindings.anypointmq.v0._0_1.operation.AnypointMQOperationBinding;
import com.asyncapi.bindings.googlepubsub.v0._1_0.operation.GooglePubSubOperationBinding;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.asyncapi.bindings;

import com.asyncapi.bindings.amqp.v0._2_0.server.AMQPServerBinding;
import com.asyncapi.bindings.amqp.AMQPServerBinding;
import com.asyncapi.bindings.amqp1.v0._1_0.server.AMQP1ServerBinding;
import com.asyncapi.bindings.anypointmq.v0._0_1.server.AnypointMQServerBinding;
import com.asyncapi.bindings.googlepubsub.v0._1_0.server.GooglePubSubServerBinding;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.asyncapi.bindings.amqp;

import com.asyncapi.bindings.ChannelBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* Describes AMQP 0-9-1 channel binding.
* <p>
* Contains information about the channel representation in AMQP.
*
* @since 1.0.0-RC2
* @see <a href="https://github.com/asyncapi/bindings/tree/master/amqp#channel-binding-object">AMQP channel binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.amqp.v0._3_0.channel.AMQPChannelBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._1_0.channel.AMQPChannelBinding.class, name = "0.1.0"),
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._2_0.channel.AMQPChannelBinding.class, name = "0.2.0"),
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._3_0.channel.AMQPChannelBinding.class, names = {
"0.3.0",
"latest"
}),
})
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class AMQPChannelBinding extends ChannelBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.asyncapi.bindings.amqp;

import com.asyncapi.bindings.MessageBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* Describes AMQP 0-9-1 message binding.
* <p>
* Contains information about the message representation in AMQP.
*
* @since 1.0.0-RC2
* @see <a href="https://github.com/asyncapi/bindings/tree/master/amqp#message-binding-object">AMQP message binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.amqp.v0._3_0.message.AMQPMessageBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._1_0.message.AMQPMessageBinding.class, name = "0.1.0"),
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._2_0.message.AMQPMessageBinding.class, name = "0.2.0"),
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._3_0.message.AMQPMessageBinding.class, names = {
"0.3.0",
"latest"
}),
})
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class AMQPMessageBinding extends MessageBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.asyncapi.bindings.amqp;

import com.asyncapi.bindings.OperationBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* Describes AMQP 0-9-1 operation binding.
* <p>
* Contains information about the operation representation in AMQP.
*
* @since 1.0.0-RC2
* @see <a href="https://github.com/asyncapi/bindings/tree/master/amqp#operation-binding-object">AMQP operation binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.amqp.v0._3_0.operation.AMQPOperationBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._1_0.operation.AMQPOperationBinding.class, name = "0.1.0"),
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._2_0.operation.AMQPOperationBinding.class, name = "0.2.0"),
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._3_0.operation.AMQPOperationBinding.class, names = {
"0.3.0",
"latest"
}),
})
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class AMQPOperationBinding extends OperationBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.asyncapi.bindings.amqp;

import com.asyncapi.bindings.ServerBinding;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
* Describes AMQP 0-9-1 server binding.
* <p>
* Contains information about the server representation in AMQP.
*
* @since 1.0.0-RC2
* @see <a href="https://github.com/asyncapi/bindings/tree/master/amqp#server-binding-object">AMQP server binding</a>
* @author Pavel Bodiachevskii
*/
@JsonTypeInfo(
use = JsonTypeInfo.Id.NAME,
include = JsonTypeInfo.As.EXISTING_PROPERTY,
defaultImpl = com.asyncapi.bindings.amqp.v0._3_0.server.AMQPServerBinding.class,
property = "bindingVersion",
visible = true
)
@JsonSubTypes({
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._1_0.server.AMQPServerBinding.class, name = "0.1.0"),
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._2_0.server.AMQPServerBinding.class, name = "0.2.0"),
@JsonSubTypes.Type(value = com.asyncapi.bindings.amqp.v0._3_0.server.AMQPServerBinding.class, names = {
"0.3.0",
"latest"
}),
})
@Data
@EqualsAndHashCode(callSuper = true)
public abstract class AMQPServerBinding extends ServerBinding {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
package com.asyncapi.bindings.amqp.v0._1_0.channel;

import com.asyncapi.bindings.amqp.v0._1_0.channel.exchange.AMQPChannelExchangeProperties;
import com.asyncapi.bindings.amqp.v0._1_0.channel.queue.AMQPChannelQueueProperties;
import com.fasterxml.jackson.annotation.JsonClassDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import lombok.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

/**
* Describes AMQP 0-9-1 channel binding.
* <p>
* Contains information about the channel representation in AMQP.
*
* @version 0.1.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)
@JsonClassDescription("Describes AMQP 0-9-1 channel binding.")
public class AMQPChannelBinding extends com.asyncapi.bindings.amqp.AMQPChannelBinding {

/**
* Defines what type of channel is it. Can be either queue or routingKey (default).
*/
@NotNull
@Builder.Default
@javax.validation.constraints.NotNull
@JsonProperty(value = "is", required = true, defaultValue = "routingKey")
@JsonPropertyDescription("Defines what type of channel is it. Can be either queue or routingKey (default).")
private AMQPChannelType is = AMQPChannelType.ROUTING_KEY;

/**
* When is=routingKey, this object defines the exchange properties.
*/
@Nullable
@JsonProperty("exchange")
@JsonPropertyDescription("When is=routingKey, this object defines the exchange properties.")
private AMQPChannelExchangeProperties exchange;

/**
* When is=queue, this object defines the queue properties.
*/
@Nullable
@JsonProperty("queue")
@JsonPropertyDescription("When is=queue, this object defines the queue properties.")
private AMQPChannelQueueProperties queue;

@Override
public String getBindingVersion() {
return "0.1.0";
}

@Override
public void setBindingVersion(@Nullable String bindingVersion) {
super.setBindingVersion("0.1.0");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.asyncapi.bindings.amqp.v0._1_0.channel;

import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Describes AMQP 0-9-1 channel type.
* <p>
* Contains information about the type of channel in AMQP.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/amqp#channel-binding-object">AMQP channel binding</a>
* @author Pavel Bodiachevskii
*/
public enum AMQPChannelType {

@JsonProperty("queue")
QUEUE,

@JsonProperty("routingKey")
@JsonAlias("routingKey")
ROUTING_KEY

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
package com.asyncapi.bindings.amqp.v0._1_0.channel.exchange;

import com.fasterxml.jackson.annotation.JsonClassDescription;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import lombok.*;
import org.jetbrains.annotations.Nullable;

/**
* Describes AMQP 0-9-1 channel exchange properties.
* <p>
* Contains information about the channel exchange properties in AMQP.
*
* @version 0.1.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
@JsonClassDescription("Describes AMQP 0-9-1 channel exchange properties.")
public class AMQPChannelExchangeProperties {

/**
* The name of the exchange. It MUST NOT exceed 255 characters long.
*/
@Nullable
@javax.validation.constraints.Size(
max = 255,
message = "Exchange name must not exceed 255 characters long."
)
@JsonProperty("name")
@JsonPropertyDescription("The name of the exchange. It MUST NOT exceed 255 characters long.")
private String name;

/**
* The type of the exchange. Can be either topic, direct, fanout, default or headers.
*/
@Nullable
@JsonProperty("type")
@JsonPropertyDescription("The type of the exchange. Can be either topic, direct, fanout, default or headers.")
private AMQPChannelExchangeType type;

/**
* Whether the exchange should survive broker restarts or not.
*/
@Nullable
@JsonProperty("durable")
@JsonPropertyDescription("Whether the exchange should survive broker restarts or not.")
private Boolean durable;

/**
* Whether the exchange should be deleted when the last queue is unbound from it.
*/
@Nullable
@JsonProperty("autoDelete")
@JsonPropertyDescription("Whether the exchange should be deleted when the last queue is unbound from it.")
private Boolean autoDelete;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package com.asyncapi.bindings.amqp.v0._1_0.channel.exchange;

import com.fasterxml.jackson.annotation.JsonClassDescription;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
* Describes AMQP 0-9-1 channel exchange type.
* <p>
* Contains information about the channel exchange type in AMQP.
*
* @version 0.1.0
* @see <a href="https://github.com/asyncapi/bindings/tree/master/amqp#channel-binding-object">AMQP channel binding</a>
* @author Pavel Bodiachevskii
*/
@JsonClassDescription("Describes AMQP 0-9-1 channel exchange type.")
public enum AMQPChannelExchangeType {

@JsonProperty("topic")
TOPIC,

@JsonProperty("direct")
DIRECT,

@JsonProperty("fanout")
FANOUT,

@JsonProperty("default")
DEFAULT,

@JsonProperty("headers")
HEADERS

}
Loading

0 comments on commit 718a49e

Please sign in to comment.