This repository has been archived by the owner on Jun 9, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fine tuning notification confirmation feature
* Using AUI flag. * Showing invoked URL and response content. * Also logging error when variable cant be resolved. Was giving up entirely. Will now log and continue trying to resolve other variables.
- Loading branch information
1 parent
445b66b
commit aee524c
Showing
24 changed files
with
442 additions
and
262 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,76 @@ | ||
package se.bjurr.prnfb.http; | ||
|
||
import java.net.URI; | ||
|
||
public class HttpResponse { | ||
public HttpResponse(int status, String content) { | ||
this.status = status; | ||
this.content = content; | ||
} | ||
|
||
private int status; | ||
private String content; | ||
|
||
public int getStatus() { | ||
return status; | ||
} | ||
|
||
public String getContent() { | ||
return content; | ||
} | ||
private final String content; | ||
|
||
private final int status; | ||
|
||
private final URI uri; | ||
|
||
public HttpResponse(URI uri, int status, String content) { | ||
this.uri = uri; | ||
this.status = status; | ||
this.content = content; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
HttpResponse other = (HttpResponse) obj; | ||
if (this.content == null) { | ||
if (other.content != null) { | ||
return false; | ||
} | ||
} else if (!this.content.equals(other.content)) { | ||
return false; | ||
} | ||
if (this.status != other.status) { | ||
return false; | ||
} | ||
if (this.uri == null) { | ||
if (other.uri != null) { | ||
return false; | ||
} | ||
} else if (!this.uri.equals(other.uri)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
public String getContent() { | ||
return this.content; | ||
} | ||
|
||
public int getStatus() { | ||
return this.status; | ||
} | ||
|
||
public URI getUri() { | ||
return this.uri; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((this.content == null) ? 0 : this.content.hashCode()); | ||
result = prime * result + this.status; | ||
result = prime * result + ((this.uri == null) ? 0 : this.uri.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "HttpResponse [content=" + this.content + ", status=" + this.status + ", uri=" + this.uri + "]"; | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
src/main/java/se/bjurr/prnfb/http/NotificationResponse.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,80 @@ | ||
package se.bjurr.prnfb.http; | ||
|
||
import java.util.UUID; | ||
|
||
public class NotificationResponse { | ||
private final HttpResponse httpResponse; | ||
private final UUID notification; | ||
private final String notificationName; | ||
|
||
public NotificationResponse(UUID notification, String notificationName, HttpResponse httpResponse) { | ||
this.notification = notification; | ||
this.notificationName = notificationName; | ||
this.httpResponse = httpResponse; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) { | ||
return true; | ||
} | ||
if (obj == null) { | ||
return false; | ||
} | ||
if (getClass() != obj.getClass()) { | ||
return false; | ||
} | ||
NotificationResponse other = (NotificationResponse) obj; | ||
if (this.httpResponse == null) { | ||
if (other.httpResponse != null) { | ||
return false; | ||
} | ||
} else if (!this.httpResponse.equals(other.httpResponse)) { | ||
return false; | ||
} | ||
if (this.notification == null) { | ||
if (other.notification != null) { | ||
return false; | ||
} | ||
} else if (!this.notification.equals(other.notification)) { | ||
return false; | ||
} | ||
if (this.notificationName == null) { | ||
if (other.notificationName != null) { | ||
return false; | ||
} | ||
} else if (!this.notificationName.equals(other.notificationName)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
|
||
public HttpResponse getHttpResponse() { | ||
return this.httpResponse; | ||
} | ||
|
||
public UUID getNotification() { | ||
return this.notification; | ||
} | ||
|
||
public String getNotificationName() { | ||
return this.notificationName; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
final int prime = 31; | ||
int result = 1; | ||
result = prime * result + ((this.httpResponse == null) ? 0 : this.httpResponse.hashCode()); | ||
result = prime * result + ((this.notification == null) ? 0 : this.notification.hashCode()); | ||
result = prime * result + ((this.notificationName == null) ? 0 : this.notificationName.hashCode()); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "NotificationResponse [httpResponse=" + this.httpResponse + ", notification=" + this.notification | ||
+ ", notificationName=" + this.notificationName + "]"; | ||
} | ||
|
||
} |
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
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
Oops, something went wrong.