Skip to content

Commit

Permalink
If applied, this commit will add new multi lb messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
UellingtonDamasceno committed Jan 28, 2024
1 parent e6f0dd1 commit 79dc5a8
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/main/java/dlt/client/tangle/enums/TransactionType.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,12 @@
* @author Uellington Damasceno
*/
public enum TransactionType {
LB_ENTRY, LB_ENTRY_REPLY, LB_STATUS, LB_REQUEST, LB_REPLY, LB_DEVICE;
LB_ENTRY,
LB_ENTRY_REPLY,
LB_STATUS,
LB_REQUEST,
LB_REPLY,
LB_DEVICE,
LB_MULTI_REQUEST,
LB_MULTI_RESPONSE;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package dlt.client.tangle.model.transactions;

import dlt.client.tangle.enums.TransactionType;

/**
*
* @author Uellington Damasceno
*/
public class LBMultiRequest extends TargetedTransaction {

public LBMultiRequest(String source, String group, String target) {
super(source, group, TransactionType.LB_MULTI_REQUEST, target);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package dlt.client.tangle.model.transactions;

import dlt.client.tangle.enums.TransactionType;

/**
*
* @author Uellington Damasceno
*/
public class LBMultiResponse extends TargetedTransaction {

public LBMultiResponse(String source, String group, String target) {
super(source, group, TransactionType.LB_MULTI_RESPONSE, target);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Transaction {
private final String group;
private final TransactionType type;

private long createdAt;
private final long createdAt;
private long publishedAt;

public Transaction(String source, String group, TransactionType type) {
Expand Down Expand Up @@ -45,6 +45,14 @@ public final void setPublishedAt(long publishedAt) {
public final long getPublishedAt() {
return this.publishedAt;
}

public final boolean isLoopback(String source){
return this.source.equals(source);
}

public final boolean is(TransactionType transactionType){
return this.type.equals(transactionType);
}

@Override
public String toString() {
Expand Down

0 comments on commit 79dc5a8

Please sign in to comment.