-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests(bindings): AMQP 0.1.0, 0.2.0, 0.3.0
- Loading branch information
Showing
132 changed files
with
2,551 additions
and
188 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
asyncapi-core/src/main/java/com/asyncapi/bindings/ChannelBindingsDeserializer.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
2 changes: 1 addition & 1 deletion
2
asyncapi-core/src/main/java/com/asyncapi/bindings/MessageBindingsDeserializer.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
2 changes: 1 addition & 1 deletion
2
asyncapi-core/src/main/java/com/asyncapi/bindings/OperationBindingsDeserializer.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
2 changes: 1 addition & 1 deletion
2
asyncapi-core/src/main/java/com/asyncapi/bindings/ServerBindingsDeserializer.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
35 changes: 35 additions & 0 deletions
35
asyncapi-core/src/main/java/com/asyncapi/bindings/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,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 {} |
35 changes: 35 additions & 0 deletions
35
asyncapi-core/src/main/java/com/asyncapi/bindings/amqp/AMQPMessageBinding.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,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 {} |
35 changes: 35 additions & 0 deletions
35
asyncapi-core/src/main/java/com/asyncapi/bindings/amqp/AMQPOperationBinding.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,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 {} |
35 changes: 35 additions & 0 deletions
35
asyncapi-core/src/main/java/com/asyncapi/bindings/amqp/AMQPServerBinding.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,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 {} |
65 changes: 65 additions & 0 deletions
65
...api-core/src/main/java/com/asyncapi/bindings/amqp/v0/_1_0/channel/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,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"); | ||
} | ||
|
||
} |
24 changes: 24 additions & 0 deletions
24
asyncapi-core/src/main/java/com/asyncapi/bindings/amqp/v0/_1_0/channel/AMQPChannelType.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,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 | ||
|
||
} |
62 changes: 62 additions & 0 deletions
62
...va/com/asyncapi/bindings/amqp/v0/_1_0/channel/exchange/AMQPChannelExchangeProperties.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,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; | ||
|
||
} |
33 changes: 33 additions & 0 deletions
33
...ain/java/com/asyncapi/bindings/amqp/v0/_1_0/channel/exchange/AMQPChannelExchangeType.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,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 | ||
|
||
} |
Oops, something went wrong.