Skip to content
Snippets Groups Projects
Commit f5098a5d authored by Nikhil Singh[MicroSoft]'s avatar Nikhil Singh[MicroSoft]
Browse files

Commit 6 Contents:

1-Response code correction and Config addition for wait time
parent 990be890
No related branches found
No related tags found
2 merge requests!100Commit 2 contents:,!87Notification Service Refactoring
Pipeline #49634 failed
...@@ -55,7 +55,7 @@ public class PubsubEndpoint { ...@@ -55,7 +55,7 @@ public class PubsubEndpoint {
HttpResponse response = notificationHandler.notifySubscriber(notificationId, pubsubMessage, headerAttributes); HttpResponse response = notificationHandler.notifySubscriber(notificationId, pubsubMessage, headerAttributes);
if (!response.isSuccessCode()) { if (!response.isSuccessCode()) {
this.log.error(NOT_ACKNOWLEDGE); this.log.error(NOT_ACKNOWLEDGE);
return new ResponseEntity<String>(NOT_ACKNOWLEDGE, HttpStatus.INTERNAL_SERVER_ERROR); return new ResponseEntity<String>(NOT_ACKNOWLEDGE, HttpStatus.valueOf(response.getResponseCode()));
} }
this.log.info(ACKNOWLEDGE); this.log.info(ACKNOWLEDGE);
return new ResponseEntity<String>(ACKNOWLEDGE, HttpStatus.OK); return new ResponseEntity<String>(ACKNOWLEDGE, HttpStatus.OK);
......
...@@ -35,22 +35,18 @@ public class GsaAuth implements SecretAuth { ...@@ -35,22 +35,18 @@ public class GsaAuth implements SecretAuth {
private GsaSecret gsaSecret; private GsaSecret gsaSecret;
@Override
public void setSecret(Secret secret) { public void setSecret(Secret secret) {
this.gsaSecret = (GsaSecret) secret; this.gsaSecret = (GsaSecret) secret;
} }
@Override
public Secret getSecret() { public Secret getSecret() {
return this.gsaSecret; return this.gsaSecret;
} }
@Override
public String getPushUrl(String endpoint) throws Exception { public String getPushUrl(String endpoint) throws Exception {
return endpoint; return endpoint;
} }
@Override
public Map<String, String> getRequestHeaders() { public Map<String, String> getRequestHeaders() {
Map<String, String> requestHeader = new HashMap<>(); Map<String, String> requestHeader = new HashMap<>();
if (gsaSecret != null) { if (gsaSecret != null) {
......
...@@ -32,17 +32,14 @@ public class HmacAuth implements SecretAuth { ...@@ -32,17 +32,14 @@ public class HmacAuth implements SecretAuth {
private HmacSecret hmacSecret; private HmacSecret hmacSecret;
@Override
public void setSecret(Secret secret) { public void setSecret(Secret secret) {
this.hmacSecret = (HmacSecret) secret; this.hmacSecret = (HmacSecret) secret;
} }
@Override
public Secret getSecret() { public Secret getSecret() {
return this.hmacSecret; return this.hmacSecret;
} }
@Override
public String getPushUrl(String endpoint) throws Exception { public String getPushUrl(String endpoint) throws Exception {
String pushUrl = endpoint; String pushUrl = endpoint;
try { try {
...@@ -54,7 +51,6 @@ public class HmacAuth implements SecretAuth { ...@@ -54,7 +51,6 @@ public class HmacAuth implements SecretAuth {
return pushUrl; return pushUrl;
} }
@Override
public Map<String, String> getRequestHeaders() { public Map<String, String> getRequestHeaders() {
Map<String, String> requestHeader = new HashMap<>(); Map<String, String> requestHeader = new HashMap<>();
return requestHeader; return requestHeader;
......
...@@ -41,7 +41,7 @@ public class NotificationHandler { ...@@ -41,7 +41,7 @@ public class NotificationHandler {
private SubscriptionHandler subscriptionHandler; private SubscriptionHandler subscriptionHandler;
@Autowired @Autowired
private AuthFactory authFactory; private AuthFactory authFactory;
@Value("${app.expireTime:30000}") @Value("${app.waitingTime:30000}")
private int WAITING_TIME ; private int WAITING_TIME ;
public HttpResponse notifySubscriber(String notificationId, String pubsubMessage, Map<String, String> headerAttributes) throws Exception { public HttpResponse notifySubscriber(String notificationId, String pubsubMessage, Map<String, String> headerAttributes) throws Exception {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment