-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amqp Message Update - API Change (#17464)
1. New Type AmqpMessageId ( Based on discussion from Clemens, dotnet had) 2. New Type AmqpAddress ( Based on discussion from Clemens, dotnet had) 3. Return type change in AmqpMessageProperties for above two new types. 3. Following changes are to keep consistency with dotnet and common prefix -> AmqpMessage A. Renamed AmqpDataBody to AmqpMessageBody (to be same name as in dotnet) B. Renamed AmqpBodyType to AmqpMessageBodyType (Same name in dotnet) 4. Added AmqpMessageBody .getFirstData () Based on team review 5. Returning IterableStream in AmqpMessageBody .getData () Based on team review 6. Removed Copy constructor AmqpAnnotatedMessage (matching with dotnet) and because it is servicebus specific . So moving this logic into servicebus
- Loading branch information
1 parent
b31839d
commit 2bf7163
Showing
24 changed files
with
846 additions
and
381 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
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
66 changes: 66 additions & 0 deletions
66
sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/models/AmqpAddress.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,66 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.core.amqp.models; | ||
|
||
import java.util.Objects; | ||
|
||
/** | ||
* This represents amqp address information. This will be used in populating information like 'To', 'ReplyTo' etc. | ||
* | ||
* <p><strong>Create and retrieve address</strong></p> | ||
* {@codesnippet com.azure.core.amqp.models.AmqpAddress.createAndGet} | ||
* | ||
* @see <a href="http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-address-string"> | ||
* Address type Format.</a> | ||
*/ | ||
public final class AmqpAddress { | ||
|
||
private final String address; | ||
|
||
/** | ||
* Creates the {@link AmqpAddress} with given {@code address}. | ||
* | ||
* @param address The address to set for this instance. | ||
* @throws NullPointerException if {@code address} is null. | ||
*/ | ||
public AmqpAddress(String address) { | ||
this.address = Objects.requireNonNull(address, "'address' cannot be null."); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public int hashCode() { | ||
return address.hashCode(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public boolean equals(Object other) { | ||
if (other == null) { | ||
return false; | ||
} | ||
|
||
if (this.getClass() != other.getClass()) { | ||
return false; | ||
} | ||
|
||
if (this == other) { | ||
return true; | ||
} | ||
|
||
return Objects.equals(address, other.toString()); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String toString() { | ||
return this.address; | ||
} | ||
} |
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
23 changes: 0 additions & 23 deletions
23
sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/models/AmqpBodyType.java
This file was deleted.
Oops, something went wrong.
41 changes: 0 additions & 41 deletions
41
sdk/core/azure-core-amqp/src/main/java/com/azure/core/amqp/models/AmqpDataBody.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.