You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by la...@apache.org on 2015/02/06 17:05:50 UTC
[37/53] [abbrv] airavata git commit: adding SSL thrift server for
credential store - AIRAVATA-1561
adding SSL thrift server for credential store - AIRAVATA-1561
Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/e32c1a94
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/e32c1a94
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/e32c1a94
Branch: refs/heads/gfac-storm
Commit: e32c1a949ca470a63050da7a3059695d687070ae
Parents: fb661cf
Author: Chathuri Wimalasena <ka...@gmail.com>
Authored: Tue Feb 3 14:37:29 2015 -0500
Committer: Chathuri Wimalasena <ka...@gmail.com>
Committed: Tue Feb 3 14:37:29 2015 -0500
----------------------------------------------------------------------
.../common/utils/ApplicationSettings.java | 7 +
.../main/resources/airavata-server.properties | 5 +-
.../store/server/CredentialStoreServer.java | 133 +++++++++++++++++++
.../server/CredentialStoreServerHandler.java | 44 ++++++
.../invoker/MsgBoxWsaResponsesCorrelator.java | 95 +++++++------
.../xbaya/jython/runner/JythonClassLoader.java | 8 +-
.../xbaya/jython/script/JythonScript.java | 11 +-
.../xbaya/lead/LeadContextHeaderHelper.java | 21 ++-
.../xbaya/lead/NotificationHandler.java | 49 +++----
.../monitor/MonitorConfigurationWindow.java | 15 +--
10 files changed, 280 insertions(+), 108 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
----------------------------------------------------------------------
diff --git a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
index 9a7ad16..6c7ce75 100644
--- a/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
+++ b/modules/commons/utils/src/main/java/org/apache/airavata/common/utils/ApplicationSettings.java
@@ -369,6 +369,13 @@ public class ApplicationSettings {
return getSetting("credential.store.keystore.password");
}
+ public static String getCredentialStoreServerHost() throws ApplicationSettingsException {
+ return getSetting("credential.store.server.host");
+ }
+
+ public static String getCredentialStoreServerPort() throws ApplicationSettingsException {
+ return getSetting("credential.store.server.port");
+ }
public static String getCredentialStoreNotifierEnabled() throws ApplicationSettingsException {
return getSetting("notifier.enabled");
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/configuration/server/src/main/resources/airavata-server.properties
----------------------------------------------------------------------
diff --git a/modules/configuration/server/src/main/resources/airavata-server.properties b/modules/configuration/server/src/main/resources/airavata-server.properties
index 22d0a65..6280acd 100644
--- a/modules/configuration/server/src/main/resources/airavata-server.properties
+++ b/modules/configuration/server/src/main/resources/airavata-server.properties
@@ -67,7 +67,7 @@ appcatalog.validationQuery=SELECT 1 from CONFIGURATION
# Server module Configuration
###########################################################################
-servers=apiserver,orchestrator,gfac
+servers=apiserver,orchestrator,gfac,credentialstore
#shutdown.trategy=NONE
shutdown.trategy=SELF_TERMINATE
@@ -102,6 +102,9 @@ credential.store.jdbc.url=jdbc:derby://localhost:1527/persistent_data;create=tru
credential.store.jdbc.user=airavata
credential.store.jdbc.password=airavata
credential.store.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+credential.store.server.host=localhost
+credential.store.server.port=8960
+credentialstore=org.apache.airavata.credential.store.server.CredentialStoreServer
notifier.enabled=false
#period in milliseconds
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
new file mode 100644
index 0000000..efaddbe
--- /dev/null
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServer.java
@@ -0,0 +1,133 @@
+
+package org.apache.airavata.credential.store.server;
+
+
+import org.apache.airavata.common.utils.IServer;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.credential.store.cpi.CredentialStoreService;
+import org.apache.thrift.server.TServer;
+import org.apache.thrift.server.TThreadPoolServer;
+import org.apache.thrift.transport.TSSLTransportFactory;
+import org.apache.thrift.transport.TServerSocket;
+import org.apache.thrift.transport.TTransportException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.net.InetAddress;
+
+public class CredentialStoreServer implements IServer {
+ private final static Logger logger = LoggerFactory.getLogger(CredentialStoreServer.class);
+ private static final String SERVER_NAME = "Credential Store Server";
+ private static final String SERVER_VERSION = "1.0";
+
+ private IServer.ServerStatus status;
+ private TServer server;
+
+ public CredentialStoreServer() {
+ setStatus(IServer.ServerStatus.STOPPED);
+ }
+
+ @Override
+ public String getName() {
+ return SERVER_NAME;
+ }
+
+ @Override
+ public String getVersion() {
+ return SERVER_VERSION;
+ }
+
+ @Override
+ public void start() throws Exception {
+ try {
+ setStatus(ServerStatus.STARTING);
+ TSSLTransportFactory.TSSLTransportParameters params =
+ new TSSLTransportFactory.TSSLTransportParameters();
+ String keystorePath = ServerSettings.getCredentialStoreKeyStorePath();
+ String keystorePWD = ServerSettings.getCredentialStoreKeyStorePassword();
+ String host = ServerSettings.getCredentialStoreServerHost();
+ final int port = Integer.valueOf(ServerSettings.getCredentialStoreServerPort());
+ params.setKeyStore(keystorePath, keystorePWD);
+
+ TServerSocket serverTransport = TSSLTransportFactory.getServerSocket(
+ port, 10000, InetAddress.getByName(host), params);
+ CredentialStoreService.Processor processor = new CredentialStoreService.Processor(new CredentialStoreServerHandler());
+
+ server = new TThreadPoolServer(new TThreadPoolServer.Args(serverTransport).
+ processor(processor));
+ new Thread() {
+ public void run() {
+ server.serve();
+ setStatus(ServerStatus.STOPPED);
+ logger.info("Credential Store Server Stopped.");
+ }
+ }.start();
+ new Thread() {
+ public void run() {
+ while(!server.isServing()){
+ try {
+ Thread.sleep(500);
+ } catch (InterruptedException e) {
+ break;
+ }
+ }
+ if (server.isServing()){
+ setStatus(ServerStatus.STARTED);
+ logger.info("Starting Credential Store Server on Port " + port);
+ logger.info("Listening to Credential Store Clients ....");
+ }
+ }
+ }.start();
+ } catch (TTransportException e) {
+ setStatus(ServerStatus.FAILED);
+ logger.error("Error while starting the credential store service", e);
+ throw new Exception("Error while starting the credential store service", e);
+ }
+ }
+
+ public static void main(String[] args) {
+ try {
+ new CredentialStoreServer().start();
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ }
+ }
+
+ @Override
+ public void stop() throws Exception {
+ if (server!=null && server.isServing()){
+ setStatus(ServerStatus.STOPING);
+ server.stop();
+ }
+ }
+
+ @Override
+ public void restart() throws Exception {
+ stop();
+ start();
+ }
+
+ @Override
+ public void configure() throws Exception {
+
+ }
+
+ @Override
+ public ServerStatus getStatus() throws Exception {
+ return null;
+ }
+
+ private void setStatus(IServer.ServerStatus stat){
+ status=stat;
+ status.updateTime();
+ }
+
+ public TServer getServer() {
+ return server;
+ }
+
+ public void setServer(TServer server) {
+ this.server = server;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
----------------------------------------------------------------------
diff --git a/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
new file mode 100644
index 0000000..56c9ffd
--- /dev/null
+++ b/modules/credential-store-service/credential-store/src/main/java/org/apache/airavata/credential/store/server/CredentialStoreServerHandler.java
@@ -0,0 +1,44 @@
+package org.apache.airavata.credential.store.server;
+
+import org.apache.airavata.credential.store.cpi.CredentialStoreService;
+import org.apache.airavata.credential.store.datamodel.CertificateCredential;
+import org.apache.airavata.credential.store.datamodel.PasswordCredential;
+import org.apache.airavata.credential.store.datamodel.SSHCredential;
+import org.apache.thrift.TException;
+
+public class CredentialStoreServerHandler implements CredentialStoreService.Iface {
+ @Override
+ public String getCSServiceVersion() throws TException {
+ return null;
+ }
+
+ @Override
+ public String addSSHCredential(SSHCredential sshCredential) throws TException {
+ return null;
+ }
+
+ @Override
+ public String addCertificateCredential(CertificateCredential certificateCredential) throws TException {
+ return null;
+ }
+
+ @Override
+ public String addPasswordCredential(PasswordCredential passwordCredential) throws TException {
+ return null;
+ }
+
+ @Override
+ public SSHCredential getSSHCredential(String tokenId) throws TException {
+ return null;
+ }
+
+ @Override
+ public CertificateCredential getCertificateCredential(String tokenId) throws TException {
+ return null;
+ }
+
+ @Override
+ public PasswordCredential getPasswordCredential(String tokenId) throws TException {
+ return null;
+ }
+}
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java
index 5fee29f..a5baa2d 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java
@@ -21,7 +21,6 @@
package org.apache.airavata.xbaya.invoker;
import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.wsmg.msgbox.client.MsgBoxClient;
import org.apache.axiom.om.OMElement;
import org.apache.axis2.addressing.EndpointReference;
import org.slf4j.Logger;
@@ -56,7 +55,7 @@ public class MsgBoxWsaResponsesCorrelator extends WSIFAsyncWsaResponsesCorrelato
private final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
private String msgBoxServiceLoc;
- private MsgBoxClient msgBoxClient;
+// private MsgBoxClient msgBoxClient;
EndpointReference msgBoxAddr;
private Thread messageBoxDonwloader;
@@ -67,9 +66,9 @@ public class MsgBoxWsaResponsesCorrelator extends WSIFAsyncWsaResponsesCorrelato
{
this.invoker = output;
this.msgBoxServiceLoc = msgBoxServiceLoc;
- msgBoxClient = new MsgBoxClient();
+// msgBoxClient = new MsgBoxClient();
try {
- msgBoxAddr = msgBoxClient.createMessageBox(msgBoxServiceLoc,5000L);
+// msgBoxAddr = msgBoxClient.createMessageBox(msgBoxServiceLoc,5000L);
try {
setReplyTo(new WsaEndpointReference(new URI(msgBoxAddr.getAddress())));
} catch (URISyntaxException e) {
@@ -78,7 +77,7 @@ public class MsgBoxWsaResponsesCorrelator extends WSIFAsyncWsaResponsesCorrelato
messageBoxDonwloader = new Thread(this, Thread.currentThread().getName()+"-async-msgbox-correlator");
messageBoxDonwloader.setDaemon(true);
messageBoxDonwloader.start();
- } catch (RemoteException e) {
+ } catch (Exception e) {
logger.error(e.getLocalizedMessage(),e); //To change body of catch statement use File | Settings | File Templates.
}
}
@@ -90,49 +89,49 @@ public class MsgBoxWsaResponsesCorrelator extends WSIFAsyncWsaResponsesCorrelato
public void run() {
- while(true) {
- try {
- Iterator<OMElement> omElementIterator = msgBoxClient.takeMessagesFromMsgBox(msgBoxAddr, 5000L);
- List<XmlElement> xmlArrayList = new ArrayList<XmlElement>();
- while (omElementIterator.hasNext()){
- OMElement next = omElementIterator.next();
- String message = next.toStringWithConsume();
- xmlArrayList.add(XMLUtil.stringToXmlElement3(message));
- }
- // now hard work: find callbacks
- for (int i = 0; i < xmlArrayList.size(); i++) {
- XmlElement m = xmlArrayList.get(i);
- try {
- logger.debug(Thread.currentThread().getName());
- WSIFMessageElement e = new WSIFMessageElement(m);
- this.invoker.setOutputMessage(e);
- //ideally there are no multiple messages, so we can return from this thread at this point
- //otherwise this thread will keep running forever for each worfklow node, so there can be large
- // number of waiting threads in an airavata deployment
- return;
- } catch (Throwable e) {
- logger.error(e.getLocalizedMessage(),e); //To change body of catch statement use File | Settings | File Templates.
- }
- }
- try {
- Thread.currentThread().sleep(1000L); //do not overload msg box service ...
- } catch (InterruptedException e) {
- break;
- }
- } catch (XsulException e) {
- logger.error("could not retrieve messages");
- break;
- } catch (RemoteException e) {
- logger.error("could not retrieve messages");
- break;
- } catch (XMLStreamException e) {
- logger.error("could not retrieve messages");
- break;
- } catch (Exception e){
- logger.error("could not retrieve messages");
- break;
- }
- }
+// while(true) {
+// try {
+// Iterator<OMElement> omElementIterator = msgBoxClient.takeMessagesFromMsgBox(msgBoxAddr, 5000L);
+// List<XmlElement> xmlArrayList = new ArrayList<XmlElement>();
+// while (omElementIterator.hasNext()){
+// OMElement next = omElementIterator.next();
+// String message = next.toStringWithConsume();
+// xmlArrayList.add(XMLUtil.stringToXmlElement3(message));
+// }
+// // now hard work: find callbacks
+// for (int i = 0; i < xmlArrayList.size(); i++) {
+// XmlElement m = xmlArrayList.get(i);
+// try {
+// logger.debug(Thread.currentThread().getName());
+// WSIFMessageElement e = new WSIFMessageElement(m);
+// this.invoker.setOutputMessage(e);
+// //ideally there are no multiple messages, so we can return from this thread at this point
+// //otherwise this thread will keep running forever for each worfklow node, so there can be large
+// // number of waiting threads in an airavata deployment
+// return;
+// } catch (Throwable e) {
+// logger.error(e.getLocalizedMessage(),e); //To change body of catch statement use File | Settings | File Templates.
+// }
+// }
+// try {
+// Thread.currentThread().sleep(1000L); //do not overload msg box service ...
+// } catch (InterruptedException e) {
+// break;
+// }
+// } catch (XsulException e) {
+// logger.error("could not retrieve messages");
+// break;
+// } catch (RemoteException e) {
+// logger.error("could not retrieve messages");
+// break;
+// } catch (XMLStreamException e) {
+// logger.error("could not retrieve messages");
+// break;
+// } catch (Exception e){
+// logger.error("could not retrieve messages");
+// break;
+// }
+// }
}
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonClassLoader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonClassLoader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonClassLoader.java
index 135e331..bd05cc4 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonClassLoader.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonClassLoader.java
@@ -45,7 +45,6 @@ import java.util.jar.JarFile;
import org.apache.airavata.common.utils.IOUtil;
import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
import org.apache.airavata.xbaya.XBayaVersion;
-import org.apache.airavata.xbaya.jython.lib.NotificationSender;
import org.python.util.PythonInterpreter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -170,10 +169,11 @@ public class JythonClassLoader extends SecureClassLoader {
// JythonOneTimeRunner also needs to be loaded separatly.
if (name.startsWith("org.python.")) {
klass = findClassFromURL(name, this.jythonURL, this.jythonJarFile);
- } else if (name.startsWith(NotificationSender.class.getPackage().getName())
- || name.startsWith(JythonOneTimeRunnerImpl.class.getName())) {
- klass = findClassFromURL(name, this.xbayaURL, this.xbayaJarFile);
}
+// else if (name.startsWith(NotificationSender.class.getPackage().getName())
+// || name.startsWith(JythonOneTimeRunnerImpl.class.getName())) {
+// klass = findClassFromURL(name, this.xbayaURL, this.xbayaJarFile);
+// }
if (klass != null) {
this.classes.put(name, klass);
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/script/JythonScript.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/script/JythonScript.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/script/JythonScript.java
index cf2e619..41b4389 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/script/JythonScript.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/script/JythonScript.java
@@ -50,7 +50,6 @@ import org.apache.airavata.xbaya.XBayaConfiguration;
import org.apache.airavata.xbaya.XBayaConstants;
import org.apache.airavata.xbaya.XBayaVersion;
import org.apache.airavata.xbaya.invoker.GenericInvoker;
-import org.apache.airavata.xbaya.jython.lib.NotificationSender;
public class JythonScript {
@@ -76,7 +75,7 @@ public class JythonScript {
private static final String INVOKER_CLASS = StringUtil.getClassName(GenericInvoker.class);
- private static final String NOTIFICATION_CLASS = StringUtil.getClassName(NotificationSender.class);
+// private static final String NOTIFICATION_CLASS = StringUtil.getClassName(NotificationSender.class);
private static final String WORKFLOW_STARTED_METHOD = "workflowStarted";
@@ -266,7 +265,7 @@ public class JythonScript {
}
/**
- * @throws GraphExceptionconcreteWSDL
+ * @throws org.apache.airavata.workflow.model.graph.GraphException
*/
public void create() throws GraphException {
StringWriter stringWriter = new StringWriter();
@@ -339,7 +338,7 @@ public class JythonScript {
pw.println("from java.io import FileInputStream");
pw.println("from javax.xml.namespace import QName");
pw.println("from " + GenericInvoker.class.getPackage().getName() + " import " + INVOKER_CLASS);
- pw.println("from " + NotificationSender.class.getPackage().getName() + " import " + NOTIFICATION_CLASS);
+// pw.println("from " + NotificationSender.class.getPackage().getName() + " import " + NOTIFICATION_CLASS);
pw.println();
}
@@ -431,8 +430,8 @@ public class JythonScript {
+ MESSAGE_BOX_URL_VARIABLE + "')");
// Initialize a notification sender.
- pw.println(NOTIFICATION_VARIABLE + " = " + NOTIFICATION_CLASS + "(" + BROKER_URL_VARIABLE + ", "
- + TOPIC_VARIABLE + ")");
+// pw.println(NOTIFICATION_VARIABLE + " = " + NOTIFICATION_CLASS + "(" + BROKER_URL_VARIABLE + ", "
+// + TOPIC_VARIABLE + ")");
// Send a START_WORKFLOW notification.
pw.println(NOTIFICATION_VARIABLE + "." + WORKFLOW_STARTED_METHOD + "(");
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java
index d982c0f..d73e00a 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java
@@ -21,18 +21,13 @@
package org.apache.airavata.xbaya.lead;
-import java.net.URI;
-
import org.apache.airavata.common.utils.WSDLUtil;
import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.ws.monitor.MonitorConfiguration;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
import org.apache.airavata.xbaya.XBayaConfiguration;
import org.apache.airavata.xbaya.XBayaConstants;
-
-import org.apache.axis2.addressing.EndpointReference;
import xsul.lead.LeadContextHeader;
-import xsul.ws_addressing.WsaEndpointReference;
+
+import java.net.URI;
public class LeadContextHeaderHelper {
@@ -102,9 +97,9 @@ public class LeadContextHeaderHelper {
topic = XBayaConstants.DEFAULT_TOPIC;
}
// TODO remove the xsul dependency here to WsaEndpointReference object
- EndpointReference eventSink = WseMsgBrokerClient.createEndpointReference(brokerURL.toString(), topic);
- WsaEndpointReference eprReference = new WsaEndpointReference(URI.create(eventSink.getAddress()));
- this.leadContextHeader.setEventSink(eprReference);
+// EndpointReference eventSink = WseMsgBrokerClient.createEndpointReference(brokerURL.toString(), topic);
+// WsaEndpointReference eprReference = new WsaEndpointReference(URI.create(eventSink.getAddress()));
+// this.leadContextHeader.setEventSink(eprReference);
}
}
@@ -134,9 +129,9 @@ public class LeadContextHeaderHelper {
/**
* @param monitorConfiguration
*/
- public void setMonitorConfiguration(MonitorConfiguration monitorConfiguration) {
- setEventSink(monitorConfiguration.getBrokerURL(), monitorConfiguration.getTopic());
- }
+// public void setMonitorConfiguration(MonitorConfiguration monitorConfiguration) {
+// setEventSink(monitorConfiguration.getBrokerURL(), monitorConfiguration.getTopic());
+// }
/**
* This method has to be called before setMonitorConfiguration because this will overwrite some variables.
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/NotificationHandler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/NotificationHandler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/NotificationHandler.java
index 982cdf3..c1c9da0 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/NotificationHandler.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/NotificationHandler.java
@@ -21,24 +21,14 @@
package org.apache.airavata.xbaya.lead;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Properties;
-
import org.apache.airavata.common.utils.XMLUtil;
import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
-import org.apache.airavata.workflow.tracking.NotifierFactory;
-import org.apache.airavata.workflow.tracking.WorkflowNotifier;
-import org.apache.airavata.workflow.tracking.common.InvocationContext;
-import org.apache.airavata.workflow.tracking.common.InvocationEntity;
-import org.apache.airavata.workflow.tracking.common.WorkflowTrackingContext;
import org.apache.airavata.xbaya.XBayaConstants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.xmlbeans.XmlObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.xmlpull.v1.builder.XmlElement;
-
import xsul.XmlConstants;
import xsul.invoker.DynamicInfosetInvokerException;
import xsul.lead.LeadContextHeader;
@@ -46,6 +36,9 @@ import xsul.message_router.MessageContext;
import xsul.xbeans_util.XBeansUtil;
import xsul.xhandler.BaseHandler;
+import java.net.URI;
+import java.net.URISyntaxException;
+
public class NotificationHandler extends BaseHandler {
private static final Logger logger = LoggerFactory.getLogger(NotificationHandler.class);
@@ -58,13 +51,13 @@ public class NotificationHandler extends BaseHandler {
private LeadContextHeader leadContext;
- private WorkflowNotifier notifier;
+// private WorkflowNotifier notifier;
- private WorkflowTrackingContext context;
+// private WorkflowTrackingContext context;
- private InvocationContext invocationContext;
+// private InvocationContext invocationContext;
- private InvocationEntity invocationEntity;
+// private InvocationEntity invocationEntity;
private WorkflowContextHeaderBuilder builder;
@@ -76,7 +69,7 @@ public class NotificationHandler extends BaseHandler {
public NotificationHandler(LeadContextHeader leadContext) {
super(NotificationHandler.class.getName());
this.leadContext = leadContext;
- this.notifier = NotifierFactory.createNotifier();
+// this.notifier = NotifierFactory.createNotifier();
URI myWorkflowID = null;
URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
String userDN = this.leadContext.getUserDn();
@@ -93,15 +86,15 @@ public class NotificationHandler extends BaseHandler {
String myNodeID = null;
Integer myTimestep = null;
EndpointReference epr = new EndpointReference(leadContext.getEventSink().getAddress().toString());
- this.invocationEntity = this.notifier.createEntity(myWorkflowID, myServiceID, myNodeID, myTimestep);
- this.context = this.notifier.createTrackingContext(new Properties(), epr.getAddress().toString(), myWorkflowID,
- myServiceID, myNodeID, myTimestep);
+// this.invocationEntity = this.notifier.createEntity(myWorkflowID, myServiceID, myNodeID, myTimestep);
+// this.context = this.notifier.createTrackingContext(new Properties(), epr.getAddress().toString(), myWorkflowID,
+// myServiceID, myNodeID, myTimestep);
}
public NotificationHandler(WorkflowContextHeaderBuilder builder) {
super(NotificationHandler.class.getName());
this.builder = builder;
- this.notifier = NotifierFactory.createNotifier();
+// this.notifier = NotifierFactory.createNotifier();
URI myWorkflowID = null;
URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
String userDN = this.builder.getUserIdentifier();
@@ -118,9 +111,9 @@ public class NotificationHandler extends BaseHandler {
String myNodeID = null;
Integer myTimestep = null;
EndpointReference epr = new EndpointReference(builder.getWorkflowMonitoringContext().getEventPublishEpr());
- this.invocationEntity = this.notifier.createEntity(myWorkflowID, myServiceID, myNodeID, myTimestep);
- this.context = this.notifier.createTrackingContext(new Properties(), epr.getAddress().toString(), myWorkflowID,
- myServiceID, myNodeID, myTimestep);
+// this.invocationEntity = this.notifier.createEntity(myWorkflowID, myServiceID, myNodeID, myTimestep);
+// this.context = this.notifier.createTrackingContext(new Properties(), epr.getAddress().toString(), myWorkflowID,
+// myServiceID, myNodeID, myTimestep);
}
/**
@@ -154,8 +147,8 @@ public class NotificationHandler extends BaseHandler {
}
XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody);
- this.invocationContext = this.notifier.invokingService(this.context, this.invocationEntity, headerObject,
- bodyObject, INVOKING_MESSAGE);
+// this.invocationContext = this.notifier.invokingService(this.context, this.invocationEntity, headerObject,
+// bodyObject, INVOKING_MESSAGE);
return super.processOutgoingXml(soapEnvelope, context);
}
@@ -178,11 +171,11 @@ public class NotificationHandler extends BaseHandler {
XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody);
XmlElement faultElement = soapBody.element(null, "Fault");
if (faultElement == null) {
- this.notifier.receivedResult(this.context, this.invocationContext, headerObject, bodyObject,
- RECEIVE_RESULT_MESSAGE);
+// this.notifier.receivedResult(this.context, this.invocationContext, headerObject, bodyObject,
+// RECEIVE_RESULT_MESSAGE);
} else {
- this.notifier.receivedFault(this.context, this.invocationContext, headerObject, bodyObject,
- RECEIVE_FAULT_MESSAGE);
+// this.notifier.receivedFault(this.context, this.invocationContext, headerObject, bodyObject,
+// RECEIVE_FAULT_MESSAGE);
}
return super.processIncomingXml(soapEnvelope, context);
http://git-wip-us.apache.org/repos/asf/airavata/blob/e32c1a94/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorConfigurationWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorConfigurationWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorConfigurationWindow.java
index f2c49bd..552d7f0 100644
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorConfigurationWindow.java
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorConfigurationWindow.java
@@ -34,7 +34,6 @@ import javax.swing.JLabel;
import javax.swing.JPanel;
import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.ws.monitor.MonitorConfiguration;
import org.apache.airavata.xbaya.XBayaEngine;
import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
import org.apache.airavata.xbaya.ui.widgets.GridPanel;
@@ -45,7 +44,7 @@ public class MonitorConfigurationWindow {
private XBayaEngine engine;
- private MonitorConfiguration configuration;
+// private MonitorConfiguration configuration;
private XBayaDialog dialog;
@@ -71,10 +70,10 @@ public class MonitorConfigurationWindow {
* Shows the dialog.
*/
public void show() {
- this.brokerTextField.setText(this.configuration.getBrokerURL());
- this.topicTextField.setText(this.configuration.getTopic());
- this.pullCheckBox.setSelected(this.configuration.isPullMode());
- this.messageBoxTextField.setText(this.configuration.getMessageBoxURL());
+// this.brokerTextField.setText(this.configuration.getBrokerURL());
+// this.topicTextField.setText(this.configuration.getTopic());
+// this.pullCheckBox.setSelected(this.configuration.isPullMode());
+// this.messageBoxTextField.setText(this.configuration.getMessageBoxURL());
this.dialog.show();
}
@@ -125,10 +124,10 @@ public class MonitorConfigurationWindow {
return;
}
} else {
- messageBoxURL = this.configuration.getMessageBoxURL();
+// messageBoxURL = this.configuration.getMessageBoxURL();
}
- this.configuration.set(brokerURL, topic, pull, messageBoxURL);
+// this.configuration.set(brokerURL, topic, pull, messageBoxURL);
this.engine.getConfiguration().setMessageBoxURL(messageBoxURL);
this.engine.getConfiguration().setBrokerURL(brokerURL);
this.engine.getConfiguration().setTopic(topic);