Skip to content
Permalink
Browse files
Removing duplicate notification event object, removing file listener
  • Loading branch information
DImuthuUpe committed Sep 21, 2021
1 parent db6cd1a commit 233042551f2da018553fb9e6f0b5748795248860
Showing 29 changed files with 136 additions and 1,630 deletions.
@@ -0,0 +1,68 @@
upstream drms {
server localhost:10000;
}

upstream dataorch {
server localhost:{{ datalake_data_orch_http_port }};
}

upstream mft {
server {{ mft_default_agent_host }}:{{ mft_default_agent_port }};
}

server {
listen 8443 ssl;

# The host name to respond to
server_name beta.iubemcenter.scigap.org;
ssl_certificate /etc/letsencrypt/live/beta.iubemcenter.scigap.org/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/beta.iubemcenter.scigap.org/privkey.pem;

add_header 'Access-Control-Allow-Origin' '*' always;
add_header 'Access-Control-Allow_Credentials' 'true';
add_header 'Access-Control-Allow-Headers' 'Authorization,authorization, Access-Control-Allow-Origin, Accept,Origin,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Content-Range,Range,user-token';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,PUT,DELETE,PATCH';
rewrite_log on;
error_log /var/log/nginx/error.log debug;

if ($request_method = 'OPTIONS') {
return 204;
}

location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://drms;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_ssl_verify off;
}

location /dataorch {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
rewrite /dataorch(.*) $1 break;
proxy_pass http://dataorch;
proxy_redirect off;
proxy_no_cache 1;
proxy_cache_bypass 1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_ssl_verify off;
}

location /downloads {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://mft;
proxy_redirect off;
proxy_no_cache 1;
proxy_cache_bypass 1;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_ssl_verify off;
}
}
@@ -27,7 +27,6 @@
<artifactId>data-orchestrator-api-stub</artifactId>
<version>${project.version}</version>
</dependency>

</dependencies>

</project>
@@ -1,6 +1,6 @@
package org.apache.airavata.dataorchestrator.clients.core;

import org.apache.airavata.dataorchestrator.messaging.model.NotificationEvent;
import org.apache.airavata.datalake.data.orchestrator.api.stub.notification.Notification;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

@@ -19,30 +19,30 @@ public AbstractListener(EventPublisher eventPublisher) {
this.eventPublisher = eventPublisher;
}

public void onRegistered(NotificationEvent event) throws Exception {
public void onRegistered(Notification event) throws Exception {
LOGGER.info(" Registration event received for path " + event.getResourcePath());
eventPublisher.publish(event, NotificationEvent.Type.REGISTER);
eventPublisher.publish(event, Notification.NotificationType.REGISTER);

}

public void onCreated(NotificationEvent event) throws Exception {
public void onCreated(Notification event) throws Exception {
LOGGER.info(event.getResourceType() + " " +
event.getResourcePath() + ":" + event.getResourcePath() + " Created");
eventPublisher.publish(event, NotificationEvent.Type.CREATE);
eventPublisher.publish(event, Notification.NotificationType.CREATE);

}

public void onModified(NotificationEvent event) throws Exception {
public void onModified(Notification event) throws Exception {
LOGGER.info(event.getResourceType() + " " +
event.getResourcePath() + ":" + event.getResourcePath() + " Created");
eventPublisher.publish(event, NotificationEvent.Type.MODIFY);
eventPublisher.publish(event, Notification.NotificationType.MODIFY);

}

public void onDeleted(NotificationEvent event) throws Exception {
public void onDeleted(Notification event) throws Exception {
LOGGER.info(event.getResourceType() + " " +
event.getResourcePath() + ":" + event.getBasePath() + " Created");
eventPublisher.publish(event, NotificationEvent.Type.DELETE);
eventPublisher.publish(event, Notification.NotificationType.DELETE);

}

@@ -1,16 +1,12 @@
package org.apache.airavata.dataorchestrator.clients.core;

import org.apache.airavata.dataorchestrator.messaging.model.NotificationEvent;
import org.apache.airavata.datalake.data.orchestrator.api.stub.notification.Notification;

import java.util.concurrent.ExecutionException;

/**
* A class responsible for process incoming notification events, callbacks from kafka producer, message replays
*/
public interface EventPublisher {


public void publish(NotificationEvent notificationEvent, NotificationEvent.Type eventType) throws Exception;


public void publish(Notification notificationEvent, Notification.NotificationType eventType) throws Exception;
}

0 comments on commit 2330425

Please sign in to comment.