You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by sa...@apache.org on 2014/04/14 20:30:03 UTC

[01/90] [abbrv] [partial] AIRAVATA-1124

Repository: airavata
Updated Branches:
  refs/heads/master bb0f71025 -> b7122a9d2


http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java
deleted file mode 100644
index 98277ce..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java
+++ /dev/null
@@ -1,727 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.descriptors;
-
-import java.awt.BorderLayout;
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.PathNotFoundException;
-import javax.swing.BorderFactory;
-import javax.swing.DefaultCellEditor;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.WindowConstants;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumn;
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.schemas.gfac.InputParameterType;
-import org.apache.airavata.schemas.gfac.OutputParameterType;
-import org.apache.airavata.schemas.gfac.ParameterType;
-import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.DescriptorListDialog.DescriptorType;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.apache.xmlbeans.XmlCursor;
-
-public class ServiceDescriptionDialog extends JDialog {
-
-    private static final long serialVersionUID = 2705760838264284423L;
-    private final GridPanel contentPanel = new GridPanel();
-    private XBayaLabel lblServiceName;
-    private XBayaTextField txtServiceName;
-    private JTable tblParameters;
-    private boolean serviceCreated = false;
-    private JLabel lblError;
-    private ServiceDescription serviceDescription;
-    private ServiceDescription orginalServiceDescription;
-    private JButton okButton;
-    private JButton btnDeleteParameter;
-    private DefaultTableModel defaultTableModel;
-    private AiravataAPI registry;
-    private boolean newDescription;
-    private boolean ignoreTableChanges=false;
-	private JCheckBox chkForceFileStagingToWorkDir;
-	private boolean serviceDescriptionMode;
-	private String suggestedNamePrefix;
-	private String titlePrefix;
-	
-    /**
-     * Launch the application.
-     */
-    public static void main(String[] args) {
-        try {
-            ServiceDescriptionDialog dialog = new ServiceDescriptionDialog(null,true,null);
-            dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
-            dialog.setVisible(true);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    public ServiceDescriptionDialog(AiravataAPI registry) {
-    	this(registry,true,null);
-    }
-    
-    public ServiceDescriptionDialog(AiravataAPI registry, boolean newDescription, ServiceDescription serviceDescription) {
-    	this(registry, newDescription, serviceDescription, true, null);
-    }
-    
-    /**
-     * Create the dialog.
-     */
-    public ServiceDescriptionDialog(AiravataAPI registry, boolean newDescription, ServiceDescription serviceDescription, boolean serviceDescriptionMode, String suggestedNamePrefix) {
-    	setNewDescription(newDescription);
-    	this.setOrginalServiceDescription(serviceDescription);
-    	setServiceDescriptionMode(serviceDescriptionMode);
-    	setSuggestedNamePrefix(suggestedNamePrefix);
-    	if (isNewDescription()) {
-			setTitlePrefix(isServiceDescriptionMode()? "New Service Description":"Input/Output parameters for "+getSuggestedNamePrefix());
-		}else{
-			setTitlePrefix(isServiceDescriptionMode()? "Update Service Description: "+getOrginalServiceDescription().getType().getName():"Update Input/Output parameters for "+getSuggestedNamePrefix());
-		}
-        addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowOpened(WindowEvent arg0) {
-                if (isNewDescription() && !isServiceDescriptionMode()) {
-					String baseName = isServiceDescriptionMode()? "Service":getSuggestedNamePrefix()+"_Service";
-					int i;
-					String defaultName;
-					if (isServiceDescriptionMode()) {
-						i = 1;
-						defaultName = baseName+i;
-					}else{
-						i = 0;
-						defaultName = baseName;
-					}
-					try {
-						while (getRegistry().getApplicationManager().isServiceDescriptorExists(defaultName)) {
-							defaultName = baseName + (++i);
-						}
-					} catch (Exception e) {
-					}
-					txtServiceName.setText(defaultName);
-					setServiceName(txtServiceName.getText());
-				}
-            }
-        });
-        setRegistry(registry);
-        initGUI();
-
-    }
-
-    public void open() {
-        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
-        setVisible(true);
-    }
-
-    protected ServiceDescriptionDialog getDialog() {
-        return this;
-    }
-
-    private void initGUI() {
-    	setTitle(getTitlePrefix());
-//        if (isNewDescription()) {
-//			setTitle("New Service Description");
-//		}else{
-//			setTitle("Update Service Description: "+getOrginalServiceDescription().getType().getName());
-//		}
-		setBounds(100, 100, 463, 459);
-        setModal(true);
-        setLocationRelativeTo(null);
-        BorderLayout borderLayout = new BorderLayout();
-        borderLayout.setVgap(5);
-        borderLayout.setHgap(5);
-        getContentPane().setLayout(borderLayout);
-
-        txtServiceName = new XBayaTextField();
-        txtServiceName.getSwingComponent().addKeyListener(new KeyAdapter() {
-            @Override
-            public void keyReleased(KeyEvent e) {
-                setServiceName(txtServiceName.getText());
-            }
-        });
-        txtServiceName.setColumns(10);
-        lblServiceName = new XBayaLabel(isServiceDescriptionMode()? "Service name":"Bind parameters to service",txtServiceName);
-        if (!isServiceDescriptionMode()){
-        	lblServiceName.getSwingComponent().setFont(new Font("Tahoma", Font.ITALIC, 11));
-        }
-        JLabel lblInputParameters = new JLabel(isServiceDescriptionMode()? "Service Parameters":"Input/Output Parameters");
-        lblInputParameters.setFont(new Font("Tahoma", Font.BOLD, 11));
-
-        JScrollPane scrollPane = new JScrollPane();
-
-        btnDeleteParameter = new JButton("Delete parameter");
-        btnDeleteParameter.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent arg0) {
-                deleteSelectedRows();
-            }
-        });
-        btnDeleteParameter.setEnabled(false);
-
-        tblParameters = new JTable();
-        tblParameters.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
-        tblParameters.setFillsViewportHeight(true);
-        defaultTableModel = new DefaultTableModel(new Object[][] { { null, null, null, null }, }, new String[] { "I/O",
-                "Parameter Name", "Type", "Description" });
-        tblParameters.setModel(defaultTableModel);
-        defaultTableModel.addTableModelListener(new TableModelListener() {
-
-            @Override
-            public void tableChanged(TableModelEvent arg0) {
-                if (!ignoreTableChanges) {
-					int selectedRow = tblParameters.getSelectedRow();
-					if (selectedRow != -1
-							&& defaultTableModel.getRowCount() > 0) {
-						Object parameterIOType = defaultTableModel.getValueAt(
-								selectedRow, 0);
-						Object parameterDataType = defaultTableModel
-								.getValueAt(selectedRow, 2);
-						if (parameterIOType == null
-								|| parameterIOType.equals("")) {
-							defaultTableModel.setValueAt(getIOStringList()[0],
-									selectedRow, 0);
-						}
-						if (parameterDataType == null
-								|| parameterDataType.equals("")) {
-							defaultTableModel.setValueAt(getDataTypes()[0],
-									selectedRow, 2);
-						}
-					}
-					addNewRowIfLastIsNotEmpty();
-				}
-            }
-
-        });
-        TableColumn ioColumn = tblParameters.getColumnModel().getColumn(0);
-        String[] ioStringList = getIOStringList();
-        ioColumn.setCellEditor(new StringArrayComboBoxEditor(ioStringList));
-
-        TableColumn datatypeColumn = tblParameters.getColumnModel().getColumn(2);
-        String[] dataTypeStringList = getDataTypes();
-        datatypeColumn.setCellEditor(new StringArrayComboBoxEditor(dataTypeStringList));
-
-        TableColumn parameterNameCol = tblParameters.getColumnModel().getColumn(1);
-        parameterNameCol.setPreferredWidth(190);
-        scrollPane.setViewportView(tblParameters);
-        ListSelectionModel selectionModel = tblParameters.getSelectionModel();
-        selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-
-        selectionModel.addListSelectionListener(new ListSelectionListener() {
-            @Override
-            public void valueChanged(ListSelectionEvent e) {
-                btnDeleteParameter.setEnabled(tblParameters.getSelectedRows().length > 0);
-            }
-
-        });
-        JLabel lblTableParameterNote=null;
-        if (!isServiceDescriptionMode()) {
-			final JPopupMenu popup = new JPopupMenu();
-			JMenuItem menuItem = new JMenuItem(
-					"Bind to parameters in existing service...");
-			menuItem.addActionListener(new ActionListener() {
-				@Override
-				public void actionPerformed(ActionEvent arg0) {
-					bindExistingServiceDescriptionAsParameters();
-				}
-
-			});
-			popup.add(menuItem);
-			tblParameters.addMouseListener(new MouseAdapter() {
-				@Override
-				public void mouseClicked(MouseEvent e) {
-					showPopup(e);
-				}
-
-				public void mousePressed(MouseEvent e) {
-					showPopup(e);
-				}
-
-				public void mouseReleased(MouseEvent e) {
-					showPopup(e);
-				}
-
-				private void showPopup(MouseEvent e) {
-					if (e.isPopupTrigger()) {
-						popup.show(tblParameters, e.getX(), e.getY());
-					}
-				}
-			});
-			lblTableParameterNote = new JLabel("*Note: Right click on the table to bind an existing service");
-			lblTableParameterNote.setFont(new Font("Tahoma", Font.ITALIC, 11));
-		}
-		chkForceFileStagingToWorkDir=new JCheckBox("Advanced: Force input file staging to working directory");
-        chkForceFileStagingToWorkDir.addActionListener(new ActionListener(){
-
-			@Override
-			public void actionPerformed(ActionEvent arg0) {
-				setForceFileStagingToWorkDir(chkForceFileStagingToWorkDir.isSelected());
-			}
-        	
-        });
-        GridPanel buttonPane = new GridPanel();
-        {
-            GridBagLayout gbl_buttonPane = new GridBagLayout();
-            gbl_buttonPane.columnWidths = new int[] { 307, 136, 0 };
-            gbl_buttonPane.rowHeights = new int[] { 33, 0 };
-            gbl_buttonPane.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
-            gbl_buttonPane.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
-            
-
-            lblError = new JLabel("");
-            lblError.setForeground(Color.RED);
-            GridBagConstraints gbc_lblError = new GridBagConstraints();
-            gbc_lblError.insets = new Insets(0, 0, 0, 5);
-            gbc_lblError.gridx = 0;
-            gbc_lblError.gridy = 0;
-            buttonPane.add(lblError);
-            JPanel panel = new JPanel();
-            GridBagConstraints gbc_panel = new GridBagConstraints();
-            gbc_panel.anchor = GridBagConstraints.NORTHWEST;
-            gbc_panel.gridx = 1;
-            gbc_panel.gridy = 0;
-            buttonPane.add(panel);
-            {
-            	JButton resetButton = new JButton("Reset");
-                resetButton.addActionListener(new ActionListener() {
-                    @Override
-                    public void actionPerformed(ActionEvent e) {
-                    	loadData();
-                    }
-                });
-                panel.add(resetButton);
-            }
-            {
-                okButton = new JButton("Save");
-                if (!isNewDescription()){
-                	okButton.setText("Update");
-                }
-                okButton.setEnabled(false);
-                okButton.addActionListener(new ActionListener() {
-                    @Override
-                    public void actionPerformed(ActionEvent e) {
-                        saveServiceDescription();
-                        close();
-                    }
-                });
-                panel.add(okButton);
-                okButton.setActionCommand("OK");
-                getRootPane().setDefaultButton(okButton);
-            }
-            {
-                JButton cancelButton = new JButton("Cancel");
-                cancelButton.addActionListener(new ActionListener() {
-                    @Override
-                    public void actionPerformed(ActionEvent e) {
-                        setServiceCreated(false);
-                        close();
-                    }
-                });
-                panel.add(cancelButton);
-                cancelButton.setActionCommand("Cancel");
-            }
-        }
-        
-        contentPanel.add(lblServiceName);
-        contentPanel.add(txtServiceName);
-        GridPanel parameterPanel=new GridPanel();
-        if (isServiceDescriptionMode()) {
-			parameterPanel.add(lblInputParameters);
-		}
-		if (lblTableParameterNote!=null) {
-			parameterPanel.add(lblTableParameterNote);
-		}
-        parameterPanel.add(scrollPane);
-			//        if (isServiceDescriptionMode()){
-    	parameterPanel.add(btnDeleteParameter);
-//        }else{
-//            GridPanel parameterOptionPanel=new GridPanel();
-//        	JButton btnLoadExistingServiceData = new JButton("Bind to parameters in existing service description...");
-//        	btnLoadExistingServiceData.addActionListener(new ActionListener(){
-//				@Override
-//				public void actionPerformed(ActionEvent arg0) {
-//					bindExistingServiceDescriptionAsParameters();
-//				}
-//        	});
-//        	parameterOptionPanel.add(btnLoadExistingServiceData);
-//        	parameterOptionPanel.add(btnDeleteParameter);
-//        	parameterPanel.add(parameterOptionPanel);
-//        }
-        
-        SwingUtil.layoutToGrid(contentPanel.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, 1);
-//        if (lblTableParameterNote==null){
-        	SwingUtil.layoutToGrid(parameterPanel.getSwingComponent(), 3, 1, 1, 0);
-//        }else{
-//        	SwingUtil.layoutToGrid(parameterPanel.getSwingComponent(), 4, 1, 2, 0);
-//        }
-        GridPanel infoPanel = new GridPanel();
-        if (isServiceDescriptionMode()) {
-			infoPanel.add(contentPanel);
-		}
-		infoPanel.add(parameterPanel);
-        infoPanel.add(chkForceFileStagingToWorkDir);
-        if (!isServiceDescriptionMode()) {
-			infoPanel.add(contentPanel);
-		}
-        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        if (isServiceDescriptionMode()) {
-			infoPanel.layout(3, 1, 1, 0);
-		}else{
-			infoPanel.layout(3, 1, 0, 0);
-		}
-		getContentPane().add(infoPanel.getSwingComponent());
-        getContentPane().add(buttonPane.getSwingComponent());
-        buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
-        setResizable(true);
-        getRootPane().setDefaultButton(okButton);
-        if (!isNewDescription()){
-        	loadData();
-        }
-    }
-
-    private void loadData() {
-    	ServiceDescriptionType descType = getOrginalServiceDescription().getType();
-		txtServiceName.setText(descType.getName());
-		setServiceName(txtServiceName.getText());
-
-		txtServiceName.setEditable(!isServiceDescriptionMode() || isNewDescription());
-    	ignoreTableChanges=true;
-    	while(defaultTableModel.getRowCount()>0){
-    		defaultTableModel.removeRow(0);
-    	}
-    	InputParameterType[] iparameters = descType.getInputParametersArray();
-    	for (InputParameterType parameter : iparameters) {
-    		defaultTableModel.addRow(new Object[] { getIOStringList()[0], parameter.getParameterName(),parameter.getParameterType().getName(),parameter.getParameterDescription()});	
-		}
-    	OutputParameterType[] oparameters = descType.getOutputParametersArray();
-    	for (OutputParameterType parameter : oparameters) {
-    		defaultTableModel.addRow(new Object[] { getIOStringList()[1], parameter.getParameterName(), parameter.getParameterType().getName(),parameter.getParameterDescription()});	
-		}
-    	addNewRowIfLastIsNotEmpty();
-    	Boolean selected = false;
-    	if (descType.getPortType()!=null && descType.getPortType().getMethod()!=null) {
-			XmlCursor cursor = descType.getPortType().getMethod().newCursor();
-//			cursor.toNextToken();
-			String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
-			cursor.dispose();
-			selected = false;
-			if (value != null) {
-				selected = Boolean.parseBoolean(value);
-			}
-		}
-		chkForceFileStagingToWorkDir.setSelected(selected);
-    	setForceFileStagingToWorkDir(selected);
-    	ignoreTableChanges=false;
-	}
-
-    private String[] getIOStringList() {
-        String[] ioStringList = new String[] { "Input", "Output" };
-        return ioStringList;
-    }
-
-    private String[] getDataTypes() {
-        String[] type = new String[DataType.Enum.table.lastInt()];
-        for (int i = 1; i <= DataType.Enum.table.lastInt(); i++) {
-            type[i - 1] = DataType.Enum.forInt(i).toString();
-        }
-        return type;
-    }
-
-    public boolean isServiceCreated() {
-        return serviceCreated;
-    }
-
-    public void setServiceCreated(boolean serviceCreated) {
-        this.serviceCreated = serviceCreated;
-    }
-
-    public ServiceDescription getServiceDescription() {
-        if (serviceDescription == null) {
-            serviceDescription = new ServiceDescription();
-        }
-        return serviceDescription;
-    }
-
-    public ServiceDescriptionType getServiceDescriptionType() {
-        return getServiceDescription().getType();
-    }
-
-    public String getServiceName() {
-        return getServiceDescription().getType().getName();
-    }
-
-    public void setServiceName(String serviceName) {
-        getServiceDescription().getType().setName(serviceName);
-        updateDialogStatus();
-    }
-
-    private void setupMethod(){
-    	if (getServiceDescriptionType().getPortType()==null){
-    		getServiceDescriptionType().setPortType(getServiceDescriptionType().addNewPortType());
-    	}
-    	if (getServiceDescriptionType().getPortType().getMethod()==null){
-    		getServiceDescriptionType().getPortType().setMethod(getServiceDescriptionType().getPortType().addNewMethod());
-    	}
-    }
-    public void setForceFileStagingToWorkDir(Boolean force){
-    	setupMethod();
-    	XmlCursor cursor = getServiceDescriptionType().getPortType().getMethod().newCursor();
-    	cursor.toNextToken();
-		if (!cursor.setAttributeText(new QName("http://airavata.apache.org/schemas/gfac/2012/12","forceFileStagingToWorkDir"),force.toString())){
-			cursor.insertAttributeWithValue("forceFileStagingToWorkDir",force.toString());
-		}
-		cursor.dispose();
-    }
-    
-    public Boolean getForceFileStagingToWorkDir(){
-    	setupMethod();
-    	XmlCursor cursor = getServiceDescriptionType().getPortType().getMethod().newCursor();    	
-    	cursor.toNextToken();
-		String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
-		cursor.dispose();
-		if (value==null){
-			return false;
-		}else{
-			return Boolean.parseBoolean(value);
-		}
-		
-    }
-    
-    private void updateDialogStatus() {
-        String message = null;
-        try {
-            validateDialog();
-        } catch (Exception e) {
-            message = e.getLocalizedMessage();
-        }
-        okButton.setEnabled(message == null);
-        setError(message);
-    }
-
-    private void validateDialog() throws Exception {
-        if (getServiceName() == null || getServiceName().trim().equals("")) {
-            throw new Exception("Name of the service cannot be empty!!!");
-        }
-
-        ServiceDescription serviceDescription2 = null;
-        try {
-            serviceDescription2 = getRegistry().getApplicationManager().getServiceDescription(getServiceName());
-        } catch (AiravataAPIInvocationException e) {
-            if (e.getCause() instanceof PathNotFoundException) {
-                // non-existant name. just want we want
-            } else {
-                throw e;
-            }
-        }
-        if (isNewDescription() && serviceDescription2 != null) {
-            throw new Exception("Service descriptor with the given name already exists!!!");
-        }
-    }
-
-    public void saveServiceDescription() {
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-
-        for (int i = 0; i < defaultTableModel.getRowCount(); i++) {
-            String parameterName = (String) defaultTableModel.getValueAt(i, 1);
-            String paramType = (String) defaultTableModel.getValueAt(i, 2);
-            String parameterDescription = (String) defaultTableModel.getValueAt(i, 3);
-            if (parameterName != null && !parameterName.trim().equals("")) {
-                // todo how to handle Enum
-                if (getIOStringList()[0].equals(defaultTableModel.getValueAt(i, 0))) {
-                    InputParameterType parameter = InputParameterType.Factory.newInstance();
-                    parameter.setParameterName(parameterName);
-                    parameter.setParameterDescription(parameterDescription);
-                    ParameterType parameterType = parameter.addNewParameterType();
-                    parameterType.setType(DataType.Enum.forString(paramType));
-                    parameterType.setName(paramType);
-                    inputParameters.add(parameter);
-
-                } else {
-                    OutputParameterType parameter = OutputParameterType.Factory.newInstance();
-                    parameter.setParameterName(parameterName);
-                    parameter.setParameterDescription(parameterDescription);
-                    ParameterType parameterType = parameter.addNewParameterType();
-                    parameterType.setType(DataType.Enum.forString(paramType));
-                    parameterType.setName(paramType);
-                    outputParameters.add(parameter);
-                }
-            }
-        }
-        getServiceDescriptionType().setInputParametersArray(inputParameters.toArray(new InputParameterType[] {}));
-        getServiceDescriptionType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[] {}));
-
-        try {
-			if (getRegistry().getApplicationManager().isServiceDescriptorExists(getServiceDescription().getType().getName())) {
-				getRegistry().getApplicationManager().updateServiceDescriptor(getServiceDescription());
-			}else{
-				getRegistry().getApplicationManager().saveServiceDescription(getServiceDescription());
-			}
-			setServiceCreated(true);
-		} catch (AiravataAPIInvocationException e) {
-			e.printStackTrace();
-			setError(e.getMessage());
-		}
-    }
-
-    public void close() {
-        getDialog().setVisible(false);
-    }
-
-    private void setError(String errorMessage) {
-        if (errorMessage == null || errorMessage.trim().equals("")) {
-            lblError.setText("");
-        } else {
-            lblError.setText(errorMessage.trim());
-        }
-    }
-
-    private void deleteSelectedRows() {
-        // TODO confirm deletion of selected rows
-        int selectedRow = tblParameters.getSelectedRow();
-        while (selectedRow >= 0 && tblParameters.getRowCount()>0) {
-            defaultTableModel.removeRow(selectedRow);
-            selectedRow = tblParameters.getSelectedRow();
-        }
-        addNewRowIfLastIsNotEmpty();
-    }
-
-    private void addNewRowIfLastIsNotEmpty() {
-    	
-        if (defaultTableModel.getRowCount()>0) {
-			Object parameterName = defaultTableModel.getValueAt(
-					defaultTableModel.getRowCount() - 1, 1);
-			if (parameterName != null && !parameterName.equals("")) {
-				defaultTableModel
-						.addRow(new Object[] { null, null, null, null });
-			}
-		}else{
-			if (tblParameters.getSelectedRow()==-1){
-				defaultTableModel.addRow(new Object[] { null, null, null, null });
-			}
-			
-		}
-    }
-
-    public AiravataAPI getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-
-    public boolean isNewDescription() {
-		return newDescription;
-	}
-
-	public void setNewDescription(boolean newDescription) {
-		this.newDescription = newDescription;
-	}
-
-	public ServiceDescription getOrginalServiceDescription() {
-		return orginalServiceDescription;
-	}
-
-	public void setOrginalServiceDescription(ServiceDescription orginalServiceDescription) {
-		this.orginalServiceDescription = orginalServiceDescription;
-	}
-
-	public boolean isServiceDescriptionMode() {
-		return serviceDescriptionMode;
-	}
-
-	public void setServiceDescriptionMode(boolean serviceDescriptionMode) {
-		this.serviceDescriptionMode = serviceDescriptionMode;
-	}
-
-	public String getSuggestedNamePrefix() {
-		return suggestedNamePrefix;
-	}
-
-	public void setSuggestedNamePrefix(String suggestedNamePrefix) {
-		this.suggestedNamePrefix = suggestedNamePrefix;
-	}
-
-	public String getTitlePrefix() {
-		return titlePrefix;
-	}
-
-	public void setTitlePrefix(String titlePrefix) {
-		this.titlePrefix = titlePrefix;
-	}
-
-	private void bindExistingServiceDescriptionAsParameters() {
-		DescriptorListDialog descriptorListDialog = new DescriptorListDialog(getRegistry(),DescriptorType.SERVICE);
-		descriptorListDialog.open();
-		if (descriptorListDialog.isServiceSelected()){
-			setOrginalServiceDescription((ServiceDescription) descriptorListDialog.getSelected());
-			setNewDescription(false);
-			loadData();
-		}
-	}
-
-	private class StringArrayComboBoxEditor extends DefaultCellEditor {
-        private static final long serialVersionUID = -304464739219209395L;
-
-        public StringArrayComboBoxEditor(Object[] items) {
-            super(new JComboBox(items));
-        }
-    }
-}


[82/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/commons/TestCommonRoutines.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/commons/TestCommonRoutines.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/commons/TestCommonRoutines.java
new file mode 100644
index 0000000..098dd49
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/commons/TestCommonRoutines.java
@@ -0,0 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.commons;
+
+import java.util.Date;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.wsmg.commons.CommonRoutines;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestCommonRoutines extends TestCase {
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @Before
+    public void setUp() throws Exception {
+    }
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    /**
+     * Test method for {@link org.apache.airavata.wsmg.commons.CommonRoutines#getXsdDateTime(java.util.Date)}.
+     */
+    @Test
+    public void testGetXsdDateTime() {
+        assertNotNull(CommonRoutines.getXsdDateTime(new Date()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestAddtionalWseXpathAndTopicScenarios.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestAddtionalWseXpathAndTopicScenarios.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestAddtionalWseXpathAndTopicScenarios.java
new file mode 100644
index 0000000..6f1ecbb
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestAddtionalWseXpathAndTopicScenarios.java
@@ -0,0 +1,151 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.matching.XPath;
+
+import java.net.URL;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import javax.xml.stream.XMLStreamException;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.airavata.wsmg.util.ConfigKeys;
+import org.apache.airavata.wsmg.util.TestUtilServer;
+import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestAddtionalWseXpathAndTopicScenarios extends TestCase {
+
+    static Properties configs = new Properties();
+
+    class NotificationReciever implements ConsumerNotificationHandler {
+
+        private BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
+
+        private String id;
+
+        public NotificationReciever(String id) {
+            this.id = id;
+        }
+
+        public void handleNotification(SOAPEnvelope msgEnvelope) {
+            queue.add(msgEnvelope);
+            System.out.println(String.format("[reciever id: %s] %s", id, msgEnvelope));
+        }
+
+        public BlockingQueue<SOAPEnvelope> getMsgQueue() {
+            return queue;
+        }
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL configURL = ClassLoader.getSystemResource(ConfigKeys.CONFIG_FILE_NAME);
+        configs.load(configURL.openStream());
+
+        TestUtilServer.start(null, null);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public final void testXpathAndTopicOnlyRoundTrip() {
+
+        try {
+
+            String topic = "RoundTripTestXpathAndTopicWse";
+
+            String xpathExpression = "/c/b/a[text()=1]";
+
+            String msgFormat = "<c><b><a>%d</a></b></c>";
+
+            long value = 1;
+            String matchingMsg = String.format(msgFormat, value);
+            String unmatchingMsg = String.format(msgFormat, value + 1);
+
+            int consumerPort = TestUtilServer.getAvailablePort();
+
+            String brokerEpr = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
+
+            WseMsgBrokerClient topicOnlyReceiverApi = new WseMsgBrokerClient();
+            topicOnlyReceiverApi.init(brokerEpr);
+            NotificationReciever topicOnlyMsgReceiver = new NotificationReciever("Topic Only");
+            String[] topicConsumerEPRs = topicOnlyReceiverApi.startConsumerService(consumerPort, topicOnlyMsgReceiver);
+            assertTrue("invalid consumer eprs returned", topicConsumerEPRs.length > 0);
+            String topicOnlySubId = topicOnlyReceiverApi.subscribe(topicConsumerEPRs[0], topic, null);
+            System.out.println("Topic only subscription ID: " + topicOnlySubId);
+
+            WseMsgBrokerClient xpathAndTopicReceiverApi = new WseMsgBrokerClient();
+            xpathAndTopicReceiverApi.init(brokerEpr);
+            NotificationReciever topicAndXpathMsgReceiver = new NotificationReciever("Topic And Xpath");
+            String[] topicAndXpathConsumerEPRs = xpathAndTopicReceiverApi.startConsumerService(consumerPort + 1,
+                    topicAndXpathMsgReceiver);
+            assertTrue("invalid consumer eprs returned", topicAndXpathConsumerEPRs.length > 0);
+            String topicAndXpathSubId = xpathAndTopicReceiverApi.subscribe(topicAndXpathConsumerEPRs[0], topic,
+                    xpathExpression);
+            System.out.println("Xpath and Topic subscription ID: " + topicAndXpathSubId);
+
+            WseMsgBrokerClient senderApi = new WseMsgBrokerClient();
+            senderApi.init(brokerEpr);
+
+            try {
+
+                senderApi.publish(topic, AXIOMUtil.stringToOM(matchingMsg));
+                senderApi.publish(topic, AXIOMUtil.stringToOM(unmatchingMsg));
+
+                Thread.sleep(5000);
+
+                assertTrue("topic only reciever should get all messages" + topicOnlyMsgReceiver.getMsgQueue().size(),
+                        topicOnlyMsgReceiver.getMsgQueue().size() == 2);
+
+                assertTrue("xpath and topic reciever should only get one message"
+                        + topicAndXpathMsgReceiver.getMsgQueue().size(),
+                        topicAndXpathMsgReceiver.getMsgQueue().size() == 1);
+            } catch (XMLStreamException x) {
+                fail("Error while creating OMElement");
+            } catch (InterruptedException e) {
+                fail("interrupted while waiting for message");
+            }
+
+            topicOnlyReceiverApi.unSubscribe(topicOnlySubId);
+            topicOnlyReceiverApi.shutdownConsumerService();
+
+            xpathAndTopicReceiverApi.unSubscribe(topicAndXpathSubId);
+            xpathAndTopicReceiverApi.shutdownConsumerService();
+
+        } catch (AxisFault e) {
+            e.printStackTrace();
+            fail("unexpected exception occured");
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathAndTopicSubscription.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathAndTopicSubscription.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathAndTopicSubscription.java
new file mode 100644
index 0000000..024b5d3
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathAndTopicSubscription.java
@@ -0,0 +1,137 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.matching.XPath;
+
+import java.net.URL;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import javax.xml.stream.XMLStreamException;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.airavata.wsmg.util.ConfigKeys;
+import org.apache.airavata.wsmg.util.TestUtilServer;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestWseXpathAndTopicSubscription extends TestCase implements ConsumerNotificationHandler {
+
+    static Properties configs = new Properties();
+
+    BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
+
+    public void handleNotification(SOAPEnvelope msgEnvelope) {
+
+        queue.add(msgEnvelope);
+        System.out.println(msgEnvelope);
+    }
+
+    BlockingQueue<SOAPEnvelope> getMsgQueue() {
+        return queue;
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL configURL = ClassLoader.getSystemResource(ConfigKeys.CONFIG_FILE_NAME);
+        configs.load(configURL.openStream());
+
+        TestUtilServer.start(null, null);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public final void testXpathOnlyRoundTrip() {
+
+        try {
+
+            String validMsgFormat = "<c><b><a> %d </a></b></c>";
+            String invalidMsgFormat = "<a><b><c> %d </c></b></a>";
+
+            long value = System.currentTimeMillis();
+            String validMsg = String.format(validMsgFormat, value);
+            String invalidMsg = String.format(invalidMsgFormat, value);
+
+            int consumerPort = TestUtilServer.getAvailablePort();
+
+            String brokerEPR = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
+            WseMsgBrokerClient msgBrokerClient = new WseMsgBrokerClient();
+            msgBrokerClient.init(brokerEPR);
+
+            String[] consumerEPRs = msgBrokerClient.startConsumerService(consumerPort, this);
+
+            assertTrue(consumerEPRs.length > 0);
+
+            String xpathExpression = "/c/b/a";
+
+            String subscriptionID = msgBrokerClient.subscribe(consumerEPRs[0], null, xpathExpression);
+
+            try {
+                msgBrokerClient.publish(null, AXIOMUtil.stringToOM(validMsg));
+                msgBrokerClient.publish(null, AXIOMUtil.stringToOM(invalidMsg));
+
+                SOAPEnvelope env = getMsgQueue().take();
+
+                assertNotNull(env.getBody());
+                assertNotNull(env.getBody().getChildrenWithLocalName("c"));
+
+                OMElement element = (OMElement) env.getBody().getChildrenWithLocalName("c").next();
+
+                String text = element.toStringWithConsume();
+
+                assertTrue("round trip of message failed" + " - due to invalid messege content",
+                        text.indexOf(new Long(value).toString()) > 0);
+
+                Thread.sleep(5000);
+
+                assertTrue("unexpected msg recieved", getMsgQueue().isEmpty());
+
+            } catch (InterruptedException e) {
+                fail("interrupted while waiting for message");
+            } catch (XMLStreamException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+                fail("invalid xml recieved: " + e.getMessage());
+            }
+
+            msgBrokerClient.unSubscribe(subscriptionID);
+            msgBrokerClient.shutdownConsumerService();
+
+        } catch (AxisFault e) {
+            e.printStackTrace();
+            fail("unexpected exception occured");
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathSubscription.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathSubscription.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathSubscription.java
new file mode 100644
index 0000000..097e6b7
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathSubscription.java
@@ -0,0 +1,139 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.matching.XPath;
+
+import java.net.URL;
+import java.util.Properties;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import javax.xml.stream.XMLStreamException;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.airavata.wsmg.util.ConfigKeys;
+import org.apache.airavata.wsmg.util.TestUtilServer;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class TestWseXpathSubscription extends TestCase implements ConsumerNotificationHandler {
+
+    static Properties configs = new Properties();
+
+    BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
+
+    public void handleNotification(SOAPEnvelope msgEnvelope) {
+
+        queue.add(msgEnvelope);
+        System.out.println(msgEnvelope);
+    }
+
+    BlockingQueue<SOAPEnvelope> getMsgQueue() {
+        return queue;
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        URL configURL = ClassLoader.getSystemResource(ConfigKeys.CONFIG_FILE_NAME);
+        configs.load(configURL.openStream());
+
+        TestUtilServer.start(null, null);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public final void testSimpleXpathTopicRoundTrip() {
+
+        try {
+
+            String validMsgFormat = "<c><b><a> %d </a></b></c>";
+            String invalidMsgFormat = "<a><b><c> %d </c></b></a>";
+
+            long value = System.currentTimeMillis();
+            String validMsg = String.format(validMsgFormat, value);
+            String invalidMsg = String.format(invalidMsgFormat, value);
+
+            int consumerPort = TestUtilServer.getAvailablePort();
+
+            String brokerEPR = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
+
+            WseMsgBrokerClient wseMsgBrokerClient = new WseMsgBrokerClient();
+            wseMsgBrokerClient.init(brokerEPR);
+
+            String[] consumerEPRs = wseMsgBrokerClient.startConsumerService(consumerPort, this);
+
+            assertTrue(consumerEPRs.length > 0);
+
+            String xpathExpression = "/c/b/a";
+            String topicExpression = "XpathAndTopicTestWse";
+
+            String subscriptionID = wseMsgBrokerClient.subscribe(consumerEPRs[0], topicExpression, xpathExpression);
+
+            try {
+
+                wseMsgBrokerClient.publish(topicExpression, AXIOMUtil.stringToOM(validMsg));
+                wseMsgBrokerClient.publish(topicExpression, AXIOMUtil.stringToOM(invalidMsg));
+
+                SOAPEnvelope env = getMsgQueue().take();
+
+                assertNotNull(env.getBody());
+                assertNotNull(env.getBody().getChildrenWithLocalName("c"));
+
+                OMElement element = (OMElement) env.getBody().getChildrenWithLocalName("c").next();
+
+                String text = element.toStringWithConsume();
+
+                assertTrue("round trip of message failed" + " - due to invalid messege content",
+                        text.indexOf(new Long(value).toString()) > 0);
+
+                Thread.sleep(5000);
+
+                assertTrue("unexpected msg recieved", getMsgQueue().isEmpty());
+
+            } catch (InterruptedException e) {
+                fail("interrupted while waiting for message");
+            } catch (XMLStreamException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+                fail("invalid xml recieved: " + e.getMessage());
+            }
+
+            wseMsgBrokerClient.unSubscribe(subscriptionID);
+            wseMsgBrokerClient.shutdownConsumerService();
+
+        } catch (AxisFault e) {
+            e.printStackTrace();
+            fail("unexpected exception occured");
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/performance/XppXPath.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/performance/XppXPath.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/performance/XppXPath.java
new file mode 100644
index 0000000..da95a00
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/performance/XppXPath.java
@@ -0,0 +1,269 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.matching.XPath.performance;
+
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.FileReader;
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.Vector;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.FactoryConfigurationError;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import edu.berkeley.cs.db.yfilterplus.queryparser.QueryParser;
+import edu.berkeley.cs.db.yfilterplus.queryparser.XPQueryParser;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
+import org.apache.axiom.soap.SOAPEnvelope;
+
+public class XppXPath {
+
+    private Vector xPathExpressions = new Vector();
+    protected BufferedReader m_in = null;
+    private static final boolean DEBUG = false;
+    long total = 0;
+
+    public int[] getMatchedLinks(String message) {
+
+        return null;
+    }
+
+    public Vector checkQueries(String query) {
+        Vector result = new Vector();
+        Set xPathExpressionsSet = new HashSet(xPathExpressions);
+
+        int size = xPathExpressions.size();
+
+        for (int i = 0; i < size; i++) {
+
+            boolean match = query.equals(xPathExpressions.get(i));
+
+            // long start=System.nanoTime();
+            if (match) {
+
+                result.add(new Integer(i));
+
+            }
+            // long end=System.nanoTime();
+            // total+=(end-start);
+        }
+
+        // System.out.println("Total="+total);
+        return result;
+    }
+
+    public boolean checkQueriesVectorToSet(Set queries) {
+        // Vector result=new Vector();
+        Set xPathExpressionsSet = new HashSet(xPathExpressions);
+
+        int size = xPathExpressions.size();
+        Iterator iter = queries.iterator();
+        int counter = 0;
+        while (iter.hasNext()) {
+            Object query = iter.next();
+            for (int i = 0; i < size; i++) {
+
+                boolean match = query.equals(xPathExpressions.get(i));
+
+                // long start=System.nanoTime();
+                if (match) {
+
+                    return true;
+
+                }
+                // long end=System.nanoTime();
+                // total+=(end-start);
+            }
+            counter++;
+            // System.out.println("counter="+counter);
+        }
+        // System.out.println("Total="+total);
+        return false;
+    }
+
+    public boolean checkQueriesBySet(Set queries) {
+        Set xPathExpressionsSet = new HashSet(xPathExpressions);
+        Iterator iter = queries.iterator();
+        int counter = 0;
+        while (iter.hasNext()) {
+            if (xPathExpressionsSet.contains(iter.next())) {
+                // System.out.println("counter="+counter);
+                return true;
+            }
+            counter++;
+        }
+        return false;
+    }
+
+    public void addXPathExpressions(String xPathExpression) {
+        xPathExpressions.add(xPathExpression);
+    }
+
+    public void readQueriesFromFile(String queryFile) {
+        int noQueries = Integer.MAX_VALUE;
+        int qNum = 0;
+        // QueryParser qp = new XFQueryParser(queryFile);
+        QueryParser qp = new XPQueryParser(queryFile);
+        // Query query;
+        String queryString;
+        while (qNum < noQueries && ((queryString = qp.readNextQueryString()) != null)) {
+            if (DEBUG)
+                System.out.println(queryString);
+            addXPathExpressions(queryString);
+            qNum++;
+        }
+    }
+
+    public String getARandomQuery() {
+        int index = (int) (xPathExpressions.size() * (Math.random()));
+        return (String) xPathExpressions.get(index);
+    }
+
+    // From http://www.rgagnon.com/javadetails/java-0052.html
+    public static String readFile(String filename) throws IOException {
+        String lineSep = System.getProperty("line.separator");
+        BufferedReader br = new BufferedReader(new FileReader(filename));
+        String nextLine = "";
+        StringBuffer sb = new StringBuffer();
+        while ((nextLine = br.readLine()) != null) {
+            sb.append(nextLine);
+            //
+            // note:
+            // BufferedReader strips the EOL character.
+            //
+            sb.append(lineSep);
+        }
+        return sb.toString();
+    }
+
+    /**
+     * @param args
+     * @throws IOException
+     * @throws FactoryConfigurationError
+     * @throws XMLStreamException
+     */
+    public static void main(String[] args) throws IOException, XMLStreamException, FactoryConfigurationError {
+        String queryFile = "C:\\YiFile\\yfilter-1.0\\yfilter-1.0\\queries2.txt";
+        XppXPath xppXPath = new XppXPath();
+        xppXPath.readQueriesFromFile(queryFile);
+        long total = 0;
+        final int round = 100;
+        String message = readFile("c:\\YiFile\\testdata\\soap2.txt");
+
+        int messageStartPoint = message.indexOf('<');
+        String xpathList = message.substring(0, messageStartPoint);
+        System.out.println("XpathList=" + xpathList);
+        System.out.println("*****************************************");
+        long start0 = System.nanoTime();
+        StringTokenizer parser0 = new StringTokenizer(xpathList, ";");
+        Set xpathTokens = new HashSet();
+        while (parser0.hasMoreTokens()) {
+            xpathTokens.add(parser0.nextToken());
+        }
+        long end0 = System.nanoTime();
+        long total0 = (end0 - start0);
+        // for(int i=0;i<xpathTokens.size();i++){
+        // System.out.println((String)xpathTokens.get(i));
+        // }
+        System.out.println("Avg Time to token=" + (total0));
+        System.out.println("Total token=" + xpathTokens.size());
+        boolean result = false;
+        for (int i = 0; i < round; i++) {
+            String randomQuery = xppXPath.getARandomQuery();
+            // xpathTokens.add(randomQuery);
+            // Vector result=null;
+
+            long start = System.nanoTime();
+            // result=xppXPath.checkQueries(randomQuery);
+            result = xppXPath.checkQueriesBySet(xpathTokens);
+            // result=xppXPath.checkQueriesVectorToSet(xpathTokens);
+            long end = System.nanoTime();
+            total += (end - start);
+        }
+        System.out.println("Match result=" + result);
+        System.out.println("Avg Time for Checking=" + (total / round));
+
+        // XSUL
+        // long start=System.nanoTime();
+        // XmlElement messageEl = builder.parseFragmentFromReader(new
+        // StringReader(
+        // message));
+        // XmlElement messageIdEl= messageEl.element(null,
+        // "Header").element(null,"MessageID");
+        // String messageId=messageIdEl.requiredTextContent();
+        // System.out.println("MessageId="+messageId);
+        // long end=System.nanoTime();
+        // total=(end-start);
+        // System.out.println("Avg Time="+(total));
+
+        // AXIOM
+        // long start=System.nanoTime();
+        // create the parser
+        // XMLStreamReader parser =
+        // XMLInputFactory.newInstance().createXMLStreamReader(new
+        // FileReader("c:\\YiFile\\testdata\\soap_only.txt"));
+        // create the builder
+        String message1 = readFile("c:\\YiFile\\testdata\\soap_only.txt");
+        long start = System.nanoTime();
+        XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(
+                new ByteArrayInputStream(message1.getBytes()));
+
+        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
+                OMAbstractFactory.getSOAP11Factory(), parser);
+        // get the root element (in this case the envelope)
+
+        SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
+
+        // // create the parser
+        // XMLStreamReader parser =
+        // XMLInputFactory.newInstance().createXMLStreamReader(new
+        // FileReader("c:\\YiFile\\testdata\\soap.txt"));
+        // // create the builder
+        // OMXMLParserWrapper builder =
+        // OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMAbstractFactory.getOMFactory(),parser);
+        // // get the root element (in this case the envelope)
+        // SOAPEnvelope envelope = (SOAPEnvelope)builder.getDocumentElement();
+        //
+        //
+        String messageIDString = envelope.getHeader().getFirstChildWithName(new QName(null, "MessageID")).getText();
+        long end = System.nanoTime();
+        total = (end - start);
+        System.out.println("Avg Time for Axiom=" + (total));
+        // OMElement headerEl=envelope.getHeader().getFirstChildWithName(new
+        // QName("http://schemas.xmlsoap.org/soap/envelope/", "Header"));
+        envelope.getHeader().getFirstChildWithName(new QName(null, "MessageID")).serialize(System.out);
+        System.out.println();
+        //
+        // headerEl.getFirstChildWithName(new QName(null, "MessageID"));
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/NotificationManager.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/NotificationManager.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/NotificationManager.java
new file mode 100644
index 0000000..c168a5f
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/NotificationManager.java
@@ -0,0 +1,151 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.performance_evaluator.rtt;
+
+import java.util.LinkedList;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.apache.airavata.wsmg.client.*;
+import org.apache.axiom.soap.SOAPEnvelope;
+
+public class NotificationManager implements ConsumerNotificationHandler {
+
+    private MessageBrokerClient client = null;
+    private String[] eprs = null;
+    private String brokerLocation = null;
+    private String protocol = null;
+    private int consumerServerPort = 0;
+    private LinkedList<String> subscriptionIds;
+    private int numberOfTopicSubscribed = 0;
+    private int numMultiThreadSupportPerSub = 0;
+    private int multipleThreadSupportIndex = 1;
+
+    public NotificationManager(String brokerLocationIn, int consumerServerPortIn, String protocolIn,
+            int numMultiThreadSupportPerSub) throws MsgBrokerClientException {
+
+        this.brokerLocation = brokerLocationIn;
+        this.consumerServerPort = consumerServerPortIn;
+        this.protocol = protocolIn;
+        this.numMultiThreadSupportPerSub = numMultiThreadSupportPerSub;
+
+        if (client == null) {
+            if (protocol.equalsIgnoreCase("wse")) {
+                WsntMsgBrokerClient wseClient = new WsntMsgBrokerClient();
+                wseClient.init(this.brokerLocation);
+                wseClient.setTimeoutInMilliSeconds(200000000);
+                eprs = wseClient.startConsumerService(consumerServerPort, this);
+                client = wseClient;
+            } else {
+                WsntMsgBrokerClient wsntClient = new WsntMsgBrokerClient();
+                wsntClient.init(this.brokerLocation);
+                wsntClient.setTimeoutInMilliSeconds(200000000);
+                eprs = wsntClient.startConsumerService(consumerServerPort, this);
+                client = wsntClient;
+            }
+        }
+
+        subscriptionIds = new LinkedList<String>();
+
+    }
+
+    public Subscription createTopicSubscription(String topic) throws Exception {
+
+        if (multipleThreadSupportIndex > numMultiThreadSupportPerSub) {
+            multipleThreadSupportIndex = 1;
+        }
+
+        String subscriptionId = client
+                .subscribe(brokerLocation, eprs[0] + "user" + multipleThreadSupportIndex++, topic);
+        subscriptionIds.add(subscriptionId);
+        Subscription subscription = new Subscription(client, subscriptionId, topic, this, brokerLocation, protocol);
+        return subscription;
+    }
+
+    public Subscription createXpathSubscription(String topicExpression, String xpathExpression) throws Exception {
+        if (multipleThreadSupportIndex > numMultiThreadSupportPerSub) {
+            multipleThreadSupportIndex = 1;
+        }
+
+        String subscriptionId = client.subscribe(eprs[0] + "user" + multipleThreadSupportIndex++, topicExpression,
+                xpathExpression);
+        subscriptionIds.add(subscriptionId);
+        Subscription subscription = new Subscription(client, subscriptionId, topicExpression, xpathExpression, this,
+                brokerLocation, protocol);
+        return subscription;
+    }
+
+    public void cleanup() throws MsgBrokerClientException {
+
+        WseMsgBrokerClient wseClient = null;
+        WsntMsgBrokerClient wsntClient = null;
+
+        if ("wse".equalsIgnoreCase(this.protocol)) {
+            wseClient = (WseMsgBrokerClient) client;
+        } else {
+            wsntClient = (WsntMsgBrokerClient) client;
+        }
+
+        if (subscriptionIds != null) {
+            if (wseClient != null) {
+                while (!subscriptionIds.isEmpty()) {
+                    String subId = subscriptionIds.remove();
+                    wseClient.unSubscribe(subId);
+                }
+            } else {
+                while (!subscriptionIds.isEmpty()) {
+                    String subId = subscriptionIds.remove();
+                    wsntClient.unSubscribe(subId);
+                }
+
+            }
+        }
+
+        if (client != null) {
+            client.shutdownConsumerService();
+        }
+    }
+
+    private BlockingQueue<StatContainer> queue = new LinkedBlockingQueue<StatContainer>();
+    private int numMsgsReceived = 0;
+
+    public void handleNotification(SOAPEnvelope msgEnvelope) {
+        queue.add(new StatContainer(msgEnvelope));
+        numMsgsReceived += 1;
+    }
+
+    public BlockingQueue<StatContainer> getQueue() {
+        return queue;
+    }
+
+    public int getNumberOfMsgsReceived() {
+        return numMsgsReceived;
+    }
+
+    public synchronized void incNoTopicsSubscribed() {
+        numberOfTopicSubscribed++;
+    }
+
+    public synchronized int getNoTopicsSubscribed() {
+        return numberOfTopicSubscribed;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PerformanceTest.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PerformanceTest.java
new file mode 100644
index 0000000..4e90ec0
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PerformanceTest.java
@@ -0,0 +1,399 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.performance_evaluator.rtt;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.Writer;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Properties;
+import java.util.concurrent.CountDownLatch;
+
+import org.apache.airavata.wsmg.performance_evaluator.rtt.util.ConfigKeys;
+import org.apache.airavata.wsmg.performance_evaluator.rtt.util.LoadMsgPayload;
+import org.apache.airavata.wsmg.performance_evaluator.rtt.util.LoadXpath;
+
+class Stat {
+    String name;
+    Object value;
+
+    public Stat(String k, Object v) {
+        name = k;
+        value = v;
+    }
+
+}
+
+public class PerformanceTest {
+
+    public static int NOTIFICATIONS_PUBLISHED_PER_TOPIC = 0;
+    static String payload = null;
+    static LinkedList<String> xpathList = null;
+    public static long totalRoundTripTime = 0;
+    private static long avgRountTripTime = 0;
+    public static BufferedWriter out = null;
+    public static Properties configurations = null;
+    public static long avgPublishRTTime = 0l;
+    private static long totalPublishRTT = 0l;
+    private static int notifPerTopic = 0;
+    private static int noTopicsPublished = 0;
+    private static String protocol = "";
+    private static int payLoadMultiplier = 1;
+    private static int consumerPort = 3345;
+    private static long testExpirationTime = 0l;
+    private static int numberOfSubscriber = 0;
+    private static int numMultiThreadsSupportPerSub = 0;
+    private static String topicPrefix = "";
+
+    public static void main(String[] args) throws Exception {
+        loadConfigurationsFromFile();
+        testPerformance();
+    }
+
+    public static void testPerformance() throws Exception {
+
+        setConfigurationValues();
+        File outfile = new File("performance.log");
+        CountDownLatch publiserhStartSignal = new CountDownLatch(1);
+        CountDownLatch publisherDoneSignal = new CountDownLatch(noTopicsPublished);
+        NotificationManager notifManagerArray[] = new NotificationManager[numberOfSubscriber];
+        StatCalculatorThread statCalcThread[] = new StatCalculatorThread[numberOfSubscriber];
+        setPayload(payLoadMultiplier);
+
+        for (int j = 0; j < numberOfSubscriber; j++) {
+            notifManagerArray[j] = new NotificationManager(configurations.getProperty(ConfigKeys.BROKER_URL),
+                    consumerPort + j, protocol, numMultiThreadsSupportPerSub);
+
+        }
+
+        // thread to calculate stats for notification manager
+        // set the subscriptions depending on the topic or xpath based
+        int arrayIndex = 0;
+        int totalReceivers = 0;
+        createSubscriberArray(noTopicsPublished, numberOfSubscriber, notifManagerArray, arrayIndex);
+        System.out.println("subscribing to topics completed, creating publisher threads");
+
+        // start publishers
+        PublisherThread[] publisher = new PublisherThread[noTopicsPublished];
+        createPublishers(noTopicsPublished, protocol, publiserhStartSignal, publisherDoneSignal, publisher);
+        System.out.println("sending signal to start publishing...");
+        long publisherStartTime = System.currentTimeMillis();
+        long startTime = System.currentTimeMillis();
+        publiserhStartSignal.countDown(); // let all threads proceed
+
+        for (int j = 0; j < numberOfSubscriber; j++) {
+            statCalcThread[j] = new StatCalculatorThread(notifManagerArray[j], testExpirationTime);
+            statCalcThread[j].start();
+        }
+
+        publisherDoneSignal.await(); // wait for all to finish
+
+        for (int j = 0; j < noTopicsPublished; j++) {
+            totalPublishRTT += publisher[j].getAvgPubTime();
+        }
+
+        avgPublishRTTime = totalPublishRTT / noTopicsPublished;
+        long publishersRunningTime = System.currentTimeMillis() - publisherStartTime;
+        System.out.println("finished publishing messgaes.");
+
+        for (StatCalculatorThread stats : statCalcThread) {
+            stats.join();
+        }
+
+        long stopTime = 0l;
+        long totNumberOfMessagesReceived = 0;
+
+        for (StatCalculatorThread stats : statCalcThread) {
+            stopTime = stopTime < stats.getLastMsgReceivedTime() ? stats.getLastMsgReceivedTime() : stopTime;
+            totalRoundTripTime += stats.getTotalTime();
+            totNumberOfMessagesReceived += stats.getNumberOfMsgReceived();
+        }
+
+        for (NotificationManager notifMngr : notifManagerArray) {
+            totalReceivers += notifMngr.getNoTopicsSubscribed();
+        }
+
+        avgRountTripTime = totalRoundTripTime / totNumberOfMessagesReceived;
+        long executionTime = stopTime - startTime;
+        double throughtput = (totNumberOfMessagesReceived * 1000) / (executionTime);
+
+        List<Stat> statistics = new ArrayList<Stat>();
+
+        statistics.add(new Stat("Payload size (bytes)", payload.getBytes("US-ASCII").length));
+        statistics.add(new Stat("Protocol", protocol));
+        statistics.add(new Stat("# total expected Msgs", totalReceivers * notifPerTopic));
+        statistics.add(new Stat("# total msgs received", totNumberOfMessagesReceived));
+        setStatList(notifPerTopic, noTopicsPublished, publishersRunningTime, executionTime, throughtput, statistics);
+        printStatistics(statistics, outfile);
+
+        for (NotificationManager notifMngr : notifManagerArray) {
+            notifMngr.cleanup();
+        }
+
+        System.out.println("end of test");
+        System.exit(0);
+    }
+
+    private static void setConfigurationValues() {
+        notifPerTopic = Integer.parseInt(configurations.getProperty(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC));
+        noTopicsPublished = Integer.parseInt(configurations.getProperty(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED));
+        protocol = configurations.getProperty(ConfigKeys.PROTOCOL);
+        payLoadMultiplier = Integer.parseInt(configurations.getProperty(ConfigKeys.PAYLOAD_MULTIPLYER));
+        consumerPort = Integer.parseInt(configurations.getProperty(ConfigKeys.CONSUMER_PORT));
+        testExpirationTime = Math.max(20000,
+                Long.parseLong(configurations.getProperty(ConfigKeys.PERFORMANCE_TEST_TIMEOUT, "20000")));
+        numberOfSubscriber = Integer.parseInt(configurations.getProperty(ConfigKeys.NUMBER_OF_SUBSCRIBERS));
+        numMultiThreadsSupportPerSub = Integer.parseInt(configurations.getProperty(ConfigKeys.MULTI_THREAD_PER_SUB));
+        topicPrefix = "topic" + configurations.getProperty(ConfigKeys.TOPIC_SIMPLE);
+        NOTIFICATIONS_PUBLISHED_PER_TOPIC = notifPerTopic;
+    }
+
+    private static void setStatList(int notifPerTopic, int noTopicsPublished, long publishersRunningTime,
+            long executionTime, double throughtput, List<Stat> statistics) {
+
+        statistics.add(new Stat("# topics published", noTopicsPublished));
+        statistics.add(new Stat("Total RTT (millis)", totalRoundTripTime));
+        statistics.add(new Stat("Average RTT (millis)", avgRountTripTime));
+        statistics.add(new Stat("Total published to receive time (millis)", executionTime));
+        statistics.add(new Stat("Throughput (messages per second)", throughtput));
+        statistics.add(new Stat("Total publish RTT (millis)", totalPublishRTT));
+        statistics.add(new Stat("Average publish RTT (millis)", avgPublishRTTime));
+        statistics.add(new Stat("publisher duration (millis)", publishersRunningTime));
+        statistics.add(new Stat("Publisher throughput (messages per second)", noTopicsPublished * notifPerTopic * 1000
+                / publishersRunningTime));
+    }
+
+    private static void setPayload(int payLoadMultiplier) {
+        String tempPayload = "";
+        try {
+            tempPayload = LoadMsgPayload.getInstance().getMessage("payload.txt");
+        } catch (FileNotFoundException e2) {
+            e2.printStackTrace();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+
+        for (int i = 1; i <= payLoadMultiplier; i++) {
+            payload += tempPayload;
+        }
+    }
+
+    private static void createPublishers(int noTopicsPublished, String protocol, CountDownLatch publiserhStartSignal,
+            CountDownLatch publisherDoneSignal, PublisherThread[] publisher) {
+        int threadId = 0;
+        for (int j = 0; j < noTopicsPublished; j++) {
+            threadId++;
+            publisher[j] = new PublisherThread(protocol, configurations.getProperty(ConfigKeys.BROKER_URL), topicPrefix
+                    + j, payload, publiserhStartSignal, publisherDoneSignal, threadId);
+            publisher[j].start();
+        }
+    }
+
+    private static void createSubscriberArray(int noTopicsPublished, int numberOfSubscriber,
+            NotificationManager[] notifManagerArray, int arrayIndex) throws Exception, IOException {
+        if ("false".equalsIgnoreCase(configurations.getProperty(ConfigKeys.IS_XPATH_ENABLED))) {
+            if (numberOfSubscriber <= noTopicsPublished) {
+                for (int i = 0; i < noTopicsPublished; ++i) {
+                    notifManagerArray[arrayIndex].createTopicSubscription(topicPrefix + i);
+                    notifManagerArray[arrayIndex++].incNoTopicsSubscribed();
+                    if (arrayIndex >= numberOfSubscriber) {
+                        arrayIndex = 0;
+                    }
+                }
+            } else {
+                int topicIndex = 0;
+                for (int i = 0; i < numberOfSubscriber; ++i) {
+                    notifManagerArray[i].createTopicSubscription(topicPrefix + topicIndex++);
+                    notifManagerArray[i].incNoTopicsSubscribed();
+                    if (topicIndex >= noTopicsPublished) {
+                        topicIndex = 0;
+                    }
+                }
+            }
+        } else {
+            xpathList = LoadXpath.getInstace().getXpathList("xpath.list");
+            if (numberOfSubscriber <= noTopicsPublished) {
+                Iterator<String> ite = xpathList.iterator();
+                for (int i = 0; i < noTopicsPublished; ++i) {
+                    if (!ite.hasNext())
+                        ite = xpathList.iterator();
+
+                    notifManagerArray[arrayIndex].createXpathSubscription(topicPrefix + i, ite.next());
+                    notifManagerArray[arrayIndex++].incNoTopicsSubscribed();
+                    if (arrayIndex >= numberOfSubscriber) {
+                        arrayIndex = 0;
+                    }
+                }
+            } else {
+                int topicIndex = 0;
+                for (int i = 0; i < numberOfSubscriber; ++i) {
+                    notifManagerArray[i].incNoTopicsSubscribed();
+                    if (topicIndex >= noTopicsPublished) {
+                        topicIndex = 0;
+                    }
+                }
+            }
+        }
+    }
+
+    private static Properties getDefaults() {
+        Properties defaults = new Properties();
+        defaults.setProperty(ConfigKeys.BROKER_URL, "http://localhost:8080/axis2/services/EventingService");
+        defaults.setProperty(ConfigKeys.TOPIC_SIMPLE, "simpleSampleTopic");
+        defaults.setProperty(ConfigKeys.CONSUMER_PORT, "6666");
+        defaults.setProperty(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC, "5");
+        defaults.setProperty(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED, "5");
+        defaults.setProperty(ConfigKeys.IS_XPATH_ENABLED, "false");
+        defaults.setProperty(ConfigKeys.XPATH, "/c/b/a");
+        defaults.setProperty(ConfigKeys.PAYLOAD_MULTIPLYER, "1");
+        defaults.setProperty(ConfigKeys.PROTOCOL, "wse");
+        defaults.setProperty(ConfigKeys.PUBLISH_TIME_INTERVAL, "10000");
+        defaults.setProperty(ConfigKeys.PERFORMANCE_TEST_TIMEOUT, "5000000");
+        defaults.setProperty(ConfigKeys.NUMBER_OF_SUBSCRIBERS, "1");
+        defaults.setProperty(ConfigKeys.MULTI_THREAD_PER_SUB, "50");
+        return defaults;
+    }
+
+    private static void printStatistics(List<Stat> stats, File aFile) throws IOException {
+        int maxLen = 0;
+        Writer output = new BufferedWriter(new FileWriter(aFile, true));
+
+        for (Stat stat : stats) {
+            maxLen = Math.max(maxLen, stat.name.length());
+        }
+
+        char[] fillchars = null;
+
+        for (Stat stat : stats) {
+            fillchars = new char[maxLen - stat.name.length() + 1];
+            Arrays.fill(fillchars, ' ');
+            String formattedStr = String.format("%s%s : %s", stat.name, new String(fillchars), stat.value.toString());
+            output.write(formattedStr + "\n");
+            System.out.println(formattedStr);
+        }
+
+        fillchars = new char[maxLen];
+        Arrays.fill(fillchars, '-');
+        String fillingString = new String(fillchars);
+        output.write(fillingString + "\n");
+        System.out.println(fillingString);
+        output.close();
+    }
+
+    public static void loadConfigurationsFromFile() {
+        configurations = new Properties(getDefaults());
+
+        try {
+            URL url = ClassLoader.getSystemResource(ConfigKeys.CONFIG_FILE_NAME);
+            if (url == null) {
+                throw new IOException("configuration file not found");
+            }
+            configurations.load(url.openStream());
+        } catch (IOException ioe) {
+            System.out.println("unable to load configuration file, default settings will be used");
+        }
+    }
+
+    // Not used, If required to run as a test case call it from main
+    public static void loadConfigurationsFromSystemEnv() {
+
+        configurations = new Properties(getDefaults());
+
+        Properties envConfigs = System.getProperties();
+        String brokerUrl = envConfigs.getProperty(ConfigKeys.BROKER_URL, null);
+        String consumerUrl = envConfigs.getProperty(ConfigKeys.CONSUMER_EPR, null);
+        String consumerPort = envConfigs.getProperty(ConfigKeys.CONSUMER_PORT, null);
+        String isXpathEnabled = envConfigs.getProperty(ConfigKeys.IS_XPATH_ENABLED, null);
+        String notifPerTopic = envConfigs.getProperty(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC, null);
+        String subsPerTopic = envConfigs.getProperty(ConfigKeys.NUMBER_OF_SUBS_PERTOPIC, null);
+        String noTopicsPublished = envConfigs.getProperty(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED, null);
+        String payLoadMultiplier = envConfigs.getProperty(ConfigKeys.PAYLOAD_MULTIPLYER, null);
+        String protocol = envConfigs.getProperty(ConfigKeys.PROTOCOL, null);
+        String topicSimple = envConfigs.getProperty(ConfigKeys.TOPIC_SIMPLE, null);
+        String topicXpath = envConfigs.getProperty(ConfigKeys.XPATH, null);
+
+        if (brokerUrl == null) {
+            System.err.println(ConfigKeys.BROKER_URL + " not given");
+            System.exit(1);
+        }
+        if (consumerUrl == null) {
+            System.err.println(ConfigKeys.CONSUMER_EPR + " not given");
+            System.exit(1);
+        }
+        if (consumerPort == null) {
+            System.err.println(ConfigKeys.CONSUMER_PORT + " not given");
+            System.exit(1);
+        }
+        if (isXpathEnabled == null) {
+            System.err.println(ConfigKeys.IS_XPATH_ENABLED + " not given");
+            System.exit(1);
+        }
+        if (notifPerTopic == null) {
+            System.err.println(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC + " not given");
+            System.exit(1);
+        }
+        if (subsPerTopic == null) {
+            System.err.println(ConfigKeys.NUMBER_OF_SUBS_PERTOPIC + " not given");
+            System.exit(1);
+        }
+        if (noTopicsPublished == null) {
+            System.err.println(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED + " not given");
+            System.exit(1);
+        }
+        if (payLoadMultiplier == null) {
+            System.err.println(ConfigKeys.PAYLOAD_MULTIPLYER + " not given");
+            System.exit(1);
+        }
+        if (protocol == null) {
+            System.err.println(ConfigKeys.PROTOCOL + " not given");
+            System.exit(1);
+        }
+        if (topicSimple == null) {
+            System.err.println(ConfigKeys.TOPIC_SIMPLE + " not given");
+            System.exit(1);
+        }
+        if (topicXpath == null) {
+            System.err.println(ConfigKeys.XPATH + " not given");
+            System.exit(1);
+        }
+
+        configurations.put(ConfigKeys.BROKER_URL, brokerUrl);
+        configurations.put(ConfigKeys.CONSUMER_EPR, consumerUrl);
+        configurations.put(ConfigKeys.CONSUMER_PORT, consumerPort);
+        configurations.put(ConfigKeys.IS_XPATH_ENABLED, isXpathEnabled);
+        configurations.put(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC, notifPerTopic);
+        configurations.put(ConfigKeys.NUMBER_OF_SUBS_PERTOPIC, subsPerTopic);
+        configurations.put(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED, noTopicsPublished);
+        configurations.put(ConfigKeys.PAYLOAD_MULTIPLYER, payLoadMultiplier);
+        configurations.put(ConfigKeys.PROTOCOL, protocol);
+        configurations.put(ConfigKeys.TOPIC_SIMPLE, topicSimple);
+        configurations.put(ConfigKeys.XPATH, topicXpath);
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PublisherThread.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PublisherThread.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PublisherThread.java
new file mode 100644
index 0000000..4f1215b
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PublisherThread.java
@@ -0,0 +1,99 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.performance_evaluator.rtt;
+
+import java.util.concurrent.CountDownLatch;
+
+import org.apache.airavata.wsmg.client.*;
+
+public class PublisherThread extends Thread {
+    private String brokerURL;
+    private String topic;
+    private final CountDownLatch startSignal;
+    private final CountDownLatch doneSignal;
+    private long totPublishTime = 0l;
+    long avgPublishTime = 0l;
+
+    private String payload = "";
+    String msg = "";
+    private MessageBrokerClient client = null;
+    int trackId = 0;
+    int threadId = 0;
+
+    public PublisherThread(String protocolIn, String brokerURLIn, String topicIn, String payloadIn,
+            CountDownLatch startSignalIn, CountDownLatch doneSignalIn, int threadIdIn) {
+        this.payload = payloadIn;
+        this.brokerURL = brokerURLIn;
+        this.topic = topicIn;
+        this.startSignal = startSignalIn;
+        this.doneSignal = doneSignalIn;
+        this.threadId = threadIdIn;
+        if ("wse".equalsIgnoreCase(protocolIn)) {
+
+            WseMsgBrokerClient wseMsgBrokerClient = new WseMsgBrokerClient();
+            wseMsgBrokerClient.setTimeoutInMilliSeconds(0);
+            wseMsgBrokerClient.init(brokerURL);
+            client = wseMsgBrokerClient;
+
+        } else {
+
+            WsntMsgBrokerClient wsntMsgBrokerClient = new WsntMsgBrokerClient();
+            wsntMsgBrokerClient.setTimeoutInMilliSeconds(0);
+            wsntMsgBrokerClient.init(brokerURL);
+            client = wsntMsgBrokerClient;
+        }
+
+    }
+
+    public void run() {
+
+        try {
+            trackId = 1;
+            startSignal.await();
+            System.out.println("Publishing started for topic :" + this.topic);
+            for (int i = 0; i < PerformanceTest.NOTIFICATIONS_PUBLISHED_PER_TOPIC; i++) {
+                msg = "<perf:performancetest xmlns:perf=\"http://lead.extreme.indiana.edu/namespaces/performance\"><perf:time>"
+                        + System.currentTimeMillis()
+                        + "</perf:time><perf:trackInfo><perf:threadId>"
+                        + threadId
+                        + "</perf:threadId><perf:trackId>"
+                        + trackId
+                        + "</perf:trackId></perf:trackInfo>"
+                        + "<perf:payload>" + payload + "</perf:payload></perf:performancetest>";
+                long publishStartTime = System.currentTimeMillis();
+                client.publish(topic, msg);
+                totPublishTime += System.currentTimeMillis() - publishStartTime;
+                trackId++;
+            }
+
+            avgPublishTime = totPublishTime / PerformanceTest.NOTIFICATIONS_PUBLISHED_PER_TOPIC;
+            System.out.println("Publishing ended for topic :" + this.topic);
+            doneSignal.countDown();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    synchronized long getAvgPubTime() {
+        return this.avgPublishTime;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatCalculatorThread.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatCalculatorThread.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatCalculatorThread.java
new file mode 100644
index 0000000..541d80b
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatCalculatorThread.java
@@ -0,0 +1,103 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.performance_evaluator.rtt;
+
+import java.util.concurrent.TimeUnit;
+
+public class StatCalculatorThread extends Thread {
+
+    private NotificationManager notifManager = null;
+    private long lastMsgReceivedTime = 0l;
+    private long timeTot = 0;
+    private long avgTime = 0;
+    private int numberOfMssgsReceived = 0; // to avoid concurrency
+    private long timeOutMillis;
+    private int expectedNoMessages = 0;
+
+    public StatCalculatorThread(NotificationManager notificationManager, long timeOutInMillis) throws Exception {
+        this.timeOutMillis = timeOutInMillis;
+        this.notifManager = notificationManager;
+        expectedNoMessages = PerformanceTest.NOTIFICATIONS_PUBLISHED_PER_TOPIC
+                * notificationManager.getNoTopicsSubscribed();
+    }
+
+    @Override
+    public void run() {
+        do {
+
+            StatContainer container = null;
+            try {
+                container = notifManager.getQueue().poll(timeOutMillis, TimeUnit.MILLISECONDS);
+
+                if (container != null) {
+                    timeTot += container.getRondTripTime();
+                    lastMsgReceivedTime = container.getMessageReceivedTime();
+                    numberOfMssgsReceived++;
+                    // ******un-comment in order to log trakId and message
+                    // related other information*****
+                    // if (logger.isInfoEnabled()) {
+                    // trackInfo = env
+                    // .getBody()
+                    // .getFirstElement()
+                    // .getFirstChildWithName(
+                    // new QName(
+                    // "http://lead.extreme.indiana.edu/namespaces/performance",
+                    // "trackInfo")).toStringWithConsume();
+                    // logger.info(trackInfo + "   Send time :" + time
+                    // + "  Received time :" + System.currentTimeMillis());
+                    // }
+                } else {
+                    System.out.println("stat calculator thread was interrupted");
+                    break;
+                }
+            } catch (InterruptedException e1) {
+                e1.printStackTrace();
+                break;
+            }
+
+        } while (expectedNoMessages > numberOfMssgsReceived);
+
+        if (numberOfMssgsReceived > 0) {
+            avgTime = timeTot / numberOfMssgsReceived;
+        } else {
+            System.out.println("no messages received");
+        }
+
+        System.out.println("end of stat calculator");
+    }
+
+    synchronized long getTotalTime() {
+        return timeTot;
+    }
+
+    synchronized long getAverageTime() {
+        return avgTime;
+    }
+
+    synchronized long getNumberOfMsgReceived() {
+        return numberOfMssgsReceived;
+    }
+
+    synchronized public long getLastMsgReceivedTime() {
+        return lastMsgReceivedTime;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatContainer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatContainer.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatContainer.java
new file mode 100644
index 0000000..31b9c85
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatContainer.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.performance_evaluator.rtt;
+
+import org.apache.axiom.soap.SOAPEnvelope;
+
+public class StatContainer {
+    private SOAPEnvelope msgEnvelope = null;
+    private long rtt = 0l;
+    private long receivedTime = 0l;
+
+    public StatContainer(SOAPEnvelope msgEnvelope) {
+        this.msgEnvelope = msgEnvelope;
+        this.receivedTime = System.currentTimeMillis();
+        this.rtt = this.receivedTime
+                - Long.parseLong(msgEnvelope.getBody().getFirstElement().getFirstElement().getText());
+    }
+
+    public long getRondTripTime() {
+        return this.rtt;
+    }
+
+    public SOAPEnvelope getMsgEnvelope() {
+        return msgEnvelope;
+    }
+
+    public long getMessageReceivedTime() {
+        return this.receivedTime;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/Subscription.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/Subscription.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/Subscription.java
new file mode 100644
index 0000000..d8df04f
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/Subscription.java
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.performance_evaluator.rtt;
+
+import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
+import org.apache.airavata.wsmg.client.MessageBrokerClient;
+import org.apache.axis2.addressing.EndpointReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Subscription {
+
+    private String subscriptionID;
+
+    private String topic;
+    private final static Logger logger = LoggerFactory.getLogger(Subscription.class);
+    private ConsumerNotificationHandler handler;
+    private MessageBrokerClient client;
+    private EndpointReference messageBoxEPR;
+    private String xpath;
+    private String brokerURL;
+
+    private String protocol;
+
+    public Subscription(MessageBrokerClient clientIn, String subscriptionID, String topic,
+            ConsumerNotificationHandler callback, String brokerURL, String protocolIn) {
+        super();
+        this.subscriptionID = subscriptionID;
+        this.topic = topic;
+        this.handler = callback;
+        this.brokerURL = brokerURL;
+        this.client = clientIn;
+        this.protocol = protocolIn;
+    }
+
+    public Subscription(MessageBrokerClient clientIn, String subscriptionID, String topic, String xpath,
+            ConsumerNotificationHandler callback, String brokerURL, String protocolIn) {
+        super();
+        this.client = clientIn;
+        this.subscriptionID = subscriptionID;
+        this.topic = topic;
+        this.handler = callback;
+        this.brokerURL = brokerURL;
+        this.xpath = xpath;
+        this.protocol = protocolIn;
+    }
+
+    public ConsumerNotificationHandler getCallback() {
+        return handler;
+    }
+
+    public String getTopic() {
+        return topic;
+    }
+
+    // public void destroy() throws RemoteException {
+    // client.shutdownConsumerService();
+    // }
+
+    public EndpointReference getMessageBoxEPR() {
+        return messageBoxEPR;
+    }
+
+    public void setMessageBoxEpr(EndpointReference messageBoxEPR) {
+        this.messageBoxEPR = messageBoxEPR;
+    }
+
+    public String getSubscriptionID() {
+        return subscriptionID;
+    }
+
+    public void setSubscriptionID(String subscriptionID) {
+        this.subscriptionID = subscriptionID;
+    }
+
+    public String getBrokerURL() {
+        return brokerURL;
+    }
+
+    public void setBrokerURL(String brokerURL) {
+        this.brokerURL = brokerURL;
+    }
+
+    // public String getConsumerEPR() throws UnknownHostException {
+    // cli
+    // }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/ConfigKeys.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/ConfigKeys.java
new file mode 100644
index 0000000..6463f31
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/ConfigKeys.java
@@ -0,0 +1,43 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.performance_evaluator.rtt.util;
+
+public interface ConfigKeys {
+    String CONFIG_FILE_NAME = "configurations.properties";
+    String BROKER_URL = "broker.eventing.service.epr";
+    String CONSUMER_EPR = "consumer.location";
+    String CONSUMER_PORT = "consumer.port";
+    String TOPIC_SIMPLE = "topic.simple";
+    String TOPIC_XPATH = "topic.xpath";
+    String PUBLISH_TIME_INTERVAL = "publish.time.interval";
+    String IS_XPATH_ENABLED = "is.xpath.enabled";
+    String XPATH = "topic.xpath";
+    String PAYLOAD_MULTIPLYER = "payload.multiplyer";
+    String PROTOCOL = "protocol.used";
+    String NUMBER_OF_SUBS_PERTOPIC = "num.subscribers.per.topic";
+    String NOTIFICATIONS_PUBLISHED_PER_TOPIC = "notifications.per.topic";
+    String NUMBER_OF_TOPICS_PUBLISHED = "number.of.topics";
+    String SCHEDULER_REPEAT_PERIOD = "stat.timeout.monitor.scheduler.period";
+    String PERFORMANCE_TEST_TIMEOUT = "performance.test.timeout.period.millis";
+    String NUMBER_OF_SUBSCRIBERS = "number.of.subscriber.servers";
+    String MULTI_THREAD_PER_SUB = "num.muti.thread.per.sub";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadMsgPayload.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadMsgPayload.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadMsgPayload.java
new file mode 100644
index 0000000..8ed4cb6
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadMsgPayload.java
@@ -0,0 +1,66 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.performance_evaluator.rtt.util;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+
+public class LoadMsgPayload {
+
+    private static LoadMsgPayload msg = null;
+
+    public static LoadMsgPayload getInstance() {
+        if (msg == null)
+            msg = new LoadMsgPayload();
+        return msg;
+    }
+
+    public String getMessage(String fileName) throws IOException {
+        URL url = ClassLoader.getSystemResource(fileName);
+        if (url != null)
+            return convertStreamToString(url.openStream());
+        else
+            return "";
+    }
+
+    private String convertStreamToString(InputStream is) throws IOException {
+        if (is != null) {
+            StringBuilder sb = new StringBuilder();
+            String line;
+
+            try {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+                while ((line = reader.readLine()) != null) {
+                    sb.append(line).append("\n");
+                }
+            } finally {
+                is.close();
+            }
+            return sb.toString();
+        } else {
+            return "";
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadXpath.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadXpath.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadXpath.java
new file mode 100644
index 0000000..1a1a5fa
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadXpath.java
@@ -0,0 +1,66 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.performance_evaluator.rtt.util;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.LinkedList;
+
+public class LoadXpath {
+    private static LoadXpath xpath = null;
+    LinkedList<String> xpathList = null;
+
+    public static LoadXpath getInstace() {
+        if (xpath == null)
+            xpath = new LoadXpath();
+        return xpath;
+    }
+
+    public LinkedList<String> getXpathList(String fileName) throws IOException {
+        URL url = ClassLoader.getSystemResource(fileName);
+        if (url != null && xpathList == null)
+            return convertStreamToString(url.openStream());
+        return xpathList;
+    }
+
+    private LinkedList<String> convertStreamToString(InputStream is) throws IOException {
+        if (is != null) {
+            xpathList = new LinkedList<String>();
+            String line;
+
+            try {
+                BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+                while ((line = reader.readLine()) != null) {
+                    xpathList.add(line);
+                }
+            } finally {
+                is.close();
+            }
+            return xpathList;
+        } else {
+            return null;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java
new file mode 100644
index 0000000..e0162e7
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java
@@ -0,0 +1,167 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.util;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axis2.AxisFault;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+public class BrokerUtilTest extends TestCase {
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @Before
+    public void setUp() throws Exception {
+    }
+
+    /**
+     * @throws java.lang.Exception
+     */
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    /**
+     * Test method for
+     * {@link org.apache.airavata.wsmg.util.BrokerUtil#sameStringValue(java.lang.String, java.lang.String)} .
+     */
+    @Test
+    public void testSameStringValue() {
+
+        assertTrue(BrokerUtil.sameStringValue(null, null));
+        assertTrue(BrokerUtil.sameStringValue("test", "test"));
+
+        assertFalse(BrokerUtil.sameStringValue("one", "two"));
+        assertFalse(BrokerUtil.sameStringValue(null, "test"));
+        assertFalse(BrokerUtil.sameStringValue("test", null));
+
+    }
+
+    /**
+     * Test method for {@link org.apache.airavata.wsmg.util.BrokerUtil#getTopicLocalString(java.lang.String)}.
+     */
+    @Test
+    public void testGetTopicLocalString() {
+
+        assertEquals("localstring", (BrokerUtil.getTopicLocalString("prefix:localstring")));
+
+        assertEquals("localstring", BrokerUtil.getTopicLocalString("localstring"));
+
+    }
+
+    /**
+     * Test method for {@link org.apache.airavata.wsmg.util.BrokerUtil#getXPathString(org.apache.axiom.om.OMElement)}.
+     */
+    @Test
+    public void testGetXPathString() {
+
+        OMFactory factory = OMAbstractFactory.getOMFactory();
+
+        try {
+
+            BrokerUtil.getXPathString(null);
+            fail("method should validate invalid arguments");
+        } catch (IllegalArgumentException e) {
+
+        } catch (AxisFault e) {
+            fail("invalid exception thrown");
+        }
+
+        try {
+
+            QName invalidQName = new QName("invalidURI", "invalidLocalName");
+
+            OMElement xpathEl = factory.createOMElement(invalidQName);
+
+            BrokerUtil.getXPathString(xpathEl);
+
+            fail("method should validate arguments");
+
+        } catch (AxisFault fault) {
+
+        }
+
+        try {
+
+            String xpathExpression = "testXpathExpression";
+            String dialect = "unknownXpathDialect";
+
+            OMNamespace ns = factory.createOMNamespace("unit_test", "jnt");
+
+            OMElement xpathEl = factory.createOMElement("TestXpath", ns);
+            xpathEl.addAttribute("Dialect", dialect, null);
+
+            xpathEl.setText(xpathExpression);
+
+            BrokerUtil.getXPathString(xpathEl);
+
+            fail("method should reject unknown dialect");
+        } catch (AxisFault e) {
+
+        }
+
+        try {
+
+            String xpathExpression = "textXpathExpression";
+            String dialect = WsmgCommonConstants.XPATH_DIALECT;
+
+            OMNamespace ns = factory.createOMNamespace("unit_test", "jnt");
+
+            OMElement xpathEl = factory.createOMElement("TestXpath", ns);
+            xpathEl.addAttribute("Dialect", dialect, null);
+
+            xpathEl.setText(xpathExpression);
+            assertEquals(xpathExpression, BrokerUtil.getXPathString(xpathEl));
+
+        } catch (AxisFault e) {
+            fail("unable to extract xpath query: " + e.toString());
+        }
+
+    }
+
+    /**
+     * Test method for {@link org.apache.airavata.wsmg.util.BrokerUtil#getTopicFromRequestPath(java.lang.String)}.
+     */
+    @Test
+    public void testGetTopicFromRequestPath() {
+
+        assertNull(BrokerUtil.getTopicFromRequestPath(null));
+        assertNull(BrokerUtil.getTopicFromRequestPath(""));
+        assertNull(BrokerUtil.getTopicFromRequestPath("/"));
+        assertNull(BrokerUtil.getTopicFromRequestPath("/subscribe/url/"));
+        assertNull(BrokerUtil.getTopicFromRequestPath("/subscribe/url/topic/"));
+
+        assertEquals(BrokerUtil.getTopicFromRequestPath("/requestpath/topic/xyz"), "xyz");
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/ConfigKeys.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/ConfigKeys.java
new file mode 100644
index 0000000..0624442
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/ConfigKeys.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.util;
+
+public interface ConfigKeys {
+
+    String CONFIG_FILE_NAME = "unit_tests.properties";
+
+    String CONSUMER_EPR = "consumer.location";
+    String CONSUMER_PORT = "consumer.port";
+    String TOPIC_SIMPLE = "topic.simple";
+    String TOPIC_XPATH = "topic.xpath";
+    String AXIS2_REPO = "axis2.repo";
+
+}


[27/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceSkeleton.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceSkeleton.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceSkeleton.java
deleted file mode 100644
index a2eb271..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceSkeleton.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox;
-
-import java.io.StringReader;
-import java.sql.SQLException;
-import java.util.List;
-
-import org.apache.airavata.wsmg.commons.MsgBoxQNameConstants;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.msgbox.Storage.MsgBoxStorage;
-import org.apache.airavata.wsmg.msgbox.util.ConfigKeys;
-import org.apache.airavata.wsmg.msgbox.util.MsgBoxCommonConstants;
-import org.apache.airavata.wsmg.msgbox.util.MsgBoxUtils;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.service.Lifecycle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import sun.beans.editors.LongEditor;
-
-/**
- * Service class for MsgBoxService this get called by MsgBoxServiceMessageReceiverInOut with ProcessingContext
- */
-public class MsgBoxServiceSkeleton implements Lifecycle {
-
-    private static final Logger logger = LoggerFactory.getLogger(MsgBoxServiceSkeleton.class);
-    private static final String TRUE = Boolean.toString(true);
-    private static final String FALSE = Boolean.toString(false);
-    private static OMFactory factory = OMAbstractFactory.getOMFactory();
-    private MsgBoxStorage storage;
-    private Thread deletingThread;
-    private boolean stop;
-
-    public void init(ServiceContext context) throws AxisFault {
-        this.storage = (MsgBoxStorage) context.getConfigurationContext().getProperty(
-                MsgBoxCommonConstants.MSGBOX_STORAGE);
-        logger.debug("Starting cleanup thread for Message Box...");
-        deletingThread = new Thread(new DeleteOldMessageRunnable(context.getConfigurationContext().getProperty(ConfigKeys.MSG_PRESV_INTERVAL)));
-        deletingThread.start();
-    }
-
-    public void destroy(ServiceContext context) {
-        this.storage = null;
-
-        // stop Deleting thread
-        this.stop = true;
-        this.deletingThread.interrupt();
-
-        try {
-            deletingThread.join();
-        } catch (Exception e) {
-            logger.error("Cannot shutdown cleanup thread", e);
-        }
-    }
-
-    public OMElement createMsgBox() throws Exception {
-        try {
-            String createdMsgBoxId = storage.createMsgBox();
-
-            logger.debug("MsgBox created:" + createdMsgBoxId);
-
-            /*
-             * Output response
-             */
-            OMElement dd = factory.createOMElement(MsgBoxQNameConstants.CREATE_MSGBOX_RESP_QNAME);
-            OMElement url = factory.createOMElement(MsgBoxQNameConstants.MSG_BOXID_QNAME);
-            url.setText(createdMsgBoxId);
-            dd.addChild(url);
-            return dd;
-        } catch (Exception e) {
-            logger.error("Error creating the message box", e);
-            AxisFault f = new AxisFault("Error creating the message box", "6000", e);
-            throw f;
-        }
-
-    }
-
-    public OMElement storeMessages(String msgBoxAddr, String messageID, String soapAction, OMElement message)
-            throws Exception {
-        OMElement resp = factory.createOMElement(MsgBoxQNameConstants.STOREMSG_RESP_QNAME);
-        OMElement status = factory.createOMElement(MsgBoxQNameConstants.MSGBOX_STATUS_QNAME);
-        try {
-            storage.putMessageIntoMsgBox(msgBoxAddr, messageID, soapAction, message);
-
-            logger.debug("Put Message to MsgBox:" + msgBoxAddr + " with messageID:" + messageID);
-
-            status.setText(TRUE);
-        } catch (SQLException e) {
-            logger.error("Error while storing message: " + message + " in msgbx: " + msgBoxAddr, e);
-            status.setText(FALSE);
-
-            // FIXME: Should we throw exception?? or client will read false
-            // status
-        }
-        resp.addChild(status);
-        resp.declareNamespace(NameSpaceConstants.MSG_BOX);
-        return resp;
-    }
-
-    public OMElement takeMessages(String msgBoxAddr) throws Exception {
-        try {
-            OMElement respEl = factory.createOMElement(MsgBoxQNameConstants.TAKE_MSGBOX_RESP_QNAME);
-            OMElement messageSet = factory.createOMElement(MsgBoxQNameConstants.MSGBOX_MESSAGE_QNAME);
-
-            List<String> list = storage.takeMessagesFromMsgBox(msgBoxAddr);
-            if (list != null && list.size() != 0) {
-                for (String string : list) {
-                    messageSet.addChild(MsgBoxUtils.reader2OMElement(new StringReader(string)));
-                }
-                logger.debug("Take all messages from MsgBox:" + msgBoxAddr);
-            } else {
-                logger.debug("  no messages..  ");
-            }
-            respEl.addChild(messageSet);
-            respEl.declareNamespace(NameSpaceConstants.MSG_BOX);
-            return respEl;
-        } catch (Exception e) {
-            logger.error("Error taking mesages of message box: " + msgBoxAddr, e);
-            throw e;
-        }
-    }
-
-    public OMElement destroyMsgBox(String msgBoxAddr) throws Exception {
-        OMElement respEl = factory.createOMElement(MsgBoxQNameConstants.DESTROY_MSGBOX_RESP_QNAME);
-        OMElement statusEl = factory.createOMElement(MsgBoxQNameConstants.MSGBOX_STATUS_QNAME);
-        String addr = msgBoxAddr;
-        try {
-            storage.destroyMsgBox(addr);
-            logger.debug("Destry MsgBox:" + msgBoxAddr);
-            statusEl.setText(TRUE);
-        } catch (Exception e) {
-            logger.warn("Error while delete msgbx: " + msgBoxAddr, e);
-            statusEl.setText(FALSE);
-
-            // FIXME: Should we throw exception?? or client will read false
-            // status
-        }
-        respEl.addChild(statusEl);
-        return respEl;
-    }
-
-    class DeleteOldMessageRunnable implements Runnable {
-        long longInterval = 60 * 60 * 1000;
-        DeleteOldMessageRunnable(Object inveral){
-          longInterval = (Long)inveral;
-        }
-        public void run() {
-            while (!stop) {
-                try {
-                        // try to remove old message
-                    if (storage != null) {
-                        storage.removeAncientMessages();
-                    }
-                    Thread.sleep(longInterval);
-                } catch (Exception e) {
-                    logger.warn("Msgbox cleanup thread is interrupted to close");
-                }
-            }
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/MsgBoxStorage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/MsgBoxStorage.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/MsgBoxStorage.java
deleted file mode 100644
index e095e3c..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/MsgBoxStorage.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox.Storage;
-
-import java.util.List;
-
-import org.apache.axiom.om.OMElement;
-
-/**
- * Message Box storage backend. This has implemented in two ways in-memory and database.
- */
-public interface MsgBoxStorage {
-    public String createMsgBox() throws Exception;
-
-    public void destroyMsgBox(String key) throws Exception;
-
-    /**
-     * IMPORTANT::: List retrieved from this method is sorted by time in ascending order i.e the newest message will
-     * appear as the last item in the list.
-     * 
-     * @param key
-     * @return
-     * @throws Exception
-     */
-    public List<String> takeMessagesFromMsgBox(String key) throws Exception;
-
-    public void putMessageIntoMsgBox(String msgBoxID, String messageID, String soapAction, OMElement message)
-            throws Exception;
-
-    /**
-     * The ancientness is defined in the db.config file.
-     */
-    public void removeAncientMessages() throws Exception;
-
-    /**
-     * Clean up method
-     */
-    public void dispose();
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/DatabaseStorageImpl.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/DatabaseStorageImpl.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/DatabaseStorageImpl.java
deleted file mode 100644
index 2cec984..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/DatabaseStorageImpl.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox.Storage.dbpool;
-
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.sql.SQLNonTransientConnectionException;
-import java.util.List;
-import java.util.UUID;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.airavata.wsmg.commons.storage.DatabaseCreator;
-import org.apache.airavata.wsmg.commons.storage.JdbcStorage;
-import org.apache.airavata.wsmg.msgbox.Storage.MsgBoxStorage;
-import org.apache.axiom.om.OMElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Database message Storage Implementation, if airavata-server.properties configured to use database this will set as the storage
- * for MsgBoxSerivceSkeleton
- */
-public class DatabaseStorageImpl implements MsgBoxStorage {
-
-    private static final Logger logger = LoggerFactory.getLogger(DatabaseStorageImpl.class);
-
-    private static final String TABLE_NAME_TO_CHECK = "msgbox";
-
-    private JdbcStorage db;
-
-    public DatabaseStorageImpl(String jdbcUrl, String jdbcDriver, long timeOfOldMessage) {
-        db = new JdbcStorage(10, 50, jdbcUrl, jdbcDriver, true);
-
-        Connection conn = null;
-        try {
-
-            /*
-             * Check database
-             */
-            conn = db.connect();
-            if (!DatabaseCreator.isDatabaseStructureCreated(TABLE_NAME_TO_CHECK, conn)) {
-                DatabaseCreator.createMsgBoxDatabase(conn);
-                logger.info("New Database created for Message Box");
-            } else {
-                logger.debug("Database already created for Message Box!");
-            }
-
-            MessageBoxDB.initialize(db, timeOfOldMessage);
-
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RuntimeException("Database failure");
-        } finally {
-            db.closeConnection(conn);
-        }
-    }
-
-    public String createMsgBox() throws SQLException, IOException {
-        String uuid = UUID.randomUUID().toString();
-        MessageBoxDB.getInstance().createMsgBx(uuid);
-        return uuid;
-    }
-
-    public void destroyMsgBox(String key) throws Exception {
-        try {
-            MessageBoxDB.getInstance().deleteMessageBox(key);
-        } catch (SQLException e) {
-            throw new Exception("Could not destroy the message box with key " + key, e);
-        }
-    }
-
-    public List<String> takeMessagesFromMsgBox(String key) throws Exception {
-        List<String> list = null;
-
-        try {
-            list = MessageBoxDB.getInstance().removeAllMessagesforClient(key);
-
-        }catch(SQLNonTransientConnectionException e){
-            logger.warn("Database connection is interrupted");
-        } catch (SQLException e) {
-            throw new Exception("Error reading the message with the key " + key, e);
-        } catch (IOException e) {
-            throw new Exception("Error reading the message with the key " + key, e);
-        }
-
-        return list;
-    }
-
-    public void putMessageIntoMsgBox(String msgBoxID, String messageID, String soapAction, OMElement message)
-            throws SQLException, IOException, XMLStreamException {
-        MessageBoxDB.getInstance().addMessage(msgBoxID, messageID, soapAction, message);
-    }
-
-    public void removeAncientMessages() throws Exception {
-        MessageBoxDB.getInstance().removeAncientMessages();
-    }
-
-    public void dispose() {
-        if (db != null) {
-            db.closeAllConnections();
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/MessageBoxDB.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/MessageBoxDB.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/MessageBoxDB.java
deleted file mode 100644
index 9cf15c8..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/MessageBoxDB.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox.Storage.dbpool;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.sql.*;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.airavata.wsmg.commons.storage.JdbcStorage;
-import org.apache.axiom.om.OMElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This is the core class which used by DatabaseStorageImpl to perform all the service operations, DatabaseStorageImpl
- * class simply use this class in its operation methods to perform the actual functionality.
- */
-public class MessageBoxDB {
-
-    private static final String MSGBOXES_TABLENAME = "msgBoxes";
-    private static final String    MSGBOX_TABLENAME = "msgbox";
-
-    private static final String    MSGBOX_TABLE_ID = "MSGBOXID";
-
-    private static final Logger logger = LoggerFactory.getLogger(MessageBoxDB.class);
-
-    private static Set<String> msgBoxids;
-
-    public static final String SELECT_ALL_FROM_MSGBOXES = "SELECT * FROM " + MSGBOXES_TABLENAME;
-
-    public static final String SQL_CREATE_MSGBOXES_STATEMENT = "INSERT INTO " + MSGBOXES_TABLENAME
-            + " (msgboxid) VALUES (?)";
-
-    public static final String SQL_DELETE_MSGBOXES_STATEMENT = "DELETE FROM " + MSGBOXES_TABLENAME
-            + " WHERE msgboxid = ?";
-
-    public static final String SQL_STORE_MESSAGE_STATEMENT = "INSERT INTO " + MSGBOX_TABLENAME
-            + " (content, msgboxid, messageid,soapaction) VALUES (?,?,?,?)";
-
-    public static final String SQL_SELECT_MSGBOX_STATEMENT = "SELECT * FROM " + MSGBOX_TABLENAME
-            + " WHERE msgboxid = ? ORDER BY time";
-
-    public static final String SQL_DELETE_MSGBOX_STATEMENT = "DELETE FROM " + MSGBOX_TABLENAME + " WHERE msgboxid = ?";
-
-    public static final String SQL_DELETE_ANCIENT_STATEMENT = "DELETE FROM " + MSGBOX_TABLENAME
-            + " WHERE {fn TIMESTAMPDIFF(SQL_TSI_SECOND, time, CURRENT_TIMESTAMP) }*1000000 > ?";
-
-    private JdbcStorage db;
-
-    private static MessageBoxDB instance;
-
-    private long time;
-
-    private MessageBoxDB(JdbcStorage db, long time) {
-        this.db = db;
-        this.time = time;
-    }
-
-    public static synchronized MessageBoxDB initialize(JdbcStorage db, long time) throws SQLException {
-        if (instance == null) {
-            instance = new MessageBoxDB(db, time);
-            setMsgBoxidList(db);
-        }
-        return instance;
-    }
-
-    public static MessageBoxDB getInstance() {
-        if (instance == null) {
-            throw new RuntimeException("Please initialize this object first using initialize(JdbcStorage, long)");
-        }
-        return instance;
-    }
-
-    public synchronized void createMsgBx(String messageBoxId) throws SQLException, IOException {
-        if (!msgBoxids.contains(messageBoxId)) {
-
-            Connection connection = null;
-            try {
-                logger.debug(MSGBOXES_TABLENAME + ":" + messageBoxId);
-
-                connection = db.connect();
-                PreparedStatement statement = connection.prepareStatement(SQL_CREATE_MSGBOXES_STATEMENT);
-                statement.setString(1, messageBoxId);
-                db.executeUpdateAndClose(statement);
-                db.commitAndFree(connection);
-
-                msgBoxids.add(messageBoxId);
-
-            } catch (SQLException sql) {
-                db.rollbackAndFree(connection);
-                throw sql;
-            }
-        } else {
-            throw new IOException("The message box ID requested already exists");
-        }
-    }
-
-    public synchronized void addMessage(String msgBoxID, String messageID, String soapAction, OMElement message)
-            throws SQLException, IOException, XMLStreamException {
-        if (msgBoxids.contains(msgBoxID)) {
-
-            Connection connection = null;
-            try {
-                connection = db.connect();
-                PreparedStatement stmt = connection.prepareStatement(SQL_STORE_MESSAGE_STATEMENT);
-                ByteArrayOutputStream output = new ByteArrayOutputStream();
-                ObjectOutputStream out = new ObjectOutputStream(output);
-                out.writeObject(message.toStringWithConsume());
-                byte[] buffer = output.toByteArray();
-                ByteArrayInputStream in = new ByteArrayInputStream(buffer);
-                stmt.setBinaryStream(1, in, buffer.length);
-                stmt.setString(2, msgBoxID);
-                stmt.setString(3, messageID);
-                stmt.setString(4, soapAction);
-
-                db.executeUpdateAndClose(stmt);
-                db.commitAndFree(connection);
-
-            } catch (SQLException sql) {
-                db.rollbackAndFree(connection);
-                throw sql;
-            }
-        } else {
-            throw new IOException("Currently a messagebox is not available with given message box id :" + msgBoxID + message.toStringWithConsume());
-        }
-    }
-
-    public synchronized void deleteMessageBox(String msgBoxId) throws SQLException {
-
-        if (msgBoxids.contains(msgBoxId)) {
-
-            Connection connection = null;
-            try {
-                connection = db.connect();
-                PreparedStatement statement = connection.prepareStatement(SQL_DELETE_MSGBOXES_STATEMENT);
-                statement.setString(1, msgBoxId);
-                db.executeUpdateAndClose(statement);
-                statement = connection.prepareStatement(SQL_DELETE_MSGBOX_STATEMENT);
-                statement.setString(1, msgBoxId);
-                db.executeUpdateAndClose(statement);
-
-                // commit
-                db.commitAndFree(connection);
-
-                // remove from set
-                msgBoxids.remove(msgBoxId);
-
-            } catch (SQLException sql) {
-                db.rollbackAndFree(connection);
-                throw sql;
-            }
-        }
-    }
-
-    public synchronized List<String> removeAllMessagesforClient(String msgBoxId) throws SQLException, IOException,
-            ClassNotFoundException, XMLStreamException {
-        ArrayList<String> list = new ArrayList<String>();
-        if (msgBoxids.contains(msgBoxId)) {
-
-            Connection connection = null;
-            PreparedStatement stmt = null;
-            PreparedStatement stmt2 = null;
-            try {
-                connection = db.connect();
-                stmt = connection.prepareStatement(SQL_SELECT_MSGBOX_STATEMENT);
-                stmt.setString(1, msgBoxId);
-                ResultSet resultSet = stmt.executeQuery();
-                while (resultSet.next()) {
-                    InputStream in = resultSet.getAsciiStream("content");
-                    ObjectInputStream s = new ObjectInputStream(in);
-                    String xmlString = (String) s.readObject();
-                    logger.debug(xmlString);
-                    list.add(xmlString);
-                }
-
-                /*
-                 * Delete all retrieved messages
-                 */
-                stmt2 = connection.prepareStatement(SQL_DELETE_MSGBOX_STATEMENT);
-                stmt2.setString(1, msgBoxId);
-                stmt2.executeUpdate();
-
-                // commit
-                db.commit(connection);
-            } catch(SQLNonTransientConnectionException e){
-                logger.warn("Database connection is interrupted");
-            } catch (SQLException sql) {
-                db.rollback(connection);
-                throw sql;
-            } finally {
-
-                /*
-                 * If there is error during query, close everything and throw error
-                 */
-                db.quietlyClose(connection, stmt, stmt2);
-            }
-        }
-        return list;
-    }
-
-    public synchronized void removeAncientMessages() {
-        Connection connection = null;
-        try {
-            connection = db.connect();
-            PreparedStatement stmt = connection.prepareStatement(SQL_DELETE_ANCIENT_STATEMENT);
-            stmt.setLong(1, this.time);
-            db.executeUpdateAndCloseWithPrintLogMessages(stmt, false);
-            db.commitAndFree(connection);
-        } catch (SQLException sql) {
-            db.rollbackAndFree(connection);
-            logger.error("Caught exception while removing old entries from msgbox db table", sql);
-        }
-    }
-
-    private static void setMsgBoxidList(JdbcStorage db) throws SQLException {
-        msgBoxids = new HashSet<String>();
-
-        Connection connection = null;
-        PreparedStatement stmt = null;
-        try {
-            connection = db.connect();
-            stmt = connection.prepareStatement(SELECT_ALL_FROM_MSGBOXES);
-            ResultSet resultSet = stmt.executeQuery();
-            while (resultSet.next()) {
-                msgBoxids.add(resultSet.getString("msgboxid"));
-            }
-            db.commit(connection);
-        } catch (SQLException e) {
-            db.rollback(connection);
-            throw e;
-        } finally {
-            db.quietlyClose(connection, stmt);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/memory/InMemoryImpl.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/memory/InMemoryImpl.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/memory/InMemoryImpl.java
deleted file mode 100644
index 7406ce4..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/memory/InMemoryImpl.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox.Storage.memory;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.airavata.wsmg.msgbox.Storage.MsgBoxStorage;
-import org.apache.axiom.om.OMElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This is the in memory storage implementation for MsgBoxService, this will be initialized if airavata-server.properties is
- * configured not to use database implementation.
- */
-public class InMemoryImpl implements MsgBoxStorage {
-    private static final Logger logger = LoggerFactory.getLogger(InMemoryImpl.class);
-
-    private HashMap<String, List<Content>> map = new HashMap<String, List<Content>>();
-
-    private long time;
-
-    public InMemoryImpl(long time) {
-        this.time = time;
-    }
-
-    public String createMsgBox() throws Exception {
-        synchronized (map) {
-            String clientid = UUID.randomUUID().toString();
-            if (map.containsKey(clientid))
-                throw new Exception("Message Box is existed with key:" + clientid);
-            map.put(clientid, new ArrayList<Content>());
-            return clientid;
-        }
-    }
-
-    public void destroyMsgBox(String key) throws Exception {
-        synchronized (map) {
-            map.remove(key);
-        }
-    }
-
-    public List<String> takeMessagesFromMsgBox(String key) throws Exception {
-        synchronized (map) {
-            List<Content> x = map.get(key);
-            ArrayList<String> result = new ArrayList<String>(x.size());
-            for (Content content : x) {
-                result.add(content.getContent());
-            }
-            map.put(key, new ArrayList<Content>());
-            return result;
-        }
-    }
-
-    public void putMessageIntoMsgBox(String msgBoxID, String messageID, String soapAction, OMElement message)
-            throws Exception {
-        synchronized (map) {
-            if (!map.containsKey(msgBoxID)) {
-                throw new IllegalArgumentException("no message box with key " + msgBoxID + " to store the msg");
-            }
-            List<Content> list = map.get(msgBoxID);
-            list.add(new Content(message.toStringWithConsume(), System.currentTimeMillis()));
-            logger.debug("Message Stored in list with key " + msgBoxID);
-        }
-    }
-
-    public void removeAncientMessages() {
-        /*
-         * O(n^2) algorithms. Better performance can be achieved with more Cache.
-         */
-        synchronized (map) {
-            long currentTime = System.currentTimeMillis();
-            Iterator<List<Content>> it = map.values().iterator();
-            while (it.hasNext()) {
-                Iterator<Content> itToRemove = it.next().iterator();
-                while (itToRemove.hasNext()) {
-                    Content content = itToRemove.next();
-                    if (currentTime - this.time > content.getTime()) {
-                        itToRemove.remove();
-                    }
-                }
-            }
-        }
-    }
-
-    public void dispose() {
-        synchronized (map) {
-            map.clear();
-        }
-    }
-
-    class Content {
-        private String content;
-        private long time;
-
-        public Content(String content, long time) {
-            this.content = content;
-            this.time = time;
-        }
-
-        public String getContent() {
-            return content;
-        }
-
-        public long getTime() {
-            return time;
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/StoreMessageHandler.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/StoreMessageHandler.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/StoreMessageHandler.java
deleted file mode 100644
index 51a60ae..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/StoreMessageHandler.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox;
-
-import java.util.List;
-
-import org.apache.airavata.wsmg.commons.MsgBoxQNameConstants;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingFaultsHelper;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.dispatchers.AddressingBasedDispatcher;
-import org.apache.axis2.engine.Phase;
-import org.apache.axis2.util.JavaUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This Dispatcher is used to validate the incoming message, this is set to Handler list in MsgBoxServiceLifeCycle.
- */
-public class StoreMessageHandler extends AddressingBasedDispatcher {
-    private static final Logger logger = LoggerFactory.getLogger(StoreMessageHandler.class);
-    private static final String WSMG_MSGSTORE_SOAP_ACTION = MsgBoxQNameConstants.STOREMSG_QNAME.getNamespaceURI()
-            + MsgBoxQNameConstants.STOREMSG_QNAME.getLocalPart();
-    private static final String ADDRESSING_VALIDATE_ACTION = "addressing.validateAction";
-
-    private Phase addressingPhase;
-    private AxisOperation messageBoxOperation;
-
-    public org.apache.axis2.engine.Handler.InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
-
-        InvocationResponse response = InvocationResponse.CONTINUE;
-        if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null) {
-
-            boolean validateAction = JavaUtils.isTrue(msgContext.getProperty(ADDRESSING_VALIDATE_ACTION), true);
-            msgContext.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false));
-
-            response = super.invoke(msgContext);
-
-            if (isForMessageBoxService(msgContext))
-                validateMsgBoxStoreOperation(msgContext);
-            if (validateAction)
-                checkAction(msgContext);
-            msgContext.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(validateAction));
-
-        }
-        return response;
-    }
-
-    private void validateMsgBoxStoreOperation(MessageContext msgContext) {
-        if (msgContext.getAxisOperation() == null) {
-            AxisService service = msgContext.getAxisService();
-            AxisOperation storeMsgOperation = getMessageBoxOperation(service);
-
-            msgContext.setAxisOperation(storeMsgOperation);
-        }
-    }
-
-    private boolean isForMessageBoxService(MessageContext msgContext) {
-        return msgContext.getAxisService() != null && msgContext.getAxisService().getName().equals("MsgBoxService");
-    }
-
-    private AxisOperation getMessageBoxOperation(AxisService msgBoxService) {
-        if (messageBoxOperation == null)
-            messageBoxOperation = msgBoxService.getOperationBySOAPAction(WSMG_MSGSTORE_SOAP_ACTION);
-        return messageBoxOperation;
-    }
-
-    private void checkAction(MessageContext msgContext) throws AxisFault {
-
-        Phase addPhase = getAddressingPhase(msgContext);
-
-        if (addPhase == null) {
-            logger.error("unable to locate addressing phase object");
-        }
-        if (msgContext != null) {
-            if (msgContext.getCurrentPhaseIndex() + 1 == addPhase.getHandlerCount()) {
-                if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null)
-                    AddressingFaultsHelper.triggerActionNotSupportedFault(msgContext, msgContext.getWSAAction());
-            }
-        }
-    }
-
-    private Phase getAddressingPhase(MessageContext context) {
-
-        if (addressingPhase == null) {
-
-            List<Phase> inFlowPhases = context.getConfigurationContext().getAxisConfiguration().getPhasesInfo()
-                    .getINPhases();
-
-            for (Phase p : inFlowPhases) {
-                if (p.getName().equalsIgnoreCase("Addressing")) {
-                    addressingPhase = p;
-                }
-            }
-
-        }
-
-        return addressingPhase;
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/ConfigKeys.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/ConfigKeys.java
deleted file mode 100644
index 7069f40..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/ConfigKeys.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox.util;
-
-public class ConfigKeys {
-//    public static final String CONFIG_FILE_NAME = "airavata-server.properties";
-    public static final String MSG_PRESV_DAYS = "messagePreservationDays";
-    public static final String MSG_PRESV_HRS = "messagePreservationHours";
-    public static final String MSG_PRESV_MINS = "messagePreservationMinutes";
-    public static final String MSG_BOX_JDBC_DRIVER = "msgBox.jdbc.driver";
-    public static final String MSG_BOX_JDBC_URL = "msgBox.jdbc.url";
-    public static final String USE_DATABASE_STORAGE = "msgBox.usedatabase";
-    public static final String MSG_PRESV_INTERVAL_DAYS = "messagePreservationIntervalDays";
-    public static final String MSG_PRESV_INTERVAL_HRS = "messagePreservationIntervalHours";
-    public static final String MSG_PRESV_INTERVAL_MINS = "messagePreservationIntervalMinutes";
-    public static final String MSG_PRESV_INTERVAL = "messagePreservationInterval";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxCommonConstants.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxCommonConstants.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxCommonConstants.java
deleted file mode 100644
index cd63b83..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxCommonConstants.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox.util;
-
-public class MsgBoxCommonConstants {
-    public static final String MSGBOX_STORAGE = "msgbox.storage";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxOperations.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxOperations.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxOperations.java
deleted file mode 100644
index 6e74c2e..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxOperations.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox.util;
-
-public enum MsgBoxOperations {
-    STORE_MSGS("storeMessages"), DESTROY_MSGBOX("destroyMsgBox"), TAKE_MSGS("takeMessages"), CREATE_MSGBOX(
-            "createMsgBox");
-
-    private final String name;
-
-    private MsgBoxOperations(String n) {
-        name = n;
-    }
-
-    public String toString() {
-        return name;
-    }
-
-    public boolean equals(String s) {
-        return name.equals(s);
-    }
-
-    public static MsgBoxOperations valueFrom(String s) {
-        for (MsgBoxOperations status : MsgBoxOperations.values()) {
-            if (status.toString().equalsIgnoreCase(s)) {
-                return status;
-            }
-
-        }
-
-        throw new RuntimeException("invalid WsEventingOperation:- " + s);
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxUtils.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxUtils.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxUtils.java
deleted file mode 100644
index 8b523a0..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxUtils.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox.util;
-
-import java.io.Reader;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
-
-public class MsgBoxUtils {
-
-    public static SOAPEnvelope reader2SOAPEnvilope(Reader reader) throws XMLStreamException {
-        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-        XMLStreamReader inflow = inputFactory.createXMLStreamReader(reader);
-
-        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(inflow);
-        SOAPEnvelope omEnvelope = builder.getSOAPEnvelope();
-        return omEnvelope;
-    }
-
-    public static OMElement reader2OMElement(Reader reader) throws XMLStreamException {
-        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-        XMLStreamReader inflow = inputFactory.createXMLStreamReader(reader);
-
-        StAXOMBuilder builder = new StAXOMBuilder(inflow);
-        OMElement omElement = builder.getDocumentElement();
-        return omElement;
-    }
-
-    public static String formatMessageBoxUrl(String msgBoxServiceUrl, String msgboxId) {
-        return msgBoxServiceUrl.endsWith("/") ? msgBoxServiceUrl + "clientid/" + msgboxId : msgBoxServiceUrl
-                + "/clientid/" + msgboxId;
-    }
-
-    public static String formatURLString(String url) {
-
-        if (url == null) {
-            throw new IllegalArgumentException("url can't be null");
-        }
-
-        if (url.indexOf("//") < 0) {
-            url = "http://" + url; // use default http
-        }
-        return url;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-derby.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-derby.sql b/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-derby.sql
deleted file mode 100644
index d1ff141..0000000
--- a/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-derby.sql
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-CREATE TABLE MSGBOXES (
-  MSGBOXID VARCHAR(100) NOT NULL DEFAULT '',
-  PRIMARY KEY  (MSGBOXID)
-); 
-
-CREATE TABLE MSGBOX (
-  ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
-  CONTENT BLOB,
-  MSGBOXID VARCHAR(100) NOT NULL DEFAULT '',
-  MESSAGEID VARCHAR(100) DEFAULT '',
-  SOAPACTION VARCHAR(100) DEFAULT '',
-  TIME TIMESTAMP ,
-  PRIMARY KEY  (ID))
-;
-
-CREATE TRIGGER MESSAGE_TIME
-  AFTER INSERT ON MSGBOX
-  REFERENCING NEW AS NEW
-  FOR EACH ROW MODE DB2SQL
-    UPDATE MSGBOX SET TIME = CURRENT_TIMESTAMP WHERE ID = NEW.ID;

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-mysql.sql b/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-mysql.sql
deleted file mode 100755
index a2f730b..0000000
--- a/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-mysql.sql
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-CREATE DATABASE IF NOT EXISTS wsmg;
-
-DROP TABLE IF EXISTS msgBoxes;
-
-CREATE TABLE `msgBoxes` (
-  `msgboxid` varchar(100) NOT NULL default '',
-  PRIMARY KEY  (`msgboxid`)
-) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-
-DROP TABLE IF EXISTS msgbox;
-
-CREATE TABLE `msgbox` (
-  `id` int(11) NOT NULL auto_increment,
-  `content` longblob NOT NULL,
-  `msgboxid` varchar(100) NOT NULL default '""',
-  `messageid` varchar(100) default '""',
-  `soapaction` varchar(100) default '""',
-  `time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
-  PRIMARY KEY  (`id`),
-  KEY `MSGBOXID` (`msgboxid`)
-) ENGINE=MyISAM AUTO_INCREMENT=7665 DEFAULT CHARSET=latin1;

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/resources/services.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/resources/services.xml b/modules/ws-messenger/messagebox/src/main/resources/services.xml
deleted file mode 100644
index 18dc22e..0000000
--- a/modules/ws-messenger/messagebox/src/main/resources/services.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<serviceGroup>
-    <service name="MsgBoxService" scope="application" class="org.apache.airavata.wsmg.msgbox.MsgBoxServiceLifeCycle">
-        <messageReceivers>
-            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.airavata.wsmg.msgbox.MsgBoxServiceMessageReceiverInOut" />
-        </messageReceivers>
-        <parameter name="ServiceClass">org.apache.airavata.wsmg.msgbox.MsgBoxServiceSkeleton
-        </parameter>
-        <parameter name="useOriginalwsdl">false</parameter>
-        <parameter name="modifyUserWSDLPortAddress">true</parameter>
-        <operation name="storeMessages" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://org.apache.airavata/ws-messenger/msgbox/2011/">
-            <actionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/storeMessages
-            </actionMapping>
-            <outputActionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/storeMessagesResponse
-            </outputActionMapping>
-        </operation>
-        <operation name="destroyMsgBox" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://org.apache.airavata/ws-messenger/msgbox/2011/">
-            <actionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/destroyMsgBox
-            </actionMapping>
-            <outputActionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/destroyMsgBoxResponse
-            </outputActionMapping>
-        </operation>
-        <operation name="takeMessages" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://org.apache.airavata/ws-messenger/msgbox/2011/">
-            <actionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/takeMessages
-            </actionMapping>
-            <outputActionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/takeMessagesResponse
-            </outputActionMapping>
-        </operation>
-        <operation name="createMsgBox" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://org.apache.airavata/ws-messenger/msgbox/2011/">
-            <actionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/createMsgBox
-            </actionMapping>
-            <outputActionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/createMsgBoxResponse
-            </outputActionMapping>
-        </operation>
-    </service>
-
-</serviceGroup>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/InMemoryMessageBoxServer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/InMemoryMessageBoxServer.java b/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/InMemoryMessageBoxServer.java
deleted file mode 100644
index 0ba8d43..0000000
--- a/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/InMemoryMessageBoxServer.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox;
-
-import javax.xml.namespace.QName;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.InOutAxisOperation;
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.transport.http.SimpleHTTPServer;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-
-public class InMemoryMessageBoxServer {
-    private static int count = 0;
-
-    private static SimpleHTTPServer receiver;
-
-    public static int TESTING_PORT = 7630;
-
-    public static final String FAILURE_MESSAGE = "Intentional Failure";
-
-    public static synchronized void deployService(AxisService service) throws AxisFault {
-        receiver.getConfigurationContext().getAxisConfiguration().addService(service);
-    }
-
-    public static synchronized void unDeployService(QName service) throws AxisFault {
-        receiver.getConfigurationContext().getAxisConfiguration().removeService(service.getLocalPart());
-    }
-
-    public static synchronized void start(String repository, String axis2xml) throws Exception {
-        if (count == 0) {
-            ConfigurationContext er = getNewConfigurationContext(repository, axis2xml);
-            TESTING_PORT = getAvailablePort();
-            receiver = new SimpleHTTPServer(er, TESTING_PORT);
-
-            try {
-                receiver.start();
-                System.out.print("Server started on port " + TESTING_PORT + ".....");
-            } catch (Exception e) {
-                throw AxisFault.makeFault(e);
-            }
-
-            try {
-                Thread.sleep(2000);
-            } catch (InterruptedException e1) {
-                throw new AxisFault("Thread interuptted", e1);
-            }
-            startMessageBox();
-        }
-        count++;
-    }
-
-    public static void startMessageBox() throws Exception {
-
-        /*
-         * Imitate service.xml
-         */
-        AxisService axisService = new AxisService("MsgBoxService");
-        axisService.setServiceLifeCycle(new MsgBoxServiceLifeCycle());
-        axisService.addParameter("ServiceClass", "org.apache.airavata.wsmg.msgbox.MsgBoxServiceSkeleton");
-        createOperation(axisService, "storeMessages", new MsgBoxServiceMessageReceiverInOut(),
-                "http://org.apache.airavata/ws-messenger/msgbox/2011/storeMessages",
-                "http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/storeMessagesResponse");
-        createOperation(axisService, "destroyMsgBox", new MsgBoxServiceMessageReceiverInOut(),
-                "http://org.apache.airavata/ws-messenger/msgbox/2011/destroyMsgBox",
-                "http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/destroyMsgBoxResponse");
-        createOperation(axisService, "takeMessages", new MsgBoxServiceMessageReceiverInOut(),
-                "http://org.apache.airavata/ws-messenger/msgbox/2011/takeMessages",
-                "http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/takeMessagesResponse");
-        createOperation(axisService, "createMsgBox", new MsgBoxServiceMessageReceiverInOut(),
-                "http://org.apache.airavata/ws-messenger/msgbox/2011/createMsgBox",
-                "http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/createMsgBoxResponse");
-
-        InMemoryMessageBoxServer.deployService(axisService);
-
-        new MsgBoxServiceLifeCycle().startUp(InMemoryMessageBoxServer.getConfigurationContext(), axisService);
-
-    }
-
-    public static void createOperation(AxisService axisService, String name, MessageReceiver messageReceiver,
-            String inputAction, String outputAction) {
-        InOutAxisOperation operation1 = new InOutAxisOperation(new QName(name));
-        operation1.setMessageReceiver(messageReceiver);
-        operation1.setOutputAction(outputAction);
-        axisService.addOperation(operation1);
-        if (inputAction != null) {
-            axisService.mapActionToOperation(inputAction, operation1);
-        }
-    }
-
-    public static ConfigurationContext getNewConfigurationContext(String repository, String axis2xml) throws Exception {
-        return ConfigurationContextFactory.createConfigurationContextFromFileSystem(repository, axis2xml);
-    }
-
-    public static synchronized void stop() throws AxisFault {
-        if (count == 1) {
-            receiver.stop();
-            while (receiver.isRunning()) {
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e1) {
-                    // nothing to do here
-                }
-            }
-            count = 0;
-            // tp.doStop();
-            System.out.print("Server stopped .....");
-        } else {
-            count--;
-        }
-        receiver.getConfigurationContext().terminate();
-    }
-
-    public static ConfigurationContext getConfigurationContext() {
-        return receiver.getConfigurationContext();
-    }
-
-    public static String prefixBaseDirectory(String path) {
-        return path;
-    }
-
-      public static int getAvailablePort(){
-        ServerSocket serverSocket = null;
-        try {
-             serverSocket = new ServerSocket(0);
-             serverSocket.close();
-        } catch (IOException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        }
-        return serverSocket.getLocalPort();
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MessageBoxStressTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MessageBoxStressTest.java b/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MessageBoxStressTest.java
deleted file mode 100644
index 715b90c..0000000
--- a/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MessageBoxStressTest.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox;
-
-import java.io.StringReader;
-import java.util.Iterator;
-import java.util.UUID;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.wsmg.msgbox.client.MsgBoxClient;
-import org.apache.airavata.wsmg.msgbox.util.MsgBoxUtils;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.ServiceClient;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class MessageBoxStressTest extends TestCase {
-    private int port = InMemoryMessageBoxServer.TESTING_PORT;
-    private long timeout = 5000L;
-
-    @BeforeClass
-    public static void setUpBeforeClass() throws Exception {
-
-    }
-
-    @AfterClass
-    public static void tearDownAfterClass() throws Exception {
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        InMemoryMessageBoxServer.start(null, null);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    @Test
-    public void testMessageBox() throws Exception {
-
-        MsgBoxClient user = new MsgBoxClient();
-        port = InMemoryMessageBoxServer.TESTING_PORT;
-        // test publish with Epr
-        EndpointReference msgBoxEpr = user.createMessageBox("http://localhost:" + port
-                + "/axis2/services/MsgBoxService", timeout);
-
-        System.out.println(msgBoxEpr.toString());
-        user.storeMessage(msgBoxEpr, timeout,
-                MsgBoxUtils.reader2OMElement(new StringReader("<test>A simple test message</test>")));
-
-        Iterator<OMElement> iterator = user.takeMessagesFromMsgBox(msgBoxEpr, timeout);
-        int i = 0;
-        if (iterator != null)
-            while (iterator.hasNext()) {
-                i++;
-                System.out.println("Retrieved message :" + i);
-                System.out.println(iterator.next().toStringWithConsume());
-            }
-
-
-        // test invocations with id encoded in the Url
-//        port = InMemoryMessageBoxServer.getAvailablePort();
-//        user = new MsgBoxClient();
-//        msgBoxEpr = user.createMessageBox("http://localhost:" + port + "/axis2/services/MsgBoxService", timeout);
-        String msgBoxId = UUID.randomUUID().toString();
-        String address = msgBoxEpr.getAddress();
-        int biginIndex = address.indexOf("clientid");
-        if (biginIndex != -1) {
-            msgBoxId = address.substring(biginIndex + "clientid".length() + 1);
-        }
-        System.out.println("MSGBOX ID:" + msgBoxId);
-
-        String mesgboxUrl = "http://localhost:" + port + "/axis2/services/MsgBoxService/clientid/" + msgBoxId;
-
-        OMElement request = OMAbstractFactory.getOMFactory().createOMElement(new QName("foo"));
-        request.setText("bar");
-        ServiceClient client = null;
-
-        try {
-            client = new ServiceClient();
-            System.out.println(mesgboxUrl);
-            client.getOptions().setTo(new EndpointReference(mesgboxUrl));
-            OMElement response = client.sendReceive(request);
-        } finally {
-            client.cleanupTransport();
-        }
-
-        iterator = user.takeMessagesFromMsgBox(new EndpointReference(mesgboxUrl), timeout);
-        assertTrue(iterator.hasNext());
-        while (iterator.hasNext()) {
-            i++;
-            System.out.println("Retrieved message :" + i);
-            System.out.println(iterator.next().toStringWithConsume());
-        }
-        assertFalse(iterator.hasNext());
-
-        System.out.println("Delete message box response :  " + user.deleteMsgBox(msgBoxEpr, timeout));
-        System.out.println("All tests Done");
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MsgBoxTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MsgBoxTest.java b/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MsgBoxTest.java
deleted file mode 100644
index b3a3f4c..0000000
--- a/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MsgBoxTest.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox;
-
-import java.io.StringReader;
-import java.util.Iterator;
-import java.util.Random;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.wsmg.msgbox.client.MsgBoxClient;
-import org.apache.airavata.wsmg.msgbox.util.MsgBoxUtils;
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.addressing.EndpointReference;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-public class MsgBoxTest extends TestCase {
-
-    private int port = InMemoryMessageBoxServer.TESTING_PORT;
-    private long timeout = 5000L;
-
-    @BeforeClass
-    public static void setUpBeforeClass() throws Exception {
-
-    }
-
-    @AfterClass
-    public static void tearDownAfterClass() throws Exception {
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        InMemoryMessageBoxServer.start(null, null);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    @Test
-    public void testMessageBox() throws Exception {
-
-        MsgBoxClient user = new MsgBoxClient();
-        StringBuilder builder = new StringBuilder();
-        port = InMemoryMessageBoxServer.TESTING_PORT;
-        EndpointReference msgBoxEpr = user.createMessageBox("http://localhost:" + port
-                + "/axis2/services/MsgBoxService", timeout);
-
-        for (int i = 0; i < 10; i++) {
-
-            builder.delete(0, builder.capacity());
-            Random x = new Random();
-            for (int j = 0; j < x.nextInt(50); j++) {
-                builder.append("123456789");
-            }
-
-            String msg = String.format("<msg><seq>%d</seq><fill>%s</fill></msg>", i, builder.toString());
-
-            user.storeMessage(msgBoxEpr, timeout, MsgBoxUtils.reader2OMElement(new StringReader(msg)));
-
-            Thread.sleep(200L);
-        }
-
-        Iterator<OMElement> iterator = null;
-
-        try {
-            iterator = user.takeMessagesFromMsgBox(msgBoxEpr, timeout);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-
-        if (iterator != null)
-            while (iterator.hasNext()) {
-                System.out.println(iterator.next().toStringWithConsume());
-            }
-
-        System.out.println("Delete message box response :  " + user.deleteMsgBox(msgBoxEpr, 5000L));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/pom.xml b/modules/ws-messenger/messagebroker/pom.xml
deleted file mode 100644
index df779a1..0000000
--- a/modules/ws-messenger/messagebroker/pom.xml
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata-ws-messenger</artifactId>
-        <version>0.12-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-message-broker</artifactId>
-    <name>Airavata Message Broker</name>
-    <url>http://airavata.apache.org/</url>
-    <packaging>jar</packaging>
-
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <version>${antrun.version}</version>
-                <executions>
-                    <execution>
-                        <id>restore-persistence</id>
-                        <phase>prepare-package</phase>
-                        <configuration>
-                            <tasks>
-                                <copy file="${project.build.outputDirectory}/services.xml" tofile="${project.build.outputDirectory}/META-INF/services.xml" />
-                            </tasks>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-    <dependencies>
-
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-messenger-commons</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-client-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-common-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-messenger-client</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>yfilter</artifactId>
-            <version>${yfilter.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>wsdl4j</groupId>
-            <artifactId>wsdl4j</artifactId>
-            <version>1.5.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-transport-http</artifactId>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-transport-local</artifactId>
-        </dependency>
-
-        <!-- Logging -->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-
-        <!-- Test -->
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-	    <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-server-configuration</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    </properties>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AbstractBrokerMsgReceiver.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AbstractBrokerMsgReceiver.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AbstractBrokerMsgReceiver.java
deleted file mode 100644
index 9277dcc..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AbstractBrokerMsgReceiver.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker;
-
-import java.util.List;
-
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.engine.AxisEngine;
-import org.apache.axis2.receivers.AbstractMessageReceiver;
-import org.apache.axis2.util.MessageContextBuilder;
-
-public abstract class AbstractBrokerMsgReceiver extends AbstractMessageReceiver {
-
-    protected abstract MessageContext process(MessageContext inMsgContext, String operationName) throws AxisFault;
-
-    @Override
-    protected void invokeBusinessLogic(MessageContext inMsgContext) throws AxisFault {
-
-        String operationName = getOperationName(inMsgContext);
-        MessageContext outMsgContext = process(inMsgContext, operationName);
-
-        if (outMsgContext != null) {
-            outMsgContext.setTo(null);
-            super.replicateState(inMsgContext);
-            AxisEngine.send(outMsgContext);
-
-        }
-
-    }
-
-    protected String getOperationName(MessageContext inMsg) throws AxisFault {
-
-        org.apache.axis2.description.AxisOperation op = inMsg.getOperationContext().getAxisOperation();
-        if (op == null) {
-            throw new AxisFault(
-                    "Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
-        }
-
-        java.lang.String operationName = null;
-        if ((op.getName() == null)
-                || ((operationName = org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName().getLocalPart())) == null)) {
-            throw new AxisFault("invalid operation found");
-        }
-
-        return operationName;
-    }
-
-    protected MessageContext createOutputMessageContext(MessageContext inMsg, ProcessingContext processingContext)
-            throws AxisFault {
-
-        MessageContext outMsgContext = MessageContextBuilder.createOutMessageContext(inMsg);
-        outMsgContext.getOperationContext().addMessageContext(outMsgContext);
-
-        SOAPEnvelope outputEnvelope = getSOAPFactory(inMsg).getDefaultEnvelope();
-
-        if (processingContext.getRespMessage() != null) {
-
-            outputEnvelope.getBody().addChild(processingContext.getRespMessage());
-
-            if (processingContext.getResponseMsgNamespaces() != null) {
-                declareResponseMsgNamespace(outputEnvelope, processingContext.getResponseMsgNamespaces());
-            }
-        }
-
-        outMsgContext.setEnvelope(outputEnvelope);
-        return outMsgContext;
-    }
-
-    private void declareResponseMsgNamespace(SOAPEnvelope outputEnvelope, List<OMNamespace> namespaces) {
-
-        if (!namespaces.contains(NameSpaceConstants.WSA_NS)) {
-            namespaces.add(NameSpaceConstants.WSA_NS);// declare WSA by default
-        }
-
-        for (OMNamespace ns : namespaces) {
-            outputEnvelope.declareNamespace(ns);
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AdditionalMessageContent.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AdditionalMessageContent.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AdditionalMessageContent.java
deleted file mode 100644
index acf8f0f..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AdditionalMessageContent.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker;
-
-import java.io.Serializable;
-
-public class AdditionalMessageContent implements Serializable {
-    /**
-	 * 
-	 */
-    private static final long serialVersionUID = -5163025283681463108L;
-
-    String action;
-
-    String messageID;
-
-    String topicElement;
-
-    String producerReference;
-    String trackId;
-
-    /**
-     * @param action
-     * @param messageID
-     */
-    public AdditionalMessageContent(String action, String messageID) {
-        super();
-        // TODO Auto-generated constructor stub
-        this.action = action;
-        this.messageID = messageID;
-    }
-
-    /**
-     * @return Returns the action.
-     */
-    public String getAction() {
-        return action;
-    }
-
-    /**
-     * @param action
-     *            The action to set.
-     */
-    public void setAction(String action) {
-        this.action = action;
-    }
-
-    /**
-     * @return Returns the messageID.
-     */
-    public String getMessageID() {
-        return messageID;
-    }
-
-    /**
-     * @param messageID
-     *            The messageID to set.
-     */
-    public void setMessageID(String messageID) {
-        this.messageID = messageID;
-    }
-
-    /**
-     * @return Returns the producerReference.
-     */
-    public String getProducerReference() {
-        return producerReference;
-    }
-
-    /**
-     * @param producerReference
-     *            The producerReference to set.
-     */
-    public void setProducerReference(String producerReference) {
-        this.producerReference = producerReference;
-    }
-
-    /**
-     * @return Returns the topicElement.
-     */
-    public String getTopicElement() {
-        return topicElement;
-    }
-
-    /**
-     * @param topicElement
-     *            The topicElement to set.
-     */
-    public void setTopicElement(String topicElement) {
-        this.topicElement = topicElement;
-    }
-
-    /**
-     * @return Returns the trackId.
-     */
-    public String getTrackId() {
-        return trackId;
-    }
-
-    /**
-     * @param trackId
-     *            The trackId to set.
-     */
-    public void setTrackId(String trackId) {
-        this.trackId = trackId;
-    }
-
-    public String toString() {
-        return String.format("msgId = %s, trackId = %s, topic = %s", messageID, trackId, topicElement);
-    }
-
-}


[18/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/AmazonCredential.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/AmazonCredential.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/AmazonCredential.java
deleted file mode 100644
index fdf2267..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/AmazonCredential.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.amazon;
-
-public class AmazonCredential {
-    private static AmazonCredential instance;
-    private String awsAccesskey;
-    private String awsSecretAccessKey;
-
-    private AmazonCredential() {
-        this.awsAccesskey = "";
-        this.awsSecretAccessKey = "";
-    }
-
-    /**
-     * 
-     * @return AmazonCredential
-     */
-    public static AmazonCredential getInstance() {
-        if (instance == null) {
-            instance = new AmazonCredential();
-        }
-        return instance;
-    }
-
-    /**
-     * 
-     * @param accesskey
-     */
-    public void setAwsAccessKeyId(String accesskey) {
-        this.awsAccesskey = accesskey;
-    }
-
-    /**
-     * 
-     * @param secretAccessKey
-     */
-    public void setAwsSecretAccessKey(String secretAccessKey) {
-        this.awsSecretAccessKey = secretAccessKey;
-    }
-
-    /**
-     * 
-     * @param accesskey
-     * @return
-     */
-    public String getAwsAccessKeyId() {
-        return this.awsAccesskey;
-    }
-
-    /**
-     * 
-     * @param secretAccessKey
-     * @return
-     */
-    public String getAwsSecretAccessKey() {
-        return this.awsSecretAccessKey;
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/EC2InstanceResult.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/EC2InstanceResult.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/EC2InstanceResult.java
deleted file mode 100644
index 260ef2c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/EC2InstanceResult.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.amazon;
-
-import org.apache.airavata.xbaya.ui.widgets.TableRenderable;
-
-import com.amazonaws.services.ec2.model.Instance;
-
-public class EC2InstanceResult implements TableRenderable {
-
-    private static String[] columnName = { "Instance", "AMI ID", "Root Device", "Type", "Status", "Key Pair Name",
-            "Monitoring", "Virtualization", "Placement Group" };
-
-    private Instance instance;
-
-    /**
-     * 
-     * Constructs a EC2InstancesResult.
-     * 
-     * @param ins
-     */
-    public EC2InstanceResult(Instance ins) {
-        this.instance = ins;
-    }
-
-    public Instance getInstance() {
-        return this.instance;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getColumnCount()
-     */
-    @Override
-    public int getColumnCount() {
-        return 8;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getColumnTitle(int)
-     */
-    @Override
-    public String getColumnTitle(int index) {
-        return columnName[index];
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getValue(int)
-     */
-    @Override
-    public Object getValue(int index) {
-        switch (index) {
-        case 0:
-            return this.instance.getInstanceId();
-        case 1:
-            return this.instance.getImageId();
-        case 2:
-            return this.instance.getRootDeviceType();
-        case 3:
-            return this.instance.getInstanceType();
-        case 4:
-            return this.instance.getState().getName();
-        case 5:
-            return this.instance.getKeyName();
-        case 6:
-            return this.instance.getMonitoring().getState();
-        case 7:
-            return this.instance.getVirtualizationType();
-        case 8:
-            return this.instance.getPlacement().getGroupName();
-        default:
-            return null;
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java
deleted file mode 100644
index 2e0f4f5..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.generators;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.gpel.script.BPELScript;
-import org.apache.airavata.workflow.model.gpel.script.BPELScriptType;
-import org.apache.airavata.workflow.model.gpel.script.WorkflowWSDL;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.gpel.model.GpelProcess;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BPELFiler {
-
-    private static Logger logger = LoggerFactory.getLogger(BPELFiler.class);
-
-    private XBayaEngine engine;
-
-    private JFileChooser bpelFileChooser;
-
-    private final FileFilter bpelFileFilter = new FileFilter() {
-
-        @Override
-        public String getDescription() {
-            return "BPEL Files";
-        }
-
-        @Override
-        public boolean accept(File file) {
-            if (file.isDirectory()) {
-                return true;
-            }
-            String name = file.getName();
-            if (name.endsWith(XBayaConstants.BPEL_SUFFIX)) {
-                return true;
-            }
-            return false;
-        }
-    };
-
-    /**
-     * Constructs a BPELFiler.
-     * 
-     * @param engine
-     */
-    public BPELFiler(XBayaEngine engine) {
-        this.engine = engine;
-
-        this.bpelFileChooser = new JFileChooser(XBayaPathConstants.BPEL_SCRIPT_DIRECTORY);
-        this.bpelFileChooser.addChoosableFileFilter(this.bpelFileFilter);
-
-    }
-
-    /**
-     * Exports a BPEL process to the local file
-     */
-    public void exportBPEL() {
-        Workflow workflow = this.engine.getGUI().getWorkflow();
-        BPELScript bpel = new BPELScript(workflow);
-
-        // Check if there is any errors in the workflow first.
-        ArrayList<String> warnings = new ArrayList<String>();
-        if (!bpel.validate(warnings)) {
-            StringBuilder buf = new StringBuilder();
-            for (String warning : warnings) {
-                buf.append("- ");
-                buf.append(warning);
-                buf.append("\n");
-            }
-            this.engine.getGUI().getErrorWindow().warning(buf.toString());
-            return;
-        }
-
-        int returnVal = this.bpelFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
-        if (returnVal == JFileChooser.APPROVE_OPTION) {
-            File file = this.bpelFileChooser.getSelectedFile();
-            logger.debug(file.getPath());
-
-            String path = file.getPath();
-
-            // Remove ".bpel" at the end if any
-            if (path.endsWith(XBayaConstants.BPEL_SUFFIX)) {
-                path = path.substring(0, path.length() - XBayaConstants.BPEL_SUFFIX.length());
-            }
-
-            // Add ".bpel" at the end of the file name
-            File bpelFile = new File(path + XBayaConstants.BPEL_SUFFIX);
-            // Add ".wsdl" at the end of the file name
-            File wsdlFile = new File(path + XBayaConstants.WSDL_SUFFIX);
-
-            try {
-                // Create the script.
-                bpel.create(BPELScriptType.BPEL2);
-
-                GpelProcess gpelProcess = bpel.getGpelProcess();
-                XMLUtil.saveXML(gpelProcess.xml(), bpelFile);
-
-                WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL();
-                XMLUtil.saveXML(workflowWSDL.getWsdlDefinitions().xml(), wsdlFile);
-
-            } catch (IOException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
-            } catch (GraphException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_NOT_READY_ERROR, e);
-            } catch (RuntimeException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            } catch (Error e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            }
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ImageFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ImageFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ImageFiler.java
deleted file mode 100644
index 34902db..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ImageFiler.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.generators;
-
-import java.awt.image.BufferedImage;
-import java.io.File;
-import java.io.IOException;
-
-import javax.imageio.ImageIO;
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ImageFiler {
-
-    private static Logger logger = LoggerFactory.getLogger(ImageFiler.class);
-
-    private XBayaEngine engine;
-
-    private JFileChooser pngFileChooser;
-
-    private final FileFilter pngFileFilter = new FileFilter() {
-        @Override
-        public String getDescription() {
-            return "PNG Files";
-        }
-
-        @Override
-        public boolean accept(File file) {
-            if (file.isDirectory()) {
-                return true;
-            }
-            String name = file.getName();
-            if (name.endsWith(XBayaConstants.PNG_SUFFIX)) {
-                return true;
-            }
-            return false;
-        }
-    };
-
-    /**
-     * Constructs an ImageFiler.
-     * 
-     * @param engine
-     */
-    public ImageFiler(XBayaEngine engine) {
-        this.engine = engine;
-
-        this.pngFileChooser = new JFileChooser();
-        this.pngFileChooser.addChoosableFileFilter(this.pngFileFilter);
-    }
-
-    /**
-     * Save the workflow image to the local file
-     */
-    public void saveWorkflowImage() {
-        int returnVal = this.pngFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
-        if (returnVal == JFileChooser.APPROVE_OPTION) {
-            File file = this.pngFileChooser.getSelectedFile();
-            logger.debug(file.getPath());
-
-            // Put ".png" at the end of the file name
-            String path = file.getPath();
-            if (!path.endsWith(XBayaConstants.PNG_SUFFIX)) {
-                file = new File(path + XBayaConstants.PNG_SUFFIX);
-            }
-
-            BufferedImage image;
-            try {
-                image = this.engine.getGUI().getWorkflow().getImage();
-                ImageIO.write(image, XBayaConstants.PNG_FORMAT_NAME, file);
-            } catch (IOException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
-            } catch (RuntimeException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            } catch (Error e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            }
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/JythonFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/JythonFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/JythonFiler.java
deleted file mode 100644
index b2dd641..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/JythonFiler.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.generators;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-
-import org.apache.airavata.common.utils.IOUtil;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.jython.script.JythonScript;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JythonFiler {
-
-    private static Logger logger = LoggerFactory.getLogger(JythonFiler.class);
-
-    private XBayaEngine engine;
-
-    private JFileChooser jythonFileChooser;
-
-    private final FileFilter jythonFileFilter = new FileFilter() {
-        @Override
-        public String getDescription() {
-            return "Jython Scripts";
-        }
-
-        @Override
-        public boolean accept(File file) {
-            if (file.isDirectory()) {
-                return true;
-            }
-            String name = file.getName();
-            if (name.endsWith(XBayaConstants.JYTHON_SCRIPT_SUFFIX)) {
-                return true;
-            }
-            return false;
-        }
-    };
-
-    /**
-     * Constructs a JythonFile.
-     * 
-     * @param engine
-     */
-    public JythonFiler(XBayaEngine engine) {
-        this.engine = engine;
-        this.jythonFileChooser = new JFileChooser(XBayaPathConstants.JYTHON_SCRIPT_DIRECTORY);
-        this.jythonFileChooser.addChoosableFileFilter(this.jythonFileFilter);
-    }
-
-    /**
-     * Exports a Jython script to the local file
-     */
-    public void exportJythonScript() {
-        Workflow workflow = this.engine.getGUI().getWorkflow();
-        JythonScript script = new JythonScript(workflow, this.engine.getConfiguration());
-
-        // Check if there is any errors in the workflow first.
-        ArrayList<String> warnings = new ArrayList<String>();
-        if (!script.validate(warnings)) {
-            StringBuilder buf = new StringBuilder();
-            for (String warning : warnings) {
-                buf.append("- ");
-                buf.append(warning);
-                buf.append("\n");
-            }
-            this.engine.getGUI().getErrorWindow().warning(buf.toString());
-            return;
-        }
-
-        int returnVal = this.jythonFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
-        if (returnVal == JFileChooser.APPROVE_OPTION) {
-            File file = this.jythonFileChooser.getSelectedFile();
-            logger.debug(file.getPath());
-
-            // Put ".py" at the end of the file name
-            String path = file.getPath();
-            if (!path.endsWith(XBayaConstants.JYTHON_SCRIPT_SUFFIX)) {
-                file = new File(path + XBayaConstants.JYTHON_SCRIPT_SUFFIX);
-            }
-
-            try {
-                // Create the script.
-                script.create();
-                // Write to a file
-                IOUtil.writeToFile(script.getJythonString(), file);
-            } catch (IOException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
-            } catch (GraphException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
-            } catch (RuntimeException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            } catch (Error e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            }
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java
deleted file mode 100644
index a1573d4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.generators;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Map;
-import java.util.Set;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.utils.WSDLUtil;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.gpel.model.GpelProcess;
-import org.xmlpull.infoset.XmlElement;
-
-import xsul5.XmlConstants;
-import xsul5.wsdl.WsdlDefinitions;
-
-public class ODEScriptFiler {
-
-    private XBayaEngine engine;
-
-    private JFileChooser bpelFileChooser;
-
-    private final FileFilter bpelFileFilter = new FileFilter() {
-
-        @Override
-        public String getDescription() {
-            return "BPEL Files";
-        }
-
-        @Override
-        public boolean accept(File file) {
-            if (file.isDirectory()) {
-                return true;
-            }
-            String name = file.getName();
-            if (name.endsWith(XBayaConstants.BPEL_SUFFIX)) {
-                return true;
-            }
-            return false;
-        }
-    };
-
-    /**
-     * Constructs a ODEScriptFiler.
-     * 
-     * @param engine
-     */
-    public ODEScriptFiler(XBayaEngine engine) {
-        this.engine = engine;
-
-        this.bpelFileChooser = new JFileChooser(XBayaPathConstants.BPEL_SCRIPT_DIRECTORY);
-        this.bpelFileChooser.addChoosableFileFilter(this.bpelFileFilter);
-    }
-
-    /**
-	 * 
-	 */
-    public void save() {
-        Workflow wf = this.engine.getGUI().getWorkflow();
-        if (0 == wf.getGraph().getNodes().size()) {
-            this.engine.getGUI().getErrorWindow().warning("Workflow is Empty");
-            return;
-        }
-        GpelProcess process;
-        try {
-
-            int returnVal = this.bpelFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
-            if (returnVal == JFileChooser.APPROVE_OPTION) {
-                File file = this.bpelFileChooser.getSelectedFile();
-
-                String path = file.getPath();
-
-                // Remove ".bpel" at the end if any
-                if (path.endsWith(XBayaConstants.BPEL_SUFFIX)) {
-                    path = path.substring(0, path.length() - XBayaConstants.BPEL_SUFFIX.length());
-                }
-
-                // Add ".bpel" at the end of the file name
-                File bpelFile = new File(path + XBayaConstants.BPEL_SUFFIX);
-                // Add ".wsdl" at the end of the file name
-                File wsdlFile = new File(path + XBayaConstants.WSDL_SUFFIX);
-                // todo this has to fix, for compilation purpose passing dummy value instead of xregistry url
-                URI temp = null;
-                try {
-                    temp = new URI("temp");
-                } catch (URISyntaxException e) {
-                    e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
-                }
-                process = wf.getOdeProcess(WSDLUtil.appendWSDLQuary(temp), this.engine.getConfiguration().getODEURL());
-                String processString = process.xmlStringPretty();
-                FileWriter writer = new FileWriter(bpelFile);
-                writer.write(processString);
-                writer.close();
-
-                WsdlDefinitions workflowWSDL = wf.getOdeWorkflowWSDL(this.engine.getConfiguration().getDSCURL(),
-                        this.engine.getConfiguration().getODEURL());
-                String workflowWsdlStr = XmlConstants.BUILDER.serializeToStringPretty(workflowWSDL.xml());
-                writer = new FileWriter(wsdlFile);
-                writer.write(workflowWsdlStr);
-
-                Map<String, WsdlDefinitions> wsdlMap = wf.getOdeServiceWSDLs(
-                        this.engine.getConfiguration().getDSCURL(), this.engine.getConfiguration().getODEURL());
-                Set<String> keySet = wsdlMap.keySet();
-                for (String string : keySet) {
-                    writer = new FileWriter(new File(wsdlFile.getParent(), QName.valueOf(string).getLocalPart()));
-                    writer.write(XmlConstants.BUILDER.serializeToStringPretty(wsdlMap.get(string).xml()));
-                    writer.close();
-                }
-
-                XmlElement deployDescriptor = wf.getODEDeploymentDescriptor(this.engine.getConfiguration().getDSCURL(),
-                        this.engine.getConfiguration().getODEURL());
-                writer = new FileWriter(new File(wsdlFile.getParent(), "deploy.xml"));
-                writer.write(XmlConstants.BUILDER.serializeToString(deployDescriptor));
-                writer.close();
-
-            }
-
-        } catch (IOException e) {
-            this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
-        } catch (GraphException e) {
-            this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
-        } catch (RuntimeException e) {
-            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-        } catch (Error e) {
-            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-        } catch (ComponentException e) {
-            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-        }
-
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ScuflFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ScuflFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ScuflFiler.java
deleted file mode 100644
index bed2bc4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ScuflFiler.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.generators;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-
-import org.apache.airavata.common.utils.IOUtil;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.scufl.script.ScuflScript;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ScuflFiler {
-
-    private static Logger logger = LoggerFactory.getLogger(ScuflFiler.class);
-
-    private XBayaEngine engine;
-
-    private JFileChooser scuflFileChooser;
-
-    private final FileFilter scuflFileFilter = new FileFilter() {
-        @Override
-        public String getDescription() {
-            return "Scufl Scripts";
-        }
-
-        @Override
-        public boolean accept(File file) {
-            if (file.isDirectory()) {
-                return true;
-            }
-            String name = file.getName();
-            if (name.endsWith(XBayaConstants.SCUFL_SCRIPT_SUFFIX)) {
-                return true;
-            }
-            return false;
-        }
-    };
-
-    /**
-     * Constructs a ScuflFiler.
-     * 
-     * @param engine
-     */
-    public ScuflFiler(XBayaEngine engine) {
-        this.engine = engine;
-        this.scuflFileChooser = new JFileChooser(XBayaPathConstants.SCUFL_SCRIPT_DIRECTORY);
-        this.scuflFileChooser.addChoosableFileFilter(this.scuflFileFilter);
-    }
-
-    /**
-     * Exports a Scufl script to the local file
-     */
-    public void exportScuflScript() {
-        Workflow workflow = this.engine.getGUI().getWorkflow();
-        ScuflScript script = new ScuflScript(workflow, this.engine.getConfiguration());
-
-        // Check if there is any errors in the workflow first.
-        ArrayList<String> warnings = new ArrayList<String>();
-        if (!script.validate(warnings)) {
-            StringBuilder buf = new StringBuilder();
-            for (String warning : warnings) {
-                buf.append("- ");
-                buf.append(warning);
-                buf.append("\n");
-            }
-            this.engine.getGUI().getErrorWindow().warning(buf.toString());
-            return;
-        }
-        int returnVal = this.scuflFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
-        if (returnVal == JFileChooser.APPROVE_OPTION) {
-            File file = this.scuflFileChooser.getSelectedFile();
-            logger.debug(file.getPath());
-
-            // Put ".py" at the end of the file name
-            String path = file.getPath();
-            if (!path.endsWith(XBayaConstants.SCUFL_SCRIPT_SUFFIX)) {
-                file = new File(path + XBayaConstants.SCUFL_SCRIPT_SUFFIX);
-            }
-
-            try {
-                // Create the script.
-                script.create();
-                // Write to a file
-                IOUtil.writeToFile(script.getScript(), file);
-            } catch (IOException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
-            } catch (GraphException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
-            } catch (RuntimeException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            } catch (Error e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            }
-        }
-
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
deleted file mode 100644
index 46c567c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.generators;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import javax.swing.JFileChooser;
-import javax.swing.filechooser.FileFilter;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.ws.WSGraph;
-import org.apache.airavata.workflow.model.graph.ws.WSGraphFactory;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
-
-public class WorkflowFiler {
-
-    private static Logger logger = LoggerFactory.getLogger(WorkflowFiler.class);
-
-    private XBayaEngine engine;
-
-    private JFileChooser graphFileChooser;
-
-    private final FileFilter graphFileFilter = new FileFilter() {
-
-        @Override
-        public String getDescription() {
-            return "Workflow Files";
-        }
-
-        @Override
-        public boolean accept(File file) {
-            if (file.isDirectory()) {
-                return true;
-            }
-            String name = file.getName();
-            if (name.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
-                return true;
-            } else if (name.endsWith(XBayaConstants.WORKFLOW_FILE_SUFFIX)) {
-                return true;
-            }
-            return false;
-        }
-    };
-
-    /**
-     * Creates a FileMenu.
-     * 
-     * @param engine
-     *            the XwfClient, which is used to retrieve the current workflow graph.
-     */
-    public WorkflowFiler(XBayaEngine engine) {
-        this.engine = engine;
-
-        this.graphFileChooser = new JFileChooser(XBayaPathConstants.WORKFLOW_DIRECTORY);
-        this.graphFileChooser.addChoosableFileFilter(this.graphFileFilter);
-        this.graphFileChooser.setFileFilter(this.graphFileFilter);
-
-    }
-
-    /**
-     * Opens a current workflow from the local file.
-     */
-    public void openWorkflow() {
-        Workflow workflow = null;
-        int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());
-
-        if (returnVal == JFileChooser.APPROVE_OPTION) {
-            File file = this.graphFileChooser.getSelectedFile();
-            logger.debug(file.getPath());
-
-            try {
-                String path = file.getPath();
-
-                if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
-                    WSGraph graph = WSGraphFactory.createGraph(file);
-                    workflow = Workflow.graphToWorkflow(graph);
-                } else {
-                    XmlElement workflowElement = XMLUtil.loadXML(file);
-                    workflow = new Workflow(workflowElement);
-                }
-                GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
-                newGraphCanvas.setWorkflow(workflow);
-                //this.engine.setWorkflow(workflow);
-                engine.getGUI().getGraphCanvas().setWorkflowFile(file);
-            } catch (IOException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);
-            } catch (GraphException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
-            } catch (ComponentException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
-            } catch (RuntimeException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            } catch (Error e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            }
-        }
-        
-    }
-
-    /**
-     * Saves a current workflow to the local file.
-     */
-    public void saveWorkflow() {
-		saveWorkflow(engine.getGUI().getGraphCanvas());
-    }
-
-    public void saveAsWorkflow() {
-		GraphCanvas graphCanvas = engine.getGUI().getGraphCanvas();
-		File saveAsWorkflowFile = saveAsWorkflow(graphCanvas);
-		if (saveAsWorkflowFile!=null){
-        	graphCanvas.setWorkflowFile(saveAsWorkflowFile);
-		}
-    }
-    
-	public void saveWorkflow(GraphCanvas graphCanvas) {
-		if (graphCanvas.getWorkflowFile()==null){
-        	File saveAsWorkflowFile = saveAsWorkflow(graphCanvas);
-        	graphCanvas.setWorkflowFile(saveAsWorkflowFile);
-        }else{
-        	saveWorkflow(graphCanvas.getWorkflow(), graphCanvas.getWorkflowFile());
-        }
-		if (graphCanvas.getWorkflowFile()!=null){
-			graphCanvas.workflowSaved();
-		}
-	}
-    
-    public void saveAllWorkflows(){
-    	List<GraphCanvas> graphCanvases = engine.getGUI().getGraphCanvases();
-    	for (GraphCanvas graphCanvas : graphCanvases) {
-    		saveWorkflow(graphCanvas);
-		}
-    }
-
-	public File saveAsWorkflow(GraphCanvas graphCanvas) {
-		int returnVal = this.graphFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
-        if (returnVal == JFileChooser.APPROVE_OPTION) {
-            File file = this.graphFileChooser.getSelectedFile();
-            logger.debug(file.getPath());
-
-            // Put ".xwf" at the end of the file name
-            String path = file.getPath();
-            if (!path.endsWith(XBayaConstants.WORKFLOW_FILE_SUFFIX)) {
-                file = new File(path + XBayaConstants.WORKFLOW_FILE_SUFFIX);
-            }
-            saveWorkflow(graphCanvas.getWorkflow(),file);
-            return file;
-        }
-        return null;
-	}
-
-	private void saveWorkflow(Workflow workflow, File file) {
-		try {
-		    XMLUtil.saveXML(workflow.toXML(), file);
-		} catch (IOException e) {
-		    this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
-		} catch (RuntimeException e) {
-		    this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_SAVE_ERROR, e);
-		} catch (Error e) {
-		    this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-		}
-	}
-
-    /**
-     * Imports a workflow from the local file to the current workflow.
-     */
-    public void importWorkflow() {
-        int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());
-        if (returnVal == JFileChooser.APPROVE_OPTION) {
-            File file = this.graphFileChooser.getSelectedFile();
-            try {
-
-                String path = file.getPath();
-                Workflow importedWorkflow;
-                if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
-                    WSGraph importedGraph = WSGraphFactory.createGraph(file);
-                    importedWorkflow = Workflow.graphToWorkflow(importedGraph);
-                } else {
-                    XmlElement importedWorkflowElement = XMLUtil.loadXML(file);
-                    importedWorkflow = new Workflow(importedWorkflowElement);
-                }
-                GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
-                newGraphCanvas.setWorkflow(importedWorkflow);
-                this.engine.getGUI().setWorkflow(importedWorkflow);
-                engine.getGUI().getGraphCanvas().setWorkflowFile(file);
-
-            } catch (IOException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);
-            } catch (GraphException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
-            } catch (ComponentException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
-            } catch (RuntimeException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            } catch (Error e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            }
-        }
-    }
-    /**
-     * @param workflow
-     * @return
-     */
-    public Workflow getWorkflow() {
-        Workflow workflow = null;
-        int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());
-
-        if (returnVal == JFileChooser.APPROVE_OPTION) {
-            File file = this.graphFileChooser.getSelectedFile();
-            logger.debug(file.getPath());
-
-            try {
-                String path = file.getPath();
-
-                if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
-                    WSGraph graph = WSGraphFactory.createGraph(file);
-                    workflow = Workflow.graphToWorkflow(graph);
-                } else {
-                    XmlElement workflowElement = XMLUtil.loadXML(file);
-                    workflow = new Workflow(workflowElement);
-                }
-
-            } catch (IOException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);
-            } catch (GraphException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
-            } catch (ComponentException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
-            } catch (RuntimeException e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            } catch (Error e) {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            }
-        }
-        return workflow;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/XmlBeansFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/XmlBeansFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/XmlBeansFiler.java
deleted file mode 100644
index 2bb8381..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/XmlBeansFiler.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.generators;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.Writer;
-import java.util.LinkedList;
-import java.util.List;
-
-public class XmlBeansFiler /* implements Filer */{
-
-    private String path;
-
-    private List<File> javaFilePaths = new LinkedList<File>();
-
-    /**
-     * Constructs a XmlBeansFiler.
-     * 
-     * @param file
-     */
-    public XmlBeansFiler(String path) {
-        this.path = path + "/generated";
-    }
-
-    /**
-     * @see org.apache.xmlbeans.Filer#createBinaryFile(java.lang.String)
-     */
-    public OutputStream createBinaryFile(String name) throws IOException {
-        name = name.replace('.', File.separatorChar);
-        String binPath = this.path + File.separatorChar + name;
-        File srcFile = new File(binPath);
-        srcFile.getParentFile().mkdirs();
-        return new FileOutputStream(new File(binPath));
-    }
-
-    /**
-     * @see org.apache.xmlbeans.Filer#createSourceFile(java.lang.String)
-     */
-    public Writer createSourceFile(String name) throws IOException {
-        name = name.replace('.', File.separatorChar);
-        String srcPath = this.path + File.separatorChar + name + ".java";
-        File srcFile = new File(srcPath);
-        srcFile.getParentFile().mkdirs();
-        javaFilePaths.add(new File(srcFile.getCanonicalPath()));
-        return new FileWriter(srcFile);
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/ide/XBayaExecutionModeListener.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/ide/XBayaExecutionModeListener.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/ide/XBayaExecutionModeListener.java
deleted file mode 100644
index 9ba3ac5..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/ide/XBayaExecutionModeListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.ide;
-
-import org.apache.airavata.xbaya.XBayaConfiguration;
-
-public interface XBayaExecutionModeListener {
-	/**
-	 * Triggers when the execution mode in xbaya is changed
-	 * For possition executions modes see, 
-	 * 			XBayaConfiguration.XBayaExecutionMode
-	 * @param config - XBaya configuration object
-	 */
-	public void executionModeChanged(XBayaConfiguration config);
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/workflow/ParameterListModel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/workflow/ParameterListModel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/workflow/ParameterListModel.java
deleted file mode 100644
index 7329639..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/workflow/ParameterListModel.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.core.workflow;
-
-import java.util.Collections;
-import java.util.List;
-
-import javax.swing.AbstractListModel;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.workflow.model.graph.system.ParameterNode;
-
-public class ParameterListModel extends AbstractListModel {
-
-    private List<? extends ParameterNode> parameterNodes;
-
-    /**
-     * Constructs a ParameterListModel.
-     * 
-     * @param parameterNodes
-     * @param nodes
-     */
-    public ParameterListModel(List<? extends ParameterNode> parameterNodes) {
-        this.parameterNodes = parameterNodes;
-    }
-
-    /**
-     * @see javax.swing.ListModel#getElementAt(int)
-     */
-    public Object getElementAt(int index) {
-        return this.parameterNodes.get(index).getName();
-    }
-
-    /**
-     * @see javax.swing.ListModel#getSize()
-     */
-    public int getSize() {
-        return this.parameterNodes.size();
-    }
-
-    /**
-     * Moves the node at the index up.
-     * 
-     * @param index
-     */
-    public void up(int index) {
-        if (index < 1 || index >= this.parameterNodes.size()) {
-            throw new WorkflowRuntimeException("Illegal index: " + index);
-        }
-        swap(index - 1, index);
-    }
-
-    /**
-     * Moves the node at the index down.
-     * 
-     * @param index
-     */
-    public void down(int index) {
-        if (index < 0 || index >= this.parameterNodes.size() - 1) {
-            throw new WorkflowRuntimeException("Illegal index: " + index);
-        }
-        swap(index, index + 1);
-    }
-
-    private void swap(int index0, int index1) {
-        Collections.swap(this.parameterNodes, index0, index1);
-        fireContentsChanged(this, index0, index1);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/datadriven/WorkflowHarvester.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/datadriven/WorkflowHarvester.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/datadriven/WorkflowHarvester.java
deleted file mode 100644
index 7202999..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/datadriven/WorkflowHarvester.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.datadriven;
-
-import java.awt.Point;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.utils.Pair;
-import org.apache.airavata.workflow.model.component.system.InputComponent;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.workflow.model.graph.DataPort;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Port;
-import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.ws.WSNode;
-import org.apache.airavata.workflow.model.wf.Workflow;
-
-public class WorkflowHarvester {
-
-    public WorkflowHarvester() {
-
-    }
-
-    public Workflow[] harvest(Workflow workflow, QName dataType) {
-        LinkedList<Workflow> harvest = new LinkedList<Workflow>();
-        LinkedList<Pair<String, String>> candidates = getCandidates(workflow, dataType);
-        for (Pair<String, String> pair : candidates) {
-            Workflow clone = workflow.clone();
-
-            NodeImpl node = clone.getGraph().getNode(pair.getLeft());
-            if (null == node) {
-                throw new WorkflowRuntimeException("Specified node not found:" + pair.getLeft());
-            }
-            Port candidatePort = null;
-            List<DataPort> inPorts = node.getInputPorts();
-            for (DataPort dataPort : inPorts) {
-                if (pair.getRight().equals(dataPort.getID())) {
-                    candidatePort = dataPort;
-                    break;
-                }
-            }
-            if (null == candidatePort) {
-                throw new WorkflowRuntimeException("Specifies Port was not found:" + pair.getRight());
-            }
-            if (!(candidatePort.getFromNode() instanceof InputNode)) {
-                removeUnnecessaryNodes(node, candidatePort, clone);
-                Node input = clone.addNode(new InputComponent());
-                input.setPosition(new Point(Math.max(0, node.getPosition().x - 150), node.getPosition().y));
-
-                // the returned workflows size should be less than that of the
-                // original
-                if (clone.getGraph().getNodes().size() < workflow.getGraph().getNodes().size()
-                // if the sizes the different its a candidate, but need
-                // to make sure
-                // its not the same as one already harvested
-                        && !isWorkflowAlreadyHarvested(harvest, clone)) {
-                    try {
-                        clone.getGraph().addEdge(input.getOutputPort(0), candidatePort);
-                        cleanLeftOverInputNodes(clone);
-                    } catch (GraphException e) {
-                        throw new RuntimeException(e);
-                    }
-
-                    harvest.add(clone);
-                }
-
-            }
-        }
-        return harvest.toArray(new Workflow[0]);
-    }
-
-    /**
-     * @param clone
-     */
-    private void cleanLeftOverInputNodes(Workflow clone) {
-
-        List<NodeImpl> nodes = clone.getGraph().getNodes();
-        LinkedList<Node> removeList = new LinkedList<Node>();
-        for (Node nodeImpl : nodes) {
-            if (nodeImpl instanceof InputNode) {
-                if (nodeImpl.getOutputPort(0).getToNodes().size() == 0) {
-                    removeList.add(nodeImpl);
-                }
-            }
-        }
-        for (Node node : removeList) {
-            try {
-                clone.removeNode(node);
-            } catch (GraphException e) {
-                throw new WorkflowRuntimeException(e);
-            }
-        }
-    }
-
-    /**
-     * @param harvest
-     * @param clone
-     * @return
-     */
-    private boolean isWorkflowAlreadyHarvested(LinkedList<Workflow> harvest, Workflow clone) {
-        for (Workflow workflow : harvest) {
-            if (workflow.equals(clone)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * @param pair
-     * @param clone
-     */
-    private void removeUnnecessaryNodes(Node node, Port candidatePort, Workflow workflow) {
-        if (candidatePort.getFromPort().getEdges().size() == 1) {
-            Node fromNode = candidatePort.getFromNode();
-            try {
-                List<DataPort> inputPorts = fromNode.getInputPorts();
-                for (DataPort dataPort : inputPorts) {
-                    removeUnnecessaryNodes(fromNode, dataPort, workflow);
-                }
-                workflow.removeNode(fromNode);
-            } catch (GraphException e) {
-                throw new WorkflowRuntimeException(e);
-            }
-        }
-    }
-
-    /**
-     * @param pair
-     * @return
-     */
-    private List<DataPort> getRemainderPorts(Pair<WSNode, DataPort> pair) {
-        LinkedList<DataPort> ret = new LinkedList<DataPort>();
-        List<DataPort> inputPorts = pair.getLeft().getInputPorts();
-        for (DataPort dataPort : inputPorts) {
-            if (pair.getRight() != dataPort) {
-                ret.add(dataPort);
-            }
-        }
-        return ret;
-    }
-
-    /**
-     * @param workflow
-     * @param dataType
-     * @return pair of nodeid and portid
-     */
-    private LinkedList<Pair<String, String>> getCandidates(Workflow workflow, QName dataType) {
-        LinkedList<Pair<String, String>> candidates = new LinkedList<Pair<String, String>>();
-        List<NodeImpl> nodes = workflow.getGraph().getNodes();
-        for (NodeImpl node : nodes) {
-            if (node instanceof WSNode) {
-                List<DataPort> inputPorts = ((WSNode) node).getInputPorts();
-                for (DataPort dataPort : inputPorts) {
-
-                    if (dataType.equals(dataPort.getType())) {
-                        candidates.add(new Pair<String, String>(node.getID(), dataPort.getID()));
-                    }
-
-                }
-            }
-        }
-
-        return candidates;
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/XBayaPathConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/XBayaPathConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/XBayaPathConstants.java
deleted file mode 100644
index 659b30b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/XBayaPathConstants.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.file;
-
-import java.io.File;
-
-public interface XBayaPathConstants {
-
-    /**
-     * Root directory of the server.
-     */
-    public static final String XBAYA_DIRECTORY = "modules" + File.separator + "xbaya-gui";
-
-    /**
-     * The path of the directory that stores component definitions.
-     */
-    public static final String WSDL_DIRECTORY = XBAYA_DIRECTORY + File.separator + "src" + File.separator + "main"
-            + File.separator + "resources" + File.separator + "wsdls";
-
-    /**
-     * The path of the directory that stores graphs.
-     */
-    public static final String WORKFLOW_DIRECTORY = XBAYA_DIRECTORY + File.separator + "workflows";
-
-    /**
-     * The path of the directory where the scripts are saved.
-     */
-    public static final String SCRIPT_DIRECTORY = XBAYA_DIRECTORY + File.separator + "scripts";
-
-    /**
-     * The path of the directory where the BPEL scripts are saved.
-     */
-    public static final String JYTHON_SCRIPT_DIRECTORY = SCRIPT_DIRECTORY + File.separator + "jython";
-
-    /**
-     * The path of the directory where the BPEL scripts are saved.
-     */
-    public static final String BPEL_SCRIPT_DIRECTORY = SCRIPT_DIRECTORY + File.separator + "bpel";
-
-    /**
-     * The path of the directory where the scufl scripts are saved.
-     */
-    public static final String SCUFL_SCRIPT_DIRECTORY = SCRIPT_DIRECTORY + File.separator + "scufl";
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java
deleted file mode 100644
index cdb4c8a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.gfac;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.xmlpull.v1.builder.Iterable;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.impl.WSIFMessageElement;
-
-public class GFacRegistryClient {
-
-    /**
-     * GFAC_NAMESPACE
-     */
-    public static final String GFAC_NAMESPACE = "http://www.extreme.indiana.edu/namespaces/2004/01/gFac";
-
-    private static final String SEARCH_SERVICE_INSTANCE = "searchServiceInstance";
-
-    private static final String SEARCH_SERVIE = "searchService";
-
-    private static final String QNAME = "qname";
-
-    private static final String DESC_AS_STRING = "descAsStr";
-
-    private static final String LIFE_TIME = "lifetimeAsSeconds";
-
-    private static final String RESULTS = "results";
-
-    private static final String GET_ABSTRACT_WSDL = "getAbstractWsdl";
-
-    private String wsdlURL;
-
-    private SimpleWSClient client;
-
-    /**
-     * Constructs a GFacRegistryClient.
-     * 
-     * @param wsdlURL
-     */
-    public GFacRegistryClient(URI wsdlURL) {
-        this(wsdlURL.toString());
-    }
-
-    /**
-     * Constructs a GfacRegistryClient.
-     * 
-     * @param wsdlURL
-     */
-    public GFacRegistryClient(String wsdlURL) {
-        this.wsdlURL = wsdlURL;
-        this.client = new SimpleWSClient();
-    }
-
-    /**
-     * @param appDescAsStr
-     * @throws ComponentRegistryException
-     */
-    public void registerAppDesc(String appDescAsStr) throws ComponentRegistryException {
-        this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { DESC_AS_STRING, appDescAsStr } },
-                "registerAppDesc");
-    }
-
-    /**
-     * @param wsdlAsStr
-     * @param lifetimeAsSeconds
-     * @throws ComponentRegistryException
-     */
-    public void registerConcreteWsdl(String wsdlAsStr, int lifetimeAsSeconds) throws ComponentRegistryException {
-        this.client.sendSOAPMessage(this.wsdlURL,
-                new String[][] { { DESC_AS_STRING, wsdlAsStr }, { LIFE_TIME, String.valueOf(lifetimeAsSeconds) } },
-                "registerConcreteWsdl");
-
-    }
-
-    /**
-     * @param wsdlQName
-     * @return The concrete WSDL
-     * @throws ComponentRegistryException
-     */
-    public String getConcreteWsdl(String wsdlQName) throws ComponentRegistryException {
-        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, wsdlQName } },
-                "getConcreateWsdl");
-        return (String) response.getObjectPart(DESC_AS_STRING);
-    }
-
-    /**
-     * @param wsdlQName
-     * @throws ComponentRegistryException
-     */
-    public void removeConcreteWsdl(String wsdlQName) throws ComponentRegistryException {
-        this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, wsdlQName } }, "removeConcreteWsdl");
-
-    }
-
-    /**
-     * @param serviceName
-     * @return The list of concreate WSDL QNames.
-     * @throws ComponentRegistryException
-     */
-    public String[] findService(String serviceName) throws ComponentRegistryException {
-        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, serviceName } },
-                SEARCH_SERVICE_INSTANCE);
-        return findArrayValue(RESULTS, (WSIFMessageElement) response).toArray(new String[] {});
-    }
-
-    /**
-     * @param serviceName
-     * @return The list of abstract WSDL QNames.
-     * @throws ComponentRegistryException
-     */
-    public String[] findServiceDesc(String serviceName) throws ComponentRegistryException {
-        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, serviceName } },
-                SEARCH_SERVIE);
-        return findArrayValue(RESULTS, (WSIFMessageElement) response).toArray(new String[] {});
-    }
-
-    /**
-     * @param wsdlQName
-     * @return The AWSDL.
-     * @throws ComponentRegistryException
-     */
-    public String getAbstractWsdl(String wsdlQName) throws ComponentRegistryException {
-        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, wsdlQName } },
-                GET_ABSTRACT_WSDL);
-        return (String) response.getObjectPart(DESC_AS_STRING);
-    }
-
-    private static ArrayList<String> findArrayValue(String name, WSIFMessageElement response) {
-        XmlElement param = response.element(null, name);
-        if (param != null) {
-            Iterable it = param.elements(null, "value");
-            if (it != null) {
-                ArrayList<String> values = new ArrayList<String>();
-
-                Iterator arrayValues = it.iterator();
-                while (arrayValues.hasNext()) {
-                    values.add(((XmlElement) arrayValues.next()).requiredTextContent());
-                }
-                return values;
-            }
-        }
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java
deleted file mode 100644
index 9d9b6e2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.gfac;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-import org.xmlpull.v1.builder.XmlInfosetBuilder;
-
-import xsul.XmlConstants;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.wsif.impl.WSIFMessageElement;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-
-/**
- * This is a Simple Web Service client for easy SOAP Messages creation
- * 
- */
-public class SimpleWSClient {
-
-    private static final Logger logger = LoggerFactory.getLogger(SimpleWSClient.class);
-
-    private static final XmlInfosetBuilder builder = XmlConstants.BUILDER;
-
-    private String requestNS = GFacRegistryClient.GFAC_NAMESPACE;
-
-    /**
-     * @param url
-     * @param args
-     * @param opName
-     * @return The output
-     * @throws ComponentRegistryException
-     */
-    public WSIFMessage sendSOAPMessage(String url, Object[][] args, String opName) throws ComponentRegistryException {
-        WSIFClient wclient = WSIFRuntime.newClient(url);
-        return sendSOAPMessage(wclient, args, opName);
-    }
-
-    /**
-     * @param wclient
-     * @param args
-     * @param opName
-     * @return The output
-     * @throws ComponentRegistryException
-     */
-    public WSIFMessage sendSOAPMessage(WSIFClient wclient, Object[][] args, String opName)
-            throws ComponentRegistryException {
-
-        WSIFPort port = wclient.getPort();
-
-        WSIFOperation operation = port.createOperation(opName);
-        WSIFMessage outputMessage = operation.createOutputMessage();
-        WSIFMessage faultMessage = operation.createFaultMessage();
-        String messageName = operation.createInputMessage().getName();
-        XmlElement inputMsgElem = builder.newFragment(this.requestNS, messageName);
-
-        for (int i = 0; i < args.length; i++) {
-            createMessage((String) args[i][0], args[i][1], inputMsgElem);
-        }
-
-        WSIFMessageElement inputMessage = new WSIFMessageElement(inputMsgElem);
-
-        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
-        if (success) {
-            logger.debug("" + outputMessage);
-            return outputMessage;
-        } else {
-            throw new ComponentRegistryException("Excpetion at server " + faultMessage);
-        }
-    }
-
-    private void createMessage(String paramName, Object value, XmlElement inputMsgElem)
-            throws ComponentRegistryException {
-        XmlElement paramsElem = builder.newFragment(this.requestNS, paramName);
-        if (value instanceof String) {
-            paramsElem.addChild(value);
-        } else if (value instanceof Collection) {
-            Collection list = (Collection) value;
-            Iterator arrayValues = list.iterator();
-            while (arrayValues.hasNext()) {
-                XmlElement item = builder.newFragment("value");
-                item.addChild(arrayValues.next());
-                paramsElem.addChild(item);
-            }
-        } else if (value instanceof ArrayList) {
-            Collection list = (Collection) value;
-            Iterator arrayValues = list.iterator();
-            while (arrayValues.hasNext()) {
-                XmlElement item = builder.newFragment("value");
-                item.addChild(arrayValues.next());
-                paramsElem.addChild(item);
-            }
-        } else if (value instanceof String[]) {
-            String[] list = (String[]) value;
-            for (int i = 0; i < list.length; i++) {
-                XmlElement item = builder.newFragment("value");
-                item.addChild(list[i]);
-                paramsElem.addChild(item);
-            }
-        } else {
-            throw new ComponentRegistryException("Simple WS Client can not handle the value of type " + value);
-        }
-
-        inputMsgElem.addElement(paramsElem);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/FileTransferConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/FileTransferConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/FileTransferConstants.java
deleted file mode 100644
index f40256e..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/FileTransferConstants.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.globus;
-
-public class FileTransferConstants {
-    public static final String DATA_TYPE = "DATA_TYPE";
-    public static final String TRANSFER = "transfer";
-    public static final String SUBMISSION_ID = "submission_id";
-    public static final String TRANSFER_ITEM = "transfer_item";
-    public static final String SOURCE_ENDPOINT = "source_endpoint";
-    public static final String SOURCE_PATH = "source_path";
-    public static final String DESTINATION_ENDPOINT = "destination_endpoint";
-    public static final String DESTINATION_PATH = "destination_path";
-    public static final String DATA = "DATA";
-    public static final String SUBMISSION_ID_ENDPOINT = "/transfer/submission_id";
-    public static final String VALUE = "value";
-    public static final String TRANSFER_ENDPOINT = "/transfer";
-    public static final String TASK_ID = "task_id";
-}


[90/90] [abbrv] git commit: Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata

Posted by sa...@apache.org.
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/airavata


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/b7122a9d
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/b7122a9d
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/b7122a9d

Branch: refs/heads/master
Commit: b7122a9d21726b145c35df9e0dcdf51feeda0538
Parents: 9c47eec bb0f710
Author: Saminda Wijeratne <sa...@gmail.com>
Authored: Mon Apr 14 11:29:25 2014 -0700
Committer: Saminda Wijeratne <sa...@gmail.com>
Committed: Mon Apr 14 11:29:25 2014 -0700

----------------------------------------------------------------------
 README                                                         | 4 ++--
 RELEASE_NOTES                                                  | 5 +++++
 .../apache/airavata/client/samples/CreateLaunchExperiment.java | 6 +++---
 .../orchestrator/server/OrchestratorServerHandler.java         | 4 ++--
 4 files changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------



[75/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInvokerWrapperForGFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInvokerWrapperForGFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInvokerWrapperForGFacInvoker.java
new file mode 100644
index 0000000..9ca5669
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInvokerWrapperForGFacInvoker.java
@@ -0,0 +1,233 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.invoker;
+
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsif.WSIFMessage;
+
+public class WorkflowInvokerWrapperForGFacInvoker extends GFacInvoker {
+
+    private static final Logger logger = LoggerFactory.getLogger(WorkflowInvokerWrapperForGFacInvoker.class);
+
+    private ServiceNotifiable notifier;
+
+    private String serviceInformation;
+
+    private Future<Boolean> result;
+
+    protected boolean failerSent = false;
+
+    public WorkflowInvokerWrapperForGFacInvoker(QName portTypeQName, String gfacURL, String messageBoxURL,
+            LeadContextHeader leadcontext, ServiceNotifiable serviceNotificationSender) {
+        super(portTypeQName, gfacURL, messageBoxURL, leadcontext);
+        this.notifier = serviceNotificationSender;
+        this.serviceInformation = portTypeQName.toString();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#invoke()
+     */
+    public synchronized boolean invoke() throws WorkflowException {
+
+        try {
+            WSIFMessage inputMessage = super.getInputs();
+            logger.debug("inputMessage: " + XMLUtil.xmlElementToString((XmlElement) inputMessage));
+            this.notifier.invokingService(inputMessage);
+
+            ExecutorService executor = Executors.newSingleThreadExecutor();
+            this.result = executor.submit(new Callable<Boolean>() {
+                @SuppressWarnings("boxing")
+                public Boolean call() {
+                    try {
+                        boolean success = WorkflowInvokerWrapperForGFacInvoker.super.invoke();
+                        if (success) {
+                            // Send notification
+                            WSIFMessage outputMessage = WorkflowInvokerWrapperForGFacInvoker.super.getOutputs();
+                            // An implementation of WSIFMessage,
+                            // WSIFMessageElement, implements toString(), which
+                            // serialize the message XML.
+                            logger.debug("outputMessage: " + outputMessage);
+                            WorkflowInvokerWrapperForGFacInvoker.this.notifier.serviceFinished(outputMessage);
+                        } else {
+                            WSIFMessage faultMessage = WorkflowInvokerWrapperForGFacInvoker.super.getFault();
+                            // An implementation of WSIFMessage,
+                            // WSIFMessageElement, implements toString(), which
+                            // serialize the message XML.
+                            logger.debug("received fault: " + faultMessage);
+                            WorkflowInvokerWrapperForGFacInvoker.this.notifier.receivedFault(faultMessage);
+                            WorkflowInvokerWrapperForGFacInvoker.this.failerSent = true;
+                        }
+                        return success;
+                    } catch (WorkflowException e) {
+                        logger.error(e.getMessage(), e);
+                        // An appropriate message has been set in the exception.
+                        WorkflowInvokerWrapperForGFacInvoker.this.notifier.invocationFailed(e.getMessage(), e);
+                        WorkflowInvokerWrapperForGFacInvoker.this.failerSent = true;
+                        throw new WorkflowRuntimeException(e);
+                    } catch (RuntimeException e) {
+                        logger.error(e.getMessage(), e);
+                        String message = "Error in invoking a service: "
+                                + WorkflowInvokerWrapperForGFacInvoker.this.serviceInformation;
+                        WorkflowInvokerWrapperForGFacInvoker.this.notifier.invocationFailed(message, e);
+                        WorkflowInvokerWrapperForGFacInvoker.this.failerSent = true;
+                        throw e;
+                    }
+                }
+            });
+
+            // Kill the thread inside of executor. This is necessary for Jython
+            // script to finish.
+            executor.shutdown();
+
+            // Let other threads know that job has been submitted.
+            notifyAll();
+
+            // Check if the invocation itself fails. This happens immediately.
+            try {
+                this.result.get(100, TimeUnit.MILLISECONDS);
+            } catch (InterruptedException e) {
+                logger.error(e.getMessage(), e);
+            } catch (TimeoutException e) {
+                // The job is probably running fine.
+                // The normal case.
+                return true;
+            } catch (ExecutionException e) {
+                // The service-failed notification should have been sent
+                // already.
+                logger.error(e.getMessage(), e);
+                String message = "Error in invoking a service: " + this.serviceInformation;
+                throw new WorkflowException(message, e);
+            }
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error in invoking a service: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+
+        boolean success = super.invoke();
+        if (!success) {
+            try {
+                throw new Exception("Failed invoking GFac");
+            } catch (Exception e) {
+                notifier.invocationFailed(super.getFault().toString(), e);
+            }
+
+        } else {
+            notifier.serviceFinished(super.getOutputs());
+        }
+        return success;
+    }
+
+    public synchronized void waitToFinish() throws WorkflowException {
+        try {
+            while (this.result == null) {
+                // The job is not submitted yet.
+                try {
+                    wait();
+                } catch (InterruptedException e) {
+                    logger.error(e.getMessage(), e);
+                }
+            }
+            // Wait for the job to finish.
+            Boolean success = this.result.get();
+            if (success == false) {
+                WSIFMessage faultMessage = super.getFault();
+                String message = "Error in a service: ";
+                // An implementation of WSIFMessage,
+                // WSIFMessageElement, implements toString(), which
+                // serialize the message XML.
+                message += faultMessage.toString();
+                throw new WorkflowException(message);
+            }
+        } catch (InterruptedException e) {
+            logger.error(e.getMessage(), e);
+        } catch (ExecutionException e) {
+            // The service-failed notification should have been sent already.
+            logger.error(e.getMessage(), e);
+            String message = "Error in invoking a service: " + this.serviceInformation;
+            throw new WorkflowException(message, e);
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error while waiting for a service to finish: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    public Object getOutput(String name) throws WorkflowException {
+        try {
+            waitToFinish();
+            Object output = super.getOutput(name);
+            if (output instanceof XmlElement) {
+                logger.debug("output: " + XMLUtil.xmlElementToString((XmlElement) output));
+            }
+            return output;
+        } catch (WorkflowException e) {
+            logger.error(e.getMessage(), e);
+            // An appropriate message has been set in the exception.
+            if (!this.failerSent) {
+                this.notifier.invocationFailed(e.getMessage(), e);
+            }
+            throw e;
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error while waiting for a output: " + name;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java
new file mode 100644
index 0000000..75d5677
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java
@@ -0,0 +1,90 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.invoker.factory;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.xbaya.invoker.AsynchronousInvoker;
+import org.apache.airavata.xbaya.invoker.GFacInvoker;
+import org.apache.airavata.xbaya.invoker.Invoker;
+import org.apache.airavata.xbaya.invoker.SimpleInvoker;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsdl.WsdlDefinitions;
+
+public class InvokerFactory {
+
+    /**
+     * @param portTypeQName
+     * @param definitions
+     * @param gfacURL
+     * @param messageBoxURL
+     * @return The invoker
+     * @throws WorkflowException
+     */
+    public static Invoker createInvoker(QName portTypeQName, WsdlDefinitions definitions, String gfacURL,
+            String messageBoxURL, LeadContextHeader leadContext) throws WorkflowException {
+        Invoker invoker = null;
+
+        if (definitions != null && definitions.getServices().iterator().hasNext()) {
+            // check if this web service supports asynchronous invocation
+            if (WSDLUtil.isAsynchronousSupported(WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(definitions))) {
+                invoker = new AsynchronousInvoker(definitions, messageBoxURL);
+            } else {
+                invoker = new SimpleInvoker(definitions);
+            }
+        } else if (gfacURL != null && gfacURL.length() != 0) {
+            invoker = new GFacInvoker(portTypeQName, gfacURL, messageBoxURL, leadContext);
+        }
+
+        if (invoker == null) {
+            String message = "Cannot find an appropriate way to invoke the service";
+            throw new WorkflowException(message);
+        }
+        return invoker;
+    }
+
+    public static Invoker createInvoker(QName portTypeQName, WsdlDefinitions definitions, String gfacURL,
+            String messageBoxURL, WorkflowContextHeaderBuilder builder, boolean differ) throws WorkflowException {
+        Invoker invoker = null;
+
+        if (definitions != null && definitions.getServices().iterator().hasNext()) {
+            // check if this web service supports asynchronous invocation
+            if (WSDLUtil.isAsynchronousSupported(WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(definitions))) {
+                invoker = new AsynchronousInvoker(definitions, messageBoxURL);
+            } else {
+                invoker = new SimpleInvoker(definitions);
+            }
+        } else if (gfacURL != null && gfacURL.length() != 0) {
+            invoker = new GFacInvoker(portTypeQName, gfacURL, messageBoxURL, builder);
+        }
+
+        if (invoker == null) {
+            String message = "Cannot find an appropriate way to invoke the service";
+            throw new WorkflowException(message);
+        }
+        return invoker;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/GFacServiceCreator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/GFacServiceCreator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/GFacServiceCreator.java
new file mode 100644
index 0000000..66685ba
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/GFacServiceCreator.java
@@ -0,0 +1,168 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.lib;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.wsdl.WsdlDefinitions;
+import xsul.wsdl.WsdlResolver;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.wsif.WSIFService;
+import xsul.wsif.WSIFServiceFactory;
+import xsul.wsif.spi.WSIFProviderManager;
+
+public class GFacServiceCreator {
+
+    private static final String CREATE_SERVICE_OPERATION = "CreateService";
+
+    private static final String SHUTDOWN_OPERATION = "Shutdown";
+
+    private static final String SERVICE_QNAME_PART = "serviceQName";
+
+    private static final String SECURITY_PART = "security";
+
+    private static final String WSDL_PART = "WSDL";
+
+    private static final String SECURITY_NONE = "None";
+
+    private static final Logger logger = LoggerFactory.getLogger(GFacServiceCreator.class);
+
+    private WSIFOperation gFacOperation;
+
+    private WsdlDefinitions serviceDefinitions;
+
+    static {
+        WSIFProviderManager.getInstance().addProvider(new xsul.wsif_xsul_soap_http.Provider());
+    }
+
+    /**
+     * Constructs a GFacServiceCreater.
+     * 
+     * @param wsdlURL
+     *            The URL of the GFac service
+     * @throws URISyntaxException
+     * @throws WorkflowException
+     */
+    public GFacServiceCreator(String wsdlURL) throws URISyntaxException, WorkflowException {
+        this(new URI(wsdlURL));
+    }
+
+    /**
+     * Constructs a GFacServiceCreater.
+     * 
+     * @param wsdlURI
+     *            The URI of the GFac service
+     * @throws WorkflowException
+     */
+    public GFacServiceCreator(URI wsdlURI) throws WorkflowException {
+        try {
+            WsdlDefinitions definitions = WsdlResolver.getInstance().loadWsdl(wsdlURI);
+            WSIFService service = WSIFServiceFactory.newInstance().getService(definitions);
+            WSIFPort port = service.getPort();
+            this.gFacOperation = port.createOperation(CREATE_SERVICE_OPERATION);
+        } catch (RuntimeException e) {
+            String message = "Failed to connect to the Generic Factory: " + wsdlURI;
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     * @param serviceQName
+     * @return The WSDL definitions of the service created.
+     * @throws WorkflowException
+     */
+    public WsdlDefinitions createService(QName serviceQName) throws WorkflowException {
+        return createService(serviceQName.toString());
+    }
+
+    /**
+     * @param serviceQName
+     * @return The WSDL definitions of the service created.
+     * @throws WorkflowException
+     */
+    public WsdlDefinitions createService(String serviceQName) throws WorkflowException {
+        logger.debug(serviceQName);
+        try {
+            WSIFMessage inputMessage = this.gFacOperation.createInputMessage();
+            WSIFMessage outputMessage = this.gFacOperation.createOutputMessage();
+            WSIFMessage faultMessage = this.gFacOperation.createFaultMessage();
+
+            inputMessage.setObjectPart(SERVICE_QNAME_PART, serviceQName);
+            inputMessage.setObjectPart(SECURITY_PART, SECURITY_NONE);
+
+            logger.debug("inputMessage: " + inputMessage);
+            boolean success = this.gFacOperation.executeRequestResponseOperation(inputMessage, outputMessage,
+                    faultMessage);
+            if (!success) {
+                // An implementation of WSIFMessage, WSIFMessageElement,
+                // implements toString(), which serialize the message XML.
+                String message = "Failed to create a service: " + faultMessage.toString();
+                throw new WorkflowException(message);
+            }
+
+            String wsdl = (String) outputMessage.getObjectPart(WSDL_PART);
+            logger.debug("WSDL: " + wsdl);
+
+            XmlElement definitionsElement = XMLUtil.stringToXmlElement3(wsdl);
+
+            this.serviceDefinitions = new WsdlDefinitions(definitionsElement);
+            return this.serviceDefinitions;
+        } catch (RuntimeException e) {
+            String message = "Failed to create a service";
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     * Shutdowns the service created.
+     * 
+     * @throws WorkflowException
+     */
+    public void shutdownService() throws WorkflowException {
+        WSIFService service = WSIFServiceFactory.newInstance().getService(this.serviceDefinitions);
+        WSIFPort port = service.getPort();
+        WSIFOperation operation = port.createOperation(SHUTDOWN_OPERATION);
+
+        WSIFMessage inputMessage = operation.createInputMessage();
+        WSIFMessage outputMessage = operation.createOutputMessage();
+        WSIFMessage faultMessage = operation.createFaultMessage();
+
+        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
+        if (!success) {
+            // An implementation of WSIFMessage, WSIFMessageElement,
+            // implements toString(), which serialize the message XML.
+            String message = "Failed to shutdown the service: " + faultMessage.toString();
+            throw new WorkflowException(message);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
new file mode 100644
index 0000000..f478e18
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
@@ -0,0 +1,289 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.lib;
+
+import java.net.URI;
+import java.util.Properties;
+
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+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.axis2.addressing.EndpointReference;
+import org.python.core.PyObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+public class NotificationSender implements WorkflowNotifiable {
+
+    protected static final Logger logger = LoggerFactory.getLogger(NotificationSender.class);
+
+    protected WorkflowNotifier notifier;
+
+    protected String brokerURL;
+
+    protected String topic;
+
+    protected URI workflowID;
+
+    protected InvocationEntity initiator;
+
+    protected InvocationEntity receiver;
+
+    protected InvocationContext invocationContext;
+
+    protected EndpointReference eventSink;
+
+    protected WorkflowTrackingContext context;
+
+    /**
+     * Constructs a NotificationSender.
+     * 
+     * @param brokerURL
+     * @param topic
+     */
+    public NotificationSender(URI brokerURL, String topic) {
+        this(brokerURL.toString(), topic);
+    }
+
+    /**
+     * Creates a NotificationSender.
+     * 
+     * @param brokerURL
+     *            The location of notification brokerUrl.
+     * @param topic
+     *            The notification topic.
+     */
+    public NotificationSender(String brokerURL, String topic) {
+        logger.debug("brokerURL:" + brokerURL + "topic:" + topic);
+        this.topic = topic;
+        this.brokerURL = brokerURL;
+        this.workflowID = URI.create(StringUtil.convertToJavaIdentifier(this.topic));
+        this.eventSink = new EndpointReference(this.brokerURL);
+        Properties props = new Properties();
+
+        this.notifier = NotifierFactory.createNotifier();
+        URI initiatorWorkflowID = null;
+        URI initiatorServiceID = URI.create(StringUtil.convertToJavaIdentifier(topic));
+        String initiatorWorkflowNodeID = null;
+        Integer initiatorWorkflowTimeStep = null;
+        this.context = this.notifier.createTrackingContext(props, brokerURL, initiatorWorkflowID, initiatorServiceID,
+                initiatorWorkflowNodeID, initiatorWorkflowTimeStep);
+        this.context.setTopic(topic);
+        this.initiator = this.notifier.createEntity(initiatorWorkflowID, initiatorServiceID, initiatorWorkflowNodeID,
+                initiatorWorkflowTimeStep);
+
+        URI receiverWorkflowID = this.workflowID;
+        URI receiverServiceID = this.workflowID;
+        String receiverWorkflowNodeID = null;
+        Integer receiverWorkflowTimeStep = null;
+        this.receiver = this.notifier.createEntity(receiverWorkflowID, receiverServiceID, receiverWorkflowNodeID,
+                receiverWorkflowTimeStep);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#getEventSink()
+     */
+    @Override
+    public EndpointReference getEventSink() {
+        return this.eventSink;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowStarted(org.python.core.PyObject[],
+     * java.lang.String[])
+     */
+    @Override
+    public void workflowStarted(PyObject[] args, String[] keywords) {
+        String message = "";
+        for (int i = 0; i < args.length; i++) {
+            if (i != 0) {
+                message += ", ";
+            }
+            message += keywords[i] + "=" + args[i];
+        }
+        this.invocationContext = this.notifier.workflowInvoked(this.context, this.initiator, message);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowStarted(java.lang.Object[],
+     * java.lang.String[])
+     */
+    @Override
+    public void workflowStarted(Object[] args, String[] keywords) {
+        String message = "";
+        for (int i = 0; i < args.length; i++) {
+            if (i != 0) {
+                message += ", ";
+            }
+            message += keywords[i] + "=" + args[i];
+        }
+        this.invocationContext = this.notifier.workflowInvoked(this.context, this.initiator, message);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFinished(java.lang.Object[],
+     * java.lang.String[])
+     */
+    @Override
+    public void workflowFinished(Object[] args, String[] keywords) {
+        String message = "";
+        for (int i = 0; i < args.length; i++) {
+            if (i != 0) {
+                message += ", ";
+            }
+            message += keywords[i] + "=" + args[i];
+        }
+        this.notifier.sendingResult(context, this.invocationContext, message);
+        this.notifier.workflowTerminated(context, this.workflowID, "Workflow finished successfully.");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#sendingPartialResults(java.lang.Object[],
+     * java.lang.String[])
+     */
+    @Override
+    public void sendingPartialResults(Object[] args, String[] keywords) {
+        String message = "";
+        for (int i = 0; i < args.length; i++) {
+            if (i != 0) {
+                message += ", ";
+            }
+            message += keywords[i] + "=" + args[i];
+        }
+        this.notifier.sendingResult(context, this.invocationContext, message);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFinished(org.python.core.PyObject[],
+     * java.lang.String[])
+     */
+    @Override
+    public void workflowFinished(PyObject[] args, String[] keywords) {
+        String message = "";
+        for (int i = 0; i < args.length; i++) {
+            if (i != 0) {
+                message += ", ";
+            }
+            message += keywords[i] + "=" + args[i];
+        }
+        this.notifier.sendingResult(context, this.invocationContext, message);
+        this.notifier.workflowTerminated(context, this.workflowID, "Workflow Execution Finished.");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowTerminated()
+     */
+    @Override
+    public void workflowTerminated() {
+        this.notifier.workflowTerminated(context, this.workflowID, "Workflow Execution Finished.");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFailed(java.lang.String)
+     */
+    @Override
+    public void workflowFailed(String message) {
+        workflowFailed(message, null);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFailed(java.lang.Throwable)
+     */
+    @Override
+    public void workflowFailed(Throwable e) {
+        workflowFailed(null, e);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFailed(java.lang.String,
+     * java.lang.Throwable)
+     */
+    @Override
+    public void workflowFailed(String message, Throwable e) {
+        if(e != null)
+            logger.error(e.getMessage(), e);
+        if (message == null || "".equals(message)) {
+            message = "Error";
+        }
+        if (e != null) {
+            message += ": " + e.toString();
+        }
+        if (e != null) {
+            String stackTrace = StringUtil.getStackTraceInString(e);
+            XmlElement stackTraceElement = XMLUtil.BUILDER.newFragment("stackTrace");
+            stackTraceElement.addChild(stackTrace);
+            this.notifier.sendingFault(context, this.invocationContext, message,
+                    XMLUtil.xmlElementToString(stackTraceElement));
+        } else {
+            this.notifier.sendingFault(context, this.invocationContext, message);
+        }
+    }
+
+    public void info(String message) {
+        this.notifier.info(context, message);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#createServiceNotificationSender(java.lang.String)
+     */
+    @Override
+    public ServiceNotifiable createServiceNotificationSender(String nodeID) {
+        return new ServiceNotificationSender(this.notifier, this.eventSink, this.initiator, this.workflowID, nodeID,
+                this.context,this.invocationContext);
+    }
+
+    @Override
+    public void cleanup(){
+        this.notifier.delete();
+    }
+
+    public String getTopic() {
+        return topic;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotifiable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotifiable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotifiable.java
new file mode 100644
index 0000000..1865d9c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotifiable.java
@@ -0,0 +1,82 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.lib;
+
+import java.net.URI;
+
+import org.apache.axis2.addressing.EndpointReference;
+
+import xsul.wsif.WSIFMessage;
+
+public interface ServiceNotifiable {
+
+    /**
+     * @param serviceID
+     */
+    public abstract void setServiceID(String serviceID);
+
+    /**
+     * @return The event sink.
+     */
+    public abstract EndpointReference getEventSink();
+
+    /**
+     * @return The workflow ID.
+     */
+    public abstract URI getWorkflowID();
+
+    /**
+     * @param inputs
+     */
+    public abstract void invokingService(WSIFMessage inputs);
+
+    /**
+     * @param outputs
+     */
+    public abstract void serviceFinished(WSIFMessage outputs);
+
+    /**
+     * Sends an InvokeServiceFinishedFailed notification message.
+     * 
+     * @param message
+     *            The message to send
+     * @param e
+     */
+    public abstract void invocationFailed(String message, Throwable e);
+
+    /**
+     * Sends a receivedFault notification message.
+     * 
+     * @param message
+     *            The message to send
+     */
+    @Deprecated
+    public abstract void receivedFault(String message);
+
+    /**
+     * Sends a receivedFault notification message.
+     * 
+     * @param fault
+     */
+    public abstract void receivedFault(WSIFMessage fault);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java
new file mode 100644
index 0000000..36b79bf
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java
@@ -0,0 +1,293 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.lib;
+
+import java.net.URI;
+import java.util.Iterator;
+
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+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.workflow.tracking.impl.state.InvocationContextImpl;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.xmlbeans.XmlException;
+import org.apache.xmlbeans.XmlObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+import xsul.wsif.WSIFMessage;
+
+public class ServiceNotificationSender implements ServiceNotifiable {
+
+    private static final Logger logger = LoggerFactory.getLogger(ServiceNotificationSender.class);
+
+    private WorkflowNotifier notifier;
+
+    private URI workflowID;
+
+    private String nodeID;
+
+    private String serviceID;
+
+    private InvocationEntity receiver;
+
+    private InvocationEntity initiator;
+
+    private InvocationContext invocationContext;
+
+    private WorkflowTrackingContext context;
+
+    private EndpointReference eventSink;
+
+    /**
+     * Constructs a ServiceNotificationSender.
+     * 
+     * @param notifier
+     * @param eventSink
+     * @param initiator
+     * @param workflowID
+     * @param nodeID
+     */
+    protected ServiceNotificationSender(WorkflowNotifier notifier, EndpointReference eventSink,
+            InvocationEntity initiator, URI workflowID, String nodeID, WorkflowTrackingContext context, InvocationContext invocationContext) {
+        this.notifier = notifier;
+        this.eventSink = eventSink;
+        this.initiator = initiator;
+        this.workflowID = workflowID;
+        this.nodeID = nodeID;
+        this.context = context;
+        // In case of creating a service on the fly, there is no serviceID at
+        // the beginning.
+        this.serviceID = "";
+        this.invocationContext = invocationContext;
+        URI receiverWorkflowID = this.workflowID;
+        URI receiverServiceID = URI.create(this.serviceID);
+        String receiverWorkflowNodeID = this.nodeID;
+        Integer workflowTimeStep = new Integer(0);
+        this.receiver = this.notifier.createEntity(receiverWorkflowID, receiverServiceID, receiverWorkflowNodeID,
+                workflowTimeStep);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#setServiceID(java.lang.String)
+     */
+    @Override
+    public void setServiceID(String serviceID) {
+        logger.debug("SerivceID:" + serviceID);
+        this.serviceID = serviceID;
+
+        URI receiverWorkflowID = this.workflowID;
+        URI receiverServiceID = URI.create(this.serviceID);
+        String receiverWorkflowNodeID = this.nodeID;
+        Integer workflowTimeStep = new Integer(0);
+        this.receiver = this.notifier.createEntity(receiverWorkflowID, receiverServiceID, receiverWorkflowNodeID,
+                workflowTimeStep);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#getEventSink()
+     */
+    @Override
+    public EndpointReference getEventSink() {
+        return this.eventSink;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#getWorkflowID()
+     */
+    @Override
+    public URI getWorkflowID() {
+        return this.workflowID;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#invokingService(xsul.wsif.WSIFMessage)
+     */
+    @Override
+    public void invokingService(WSIFMessage inputs) {
+        String message = "";
+        Iterator partIt = inputs.partNames().iterator();
+        boolean first = true;
+        while (partIt.hasNext()) {
+            if (first) {
+                first = false;
+            } else {
+                message += ", ";
+            }
+
+            String name = (String) partIt.next();
+            Object value = inputs.getObjectPart(name);
+            if(value instanceof org.xmlpull.v1.builder.XmlElement){
+                message += name + "=";
+                Iterator children = ((org.xmlpull.v1.builder.XmlElement) value).children();
+                while (children.hasNext()){
+                    message += children.next();
+                }
+            }else{
+                message += name + "=" + value;
+            }
+        }
+        XmlObject header = null;
+        XmlObject body;
+        try {
+            body = XmlObject.Factory.parse(inputs.toString());
+        } catch (XmlException e) {
+            logger.warn("Failed to parse " + inputs.toString(), e);
+            body = null; // Send notification anyway.
+        }
+        this.invocationContext = this.notifier.invokingService(this.context, this.receiver, header, body, message);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#serviceFinished(xsul.wsif.WSIFMessage)
+     */
+    @Override
+    public void serviceFinished(WSIFMessage outputs) {
+        String message = "";
+        Iterator partIt = outputs.partNames().iterator();
+        boolean first = true;
+        while (partIt.hasNext()) {
+            if (first) {
+                first = false;
+            } else {
+                message += ", ";
+            }
+            String name = (String) partIt.next();
+            Object value = outputs.getObjectPart(name);
+            if(value instanceof org.xmlpull.v1.builder.XmlElement){
+                message += name + "=";
+                Iterator children = ((org.xmlpull.v1.builder.XmlElement) value).children();
+                while (children.hasNext()){
+                    message += children.next();
+                }
+            }else{
+             message += name + "=" + value;
+            }
+        }
+        XmlObject header = null;
+        XmlObject body;
+        try {
+            body = XmlObject.Factory.parse(outputs.toString());
+        } catch (XmlException e) {
+            logger.warn("Failed to parse " + outputs.toString(), e);
+            body = null; // Send notification anyway.
+        }
+        this.notifier.receivedResult(this.context, this.invocationContext, header, body, message);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#invocationFailed(java.lang.String,
+     * java.lang.Throwable)
+     */
+    @Override
+    public void invocationFailed(String message, Throwable e) {
+
+        // TODO there are two types of error messages.
+        // The first one is while creating a service. (No API)
+        // The second is while invoking a service.
+        // e.g. notifier.invokingServiceFailed().
+
+        // XXX If error occurs before invoking a service, create a fake
+        // invocation context.
+        if (this.invocationContext == null) {
+            this.invocationContext = new InvocationContextImpl(this.initiator, this.receiver);
+        }
+
+        logger.error(e.getMessage(), e);
+        if (message == null || "".equals(message)) {
+            message = "Error";
+        }
+        if (e != null) {
+            message += ": " + e.toString();
+        }
+        if (e != null) {
+            String stackTrace = StringUtil.getStackTraceInString(e);
+            XmlElement stackTraceElement = XMLUtil.BUILDER.newFragment("stackTrace");
+            stackTraceElement.addChild(stackTrace);
+            String annotation = XMLUtil.xmlElementToString(stackTraceElement);
+            this.notifier.invokingServiceFailed(this.context, this.invocationContext, e, message, annotation);
+        } else {
+            this.notifier.invokingServiceFailed(this.context, this.invocationContext, message);
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#receivedFault(java.lang.String)
+     */
+    @Override
+    @Deprecated
+    public void receivedFault(String message) {
+        // XXX If error occurs before invoking a service, create a fake
+        // invocation context.
+        if (this.invocationContext == null) {
+            this.invocationContext = new InvocationContextImpl(this.initiator, this.receiver);
+        }
+
+        if (message == null || "".equals(message)) {
+            message = "Error";
+        }
+        this.notifier.receivedFault(this.context, this.invocationContext, message);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#receivedFault(xsul.wsif.WSIFMessage)
+     */
+    @Override
+    public void receivedFault(WSIFMessage fault) {
+        // XXX If error occurs before invoking a service, create a fake
+        // invocation context.
+        if (this.invocationContext == null) {
+            this.invocationContext = new InvocationContextImpl(this.initiator, this.receiver);
+        }
+
+        String message = "Received a fault message from the service";
+        XmlObject header = null;
+        XmlObject body;
+        try {
+            body = XmlObject.Factory.parse(fault.toString());
+        } catch (XmlException e) {
+            logger.warn("Failed to parse " + fault.toString(), e);
+            body = null; // Send notification anyway.
+        }
+        this.notifier.receivedFault(this.context, this.invocationContext, header, body, message);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/StandaloneServiceNotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/StandaloneServiceNotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/StandaloneServiceNotificationSender.java
new file mode 100644
index 0000000..8e9248d
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/StandaloneServiceNotificationSender.java
@@ -0,0 +1,95 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.lib;
+
+import java.net.URI;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.axis2.addressing.EndpointReference;
+
+import xsul.wsif.WSIFMessage;
+
+public class StandaloneServiceNotificationSender implements ServiceNotifiable {
+
+    private Workflow workflow;
+    private String serviceID;
+    private URI workflowID;
+
+    public StandaloneServiceNotificationSender(Workflow workflow, URI workflowID) {
+        this.workflow = workflow;
+        this.workflowID = workflowID;
+    }
+
+    @Override
+    public void setServiceID(String serviceID) {
+        this.serviceID = serviceID;
+        System.out.println(serviceID);
+
+    }
+
+    @Override
+    public EndpointReference getEventSink() {
+        return new EndpointReference(XBayaConstants.DEFAULT_BROKER_URL.toString());
+    }
+
+    @Override
+    public URI getWorkflowID() {
+        return this.workflowID;
+    }
+
+    @Override
+    public void invokingService(WSIFMessage inputs) {
+        getNode().setState(NodeExecutionState.EXECUTING);
+    }
+
+    @Override
+    public void serviceFinished(WSIFMessage outputs) {
+    	getNode().setState(NodeExecutionState.FINISHED);
+
+    }
+
+    @Override
+    public void invocationFailed(String message, Throwable e) {
+    	getNode().setState(NodeExecutionState.FAILED);
+
+    }
+
+    @Override
+    public void receivedFault(String message) {
+    	getNode().setState(NodeExecutionState.FAILED);
+
+    }
+
+    @Override
+    public void receivedFault(WSIFMessage fault) {
+    	getNode().setState(NodeExecutionState.FAILED);
+
+    }
+
+	private Node getNode() {
+		return this.workflow.getGraph().getNode(this.serviceID);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java
new file mode 100644
index 0000000..c44fa55
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java
@@ -0,0 +1,92 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.lib;
+
+import org.apache.axis2.addressing.EndpointReference;
+import org.python.core.PyObject;
+
+public interface WorkflowNotifiable {
+
+    /**
+     * @return The event sink EPR.
+     */
+    public abstract EndpointReference getEventSink();
+
+    /**
+     * @param args
+     * @param keywords
+     */
+    public abstract void workflowStarted(PyObject[] args, String[] keywords);
+
+    public abstract void workflowStarted(Object[] args, String[] keywords);
+
+    /**
+     * @param args
+     * @param keywords
+     */
+    public abstract void workflowFinished(Object[] args, String[] keywords);
+
+    public abstract void sendingPartialResults(Object[] args, String[] keywords);
+
+    /**
+     * @param args
+     * @param keywords
+     */
+    public abstract void workflowFinished(PyObject[] args, String[] keywords);
+
+    public abstract void workflowTerminated();
+
+    /**
+     * Sends a START_INCOMPLETED notification message.
+     * 
+     * @param message
+     *            The message to send
+     */
+    public abstract void workflowFailed(String message);
+
+    /**
+     * Sends a START_INCOMPLETED notification message.
+     * 
+     * @param e
+     */
+    public abstract void workflowFailed(Throwable e);
+
+    /**
+     * Sends a START_INCOMPLETED notification message.
+     * 
+     * @param message
+     *            The message to send
+     * @param e
+     */
+    public abstract void workflowFailed(String message, Throwable e);
+
+    /**
+     * @param nodeID
+     * @return The ServiceNoficationSender created.
+     */
+    public abstract ServiceNotifiable createServiceNotificationSender(String nodeID);
+
+    public String getTopic();
+
+    public abstract void cleanup();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/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
new file mode 100644
index 0000000..135e331
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonClassLoader.java
@@ -0,0 +1,423 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.runner;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.security.AllPermission;
+import java.security.CodeSigner;
+import java.security.CodeSource;
+import java.security.PermissionCollection;
+import java.security.Permissions;
+import java.security.SecureClassLoader;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.jar.JarEntry;
+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;
+
+/**
+ * This class loader loads jython related classes without counting on parent class loader. This is because jython
+ * related classes use a lot of static fields and cannot be used to invoke Jython scripts multiple times.
+ * 
+ */
+public class JythonClassLoader extends SecureClassLoader {
+
+    private final static Logger logger = LoggerFactory.getLogger(JythonClassLoader.class);
+
+    private ClassLoader parent;
+
+    private Map<String, Class> classes = new HashMap<String, Class>();
+
+    private URL jythonURL;
+
+    private URL xbayaURL;
+
+    private JarFile jythonJarFile;
+
+    private JarFile xbayaJarFile;
+
+    private File tmpJarDirectory;
+
+    /**
+     * Constructs a JythonClassLoader.
+     * 
+     * @param parent
+     *            the parent class loader.
+     * 
+     *            This has to be explicitly passed because WebStart applications use user-level class loader. The
+     *            default system loader cannot load classes in the downloaded jar files.
+     */
+    public JythonClassLoader(ClassLoader parent) {
+        super(parent);
+        this.parent = parent;
+
+        this.jythonURL = getBaseURL(PythonInterpreter.class);
+        this.xbayaURL = getBaseURL(XBayaVersion.class);
+    }
+
+    /**
+     * @return XBaya jar file.
+     */
+    public JarFile getXBayaJarFile() {
+        if (this.xbayaJarFile == null)
+            this.xbayaJarFile = maybeGetJarFile(this.xbayaURL);
+        return this.xbayaJarFile;
+    }
+
+    /**
+     * Cleans up temporary files.
+     */
+    public void cleanUp() {
+        this.jythonJarFile = null;
+        this.xbayaJarFile = null;
+        if (this.tmpJarDirectory != null) {
+            try {
+                IOUtil.deleteDirectory(this.tmpJarDirectory);
+            } catch (RuntimeException e) {
+                logger.error(e.getMessage(), e);
+            }
+        }
+    }
+
+    /**
+     * @see java.lang.ClassLoader#loadClass(java.lang.String)
+     */
+    @Override
+    public Class<?> loadClass(String className) throws ClassNotFoundException {
+        return (loadClass(className, false));
+    }
+
+    /**
+     * @see java.lang.ClassLoader#loadClass(java.lang.String, boolean)
+     */
+    @Override
+    public synchronized Class<?> loadClass(String name, boolean resolveIt) throws ClassNotFoundException {
+
+        Class klass = null;
+        try {
+            klass = findClass(name);
+        } catch (ClassNotFoundException e) {
+            try {
+                klass = super.loadClass(name, false);
+            } catch (ClassNotFoundException e2) {
+                klass = this.parent.loadClass(name);
+                logger.debug("found from parent, klass: " + klass);
+            }
+        }
+
+        if (resolveIt) {
+            resolveClass(klass);
+        }
+
+        // logger.exiting(klass);
+        return klass;
+    }
+
+    @Override
+    protected Class<?> findClass(final String name) throws ClassNotFoundException {
+
+        // find jar location first
+        if (this.jythonJarFile == null)
+            this.jythonJarFile = maybeGetJarFile(this.jythonURL);
+        if (this.jythonJarFile == null)
+            this.xbayaJarFile = maybeGetJarFile(this.xbayaURL);
+
+        Class klass;
+
+        // Check if the class has been loaded by this class loader.
+        klass = this.classes.get(name);
+        if (klass != null) {
+            return klass;
+        }
+
+        // If the class is python, load separatly. NotificationSender also uses
+        // PyObject, so it has to be read from this class loader.
+        // 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);
+        }
+
+        if (klass != null) {
+            this.classes.put(name, klass);
+            return klass;
+        } else {
+            throw new ClassNotFoundException();
+        }
+    }
+
+    /**
+     * @see java.security.SecureClassLoader#getPermissions(java.security.CodeSource)
+     */
+    @Override
+    protected PermissionCollection getPermissions(CodeSource codesource) {
+        // Grant all perission. This could be avoided if code signers were
+        // extracted correctly.
+        Permissions permissions = new Permissions();
+        AllPermission permission = new AllPermission();
+        permissions.add(permission);
+        return permissions;
+    }
+
+    private URL getBaseURL(Class klass) {
+        String path = klass.getName().replace('.', '/').concat(".class"); // /d/e/f.class
+        URL classURL = this.parent.getResource(path);
+
+        String jarURLString;
+        if ("jar".equals(classURL.getProtocol())) {
+            // classURL = jar:file/a/b/c.jar!/d/e/f.class
+            // or jar:http://example.org/a/b/c.jar!/d/e/f.class
+            String file = classURL.getFile();
+            // file = file:/a/b/c.jar!d/e/f.class
+            // or http://example.org/a/b/c.jar!d/e/f.class
+            logger.debug("file: " + file);
+            jarURLString = file.substring(0, file.lastIndexOf('!'));
+            // jarURLString = file:/a/b/c.jar
+            // or http://example.org/a/b/c.jar
+        } else {
+            // file:/a/b/c/d/e/f.class
+            String file = classURL.getFile(); // /a/b/c/d/e/f.class
+            int index = file.lastIndexOf(path);
+            jarURLString = "file:" + file.substring(0, index); // /a/b/c/
+        }
+        try {
+            URL jarURL = new URL(jarURLString);
+            return jarURL;
+        } catch (MalformedURLException e) {
+            throw new WorkflowRuntimeException(e);
+        }
+    }
+
+    private JarFile maybeGetJarFile(URL url) {
+        String path;
+        try {
+            path = URLDecoder.decode(url.getPath(), "UTF-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new WorkflowRuntimeException(e);
+        }
+        logger.debug("path: " + path);
+        if (path.endsWith("/")) {
+            // url = file:/a/b/c/
+            // It's a local directory
+            return null;
+        } else if ("file".equals(url.getProtocol())) {
+            // url = file:/a/b/c.jar
+            // Jar file
+            try {
+                JarFile jarFile = new JarFile(path);
+                return jarFile;
+            } catch (IOException e) {
+                throw new WorkflowRuntimeException(e);
+            }
+        } else {
+            // url = http://example.com/a/b/c.jar
+            // A Jar file
+            try {
+                if (this.tmpJarDirectory == null) {
+                    Date date = new Date();
+                    SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd-HHmmss-S");
+                    String time = format.format(date);
+                    String fileName = ".xbaya-jars-" + time;
+                    String tmpdir = System.getProperty("java.io.tmpdir");
+                    this.tmpJarDirectory = new File(tmpdir, fileName);
+                    this.tmpJarDirectory.mkdir();
+                }
+
+                int i = path.lastIndexOf('/');
+                File file = new File(this.tmpJarDirectory, path.substring(i + 1));
+                logger.debug("file: " + file);
+                InputStream stream = url.openStream();
+                IOUtil.writeToFile(stream, file);
+                JarFile jarFile = new JarFile(file);
+                return jarFile;
+            } catch (IOException e) {
+                throw new WorkflowRuntimeException(e);
+            }
+        }
+    }
+
+    private Class findClassFromURL(String name, URL url, JarFile jarFile) throws ClassNotFoundException {
+        // logger.entering(new Object[] { name, url, jarFile });
+
+        String classPath = name.replace('.', '/').concat(".class");
+        // logger.info("classPath: " + classPath);
+
+        try {
+            byte[] classBytes;
+            CodeSource codeSource = null;
+            if (jarFile == null) {
+                // It's a local directory
+                String dirPath = URLDecoder.decode(url.getPath(), "UTF-8");
+                File classFile = new File(dirPath, classPath);
+                classBytes = IOUtil.readToByteArray(classFile);
+
+            } else {
+                // A Jar file
+                JarEntry jarEntry = jarFile.getJarEntry(classPath);
+                CodeSigner[] codeSigners = jarEntry.getCodeSigners();
+                // logger.info("codeSigners: " + codeSigners);
+                if (codeSigners != null) {
+                    // Somehow it's null.
+                    for (CodeSigner signer : codeSigners) {
+                        logger.debug("signer: " + signer);
+                    }
+                }
+                codeSource = new CodeSource(this.xbayaURL, codeSigners);
+                InputStream classInputStream = jarFile.getInputStream(jarEntry);
+                classBytes = IOUtil.readToByteArray(classInputStream);
+            }
+
+            Class<?> klass = defineClass(name, classBytes, 0, classBytes.length, codeSource);
+            this.classes.put(name, klass);
+            return klass;
+        } catch (IOException e) {
+            logger.error(e.getMessage(), e);
+            throw new ClassNotFoundException();
+        }
+    }
+
+    /**
+     * @see java.lang.ClassLoader#clearAssertionStatus()
+     */
+    @Override
+    public synchronized void clearAssertionStatus() {
+        super.clearAssertionStatus();
+    }
+
+    /**
+     * @see java.lang.ClassLoader#definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String,
+     *      java.lang.String, java.lang.String, java.lang.String, java.net.URL)
+     */
+    @Override
+    protected Package definePackage(String name, String specTitle, String specVersion, String specVendor,
+            String implTitle, String implVersion, String implVendor, URL sealBase) throws IllegalArgumentException {
+        return super.definePackage(name, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor,
+                sealBase);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#findLibrary(java.lang.String)
+     */
+    @Override
+    protected String findLibrary(String libname) {
+        return super.findLibrary(libname);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#findResource(java.lang.String)
+     */
+    @Override
+    protected URL findResource(String name) {
+        return super.findResource(name);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#findResources(java.lang.String)
+     */
+    @Override
+    protected Enumeration<URL> findResources(String name) throws IOException {
+        return super.findResources(name);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#getPackage(java.lang.String)
+     */
+    @Override
+    protected Package getPackage(String name) {
+        return super.getPackage(name);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#getPackages()
+     */
+    @Override
+    protected Package[] getPackages() {
+        return super.getPackages();
+    }
+
+    /**
+     * @see java.lang.ClassLoader#getResource(java.lang.String)
+     */
+    @Override
+    public URL getResource(String name) {
+        return super.getResource(name);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#getResourceAsStream(java.lang.String)
+     */
+    @Override
+    public InputStream getResourceAsStream(String name) {
+        return super.getResourceAsStream(name);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#getResources(java.lang.String)
+     */
+    @Override
+    public Enumeration<URL> getResources(String name) throws IOException {
+        return super.getResources(name);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#setClassAssertionStatus(java.lang.String, boolean)
+     */
+    @Override
+    public synchronized void setClassAssertionStatus(String className, boolean enabled) {
+        super.setClassAssertionStatus(className, enabled);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#setDefaultAssertionStatus(boolean)
+     */
+    @Override
+    public synchronized void setDefaultAssertionStatus(boolean enabled) {
+        super.setDefaultAssertionStatus(enabled);
+    }
+
+    /**
+     * @see java.lang.ClassLoader#setPackageAssertionStatus(java.lang.String, boolean)
+     */
+    @Override
+    public synchronized void setPackageAssertionStatus(String packageName, boolean enabled) {
+        super.setPackageAssertionStatus(packageName, enabled);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunner.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunner.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunner.java
new file mode 100644
index 0000000..2ebd2ff
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunner.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.runner;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+
+public interface JythonOneTimeRunner {
+
+    /**
+     * @param script
+     * @param arguments
+     * @throws WorkflowException
+     */
+    public void run(String script, String[] arguments) throws WorkflowException;
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunnerImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunnerImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunnerImpl.java
new file mode 100644
index 0000000..6a4c532
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunnerImpl.java
@@ -0,0 +1,85 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.runner;
+
+import java.io.File;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
+import java.util.jar.JarFile;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.python.core.PySystemState;
+import org.python.util.PythonInterpreter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class JythonOneTimeRunnerImpl implements JythonOneTimeRunner {
+
+    private static final Logger logger = LoggerFactory.getLogger(JythonOneTimeRunnerImpl.class);
+
+    /**
+     * @throws WorkflowException
+     * @see org.apache.airavata.xbaya.jython.runner.JythonOneTimeRunner#run(java.lang.String, java.lang.String[])
+     */
+    public void run(final String script, final String[] arguments) throws WorkflowException {
+
+        try {
+            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
+                public Void run() {
+                    ClassLoader loader = this.getClass().getClassLoader();
+
+                    PySystemState.initialize(System.getProperties(), null, arguments, loader);
+
+                    if (loader instanceof JythonClassLoader) {
+                        logger.debug("jythonClassLoader");
+                        JythonClassLoader jythonLoader = (JythonClassLoader) loader;
+
+                        JarFile xbayaJarFile = jythonLoader.getXBayaJarFile();
+                        if (xbayaJarFile != null) {
+                            String jarPath = xbayaJarFile.getName();
+                            logger.debug("jarPath: " + jarPath);
+                            // String jarDir = jarPath.substring(0,
+                            // jarPath.lastIndexOf());
+                            File jarFile = new File(jarPath);
+                            String jarDir = jarFile.getParent();
+                            logger.debug("jarDir: " + jarDir);
+
+                            // This is for the Jython interpreter to
+                            // solve import statements.
+                            PySystemState.add_extdir(jarDir);
+                        }
+                    }
+
+                    PythonInterpreter interpreter = new PythonInterpreter();
+                    interpreter.exec(script);
+                    return null;
+                }
+            });
+        } catch (PrivilegedActionException e) {
+            logger.error(e.getMessage(), e);
+            throw new WorkflowException(e.getCause());
+        }
+
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonRunner.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonRunner.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonRunner.java
new file mode 100644
index 0000000..7fe1f93
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonRunner.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.runner;
+
+import java.util.List;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+
+public class JythonRunner {
+
+    private JythonClassLoader loader;
+
+    /**
+     * 
+     * Constructs a JythonRunner.
+     * 
+     */
+    public JythonRunner() {
+        this.loader = new JythonClassLoader(this.getClass().getClassLoader());
+    }
+
+    /**
+     * @param script
+     * @param arguments
+     * @throws WorkflowException
+     */
+    public void run(String script, List<String> arguments) throws WorkflowException {
+        run(script, arguments.toArray(new String[arguments.size()]));
+    }
+
+    /**
+     * @param script
+     * @param arguments
+     * @throws WorkflowException
+     */
+    public void run(final String script, final String[] arguments) throws WorkflowException {
+        try {
+            Class<?> runnerClass = this.loader.loadClass(JythonOneTimeRunnerImpl.class.getName(), true);
+            JythonOneTimeRunner runner = (JythonOneTimeRunner) runnerClass.newInstance();
+            runner.run(script, arguments);
+
+        } catch (ClassNotFoundException e) {
+            throw new WorkflowRuntimeException(ErrorMessages.UNEXPECTED_ERROR, e);
+        } catch (InstantiationException e) {
+            throw new WorkflowRuntimeException(ErrorMessages.UNEXPECTED_ERROR, e);
+        } catch (IllegalAccessException e) {
+            throw new WorkflowRuntimeException(ErrorMessages.UNEXPECTED_ERROR, e);
+        } finally {
+            loader.cleanUp();
+        }
+    }
+}
\ No newline at end of file


[30/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/index.jsp
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/index.jsp b/modules/rest/webapp/src/main/webapp/index.jsp
deleted file mode 100644
index e6be3f8..0000000
--- a/modules/rest/webapp/src/main/webapp/index.jsp
+++ /dev/null
@@ -1,26 +0,0 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---%>
-
-<html>
-<body>
-<img src="images/airavata-logo-2.png">
-<h2>Airavata REST API</h2>
-<p>Welcome to Airavata Web Application</p>
-
-<p><a href="user-store/index.jsp"><b>Manage Local User Store</b></a></p>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/user-store/add.jsp
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/user-store/add.jsp b/modules/rest/webapp/src/main/webapp/user-store/add.jsp
deleted file mode 100644
index 3bd0feb..0000000
--- a/modules/rest/webapp/src/main/webapp/user-store/add.jsp
+++ /dev/null
@@ -1,142 +0,0 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---%>
-<%@ page import="org.apache.airavata.services.registry.rest.security.local.LocalUserStore" %>
-
-<html>
-
-<head>
-    <script language="javascript" type="text/javascript">
-        function validatePassword(fld1name, regString) {
-            var stringValue = document.getElementsByName(fld1name)[0].value;
-            var errorMessage = "";
-            if(regString != "null" && !stringValue.match(new RegExp(regString))){
-                errorMessage = "Password does not meet minimum requirements. Password length must be at least 6 " +
-                        "characters.";
-                return errorMessage;
-            }else if(regString != "null" && stringValue == ''){
-                return errorMessage;
-            }
-
-            if (stringValue == '') {
-                errorMessage = "Empty passwords are not allowed. Please enter a valid password";
-                return errorMessage;
-            }
-
-            return errorMessage;
-        }
-
-        function validateUsername(fld1name) {
-            var stringValue = document.getElementsByName(fld1name)[0].value;
-            var errorMessage = "";
-
-            if (stringValue == '') {
-                errorMessage = "Empty user names are not allowed. Please enter a valid user name.";
-                return errorMessage;
-            }
-
-            return errorMessage;
-        }
-
-        function checkPasswordsMatching(fld1name, fld2name) {
-
-            var stringValue1 = document.getElementsByName(fld1name)[0].value;
-            var stringValue2 = document.getElementsByName(fld2name)[0].value;
-            var errorMessage = "";
-
-            if (stringValue1 != stringValue2) {
-                errorMessage = "Confirm password does not match with the password. Please re-enter passwords.";
-                return errorMessage;
-            }
-
-            return errorMessage;
-
-        }
-
-        function validate() {
-            var reason = "";
-
-            reason = validateUsername("username");
-
-            if (reason != "") {
-                alert(reason);
-                return false;
-            }
-
-            reason = validatePassword("newPassword", <%=LocalUserStore.getPasswordRegularExpression()%>);
-
-            if (reason != "") {
-                alert(reason);
-                document.getElementsByName("newPassword")[0].clear();
-                return false;
-            }
-
-            reason = checkPasswordsMatching("newPassword", "confirmPassword");
-
-            if (reason != "") {
-                alert(reason);
-                document.getElementsByName("newPassword")[0].clear();
-                document.getElementsByName("confirmPassword")[0].clear();
-                return false;
-            }
-
-            return true;
-        }
-
-        function doProcess() {
-            if (validate() == true) {
-                document.registration.submit();
-            }
-        }
-
-
-    </script>
-</head>
-
-<body>
-<img src="../images/airavata-logo-2.png">
-<h2>Airavata REST API - Local User Store</h2>
-<p><b>Manage Local User Store - Add New User</b></p>
-
-<form action="index.jsp" name="registration" method="POST">
-
-    <input type="hidden" name="operation" value="addUser">
-    <table>
-        <tr>
-            <td>User Name</td>
-            <td><input type="text" name="username" maxlength="150"></td>
-        </tr>
-        <tr>
-            <td>Password</td>
-            <td><input type="password" name="newPassword"/></td>
-        </tr>
-        <tr>
-            <td>Re-Type Password</td>
-            <td><input type="password" name="confirmPassword"/></td>
-        </tr>
-    </table>
-
-    <table>
-        <tr>
-            <td><input type="button" value="Add" onclick= 'doProcess()'></td>
-            <td><a href="index.jsp"><input type="button" value="Cancel" name="Cancel"/> </a> </td>
-        </tr>
-    </table>
-
-</form>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/user-store/index.jsp
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/user-store/index.jsp b/modules/rest/webapp/src/main/webapp/user-store/index.jsp
deleted file mode 100644
index b5b1cb1..0000000
--- a/modules/rest/webapp/src/main/webapp/user-store/index.jsp
+++ /dev/null
@@ -1,138 +0,0 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---%>
-
-<%@ page import = "org.apache.airavata.services.registry.rest.security.local.LocalUserStore" %>
-<%@ page import="org.apache.airavata.services.registry.rest.security.basic.BasicAccessAuthenticator" %>
-<%@ page import="org.apache.airavata.services.registry.rest.security.HttpAuthenticatorFilter" %>
-<%@ page import="java.util.List" %>
-<%@ page import="org.apache.airavata.common.utils.Constants" %>
-<%
-
-    LocalUserStore localUserStore = (LocalUserStore)session.getAttribute("LocalUserStore");
-
-    if (localUserStore == null) {
-
-        String operatingUser = (String) session.getAttribute(Constants.USER_IN_SESSION);
-
-        if (operatingUser == null || !operatingUser.equals("admin")) {
-            HttpAuthenticatorFilter.sendUnauthorisedError(response, "Insufficient privileges to perform user operations." +
-                    " Only admin user is allowed to perform user operations.");
-
-            return;
-        }
-
-        localUserStore = new LocalUserStore(application);
-
-        session.setAttribute("LocalUserStore", localUserStore);
-    }
-
-    String operation = request.getParameter("operation");
-    if (operation != null) {
-        if (operation.equals("addUser")) {
-            String userName = request.getParameter("username");
-            String password = request.getParameter("newPassword");
-
-            localUserStore.addUser(userName, password);
-        } else if (operation.equals("deleteUser")) {
-            String[] usersToDelete = request.getParameterValues("user-id");
-
-            for (String deleteUser : usersToDelete) {
-                localUserStore.deleteUser(deleteUser);
-            }
-        }
-    }
-
-    List<String> allUsers = localUserStore.getUsers();
-
-%>
-
-<html>
-<head>
-    <script language="javascript" type="text/javascript">
-
-        function validate() {
-            var checkSelected = false;
-            for (var i = 0; i < <%=allUsers.size()%>; i++) {
-                if (document.main["user-id"][i].checked) {
-                    checkSelected = true;
-                }
-            }
-            if (checkSelected) {
-                var answer = confirm("Are you sure you want to delete selected users from the system ?");
-                if (answer) {
-                    return true;
-                }
-            } else {
-                alert("Select at least one user to delete.");
-            }
-            return false;
-        }
-
-        function doProcess() {
-            if (validate() == true) {
-                document.main.submit();
-            }
-        }
-
-    </script>
-</head>
-<body>
-<img src="../images/airavata-logo-2.png">
-<h2>Airavata REST API - Local User Store</h2>
-<p><b>Manage Local User Store</b></p>
-
-
-<form action="index.jsp" name="main" method="POST">
-    <table>
-        <tr>
-            <td>&nbsp;</td>
-            <td>All Users</td>
-        </tr>
-        <%
-            for (String user : allUsers) {
-        %>
-
-        <tr>
-            <td><input type="checkbox" name="user-id" value="<%=user%>"></td>
-            <td><%=user%>
-            </td>
-            <td><a href="password.jsp?username=<%=user%>">Change Password</a></td>
-        </tr>
-
-        <%
-            }
-        %>
-    </table>
-
-    <br>
-
-    <table width="100">
-        <tr>
-            <td>
-                <a href="add.jsp"><input type="button" value="Add" name="Add"/></a>
-            </td>
-            <td>&nbsp;</td>
-            <input type="hidden" name="operation" value="deleteUser">
-            <td><input type="button" value="Delete" onclick="doProcess()"></td>
-        </tr>
-    </table>
-
-</form>
-
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/user-store/password.jsp
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/user-store/password.jsp b/modules/rest/webapp/src/main/webapp/user-store/password.jsp
deleted file mode 100644
index 8642781..0000000
--- a/modules/rest/webapp/src/main/webapp/user-store/password.jsp
+++ /dev/null
@@ -1,157 +0,0 @@
-<%--
-  Licensed to the Apache Software Foundation (ASF) under one or more
-  contributor license agreements.  See the NOTICE file distributed with
-  this work for additional information regarding copyright ownership.
-  The ASF licenses this file to You under the Apache License, Version 2.0
-  (the "License"); you may not use this file except in compliance with
-  the License.  You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing, software
-  distributed under the License is distributed on an "AS IS" BASIS,
-  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-  See the License for the specific language governing permissions and
-  limitations under the License.
---%>
-
-<%@ page import="org.apache.airavata.services.registry.rest.security.local.LocalUserStore" %>
-
-<%
-    String userName = request.getParameter("username");
-    if (userName == null) {
-        response.sendRedirect("index.jsp");
-    }
-
-    String password = request.getParameter("newPassword");
-    String confirmPassword = request.getParameter("confirmPassword");
-
-    if (password != null && confirmPassword != null && password.equals(confirmPassword)) {
-        LocalUserStore localUserStore = (LocalUserStore)session.getAttribute("LocalUserStore");
-        localUserStore.changePasswordByAdmin(userName, password);
-
-        response.sendRedirect("password.jsp?message=\"Password successfully change for user "
-                + userName + "\"&username=" + userName);
-    }
-
-%>
-
-<html>
-<head>
-    <script language="javascript" type="text/javascript">
-        function validatePassword(fld1name, regString) {
-            var stringValue = document.getElementsByName(fld1name)[0].value;
-            var errorMessage = "";
-            if(regString != "null" && !stringValue.match(new RegExp(regString))){
-                errorMessage = "Password does not meet minimum requirements. Password length must be at least 6 " +
-                        "characters.";
-                return errorMessage;
-            }else if(regString != "null" && stringValue == ''){
-                return errorMessage;
-            }
-
-            if (stringValue == '') {
-                errorMessage = "Empty passwords are not allowed. Please enter a valid password";
-                return errorMessage;
-            }
-
-            return errorMessage;
-        }
-
-        function validateUsername(fld1name) {
-            var stringValue = document.getElementsByName(fld1name)[0].value;
-            var errorMessage = "";
-
-            if (stringValue == '') {
-                errorMessage = "Empty user names are not allowed. Please enter a valid user name.";
-                return errorMessage;
-            }
-
-            return errorMessage;
-        }
-
-        function checkPasswordsMatching(fld1name, fld2name) {
-
-            var stringValue1 = document.getElementsByName(fld1name)[0].value;
-            var stringValue2 = document.getElementsByName(fld2name)[0].value;
-            var errorMessage = "";
-
-            if (stringValue1 != stringValue2) {
-                errorMessage = "Confirm password does not match with the password. Please re-enter passwords.";
-                return errorMessage;
-            }
-
-            return errorMessage;
-
-        }
-
-        function validate() {
-            var reason = "";
-
-            reason = validatePassword("newPassword", <%=LocalUserStore.getPasswordRegularExpression()%>);
-
-            if (reason != "") {
-                alert(reason);
-                document.getElementsByName("newPassword")[0].clear();
-                return false;
-            }
-
-            reason = checkPasswordsMatching("newPassword", "confirmPassword");
-
-            if (reason != "") {
-                alert(reason);
-                document.getElementsByName("newPassword")[0].clear();
-                document.getElementsByName("confirmPassword")[0].clear();
-                return false;
-            }
-
-            return true;
-        }
-
-        function doProcess() {
-            if (validate() == true) {
-                document.passwordForm.submit();
-            }
-        }
-
-        function displayMessage() {
-            var msg = <%=request.getParameter("message")%>;
-            if (msg != null) {
-                alert(msg);
-            }
-        }
-
-
-    </script>
-</head>
-
-<body onload="displayMessage()">
-<img src="../images/airavata-logo-2.png">
-<h2>Airavata REST API - Local User Store</h2>
-<p><b>Manage Local User Store - Change Password of user - <%=userName%></b></p>
-
-<form action="password.jsp" name="passwordForm" method="POST">
-
-    <input type="hidden" name="username" value="<%=userName%>">
-    <table>
-        <tr>
-            <td>New Password</td>
-            <td><input type="password" name="newPassword"/></td>
-        </tr>
-        <tr>
-            <td>Re-Type Password</td>
-            <td><input type="password" name="confirmPassword"/></td>
-        </tr>
-    </table>
-
-    <table>
-        <tr>
-            <td><input type="button" value="Change" onclick= 'doProcess()'></td>
-            <td><a href="index.jsp"><input type="button" value="Cancel" name="Cancel"/> </a> </td>
-        </tr>
-    </table>
-
-</form>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/pom.xml
----------------------------------------------------------------------
diff --git a/modules/security/pom.xml b/modules/security/pom.xml
deleted file mode 100644
index bfe2a01..0000000
--- a/modules/security/pom.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata</artifactId>
-        <version>0.12-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-security</artifactId>
-    <name>Airavata Security Implementation</name>
-    <description>Module for managing security features in Airavata</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-common-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-simple</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.shiro</groupId>
-            <artifactId>shiro-core</artifactId>
-            <version>1.2.1</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-dbcp</groupId>
-            <artifactId>commons-dbcp</artifactId>
-            <version>1.4</version>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.7</version>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/AbstractAuthenticator.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/AbstractAuthenticator.java b/modules/security/src/main/java/org/apache/airavata/security/AbstractAuthenticator.java
deleted file mode 100644
index 536b80b..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/AbstractAuthenticator.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security;
-
-import org.apache.airavata.common.context.RequestContext;
-import org.apache.airavata.common.context.WorkflowContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-
-/**
- * An abstract implementation of the authenticator.
- */
-@SuppressWarnings("UnusedDeclaration")
-public abstract class AbstractAuthenticator implements Authenticator {
-
-    protected static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
-
-    protected static Logger log = LoggerFactory.getLogger(AbstractAuthenticator.class);
-
-    public static int DEFAULT_AUTHENTICATOR_PRIORITY = 5;
-
-    protected String authenticatorName;
-
-    private int priority = DEFAULT_AUTHENTICATOR_PRIORITY;
-
-    protected boolean enabled = true;
-
-    protected UserStore userStore;
-
-    public AbstractAuthenticator() {
-
-    }
-
-    public AbstractAuthenticator(String name) {
-        this.authenticatorName = name;
-    }
-
-    public void setUserStore(UserStore store) {
-        this.userStore = store;
-    }
-
-    public UserStore getUserStore() {
-        return this.userStore;
-    }
-
-    public int getPriority() {
-        return priority;
-    }
-
-    public boolean canProcess(Object credentials) {
-        return false;
-    }
-
-    public String getAuthenticatorName() {
-        return authenticatorName;
-    }
-
-    public void setAuthenticatorName(String authenticatorName) {
-        this.authenticatorName = authenticatorName;
-    }
-
-    public void setPriority(int priority) {
-        this.priority = priority;
-    }
-
-    public void setEnabled(boolean enabled) {
-        this.enabled = enabled;
-    }
-
-    public boolean isEnabled() {
-        return enabled;
-    }
-
-    public boolean authenticate(Object credentials) throws AuthenticationException {
-
-        boolean authenticated = doAuthentication(credentials);
-
-        if (authenticated) {
-            onSuccessfulAuthentication(credentials);
-        } else {
-            onFailedAuthentication(credentials);
-        }
-
-        return authenticated;
-    }
-
-    /**
-     * Gets the current time converted to format in DATE_TIME_FORMAT.
-     * 
-     * @return Current time as a string.
-     */
-    protected String getCurrentTime() {
-        Calendar cal = Calendar.getInstance();
-        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_TIME_FORMAT);
-        return simpleDateFormat.format(cal.getTime());
-    }
-
-    /**
-     * The actual authenticating logic goes here. If user is successfully authenticated this should return
-     * <code>true</code> else this should return <code>false</code>. If an error occurred while authenticating this will
-     * throw an exception.
-     * 
-     * @param credentials
-     *            The object which contains request credentials. This could be request most of the time.
-     * @return <code>true</code> if successfully authenticated else <code>false</code>.
-     * @throws AuthenticationException
-     *             If system error occurs while authenticating.
-     */
-    protected abstract boolean doAuthentication(Object credentials) throws AuthenticationException;
-
-    /**
-     * If authentication is successful we can do post authentication actions in following method. E.g :- adding user to
-     * session, audit logging etc ...
-     * 
-     * @param authenticationInfo
-     *            A generic object with authentication information.
-     */
-    public abstract void onSuccessfulAuthentication(Object authenticationInfo);
-
-    /**
-     * If authentication is failed we can do post authentication actions in following method. E.g :- adding user to
-     * session, audit logging etc ...
-     * 
-     * @param authenticationInfo
-     *            A generic object with authentication information.
-     */
-    public abstract void onFailedAuthentication(Object authenticationInfo);
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/AbstractDatabaseAuthenticator.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/AbstractDatabaseAuthenticator.java b/modules/security/src/main/java/org/apache/airavata/security/AbstractDatabaseAuthenticator.java
deleted file mode 100644
index a980876..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/AbstractDatabaseAuthenticator.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security;
-
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * An abstract authenticator class which reads database configurations.
- */
-@SuppressWarnings("UnusedDeclaration")
-public abstract class AbstractDatabaseAuthenticator extends AbstractAuthenticator {
-
-    private String databaseURL;
-
-    private String databaseDriver;
-
-    private String databaseUserName;
-
-    private String databasePassword;
-
-    public AbstractDatabaseAuthenticator() {
-        super();
-    }
-
-    public AbstractDatabaseAuthenticator(String name) {
-        super(name);
-    }
-
-    /**
-     * We are reading database parameters in this case.
-     * 
-     * @param node
-     *            An XML configuration node.
-     */
-    public void configure(Node node) {
-
-        /**
-         * <specificConfigurations> <database> <jdbcUrl></jdbcUrl> <databaseDriver></databaseDriver>
-         * <userName></userName> <password></password> </database> </specificConfigurations>
-         */
-
-        NodeList databaseNodeList = node.getChildNodes();
-
-        Node databaseNode = null;
-
-        for (int k = 0; k < databaseNodeList.getLength(); ++k) {
-
-            Node n = databaseNodeList.item(k);
-
-            if (n != null && n.getNodeType() == Node.ELEMENT_NODE) {
-                databaseNode = n;
-            }
-        }
-
-        if (databaseNode != null) {
-            NodeList nodeList = databaseNode.getChildNodes();
-
-            for (int i = 0; i < nodeList.getLength(); ++i) {
-                Node n = nodeList.item(i);
-
-                if (n.getNodeType() == Node.ELEMENT_NODE) {
-
-                    Element element = (Element) n;
-
-                    if (element.getNodeName().equals("jdbcUrl")) {
-                        databaseURL = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("databaseDriver")) {
-                        databaseDriver = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("userName")) {
-                        databaseUserName = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("password")) {
-                        databasePassword = element.getFirstChild().getNodeValue();
-                    }
-                }
-            }
-        }
-
-        StringBuilder stringBuilder = new StringBuilder("Configuring DB parameters for authenticator with JDBC URL - ");
-        stringBuilder.append(databaseURL).append(" DB driver - ").append(" DB user - ").append(databaseUserName)
-                .append(" DB password - xxxxxx");
-
-        log.debug(stringBuilder.toString());
-
-        try {
-            getUserStore().configure(node);
-        } catch (UserStoreException e) {
-            String msg = "Error configuring user store associated with authenticator.";
-            log.error(msg, e);
-            throw new RuntimeException(msg, e);
-        }
-    }
-
-    public String getDatabaseURL() {
-        return databaseURL;
-    }
-
-    public String getDatabaseDriver() {
-        return databaseDriver;
-    }
-
-    public String getDatabaseUserName() {
-        return databaseUserName;
-    }
-
-    public String getDatabasePassword() {
-        return databasePassword;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/AuthenticationException.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/AuthenticationException.java b/modules/security/src/main/java/org/apache/airavata/security/AuthenticationException.java
deleted file mode 100644
index f4aca49..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/AuthenticationException.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security;
-
-/**
- * Wraps errors during authentication. This exception will be thrown if there is a system error during authentication.
- */
-public class AuthenticationException extends Exception {
-
-    public AuthenticationException() {
-        super();
-    }
-
-    public AuthenticationException(String message) {
-        super(message);
-    }
-
-    public AuthenticationException(String message, Exception e) {
-        super(message, e);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/Authenticator.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/Authenticator.java b/modules/security/src/main/java/org/apache/airavata/security/Authenticator.java
deleted file mode 100644
index 814bdb6..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/Authenticator.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security;
-
-import org.w3c.dom.Node;
-
-/**
- * A generic interface to do request authentication. Specific authenticator will implement authenticate method.
- */
-@SuppressWarnings("UnusedDeclaration")
-public interface Authenticator {
-
-    /**
-     * Authenticates the request with given credentials.
-     * 
-     * @param credentials
-     *            Credentials can be a session ticket, password or session id.
-     * @return <code>true</code> if request is successfully authenticated else <code>false</code>.
-     * @throws AuthenticationException
-     *             If a system error occurred during authentication process.
-     */
-    boolean authenticate(Object credentials) throws AuthenticationException;
-
-    /**
-     * Checks whether given user is already authenticated.
-     * 
-     * @param credentials
-     *            The token to be authenticated.
-     * @return <code>true</code> if token is already authenticated else <code>false</code>.
-     */
-    boolean isAuthenticated(Object credentials);
-
-    /**
-     * Says whether current authenticator can handle given credentials.
-     * 
-     * @param credentials
-     *            Credentials used during authentication.
-     * @return <code>true</code> is can authenticate else <code>false</code>.
-     */
-    boolean canProcess(Object credentials);
-
-    /**
-     * Gets the priority of this authenticator.
-     * 
-     * @return Higher the priority higher the precedence of selecting the authenticator.
-     */
-    int getPriority();
-
-    /**
-     * Returns the authenticator name. Each authenticator is associated with an identifiable name.
-     * 
-     * @return The authenticator name.
-     */
-    String getAuthenticatorName();
-
-    /**
-     * Authenticator specific configurations goes into this method.
-     * 
-     * @param node
-     *            An XML configuration node.
-     * @throws RuntimeException
-     *             If an error occurred while configuring the authenticator.
-     */
-    void configure(Node node) throws RuntimeException;
-
-    /**
-     * Return <code>true</code> if current authenticator is enabled. Else <code>false</code>.
-     * 
-     * @return <code>true</code> if enabled.
-     */
-    boolean isEnabled();
-
-    /**
-     * User store that should be used by this authenticator. When authenticating a request authenticator should use the
-     * user store set by this method.
-     * 
-     * @param userStore
-     *            The user store to be used.
-     */
-    void setUserStore(UserStore userStore);
-
-    /**
-     * Gets the user store used by this authenticator.
-     * 
-     * @return The user store used by this authenticator.
-     */
-    UserStore getUserStore();
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/Authoriser.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/Authoriser.java b/modules/security/src/main/java/org/apache/airavata/security/Authoriser.java
deleted file mode 100644
index f0fdea9..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/Authoriser.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security;
-
-/**
- * An interface which can be used to authorise accessing resources.
- */
-@SuppressWarnings("UnusedDeclaration")
-public interface Authoriser {
-
-    /**
-     * Checks whether user has sufficient privileges to perform action on the given resource.
-     * 
-     * @param userName
-     *            The user who is performing the action.
-     * @param resource
-     *            The resource which user is trying to access.
-     * @param action
-     *            The action (GET, PUT etc ...)
-     * @return Returns <code>true</code> if user is authorised to perform the action, else false.
-     */
-    boolean isAuthorised(String userName, String resource, String action);
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/UserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/UserStore.java b/modules/security/src/main/java/org/apache/airavata/security/UserStore.java
deleted file mode 100644
index cfee957..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/UserStore.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-
-package org.apache.airavata.security;
-
-import org.w3c.dom.Node;
-
-/**
- * An interface to wrap the functionality of a user store. A user store is place where we keep user attribute
- * information. Usually this contains, user id, user name, password etc ...
- * We also authenticate users against the credentials stored in a user store. In addition to user attributes
- * we also store role information and group information.
- * This interface provide methods to manipulated data in a user store.
- * Such operations are as follows,
- * <ol>
- *     <li>authenticate user</li>
- *     <li>add user</li>
- *     <li>delete user</li>
- *     <li>add a role</li>
- *     <li>delete a role</li>
- *     <li>... etc ...</li>
- * </ol>
- */
-public interface UserStore {
-
-    /**
-     * Checks whether given user exists in the user store and its credentials match with the credentials stored
-     * in the user store.
-     * @param userName Name of the user to authenticate.
-     * @param credentials User credentials as an object. User credentials may not be a string always.
-     * @return True if user exists in the user store and its credentials match with the credentials in user store.
-     *          <code>false</code> else.
-     * @throws UserStoreException if a system wide error occurred while authenticating the user.
-     */
-    boolean authenticate(String userName, Object credentials) throws UserStoreException;
-
-    /**
-     * Authenticates a user using a token.
-     * @param credentials The token information.
-     * @return <code>true</code> if authentication successful else <code>false</code>.
-     * @throws UserStoreException if a system wide error occurred while authenticating the user.
-     */
-    boolean authenticate(Object credentials) throws UserStoreException;
-
-    /**
-     * This method will do necessary configurations of the user store.
-     * @param node An XML configuration node.
-     * @throws RuntimeException If an error occurred while configuring the authenticator.
-     */
-    void configure(Node node) throws UserStoreException;
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/UserStoreException.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/UserStoreException.java b/modules/security/src/main/java/org/apache/airavata/security/UserStoreException.java
deleted file mode 100644
index 927bf8a..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/UserStoreException.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-
-package org.apache.airavata.security;
-
-/**
- * Exception class to wrap user store errors.
- */
-public class UserStoreException extends Exception {
-
-    public UserStoreException() {
-        super();
-    }
-
-    public UserStoreException(String message) {
-        super(message);
-    }
-
-    public UserStoreException(String message, Exception e) {
-        super(message, e);
-    }
-
-    public UserStoreException(Exception e) {
-        super(e);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/configurations/AbstractConfigurationReader.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/configurations/AbstractConfigurationReader.java b/modules/security/src/main/java/org/apache/airavata/security/configurations/AbstractConfigurationReader.java
deleted file mode 100644
index 5ba0915..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/configurations/AbstractConfigurationReader.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.configurations;
-
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Abstract implementation to read configurations.
- */
-public abstract class AbstractConfigurationReader {
-
-    public void init(String fileName) throws IOException, SAXException, ParserConfigurationException {
-
-        File configurationFile = new File(fileName);
-
-        if (!configurationFile.canRead()) {
-            throw new IOException("Error reading configuration file " + configurationFile.getAbsolutePath());
-        }
-
-        FileInputStream streamIn = new FileInputStream(configurationFile);
-
-        try {
-            init(streamIn);
-        } finally {
-            streamIn.close();
-        }
-    }
-
-    public abstract void init(InputStream inputStream) throws IOException, ParserConfigurationException, SAXException;
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReader.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReader.java b/modules/security/src/main/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReader.java
deleted file mode 100644
index 278c8a9..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReader.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.configurations;
-
-import org.apache.airavata.security.AbstractAuthenticator;
-import org.apache.airavata.security.Authenticator;
-import org.apache.airavata.security.UserStore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Document;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-
-/**
- * This class will read authenticators.xml and load all configurations related to authenticators.
- */
-public class AuthenticatorConfigurationReader extends AbstractConfigurationReader {
-
-    private List<Authenticator> authenticatorList = new ArrayList<Authenticator>();
-
-    protected static Logger log = LoggerFactory.getLogger(AuthenticatorConfigurationReader.class);
-
-    protected static boolean authenticationEnabled = true;
-
-    public AuthenticatorConfigurationReader() {
-
-    }
-
-    public void init(InputStream inputStream) throws IOException, ParserConfigurationException, SAXException {
-
-        authenticationEnabled = true;
-
-        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
-        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
-        Document doc = dBuilder.parse(inputStream);
-        doc.getDocumentElement().normalize();
-
-        NodeList rootNodeList = doc.getElementsByTagName("authenticators");
-
-        if (rootNodeList == null || rootNodeList.getLength() == 0) {
-            throw new ParserConfigurationException("authenticators.xml should have authenticators root element.");
-        }
-
-        Node authenticatorsNode = rootNodeList.item(0);
-        NamedNodeMap rootAttributes = authenticatorsNode.getAttributes();
-
-        if (rootAttributes != null && rootAttributes.getNamedItem("enabled") != null) {
-
-            String enabledAttribute = rootAttributes.getNamedItem("enabled").getNodeValue();
-            if (enabledAttribute != null) {
-
-                if (enabledAttribute.equals("false")) {
-                    authenticationEnabled = false;
-                }
-            }
-        }
-
-        NodeList authenticators = doc.getElementsByTagName("authenticator");
-
-        for (int i = 0; i < authenticators.getLength(); ++i) {
-            Node node = authenticators.item(i);
-
-            if (node.getNodeType() == Node.ELEMENT_NODE) {
-
-                NamedNodeMap namedNodeMap = node.getAttributes();
-
-                String name = namedNodeMap.getNamedItem("name").getNodeValue();
-                String className = namedNodeMap.getNamedItem("class").getNodeValue();
-                String enabled = namedNodeMap.getNamedItem("enabled").getNodeValue();
-                String priority = namedNodeMap.getNamedItem("priority").getNodeValue();
-                String userStoreClass = namedNodeMap.getNamedItem("userstore").getNodeValue();
-
-                if (className == null) {
-                    reportError("class");
-                }
-
-                if (userStoreClass == null) {
-                    reportError("userstore");
-                }
-
-                Authenticator authenticator = createAuthenticator(name, className, enabled, priority, userStoreClass);
-
-                NodeList configurationNodes = node.getChildNodes();
-
-                for (int j = 0; j < configurationNodes.getLength(); ++j) {
-
-                    Node configurationNode = configurationNodes.item(j);
-
-                    if (configurationNode.getNodeType() == Node.ELEMENT_NODE) {
-
-                        if (configurationNode.getNodeName().equals("specificConfigurations")) {
-                            authenticator.configure(configurationNode);
-                        }
-                    }
-                }
-
-                if (authenticator.isEnabled()) {
-                    authenticatorList.add(authenticator);
-                }
-
-                Collections.sort(authenticatorList, new AuthenticatorComparator());
-
-                StringBuilder stringBuilder = new StringBuilder("Successfully initialized authenticator ");
-                stringBuilder.append(name).append(" with class ").append(className).append(" enabled? ")
-                        .append(enabled).append(" priority = ").append(priority);
-
-                log.debug(stringBuilder.toString());
-            }
-        }
-    }
-
-    private void reportError(String element) throws ParserConfigurationException {
-        throw new ParserConfigurationException("Error in configuration. Missing mandatory element " + element);
-    }
-
-    protected Authenticator createAuthenticator(String name, String className, String enabled, String priority,
-            String userStoreClassName) {
-
-        log.debug("Loading authenticator class " + className + " and name " + name);
-
-        // Load a class and instantiate an object
-        Class authenticatorClass;
-        try {
-            authenticatorClass = Class.forName(className, true, Thread.currentThread().getContextClassLoader());
-            // authenticatorClass = Class.forName(className);
-        } catch (ClassNotFoundException e) {
-            log.error("Error loading authenticator class " + className);
-            throw new RuntimeException("Error loading authenticator class " + className, e);
-
-        }
-
-        try {
-            AbstractAuthenticator authenticatorInstance = (AbstractAuthenticator) authenticatorClass.newInstance();
-            authenticatorInstance.setAuthenticatorName(name);
-
-            if (enabled != null) {
-                authenticatorInstance.setEnabled(Boolean.parseBoolean(enabled));
-            }
-
-            if (priority != null) {
-                authenticatorInstance.setPriority(Integer.parseInt(priority));
-            }
-
-            UserStore userStore = createUserStore(userStoreClassName);
-            authenticatorInstance.setUserStore(userStore);
-
-            return authenticatorInstance;
-
-        } catch (InstantiationException e) {
-            String error = "Error instantiating authenticator class " + className + " object.";
-            log.error(error);
-            throw new RuntimeException(error, e);
-
-        } catch (IllegalAccessException e) {
-            String error = "Not allowed to instantiate authenticator class " + className;
-            log.error(error);
-            throw new RuntimeException(error, e);
-        }
-
-    }
-
-    protected UserStore createUserStore(String userStoreClassName) {
-
-        try {
-            Class userStoreClass = Class.forName(userStoreClassName, true, Thread.currentThread()
-                    .getContextClassLoader());
-
-            return (UserStore) userStoreClass.newInstance();
-        } catch (ClassNotFoundException e) {
-            log.error("Error loading authenticator class " + userStoreClassName);
-            throw new RuntimeException("Error loading authenticator class " + userStoreClassName, e);
-
-        } catch (InstantiationException e) {
-            String error = "Error instantiating authenticator class " + userStoreClassName + " object.";
-            log.error(error);
-            throw new RuntimeException(error, e);
-
-        } catch (IllegalAccessException e) {
-            String error = "Not allowed to instantiate authenticator class " + userStoreClassName;
-            log.error(error);
-            throw new RuntimeException(error, e);
-        }
-
-    }
-
-    public List<Authenticator> getAuthenticatorList() {
-        return Collections.unmodifiableList(authenticatorList);
-    }
-
-    /**
-     * We can specify whether authentication is enabled in the system for all request or not. This we can state in the
-     * configuration. AuthenticatorConfigurationReader will read that information and will populate that to static
-     * boolean authenticationEnabled. This method will say whether authentication is enabled in the system or disabled
-     * in the system.
-     * 
-     * @return <code>true</code> if authentication is enabled. Else <code>false</code>.
-     */
-    public static boolean isAuthenticationEnabled() {
-        return authenticationEnabled;
-    }
-
-    /**
-     * Comparator to sort authenticators based on authenticator priority.
-     */
-    public class AuthenticatorComparator implements Comparator<Authenticator> {
-
-        @Override
-        public int compare(Authenticator o1, Authenticator o2) {
-            return (o1.getPriority() > o2.getPriority() ? -1 : (o1.getPriority() == o2.getPriority() ? 0 : 1));
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/userstore/AbstractJDBCUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/userstore/AbstractJDBCUserStore.java b/modules/security/src/main/java/org/apache/airavata/security/userstore/AbstractJDBCUserStore.java
deleted file mode 100644
index 96d2485..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/userstore/AbstractJDBCUserStore.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.userstore;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.ApplicationSettings;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.security.UserStore;
-import org.apache.airavata.security.UserStoreException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * An abstract implementation of the UserStore. This will encapsulate JDBC configurations reading code.
- */
-public abstract class AbstractJDBCUserStore implements UserStore {
-
-    protected static Logger log = LoggerFactory.getLogger(JDBCUserStore.class);
-
-    private String databaseURL = null;
-    private String databaseDriver = null;
-    private String databaseUserName = null;
-    private String databasePassword = null;
-
-    public String getDatabaseURL() {
-        return databaseURL;
-    }
-
-    public String getDatabaseDriver() {
-        return databaseDriver;
-    }
-
-    public String getDatabaseUserName() {
-        return databaseUserName;
-    }
-
-    public String getDatabasePassword() {
-        return databasePassword;
-    }
-
-    /**
-     * Configures primary JDBC parameters. i.e
-     *
-     * @param node An XML configuration node.
-     * @throws UserStoreException
-     */
-    public void configure(Node node) throws UserStoreException {
-
-        /**
-         * <specificConfigurations> <database> <jdbcUrl></jdbcUrl> <databaseDriver></databaseDriver>
-         * <userName></userName> <password></password> </database> </specificConfigurations>
-         */
-
-        NodeList databaseNodeList = node.getChildNodes();
-
-        Node databaseNode = null;
-
-        for (int k = 0; k < databaseNodeList.getLength(); ++k) {
-
-            Node n = databaseNodeList.item(k);
-
-            if (n != null && n.getNodeType() == Node.ELEMENT_NODE) {
-                databaseNode = n;
-            }
-        }
-
-        if (databaseNode != null) {
-            NodeList nodeList = databaseNode.getChildNodes();
-
-            for (int i = 0; i < nodeList.getLength(); ++i) {
-                Node n = nodeList.item(i);
-
-                if (n.getNodeType() == Node.ELEMENT_NODE) {
-
-                    Element element = (Element) n;
-
-                    if (element.getNodeName().equals("jdbcUrl")) {
-                        databaseURL = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("databaseDriver")) {
-                        databaseDriver = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("userName")) {
-                        databaseUserName = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("password")) {
-                        databasePassword = element.getFirstChild().getNodeValue();
-                    }
-                }
-            }
-        }
-
-        if (databaseURL == null || databaseUserName == null || databasePassword == null) {
-            // If database configurations are not specified in authenticators.xml we will read them from
-            // server.properties file.
-            try {
-                databaseDriver = ServerSettings.getCredentialStoreDBDriver();
-                databaseURL = ServerSettings.getCredentialStoreDBURL();
-                databaseUserName = ServerSettings.getCredentialStoreDBUser();
-                databasePassword = ServerSettings.getCredentialStoreDBPassword();
-
-            } catch (ApplicationSettingsException e) {
-                log.error("Error reading default user store DB configurations.");
-                throw new UserStoreException(e);
-            }
-
-            StringBuilder stringBuilder = new StringBuilder("User store configurations - dbDriver - ");
-            stringBuilder.append(databaseDriver);
-            stringBuilder.append(" URL - ").append(databaseURL).append(" DB user - ").append(databaseUserName);
-            log.info(stringBuilder.toString());
-
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/userstore/JDBCUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/userstore/JDBCUserStore.java b/modules/security/src/main/java/org/apache/airavata/security/userstore/JDBCUserStore.java
deleted file mode 100644
index f1a486d..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/userstore/JDBCUserStore.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.userstore;
-
-import org.apache.airavata.security.UserStoreException;
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.security.util.PasswordDigester;
-import org.apache.shiro.authc.AuthenticationException;
-import org.apache.shiro.authc.AuthenticationInfo;
-import org.apache.shiro.authc.AuthenticationToken;
-import org.apache.shiro.authc.UsernamePasswordToken;
-import org.apache.shiro.realm.jdbc.JdbcRealm;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
-
-import javax.sql.DataSource;
-
-/**
- * The JDBC user store implementation.
- */
-public class JDBCUserStore extends AbstractJDBCUserStore {
-
-    protected static Logger log = LoggerFactory.getLogger(JDBCUserStore.class);
-
-    private JdbcRealm jdbcRealm;
-
-    private PasswordDigester passwordDigester;
-
-    public JDBCUserStore() {
-        jdbcRealm = new JdbcRealm();
-    }
-
-    @Override
-    public boolean authenticate(String userName, Object credentials) throws UserStoreException {
-        AuthenticationToken authenticationToken = new UsernamePasswordToken(userName,
-                passwordDigester.getPasswordHashValue((String) credentials));
-
-        AuthenticationInfo authenticationInfo;
-        try {
-
-            authenticationInfo = jdbcRealm.getAuthenticationInfo(authenticationToken);
-            return authenticationInfo != null;
-
-        } catch (AuthenticationException e) {
-            log.debug(e.getLocalizedMessage(), e);
-            return false;
-        }
-    }
-
-    @Override
-    public boolean authenticate(Object credentials) throws UserStoreException {
-        log.error("JDBC user store only supports user name, password based authentication.");
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public void configure(Node node) throws UserStoreException {
-
-        super.configure(node);
-
-        /**
-         * <specificConfigurations> <database> <jdbcUrl></jdbcUrl> <databaseDriver></databaseDriver>
-         * <userName></userName> <password></password> <passwordHashMethod>MD5</passwordHashMethod>
-         * <userTableName></userTableName> <userNameColumnName></userNameColumnName>
-         * <passwordColumnName></passwordColumnName> </database> </specificConfigurations>
-         */
-
-        NodeList databaseNodeList = node.getChildNodes();
-
-        Node databaseNode = null;
-
-        for (int k = 0; k < databaseNodeList.getLength(); ++k) {
-
-            Node n = databaseNodeList.item(k);
-
-            if (n != null && n.getNodeType() == Node.ELEMENT_NODE) {
-                databaseNode = n;
-            }
-        }
-
-        String userTable = null;
-        String userNameColumn = null;
-        String passwordColumn = null;
-        String passwordHashMethod = null;
-
-        if (databaseNode != null) {
-            NodeList nodeList = databaseNode.getChildNodes();
-
-            for (int i = 0; i < nodeList.getLength(); ++i) {
-                Node n = nodeList.item(i);
-
-                if (n.getNodeType() == Node.ELEMENT_NODE) {
-
-                    Element element = (Element) n;
-
-                    if (element.getNodeName().equals("userTableName")) {
-                        userTable = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("userNameColumnName")) {
-                        userNameColumn = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("passwordColumnName")) {
-                        passwordColumn = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("passwordHashMethod")) {
-                        passwordHashMethod = element.getFirstChild().getNodeValue();
-                    }
-                }
-            }
-        }
-
-        passwordDigester = new PasswordDigester(passwordHashMethod);
-
-        try {
-            initializeDatabaseLookup(passwordColumn, userTable, userNameColumn);
-        } catch (Exception e) {
-            log.error("Error while initializing database configurations.", e);
-            throw new UserStoreException("Error while initializing database configurations.", e);
-        }
-
-        StringBuilder stringBuilder = new StringBuilder(
-                "Configuring DB parameters for authenticator with User name Table - ");
-        stringBuilder.append(userTable).append(" User name column - ").append(userNameColumn)
-                .append(" Password column - ").append(passwordColumn);
-
-        log.debug(stringBuilder.toString());
-    }
-
-    protected void initializeDatabaseLookup(String passwordColumn, String userTable, String userNameColumn) throws IllegalAccessException, ClassNotFoundException, InstantiationException {
-
-        DBUtil dbUtil = new DBUtil(getDatabaseURL(), getDatabaseUserName(), getDatabasePassword(), getDatabaseDriver());
-        DataSource dataSource = dbUtil.getDataSource();
-        jdbcRealm.setDataSource(dataSource);
-
-        StringBuilder stringBuilder = new StringBuilder();
-
-        stringBuilder.append("SELECT ").append(passwordColumn).append(" FROM ").append(userTable).append(" WHERE ")
-                .append(userNameColumn).append(" = ?");
-
-        jdbcRealm.setAuthenticationQuery(stringBuilder.toString());
-    }
-
-    public PasswordDigester getPasswordDigester() {
-        return passwordDigester;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/userstore/LDAPUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/userstore/LDAPUserStore.java b/modules/security/src/main/java/org/apache/airavata/security/userstore/LDAPUserStore.java
deleted file mode 100644
index c0ba288..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/userstore/LDAPUserStore.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.userstore;
-
-import org.apache.airavata.security.UserStore;
-import org.apache.airavata.security.UserStoreException;
-import org.apache.airavata.security.util.PasswordDigester;
-import org.apache.shiro.authc.AuthenticationException;
-import org.apache.shiro.authc.AuthenticationInfo;
-import org.apache.shiro.authc.AuthenticationToken;
-import org.apache.shiro.authc.UsernamePasswordToken;
-import org.apache.shiro.realm.ldap.JndiLdapContextFactory;
-import org.apache.shiro.realm.ldap.JndiLdapRealm;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
-
-/**
- * A user store which talks to LDAP server. User credentials and user information are stored in a LDAP server.
- */
-public class LDAPUserStore implements UserStore {
-
-    private JndiLdapRealm ldapRealm;
-
-    protected static Logger log = LoggerFactory.getLogger(LDAPUserStore.class);
-
-    private PasswordDigester passwordDigester;
-
-    public boolean authenticate(String userName, Object credentials) throws UserStoreException {
-
-        AuthenticationToken authenticationToken = new UsernamePasswordToken(userName,
-                passwordDigester.getPasswordHashValue((String) credentials));
-
-        AuthenticationInfo authenticationInfo;
-        try {
-            authenticationInfo = ldapRealm.getAuthenticationInfo(authenticationToken);
-        } catch (AuthenticationException e) {
-            log.warn(e.getLocalizedMessage(), e);
-            return false;
-        }
-
-        return authenticationInfo != null;
-
-    }
-
-    @Override
-    public boolean authenticate(Object credentials) throws UserStoreException {
-        log.error("LDAP user store only supports authenticating with user name and password.");
-        throw new NotImplementedException();
-    }
-
-    public void configure(Node specificConfigurationNode) throws UserStoreException {
-
-        /**
-         * <specificConfiguration> <ldap> <url>ldap://localhost:10389</url> <systemUser>admin</systemUser>
-         * <systemUserPassword>secret</systemUserPassword> <userDNTemplate>uid={0},ou=system</userDNTemplate> </ldap>
-         * </specificConfiguration>
-         */
-
-        Node configurationNode = null;
-        if (specificConfigurationNode != null) {
-            NodeList nodeList = specificConfigurationNode.getChildNodes();
-
-            for (int i = 0; i < nodeList.getLength(); ++i) {
-                Node n = nodeList.item(i);
-                if (n.getNodeType() == Node.ELEMENT_NODE) {
-                    configurationNode = n;
-                }
-            }
-        }
-
-        String url = null;
-        String systemUser = null;
-        String systemUserPassword = null;
-        String userTemplate = null;
-        String passwordHashMethod = null;
-
-        if (configurationNode != null) {
-            NodeList nodeList = configurationNode.getChildNodes();
-
-            for (int i = 0; i < nodeList.getLength(); ++i) {
-                Node n = nodeList.item(i);
-
-                if (n.getNodeType() == Node.ELEMENT_NODE) {
-
-                    Element element = (Element) n;
-
-                    if (element.getNodeName().equals("url")) {
-                        url = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("systemUser")) {
-                        systemUser = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("systemUserPassword")) {
-                        systemUserPassword = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("userDNTemplate")) {
-                        userTemplate = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("passwordHashMethod")) {
-                        passwordHashMethod = element.getFirstChild().getNodeValue();
-                    }
-                }
-            }
-        }
-
-        passwordDigester = new PasswordDigester(passwordHashMethod);
-
-        initializeLDAP(url, systemUser, systemUserPassword, userTemplate);
-
-    }
-
-    protected void initializeLDAP(String ldapUrl, String systemUser, String systemUserPassword, String userNameTemplate) {
-
-        JndiLdapContextFactory jndiLdapContextFactory = new JndiLdapContextFactory();
-
-        jndiLdapContextFactory.setUrl(ldapUrl);
-        jndiLdapContextFactory.setSystemUsername(systemUser);
-        jndiLdapContextFactory.setSystemPassword(systemUserPassword);
-
-        ldapRealm = new JndiLdapRealm();
-
-        ldapRealm.setContextFactory(jndiLdapContextFactory);
-        ldapRealm.setUserDnTemplate(userNameTemplate);
-
-        ldapRealm.init();
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/userstore/SessionDBUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/userstore/SessionDBUserStore.java b/modules/security/src/main/java/org/apache/airavata/security/userstore/SessionDBUserStore.java
deleted file mode 100644
index b332e68..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/userstore/SessionDBUserStore.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.userstore;
-
-import org.apache.airavata.security.UserStoreException;
-import org.apache.airavata.common.utils.DBUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import sun.reflect.generics.reflectiveObjects.NotImplementedException;
-
-import java.sql.SQLException;
-
-/**
- * User store which works on sessions. Will talk to database to check whether session ids are stored in the database.
- */
-public class SessionDBUserStore extends AbstractJDBCUserStore {
-
-    private String sessionTable;
-    private String sessionColumn;
-    private String comparingColumn;
-
-    protected DBUtil dbUtil;
-
-    protected static Logger log = LoggerFactory.getLogger(SessionDBUserStore.class);
-
-    @Override
-    public boolean authenticate(String userName, Object credentials) throws UserStoreException {
-        // This user store only supports session tokens.
-        throw new NotImplementedException();
-    }
-
-    @Override
-    public boolean authenticate(Object credentials) throws UserStoreException {
-
-        String sessionTicket = (String) credentials;
-
-        try {
-            String sessionString = dbUtil.getMatchingColumnValue(sessionTable, sessionColumn, sessionTicket);
-            return (sessionString != null);
-        } catch (SQLException e) {
-            throw new UserStoreException("Error querying database for session information.", e);
-        }
-    }
-
-    @Override
-    public void configure(Node node) throws UserStoreException {
-
-        super.configure(node);
-        /**
-         * <specificConfigurations> <sessionTable> </sessionTable> <sessionColumn></sessionColumn>
-         * <comparingColumn></comparingColumn> </specificConfigurations>
-         */
-
-        NodeList databaseNodeList = node.getChildNodes();
-
-        Node databaseNode = null;
-
-        for (int k = 0; k < databaseNodeList.getLength(); ++k) {
-
-            Node n = databaseNodeList.item(k);
-
-            if (n != null && n.getNodeType() == Node.ELEMENT_NODE) {
-                databaseNode = n;
-            }
-        }
-
-        if (databaseNode != null) {
-            NodeList nodeList = databaseNode.getChildNodes();
-
-            for (int i = 0; i < nodeList.getLength(); ++i) {
-                Node n = nodeList.item(i);
-
-                if (n.getNodeType() == Node.ELEMENT_NODE) {
-
-                    Element element = (Element) n;
-
-                    if (element.getNodeName().equals("sessionTable")) {
-                        sessionTable = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("sessionColumn")) {
-                        sessionColumn = element.getFirstChild().getNodeValue();
-                    } else if (element.getNodeName().equals("comparingColumn")) {
-                        comparingColumn = element.getFirstChild().getNodeValue();
-                    }
-                }
-            }
-        }
-
-        initializeDatabaseLookup();
-
-        StringBuilder stringBuilder = new StringBuilder(
-                "Configuring DB parameters for authenticator with Session Table - ");
-        stringBuilder.append(sessionTable).append(" Session column - ").append(sessionColumn)
-                .append(" Comparing column - ").append(comparingColumn);
-
-        log.debug(stringBuilder.toString());
-    }
-
-    private void initializeDatabaseLookup() throws RuntimeException {
-
-        try {
-            this.dbUtil = new DBUtil(getDatabaseURL(), getDatabaseUserName(), getDatabasePassword(), getDatabaseDriver());
-        } catch (ClassNotFoundException e) {
-            throw new RuntimeException("Error loading database driver. Driver class not found.", e);
-        } catch (InstantiationException e) {
-            throw new RuntimeException("Error loading database driver. Error instantiating driver object.", e);
-        } catch (IllegalAccessException e) {
-            throw new RuntimeException("Error loading database driver. Illegal access to driver object.", e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java b/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
deleted file mode 100644
index 113189c..0000000
--- a/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.util;
-
-import org.apache.airavata.common.utils.SecurityUtil;
-import org.apache.airavata.security.UserStoreException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.UnsupportedEncodingException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-
-/**
- * Contains some utility methods related to security.
- */
-public class PasswordDigester {
-
-    protected static Logger log = LoggerFactory.getLogger(PasswordDigester.class);
-
-    private String hashMethod;
-
-    /**
-     * Creates password digester
-     * 
-     * @param method
-     *            The particular hash method. E.g :- MD5, SHA1 etc ...
-     */
-    public PasswordDigester(String method) throws UserStoreException {
-        hashMethod = method;
-        validateHashAlgorithm();
-    }
-
-    /**
-     * Gets the hash value of a password.
-     * 
-     * @param password
-     *            Password.
-     * @return Hashed password.
-     * @throws UserStoreException
-     *             If an invalid hash method is given.
-     */
-    public String getPasswordHashValue(String password) throws UserStoreException {
-
-        if (hashMethod.equals(SecurityUtil.PASSWORD_HASH_METHOD_PLAINTEXT)) {
-            return password;
-        } else {
-            MessageDigest messageDigest = null;
-            try {
-                messageDigest = MessageDigest.getInstance(hashMethod);
-            } catch (NoSuchAlgorithmException e) {
-                throw new UserStoreException("Error creating message digest with hash algorithm - " + hashMethod, e);
-            }
-            try {
-                return new String(messageDigest.digest(password.getBytes("UTF-8")));
-            } catch (UnsupportedEncodingException e) {
-                throw new UserStoreException("Unable to create password digest", e);
-            }
-        }
-
-    }
-
-    private void validateHashAlgorithm() throws UserStoreException {
-
-        if (hashMethod == null) {
-            log.warn("Password hash method is not configured. Setting default to plaintext.");
-            hashMethod = SecurityUtil.PASSWORD_HASH_METHOD_PLAINTEXT;
-        } else {
-
-            // Validating configured hash method is correct.
-            if (!hashMethod.equals(SecurityUtil.PASSWORD_HASH_METHOD_PLAINTEXT)) {
-                try {
-                    MessageDigest.getInstance(hashMethod);
-                } catch (NoSuchAlgorithmException e) {
-                    String msg = "Invalid hash algorithm - " + hashMethod
-                            + ". Use Java style way of specifying hash algorithm. E.g :- MD5";
-                    log.error(msg);
-                    throw new UserStoreException(msg, e);
-                }
-            }
-        }
-
-    }
-
-    public String getHashMethod() {
-        return hashMethod;
-    }
-
-    public void setHashMethod(String hashMethod) {
-        this.hashMethod = hashMethod;
-    }
-}


[69/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonRunnerTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonRunnerTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonRunnerTestCase.java
new file mode 100644
index 0000000..c7a815f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonRunnerTestCase.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.jython;
+
+import java.util.LinkedList;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.jython.runner.JythonRunner;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.apache.airavata.xbaya.test.XBayaTestCase;
+import org.apache.airavata.xbaya.test.service.adder.AdderService;
+import org.apache.airavata.xbaya.test.service.multiplier.MultiplierService;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+
+public class JythonRunnerTestCase extends XBayaTestCase {
+
+    /**
+     * @throws WorkflowException
+     */
+    public void testRun() throws WorkflowException {
+
+        WorkflowCreator creator = new WorkflowCreator();
+        Workflow workflow = creator.createComplexMathWorkflow();
+        JythonScript script = new JythonScript(workflow, this.configuration);
+        script.create();
+        String jythonString = script.getJythonString();
+
+        AdderService adder = new AdderService();
+        adder.run();
+        String adderWSDLLoc = adder.getServiceWsdlLocation();
+
+        MultiplierService multiplier = new MultiplierService();
+        multiplier.run();
+        String multiplierWSDLLoc = multiplier.getServiceWsdlLocation();
+
+        LinkedList<String> arguments = new LinkedList<String>();
+        arguments.add("-topic");
+        arguments.add("complex-math");
+        arguments.add("-Adder_wsdl");
+        arguments.add(adderWSDLLoc);
+        arguments.add("-Adder_2_wsdl");
+        arguments.add(adderWSDLLoc);
+        arguments.add("-Multiplier_wsdl");
+        arguments.add(multiplierWSDLLoc);
+
+        JythonRunner runner = new JythonRunner();
+        runner.run(jythonString, arguments);
+        runner.run(jythonString, arguments);
+
+        adder.shutdownServer();
+        multiplier.shutdownServer();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonScriptTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonScriptTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonScriptTestCase.java
new file mode 100644
index 0000000..022b099
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonScriptTestCase.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.jython;
+
+import java.io.IOException;
+
+import org.apache.airavata.common.utils.IOUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.jython.runner.JythonRunner;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.apache.airavata.xbaya.test.XBayaTestCase;
+import org.apache.airavata.xbaya.test.service.adder.AdderService;
+import org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdderService;
+import org.apache.airavata.xbaya.test.service.arraygen.ArrayGeneratorService;
+import org.apache.airavata.xbaya.test.service.multiplier.MultiplierService;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+
+public class JythonScriptTestCase extends XBayaTestCase {
+
+    private WorkflowCreator workflowCreator;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        this.workflowCreator = new WorkflowCreator();
+    }
+
+    /**
+     * @throws IOException
+     * @throws WorkflowException
+     */
+    public void testSimpleMath() throws IOException, WorkflowException {
+        Workflow workflow = this.workflowCreator.createSimpleMathWorkflow();
+        JythonScript script = new JythonScript(workflow, this.configuration);
+        script.create();
+        String jythonString = script.getJythonString();
+        String filename = "tmp/simple-math.py";
+        IOUtil.writeToFile(jythonString, filename);
+
+        AdderService service = new AdderService();
+        service.run();
+        String adderWSDLLoc = service.getServiceWsdlLocation();
+
+        String[] arguments = new String[] { "-Adder_add_wsdl", adderWSDLLoc };
+        JythonRunner runner = new JythonRunner();
+        runner.run(jythonString, arguments);
+
+        service.shutdownServer();
+    }
+
+    /**
+     * @throws IOException
+     * @throws WorkflowException
+     */
+    public void testComplexMath() throws IOException, WorkflowException {
+        Workflow workflow = this.workflowCreator.createComplexMathWorkflow();
+        JythonScript script = new JythonScript(workflow, this.configuration);
+        script.create();
+        String jythonString = script.getJythonString();
+        String filename = "tmp/complex-math.py";
+        IOUtil.writeToFile(jythonString, filename);
+
+        AdderService adder = new AdderService();
+        adder.run();
+        String adderWSDLLoc = adder.getServiceWsdlLocation();
+
+        MultiplierService multiplier = new MultiplierService();
+        multiplier.run();
+        String multiplierWSDLLoc = multiplier.getServiceWsdlLocation();
+
+        String[] arguments = new String[] { "-topic", "complex-math", "-Adder_add_wsdl", adderWSDLLoc,
+                "-Adder_add_2_wsdl", adderWSDLLoc, "-Multiplier_multiply_wsdl", multiplierWSDLLoc };
+
+        JythonRunner runner = new JythonRunner();
+        runner.run(jythonString, arguments);
+
+        adder.shutdownServer();
+        multiplier.shutdownServer();
+    }
+
+    /**
+     * @throws IOException
+     * @throws WorkflowException
+     */
+    public void testArray() throws IOException, WorkflowException {
+        Workflow workflow = this.workflowCreator.createArrayWorkflow();
+        JythonScript script = new JythonScript(workflow, this.configuration);
+        script.create();
+        String jythonString = script.getJythonString();
+        String filename = "tmp/array-test.py";
+        IOUtil.writeToFile(jythonString, filename);
+
+        ArrayGeneratorService arrayGenerator = new ArrayGeneratorService();
+        arrayGenerator.run();
+        String arrayGeneratorWSDLLoc = arrayGenerator.getServiceWsdlLocation();
+
+        ArrayAdderService arrayAdder = new ArrayAdderService();
+        arrayAdder.run();
+        String arrayAdderWSDLLoc = arrayAdder.getServiceWsdlLocation();
+
+        String[] arguments = new String[] { "-topic", "array-test", "-ArrayAdder_add_wsdl", arrayAdderWSDLLoc,
+                "-ArrayGenerator_generate_wsdl", arrayGeneratorWSDLLoc };
+
+        JythonRunner runner = new JythonRunner();
+        runner.run(jythonString, arguments);
+
+        arrayGenerator.shutdownServer();
+        arrayAdder.shutdownServer();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/AllServices.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/AllServices.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/AllServices.java
new file mode 100644
index 0000000..e63027b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/AllServices.java
@@ -0,0 +1,115 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.test.service.adder.Adder;
+import org.apache.airavata.xbaya.test.service.adder.AdderImpl;
+import org.apache.airavata.xbaya.test.service.approver.Approver;
+import org.apache.airavata.xbaya.test.service.approver.ApproverImpl;
+import org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdder;
+import org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdderImpl;
+import org.apache.airavata.xbaya.test.service.arraygen.ArrayGenerator;
+import org.apache.airavata.xbaya.test.service.arraygen.ArrayGeneratorImpl;
+import org.apache.airavata.xbaya.test.service.echo.Echo;
+import org.apache.airavata.xbaya.test.service.echo.EchoImpl;
+import org.apache.airavata.xbaya.test.service.multiplier.Multiplier;
+import org.apache.airavata.xbaya.test.service.multiplier.MultiplierImpl;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsdl.WsdlDefinitions;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xservo.XService;
+import xsul.xservo_soap.XSoapDocLiteralService;
+import xsul.xservo_soap_http.HttpBasedServices;
+
+public class AllServices {
+
+    // private static final Logger logger = LoggerFactory.getLogger();
+
+    private int port;
+
+    private HttpBasedServices httpServices;
+
+    /**
+     * Constructs an AllService.
+     * 
+     * @param port
+     */
+    public AllServices(int port) {
+        this.port = port;
+    }
+
+    /**
+     * @throws IOException
+     */
+    public void startAll() throws IOException {
+        this.httpServices = new HttpBasedServices(this.port);
+
+        start(Adder.SERVICE_NAME, Adder.WSDL_NAME, Adder.WSDL_PATH, new AdderImpl());
+        start(Multiplier.SERVICE_NAME, Multiplier.WSDL_NAME, Multiplier.WSDL_PATH, new MultiplierImpl());
+        start(ArrayGenerator.SERVICE_NAME, ArrayGenerator.WSDL_NAME, ArrayGenerator.WSDL_PATH, new ArrayGeneratorImpl());
+        start(ArrayAdder.SERVICE_NAME, ArrayAdder.WSDL_NAME, ArrayAdder.WSDL_PATH, new ArrayAdderImpl());
+        start(Echo.SERVICE_NAME, Echo.WSDL_NAME, Echo.WSDL_PATH, new EchoImpl());
+
+        start(Approver.SERVICE_NAME, Approver.WSDL_NAME, Approver.WSDL_PATH, new ApproverImpl());
+    }
+
+    /**
+     * @param serviceName
+     * @param wsdlName
+     * @param wsdlPath
+     * @param serviceImpl
+     * @throws IOException
+     */
+    private void start(String serviceName, String wsdlName, String wsdlPath, Object serviceImpl) throws IOException {
+        String wsdlLocation = XBayaPathConstants.WSDL_DIRECTORY + File.separator + wsdlPath;
+        XService xservice = this.httpServices.addService(new XSoapDocLiteralService(serviceName, wsdlLocation,
+                serviceImpl));
+        xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
+        xservice.startService();
+
+        WsdlDefinitions wsdl = xservice.getWsdl();
+
+        File wsdlFile = new File(Service.SAMPLE_WSDL_DIRECTORY, wsdlName);
+        XMLUtil.saveXML(wsdl, wsdlFile);
+    }
+
+    /**
+     * @param args
+     * @throws IOException
+     */
+    public static void main(String args[]) throws IOException {
+        int port = 0;
+        if (args.length == 2) {
+            if ("-port".equalsIgnoreCase(args[0])) {
+                port = Integer.parseInt(args[1]);
+            }
+        }
+        AllServices service = new AllServices(port);
+        service.startAll();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/Service.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/Service.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/Service.java
new file mode 100644
index 0000000..ca6a4df
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/Service.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service;
+
+import java.io.File;
+
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+
+public interface Service {
+
+    /**
+     * SAMPLE_WSDL_DIRECTORY
+     */
+    public static final String SAMPLE_WSDL_DIRECTORY = XBayaPathConstants.WSDL_DIRECTORY + File.separator + "sample";
+
+    /**
+     * MATH_DIRECTORY_NAME
+     */
+    public static final String MATH_DIRECTORY_NAME = "math";
+
+    /**
+     * LOAD_DIRECTORY_NAME
+     */
+    public static final String LOAN_DIRECTORY_NAME = "loan";
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/ServiceNotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/ServiceNotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/ServiceNotificationSender.java
new file mode 100644
index 0000000..cd2db2b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/ServiceNotificationSender.java
@@ -0,0 +1,161 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service;
+
+import java.net.URI;
+import java.util.Properties;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.tracking.Notifier;
+import org.apache.airavata.workflow.tracking.NotifierFactory;
+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.axis2.addressing.EndpointReference;
+import org.apache.xmlbeans.XmlObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlDocument;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.XmlConstants;
+import xsul.lead.LeadContextHeader;
+import xsul.soap.SoapUtil;
+import xsul.soap11_util.Soap11Util;
+import xsul.soap12_util.Soap12Util;
+import xsul.xbeans_util.XBeansUtil;
+
+public class ServiceNotificationSender {
+
+    private final static Logger logger = LoggerFactory.getLogger(ServiceNotificationSender.class);
+
+    private final static String INVOKED_MESSAGE = "Service is invoked";
+
+    private final static String SENDING_RESULT_MESSAGE = "Sending successful result of invocation";
+
+    private Notifier notifier;
+
+    private InvocationEntity initiator;
+
+    private InvocationEntity receiver;
+
+    private InvocationContext invocationContext;
+
+    private WorkflowTrackingContext context;
+
+    private SoapUtil soapFragrance;
+
+    /**
+     * @param inputElement
+     * @return The ServiceNotificationSender
+     */
+    public static ServiceNotificationSender invoked(XmlElement inputElement) {
+        try {
+
+            XmlElement soapBody = (XmlElement) inputElement.getParent();
+            XmlElement soapEnvelope = (XmlElement) soapBody.getParent();
+            SoapUtil soapFragrance = SoapUtil.selectSoapFragrance(soapEnvelope,
+                    new SoapUtil[] { Soap11Util.getInstance(), Soap12Util.getInstance() });
+            XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
+            XmlElement leadHeader = soapHeader.element(LeadContextHeader.NS, LeadContextHeader.TYPE.getLocalPart());
+            logger.info("leadHeader: " + XMLUtil.xmlElementToString(leadHeader));
+            if (leadHeader == null) {
+                return null;
+            }
+            LeadContextHeader leadContext = new LeadContextHeader(leadHeader);
+            ServiceNotificationSender sender = new ServiceNotificationSender(soapFragrance, leadContext);
+            sender.serviceInvoked(inputElement);
+
+            return sender;
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            return null;
+        }
+    }
+
+    /**
+     * Constructs a ServiceNotificationSender.
+     * 
+     * @param soapFragrance
+     * @param leadContext
+     */
+    private ServiceNotificationSender(SoapUtil soapFragrance, LeadContextHeader leadContext) {
+        this.soapFragrance = soapFragrance;
+        this.notifier = NotifierFactory.createNotifier();
+
+        URI workflowID = leadContext.getWorkflowId();
+        String serviceIDString = leadContext.getServiceId();
+        if (serviceIDString == null) {
+            serviceIDString = "serviceIDWasNull";
+        }
+        URI serviceID = URI.create(serviceIDString);
+        String nodeID = leadContext.getNodeId();
+        String timeStepString = leadContext.getTimeStep();
+        Integer timeStep = null;
+        if (timeStepString != null) {
+            try {
+                timeStep = new Integer(timeStepString);
+            } catch (NumberFormatException e) {
+                logger.error(e.getMessage(), e);
+            }
+        }
+        this.initiator = this.notifier.createEntity(workflowID, serviceID, nodeID, timeStep);
+        this.receiver = this.notifier.createEntity(workflowID, serviceID, nodeID, timeStep);
+        EndpointReference epr = new EndpointReference(leadContext.getEventSink().getAddress().toString());
+        this.context = this.notifier.createTrackingContext(new Properties(), epr.toString(), workflowID, serviceID,
+                nodeID, timeStep);
+    }
+
+    /**
+     * @param inputElement
+     */
+    private void serviceInvoked(XmlElement inputElement) {
+        XmlElement soapBody = (XmlElement) inputElement.getParent();
+        XmlElement soapEnvelope = (XmlElement) soapBody.getParent();
+        XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
+        XmlObject headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
+        XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody);
+        this.invocationContext = this.notifier.serviceInvoked(this.context, this.initiator, headerObject, bodyObject,
+                INVOKED_MESSAGE);
+    }
+
+    /**
+     * @param outputElement
+     */
+    public void sendingResult(XmlElement outputElement) {
+        try {
+            XmlDocument document = this.soapFragrance.wrapBodyContent(outputElement);
+            XmlElement soapEnvelope = document.getDocumentElement();
+            XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
+            XmlElement soapBody = soapEnvelope.element(null, XmlConstants.S_BODY);
+            XmlObject headerObject = null;
+            if (soapHeader != null) {
+                headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
+            }
+            XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody);
+            this.notifier.sendingResult(this.context, this.invocationContext, headerObject, bodyObject,
+                    SENDING_RESULT_MESSAGE);
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/Adder.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/Adder.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/Adder.java
new file mode 100644
index 0000000..1d29245
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/Adder.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.adder;
+
+import java.io.File;
+
+import org.apache.airavata.xbaya.test.service.Service;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.xwsif_runtime.XmlElementBasedStub;
+
+public interface Adder extends XmlElementBasedStub {
+
+    /**
+     * SERVICE_NAME
+     */
+    public final static String SERVICE_NAME = "AdderService";
+
+    /**
+     * WSDL_NAME
+     */
+    public final static String WSDL_NAME = "adder.wsdl";
+
+    /**
+     * WSDL_PATH
+     */
+    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
+
+    /**
+     * @param input
+     *            the input message
+     * @return the output message
+     */
+    public XmlElement add(XmlElement input);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderClient.java
new file mode 100644
index 0000000..d3cfe7c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderClient.java
@@ -0,0 +1,114 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.adder;
+
+import java.net.URI;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xwsif_runtime.WSIFClient;
+import xsul.xwsif_runtime.WSIFRuntime;
+import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
+
+public class AdderClient {
+
+    private final static Logger logger = LoggerFactory.getLogger(AdderClient.class);
+
+    private AdderService service;
+
+    /**
+     * 
+     */
+    public void run() {
+        String wsdlLoc = startServer();
+        runClient(wsdlLoc);
+        shutdownServer();
+    }
+
+    private String startServer() {
+        this.service = new AdderService();
+        this.service.run();
+        return this.service.getServiceWsdlLocation();
+    }
+
+    private void shutdownServer() {
+        this.service.shutdownServer();
+    }
+
+    private void runClient(String wsdlLoc) {
+        logger.info("Invoking operation echoString using WSDL from " + wsdlLoc);
+
+        WSIFAsyncResponsesCorrelator correlator;
+        correlator = null;
+
+        // pass some headers
+        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
+        helper.setXBayaConfiguration(new XBayaConfiguration());
+        LeadContextHeader leadContext = helper.getLeadContextHeader();
+        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
+        leadContext.setNodeId("decoder1");
+        leadContext.setTimeStep("5");
+        leadContext.setServiceId("decoder-instance-10");
+
+        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
+                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
+                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
+        // seconds
+
+        WSIFPort port = wclient.getPort();
+        WSIFOperation operation = port.createOperation("add");
+        WSIFMessage inputMessage = operation.createInputMessage();
+        WSIFMessage outputMessage = operation.createOutputMessage();
+        WSIFMessage faultMessage = operation.createFaultMessage();
+
+        inputMessage.setObjectPart("x", "2");
+        inputMessage.setObjectPart("y", "3");
+
+        logger.info("Sending a message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
+        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
+
+        XmlElement result;
+        if (success) {
+            result = (XmlElement) outputMessage;
+        } else {
+            result = (XmlElement) faultMessage;
+        }
+        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        (new AdderClient()).run();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderImpl.java
new file mode 100644
index 0000000..ee37bf4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderImpl.java
@@ -0,0 +1,79 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.adder;
+
+import java.util.Random;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+import org.xmlpull.v1.builder.XmlNamespace;
+
+import xsul.XmlConstants;
+
+public class AdderImpl implements Adder {
+
+    private final static Logger logger = LoggerFactory.getLogger(AdderImpl.class);
+
+    /**
+     * @see org.apache.airavata.xbaya.test.service.adder.Adder#add(org.xmlpull.v1.builder.XmlElement)
+     */
+    public XmlElement add(XmlElement inputElement) {
+        logger.info(XMLUtil.xmlElementToString(inputElement));
+        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
+
+        XmlElement xElement = inputElement.requiredElement(null, "x");
+        XmlElement yElement = inputElement.requiredElement(null, "y");
+        String xString = xElement.requiredTextContent();
+        String yString = yElement.requiredTextContent();
+
+        int x = Integer.parseInt(xString);
+        int y = Integer.parseInt(yString);
+
+        int z = x + y;
+
+        Random random = new Random();
+        int msec = random.nextInt(5000);
+        logger.info("Sleep for " + msec + " msec");
+        try {
+            Thread.sleep(msec);
+        } catch (InterruptedException e) {
+            logger.error(e.getMessage(), e);
+        }
+
+        String zString = "" + z;
+
+        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("addertypens",
+                "http://www.extreme.indiana.edu/math/adder/xsd/");
+        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "AddOutput");
+        XmlElement zElement = outputElement.addElement("z");
+        zElement.addChild(zString);
+
+        if (notifier != null) {
+            notifier.sendingResult(outputElement);
+        }
+        logger.info(XMLUtil.xmlElementToString(outputElement));
+        return outputElement;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderService.java
new file mode 100644
index 0000000..d14e5f6
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderService.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.adder;
+
+import java.io.File;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsdl.WsdlDefinitions;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xservo.XService;
+import xsul.xservo_soap.XSoapDocLiteralService;
+import xsul.xservo_soap_http.HttpBasedServices;
+
+public class AdderService {
+
+    private final static String SERVICE_NAME = "AdderService";
+
+    private final static String BASE_WSDL_LOCATION = "wsdls/math/adder.wsdl";
+
+    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/adder.wsdl";
+
+    private final static Logger logger = LoggerFactory.getLogger(AdderService.class);
+
+    private HttpBasedServices httpServices;
+
+    private XService xservice;
+
+    private int port;
+
+    /**
+     * Constructs a AdderService.
+     */
+    public AdderService() {
+        this(0);
+    }
+
+    /**
+     * Constructs a AdderService.
+     * 
+     * @param port
+     */
+    public AdderService(int port) {
+        this.port = port;
+    }
+
+    /**
+     * Runs the service.
+     */
+    public void run() {
+        this.httpServices = new HttpBasedServices(this.port);
+        logger.info("Server started on " + this.httpServices.getServerPort());
+
+        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
+        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
+                new AdderImpl()));
+        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
+        this.xservice.startService();
+        logger.info("Service started");
+        logger.info("Service WSDL available at " + getServiceWsdlLocation());
+
+    }
+
+    /**
+     * Returns the location of the WSDL of the service.
+     * 
+     * @return The location of the WSDL of the service.
+     */
+    public String getServiceWsdlLocation() {
+        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
+    }
+
+    /**
+     * Returns the WSDL of the service.
+     * 
+     * @return The WSDL of the service.
+     */
+    public WsdlDefinitions getWsdl() {
+        return this.xservice.getWsdl();
+    }
+
+    /**
+     * Shutdowns the service.
+     */
+    public void shutdownServer() {
+        this.httpServices.getServer().shutdownServer();
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        try {
+            int port = 0;
+            if (args.length == 2) {
+                if ("-port".equalsIgnoreCase(args[0])) {
+                    port = Integer.parseInt(args[1]);
+                }
+            }
+            AdderService service = new AdderService(port);
+            service.run();
+            WsdlDefinitions wsdl = service.getWsdl();
+            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
+            XMLUtil.saveXML(wsdl, wsdlFile);
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/Approver.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/Approver.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/Approver.java
new file mode 100644
index 0000000..067770d
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/Approver.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.approver;
+
+import java.io.File;
+
+import org.apache.airavata.xbaya.test.service.Service;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.xwsif_runtime.XmlElementBasedStub;
+
+public interface Approver extends XmlElementBasedStub {
+
+    /**
+     * SERVICE_NAME
+     */
+    public final static String SERVICE_NAME = "ApproverService";
+
+    /**
+     * WSDL_NAME
+     */
+    public final static String WSDL_NAME = "approver.wsdl";
+
+    /**
+     * WSDL_PATH
+     */
+    public final static String WSDL_PATH = Service.LOAN_DIRECTORY_NAME + File.separator + WSDL_NAME;
+
+    /**
+     * @param input
+     *            the input message
+     * @return the output message
+     */
+    public XmlElement approve(XmlElement input);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverClient.java
new file mode 100644
index 0000000..954d93e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverClient.java
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.approver;
+
+import java.net.URI;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xwsif_runtime.WSIFClient;
+import xsul.xwsif_runtime.WSIFRuntime;
+import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
+
+public class ApproverClient {
+
+    private final static Logger logger = LoggerFactory.getLogger(ApproverClient.class);
+
+    private ApproverService service;
+
+    /**
+     * 
+     */
+    public void run() {
+        String wsdlLoc = startServer();
+        runClient(wsdlLoc);
+        shutdownServer();
+    }
+
+    private String startServer() {
+        this.service = new ApproverService();
+        this.service.run();
+        return this.service.getServiceWsdlLocation();
+    }
+
+    private void shutdownServer() {
+        this.service.shutdownServer();
+    }
+
+    private void runClient(String wsdlLoc) {
+        logger.info("Invoking operation echoString using WSDL from " + wsdlLoc);
+
+        WSIFAsyncResponsesCorrelator correlator;
+        correlator = null;
+
+        // pass some headers
+        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
+        helper.setXBayaConfiguration(new XBayaConfiguration());
+        LeadContextHeader leadContext = helper.getLeadContextHeader();
+        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
+        leadContext.setNodeId("decoder1");
+        leadContext.setTimeStep("5");
+        leadContext.setServiceId("decoder-instance-10");
+
+        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
+                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
+                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
+        // seconds
+
+        WSIFPort port = wclient.getPort();
+        WSIFOperation operation = port.createOperation("approve");
+        WSIFMessage inputMessage = operation.createInputMessage();
+        WSIFMessage outputMessage = operation.createOutputMessage();
+        WSIFMessage faultMessage = operation.createFaultMessage();
+
+        inputMessage.setObjectPart("amount", "100");
+
+        logger.info("Sending a message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
+        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
+
+        XmlElement result;
+        if (success) {
+            result = (XmlElement) outputMessage;
+        } else {
+            result = (XmlElement) faultMessage;
+        }
+        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        (new ApproverClient()).run();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverImpl.java
new file mode 100644
index 0000000..37bff40
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverImpl.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.approver;
+
+import java.util.Random;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+import org.xmlpull.v1.builder.XmlNamespace;
+
+import xsul.XmlConstants;
+
+public class ApproverImpl implements Approver {
+
+    private final static Logger logger = LoggerFactory.getLogger(ApproverImpl.class);
+
+    /**
+     * @see org.apache.airavata.xbaya.test.service.approver.Approver#approve(org.xmlpull.v1.builder.XmlElement)
+     */
+    public XmlElement approve(XmlElement inputElement) {
+        logger.info(XMLUtil.xmlElementToString(inputElement));
+        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
+
+        XmlElement amountElement = inputElement.requiredElement(null, "amount");
+        String amountString = amountElement.requiredTextContent();
+        int amount = Integer.parseInt(amountString);
+        logger.info("amount: " + amount);
+
+        Random random = new Random();
+        int msec = random.nextInt(5000);
+        logger.info("Sleep for " + msec + " msec");
+        try {
+            Thread.sleep(msec);
+        } catch (InterruptedException e) {
+            logger.error(e.getMessage(), e);
+        }
+
+        String accept = "No";
+
+        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("approvertypens",
+                "http://www.extreme.indiana.edu/loan/approver/xsd/");
+        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "ApproveOutput");
+        XmlElement acceptElement = outputElement.addElement("accept");
+        acceptElement.addChild(accept);
+
+        if (notifier != null) {
+            notifier.sendingResult(outputElement);
+        }
+        logger.info(XMLUtil.xmlElementToString(outputElement));
+        return outputElement;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverService.java
new file mode 100644
index 0000000..30caac2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverService.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.approver;
+
+import java.io.File;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsdl.WsdlDefinitions;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xservo.XService;
+import xsul.xservo_soap.XSoapDocLiteralService;
+import xsul.xservo_soap_http.HttpBasedServices;
+
+public class ApproverService {
+
+    private final static String SERVICE_NAME = "ApproverService";
+
+    private final static String BASE_WSDL_LOCATION = "wsdls/loan/approver-wsdl.xml";
+
+    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/approver-wsdl.xml";
+
+    private final static Logger logger = LoggerFactory.getLogger(ApproverService.class);
+
+    private HttpBasedServices httpServices;
+
+    private XService xservice;
+
+    private int port;
+
+    /**
+     * Constructs a AdderService.
+     */
+    public ApproverService() {
+        this(0);
+    }
+
+    /**
+     * Constructs a AdderService.
+     * 
+     * @param port
+     */
+    public ApproverService(int port) {
+        this.port = port;
+    }
+
+    /**
+     * Runs the service.
+     */
+    public void run() {
+        this.httpServices = new HttpBasedServices(this.port);
+        logger.info("Server started on " + this.httpServices.getServerPort());
+
+        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
+        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
+                new ApproverImpl()));
+        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
+        this.xservice.startService();
+        logger.info("Service started");
+        logger.info("Service WSDL available at " + getServiceWsdlLocation());
+
+    }
+
+    /**
+     * Returns the location of the WSDL of the service.
+     * 
+     * @return The location of the WSDL of the service.
+     */
+    public String getServiceWsdlLocation() {
+        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
+    }
+
+    /**
+     * Returns the WSDL of the service.
+     * 
+     * @return The WSDL of the service.
+     */
+    public WsdlDefinitions getWsdl() {
+        return this.xservice.getWsdl();
+    }
+
+    /**
+     * Shutdowns the service.
+     */
+    public void shutdownServer() {
+        this.httpServices.getServer().shutdownServer();
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        try {
+            int port = 0;
+            if (args.length == 2) {
+                if ("-port".equalsIgnoreCase(args[0])) {
+                    port = Integer.parseInt(args[1]);
+                }
+            }
+            ApproverService service = new ApproverService(port);
+            service.run();
+            WsdlDefinitions wsdl = service.getWsdl();
+            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
+            XMLUtil.saveXML(wsdl, wsdlFile);
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdder.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdder.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdder.java
new file mode 100644
index 0000000..4fc4bb9
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdder.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.arrayadder;
+
+import java.io.File;
+
+import org.apache.airavata.xbaya.test.service.Service;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.xwsif_runtime.XmlElementBasedStub;
+
+public interface ArrayAdder extends XmlElementBasedStub {
+
+    /**
+     * SERVICE_NAME
+     */
+    public final static String SERVICE_NAME = "ArrayAdderService";
+
+    /**
+     * WSDL_NAME
+     */
+    public final static String WSDL_NAME = "arrayadder.wsdl";
+
+    /**
+     * WSDL_PATH
+     */
+    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
+
+    /**
+     * @param input
+     *            the input message
+     * @return the output message
+     */
+    public XmlElement add(XmlElement input);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderClient.java
new file mode 100644
index 0000000..58786e2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderClient.java
@@ -0,0 +1,121 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.arrayadder;
+
+import java.net.URI;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.XmlConstants;
+import xsul.lead.LeadContextHeader;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xwsif_runtime.WSIFClient;
+import xsul.xwsif_runtime.WSIFRuntime;
+import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
+
+public class ArrayAdderClient {
+
+    private final static Logger logger = LoggerFactory.getLogger(ArrayAdderClient.class);
+
+    private ArrayAdderService service;
+
+    /**
+     * 
+     */
+    public void run() {
+        String wsdlLoc = startServer();
+        runClient(wsdlLoc);
+        shutdownServer();
+    }
+
+    private String startServer() {
+        this.service = new ArrayAdderService();
+        this.service.run();
+        return this.service.getServiceWsdlLocation();
+    }
+
+    private void shutdownServer() {
+        this.service.shutdownServer();
+    }
+
+    private void runClient(String wsdlLoc) {
+        logger.info("Invoking operation add using WSDL from " + wsdlLoc);
+
+        WSIFAsyncResponsesCorrelator correlator;
+        correlator = null;
+
+        // pass some headers
+        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
+        helper.setXBayaConfiguration(new XBayaConfiguration());
+        LeadContextHeader leadContext = helper.getLeadContextHeader();
+        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
+        leadContext.setNodeId("decoder1");
+        leadContext.setTimeStep("5");
+        leadContext.setServiceId("decoder-instance-10");
+
+        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
+                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
+                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
+        // seconds
+
+        WSIFPort port = wclient.getPort();
+        WSIFOperation operation = port.createOperation("add");
+        WSIFMessage inputMessage = operation.createInputMessage();
+        WSIFMessage outputMessage = operation.createOutputMessage();
+        WSIFMessage faultMessage = operation.createFaultMessage();
+
+        // Input
+        XmlElement arrayElement = XmlConstants.BUILDER.newFragment("input");
+        for (int i = 0; i < 5; i++) {
+            XmlElement valueElement = arrayElement.addElement("value");
+            valueElement.addChild("" + i);
+        }
+
+        inputMessage.setObjectPart("input", arrayElement);
+
+        logger.info("Sending a message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
+        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
+
+        XmlElement result;
+        if (success) {
+            result = (XmlElement) outputMessage;
+        } else {
+            result = (XmlElement) faultMessage;
+        }
+        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        (new ArrayAdderClient()).run();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderImpl.java
new file mode 100644
index 0000000..ab2792c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderImpl.java
@@ -0,0 +1,83 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.arrayadder;
+
+import java.util.Iterator;
+import java.util.Random;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+import org.xmlpull.v1.builder.XmlNamespace;
+
+import xsul.XmlConstants;
+
+public class ArrayAdderImpl implements ArrayAdder {
+
+    private final static Logger logger = LoggerFactory.getLogger(ArrayAdderImpl.class);
+
+    /**
+     * @see org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdder#add(org.xmlpull.v1.builder.XmlElement)
+     */
+    public XmlElement add(XmlElement inputElement) {
+        logger.info(XMLUtil.xmlElementToString(inputElement));
+
+        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
+
+        XmlElement arrayElement = inputElement.requiredElement(null, "input");
+
+        int sum = 0;
+        @SuppressWarnings("rawtypes")
+		Iterator valueIt = arrayElement.elements(null, "value").iterator();
+        while (valueIt.hasNext()) {
+            XmlElement valueElement = (XmlElement) valueIt.next();
+            String valueString = valueElement.requiredTextContent();
+            int value = Integer.parseInt(valueString);
+            sum += value;
+        }
+
+        Random random = new Random();
+        int msec = random.nextInt(5000);
+        logger.info("Sleep for " + msec + " msec");
+        try {
+            Thread.sleep(msec);
+        } catch (InterruptedException e) {
+            logger.error(e.getMessage(), e);
+        }
+
+        String sumString = "" + sum;
+
+        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("typens",
+                "http://www.extreme.indiana.edu/math/arrayadder/xsd/");
+        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "ArrayAdderOutput");
+        XmlElement sumElement = outputElement.addElement("sum");
+        sumElement.addChild(sumString);
+
+        if (notifier != null) {
+            notifier.sendingResult(outputElement);
+        }
+        logger.info(XMLUtil.xmlElementToString(outputElement));
+        return outputElement;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderService.java
new file mode 100644
index 0000000..b5f9cae
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderService.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.arrayadder;
+
+import java.io.File;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsdl.WsdlDefinitions;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xservo.XService;
+import xsul.xservo_soap.XSoapDocLiteralService;
+import xsul.xservo_soap_http.HttpBasedServices;
+
+public class ArrayAdderService {
+
+    private final static String SERVICE_NAME = "ArrayGeneratorService";
+
+    private final static String BASE_WSDL_LOCATION = "wsdls/math/arrayadder-wsdl.xml";
+
+    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/arrayadder-wsdl.xml";
+
+    private final static Logger logger = LoggerFactory.getLogger(ArrayAdderService.class);
+
+    private HttpBasedServices httpServices;
+
+    private XService xservice;
+
+    private int port;
+
+    /**
+     * Constructs a AdderService.
+     */
+    public ArrayAdderService() {
+        this(0);
+    }
+
+    /**
+     * Constructs a AdderService.
+     * 
+     * @param port
+     */
+    public ArrayAdderService(int port) {
+        this.port = port;
+    }
+
+    /**
+     * Runs the service.
+     */
+    public void run() {
+        this.httpServices = new HttpBasedServices(this.port);
+        logger.info("Server started on " + this.httpServices.getServerPort());
+
+        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
+        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
+                new ArrayAdderImpl()));
+        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
+        this.xservice.startService();
+        logger.info("Service started");
+        logger.info("Service WSDL available at " + getServiceWsdlLocation());
+
+    }
+
+    /**
+     * Returns the location of the WSDL of the service.
+     * 
+     * @return The location of the WSDL of the service.
+     */
+    public String getServiceWsdlLocation() {
+        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
+    }
+
+    /**
+     * Returns the WSDL of the service.
+     * 
+     * @return The WSDL of the service.
+     */
+    public WsdlDefinitions getWsdl() {
+        return this.xservice.getWsdl();
+    }
+
+    /**
+     * Shutdowns the service.
+     */
+    public void shutdownServer() {
+        this.httpServices.getServer().shutdownServer();
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        try {
+            int port = 0;
+            if (args.length == 2) {
+                if ("-port".equalsIgnoreCase(args[0])) {
+                    port = Integer.parseInt(args[1]);
+                }
+            }
+            ArrayAdderService service = new ArrayAdderService(port);
+            service.run();
+            WsdlDefinitions wsdl = service.getWsdl();
+            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
+            XMLUtil.saveXML(wsdl, wsdlFile);
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGenerator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGenerator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGenerator.java
new file mode 100644
index 0000000..4ffd01b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGenerator.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.arraygen;
+
+import java.io.File;
+
+import org.apache.airavata.xbaya.test.service.Service;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.xwsif_runtime.XmlElementBasedStub;
+
+public interface ArrayGenerator extends XmlElementBasedStub {
+
+    /**
+     * SERVICE_NAME
+     */
+    public final static String SERVICE_NAME = "ArrayGeneratorService";
+
+    /**
+     * WSDL_NAME
+     */
+    public final static String WSDL_NAME = "arraygen.wsdl";
+
+    /**
+     * WSDL_PATH
+     */
+    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
+
+    /**
+     * @param input
+     *            the input message
+     * @return the output message
+     */
+    public XmlElement generate(XmlElement input);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorClient.java
new file mode 100644
index 0000000..3256d6f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorClient.java
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.arraygen;
+
+import java.net.URI;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xwsif_runtime.WSIFClient;
+import xsul.xwsif_runtime.WSIFRuntime;
+import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
+
+public class ArrayGeneratorClient {
+
+    private final static Logger logger = LoggerFactory.getLogger(ArrayGeneratorClient.class);
+
+    private ArrayGeneratorService service;
+
+    /**
+     * 
+     */
+    public void run() {
+        String wsdlLoc = startServer();
+        runClient(wsdlLoc);
+        shutdownServer();
+    }
+
+    private String startServer() {
+        this.service = new ArrayGeneratorService();
+        this.service.run();
+        return this.service.getServiceWsdlLocation();
+    }
+
+    private void shutdownServer() {
+        this.service.shutdownServer();
+    }
+
+    private void runClient(String wsdlLoc) {
+        logger.info("Invoking operation echoString using WSDL from " + wsdlLoc);
+
+        WSIFAsyncResponsesCorrelator correlator;
+        correlator = null;
+
+        // pass some headers
+        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
+        helper.setXBayaConfiguration(new XBayaConfiguration());
+        LeadContextHeader leadContext = helper.getLeadContextHeader();
+        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
+        leadContext.setNodeId("decoder1");
+        leadContext.setTimeStep("5");
+        leadContext.setServiceId("decoder-instance-10");
+
+        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
+                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
+                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
+        // seconds
+
+        WSIFPort port = wclient.getPort();
+        WSIFOperation operation = port.createOperation("generate");
+        WSIFMessage inputMessage = operation.createInputMessage();
+        WSIFMessage outputMessage = operation.createOutputMessage();
+        WSIFMessage faultMessage = operation.createFaultMessage();
+
+        inputMessage.setObjectPart("n", "3");
+
+        logger.info("Sending a message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
+        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
+
+        XmlElement result;
+        if (success) {
+            result = (XmlElement) outputMessage;
+        } else {
+            result = (XmlElement) faultMessage;
+        }
+        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        (new ArrayGeneratorClient()).run();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorImpl.java
new file mode 100644
index 0000000..3f6cb9d
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorImpl.java
@@ -0,0 +1,77 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.arraygen;
+
+import java.util.Random;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+import org.xmlpull.v1.builder.XmlNamespace;
+
+import xsul.XmlConstants;
+
+public class ArrayGeneratorImpl implements ArrayGenerator {
+
+    private final static Logger logger = LoggerFactory.getLogger(ArrayGeneratorImpl.class);
+
+    /**
+     * @see org.apache.airavata.xbaya.test.service.arraygen.ArrayGenerator#generate(org.xmlpull.v1.builder.XmlElement)
+     */
+    public XmlElement generate(XmlElement inputElement) {
+        logger.info(XMLUtil.xmlElementToString(inputElement));
+
+        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
+
+        XmlElement nElement = inputElement.requiredElement(null, "n");
+        String nString = nElement.requiredTextContent();
+
+        int n = Integer.parseInt(nString);
+
+        Random random = new Random();
+        int msec = random.nextInt(5000);
+        logger.info("Sleep for " + msec + " msec");
+        try {
+            Thread.sleep(msec);
+        } catch (InterruptedException e) {
+            logger.error(e.getMessage(), e);
+        }
+
+        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("typens",
+                "http://www.extreme.indiana.edu/math/arraygen/xsd/");
+        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "ArrayGeneratorOutput");
+
+        XmlElement arrayElement = outputElement.addElement("output");
+        for (int i = 0; i < n; i++) {
+            XmlElement valueElement = arrayElement.addElement("value");
+            valueElement.addChild("" + i);
+        }
+
+        if (notifier != null) {
+            notifier.sendingResult(outputElement);
+        }
+        logger.info(XMLUtil.xmlElementToString(outputElement));
+        return outputElement;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorService.java
new file mode 100644
index 0000000..5685c69
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorService.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.arraygen;
+
+import java.io.File;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsdl.WsdlDefinitions;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xservo.XService;
+import xsul.xservo_soap.XSoapDocLiteralService;
+import xsul.xservo_soap_http.HttpBasedServices;
+
+public class ArrayGeneratorService {
+
+    private final static String SERVICE_NAME = "ArrayGeneratorService";
+
+    private final static String BASE_WSDL_LOCATION = "wsdls/math/arraygen-wsdl.xml";
+
+    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/arraygen-wsdl.xml";
+
+    private final static Logger logger = LoggerFactory.getLogger(ArrayGeneratorService.class);
+
+    private HttpBasedServices httpServices;
+
+    private XService xservice;
+
+    private int port;
+
+    /**
+     * Constructs a AdderService.
+     */
+    public ArrayGeneratorService() {
+        this(0);
+    }
+
+    /**
+     * Constructs a AdderService.
+     * 
+     * @param port
+     */
+    public ArrayGeneratorService(int port) {
+        this.port = port;
+    }
+
+    /**
+     * Runs the service.
+     */
+    public void run() {
+        this.httpServices = new HttpBasedServices(this.port);
+        logger.info("Server started on " + this.httpServices.getServerPort());
+
+        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
+        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
+                new ArrayGeneratorImpl()));
+        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
+        this.xservice.startService();
+        logger.info("Service started");
+        logger.info("Service WSDL available at " + getServiceWsdlLocation());
+
+    }
+
+    /**
+     * Returns the location of the WSDL of the service.
+     * 
+     * @return The location of the WSDL of the service.
+     */
+    public String getServiceWsdlLocation() {
+        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
+    }
+
+    /**
+     * Returns the WSDL of the service.
+     * 
+     * @return The WSDL of the service.
+     */
+    public WsdlDefinitions getWsdl() {
+        return this.xservice.getWsdl();
+    }
+
+    /**
+     * Shutdowns the service.
+     */
+    public void shutdownServer() {
+        this.httpServices.getServer().shutdownServer();
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        try {
+            int port = 0;
+            if (args.length == 2) {
+                if ("-port".equalsIgnoreCase(args[0])) {
+                    port = Integer.parseInt(args[1]);
+                }
+            }
+            ArrayGeneratorService service = new ArrayGeneratorService(port);
+            service.run();
+            WsdlDefinitions wsdl = service.getWsdl();
+            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
+            XMLUtil.saveXML(wsdl, wsdlFile);
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/Echo.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/Echo.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/Echo.java
new file mode 100644
index 0000000..bfc22db
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/Echo.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.echo;
+
+import java.io.File;
+
+import org.apache.airavata.xbaya.test.service.Service;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.xwsif_runtime.XmlElementBasedStub;
+
+public interface Echo extends XmlElementBasedStub {
+
+    /**
+     * SERVICE_NAME
+     */
+    public final static String SERVICE_NAME = "EchoService";
+
+    /**
+     * WSDL_NAME
+     */
+    public final static String WSDL_NAME = "echo.wsdl";
+
+    /**
+     * WSDL_PATH
+     */
+    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
+
+    /**
+     * @param input
+     *            the input message
+     * @return the output message
+     */
+    public XmlElement echo(XmlElement input);
+}
\ No newline at end of file


[64/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
new file mode 100644
index 0000000..340ab65
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
@@ -0,0 +1,424 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.descriptors;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.AbstractButton;
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JScrollPane;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
+import org.apache.airavata.xbaya.registrybrowser.nodes.JCRBrowserIcons;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.util.RegistryConstants;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class DescriptorEditorDialog extends JDialog {
+
+	private static final long serialVersionUID = 478151437279682576L;
+
+	private XBayaEngine engine;
+
+    private XBayaDialog dialog;
+
+    private AiravataAPI registry;
+
+	private JList descriptorList;
+
+	private Map<ApplicationDescription,String> dlist;
+
+	private JButton editButton;
+
+	private AbstractButton removeButton;
+	
+	private boolean descriptorChanged=false;
+	
+	public enum DescriptorType{
+		HOST,
+		SERVICE,
+		APPLICATION
+	};
+
+	public DescriptorType descriptorType;
+	
+    /**
+     * @param engine XBaya workflow engine
+     */
+    public DescriptorEditorDialog(XBayaEngine engine, DescriptorType descriptorType) {
+        this.engine = engine;
+        this.descriptorType=descriptorType;
+        setRegistry(engine.getConfiguration().getAiravataAPI());
+        initGUI();
+    }
+
+    /**
+     * Displays the dialog.
+     */
+    public void show() {
+        this.dialog.show();
+    }
+
+    public void hide() {
+        this.dialog.hide();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGUI() {
+    	descriptorList= new JList(new DefaultListModel());
+    	descriptorList.setCellRenderer(new DescriptorListCellRenderer(descriptorType));
+    	JScrollPane pane = new JScrollPane(descriptorList);
+    	
+    	descriptorList.addMouseListener(new MouseAdapter(){
+    		@Override
+    		public void mouseClicked(MouseEvent e) {
+    			if (e.getClickCount()==2){
+    				try {
+						editDescriptor();
+    				} catch (AiravataAPIInvocationException e1) {
+    					engine.getGUI().getErrorWindow().error("Error while editing descriptor", e1);
+    					e1.printStackTrace();
+    				}
+				}
+    		}
+    	});
+    	GridPanel infoPanel=new GridPanel();
+        infoPanel.add(pane);
+        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+        SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 1, 1, 0, 0);
+
+        JButton newButton = new JButton("New...");
+        newButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+            	try {
+					newDescriptor();
+        		} catch (AiravataAPIInvocationException e1) {
+        			engine.getGUI().getErrorWindow().error("Error while creating descriptors", e1);
+        			e1.printStackTrace();
+        		}
+            }
+        });
+        descriptorList.addListSelectionListener(new ListSelectionListener(){
+			public void valueChanged(ListSelectionEvent e) {
+				boolean isSelected=descriptorList.getSelectedIndex()!=-1;
+				editButton.setEnabled(isSelected);
+				removeButton.setEnabled(isSelected);
+			}
+        	
+        });
+        editButton = new JButton("Edit...");
+        editButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+            	try {
+					editDescriptor();
+        		} catch (AiravataAPIInvocationException e1) {
+        			engine.getGUI().getErrorWindow().error("Error while editing descriptor", e1);
+        			e1.printStackTrace();
+        		}
+            }
+
+        });
+        removeButton = new JButton("Remove");
+        removeButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+            	try {
+					deleteDescriptor();
+        		} catch (AiravataAPIInvocationException e1) {
+        			engine.getGUI().getErrorWindow().error("Error while removing descriptor", e1);
+        			e1.printStackTrace();
+        		}
+            }
+        });
+        JButton closeButton = new JButton("Close");
+        closeButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+        
+
+        GridPanel buttonPanel = new GridPanel();
+        buttonPanel.add(newButton);
+        buttonPanel.add(editButton);
+        buttonPanel.add(removeButton);
+        buttonPanel.add(closeButton);
+        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+        String title=null; 
+        switch (descriptorType){
+        	case HOST:
+        		title="Host Descriptions";
+        		break;
+        	case SERVICE:
+        		title="Applications";
+        		break;
+        	case APPLICATION:
+        		title="Application Descriptions";
+        		break;
+        }
+		this.dialog = new XBayaDialog(this.engine.getGUI(), title, infoPanel, buttonPanel);
+        this.dialog.setDefaultButton(editButton);
+        editButton.setEnabled(false);
+        removeButton.setEnabled(false);
+        try {
+			loadDescriptors();
+		} catch (AiravataAPIInvocationException e1) {
+			engine.getGUI().getErrorWindow().error("Error while loading descriptors", e1);
+			e1.printStackTrace();
+		}
+    }
+    
+    private void editDescriptor() throws AiravataAPIInvocationException {
+    	switch (descriptorType){
+	    	case HOST:
+	    		HostDescription h = (HostDescription) getSelected();
+	    		HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine.getConfiguration().getAiravataAPI(),false,h, null);
+	    		hostDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
+	    		hostDescriptionDialog.open();
+	    		if (hostDescriptionDialog.isHostCreated()) {
+					loadDescriptors();
+					setAsChanged();
+				}
+	    		break;
+	    	case SERVICE:
+	    		ServiceDescription d = (ServiceDescription) getSelected();
+	    		DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(getAPI(),false,d, null);
+	        	serviceDescriptionDialog.open();
+//	    		ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),false,d);
+//	    		serviceDescriptionDialog.open();
+	    		if (serviceDescriptionDialog.isServiceCreated()) {
+					loadDescriptors();
+					setAsChanged();
+				}
+	    		break;
+	    	case APPLICATION:
+                ApplicationDescription a = (ApplicationDescription) getSelected();
+                String[] s = dlist.get(a).split("\\$");
+                ApplicationDescriptionDialog aDescriptionDialog = new ApplicationDescriptionDialog(engine, false, a, s[1], s[0]);
+                aDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
+                aDescriptionDialog.open();
+                if (aDescriptionDialog.isApplicationDescCreated()) {
+                    loadDescriptors();
+					setAsChanged();
+                }
+			break;
+    	}
+	}
+
+	private void setAsChanged() {
+		descriptorChanged=true;
+    	if (DescriptorEditorDialog.this.descriptorType==DescriptorType.SERVICE){
+			reloadComponentRegistry();
+		}
+	}
+
+    private void newDescriptor() throws AiravataAPIInvocationException {
+    	switch (descriptorType){
+	    	case HOST:
+	    		HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine.getConfiguration().getAiravataAPI(), null);
+	    		hostDescriptionDialog.open();
+	    		if (hostDescriptionDialog.isHostCreated()){
+	    			loadDescriptors();
+					setAsChanged();
+	    		}
+	    		break;
+	    	case SERVICE:
+	    		DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(null, getAPI());
+	        	serviceDescriptionDialog.open();
+//	    		ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry());
+//	    		serviceDescriptionDialog.open();
+	    		if (serviceDescriptionDialog.isServiceCreated()){
+	    			loadDescriptors();
+					setAsChanged();
+	    		}
+	    		break;
+	    	case APPLICATION:
+	    		ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(engine);
+	    		applicationDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
+	    		applicationDescriptionDialog.open();
+	    		if (applicationDescriptionDialog.isApplicationDescCreated()){
+	    			loadDescriptors();
+					setAsChanged();
+	    		}
+	    		break;
+    	}
+		
+	}
+    
+	private Object getSelected() {
+		return descriptorList.getModel().getElementAt(descriptorList.getSelectedIndex());
+	}
+	protected boolean askQuestion(String title, String question) {
+        return JOptionPane.showConfirmDialog(this, question, title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
+    }
+    private boolean deleteDescriptor() throws AiravataAPIInvocationException{
+    	String title=null;
+    	String question=null;
+    	switch (descriptorType){
+	    	case HOST:
+	    		HostDescription h = (HostDescription) getSelected();
+	    		title = "Host description";
+	    		question = "Are you sure that you want to remove the service description \""
+	                    + h.getType().getHostName() + "\"?";
+	    		break;
+	    	case SERVICE:
+	        	ServiceDescription d = (ServiceDescription) getSelected();
+	    		title = "Service description";
+	    		question = "Are you sure that you want to remove the applications associated with \""
+	                    + d.getType().getName() + "\"?";
+	    		break;
+	    	case APPLICATION:
+	    		ApplicationDescription a = (ApplicationDescription) getSelected();
+	    		title = "Service description";
+	    		question = "Are you sure that you want to remove the service description \""
+	                    + a.getType().getApplicationName().getStringValue() + "\"?";
+	    		break;
+    	}
+    	
+        
+		if (askQuestion(title, question)) {
+            	switch (descriptorType){
+	    	    	case HOST:
+	    	    		HostDescription h = (HostDescription) getSelected();
+	    	        	getAPI().getApplicationManager().deleteHostDescription(h.getType().getHostName());
+                        loadDescriptors();
+    					setAsChanged();
+	    	    		break;
+	    	    	case SERVICE:
+	    	        	ServiceDescription d = (ServiceDescription) getSelected();
+	    	        	getAPI().getApplicationManager().deleteServiceDescription(d.getType().getName());
+                        loadDescriptors();
+    					setAsChanged();
+	    	    		break;
+	    	    	case APPLICATION:
+	    	    		ApplicationDescription a = (ApplicationDescription) getSelected();
+	    	    		String[] s = dlist.get(a).split("\\$");
+	    	        	getAPI().getApplicationManager().deleteApplicationDescription(s[0], s[1], a.getType().getApplicationName().getStringValue());
+	    	    		loadDescriptors();
+						setAsChanged();
+                        break;
+            	}
+//				loadDescriptors();
+        }
+        return true;
+    }
+
+	private void reloadComponentRegistry() {
+		ComponentRegistryLoader loader = ComponentRegistryLoader.getLoader(engine, RegistryConstants.REGISTRY_TYPE_JCR);
+		loader.load(engine.getConfiguration().getJcrComponentRegistry());
+	}
+    
+    private void loadDescriptors() throws AiravataAPIInvocationException {
+    	try {
+    		//allow the registry cache to update
+			Thread.sleep(500);
+		} catch (InterruptedException e1) {
+			e1.printStackTrace();
+		}
+    	((DefaultListModel)descriptorList.getModel()).removeAllElements();
+    		List<?> descriptors=null;
+			switch (descriptorType){
+	    	case HOST:
+	    		descriptors = getAPI().getApplicationManager().getAllHostDescriptions();
+	    		break;
+	    	case SERVICE:
+	    		descriptors = getAPI().getApplicationManager().getAllServiceDescriptions();
+	    		break;
+	    	case APPLICATION:
+	    		Map<String,ApplicationDescription> temp =getAPI().getApplicationManager().getApplicationDescriptors(null);
+                for(String value:temp.keySet()) {
+                    dlist.put(temp.get(value), value);
+
+                }
+	    		descriptors =Arrays.asList(dlist.keySet().toArray(new ApplicationDescription[]{}));
+	    		break;
+    		}
+    		for (Object d : descriptors) {
+				((DefaultListModel)descriptorList.getModel()).addElement(d);
+			}
+	}
+    
+    private static class DescriptorListCellRenderer extends DefaultListCellRenderer{
+		private static final long serialVersionUID = -1019715929291926180L;
+		private DescriptorType descriptorType;
+		public DescriptorListCellRenderer(DescriptorType descriptorType) {
+			this.descriptorType=descriptorType;
+		}
+		public Component getListCellRendererComponent(JList list, Object value,
+				int index, boolean isSelected, boolean cellHasFocus) {
+			Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+			if (c instanceof JLabel){
+				switch (descriptorType){
+		    	case HOST:
+		    		((JLabel) c).setText(((HostDescription)value).getType().getHostName());
+					((JLabel) c).setIcon(JCRBrowserIcons.HOST_ICON);
+		    		break;
+		    	case SERVICE:
+		    		((JLabel) c).setText(((ServiceDescription)value).getType().getName());
+					((JLabel) c).setIcon(JCRBrowserIcons.SERVICE_ICON);
+		    		break;
+		    	case APPLICATION:
+		    		((JLabel) c).setText(((ApplicationDescription)value).getType().getApplicationName().getStringValue());
+					((JLabel) c).setIcon(JCRBrowserIcons.APPLICATION_ICON);
+		    		break;
+				}
+				
+			}
+			return c;
+		}
+    	
+    }
+    public AiravataAPI getAPI() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorListDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorListDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorListDialog.java
new file mode 100644
index 0000000..fa4d03a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorListDialog.java
@@ -0,0 +1,261 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.descriptors;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.DefaultListModel;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JScrollPane;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.xbaya.registrybrowser.nodes.JCRBrowserIcons;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+
+public class DescriptorListDialog extends JDialog {
+
+	private static final long serialVersionUID = 478151437279682576L;
+
+	private XBayaGUI xbayaGUI;
+
+    private XBayaDialog dialog;
+
+    private AiravataAPI registry;
+
+	private JList descriptorList;
+
+	private Map<String[],ApplicationDescription> dlist;
+
+	private JButton okButton;
+	
+	private boolean serviceSelected=false;
+
+	public enum DescriptorType{
+		HOST,
+		SERVICE,
+		APPLICATION
+	};
+
+	public DescriptorType descriptorType;
+
+    /**
+     *
+     * @param registry
+     * @param descriptorType
+     */
+    public DescriptorListDialog(AiravataAPI registry, DescriptorType descriptorType) {
+        setRegistry(registry);
+        this.descriptorType=descriptorType;
+        initGUI();
+        
+    }
+
+    /**
+     * Displays the dialog.
+     */
+    public void open() {
+    	pack();
+    	setModal(true);
+        // Adjust the size if it's bigger than the screen.
+        Dimension size = getSize();
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        final int inset = 100;
+        int width = size.width;
+        if (width > screenSize.width) {
+            width = screenSize.width - inset;
+        }
+        int height = size.height;
+        if (height > screenSize.height) {
+            height = screenSize.height - inset;
+        }
+        setSize(width, height);
+
+        setLocationRelativeTo(null);
+        setVisible(true);
+    }
+
+    public void close() {
+        setVisible(false);
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGUI() {
+    	descriptorList= new JList(new DefaultListModel());
+    	descriptorList.setCellRenderer(new DescriptorListCellRenderer(descriptorType));
+    	JScrollPane pane = new JScrollPane(descriptorList);
+
+    	GridPanel infoPanel=new GridPanel();
+        infoPanel.add(pane);
+        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+        SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 1, 1, 0, 0);
+
+        descriptorList.addListSelectionListener(new ListSelectionListener(){
+			@Override
+			public void valueChanged(ListSelectionEvent e) {
+				boolean isSelected=descriptorList.getSelectedIndex()!=-1;
+				okButton.setEnabled(isSelected);
+			}
+        	
+        });
+        okButton = new JButton("OK");
+        okButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+            	serviceSelected=true;
+            	close();
+            }
+
+        });
+        JButton closeButton = new JButton("Cancel");
+        closeButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                close();
+            }
+        });
+        
+
+        GridPanel buttonPanel = new GridPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(closeButton);
+        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+        String title=null; 
+        switch (descriptorType){
+        	case HOST:
+        		title="Host Descriptions";
+        		break;
+        	case SERVICE:
+        		title="Service Descriptions";
+        		break;
+        	case APPLICATION:
+        		title="Application Descriptions";
+        		break;
+        }
+        getContentPane().add(infoPanel.getSwingComponent());
+        getContentPane().add(buttonPanel.getSwingComponent());
+        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
+        getRootPane().setDefaultButton(okButton);
+        okButton.setEnabled(false);
+        loadDescriptors();
+    }
+    
+	public Object getSelected() {
+		return descriptorList.getModel().getElementAt(descriptorList.getSelectedIndex());
+	}
+
+	protected boolean askQuestion(String title, String question) {
+        return JOptionPane.showConfirmDialog(null, question, title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
+    }
+    
+    private void loadDescriptors() {
+    	((DefaultListModel)descriptorList.getModel()).removeAllElements();
+    	try {
+    		List<?> descriptors=null;
+			switch (descriptorType){
+	    	case HOST:
+	    		descriptors = getRegistry().getApplicationManager().getAllHostDescriptions();
+	    		break;
+	    	case SERVICE:
+	    		descriptors = getRegistry().getApplicationManager().getAllServiceDescriptions();
+	    		break;
+	    	case APPLICATION:
+	    		dlist=getRegistry().getApplicationManager().getAllApplicationDescriptions();
+	    		descriptors =Arrays.asList(dlist.values().toArray(new ApplicationDescription[]{}));
+	    		break;
+    		}
+    		for (Object d : descriptors) {
+				((DefaultListModel)descriptorList.getModel()).addElement(d);
+			}
+		} catch (AiravataAPIInvocationException e) {
+			xbayaGUI.getErrorWindow().error(e);
+		}
+	}
+    
+    private static class DescriptorListCellRenderer extends DefaultListCellRenderer{
+		private static final long serialVersionUID = -1019715929291926180L;
+		private DescriptorType descriptorType;
+		public DescriptorListCellRenderer(DescriptorType descriptorType) {
+			this.descriptorType=descriptorType;
+		}
+		public Component getListCellRendererComponent(JList list, Object value,
+				int index, boolean isSelected, boolean cellHasFocus) {
+			Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+			if (c instanceof JLabel){
+				switch (descriptorType){
+		    	case HOST:
+		    		((JLabel) c).setText(((HostDescription)value).getType().getHostName());
+					((JLabel) c).setIcon(JCRBrowserIcons.HOST_ICON);
+		    		break;
+		    	case SERVICE:
+		    		((JLabel) c).setText(((ServiceDescription)value).getType().getName());
+					((JLabel) c).setIcon(JCRBrowserIcons.SERVICE_ICON);
+		    		break;
+		    	case APPLICATION:
+		    		((JLabel) c).setText(((ApplicationDescription)value).getType().getApplicationName().getStringValue());
+					((JLabel) c).setIcon(JCRBrowserIcons.APPLICATION_ICON);
+		    		break;
+				}
+				
+			}
+			return c;
+		}
+    	
+    }
+    public AiravataAPI getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+
+	public boolean isServiceSelected() {
+		return serviceSelected;
+	}
+
+	public void setServiceSelected(boolean serviceSelected) {
+		this.serviceSelected = serviceSelected;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
new file mode 100644
index 0000000..d544e16
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
@@ -0,0 +1,617 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.descriptors;
+
+import java.awt.Color;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextField;
+import javax.swing.ProgressMonitor;
+import javax.swing.SwingConstants;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.schemas.gfac.*;
+import org.apache.airavata.xbaya.ui.menues.MenuIcons;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLinkButton;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.xmlbeans.XmlException;
+
+public class HostDeploymentDialog extends JDialog implements ActionListener {
+    /**
+	 * 
+	 */
+    private static final long serialVersionUID = -2745085755585610025L;
+    private XBayaTextField txtExecPath;
+    private XBayaTextField txtTempDir;
+
+    private AiravataAPI registry;
+    private ApplicationDescription shellApplicationDescription;
+    private JLabel lblError;
+    private boolean applcationDescCreated = false;
+    private JButton okButton;
+
+    private String hostName;
+    private JComboBox cmbHostName;
+
+    private JButton btnHostAdvanceOptions;
+    private boolean newDescriptor;
+    private ApplicationDescription originalDescription;
+    private String originalHost;
+    private JButton btnTmpDirBrowse;
+    private JButton btnExecBrowse;
+    private List<String> existingHostList;
+
+    /**
+     * Create the dialog.
+     */
+    public HostDeploymentDialog(AiravataAPI registry, boolean newDescriptor,
+            ApplicationDescription originalDescription, String originalHost, List<String> existingHostList) {
+        setNewDescriptor(newDescriptor);
+        setOriginalDescription(originalDescription);
+        setOriginalHost(originalHost);
+        setRegistry(registry);
+        setExistingHostList(existingHostList);
+        iniGUI();
+    }
+
+    public void open() {
+        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+        setVisible(true);
+    }
+
+    protected HostDeploymentDialog getDialog() {
+        return this;
+    }
+
+    private void iniGUI() {
+        if (isNewDescriptor()) {
+            setTitle("New Application Deployment");
+        } else {
+            setTitle("Update Application Deployment: "
+                    + getOriginalDescription().getType().getApplicationName().getStringValue());
+        }
+        setBounds(100, 100, 600, 620);
+        setModal(true);
+        setLocationRelativeTo(null);
+        GridPanel buttonPane = new GridPanel();
+        {
+            lblError = new JLabel("");
+            lblError.setForeground(Color.RED);
+            buttonPane.add(lblError);
+            if (!isNewDescriptor()) {
+                JButton resetButton = new JButton("Reset");
+                resetButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        loadData();
+                    }
+                });
+                buttonPane.add(resetButton);
+            }
+            {
+                okButton = new JButton("Add");
+                if (!isNewDescriptor()) {
+                    okButton.setText("Update");
+                }
+                okButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        saveApplicationDescription();
+                        close();
+                    }
+                });
+                okButton.setEnabled(false);
+                okButton.setActionCommand("OK");
+                buttonPane.add(okButton);
+                getRootPane().setDefaultButton(okButton);
+            }
+            {
+                JButton cancelButton = new JButton("Cancel");
+                cancelButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        setApplicationDescCreated(false);
+                        close();
+                    }
+                });
+                cancelButton.setActionCommand("Cancel");
+                buttonPane.add(cancelButton);
+            }
+        }
+        {
+            JPanel execPath = new JPanel();
+            txtExecPath = new XBayaTextField();
+            txtExecPath.getTextField().addKeyListener(new KeyAdapter() {
+                @Override
+                public void keyReleased(KeyEvent e) {
+                    setExecutablePath(txtExecPath.getText());
+                }
+            });
+            txtExecPath.getTextField().addFocusListener(new FocusAdapter() {
+                @Override
+                public void focusLost(FocusEvent e) {
+                    super.focusLost(e);
+                    updateTempDirWithExecPath(txtExecPath.getText());
+                }
+            });
+            txtExecPath.setColumns(10);
+            btnExecBrowse = new JButton(MenuIcons.OPEN_ICON);
+            btnExecBrowse.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent arg0) {
+                    JFileChooser c = new JFileChooser();
+                    int rVal = c.showOpenDialog(null);
+                    if (rVal == JFileChooser.APPROVE_OPTION) {
+                        txtExecPath.setText(c.getSelectedFile().toString());
+                        setExecutablePath(txtExecPath.getText());
+                    }
+                }
+            });
+            execPath.add(txtExecPath.getSwingComponent());
+            execPath.add(btnExecBrowse);
+
+            setupLayoutForBrowse(execPath, txtExecPath.getSwingComponent());
+
+            JLabel lblExecutablePath = new JLabel("Executable path");
+            JPanel tmpDirPath = new JPanel();
+
+            txtTempDir = new XBayaTextField();
+            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
+                @Override
+                public void keyReleased(KeyEvent e) {
+                    setTempDir(txtTempDir.getText());
+                }
+            });
+            txtTempDir.setColumns(10);
+            btnTmpDirBrowse = new JButton(MenuIcons.OPEN_DIR_ICON);
+            btnTmpDirBrowse.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent arg0) {
+                    JFileChooser c = new JFileChooser();
+                    c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+                    int rVal = c.showOpenDialog(null);
+                    if (rVal == JFileChooser.APPROVE_OPTION) {
+                        txtTempDir.setText(c.getSelectedFile().toString());
+                        setTempDir(txtTempDir.getText());
+                    }
+                }
+            });
+            JTextField component = txtTempDir.getSwingComponent();
+            tmpDirPath.add(component);
+            tmpDirPath.add(btnTmpDirBrowse);
+
+            setupLayoutForBrowse(tmpDirPath, component);
+
+            JLabel lblTemporaryDirectory = new JLabel("Scratch working directory");
+
+            JButton btnAdvance = new JButton("Advanced application configurations...");
+            btnAdvance.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    try {
+                        ApplicationDescriptionAdvancedOptionDialog serviceDescriptionDialog = new ApplicationDescriptionAdvancedOptionDialog(
+                                getRegistry(), getShellApplicationDescription());
+                        serviceDescriptionDialog.open();
+                    } catch (Exception e1) {
+                        e1.printStackTrace();
+                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
+                    }
+                }
+            });
+
+            cmbHostName = new JComboBox();
+            cmbHostName.addActionListener(this);
+
+            XBayaLabel lblHostName = new XBayaLabel("Application host", cmbHostName);
+            XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
+            lnkNewHost.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    try {
+                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getRegistry(), null);
+                        hostDescriptionDialog.setLocationRelativeTo(getContentPane());
+                        hostDescriptionDialog.open();
+
+                        if (hostDescriptionDialog.isHostCreated()) {
+                            ProgressMonitor progressMonitor = new ProgressMonitor(getContentPane(),
+                                    "Host Descriptions", "Refreshing host list..", 0, 200);
+                            int progress = 1;
+                            progressMonitor.setProgress(progress++);
+                            while (cmbHostName.getSelectedIndex() == -1
+                                    || !cmbHostName.getSelectedItem().toString()
+                                            .equals(hostDescriptionDialog.getHostLocation())) {
+                                loadHostDescriptions();
+                                cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
+                                progressMonitor.setProgress(progress++);
+                                Thread.sleep(50);
+                            }
+                            progressMonitor.setProgress(200);
+                        }
+                    } catch (Exception e1) {
+                        e1.printStackTrace();
+                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
+                    }
+                }
+            });
+            lnkNewHost.setText("Create new host...");
+            lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);
+
+            btnHostAdvanceOptions = new JButton("HPC Configuration...");
+            btnHostAdvanceOptions.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent arg0) {
+                    try {
+                        ApplicationDescriptionHostAdvancedOptionDialog hostAdvancedOptionsDialog = new ApplicationDescriptionHostAdvancedOptionDialog(
+                                getRegistry(), getShellApplicationDescription());
+                        hostAdvancedOptionsDialog.open();
+                    } catch (Exception e1) {
+                        e1.printStackTrace();
+                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
+                    }
+                }
+            });
+            btnHostAdvanceOptions.setVisible(false);
+            GridPanel hostPanel = new GridPanel();
+            hostPanel.add(cmbHostName);
+            // hostPanel.add(btnHostAdvanceOptions);
+            hostPanel.add(new JLabel());
+
+            SwingUtil.layoutToGrid(hostPanel.getSwingComponent(), 1, 2, 0, 0);
+
+            GridPanel infoPanel1 = new GridPanel();
+
+            infoPanel1.add(lblExecutablePath);
+            infoPanel1.add(execPath);
+            infoPanel1.add(lblTemporaryDirectory);
+            infoPanel1.add(tmpDirPath);
+
+            GridPanel infoPanel3 = new GridPanel();
+
+            infoPanel3.add(lblHostName);
+            infoPanel3.add(hostPanel);
+            infoPanel3.add(new JLabel());
+            infoPanel3.add(lnkNewHost);
+
+            GridPanel infoPanel4 = new GridPanel();
+            // infoPanel4.add(new JLabel());
+            infoPanel4.add(btnHostAdvanceOptions);
+            infoPanel4.add(btnAdvance);
+            infoPanel4.layout(1, 2, 0, 0);
+
+            SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 4, 1, SwingUtil.WEIGHT_NONE, 0);
+            SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
+
+            GridPanel infoPanel = new GridPanel();
+            infoPanel.add(new JSeparator());
+            infoPanel.add(infoPanel3);
+            infoPanel.add(new JSeparator());
+            infoPanel.add(infoPanel1);
+
+            infoPanel.add(new JSeparator());
+            infoPanel.add(infoPanel4);
+
+            SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 6, 1, SwingUtil.WEIGHT_NONE, 0);
+            SwingUtil.layoutToGrid(buttonPane.getSwingComponent(), 1, buttonPane.getContentPanel().getComponentCount(),
+                    SwingUtil.WEIGHT_NONE, 0);
+            getContentPane().add(infoPanel.getSwingComponent());
+            getContentPane().add(buttonPane.getSwingComponent());
+
+            buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+            infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+
+            SwingUtil.layoutToGrid(getContentPane(), 2, 1, -1, 0);
+            loadHostDescriptions();
+        }
+        setResizable(true);
+        getRootPane().setDefaultButton(okButton);
+        if (!isNewDescriptor()) {
+            loadData();
+        }
+        pack();
+        if (getSize().getWidth() < 500) {
+            setSize(500, getSize().height);
+        }
+    }
+
+    private void setupLayoutForBrowse(JPanel tmpDirPath, JTextField component) {
+        GridBagLayout layout;
+        GridBagConstraints constraints;
+        layout = new GridBagLayout();
+        constraints = new GridBagConstraints();
+        constraints.fill = GridBagConstraints.BOTH;
+        constraints.weightx = 1;
+        layout.setConstraints(component, constraints);
+        tmpDirPath.setLayout(layout);
+    }
+
+    private void loadData() {
+        txtExecPath.setText(getOriginalDescription().getType().getExecutableLocation());
+        setExecutablePath(txtExecPath.getText());
+        txtTempDir.setText(getOriginalDescription().getType().getScratchWorkingDirectory());
+        setTempDir(txtTempDir.getText());
+
+        cmbHostName.setSelectedItem(getOriginalHost());
+        setHostName(cmbHostName.getSelectedItem().toString());
+        cmbHostName.setEnabled(isNewDescriptor());
+    }
+
+    private void loadHostDescriptions() {
+        cmbHostName.removeAllItems();
+        setHostName(null);
+        try {
+            List<HostDescription> hostDescriptions = getRegistry().getApplicationManager().getAllHostDescriptions();
+            for (HostDescription hostDescription : hostDescriptions) {
+                if (!isNewDescriptor() || !getExistingHostList().contains(hostDescription.getType().getHostName())) {
+                    cmbHostName.addItem(hostDescription.getType().getHostName());
+                }
+            }
+        } catch (Exception e) {
+            setError(e.getLocalizedMessage());
+        }
+        updateHostName();
+    }
+
+    public ApplicationDescription getShellApplicationDescription() {
+        if (shellApplicationDescription == null) {
+            if (isNewDescriptor()) {
+                shellApplicationDescription = new ApplicationDescription();
+            } else {
+                try {
+                    shellApplicationDescription = ApplicationDescription.fromXML(getOriginalDescription().toXML());
+                } catch (XmlException e) {
+                    // shouldn't happen (hopefully)
+                }
+            }
+        }
+        return shellApplicationDescription;
+    }
+
+    public ApplicationDeploymentDescriptionType getApplicationDescriptionType() {
+        return getShellApplicationDescription().getType();
+    }
+
+    public String getExecutablePath() {
+        return getApplicationDescriptionType().getExecutableLocation();
+    }
+
+    public void setExecutablePath(String executablePath) {
+        getApplicationDescriptionType().setExecutableLocation(executablePath);
+        updateTempDirWithExecPath(executablePath);
+        updateDialogStatus();
+    }
+
+    private void updateTempDirWithExecPath(String executablePath) {
+        // if (!executablePath.trim().equals("") && (!txtExecPath.getSwingComponent().isFocusOwner()) &&
+        // (getApplicationDescriptionType().getScratchWorkingDirectory()==null ||
+        // getApplicationDescriptionType().getScratchWorkingDirectory().trim().equalsIgnoreCase(""))){
+        // String temp_location = "workflow_runs";
+        // String tempDir = new File(new File(executablePath).getParentFile(),temp_location).toString();
+        // txtTempDir.setText(tempDir);
+        // txtTempDir.getSwingComponent().setSelectionStart(tempDir.length()-temp_location.length());
+        // txtTempDir.getSwingComponent().setSelectionEnd(tempDir.length());
+        // setTempDir(txtTempDir.getText());
+        // txtTempDir.getSwingComponent().requestFocus();
+        // }
+    }
+
+    public String getTempDir() {
+        return getApplicationDescriptionType().getScratchWorkingDirectory();
+    }
+
+    public void setTempDir(String tempDir) {
+        getApplicationDescriptionType().setScratchWorkingDirectory(tempDir);
+        updateDialogStatus();
+    }
+
+    public void close() {
+        getDialog().setVisible(false);
+    }
+
+    public void saveApplicationDescription() {
+        setApplicationDescCreated(true);
+    }
+
+    public boolean isApplicationDescCreated() {
+        return applcationDescCreated;
+    }
+
+    public void setApplicationDescCreated(boolean applicationDescCreated) {
+        this.applcationDescCreated = applicationDescCreated;
+    }
+
+    private void setError(String errorMessage) {
+        if (errorMessage == null || errorMessage.trim().equals("")) {
+            lblError.setText("");
+        } else {
+            lblError.setText(errorMessage.trim());
+        }
+    }
+
+    private void updateDialogStatus() {
+        String message = null;
+        try {
+            validateDialog();
+        } catch (Exception e) {
+            message = e.getLocalizedMessage();
+        }
+        okButton.setEnabled(message == null);
+        setError(message);
+    }
+
+    private void validateDialog() throws Exception {
+        if (getExecutablePath() == null || getExecutablePath().trim().equals("")) {
+            throw new Exception("Executable path cannot be empty!!!");
+        }
+
+        if (getTempDir() == null || getTempDir().trim().equals("")) {
+            throw new Exception("Temporary directory location cannot be empty!!!");
+        }
+
+        if (getHostName() == null || getHostName().trim().equals("")) {
+            throw new Exception("Please select/create host to bind to this deployment description");
+        }
+
+    }
+
+    public String getHostName() {
+        return hostName;
+    }
+
+    public void setHostName(String hostName) {
+        this.hostName = hostName;
+        if (hostName != null) {
+            HostDescription hostDescription;
+            try {
+                hostDescription = registry.getApplicationManager().getHostDescription(hostName);
+                if (hostDescription.getType() instanceof GlobusHostType || hostDescription.getType() instanceof UnicoreHostType || hostDescription.getType() instanceof GsisshHostType) {
+                    getShellApplicationDescription().getType().changeType(HpcApplicationDeploymentType.type);
+                }else if (hostDescription.getType() instanceof SSHHostType && ((SSHHostType)hostDescription.getType()).getHpcResource()) {
+                    getShellApplicationDescription().getType().changeType(HpcApplicationDeploymentType.type);
+                } else {
+                    getShellApplicationDescription().getType().changeType(ApplicationDeploymentDescriptionType.type);
+                }
+                btnHostAdvanceOptions.setVisible(getShellApplicationDescription().getType() instanceof HpcApplicationDeploymentType);
+                String hostAddress = hostDescription.getType().getHostAddress();
+                boolean isLocal = isLocalAddress(hostAddress);
+                btnExecBrowse.setVisible(isLocal);
+                btnTmpDirBrowse.setVisible(isLocal);
+            } catch (AiravataAPIInvocationException e) {
+                e.printStackTrace();
+            }
+        }
+        updateDialogStatus();
+    }
+
+    private boolean isLocalAddress(String hostAddress) {
+        return hostAddress.equalsIgnoreCase("localhost") || hostAddress.equalsIgnoreCase("127.0.0.1");
+    }
+
+    private void updateHostName() {
+        if (cmbHostName.getSelectedItem() != null) {
+            setHostName(cmbHostName.getSelectedItem().toString());
+        }
+    }
+
+    public void actionPerformed(ActionEvent e) {
+        if (e.getSource() == cmbHostName) {
+            updateHostName();
+        }
+        if (e.getSource() == txtExecPath) {
+            setExecutablePath(txtExecPath.getText());
+        }
+        if (e.getSource() == txtTempDir) {
+            setTempDir(txtTempDir.getText());
+        }
+    }
+
+    public AiravataAPI getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+
+    public boolean isNewDescriptor() {
+        return newDescriptor;
+    }
+
+    public void setNewDescriptor(boolean newDescriptor) {
+        this.newDescriptor = newDescriptor;
+    }
+
+    public ApplicationDescription getOriginalDescription() {
+        return originalDescription;
+    }
+
+    public void setOriginalDescription(ApplicationDescription originalDescription) {
+        this.originalDescription = originalDescription;
+    }
+
+    public String getOriginalHost() {
+        return originalHost;
+    }
+
+    public void setOriginalHost(String originalHost) {
+        this.originalHost = originalHost;
+    }
+
+    public HostDeployment execute() throws AiravataAPIInvocationException {
+        open();
+        if (isApplicationDescCreated()) {
+            return new HostDeployment(getRegistry().getApplicationManager().getHostDescription(getHostName()),
+                    getShellApplicationDescription());
+        }
+        return null;
+    }
+
+    public List<String> getExistingHostList() {
+        return existingHostList;
+    }
+
+    public void setExistingHostList(List<String> existingHostList) {
+        this.existingHostList = existingHostList;
+    }
+
+    public static class HostDeployment {
+        private HostDescription hostDescription;
+        private ApplicationDescription applicationDescription;
+
+        public HostDeployment(HostDescription hostDescription, ApplicationDescription applicationDescription) {
+            setHostDescription(hostDescription);
+            setApplicationDescription(applicationDescription);
+        }
+
+        public ApplicationDescription getApplicationDescription() {
+            return applicationDescription;
+        }
+
+        public void setApplicationDescription(ApplicationDescription applicationDescription) {
+            this.applicationDescription = applicationDescription;
+        }
+
+        public HostDescription getHostDescription() {
+            return hostDescription;
+        }
+
+        public void setHostDescription(HostDescription hostDescription) {
+            this.hostDescription = hostDescription;
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
new file mode 100644
index 0000000..5dece7b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
@@ -0,0 +1,592 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.descriptors;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JFrame;
+import javax.swing.JLabel;
+import javax.swing.SwingConstants;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.schemas.gfac.Ec2HostType;
+import org.apache.airavata.schemas.gfac.ExportProperties;
+import org.apache.airavata.schemas.gfac.ExportProperties.Name;
+import org.apache.airavata.schemas.gfac.GlobusHostType;
+import org.apache.airavata.schemas.gfac.GsisshHostType;
+import org.apache.airavata.schemas.gfac.HostDescriptionType;
+import org.apache.airavata.schemas.gfac.SSHHostType;
+import org.apache.airavata.schemas.gfac.UnicoreHostType;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class HostDescriptionDialog extends JDialog {
+
+	private static final long serialVersionUID = -2910634296292034085L;
+
+    private XBayaTextField hostIdTextField;
+
+    private XBayaTextField hostAddressTextField;
+
+    private XBayaTextField gateKeeperTextField;
+
+    private XBayaTextField gridFTPTextField;
+
+    private HostDescription hostDescription;
+
+    private boolean hostCreated = false;
+
+    private AiravataAPI registry;
+
+	private XBayaLabel gateKeeperLabel;
+
+	private XBayaLabel gridFTPLabel;
+
+    private JLabel lblError;
+
+    private String hostId;
+
+    private JButton okButton;
+
+    private boolean newHost;
+
+    private HostDescription originalHostDescription;
+
+//    private XBayaEngine engine;
+
+	private JComboBox cmbResourceProtocol;
+
+	private GridPanel infoPanel2;
+
+	private XBayaTextField exportsTextField;
+
+	private XBayaTextField preJobCommandsTextField;
+
+	private XBayaTextField postJobCommandsTextField;
+
+	private XBayaLabel postJobCommandsTextFieldLabel;
+
+	private XBayaLabel preJobCommandsLabel;
+
+	private XBayaLabel exportsLabel;
+
+	private XBayaTextField fileEndPointPrefixTextField;
+
+	private XBayaLabel fileEndPointPrefixLabel;
+
+	private JCheckBox hpcResourceCheckBoxField;
+
+	private JLabel emptyLabel;
+
+	private static final String REMOTE_PROTOCOL_STR_LOCAL="Local";
+	private static final String REMOTE_PROTOCOL_STR_SSH="SSH";
+	private static final String REMOTE_PROTOCOL_STR_GLOBUS="Globus";
+	private static final String REMOTE_PROTOCOL_STR_UNICORE="Unicore";
+	private static final String REMOTE_PROTOCOL_STR_AMAZON_EC2="Amazon EC2";
+	private static final String REMOTE_PROTOCOL_STR_HADOOP="Hadoop";
+	private static final String REMOTE_PROTOCOL_GSI_SSH="GSI-SSH";
+
+
+    public HostDescriptionDialog(AiravataAPI registry, JFrame parent) {
+    	this(registry,true,null, parent);
+    }
+
+    /**
+     *
+     * @param registry
+     * @param newHost
+     * @param originalHostDescription
+     */
+    public HostDescriptionDialog(AiravataAPI registry, boolean newHost, HostDescription originalHostDescription, JFrame parent) {
+        super(parent);
+        setNewHost(newHost);
+        setOriginalHostDescription(originalHostDescription);
+        addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowOpened(WindowEvent arg0) {
+//                if (isNewHost()) {
+//					String baseName = "Host";
+//					int i = 1;
+//					String defaultName = baseName + i;
+//					try {
+//						while (getRegistry().getServiceDescription(defaultName) != null) {
+//							defaultName = baseName + (++i);
+//						}
+//					} catch (Exception e) {
+//						e.printStackTrace();
+//					}
+//					hostIdTextField.setText(defaultName);
+//				}
+            }
+        });
+        setRegistry(registry);
+        initGUI();
+    }
+
+    /**
+     * Displays the dialog.
+     */
+    public void open() {
+        setModal(true);
+        setLocationRelativeTo(getOwner());
+		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+		setVisible(true);
+    }
+
+    public void close() {
+    	setVisible(false);
+    }
+
+    private void ok() {
+        hostId = this.hostIdTextField.getText();
+        String hostAddress = this.hostAddressTextField.getText();
+
+        setHostId(hostId);
+        setHostLocation(hostAddress);
+        HostDescriptionType host = getHostDescription().getType();
+        if(host instanceof GlobusHostType) {
+        	((GlobusHostType)hostDescription.getType()).addGlobusGateKeeperEndPoint(this.gateKeeperTextField.getText());
+            ((GlobusHostType)hostDescription.getType()).addGridFTPEndPoint(this.gridFTPTextField.getText());
+        }else if (host instanceof UnicoreHostType){
+        	((UnicoreHostType)hostDescription.getType()).addUnicoreBESEndPoint(this.gateKeeperTextField.getText());
+            ((UnicoreHostType)hostDescription.getType()).addGridFTPEndPoint(this.gridFTPTextField.getText());
+        }else if (host instanceof SSHHostType){
+        	while(((SSHHostType)hostDescription.getType()).getFileEndPointPrefixArray().length>0){
+        		((SSHHostType)hostDescription.getType()).removeFileEndPointPrefix(0);
+        	}
+        	String[] prefixes = StringUtil.getElementsFromString(this.fileEndPointPrefixTextField.getText());
+        	for (String prefix : prefixes) {
+        		((SSHHostType)hostDescription.getType()).addNewFileEndPointPrefix().setStringValue(prefix);
+			}
+            ((SSHHostType)hostDescription.getType()).setHpcResource(hpcResourceCheckBoxField.isSelected());
+        }else if (host instanceof GsisshHostType){
+        	String[] exports = StringUtil.getElementsFromString(exportsTextField.getText());
+        	ExportProperties exportsElement = ((GsisshHostType)hostDescription.getType()).addNewExports();
+        	for (String export : exports) {
+        		String[] nameVal = StringUtil.getElementsFromString(export,"=",StringUtil.QUOTE);
+        		if (nameVal.length>0){
+            		Name name = exportsElement.addNewName();
+        			name.setStringValue(nameVal[0]);
+        			if (nameVal.length>1){
+        				name.setValue(nameVal[1]);
+        			}
+        		}
+			}
+            ((GsisshHostType)hostDescription.getType()).setPreJobCommandsArray(StringUtil.getElementsFromString(this.preJobCommandsTextField.getText()));
+            ((GsisshHostType)hostDescription.getType()).setPostJobCommandsArray(StringUtil.getElementsFromString(this.postJobCommandsTextField.getText()));
+        }
+        saveHostDescription();
+        close();
+    }
+
+    private GridPanel createPanelWithMessage(String message){
+    	GridPanel gridPanel = new GridPanel();
+    	JLabel lblMessage = new JLabel(message, SwingConstants.CENTER);
+		gridPanel.add(lblMessage);
+		lblMessage.setFont(new Font("Tahoma", Font.ITALIC, 11));
+    	gridPanel.layout(1,1, 0,0);
+    	return gridPanel;
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGUI() {
+    	setBounds(100, 100, 400, 350);
+    	setModal(true);
+        setLocationRelativeTo(null);
+        if (isNewHost()) {
+			setTitle("Register Host");
+		}else{
+			setTitle("Update Host: "+getOriginalHostDescription().getType().getHostName());
+		}
+		this.hostIdTextField = new XBayaTextField();
+        this.hostAddressTextField = new XBayaTextField();
+
+        XBayaLabel hostIdLabel = new XBayaLabel("Host ID", this.hostIdTextField);
+        XBayaLabel hostAddressLabel = new XBayaLabel("Host Address", this.hostAddressTextField);
+        cmbResourceProtocol = new JComboBox(new String[]{REMOTE_PROTOCOL_STR_LOCAL,REMOTE_PROTOCOL_STR_SSH,REMOTE_PROTOCOL_STR_GLOBUS,REMOTE_PROTOCOL_STR_UNICORE,REMOTE_PROTOCOL_STR_AMAZON_EC2, REMOTE_PROTOCOL_STR_HADOOP, REMOTE_PROTOCOL_GSI_SSH});
+        JLabel lblResourceProtocol = new JLabel("Resource Protocol");
+        GridPanel pnlResourceProtocolSelection=new GridPanel();
+        pnlResourceProtocolSelection.add(lblResourceProtocol);
+        pnlResourceProtocolSelection.add(cmbResourceProtocol);
+        pnlResourceProtocolSelection.layout(1, 2, 0, 1);
+        cmbResourceProtocol.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent arg0) {
+                updateRemoteProtocolTypeAndControls();
+            }
+        });
+        hostIdTextField.getSwingComponent().addKeyListener(new KeyAdapter() {
+            @Override
+            public void keyReleased(KeyEvent e) {
+            	updateDialogStatus();
+            }
+        });
+        hostAddressTextField.getSwingComponent().addKeyListener(new KeyAdapter() {
+            @Override
+            public void keyReleased(KeyEvent e) {
+            	updateDialogStatus();
+            }
+        });
+        GridPanel infoPanel1 = new GridPanel();
+        infoPanel1.add(hostIdLabel);
+        infoPanel1.add(this.hostIdTextField);
+        infoPanel1.add(hostAddressLabel);
+        infoPanel1.add(this.hostAddressTextField);
+//        infoPanel1.add(chkGobusHost);
+        infoPanel2 = new GridPanel();
+        infoPanel2.add(createPanelWithMessage("Initializing..."));
+        SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
+        SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE, 1);
+
+        GridPanel infoPanel = new GridPanel();
+
+        infoPanel.add(infoPanel1);
+        infoPanel.add(pnlResourceProtocolSelection);
+        infoPanel.add(infoPanel2);
+        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+        SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 3, 1, SwingUtil.WEIGHT_NONE, 0);
+
+        GridPanel buttonPanel = new GridPanel();
+        lblError = new JLabel();
+        lblError.setForeground(Color.RED);
+        buttonPanel.add(lblError);
+        okButton = new JButton("Save");
+        if (!isNewHost()) {
+			okButton.setText("Update");
+		}
+		okButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                ok();
+            }
+        });
+
+        buttonPanel.add(okButton);
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                close();
+            }
+        });
+
+        buttonPanel.add(cancelButton);
+        buttonPanel.layout(1,3,SwingUtil.WEIGHT_NONE,0);
+        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+
+        getContentPane().add(infoPanel.getSwingComponent());
+        getContentPane().add(buttonPanel.getSwingComponent());
+
+        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
+
+        getRootPane().setDefaultButton(okButton);
+        cmbResourceProtocol.setSelectedIndex(0);
+        updateRemoteProtocolTypeAndControls();
+        if (!isNewHost()) {
+			loadData();
+		}
+//        SwingUtil.addPlaceHolder(hostIdTextField.getSwingComponent(), "[unique name for the host]");
+//        SwingUtil.addPlaceHolder(hostAddressTextField.getSwingComponent(), "[a valid host address, eg: myhost.com, 127.0.0.1]");
+//        SwingUtil.addPlaceHolder(GridFTPTextField.getSwingComponent(), "[List of grid ftp endpoints]");
+//        SwingUtil.addPlaceHolder(globusGateKeeperTextField.getSwingComponent(), "[List of globus gate keeper endpoints]");
+        updateDialogStatus();
+    }
+
+	private GridPanel createGlobusRemoteProtocolPanel() {
+		GridPanel globusPanel = new GridPanel();
+        if (gridFTPTextField==null) {
+			this.gridFTPTextField = new XBayaTextField();
+			this.gateKeeperTextField = new XBayaTextField();
+			gateKeeperLabel = new XBayaLabel("GRAM Endpoint", this.gateKeeperTextField);
+	        gridFTPLabel = new XBayaLabel("Grid FTP Endpoint", this.gridFTPTextField);
+		}
+        globusPanel.add(gateKeeperLabel);
+        globusPanel.add(gateKeeperTextField);
+        globusPanel.add(gridFTPLabel);
+        globusPanel.add(gridFTPTextField);
+        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
+        return globusPanel;
+	}
+	
+	private GridPanel createSSHRemoteProtocolPanel() {
+		GridPanel globusPanel = new GridPanel();
+        if (fileEndPointPrefixTextField==null) {
+			this.fileEndPointPrefixTextField = new XBayaTextField();
+			this.hpcResourceCheckBoxField = new JCheckBox("HPC Resource");
+			fileEndPointPrefixLabel = new XBayaLabel("File Endpoint Prefix", this.fileEndPointPrefixTextField);
+			this.emptyLabel=new JLabel();
+		}
+        globusPanel.add(hpcResourceCheckBoxField);
+        globusPanel.add(emptyLabel);
+        globusPanel.add(fileEndPointPrefixLabel);
+        globusPanel.add(fileEndPointPrefixTextField);
+        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
+        return globusPanel;
+	}
+	
+	private GridPanel createGSISSHRemoteProtocolPanel() {
+		GridPanel globusPanel = new GridPanel();
+        if (exportsTextField==null) {
+			this.exportsTextField = new XBayaTextField();
+			this.preJobCommandsTextField = new XBayaTextField();
+			this.postJobCommandsTextField = new XBayaTextField();
+			exportsLabel = new XBayaLabel("Exports", this.exportsTextField);
+			preJobCommandsLabel = new XBayaLabel("Pre-job Commands", this.preJobCommandsTextField);
+			postJobCommandsTextFieldLabel = new XBayaLabel("Post-job Commands", this.postJobCommandsTextField);
+		}
+        globusPanel.add(exportsLabel);
+        globusPanel.add(exportsTextField);
+        globusPanel.add(preJobCommandsLabel);
+        globusPanel.add(preJobCommandsTextField);
+        globusPanel.add(postJobCommandsTextFieldLabel);
+        globusPanel.add(postJobCommandsTextField);
+        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 3, 2, SwingUtil.WEIGHT_NONE, 1);
+        return globusPanel;
+	}
+
+	private GridPanel createUnicoreRemoteProtocolPanel() {
+		GridPanel globusPanel = new GridPanel();
+        if (gridFTPTextField==null) {
+			this.gridFTPTextField = new XBayaTextField();
+			this.gateKeeperTextField = new XBayaTextField();
+			gateKeeperLabel = new XBayaLabel("Unicore Endpoint", this.gateKeeperTextField);
+	        gridFTPLabel = new XBayaLabel("GridFTP Endpoint", this.gridFTPTextField);
+		}
+        globusPanel.add(gateKeeperLabel);
+        globusPanel.add(gateKeeperTextField);
+        globusPanel.add(gridFTPLabel);
+        globusPanel.add(gridFTPTextField);
+        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
+        return globusPanel;
+	}
+    private void loadData() {
+    	HostDescriptionType t = getOriginalHostDescription().getType();
+    	hostIdTextField.setText(t.getHostName());
+		hostAddressTextField.setText(t.getHostAddress());
+		if (t instanceof GlobusHostType){
+			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_GLOBUS);
+			gateKeeperTextField.setText(StringUtil.createDelimiteredString(((GlobusHostType) t).getGlobusGateKeeperEndPointArray()));
+			gridFTPTextField.setText(StringUtil.createDelimiteredString(((GlobusHostType) t).getGridFTPEndPointArray()));
+		}else if (t instanceof SSHHostType){
+			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_SSH);
+			fileEndPointPrefixTextField.setText(StringUtil.createDelimiteredString(((SSHHostType)t).getFileEndPointPrefixArray()));
+			hpcResourceCheckBoxField.setSelected(((SSHHostType)t).getHpcResource());
+		}else if (t instanceof UnicoreHostType){
+			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_UNICORE);
+			gateKeeperTextField.setText(StringUtil.createDelimiteredString(((UnicoreHostType) t).getUnicoreBESEndPointArray()));
+			gridFTPTextField.setText(StringUtil.createDelimiteredString(((UnicoreHostType) t).getGridFTPEndPointArray()));
+		}else if (t instanceof Ec2HostType){
+			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_AMAZON_EC2);
+		}else if (t instanceof GsisshHostType){
+			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_GSI_SSH);
+			List<String> arr=new ArrayList<String>();
+			ExportProperties exports = ((GsisshHostType) t).getExports();
+			if (exports!=null) {
+				Name[] nameArray = exports.getNameArray();
+				for (Name name : nameArray) {
+					arr.add(name.getStringValue() + "="
+							+ StringUtil.quoteString(name.getValue(), "="));
+				}
+			}
+			exportsTextField.setText(StringUtil.createDelimiteredString(arr.toArray(new String[]{})));
+			preJobCommandsTextField.setText(StringUtil.createDelimiteredString(((GsisshHostType) t).getPreJobCommandsArray()));
+			postJobCommandsTextField.setText(StringUtil.createDelimiteredString(((GsisshHostType) t).getPostJobCommandsArray()));
+		}
+		hostIdTextField.setEditable(isNewHost());
+		updateRemoteProtocolTypeAndControls();
+	}
+
+    public String getHostId() {
+        return getHostDescription().getType().getHostName();
+    }
+
+    public void setHostId(String hostId) {
+        getHostDescription().getType().setHostName(hostId);
+        updateDialogStatus();
+    }
+
+    public String getHostLocation() {
+        return getHostDescription().getType().getHostName();
+    }
+
+    public void setHostLocation(String hostLocation) {
+        getHostDescription().getType().setHostAddress(hostLocation);
+        updateDialogStatus();
+    }
+
+    private void validateDialog() throws Exception {
+        if (isNewHost()) {
+			String hostName = this.hostIdTextField.getText();
+			if (hostName == null
+					|| hostName.trim().equals("")) {
+				throw new Exception("Id of the host cannot be empty!!!");
+			}
+			HostDescription hostDescription2 = null;
+		    hostDescription2 = getRegistry().getApplicationManager().getHostDescription(hostName);
+			if (hostDescription2 != null) {
+				throw new Exception(
+						"Host descriptor with the given id already exists!!!");
+			}
+		}
+        String hostAddress = this.hostAddressTextField.getText();
+		if (hostAddress == null || hostAddress.trim().equals("")) {
+            throw new Exception("Host location/ip cannot be empty!!!");
+        }
+    }
+
+    private void updateDialogStatus() {
+        String message = null;
+        try {
+            validateDialog();
+        } catch (Exception e) {
+            message = e.getLocalizedMessage();
+        }
+        okButton.setEnabled(message == null);
+        setError(message);
+    }
+
+    private void setError(String errorMessage) {
+        if (errorMessage == null || errorMessage.trim().equals("")) {
+            lblError.setText("");
+        } else {
+            lblError.setText(errorMessage.trim());
+        }
+
+    }
+
+    public boolean isHostCreated() {
+        return hostCreated;
+    }
+
+    public void setHostCreated(boolean hostCreated) {
+        this.hostCreated = hostCreated;
+    }
+
+    public HostDescription getHostDescription() {
+        if (hostDescription == null) {
+            hostDescription = new HostDescription(GlobusHostType.type);
+        }
+        return hostDescription;
+    }
+
+    public void saveHostDescription() {
+        HostDescription desc = getHostDescription();
+        try {
+        	if (getRegistry().getApplicationManager().isHostDescriptorExists(desc.getType().getHostName())){
+        		getRegistry().getApplicationManager().updateHostDescriptor(desc);
+        	}else{
+        		getRegistry().getApplicationManager().addHostDescription(desc);
+        	}
+			setHostCreated(true);
+		}catch (DescriptorAlreadyExistsException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}  catch (AiravataAPIInvocationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+
+		}
+    }
+
+    public AiravataAPI getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+    String previousProtocol=null;
+	private void updateRemoteProtocolTypeAndControls() {
+		String selectedProtocol=cmbResourceProtocol.getSelectedItem().toString();
+		if (previousProtocol==null || !previousProtocol.equals(selectedProtocol)){
+			infoPanel2.getContentPanel().removeAll();
+			if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_LOCAL)){
+				getHostDescription().getType().changeType(HostDescriptionType.type);
+				infoPanel2.add(createPanelWithMessage("No configurations needed."));
+			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_SSH)){
+				getHostDescription().getType().changeType(SSHHostType.type);
+				infoPanel2.add(createSSHRemoteProtocolPanel());
+			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_GLOBUS)){
+				getHostDescription().getType().changeType(GlobusHostType.type);
+				infoPanel2.add(createGlobusRemoteProtocolPanel());
+			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_UNICORE)){
+				getHostDescription().getType().changeType(UnicoreHostType.type);
+				infoPanel2.add(createUnicoreRemoteProtocolPanel());
+			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_AMAZON_EC2)){
+				getHostDescription().getType().changeType(Ec2HostType.type);
+				infoPanel2.add(createPanelWithMessage("No configurations needed."));
+			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_GSI_SSH)){
+				getHostDescription().getType().changeType(GsisshHostType.type);
+				infoPanel2.add(createGSISSHRemoteProtocolPanel());
+			}else{
+				infoPanel2.add(createPanelWithMessage("Not supported."));
+			}
+			infoPanel2.getContentPanel().setBorder(BorderFactory.createEtchedBorder());
+			infoPanel2.getContentPanel().updateUI();
+			infoPanel2.layout(1, 1,0,0);
+		}
+	}
+
+	public boolean isNewHost() {
+		return newHost;
+	}
+
+	public void setNewHost(boolean newHost) {
+		this.newHost = newHost;
+	}
+
+	public HostDescription getOriginalHostDescription() {
+		return originalHostDescription;
+	}
+
+	public void setOriginalHostDescription(HostDescription originalHostDescription) {
+		this.originalHostDescription = originalHostDescription;
+	}
+
+//	public XBayaEngine getEngine() {
+//		return engine;
+//	}
+//
+//	public void setEngine(XBayaEngine engine) {
+//		this.engine = engine;
+//	}
+}
\ No newline at end of file


[54/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentTreeNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentTreeNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentTreeNode.java
new file mode 100644
index 0000000..a2326ed
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentTreeNode.java
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets.component;
+
+import java.util.List;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.MutableTreeNode;
+
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistry;
+
+public class ComponentTreeNode extends DefaultMutableTreeNode {
+
+    private ComponentReference componentReference;
+
+    private ComponentRegistry componentRegistry;
+
+    /**
+     * Constructs a ComponentTreeNode.
+     * 
+     * @param name
+     */
+    public ComponentTreeNode(String name) {
+        super(name);
+    }
+
+    /**
+     * Constructs a ComponentTreeNode.
+     * 
+     * @param componentReference
+     */
+    public ComponentTreeNode(ComponentReference componentReference) {
+        super(componentReference);
+        this.componentReference = componentReference;
+    }
+
+    /**
+     * Constructs a ComponentTreeNode.
+     * 
+     * @param componentRegistry
+     */
+    public ComponentTreeNode(ComponentRegistry componentRegistry) {
+        super(componentRegistry);
+        this.componentRegistry = componentRegistry;
+    }
+
+    /**
+     * @return The component reference.
+     */
+    public ComponentReference getComponentReference() {
+        return this.componentReference;
+    }
+
+    /**
+     * @param componentRegistry
+     */
+    public void setComponentRegistry(ComponentRegistry componentRegistry) {
+        super.setUserObject(componentRegistry);
+        this.componentRegistry = componentRegistry;
+    }
+
+    /**
+     * @return The component registry.
+     */
+    public ComponentRegistry getComponentRegistry() {
+        return this.componentRegistry;
+    }
+
+    /**
+     * @see javax.swing.tree.DefaultMutableTreeNode#insert(javax.swing.tree.MutableTreeNode, int)
+     */
+    @Override
+    public void insert(MutableTreeNode newChild, int childIndex) {
+        if (!(newChild instanceof ComponentTreeNode)) {
+            throw new IllegalArgumentException();
+        }
+        super.insert(newChild, childIndex);
+    }
+
+    /**
+     * @return The children.
+     */
+    @SuppressWarnings("unchecked")
+    public List<ComponentTreeNode> getChildren() {
+        return this.children;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/AmazonUtil.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/AmazonUtil.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/AmazonUtil.java
new file mode 100644
index 0000000..3105d64
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/AmazonUtil.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
+
+import com.amazonaws.auth.BasicAWSCredentials;
+import com.amazonaws.services.ec2.AmazonEC2;
+import com.amazonaws.services.ec2.AmazonEC2Client;
+import com.amazonaws.services.ec2.model.DescribeInstancesResult;
+import com.amazonaws.services.ec2.model.DescribeKeyPairsResult;
+import com.amazonaws.services.ec2.model.Instance;
+import com.amazonaws.services.ec2.model.KeyPairInfo;
+import com.amazonaws.services.ec2.model.Reservation;
+import com.amazonaws.services.ec2.model.RunInstancesRequest;
+import com.amazonaws.services.ec2.model.RunInstancesResult;
+import com.amazonaws.services.ec2.model.TerminateInstancesRequest;
+
+public class AmazonUtil {
+
+    /**
+     * Amazon EC2 instance type
+     */
+    public final static String[] INSTANCE_TYPE = { "t1.micro", "m1.small", "m1.large", "m1.xlarge", "m2.xlarge",
+            "m2.2xlarge", "m2.4xlarge", "c1.medium", "c1.xlarge" };
+
+    private static AmazonEC2 getEC2Client() {
+        AmazonEC2 ec2 = new AmazonEC2Client(new BasicAWSCredentials(AmazonCredential.getInstance().getAwsAccessKeyId(),
+                AmazonCredential.getInstance().getAwsSecretAccessKey()));
+        return ec2;
+    }
+
+    /**
+     * Launch a new EC2 instance
+     * 
+     * @param AMI_ID
+     * @param type
+     * @param number
+     * @return list of newly launched instances
+     */
+    public static List<Instance> launchInstance(String AMI_ID, String type, Integer number) {
+        List<Instance> resultList = new ArrayList<Instance>();
+
+        RunInstancesRequest request = new RunInstancesRequest(AMI_ID, number, number);
+        request.setInstanceType(type);
+
+        RunInstancesResult result = getEC2Client().runInstances(request);
+        resultList.addAll(result.getReservation().getInstances());
+        return resultList;
+    }
+
+    /**
+     * Launch a new EC2 instance
+     * 
+     * @param AMI_ID
+     * @param type
+     * @param number
+     * @param keyname
+     * @return list of newly launched instances
+     */
+    public static List<Instance> launchInstance(String AMI_ID, String type, Integer number, String keyname) {
+        List<Instance> resultList = new ArrayList<Instance>();
+
+        RunInstancesRequest request = new RunInstancesRequest(AMI_ID, number, number);
+        request.setInstanceType(type);
+        request.setKeyName(keyname);
+
+        RunInstancesResult result = getEC2Client().runInstances(request);
+        resultList.addAll(result.getReservation().getInstances());
+        return resultList;
+    }
+
+    /**
+     * Load instances
+     * 
+     * @return list of instances
+     */
+    public static List<Instance> loadInstances() {
+        List<Instance> resultList = new ArrayList<Instance>();
+        DescribeInstancesResult describeInstancesResult = getEC2Client().describeInstances();
+        List<Reservation> reservations = describeInstancesResult.getReservations();
+        for (Iterator<Reservation> iterator = reservations.iterator(); iterator.hasNext();) {
+            Reservation reservation = iterator.next();
+            for (Instance instance : reservation.getInstances()) {
+                resultList.add(instance);
+            }
+        }
+        return resultList;
+    }
+
+    /**
+     * Load keypairs
+     * 
+     * @return list of keypairs
+     */
+    public static List<String> loadKeypairs() {
+        List<String> resultList = new ArrayList<String>();
+        DescribeKeyPairsResult results = getEC2Client().describeKeyPairs();
+        for (KeyPairInfo key : results.getKeyPairs()) {
+            resultList.add(key.getKeyName());
+        }
+        return resultList;
+    }
+
+    /**
+     * Terminate instances
+     * 
+     * @param instanceIds
+     */
+    public static void terminateInstances(List<String> instanceIds) {
+        // terminate
+        TerminateInstancesRequest request = new TerminateInstancesRequest(instanceIds);
+        getEC2Client().terminateInstances(request);
+    }
+
+    /**
+     * Terminate instances
+     * 
+     * @param instanceIds
+     */
+    public static void terminateInstances(String... instanceIds) {
+        // terminate
+        TerminateInstancesRequest request = new TerminateInstancesRequest();
+        getEC2Client().terminateInstances(request.withInstanceIds(instanceIds));
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/Data.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/Data.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/Data.java
new file mode 100644
index 0000000..f41f0b3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/Data.java
@@ -0,0 +1,70 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.util;
+
+public class Data {
+    private String destination_path;
+    private String verify_size;
+    private String source_path;
+    private boolean recursive;
+    private String DATA_TYPE;
+
+    public String getDestination_path() {
+        return destination_path;
+    }
+
+    public void setDestination_path(String destination_path) {
+        this.destination_path = destination_path;
+    }
+
+    public String getVerify_size() {
+        return verify_size;
+    }
+
+    public void setVerify_size(String verify_size) {
+        this.verify_size = verify_size;
+    }
+
+    public String getSource_path() {
+        return source_path;
+    }
+
+    public void setSource_path(String source_path) {
+        this.source_path = source_path;
+    }
+
+    public boolean getRecursive() {
+        return recursive;
+    }
+
+    public void setRecursive(boolean recursive) {
+        this.recursive = recursive;
+    }
+
+    public String getDATA_TYPE() {
+        return DATA_TYPE;
+    }
+
+    public void setDATA_TYPE(String DATA_TYPE) {
+        this.DATA_TYPE = DATA_TYPE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/GOConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/GOConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/GOConstants.java
new file mode 100644
index 0000000..50efb17
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/GOConstants.java
@@ -0,0 +1,30 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.util;
+
+public class GOConstants {
+    public static final String BASEURL = "https://transfer.api.globusonline.org/v0.10";
+    public static final String NEXUS_API_HOST = "nexus.api.globusonline.org";
+    public static final int NEXUS_API_PORT = 443;
+    public static final String NEXUS_API_SCHEMA = "https";
+    public static final String GOAUTH_TOKEN_REQ_URL = "/goauth/token?grant_type=client_credentials";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/GlobusOnlineUtils.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/GlobusOnlineUtils.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/GlobusOnlineUtils.java
new file mode 100644
index 0000000..e106cb5
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/GlobusOnlineUtils.java
@@ -0,0 +1,245 @@
+///*
+// *
+// * Licensed to the Apache Software Foundation (ASF) under one
+// * or more contributor license agreements.  See the NOTICE file
+// * distributed with this work for additional information
+// * regarding copyright ownership.  The ASF licenses this file
+// * to you under the Apache License, Version 2.0 (the
+// * "License"); you may not use this file except in compliance
+// * with the License.  You may obtain a copy of the License at
+// *
+// *   http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing,
+// * software distributed under the License is distributed on an
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// * KIND, either express or implied.  See the License for the
+// * specific language governing permissions and limitations
+// * under the License.
+// *
+// */
+//
+//package org.apache.airavata.xbaya.util;
+//
+//import org.apache.http.HttpEntity;
+//import org.apache.http.HttpHost;
+//import org.apache.http.auth.AuthScope;
+//import org.apache.http.auth.UsernamePasswordCredentials;
+//import org.apache.http.client.AuthCache;
+//import org.apache.http.client.ClientProtocolException;
+//import org.apache.http.client.CredentialsProvider;
+//import org.apache.http.client.methods.CloseableHttpResponse;
+//import org.apache.http.client.methods.HttpGet;
+//import org.apache.http.client.protocol.HttpClientContext;
+//import org.apache.http.impl.auth.BasicScheme;
+//import org.apache.http.impl.client.BasicAuthCache;
+//import org.apache.http.impl.client.BasicCredentialsProvider;
+//import org.apache.http.impl.client.CloseableHttpClient;
+//import org.apache.http.impl.client.HttpClients;
+//import org.apache.http.util.EntityUtils;
+//import org.globusonline.transfer.APIError;
+//import org.globusonline.transfer.Authenticator;
+//import org.globusonline.transfer.GoauthAuthenticator;
+//import org.globusonline.transfer.JSONTransferAPIClient;
+//import org.json.JSONArray;
+//import org.json.JSONException;
+//import org.json.JSONObject;
+//import org.json.JSONTokener;
+//
+//import java.io.File;
+//import java.io.IOException;
+//import java.io.InputStream;
+//import java.io.InputStreamReader;
+//import java.security.GeneralSecurityException;
+//import java.security.KeyManagementException;
+//import java.security.NoSuchAlgorithmException;
+//import java.text.DateFormat;
+//import java.text.SimpleDateFormat;
+//import java.util.*;
+//
+//public class GlobusOnlineUtils {
+//    public static final String ACCESS_TOKEN = "access_token";
+//
+//    private static String goUserName;
+//    private static String goPWD;
+//
+//    public static void main(String[] args) {
+////        String s = appendFileName("/~/Desktop/1.docx", "/~/");
+////        System.out.println(s);
+//
+//    }
+//
+//    public GlobusOnlineUtils(String goUsername, String goPwd) {
+//        goUserName = goUsername;
+//        goPWD = goPwd;
+//    }
+//
+//    public String getAuthenticationToken() {
+//        String token = null;
+//        HttpHost targetHost = new HttpHost(GOConstants.NEXUS_API_HOST, GOConstants.NEXUS_API_PORT, GOConstants.NEXUS_API_SCHEMA);
+//        CredentialsProvider credsProvider = new BasicCredentialsProvider();
+//        credsProvider.setCredentials(
+//                new AuthScope(targetHost.getHostName(), targetHost.getPort()),
+//                new UsernamePasswordCredentials(goUserName, goPWD));
+//
+//        CloseableHttpClient httpclient = HttpClients.custom()
+//                .setDefaultCredentialsProvider(credsProvider).build();
+//        try {
+//
+//            // Create AuthCache instance
+//            AuthCache authCache = new BasicAuthCache();
+//            // Generate BASIC scheme object and add it to the local
+//            // auth cache
+//            BasicScheme basicScheme = new BasicScheme();
+//            authCache.put(targetHost, basicScheme);
+//
+//            // Add AuthCache to the execution context
+//            HttpClientContext localContext = HttpClientContext.create();
+//            localContext.setAuthCache(authCache);
+//
+//            HttpGet httpget = new HttpGet(GOConstants.GOAUTH_TOKEN_REQ_URL);
+//            httpget.addHeader("accept", "application/json");
+//            System.out.println("executing request: " + httpget.getRequestLine());
+//            System.out.println("to target: " + targetHost);
+//
+//            CloseableHttpResponse response = httpclient.execute(targetHost, httpget, localContext);
+//            try {
+//                HttpEntity entity = response.getEntity();
+//                InputStream entityContent = entity.getContent();
+//                InputStreamReader reader = new InputStreamReader(entityContent);
+//                JSONTokener tokenizer = new JSONTokener(reader);
+//                JSONObject json = new JSONObject(tokenizer);
+//                token = (String)json.get(ACCESS_TOKEN);
+//                entityContent.close();
+//                EntityUtils.consume(entity);
+//
+//            } catch (JSONException e) {
+//                e.printStackTrace();
+//            } finally {
+//                response.close();
+//            }
+//            //}
+//        } catch (ClientProtocolException e) {
+//            e.printStackTrace();
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        } finally {
+//            try {
+//                httpclient.close();
+//            } catch (IOException e) {
+//                e.printStackTrace();
+//            }
+//        }
+//        return token;
+//    }
+//
+//    public JSONTransferAPIClient getAuthenticated (){
+//        JSONTransferAPIClient jsonTransferAPIClient = null;
+//        try {
+//            String authenticationToken = getAuthenticationToken();
+//            Authenticator authenticator = new GoauthAuthenticator(authenticationToken);
+//            jsonTransferAPIClient = new JSONTransferAPIClient(goUserName,
+//                    null, GOConstants.BASEURL);
+//            jsonTransferAPIClient.setAuthenticator(authenticator);
+//        } catch (KeyManagementException e) {
+//            e.printStackTrace();
+//        } catch (NoSuchAlgorithmException e) {
+//            e.printStackTrace();
+//        }
+//        return jsonTransferAPIClient;
+//    }
+//
+//    public String transferFiles (TransferFile tf){
+//        String taskId = null;
+//        try {
+//            JSONTransferAPIClient apiClient = getAuthenticated();
+//            String submissionId = apiClient.getSubmissionId();
+//            tf.setSubmission_id(submissionId);
+//            JSONObject jsonObject = new JSONObject(tf);
+//            JSONTransferAPIClient.Result result = apiClient.transfer(jsonObject);
+//            taskId = (String)result.document.get("task_id");
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        } catch (GeneralSecurityException e) {
+//            e.printStackTrace();
+//        } catch (JSONException e) {
+//            e.printStackTrace();
+//        } catch (APIError apiError) {
+//            apiError.printStackTrace();
+//        }
+//        return taskId;
+//    }
+//
+//    public TransferFile getTransferFile (String sourceEp,
+//                                                String destEp,
+//                                                String sourcePath,
+//                                                String destPath,
+//                                                String label){
+//
+//        TransferFile transferFile = new TransferFile();
+//
+//
+//        transferFile.setPreserve_timestamp(false);
+//        transferFile.setDATA_TYPE("transfer");
+//        transferFile.setEncrypt_data(false);
+//        transferFile.setSync_level(null);
+//        transferFile.setSource_endpoint(sourceEp);
+//        transferFile.setLabel(label);
+//        transferFile.setDestination_endpoint(destEp);
+//        transferFile.setLength(2);
+//        transferFile.setDeadline(getDeadlineForTransfer());
+//        transferFile.setNotify_on_succeeded(true);
+//        transferFile.setNotify_on_failed(true);
+//        transferFile.setVerify_checksum(false);
+//        transferFile.setDelete_destination_extra(false);
+//        Data[] datas = new Data[1];
+//        Data data = new Data();
+//        data.setDATA_TYPE("transfer_item");
+//        data.setDestination_path(appendFileName(sourcePath, destPath));
+//        data.setVerify_size(null);
+//        data.setSource_path(sourcePath);
+//        data.setRecursive(false);
+//        datas[0] = data;
+//        transferFile.setDATA(datas);
+//        return transferFile;
+//    }
+//
+//    private static String appendFileName(String sourcePath, String destPath){
+//        String[] split = sourcePath.split(File.separator);
+//        String fileName = split[split.length - 1];
+//        if (destPath.endsWith(File.separator)){
+//            destPath = destPath.concat(fileName);
+//        }else {
+//            destPath = destPath.concat("/" + fileName);
+//        }
+//        System.out.println(destPath);
+//        return destPath;
+//    }
+//
+//    private String getDeadlineForTransfer (){
+//        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
+//        Calendar calendar = Calendar.getInstance();
+//        calendar.add(calendar.DAY_OF_MONTH, 1);
+//        Date tomorrow = calendar.getTime();
+//        String date = dateFormat.format(tomorrow);
+//        System.out.println(date);
+//        return date;
+//    }
+//
+//    public List<String> getEPList() throws IOException, APIError, GeneralSecurityException, JSONException {
+//        List<String> epList = new ArrayList<String>();
+//        Map<String, String> params = new HashMap<String, String>();
+//        params.put("limit", "0");
+//        JSONTransferAPIClient transferAPIClient = getAuthenticated();
+//        JSONTransferAPIClient.Result result = transferAPIClient.getResult("/endpoint_list", params);
+//        JSONObject document = result.document;
+//        JSONArray dataArray = document.getJSONArray("DATA");
+//        for (int i = 0; i < dataArray.length(); i++ ){
+//            JSONObject jsonObject = dataArray.getJSONObject(i);
+//            String epName = (String)jsonObject.get("canonical_name");
+//            epList.add(epName);
+//        }
+//        return epList;
+//    }
+//
+//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/InterpreterUtil.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/InterpreterUtil.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/InterpreterUtil.java
new file mode 100644
index 0000000..8f1a01d
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/InterpreterUtil.java
@@ -0,0 +1,391 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.xbaya.util;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
+import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
+import org.apache.airavata.workflow.model.graph.system.ConstantNode;
+import org.apache.airavata.workflow.model.graph.system.DifferedInputNode;
+import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
+import org.apache.airavata.workflow.model.graph.system.EndDoWhileNode;
+import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
+import org.apache.airavata.workflow.model.graph.system.EndifNode;
+import org.apache.airavata.workflow.model.graph.system.ForEachNode;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.SystemDataPort;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.graph.ws.WSPort;
+import org.apache.airavata.xbaya.interpretor.SystemComponentInvoker;
+import org.apache.airavata.xbaya.interpretor.WorkFlowInterpreterException;
+import org.apache.airavata.xbaya.invoker.GenericInvoker;
+import org.apache.airavata.xbaya.invoker.Invoker;
+import org.apache.airavata.xbaya.invoker.WorkflowInvokerWrapperForGFacInvoker;
+import org.xmlpull.infoset.XmlElement;
+import org.xmlpull.infoset.impl.XmlElementWithViewsImpl;
+
+import xsul5.XmlConstants;
+import xsul5.wsdl.WsdlPort;
+import xsul5.wsdl.WsdlService;
+//import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler;
+//import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
+
+public class InterpreterUtil {
+    /**
+     * This method returns the input values for given foreach node
+     *
+     * @param forEachNode
+     * @param listOfValues
+     * @param invokerMap
+     * @return
+     * @throws WorkflowException
+     */
+    public static Object getInputsForForEachNode(final ForEachNode forEachNode, final LinkedList<String> listOfValues, Map<Node, Invoker> invokerMap)
+            throws WorkflowException {
+        List<DataPort> inputPorts = forEachNode.getInputPorts();
+
+        Object returnValForProvenance = null;
+        for (DataPort inputPort : inputPorts) {
+
+            Node inputNode = inputPort.getFromNode();
+            // if input node for for-each is WSNode
+            if (inputNode instanceof InputNode) {
+//                for (DataPort dataPort : forEachNode.getInputPorts()) {
+                    returnValForProvenance = InterpreterUtil.findInputFromPort(inputPort, invokerMap);
+                    if (null == returnValForProvenance) {
+                        throw new WorkFlowInterpreterException("Unable to find input for the node:" + forEachNode.getID());
+                    }
+                    String[] vals = StringUtil.getElementsFromString(returnValForProvenance.toString());
+                    listOfValues.addAll(Arrays.asList(vals));
+//                }
+            } else {
+                Invoker workflowInvoker = invokerMap.get(inputNode);
+                if (workflowInvoker != null) {
+                    if (workflowInvoker instanceof GenericInvoker) {
+
+                        String outputName = inputNode.getOutputPort(0).getName();
+                        returnValForProvenance = workflowInvoker.getOutput(outputName);
+						Iterator children = null;
+						if (returnValForProvenance instanceof org.xmlpull.v1.builder.XmlElement) {
+							org.xmlpull.v1.builder.XmlElement msgElmt = (org.xmlpull.v1.builder.XmlElement) returnValForProvenance;
+							children = msgElmt.children();
+						} else {
+							XmlElement msgElmt = XmlConstants.BUILDER.parseFragmentFromString("<temp>" + returnValForProvenance + "</temp>");
+							children = msgElmt.children().iterator();
+						}
+                        while (children.hasNext()) {
+                            Object object = children.next();
+                            if (object instanceof org.xmlpull.v1.builder.XmlElement) {
+                                org.xmlpull.v1.builder.XmlElement child = (org.xmlpull.v1.builder.XmlElement) object;
+                                Iterator valItr = child.children();
+                                if (valItr.hasNext()) {
+                                    Object object2 = valItr.next();
+                                    if (object2 instanceof String) {
+                                        listOfValues.add(object2.toString());
+                                    }
+                                }
+                            }
+                            if (object instanceof XmlElement) {
+                                listOfValues.add(((XmlElement) object).children().iterator().next().toString());
+                            }if (object instanceof String){
+                                listOfValues.add(object.toString());
+                            }
+                        }
+                    } else if (workflowInvoker instanceof SystemComponentInvoker) {
+                        int index = inputNode.getOutputPorts().indexOf(inputPort.getEdge(0).getFromPort());
+                        String outputName = "";
+                        if (inputNode.getInputPort(index) instanceof SystemDataPort) {
+                            outputName = ((SystemDataPort) inputNode.getInputPort(index)).getWSComponentPort().getName();
+                        } else if (inputNode.getInputPort(index) instanceof WSPort) {
+                            outputName = ((SystemDataPort) inputNode.getInputPort(inputNode.getOutputPorts().indexOf(
+                                    inputPort.getEdge(0).getFromPort()))).getWSComponentPort().getName();
+                        }
+                        returnValForProvenance = workflowInvoker.getOutput(outputName);
+                        XmlElement msgElmt = XmlConstants.BUILDER.parseFragmentFromString("<temp>" + returnValForProvenance + "</temp>");
+                        Iterator valItr = msgElmt.children().iterator();
+                        while (valItr.hasNext()) {
+                            Object object2 = valItr.next();
+                            if (object2 instanceof XmlElement) {
+                                listOfValues.add(((XmlElement) object2).children().iterator().next().toString());
+                            }
+                        }
+                    }
+                } else {
+                    throw new WorkFlowInterpreterException("Did not find inputs from WS to foreach");
+                }
+            }
+        }
+        return returnValForProvenance;
+    }
+
+    /**
+     *
+     * @param inputPort
+     * @param invokerMap
+     * @return
+     * @throws WorkflowException
+     */
+    public static Object findInputFromPort(DataPort inputPort, Map<Node, Invoker> invokerMap) throws WorkflowException {
+        Object outputVal = null;
+        Node fromNode = inputPort.getFromNode();
+        if (fromNode instanceof InputNode) {
+            outputVal = ((InputNode) fromNode).getDefaultValue();
+        } else if (fromNode instanceof ConstantNode) {
+            outputVal = ((ConstantNode) fromNode).getValue();
+        } else if (fromNode instanceof DifferedInputNode && ((DifferedInputNode) fromNode).isConfigured()) {
+            outputVal = ((DifferedInputNode) fromNode).getDefaultValue();
+        } else if (fromNode instanceof EndifNode || fromNode instanceof DoWhileNode  || fromNode instanceof EndDoWhileNode) {
+            Invoker fromInvoker = invokerMap.get(fromNode);
+            outputVal = fromInvoker.getOutput(inputPort.getFromPort().getID());
+        } else if (fromNode instanceof InstanceNode) {
+            return ((InstanceNode) fromNode).getOutputInstanceId();
+        } else if (fromNode instanceof EndForEachNode) {
+            outputVal = "";
+            Invoker workflowInvoker = invokerMap.get(fromNode);
+            String outputName = "";
+            if (inputPort instanceof SystemDataPort) {
+                outputName = ((SystemDataPort) inputPort).getWSComponentPort().getName();
+
+            } else if (inputPort instanceof WSPort) {
+                outputName = ((SystemDataPort) fromNode.getInputPort(fromNode.getOutputPorts().indexOf(inputPort.getEdge(0).getFromPort())))
+                        .getWSComponentPort().getName();
+            }
+            XmlElement msgElmt = XmlConstants.BUILDER.parseFragmentFromString("<temp>" + workflowInvoker.getOutput(outputName) + "</temp>");
+            Iterator valItr = msgElmt.children().iterator();
+            while (valItr.hasNext()) {
+                Object object2 = valItr.next();
+                if (object2 instanceof XmlElement) {
+
+                    if (((XmlElement) object2).children().iterator().hasNext()) {
+                        outputVal = outputVal + StringUtil.DELIMETER  + StringUtil.quoteString(((XmlElement) object2).children().iterator().next().toString());
+                    }
+                }
+            }
+
+            if (((String) outputVal).length() == 0) {
+                throw new WorkflowException("Empty Output Generated");
+            }
+            outputVal = ((String) outputVal).substring(1, ((String) outputVal).length());
+        } else {
+            Invoker fromInvoker = invokerMap.get(fromNode);
+            try {
+                if (fromInvoker != null)
+                    outputVal = fromInvoker.getOutput(inputPort.getFromPort().getName());
+
+            } catch (Exception e) {
+                // if the value is still null look it up from the inputport name
+                // because the value is set to the input port name at some point
+                // there is no harm in doing this
+                if (null == outputVal) {
+                    outputVal = fromInvoker.getOutput(inputPort.getName());
+                }
+            }
+
+        }
+        return outputVal;
+
+    }
+
+    /**
+     * @param node
+     * @return
+     */
+    public static Node findEndForEachFor(ForEachNode node) {
+
+        Collection<Node> toNodes = node.getOutputPort(0).getToNodes();
+        if (toNodes.size() != 1) {
+            throw new WorkflowRuntimeException("ForEach output does not contain single out-edge");
+        }
+        Node middleNode = toNodes.iterator().next();
+        List<DataPort> outputPorts = middleNode.getOutputPorts();
+        for (DataPort dataPort : outputPorts) {
+            if (dataPort.getToNodes().size() == 1) {
+                Node possibleEndForEachNode = dataPort.getToNodes().get(0);
+                if (possibleEndForEachNode instanceof EndForEachNode) {
+                    return possibleEndForEachNode;
+                }
+            }
+        }
+        throw new WorkflowRuntimeException("EndForEachNode not found");
+    }
+
+    public static Integer[] getNumberOfInputsForForEachNode(final ForEachNode forEachNode, Map<Node, Invoker> invokerMap) throws WorkflowException {
+        List<DataPort> inputPorts = forEachNode.getInputPorts();
+        Integer[] inputNumbers = new Integer[inputPorts.size()];
+        for (DataPort forEachInputPort : inputPorts) {
+            // if input node for for-each is WSNode
+            Node forEachInputNode = forEachInputPort.getFromNode();
+            int index = 0;
+            Object returnValForProvenance = null;
+            if (forEachInputNode instanceof InputNode) {
+                returnValForProvenance = InterpreterUtil.findInputFromPort(forEachInputPort, invokerMap);
+                if (null == returnValForProvenance) {
+                    throw new WorkFlowInterpreterException("Unable to find input for the node:" + forEachNode.getID());
+                }
+                String[] vals = StringUtil.getElementsFromString(returnValForProvenance.toString());
+                inputNumbers[inputPorts.indexOf(forEachInputPort)] = vals.length;
+            } else {
+                Invoker workflowInvoker = invokerMap.get(forEachInputNode);
+                if (workflowInvoker != null) {
+                    if (workflowInvoker instanceof GenericInvoker) {
+
+                        returnValForProvenance = ((GenericInvoker) workflowInvoker).getOutputs();
+                        String message = returnValForProvenance.toString();
+
+                        XmlElement msgElmt = XmlConstants.BUILDER.parseFragmentFromString(message);
+                        Iterator children = msgElmt.children().iterator();
+                        while (children.hasNext()) {
+                            Object object = children.next();
+                            // foreachWSNode.getInputPort(0).getType()
+                            if (object instanceof XmlElement) {
+                                index++;
+                            }
+                        }
+                    } else if (workflowInvoker instanceof WorkflowInvokerWrapperForGFacInvoker) {
+                        String outputName = forEachInputNode.getOutputPort(0).getName();
+                        returnValForProvenance = workflowInvoker.getOutput(outputName);
+                        org.xmlpull.v1.builder.XmlElement msgElmt = (org.xmlpull.v1.builder.XmlElement) returnValForProvenance;
+                        Iterator children = msgElmt.children();
+                        while (children.hasNext()) {
+                            Object object = children.next();
+                            if (object instanceof org.xmlpull.v1.builder.XmlElement) {
+                                org.xmlpull.v1.builder.XmlElement child = (org.xmlpull.v1.builder.XmlElement) object;
+                                Iterator valItr = child.children();
+                                if (valItr.hasNext()) {
+                                    Object object2 = valItr.next();
+                                    if (object2 instanceof String) {
+                                        index++;
+                                    }
+                                }
+                            }
+                        }
+                        inputNumbers[inputPorts.indexOf(forEachInputPort)] = index;
+                    } else if (workflowInvoker instanceof SystemComponentInvoker) {
+                        int portIndex = forEachInputNode.getOutputPorts().indexOf(forEachInputPort.getEdge(0).getFromPort());
+                        String outputName = "";
+                        if (forEachInputNode.getInputPort(portIndex) instanceof SystemDataPort) {
+                            outputName = ((SystemDataPort) forEachInputNode.getInputPort(portIndex)).getWSComponentPort().getName();
+                        } else if (forEachInputNode.getInputPort(portIndex) instanceof WSPort) {
+                            outputName = ((WSPort) forEachInputNode.getInputPort(portIndex)).getComponentPort().getName();
+                        }
+                        returnValForProvenance = workflowInvoker.getOutput(outputName);
+                        XmlElement msgElmt = XmlConstants.BUILDER.parseFragmentFromString("<temp>" + returnValForProvenance + "</temp>");
+                        Iterator valItr = msgElmt.children().iterator();
+                        while (valItr.hasNext()) {
+                            Object object2 = valItr.next();
+                            if (object2 instanceof XmlElement) {
+                                index++;
+                            }
+                        }
+                        inputNumbers[inputPorts.indexOf(forEachInputPort)] = index;
+                    }
+
+                } else {
+                    throw new WorkFlowInterpreterException("Did not find inputs from WS to foreach");
+                }
+            }
+        }
+        return inputNumbers;
+    }
+
+    public static ArrayList<Node> getFinishedNodesDynamically(WSGraph graph) {
+        return getNodesWithBodyColor(NodeExecutionState.FINISHED, graph);
+    }
+
+    public static ArrayList<Node> getFailedNodesDynamically(WSGraph graph) {
+        return getNodesWithBodyColor(NodeExecutionState.FAILED, graph);
+    }
+
+    public static ArrayList<Node> getWaitingNodesDynamically(WSGraph graph) {
+        return getNodesWithBodyColor(NodeExecutionState.WAITING, graph);
+    }
+
+    public static ArrayList<Node> getNodesWithBodyColor(NodeExecutionState state, WSGraph graph) {
+        ArrayList<Node> list = new ArrayList<Node>();
+        List<NodeImpl> nodes = graph.getNodes();
+        for (Node node : nodes) {
+            if (node.getState()==state) {
+                list.add(node);
+            }
+        }
+        return list;
+    }
+
+    public static int getRunningNodeCountDynamically(WSGraph graph) {
+        return getNodeCountWithBodyColor(NodeExecutionState.EXECUTING, graph);
+    }
+
+    public static int getFailedNodeCountDynamically(WSGraph graph) {
+        return getFailedNodesDynamically(graph).size();
+    }
+
+    public static int getWaitingNodeCountDynamically(WSGraph graph) {
+        return getNodeCountWithBodyColor(NodeExecutionState.WAITING, graph);
+    }
+
+    public static int getNodeCountWithBodyColor(NodeExecutionState state, WSGraph graph) {
+        int sum = 0;
+        List<NodeImpl> nodes = graph.getNodes();
+        for (Node node : nodes) {
+            if (node.getState()==state) {
+                ++sum;
+            }
+        }
+        return sum;
+    }
+
+    public static String getEPR(WSNode wsNode) {
+        Iterable<WsdlService> services = wsNode.getComponent().getWSDL().services();
+        Iterator<WsdlService> iterator = services.iterator();
+        if (iterator.hasNext()) {
+            Iterable<WsdlPort> ports = iterator.next().ports();
+            Iterator<WsdlPort> portIterator = ports.iterator();
+            if (portIterator.hasNext()) {
+                WsdlPort port = portIterator.next();
+                Iterable children = port.xml().children();
+                Iterator childIterator = children.iterator();
+                while (childIterator.hasNext()) {
+                    Object next = childIterator.next();
+                    if (next instanceof XmlElementWithViewsImpl) {
+                        org.xmlpull.infoset.XmlAttribute epr = ((XmlElementWithViewsImpl) next).attribute("location");
+                        return epr.getValue();
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/RegistryConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/RegistryConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/RegistryConstants.java
new file mode 100644
index 0000000..d59dad4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/RegistryConstants.java
@@ -0,0 +1,30 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.util;
+
+public class RegistryConstants {
+	public static final String REGISTRY_TYPE_JCR="registry.type.jcr";
+	public static final String REGISTRY_TYPE_LOCAL="registry.type.local";
+	public static final String REGISTRY_TYPE_URL="registry.type.url";
+	public static final String REGISTRY_TYPE_GPEL="registry.type.gpel";
+	public static final String REGISTRY_TYPE_WEB="registry.type.web";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/TransferFile.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/TransferFile.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/TransferFile.java
new file mode 100644
index 0000000..2748aa2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/TransferFile.java
@@ -0,0 +1,170 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.util;
+
+
+public class TransferFile {
+    private String submission_id;
+    private boolean preserve_timestamp;
+    private String DATA_TYPE;
+    private boolean encrypt_data;
+    private String sync_level;
+    private String source_endpoint;
+    private String label;
+    private String destination_endpoint;
+    private int length;
+    private String deadline;
+    private boolean notify_on_succeeded;
+    private boolean notify_on_failed;
+    private boolean verify_checksum;
+    private boolean notify_on_inactive;
+    private boolean delete_destination_extra;
+    private Data[] DATA;
+
+    public String getSubmission_id() {
+        return submission_id;
+    }
+
+    public void setSubmission_id(String submission_id) {
+        this.submission_id = submission_id;
+    }
+
+    public boolean getPreserve_timestamp() {
+        return preserve_timestamp;
+    }
+
+    public void setPreserve_timestamp(boolean preserve_timestamp) {
+        this.preserve_timestamp = preserve_timestamp;
+    }
+
+    public String getDATA_TYPE() {
+        return DATA_TYPE;
+    }
+
+    public void setDATA_TYPE(String DATA_TYPE) {
+        this.DATA_TYPE = DATA_TYPE;
+    }
+
+    public boolean getEncrypt_data() {
+        return encrypt_data;
+    }
+
+    public void setEncrypt_data(boolean encrypt_data) {
+        this.encrypt_data = encrypt_data;
+    }
+
+    public String getSync_level() {
+        return sync_level;
+    }
+
+    public void setSync_level(String sync_level) {
+        this.sync_level = sync_level;
+    }
+
+    public String getSource_endpoint() {
+        return source_endpoint;
+    }
+
+    public void setSource_endpoint(String source_endpoint) {
+        this.source_endpoint = source_endpoint;
+    }
+
+    public String getLabel() {
+        return label;
+    }
+
+    public void setLabel(String label) {
+        this.label = label;
+    }
+
+    public String getDestination_endpoint() {
+        return destination_endpoint;
+    }
+
+    public void setDestination_endpoint(String destination_endpoint) {
+        this.destination_endpoint = destination_endpoint;
+    }
+
+    public int getLength() {
+        return length;
+    }
+
+    public void setLength(int length) {
+        this.length = length;
+    }
+
+    public String getDeadline() {
+        return deadline;
+    }
+
+    public void setDeadline(String deadline) {
+        this.deadline = deadline;
+    }
+
+    public boolean getNotify_on_succeeded() {
+        return notify_on_succeeded;
+    }
+
+    public void setNotify_on_succeeded(boolean notify_on_succeeded) {
+        this.notify_on_succeeded = notify_on_succeeded;
+    }
+
+    public boolean getNotify_on_failed() {
+        return notify_on_failed;
+    }
+
+    public void setNotify_on_failed(boolean notify_on_failed) {
+        this.notify_on_failed = notify_on_failed;
+    }
+
+    public boolean getVerify_checksum() {
+        return verify_checksum;
+    }
+
+    public void setVerify_checksum(boolean verify_checksum) {
+        this.verify_checksum = verify_checksum;
+    }
+
+    public boolean getNotify_on_inactive() {
+        return notify_on_inactive;
+    }
+
+    public void setNotify_on_inactive(boolean notify_on_inactive) {
+        this.notify_on_inactive = notify_on_inactive;
+    }
+
+    public boolean getDelete_destination_extra() {
+        return delete_destination_extra;
+    }
+
+    public void setDelete_destination_extra(boolean delete_destination_extra) {
+        this.delete_destination_extra = delete_destination_extra;
+    }
+
+    public Data[] getDATA() {
+        return DATA;
+    }
+
+    public void setDATA(Data[] DATA) {
+        this.DATA = DATA;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java
new file mode 100644
index 0000000..326cb02
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/util/XBayaUtil.java
@@ -0,0 +1,353 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.util;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.SocketTimeoutException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.airavata.client.stub.interpretor.NameValue;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
+import org.apache.airavata.workflow.model.graph.system.ConstantNode;
+import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
+import org.apache.airavata.workflow.model.graph.system.EndifNode;
+import org.apache.airavata.workflow.model.graph.system.ForEachNode;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.ws.monitor.MonitorConfiguration;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.interpretor.SystemComponentInvoker;
+import org.apache.airavata.xbaya.interpretor.WorkFlowInterpreterException;
+import org.apache.airavata.xbaya.invoker.GenericInvoker;
+import org.apache.airavata.xbaya.invoker.Invoker;
+import org.apache.airavata.xbaya.invoker.WorkflowInvokerWrapperForGFacInvoker;
+import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
+import org.apache.airavata.xbaya.ui.dialogs.registry.RegistryWindow;
+import org.apache.axis2.util.XMLUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+import org.xmlpull.infoset.XmlElement;
+
+import xsul.lead.LeadContextHeader;
+import xsul.lead.LeadResourceMapping;
+import xsul5.XmlConstants;
+
+public class XBayaUtil {
+
+    private static final Logger logger = LoggerFactory.getLogger(XBayaUtil.class);
+    public static final String JCR_USER = "jcr.username";
+    public static final String JCR_PASS = "jcr.password";
+    public static final String JCR_URL = "jcr.url";
+
+    public static LeadContextHeader buildLeadContextHeader(final XBayaEngine engine,
+            MonitorConfiguration monitorConfiguration, String nodeId, LeadResourceMapping resourceMapping)
+            throws URISyntaxException {
+
+        XBayaConfiguration configuration = engine.getConfiguration();
+        Workflow workflow = engine.getGUI().getWorkflow();
+
+        LeadContextHeader leadContext = buildLeadContextHeader(workflow, configuration, monitorConfiguration, nodeId,
+                resourceMapping);
+
+        return leadContext;
+
+    }
+
+    /**
+     * 
+     * @param workflow
+     * @param configuration
+     * @param monitorConfiguration
+     * @param nodeId
+     * @param resourceMapping
+     * @return
+     * @throws URISyntaxException
+     */
+    public static LeadContextHeader buildLeadContextHeader(Workflow workflow, XBayaConfiguration configuration,
+            MonitorConfiguration monitorConfiguration, String nodeId, LeadResourceMapping resourceMapping)
+            throws URISyntaxException {
+        LeadContextHeaderHelper leadContextHelper = new LeadContextHeaderHelper();
+        leadContextHelper.setXBayaConfiguration(configuration);
+
+        leadContextHelper.setWorkflowInstanceID(workflow.getGPELInstanceID());
+        leadContextHelper.setWorkflowTemplateID(workflow.getUniqueWorkflowName());
+
+        leadContextHelper.setMonitorConfiguration(monitorConfiguration);
+
+        LeadContextHeader leadContext = leadContextHelper.getLeadContextHeader();
+
+        leadContext.setNodeId(nodeId);
+
+        leadContext.setTimeStep("1");
+
+        if (resourceMapping != null) {
+            leadContext.setResourceMapping(resourceMapping);
+        }
+        return leadContext;
+
+    }
+
+    public static boolean isURLExists(String URLName) {
+        try {
+            if (!URLName.toUpperCase().contains("HTTP"))
+                URLName = "http://" + URLName;
+            URL url = new URL(URLName);
+            System.setProperty("java.net.useSystemProxies", "true");
+            HttpURLConnection urlConn = (HttpURLConnection) url.openConnection();
+            urlConn.setConnectTimeout(9000);
+            urlConn.setReadTimeout(9000);
+            urlConn.connect();
+            if (HttpURLConnection.HTTP_OK == urlConn.getResponseCode())
+                return true;
+            else
+                return false;
+        } catch (SocketTimeoutException e) {
+            return false;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return false;
+        }
+    }
+
+    public static boolean acquireJCRRegistry(XBayaEngine engine) {
+        XBayaConfiguration configuration = engine.getConfiguration();
+        if (configuration.getAiravataAPI() == null) {
+        	updateJCRRegistryInfo(engine);
+        }
+        return engine.getConfiguration().getAiravataAPI() != null;
+    }
+    
+    public static void updateJCRRegistryInfo(XBayaEngine xbayaEngine) {
+    	RegistryWindow window = new RegistryWindow(xbayaEngine);
+        window.show();
+	}
+    
+    public static Object getInputsForForEachNode(final ForEachNode forEachNode,
+			final LinkedList<String> listOfValues, Map<Node, Invoker> invokerMap) throws WorkflowException {
+		Node forEachInputNode = forEachNode.getInputPort(0).getFromNode();
+		// if input node for for-each is WSNode
+		Object returnValForProvenance = null;
+		if (forEachInputNode instanceof InputNode) {
+			for (DataPort dataPort : forEachNode.getInputPorts()) {
+				returnValForProvenance = XBayaUtil
+						.findInputFromPort(dataPort, invokerMap);
+				if (null == returnValForProvenance) {
+					throw new WorkFlowInterpreterException(
+							"Unable to find input for the node:"
+									+ forEachNode.getID());
+				}
+				String[] vals = StringUtil.getElementsFromString(returnValForProvenance.toString());
+				listOfValues.addAll(Arrays.asList(vals));
+			}
+		} else {
+			Invoker workflowInvoker = invokerMap
+					.get(forEachInputNode);
+			if (workflowInvoker != null) {
+				if (workflowInvoker instanceof GenericInvoker) {
+
+					returnValForProvenance = ((GenericInvoker) workflowInvoker)
+							.getOutputs();
+					String message = returnValForProvenance.toString();
+
+					XmlElement msgElmt = XmlConstants.BUILDER
+							.parseFragmentFromString(message);
+					Iterator children = msgElmt.children().iterator();
+					while (children.hasNext()) {
+						Object object = children.next();
+						// foreachWSNode.getInputPort(0).getType()
+						if (object instanceof XmlElement) {
+							listOfValues.add(XmlConstants.BUILDER
+									.serializeToString(object));
+							// TODO fix for simple type - Done
+						}
+					}
+				} else if (workflowInvoker instanceof WorkflowInvokerWrapperForGFacInvoker) {
+					String outputName = forEachInputNode.getOutputPort(0)
+							.getName();
+					returnValForProvenance = workflowInvoker
+							.getOutput(outputName);
+					org.xmlpull.v1.builder.XmlElement msgElmt = (org.xmlpull.v1.builder.XmlElement) returnValForProvenance;
+					Iterator children = msgElmt.children();
+					while (children.hasNext()) {
+						Object object = children.next();
+						if (object instanceof org.xmlpull.v1.builder.XmlElement) {
+							org.xmlpull.v1.builder.XmlElement child = (org.xmlpull.v1.builder.XmlElement) object;
+							Iterator valItr = child.children();
+							if (valItr.hasNext()) {
+								Object object2 = valItr.next();
+								if (object2 instanceof String) {
+									listOfValues.add(object2.toString());
+								}
+							}
+						}
+					}
+				} else if (workflowInvoker instanceof SystemComponentInvoker) {
+					String outputName = forEachInputNode.getOutputPort(0)
+							.getName();
+					returnValForProvenance = workflowInvoker
+							.getOutput(outputName);
+					XmlElement msgElmt = XmlConstants.BUILDER
+							.parseFragmentFromString("<temp>"
+									+ returnValForProvenance + "</temp>");
+					Iterator valItr = msgElmt.children().iterator();
+					while (valItr.hasNext()) {
+						Object object2 = valItr.next();
+						if (object2 instanceof XmlElement) {
+							listOfValues.add(((XmlElement) object2).children()
+									.iterator().next().toString());
+						}
+					}
+				}
+			} else {
+				throw new WorkFlowInterpreterException(
+						"Did not find inputs from WS to foreach");
+			}
+		}
+		return returnValForProvenance;
+	}
+
+    /**
+     *
+     * @param inputPort
+     * @param invokerMap
+     * @return
+     * @throws WorkflowException
+     */
+	public static Object findInputFromPort(DataPort inputPort, Map<Node, Invoker>  invokerMap) throws WorkflowException {
+		Object outputVal = null;
+		Node fromNode = inputPort.getFromNode();
+		if (fromNode instanceof InputNode) {
+			outputVal = ((InputNode) fromNode).getDefaultValue();
+		} else if (fromNode instanceof ConstantNode) {
+			outputVal = ((ConstantNode) fromNode).getValue();
+		} else if (fromNode instanceof EndifNode) {
+			Invoker fromInvoker = invokerMap.get(fromNode);
+			outputVal = fromInvoker.getOutput(inputPort.getFromPort().getID());
+		} else if (fromNode instanceof InstanceNode) {
+			return ((InstanceNode) fromNode).getOutputInstanceId();
+		} else if (fromNode instanceof EndForEachNode) {
+			outputVal = "";
+			Invoker workflowInvoker = invokerMap.get(fromNode);
+			String outputName = fromNode.getOutputPort(0).getName();
+			XmlElement msgElmt = XmlConstants.BUILDER
+					.parseFragmentFromString("<temp>"
+							+ workflowInvoker.getOutput(outputName) + "</temp>");
+			Iterator valItr = msgElmt.children().iterator();
+			while (valItr.hasNext()) {
+				Object object2 = valItr.next();
+				if (object2 instanceof XmlElement) {
+					outputVal = outputVal
+							+ StringUtil.DELIMETER 
+							+ StringUtil.quoteString(((XmlElement) object2).children().iterator()
+									.next().toString());
+				}
+			}
+			outputVal = ((String) outputVal).substring(1,
+					((String) outputVal).length());
+		} else {
+			Invoker fromInvoker = invokerMap.get(fromNode);
+			try {
+				if (fromInvoker != null)
+					outputVal = fromInvoker.getOutput(inputPort.getFromPort()
+							.getName());
+
+			} catch (Exception e) {
+				// if the value is still null look it up from the inputport name
+				// because the value is set to the input port name at some point
+				// there is no harm in doing this
+				if (null == outputVal) {
+					outputVal = fromInvoker.getOutput(inputPort.getName());
+				}
+			}
+
+		}
+		return outputVal;
+
+	}
+
+	/**
+	 * @param node
+	 * @return
+	 */
+	public static Node findEndForEachFor(ForEachNode node) {
+
+		Collection<Node> toNodes = node.getOutputPort(0).getToNodes();
+		if(toNodes.size() != 1){
+			throw new WorkflowRuntimeException("ForEach output does not contain single out-edge");
+		}
+		Node middleNode = toNodes.iterator().next();
+		List<DataPort> outputPorts = middleNode.getOutputPorts();
+		for (DataPort dataPort : outputPorts) {
+			if(dataPort.getToNodes().size() == 1){
+				Node possibleEndForEachNode = dataPort.getToNodes().get(0);
+				if(possibleEndForEachNode instanceof EndForEachNode){
+					return possibleEndForEachNode;
+				}
+			}
+		}
+		throw new WorkflowRuntimeException("EndForEachNode not found");
+	}
+	
+	
+	public static List<NameValue> getIOParameterData(String xml) throws ParserConfigurationException, SAXException, IOException{
+		List<NameValue> parameters=new ArrayList<NameValue>();
+		Document parameterDocument = XMLUtils.newDocument(new ByteArrayInputStream(xml.getBytes()));
+		org.w3c.dom.NodeList childNodes = parameterDocument.getDocumentElement().getChildNodes();
+		for(int i=0;i<childNodes.getLength();i++){
+			org.w3c.dom.Node parameterNode = childNodes.item(i);
+			NameValue pair = new NameValue();
+			pair.setName(parameterNode.getLocalName());
+			pair.setValue(parameterNode.getTextContent());
+			parameters.add(pair);
+		}
+		return parameters;
+	}
+
+//    public static AiravataRegistry2 getRegistry(URL url) throws IOException, RepositoryException, URISyntaxException {
+//        Properties properties = new Properties();
+//        properties.load(url.openStream());
+//        JCRComponentRegistry jcrComponentRegistry = new JCRComponentRegistry(new URI((String) properties.get(JCR_URL)),
+//                (String) properties.get(JCR_USER),(String) properties.get(JCR_PASS));
+//        return jcrComponentRegistry.getRegistry();
+//    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/WorkflowClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/WorkflowClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/WorkflowClient.java
new file mode 100644
index 0000000..c19f7db
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/WorkflowClient.java
@@ -0,0 +1,246 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.workflow;
+
+import java.net.URI;
+import java.util.Map;
+
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.ws.monitor.event.EventProducer;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.gpel.client.GcInstance;
+import org.gpel.client.GcSearchList;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul5.wsdl.WsdlDefinitions;
+
+public abstract class WorkflowClient extends EventProducer {
+    /**
+     * Either workflow template or workflow instance
+     */
+    public enum WorkflowType {
+        /**
+         * Workflow template
+         */
+        TEMPLATE,
+
+        /**
+         * Workflow instance
+         */
+        INSTANCE
+    }
+
+    protected static final String PROCESS_WSDL_TYTLE = "process.wsdl";
+
+    protected static final String PROCESS_GPEL_TITLE = "process.gpel";
+
+    protected static final String PNG_MIME_TYPE = "image/png";
+
+    protected static final String GRAPH_MIME_TYPE = "application/x-xbaya+xml";
+
+    protected final static Logger logger = LoggerFactory.getLogger(WorkflowClient.class);
+
+    protected URI engineURL;
+
+    // ===========================================================================
+    // Concrete Methods
+    // ===========================================================================
+
+    /**
+     * @param engineURL
+     * @throws WorkflowEngineException
+     */
+    public void setEngineURL(URI engineURL) throws WorkflowEngineException {
+        this.engineURL = engineURL;
+        connect();
+    }
+
+    /**
+     * @return The URL of the GPEL Engine.
+     */
+    public URI getEngineURL() {
+        return this.engineURL;
+    }
+
+    /**
+     * Deploys a workflow to the GPEL Engine.
+     * 
+     * @param workflow
+     * @param redeploy
+     * @return The workflow template ID.
+     * @throws GraphException
+     * @throws WorkflowEngineException
+     */
+    public URI createScriptAndDeploy(Workflow workflow, boolean redeploy) throws GraphException,
+            WorkflowEngineException {
+        logger.debug("Entering: " + workflow.toString());
+
+        // Generate a BPEL process.
+        workflow.createScript();
+
+        return deploy(workflow, redeploy);
+    }
+
+    /**
+     * Loads a workflow with s specified workflow template ID.
+     * 
+     * @param templateID
+     *            The workflow template ID.
+     * @return The workflow loaded
+     * @throws GraphException
+     * @throws WorkflowEngineException
+     * @throws org.apache.airavata.workflow.model.component.ComponentException
+     * 
+     */
+    public Workflow load(URI templateID) throws GraphException, WorkflowEngineException, ComponentException {
+        // Don't delete this method because the portal uses it.
+        return load(templateID, WorkflowType.TEMPLATE);
+    }
+
+    /**
+     * Returns the List of GcSearchResult.
+     * <p/>
+     * This method returns the first 100 matches.
+     * 
+     * @return The List of GcSearchResult.
+     * @throws WorkflowEngineException
+     */
+    public GcSearchList list() throws WorkflowEngineException {
+        return list(100, WorkflowType.TEMPLATE);
+    }
+
+    /**
+     * @param workflow
+     * @param dscURL
+     * @return The instance of workflow
+     * @throws WorkflowEngineException
+     * @throws ComponentException
+     * @throws GraphException
+     */
+    public GcInstance instantiate(Workflow workflow, URI dscURL) throws WorkflowEngineException, ComponentException,
+            GraphException {
+        return instantiate(workflow, dscURL, null);
+    }
+
+    /**
+     * @return True if the connection is secure; false otherwise.
+     */
+    public boolean isSecure() {
+        return true;
+        // return SecurityUtil.isSecureService(this.engineURL);
+    }
+
+    /**
+     * Checks if the client is connected to the BPEL engine.
+     * 
+     * @return true if the client is connected to the BPEL engine; false otherwise.
+     */
+    protected synchronized boolean isConnected() {
+        throw new WorkflowRuntimeException("Critical Error: Called a unsupported API");
+    }
+
+    // ===========================================================================
+    // Abstract Methods
+    // ===========================================================================
+
+    /**
+     * @param workflow
+     * @param redeploy
+     * @return The workflow template ID.
+     * @throws WorkflowEngineException
+     */
+    public abstract URI deploy(Workflow workflow, boolean redeploy) throws WorkflowEngineException;
+
+    /**
+     * @param id
+     * @param workflowType
+     * @return The workflow loaded
+     * @throws GraphException
+     * @throws WorkflowEngineException
+     * @throws ComponentException
+     */
+    public abstract Workflow load(URI id, WorkflowType workflowType) throws GraphException, WorkflowEngineException,
+            ComponentException;
+
+    /**
+     * Returns the List of GcSearchResult.
+     * 
+     * @param maxNum
+     *            The maximum number of results
+     * @param type
+     * @return The List of GcSearchResult.
+     * @throws WorkflowEngineException
+     */
+    @SuppressWarnings("boxing")
+    public abstract GcSearchList list(int maxNum, WorkflowType type) throws WorkflowEngineException;
+
+    /**
+     * @param workflow
+     *            The workflow to instantiate.
+     * @param dscURL
+     *            The URL of the DSC.
+     * @param name
+     *            The name that becomes a part of the workflow instance name.
+     * @return The instance of workflow
+     * @throws WorkflowEngineException
+     * @throws ComponentException
+     * @throws GraphException
+     */
+    public abstract GcInstance instantiate(Workflow workflow, URI dscURL, String name) throws WorkflowEngineException,
+            ComponentException, GraphException;
+
+    /**
+     * Instantiate a specified workflow.
+     * <p/>
+     * The workflow must have been dployed.
+     * 
+     * @param workflow
+     * @param wsdlMap
+     *            Map<partnerLinkName, CWSDL>
+     * @return The workflow instance.
+     * @throws WorkflowEngineException
+     * @Deprecated This one doesn't support hierarchical workflows. Use instantiate(workflow, dscURL) instead.
+     */
+    @Deprecated
+    public abstract GcInstance instantiate(Workflow workflow, Map<String, WsdlDefinitions> wsdlMap)
+            throws WorkflowEngineException;
+
+    /**
+     * Starts the workflow instance.
+     * <p/>
+     * The AWSDLs in workflow must have been modified to CWSDLs.
+     * 
+     * @param instance
+     * @return The WSDL of the workflow.
+     * @throws WorkflowEngineException
+     */
+    public abstract WsdlDefinitions start(final GcInstance instance) throws WorkflowEngineException;
+
+    public abstract void connect() throws WorkflowEngineException;
+
+    public abstract void setXBayaEngine(XBayaEngine xBayaEngine);
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/WorkflowEngineException.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/WorkflowEngineException.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/WorkflowEngineException.java
new file mode 100644
index 0000000..b5017de
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/WorkflowEngineException.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.workflow;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+
+public class WorkflowEngineException extends WorkflowException {
+    public WorkflowEngineException() {
+        super(); // To change body of overridden methods use File | Settings | File Templates.
+    }
+
+    public WorkflowEngineException(String message) {
+        super(message); // To change body of overridden methods use File | Settings | File Templates.
+    }
+
+    public WorkflowEngineException(Throwable cause) {
+        super(cause); // To change body of overridden methods use File | Settings | File Templates.
+    }
+
+    public WorkflowEngineException(String message, Throwable cause) {
+        super(message, cause); // To change body of overridden methods use File | Settings | File Templates.
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/ProxyWSDL.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/ProxyWSDL.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/ProxyWSDL.java
new file mode 100644
index 0000000..f270f2c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/ProxyWSDL.java
@@ -0,0 +1,87 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.workflow.proxy;
+
+public class ProxyWSDL {
+    // FIXME Remove this once the duel network problem is solved
+    public static String WSDL = "<wsdl:definitions targetNamespace='http://extreme.indiana.edu/weps' "
+            + "xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' "
+            + "xmlns:tns='http://extreme.indiana.edu/weps' xmlns:http='http://schemas.xmlsoap.org/wsdl/http/' "
+            + "xmlns:xs='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/' "
+            + "xmlns:mime='http://schemas.xmlsoap.org/wsdl/mime/'> " + "<wsdl:types> "
+            + "<xs:schema elementFormDefault='qualified' " + "targetNamespace='http://extreme.indiana.edu/weps'> "
+            + "<xs:element name='DeploymentInformation'> " + "<xs:complexType> " + "<xs:sequence> "
+            + "<xs:element name='ProcessName' type='xs:string' /> "
+            + "<xs:element maxOccurs='1' minOccurs='0' name='TemplateId' " + "type='xs:string' /> "
+            + "<xs:element name='DeploymentDocuments' type='tns:DeploymentDocumentsType'> " +
+
+            "</xs:element> " + "</xs:sequence> " + "</xs:complexType> " + "</xs:element> "
+            + "<xs:complexType name='DeploymentDocumentsType'> " + "<xs:sequence> "
+            + "<xs:element name='BPEL' type='xs:anyType' /> "
+            + "<xs:element name='DeploymentDescriptor' type='xs:anyType' /> "
+            + "<xs:element name='ProcessWSDL' type='tns:XMLFile' /> " +
+
+            "<xs:element maxOccurs='unbounded' minOccurs='1' " + "name='ServiceWSDLs' type='tns:XMLFile' /> "
+            + "<xs:element maxOccurs='unbounded' minOccurs='0' name='Other' " + "type='xs:anyType' /> "
+            + "</xs:sequence> " + "</xs:complexType> " + "<xs:complexType name='XMLFile'> " + "<xs:sequence> "
+            + "<xs:element name='FileName' type='xs:string' /> " + "<xs:element name='Content' type='xs:anyType'> "
+            + "</xs:element> " +
+
+            "</xs:sequence> " + "</xs:complexType> " + "<xs:element name='Result' type='xs:string' /> "
+            + "<xs:element name='ProcessName' type='xs:string' /> " + "<xs:element name='CreateInstanceResponse'> "
+            + "<xs:complexType> " + "<xs:sequence> " + "<xs:element name='ProcessName' type='xs:string' /> "
+            + "<xs:element name='ProcessWSDL' type='xs:anyType'> " +
+
+            "</xs:element> " + "</xs:sequence> " + "</xs:complexType> " + "</xs:element> " + "</xs:schema> "
+            + "</wsdl:types> " + "<wsdl:message name='DeployRequest'> "
+            + "<wsdl:part name='DeploymentInformation' element='tns:DeploymentInformation'> " + "</wsdl:part> " +
+
+            "</wsdl:message> " + "<wsdl:message name='CreateInstanceResponse'> "
+            + "<wsdl:part name='Response' element='tns:CreateInstanceResponse'> " + "</wsdl:part> "
+            + "</wsdl:message> " + "<wsdl:message name='CreateInstanceRequest'> "
+            + "<wsdl:part name='ProcessName' element='tns:ProcessName'> " + "</wsdl:part> " + "</wsdl:message> " +
+
+            "<wsdl:message name='DeployResponse'> " + "<wsdl:part name='Response' element='tns:Result'> "
+            + "</wsdl:part> " + "</wsdl:message> " + "<wsdl:portType name='WEPSPortType'> "
+            + "<wsdl:operation name='deploy'> " + "<wsdl:input message='tns:DeployRequest'> " + "</wsdl:input> "
+            + "<wsdl:output message='tns:DeployResponse'> " +
+
+            "</wsdl:output> " + "</wsdl:operation> " + "<wsdl:operation name='createInstance'> "
+            + "<wsdl:input message='tns:CreateInstanceRequest'> " + "</wsdl:input> "
+            + "<wsdl:output message='tns:CreateInstanceResponse'> " + "</wsdl:output> " + "</wsdl:operation> "
+            + "</wsdl:portType> " +
+
+            "<wsdl:binding name='WEPSBinding' type='tns:WEPSPortType'> " + "<soap:binding style='document' "
+            + "transport='http://schemas.xmlsoap.org/soap/http' /> " + "<wsdl:operation name='deploy'> "
+            + "<soap:operation soapAction='urn:deploy' /> " + "<wsdl:input> " + "<soap:body use='literal' /> "
+            + "</wsdl:input> " + "<wsdl:output> " + "<soap:body use='literal' /> " +
+
+            "</wsdl:output> " + "</wsdl:operation> " + "<wsdl:operation name='createInstance'> "
+            + "<soap:operation soapAction='urn:createInstance' /> " + "<wsdl:input> " + "<soap:body use='literal' /> "
+            + "</wsdl:input> " + "<wsdl:output> " + "<soap:body use='literal' /> " +
+
+            "</wsdl:output> " + "</wsdl:operation> " + "</wsdl:binding> " + "<wsdl:service name='WEPSService'> "
+            + "<wsdl:port name='WEPS' binding='tns:WEPSBinding'> " + "<soap:address "
+            + "location='http://silktree.cs.indiana.edu:18080/axis2/services/WEPSService' /> " + "</wsdl:port> "
+            + "</wsdl:service> " + "</wsdl:definitions> ";
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowClient.java
new file mode 100644
index 0000000..d2afec5
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowClient.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.workflow.proxy;
+
+import org.apache.airavata.common.utils.Pair;
+import org.ietf.jgss.GSSException;
+
+public interface WorkflowClient {
+
+    public Pair<String, String> invoke(Pair<String, String>[] inputs) throws GSSException;
+
+    public void init();
+
+    public String getInstanceID();
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowContext.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowContext.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowContext.java
new file mode 100644
index 0000000..f2b28be
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowContext.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.workflow.proxy;
+
+import java.net.URISyntaxException;
+
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.ietf.jgss.GSSCredential;
+import org.ietf.jgss.GSSException;
+
+import xsul.lead.LeadContextHeader;
+
+public interface WorkflowContext {
+
+    public void prepare(WorkflowClient client, Workflow workflow) throws GSSException, URISyntaxException;
+
+    public LeadContextHeader getHeader();
+
+    public GSSCredential getCredentials();
+
+    public String getTopic();
+
+}


[55/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaLinkButton.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaLinkButton.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaLinkButton.java
new file mode 100644
index 0000000..b963475
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaLinkButton.java
@@ -0,0 +1,306 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.GridLayout;
+import java.awt.Rectangle;
+import java.net.URL;
+
+import javax.swing.Action;
+import javax.swing.ButtonModel;
+import javax.swing.Icon;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.plaf.ComponentUI;
+import javax.swing.plaf.metal.MetalButtonUI;
+
+public class XBayaLinkButton extends JButton {
+    /**
+	 * 
+	 */
+    private static final long serialVersionUID = -4827125226349868996L;
+
+    public static final int ALWAYS_UNDERLINE = 0;
+
+    public static final int HOVER_UNDERLINE = 1;
+
+    public static final int NEVER_UNDERLINE = 2;
+
+    public static final int SYSTEM_DEFAULT = 3;
+
+    private int linkBehavior;
+
+    private Color linkColor;
+
+    private Color colorPressed;
+
+    private Color visitedLinkColor;
+
+    private Color disabledLinkColor;
+
+    private URL buttonURL;
+
+    private Action defaultAction;
+
+    private boolean isLinkVisited;
+
+    public static void main(String[] a) {
+        JFrame f = new JFrame();
+        f.getContentPane().setLayout(new GridLayout(0, 2));
+        f.getContentPane().add(new XBayaLinkButton("www.java2s.com"));
+        f.getContentPane().add(new XBayaLinkButton("www.java2s.com/ExampleCode/CatalogExampleCode.htm"));
+        f.setSize(600, 200);
+        f.setVisible(true);
+    }
+
+    public XBayaLinkButton() {
+        this(null, null, null);
+    }
+
+    public XBayaLinkButton(Action action) {
+        this();
+        setAction(action);
+    }
+
+    public XBayaLinkButton(Icon icon) {
+        this(null, icon, null);
+    }
+
+    public XBayaLinkButton(String s) {
+        this(s, null, null);
+    }
+
+    public XBayaLinkButton(URL url) {
+        this(null, null, url);
+    }
+
+    public XBayaLinkButton(String s, URL url) {
+        this(s, null, url);
+    }
+
+    public XBayaLinkButton(Icon icon, URL url) {
+        this(null, icon, url);
+    }
+
+    public XBayaLinkButton(String text, Icon icon, URL url) {
+        super(text, icon);
+        linkBehavior = SYSTEM_DEFAULT;
+        linkColor = Color.blue;
+        colorPressed = Color.red;
+        visitedLinkColor = new Color(128, 0, 128);
+        if (text == null && url != null)
+            setText(url.toExternalForm());
+        setLinkURL(url);
+        setCursor(Cursor.getPredefinedCursor(12));
+        setBorderPainted(false);
+        setContentAreaFilled(false);
+        setRolloverEnabled(true);
+        addActionListener(defaultAction);
+    }
+
+    public void updateUI() {
+        setUI(BasicLinkButtonUI.createUI(this));
+    }
+
+    public String getUIClassID() {
+        return "LinkButtonUI";
+    }
+
+    protected void setupToolTipText() {
+        String tip = null;
+        if (buttonURL != null)
+            tip = buttonURL.toExternalForm();
+        setToolTipText(tip);
+    }
+
+    public void setLinkBehavior(int bnew) {
+        checkLinkBehaviour(bnew);
+        int old = linkBehavior;
+        linkBehavior = bnew;
+        firePropertyChange("linkBehavior", old, bnew);
+        repaint();
+    }
+
+    private void checkLinkBehaviour(int beha) {
+        if (beha != ALWAYS_UNDERLINE && beha != HOVER_UNDERLINE && beha != NEVER_UNDERLINE && beha != SYSTEM_DEFAULT)
+            throw new IllegalArgumentException("Not a legal LinkBehavior");
+        else
+            return;
+    }
+
+    public int getLinkBehavior() {
+        return linkBehavior;
+    }
+
+    public void setLinkColor(Color color) {
+        Color colorOld = linkColor;
+        linkColor = color;
+        firePropertyChange("linkColor", colorOld, color);
+        repaint();
+    }
+
+    public Color getLinkColor() {
+        return linkColor;
+    }
+
+    public void setActiveLinkColor(Color colorNew) {
+        Color colorOld = colorPressed;
+        colorPressed = colorNew;
+        firePropertyChange("activeLinkColor", colorOld, colorNew);
+        repaint();
+    }
+
+    public Color getActiveLinkColor() {
+        return colorPressed;
+    }
+
+    public void setDisabledLinkColor(Color color) {
+        Color colorOld = disabledLinkColor;
+        disabledLinkColor = color;
+        firePropertyChange("disabledLinkColor", colorOld, color);
+        if (!isEnabled())
+            repaint();
+    }
+
+    public Color getDisabledLinkColor() {
+        return disabledLinkColor;
+    }
+
+    public void setVisitedLinkColor(Color colorNew) {
+        Color colorOld = visitedLinkColor;
+        visitedLinkColor = colorNew;
+        firePropertyChange("visitedLinkColor", colorOld, colorNew);
+        repaint();
+    }
+
+    public Color getVisitedLinkColor() {
+        return visitedLinkColor;
+    }
+
+    public URL getLinkURL() {
+        return buttonURL;
+    }
+
+    public void setLinkURL(URL url) {
+        URL urlOld = buttonURL;
+        buttonURL = url;
+        setupToolTipText();
+        firePropertyChange("linkURL", urlOld, url);
+        revalidate();
+        repaint();
+    }
+
+    public void setLinkVisited(boolean flagNew) {
+        boolean flagOld = isLinkVisited;
+        isLinkVisited = flagNew;
+        firePropertyChange("linkVisited", flagOld, flagNew);
+        repaint();
+    }
+
+    public boolean isLinkVisited() {
+        return isLinkVisited;
+    }
+
+    public void setDefaultAction(Action actionNew) {
+        Action actionOld = defaultAction;
+        defaultAction = actionNew;
+        firePropertyChange("defaultAction", actionOld, actionNew);
+    }
+
+    public Action getDefaultAction() {
+        return defaultAction;
+    }
+
+    protected String paramString() {
+        String str;
+        if (linkBehavior == ALWAYS_UNDERLINE)
+            str = "ALWAYS_UNDERLINE";
+        else if (linkBehavior == HOVER_UNDERLINE)
+            str = "HOVER_UNDERLINE";
+        else if (linkBehavior == NEVER_UNDERLINE)
+            str = "NEVER_UNDERLINE";
+        else
+            str = "SYSTEM_DEFAULT";
+        String colorStr = linkColor == null ? "" : linkColor.toString();
+        String colorPressStr = colorPressed == null ? "" : colorPressed.toString();
+        String disabledLinkColorStr = disabledLinkColor == null ? "" : disabledLinkColor.toString();
+        String visitedLinkColorStr = visitedLinkColor == null ? "" : visitedLinkColor.toString();
+        String buttonURLStr = buttonURL == null ? "" : buttonURL.toString();
+        String isLinkVisitedStr = isLinkVisited ? "true" : "false";
+        return super.paramString() + ",linkBehavior=" + str + ",linkURL=" + buttonURLStr + ",linkColor=" + colorStr
+                + ",activeLinkColor=" + colorPressStr + ",disabledLinkColor=" + disabledLinkColorStr
+                + ",visitedLinkColor=" + visitedLinkColorStr + ",linkvisitedString=" + isLinkVisitedStr;
+    }
+}
+
+class BasicLinkButtonUI extends MetalButtonUI {
+    private static final BasicLinkButtonUI ui = new BasicLinkButtonUI();
+
+    public BasicLinkButtonUI() {
+    }
+
+    public static ComponentUI createUI(JComponent jcomponent) {
+        return ui;
+    }
+
+    protected void paintText(Graphics g, JComponent com, Rectangle rect, String s) {
+        XBayaLinkButton bn = (XBayaLinkButton) com;
+        ButtonModel bnModel = bn.getModel();
+        if (bnModel.isEnabled()) {
+            if (bnModel.isPressed())
+                bn.setForeground(bn.getActiveLinkColor());
+            else if (bn.isLinkVisited())
+                bn.setForeground(bn.getVisitedLinkColor());
+
+            else
+                bn.setForeground(bn.getLinkColor());
+        } else {
+            if (bn.getDisabledLinkColor() != null)
+                bn.setForeground(bn.getDisabledLinkColor());
+        }
+        super.paintText(g, com, rect, s);
+        int behaviour = bn.getLinkBehavior();
+        boolean drawLine = false;
+        if (behaviour == XBayaLinkButton.HOVER_UNDERLINE) {
+            if (bnModel.isRollover())
+                drawLine = true;
+        } else if (behaviour == XBayaLinkButton.ALWAYS_UNDERLINE || behaviour == XBayaLinkButton.SYSTEM_DEFAULT)
+            drawLine = true;
+        if (!drawLine)
+            return;
+        FontMetrics fm = g.getFontMetrics();
+        int x = rect.x + getTextShiftOffset();
+        int y = (rect.y + fm.getAscent() + fm.getDescent() + getTextShiftOffset()) - 1;
+        if (bnModel.isEnabled()) {
+            g.setColor(bn.getForeground());
+            g.drawLine(x, y, (x + rect.width) - 1, y);
+        } else {
+            g.setColor(bn.getBackground().brighter());
+            g.drawLine(x, y, (x + rect.width) - 1, y);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaList.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaList.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaList.java
new file mode 100644
index 0000000..89fbf77
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaList.java
@@ -0,0 +1,169 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.awt.Dimension;
+import java.awt.event.MouseAdapter;
+import java.util.Collection;
+import java.util.Vector;
+
+import javax.swing.JList;
+import javax.swing.JScrollPane;
+import javax.swing.ListSelectionModel;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.event.ListSelectionListener;
+
+
+/**
+ * @param <E>
+ */
+public class XBayaList<E> implements XBayaComponent {
+
+    private static final int DEFAULT_WIDTH = 300;
+
+    private static final int DEFAULT_HEIGHT = 200;
+
+    private JList list;
+
+    private JScrollPane scrollPane;
+
+    /**
+     * Constructs a XBayaTextArea.
+     */
+    public XBayaList() {
+        init();
+    }
+
+    /**
+     * @return The swing component.
+     */
+    public JScrollPane getSwingComponent() {
+        return getScrollPane();
+    }
+
+    /**
+     * @return The scroll pane.
+     */
+    public JScrollPane getScrollPane() {
+        return this.scrollPane;
+    }
+
+    /**
+     * @param enabled
+     */
+    public void setEnabled(boolean enabled) {
+        this.list.setEnabled(enabled);
+    }
+
+    /**
+     * @return The text area
+     */
+    public JList getList() {
+        return this.list;
+    }
+
+    /**
+     * @param width
+     * @param height
+     */
+    public void setSize(int width, int height) {
+        Dimension size = new Dimension(width, height);
+        this.scrollPane.setMinimumSize(size);
+        this.scrollPane.setPreferredSize(size);
+    }
+
+    /**
+     * Returns the first selected index; returns -1 if there is no selected item.
+     * 
+     * @return The first selected index; -1 if there is no selected item.
+     */
+    public int getSelectedIndex() {
+        return this.list.getSelectedIndex();
+    }
+
+    /**
+     * Selects a single cell.
+     * 
+     * @param index
+     *            the index of the one cell to select
+     */
+    public void setSelectedIndex(int index) {
+        this.list.setSelectedIndex(index);
+    }
+
+    /**
+     * Returns the first selected value, or <code>null</code> if the selection is empty.
+     * 
+     * @return the first selected value
+     */
+    @SuppressWarnings("unchecked")
+    public E getSelectedValue() {
+        return (E) this.list.getSelectedValue();
+    }
+
+    /**
+     * @param listData
+     */
+    public void setListData(Iterable<E> listData) {
+        if (listData instanceof Vector) {
+            this.list.setListData((Vector) listData);
+        } else if (listData instanceof Collection) {
+            this.list.setListData(new Vector<E>((Collection<E>) listData));
+        } else {
+            Vector<E> data = new Vector<E>();
+            for (E datum : data) {
+                data.add(datum);
+            }
+            this.list.setListData(data);
+        }
+    }
+
+    /**
+     * @param listData
+     */
+    public void setListData(E[] listData) {
+        this.list.setListData(listData);
+    }
+
+    /**
+     * @param listener
+     */
+    public void addListSelectionListener(ListSelectionListener listener) {
+        this.list.addListSelectionListener(listener);
+    }
+
+    /**
+     * @param adapter
+     */
+    public void addMouseListener(MouseAdapter adapter) {
+        this.list.addMouseListener(adapter);
+    }
+
+    private void init() {
+        this.list = new JList();
+        this.list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        this.scrollPane = new JScrollPane(this.list);
+        this.scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+        setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextArea.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextArea.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextArea.java
new file mode 100644
index 0000000..49af32f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextArea.java
@@ -0,0 +1,120 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.awt.Dimension;
+
+import javax.swing.JScrollPane;
+import javax.swing.JTextArea;
+import javax.swing.ScrollPaneConstants;
+
+public class XBayaTextArea implements XBayaTextComponent {
+
+    /**
+     * DEFAULT_WIDTH
+     */
+    public static final int DEFAULT_WIDTH = 300;
+
+    /**
+     * DEFAULT_HEIGHT
+     */
+    public static final int DEFAULT_HEIGHT = 200;
+
+    private JTextArea textArea;
+
+    private JScrollPane scrollPane;
+
+    /**
+     * Constructs a XBayaTextArea.
+     */
+    public XBayaTextArea() {
+        init();
+    }
+
+    /**
+     * @return The swing component.
+     */
+    public JScrollPane getSwingComponent() {
+        return getScrollPane();
+    }
+
+    /**
+     * @param text
+     */
+    public void setText(String text) {
+        if (text == null) {
+            text = "";
+        } else {
+            text = text.trim();
+        }
+        this.textArea.setText(text);
+        this.textArea.setCaretPosition(0);
+    }
+
+    /**
+     * @return The text
+     */
+    public String getText() {
+        return this.textArea.getText().trim();
+    }
+
+    /**
+     * @return The scroll pane.
+     */
+    public JScrollPane getScrollPane() {
+        return this.scrollPane;
+    }
+
+    /**
+     * @return The text area
+     */
+    public JTextArea getTextArea() {
+        return this.textArea;
+    }
+
+    /**
+     * @param editable
+     */
+    public void setEditable(boolean editable) {
+        this.textArea.setEditable(editable);
+    }
+
+    /**
+     * @param width
+     * @param height
+     */
+    public void setSize(int width, int height) {
+        Dimension size = new Dimension(width, height);
+        this.scrollPane.setMinimumSize(size);
+        this.scrollPane.setPreferredSize(size);
+    }
+
+    private void init() {
+        this.textArea = new JTextArea();
+        this.textArea.setEditable(true);
+        this.textArea.setLineWrap(true);
+        this.textArea.setWrapStyleWord(true);
+        this.scrollPane = new JScrollPane(this.textArea);
+        this.scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+        setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextComponent.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextComponent.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextComponent.java
new file mode 100644
index 0000000..68a499a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextComponent.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+
+public interface XBayaTextComponent extends XBayaComponent {
+
+    /**
+     * @param text
+     */
+    public void setText(String text);
+
+    /**
+     * @return The text
+     */
+    public String getText();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextField.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextField.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextField.java
new file mode 100644
index 0000000..c8397d8
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaTextField.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.net.URI;
+
+import javax.swing.JTextField;
+
+import org.apache.airavata.common.utils.StringUtil;
+
+public class XBayaTextField implements XBayaTextComponent {
+
+    /**
+     * DEFAULT_COLUMNS
+     */
+    public static final int DEFAULT_COLUMNS = 30;
+
+    private JTextField textArea;
+
+    /**
+     * Constructs a XBayaTextArea.
+     */
+    public XBayaTextField() {
+        init();
+    }
+
+    /**
+     * Constructs a XBayaTextField.
+     * 
+     * @param initStr
+     */
+    public XBayaTextField(String initStr) {
+        init();
+        this.textArea.setText(initStr);
+    }
+
+    /**
+     * @return The swing component.
+     */
+    public JTextField getSwingComponent() {
+        return getTextField();
+    }
+
+    /**
+     * @param uri
+     */
+    public void setText(URI uri) {
+        setText(StringUtil.toString(uri));
+    }
+
+    /**
+     * @param text
+     */
+    public void setText(String text) {
+        if (text == null) {
+            text = "";
+        } else {
+            text = text.trim();
+        }
+        this.textArea.setText(text);
+        this.textArea.setCaretPosition(0);
+    }
+
+    /**
+     * @return The text. It never returns null.
+     */
+    public String getText() {
+        return this.textArea.getText().trim();
+    }
+
+    /**
+     * @return The text field
+     */
+    public JTextField getTextField() {
+        return this.textArea;
+    }
+
+    /**
+     * @param editable
+     */
+    public void setEditable(boolean editable) {
+        this.textArea.setEditable(editable);
+    }
+
+    /**
+     * @param columns
+     */
+    public void setColumns(int columns) {
+        this.textArea.setColumns(columns);
+    }
+
+    /**
+     * Sets whether or not this component is enabled.
+     * 
+     * @param enabled
+     */
+    public void setEnabled(boolean enabled) {
+        this.textArea.setEnabled(enabled);
+    }
+
+    private void init() {
+        this.textArea = new JTextField(DEFAULT_COLUMNS);
+        this.textArea.setEditable(true);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaToolBar.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaToolBar.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaToolBar.java
new file mode 100644
index 0000000..9f18440
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaToolBar.java
@@ -0,0 +1,362 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.swing.AbstractAction;
+import javax.swing.BorderFactory;
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JToolBar;
+import javax.swing.border.Border;
+
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+
+import com.amazonaws.transform.MapEntry;
+
+public class XBayaToolBar implements XBayaComponent {
+
+    private XBayaEngine engine;
+
+    private JToolBar toolbar;
+
+    private JButton play;
+
+    private JButton step;
+
+    private JButton stop;
+    
+    private Map<String,List<ToolbarButton>> toolbarButtons = new HashMap<String,List<ToolbarButton>>();
+
+    private static Map<String,Integer> groupOrder;
+    /**
+     * IMAGES_STOP_JPEG
+     */
+    public static final String IMAGES_STOP_JPEG = "stop.jpeg";
+    /**
+     * IMAGES_PAUSE_JPEG
+     */
+    public static final String IMAGES_PAUSE_JPEG = "pause.jpeg";
+    /**
+     * IMAGES_PLAY_JPEG
+     */
+    public static final String IMAGES_PLAY_JPEG = "play.jpeg";
+    /**
+     * IMAGES_STEP_JPEG
+     */
+    private static final String IMAGES_STEP_JPEG = "step.gif";
+
+    private AbstractAction playAction;
+
+    private AbstractAction stepAction;
+
+    private AbstractAction stopAction;
+
+    private ImageIcon PLAY_ICON;
+
+    private ImageIcon PAUSE_ICON;
+
+    /**
+     * Creates a toolbar.
+     * 
+     * @param client
+     */
+    public XBayaToolBar(XBayaEngine client) {
+        this.engine = client;
+        init();
+    }
+
+    /**
+     * Returns the toolbar.
+     * 
+     * @return The toolbar
+     */
+    public JComponent getSwingComponent() {
+        return this.toolbar;
+    }
+
+    private void init() {
+
+        this.toolbar = new JToolBar();
+        this.toolbar.setFloatable(false);
+        Border border = BorderFactory.createEtchedBorder();
+        this.toolbar.setBorder(border);
+
+        JButton addNodeButton = new JButton("Add Node");
+        addNodeButton.addActionListener(new AbstractAction() {
+            private static final long serialVersionUID = 1L;
+
+            public void actionPerformed(ActionEvent event) {
+                try {
+                    XBayaToolBar.this.engine.getGUI().addNode();
+                } catch (RuntimeException e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                } catch (Error e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                }
+            }
+        });
+
+        JButton removeNodeButton = new JButton("Remove Node");
+        removeNodeButton.addActionListener(new AbstractAction() {
+            private static final long serialVersionUID = 1L;
+
+            public void actionPerformed(ActionEvent event) {
+                try {
+                    XBayaToolBar.this.engine.getGUI().getGraphCanvas().removeSelectedNode();
+                } catch (GraphException e) {
+                    // Should not happen
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                } catch (RuntimeException e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                } catch (Error e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                }
+            }
+        });
+
+        JButton connectEdgeButton = new JButton("Connect/Disconnect");
+        connectEdgeButton.addActionListener(new AbstractAction() {
+            private static final long serialVersionUID = 1L;
+
+            public void actionPerformed(ActionEvent event) {
+                try {
+                    XBayaToolBar.this.engine.getGUI().getGraphCanvas().addOrRemoveEdge();
+                } catch (RuntimeException e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                } catch (Error e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                }
+            }
+        });
+
+        this.play = new JButton();
+        PAUSE_ICON = SwingUtil.createImageIcon(IMAGES_PAUSE_JPEG);
+        PLAY_ICON = SwingUtil.createImageIcon(IMAGES_PLAY_JPEG);
+        this.playAction = new AbstractAction(null, PAUSE_ICON) {
+            /**
+             * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+             */
+            public void actionPerformed(ActionEvent e1) {
+                try {
+                    Workflow workflow = engine.getGUI().getWorkflow();
+                    WorkflowExecutionState executionState = workflow.getExecutionState();
+                    if (executionState == WorkflowExecutionState.RUNNING || executionState == WorkflowExecutionState.STEP) {
+                        workflow.setExecutionState(WorkflowExecutionState.PAUSED);
+                        play.setIcon(PLAY_ICON);
+                    } else if (executionState == WorkflowExecutionState.PAUSED) {
+                        workflow.setExecutionState(WorkflowExecutionState.RUNNING);
+                        play.setIcon(PAUSE_ICON);
+                    } else {
+                        throw new IllegalStateException("Unknown state :" + executionState);
+                    }
+                } catch (RuntimeException e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                } catch (Error e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                }
+
+            }
+        };
+        this.play.setAction(this.playAction);
+
+        this.step = new JButton();
+        this.stepAction = new AbstractAction(null, SwingUtil.createImageIcon(IMAGES_STEP_JPEG)) {
+            /**
+             * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+             */
+            public void actionPerformed(ActionEvent e2) {
+                try {
+                    if (engine.getGUI().getWorkflow().getExecutionState() == WorkflowExecutionState.PAUSED) {
+                        engine.getGUI().getWorkflow().setExecutionState(WorkflowExecutionState.STEP);
+                    } else {
+                        throw new IllegalStateException("Unknown state :" + engine.getGUI().getWorkflow().getExecutionState());
+                    }
+                } catch (RuntimeException e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                } catch (Error e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                }
+
+            }
+        };
+        this.step.setAction(stepAction);
+
+        this.stop = new JButton();
+        this.stopAction = new AbstractAction(null, SwingUtil.createImageIcon(IMAGES_STOP_JPEG)) {
+            /**
+             * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+             */
+            public void actionPerformed(ActionEvent e1) {
+                try {
+                    if (engine.getGUI().getWorkflow().getExecutionState() != WorkflowExecutionState.NONE
+                            || engine.getGUI().getWorkflow().getExecutionState() != WorkflowExecutionState.STOPPED) {
+                        engine.getGUI().getWorkflow().setExecutionState(WorkflowExecutionState.STOPPED);
+                    } else {
+                        throw new IllegalStateException("Unknown state :" + engine.getGUI().getWorkflow().getExecutionState());
+                    }
+                } catch (RuntimeException e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                } catch (Error e) {
+                    XBayaToolBar.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                }
+
+            }
+        };
+        this.stop.setAction(stopAction);
+
+//        this.toolbar.add(addNodeButton);
+//        this.toolbar.add(removeNodeButton);
+//        this.toolbar.addSeparator();
+//        this.toolbar.add(connectEdgeButton);
+        
+    }
+
+    public ToolbarButton addToolbarButton(String group, String caption, Icon icon, String description, ActionListener onClick, int order){
+    	ToolbarButton toolbarButton = new ToolbarButton(icon, caption, description, order);
+    	toolbarButton.setButtonClickListener(onClick);
+    	getToolBarButtonList(group).add(toolbarButton);
+    	rearrangeToolbarButtons();
+    	return toolbarButton;
+    }
+    
+    private void sortButtons(List<ToolbarButton> buttons){
+    	ToolbarButton[] buttonList=buttons.toArray(new ToolbarButton[]{});
+    	ToolbarButton temp;
+    	for (int i=0;i<buttonList.length-1;i++) {
+			for(int j=i+1;j<buttonList.length;j++){
+				if (buttonList[i].getOrder()!=-1){
+					if (buttonList[i].getOrder()>buttonList[j].getOrder()){
+						temp=buttonList[i];
+						buttonList[i]=buttonList[j];
+						buttonList[j]=temp;
+					}
+				}
+			}
+		}
+    	buttons.clear();
+    	buttons.addAll(Arrays.asList(buttonList));
+    }
+    
+    private void rearrangeToolbarButtons(){
+    	toolbar.removeAll();
+    	String[] groupIds = getSortedGroupIdList();
+    	Map<String, List<ToolbarButton>> tempToolbarButtons=new HashMap<String, List<ToolbarButton>>();
+    	tempToolbarButtons.putAll(toolbarButtons);
+    	for (String groupId : groupIds) {
+    		tempToolbarButtons.remove(groupId);
+    		if (toolbarButtons.containsKey(groupId) && toolbarButtons.get(groupId)!=null) {
+				List<ToolbarButton> buttons = toolbarButtons.get(groupId);
+				addButtonsToToolbar(buttons);
+			}
+		}
+    	for (String groupId : tempToolbarButtons.keySet()) {
+    		List<ToolbarButton> buttons = tempToolbarButtons.get(groupId);
+			addButtonsToToolbar(buttons);
+		}
+    }
+
+	private void addButtonsToToolbar(List<ToolbarButton> buttons) {
+		sortButtons(buttons);
+		for (ToolbarButton button : buttons) {
+			toolbar.add(button);
+		}
+		toolbar.addSeparator();
+	}
+
+	private String[] getSortedGroupIdList() {
+		String[] groupIds = getGroupOrder().keySet().toArray(new String[]{});
+    	for(int i=0;i<groupIds.length-1;i++){
+    		for(int j=i+1;j<groupIds.length;j++){
+        		if (getGroupOrder().get(groupIds[i])>getGroupOrder().get(groupIds[j])){
+        			String temp=groupIds[i];
+        			groupIds[i]=groupIds[j];
+        			groupIds[j]=temp;
+        		}
+        	}	
+    	}
+		return groupIds;
+	}
+    
+
+    /**
+     * Returns the playAction.
+     * 
+     * @return The playAction
+     */
+    public AbstractAction getPlayAction() {
+        return this.playAction;
+    }
+
+    /**
+     * Returns the stepAction.
+     * 
+     * @return The stepAction
+     */
+    public AbstractAction getStepAction() {
+        return this.stepAction;
+    }
+
+    /**
+     * Returns the stopAction.
+     * 
+     * @return The stopAction
+     */
+    public AbstractAction getStopAction() {
+        return this.stopAction;
+    }
+
+    private List<ToolbarButton> getToolBarButtonList(String group){
+    	if (!toolbarButtons.containsKey(group)){
+    		toolbarButtons.put(group, new ArrayList<ToolbarButton>());
+    	}
+    	return toolbarButtons.get(group);
+    }
+    
+    public static void setGroupOrder(String groupId, int order){
+    	getGroupOrder().put(groupId, order);
+    }
+
+	public static Map<String,Integer> getGroupOrder() {
+		if (groupOrder==null){
+    		groupOrder=new HashMap<String, Integer>();
+    	}
+		return groupOrder;
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XbayaEnhancedList.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XbayaEnhancedList.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XbayaEnhancedList.java
new file mode 100644
index 0000000..edac352
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XbayaEnhancedList.java
@@ -0,0 +1,308 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.awt.Dimension;
+import java.awt.event.MouseAdapter;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import javax.swing.ScrollPaneConstants;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.table.DefaultTableModel;
+
+
+/**
+ * @param <T>
+ */
+public class XbayaEnhancedList<T extends TableRenderable> implements XBayaComponent {
+
+    private static final int DEFAULT_WIDTH = 400;
+
+    private static final int DEFAULT_HEIGHT = 200;
+
+    private boolean checkbox;
+
+    private DefaultTableModel model;
+
+    private JTable table;
+
+    private JScrollPane scrollPane;
+
+    private Vector<T> tableList;
+
+    /**
+     * Constructs a XbayaEnhancedList.
+     * 
+     */
+    public XbayaEnhancedList() {
+        this(true);
+    }
+
+    /**
+     * 
+     * Constructs a XbayaEnhancedList.
+     * 
+     * @param checkbox
+     */
+    public XbayaEnhancedList(boolean checkbox) {
+        this.checkbox = checkbox;
+        init();
+    }
+
+    /**
+     * Init XbayaEnhancedList
+     */
+    private void init() {
+
+        this.tableList = new Vector<T>();
+
+        this.table = new JTable(new DefaultTableModel());
+        this.table.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        this.table.setRowSelectionAllowed(true);
+
+        this.scrollPane = new JScrollPane(this.table);
+        this.scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+        setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);
+    }
+
+    /**
+     * @return The swing component.
+     */
+    public JScrollPane getSwingComponent() {
+        return getScrollPane();
+    }
+
+    /**
+     * @return The scroll pane.
+     */
+    public JScrollPane getScrollPane() {
+        return this.scrollPane;
+    }
+
+    /**
+     * @param width
+     * @param height
+     */
+    public void setSize(int width, int height) {
+        Dimension size = new Dimension(width, height);
+        this.scrollPane.setMinimumSize(size);
+        this.scrollPane.setPreferredSize(size);
+    }
+
+    /**
+     * @return table
+     */
+    public JTable getTable() {
+        return this.table;
+    }
+
+    /**
+     * @param tableData
+     * @param listData
+     */
+    public void setListData(Iterable<T> tableData) {
+
+        /*
+         * Create a model for the table for the first time
+         */
+        if (this.model == null) {
+
+            this.model = new DefaultTableModel() {
+                /*
+                 * JTable uses this method to determine the default renderer/ editor for each cell. If we didn't
+                 * implement this method, then the last column would contain text ("true"/"false"), rather than a check
+                 * box.
+                 */
+                @SuppressWarnings("unchecked")
+                @Override
+                public Class getColumnClass(int c) {
+                    if (getValueAt(0, c) == null)
+                        return String.class;
+                    return getValueAt(0, c).getClass();
+                }
+
+                /*
+                 * Don't need to implement this method unless your table's editable.
+                 */
+                @Override
+                public boolean isCellEditable(int row, int col) {
+                    // Note that the data/cell address is constant,
+                    // no matter where the cell appears onscreen.
+                    if (XbayaEnhancedList.this.checkbox && col > 0) {
+                        return false;
+                    } else {
+                        return true;
+                    }
+                }
+            };
+
+            /*
+             * Setup Column Title
+             */
+            boolean noData = true;
+            for (T entry : tableData) {
+                if (this.checkbox) {
+                    this.model.addColumn("Selection");
+                }
+
+                for (int i = 0; i < entry.getColumnCount(); i++) {
+                    this.model.addColumn(entry.getColumnTitle(i));
+                }
+                noData = false;
+                break;
+            }
+
+            // empty input
+            if (noData) {
+                this.model = null;
+                return;
+            }
+
+            this.table.setModel(this.model);
+        }
+
+        clear();
+
+        ArrayList<Object> objList = new ArrayList<Object>();
+        for (T entry : tableData) {
+
+            // add checkbox if needed
+            if (this.checkbox) {
+                objList.add(Boolean.FALSE);
+            }
+
+            for (int i = 0; i < entry.getColumnCount(); i++) {
+                objList.add(entry.getValue(i));
+            }
+            this.model.addRow(objList.toArray());
+            this.tableList.add(entry);
+
+            // clear list
+            objList.clear();
+        }
+    }
+
+    /**
+     * @return T
+     */
+    public T getSelectedValue() {
+        int result = getSelectedIndex();
+        if (result < 0) {
+            return null;
+        }
+        return this.tableList.get(result);
+    }
+
+    /**
+     * @return selected values
+     */
+    public List<T> getSelectedValues() {
+        List<T> resultList = new ArrayList<T>();
+        for (Integer i : getSelectedIndices()) {
+            resultList.add(this.tableList.get(i.intValue()));
+        }
+        return resultList;
+    }
+
+    /**
+     * remove rows selected This method must be called at the last step
+     */
+    public void removeSelectedRows() {
+        int count = 0;
+        for (Integer i : getSelectedIndices()) {
+            this.model.removeRow(i.intValue() - count);
+            this.tableList.remove(i.intValue() - count);
+            count++;
+        }
+    }
+
+    /**
+     * Clear the list contents
+     */
+    public void clear() {
+        if (this.model != null) {
+            for (int i = this.model.getRowCount() - 1; i >= 0; i--) {
+                this.model.removeRow(i);
+            }
+        }
+        this.tableList.clear();
+    }
+
+    /**
+     * @param enabled
+     */
+    public void setEnabled(boolean enabled) {
+        this.table.setEnabled(enabled);
+    }
+
+    /**
+     * Returns the first selected index; returns -1 if there is no selected item.
+     * 
+     * @return The first selected index; -1 if there is no selected item.
+     */
+    public int getSelectedIndex() {
+        List<Integer> intList = getSelectedIndices();
+        if (intList.size() > 1) {
+            return -2;
+        } else if (intList.size() == 0) {
+            return -1;
+        }
+        return intList.get(0).intValue();
+    }
+
+    /**
+     * @return selected indices
+     */
+    public List<Integer> getSelectedIndices() {
+        List<Integer> intList = new ArrayList<Integer>();
+
+        if (!this.checkbox) {
+            intList.add(new Integer(this.table.getSelectedRow()));
+        } else {
+            for (int i = 0; i < this.getTable().getModel().getRowCount(); i++) {
+                if (((Boolean) this.getTable().getModel().getValueAt(i, 0)).booleanValue()) {
+                    intList.add(new Integer(i));
+                }
+            }
+        }
+        return intList;
+    }
+
+    /**
+     * @param listener
+     */
+    public void addListSelectionListener(ListSelectionListener listener) {
+        this.table.getSelectionModel().addListSelectionListener(listener);
+    }
+
+    /**
+     * @param adapter
+     */
+    public void addMouseListener(MouseAdapter adapter) {
+        this.table.addMouseListener(adapter);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/amazon/S3Tree.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/amazon/S3Tree.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/amazon/S3Tree.java
new file mode 100644
index 0000000..4f6abbb
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/amazon/S3Tree.java
@@ -0,0 +1,133 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets.amazon;
+
+import javax.swing.JTree;
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+
+public class S3Tree extends JTree {
+
+    /**
+     * 
+     * Constructs a S3Tree.
+     * 
+     */
+    public S3Tree() {
+        this.setModel(S3TreeModel.getInstance());
+        this.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+        this.setShowsRootHandles(true);
+    }
+
+    /**
+	 * 
+	 */
+    public void clean() {
+        this.setModel(S3TreeModel.getInstance().clean());
+    }
+
+    /**
+	 * 
+	 */
+    public void refresh() {
+        repaint();
+    }
+
+    /**
+     * 
+     * @param child
+     * @return
+     */
+    public DefaultMutableTreeNode addObject(Object child) {
+        DefaultMutableTreeNode parentNode = null;
+        TreePath parentPath = this.getSelectionPath().getParentPath();
+
+        if (parentPath == null) {
+            parentNode = (DefaultMutableTreeNode) S3TreeModel.getInstance().getRoot();
+        } else {
+            parentNode = (DefaultMutableTreeNode) (parentPath.getLastPathComponent());
+        }
+
+        return addObject(parentNode, child, true);
+    }
+
+    /**
+     * 
+     * @param parent
+     * @param child
+     * @return DefaultMutableTreeNode
+     */
+    public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent, Object child) {
+        return addObject(parent, child, false);
+    }
+
+    /**
+     * @param parentName
+     * @param child
+     * @return
+     */
+    public DefaultMutableTreeNode addObject(String parentName, Object child) {
+        if (parentName.contains("/")) {
+            parentName = parentName.substring(0, parentName.indexOf('/'));
+        }
+        DefaultMutableTreeNode root = (DefaultMutableTreeNode) S3TreeModel.getInstance().getRoot();
+        int count = root.getChildCount();
+        for (int i = 0; i < count; i++) {
+            Object name = ((DefaultMutableTreeNode) root.getChildAt(i)).getUserObject();
+            if (parentName.equals(name)) {
+                return this.addObject((DefaultMutableTreeNode) root.getChildAt(i), child, true);
+            }
+        }
+        return null;
+    }
+
+    /**
+     * 
+     * @param parent
+     * @param child
+     * @param shouldBeVisible
+     * @return DefaultMutableTreeNode
+     */
+    public DefaultMutableTreeNode addObject(DefaultMutableTreeNode parent, Object child, boolean shouldBeVisible) {
+        DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(child);
+
+        if (parent == null) {
+            parent = (DefaultMutableTreeNode) S3TreeModel.getInstance().getRoot();
+        }
+
+        S3TreeModel.getInstance().insertNodeInto(childNode, parent, parent.getChildCount());
+
+        if (shouldBeVisible) {
+            this.scrollPathToVisible(new TreePath(childNode.getPath()));
+        }
+        return childNode;
+    }
+
+    /**
+     * 
+     * @return DefaultMutableTreeNode
+     */
+    public DefaultMutableTreeNode getSelectedNode() {
+        return (DefaultMutableTreeNode) this.getLastSelectedPathComponent();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/amazon/S3TreeModel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/amazon/S3TreeModel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/amazon/S3TreeModel.java
new file mode 100644
index 0000000..f3168b9
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/amazon/S3TreeModel.java
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets.amazon;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.DefaultTreeModel;
+
+public class S3TreeModel extends DefaultTreeModel {
+
+    private static S3TreeModel instance;
+    private static DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode("S3 Contents");
+
+    private boolean connected;
+
+    /**
+     * Constructs a S3TreeModel.
+     * 
+     * @param root
+     */
+    private S3TreeModel() {
+        super(rootNode);
+    }
+
+    public static S3TreeModel getInstance() {
+        if (instance == null) {
+            instance = new S3TreeModel();
+        }
+        return instance;
+    }
+
+    public S3TreeModel clean() {
+        rootNode.removeAllChildren();
+        setRoot(rootNode);
+        connected = false;
+        return instance;
+    }
+
+    public void connect() {
+        this.connected = true;
+    }
+
+    public boolean isConnected() {
+        return this.connected;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelector.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelector.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelector.java
new file mode 100644
index 0000000..2d641bb
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelector.java
@@ -0,0 +1,530 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets.component;
+
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DragGestureEvent;
+import java.awt.dnd.DragGestureListener;
+import java.awt.dnd.DragSource;
+import java.awt.dnd.DragSourceAdapter;
+import java.awt.dnd.DragSourceListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.JMenuItem;
+import javax.swing.JPopupMenu;
+import javax.swing.JTree;
+import javax.swing.SwingUtilities;
+import javax.swing.ToolTipManager;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+import javax.swing.tree.TreeSelectionModel;
+
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentOperationReference;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistry;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.component.registry.ComponentController;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.XBayaComponent;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelectorEvent.ComponentSelectorEventType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * The ComponentTreeViewer class shows the selectedComponent tree.
+ * 
+ */
+public class ComponentSelector implements XBayaComponent {
+
+    /**
+     * The title.
+     */
+    public static final String TITLE = "Component List";
+
+    private static final Logger logger = LoggerFactory.getLogger(ComponentSelector.class);
+
+    private XBayaEngine engine;
+
+    private JTree tree;
+
+    private ComponentTreeModel treeModel;
+
+    private ComponentReference selectedComponentReference;
+
+    private Component selectedComponent;
+
+    private List<ComponentSelectorListener> listeners;
+
+    private DragSourceListener dragSourceListener;
+
+    private JPopupMenu popup;
+
+    /**
+     * @param engine
+     */
+    public ComponentSelector(XBayaEngine engine) {
+        this.engine = engine;
+        this.listeners = new LinkedList<ComponentSelectorListener>();
+        initGUI();
+    }
+
+    /**
+     * @return the Pane
+     */
+    public JTree getSwingComponent() {
+        return this.tree;
+    }
+
+    /**
+     * Adds a new selectedComponent registry to the end of the tree.
+     * 
+     * @param componentTree
+     */
+    public void addComponentTree(ComponentTreeNode componentTree) {
+        addComponentTree(-1, componentTree);
+    }
+
+    public void removeComponentTree(final ComponentTreeNode componentTree) {
+        ComponentSelector.this.treeModel.removeNodeFromParent(componentTree);
+//    	SwingUtilities.invokeLater(new Runnable() {
+//            public void run() {
+//                ComponentSelector.this.treeModel.removeNodeFromParent(componentTree);
+//            }
+//
+//        });
+    }
+
+    public synchronized void removeComponentRegistry(final String componentRegistryName) {
+        ComponentTreeNode root = ComponentSelector.this.treeModel.getRoot();
+        ComponentTreeNode[] treeNodes = root.getChildren().toArray(new ComponentTreeNode[]{});
+        for(ComponentTreeNode treeNode:treeNodes){
+            if (treeNode.getComponentRegistry().getName().equals(componentRegistryName)){
+                root.remove(treeNode);
+            }
+        }
+        treeModel.reload();
+    }
+    
+    /**
+     * Adds a new selectedComponent registry to the specified location.
+     * 
+     * @param index
+     *            The index to ineart a new selectedComponent registry
+     * @param componentTree
+     */
+    public void addComponentTree(final int index, final ComponentTreeNode componentTree) {
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                ComponentTreeNode root = ComponentSelector.this.treeModel.getRoot();
+                if (index < 0) {
+                    // Have to go through DefaultTreeModol to dynamically
+                    // add a node
+                    ComponentSelector.this.treeModel.addNodeInto(componentTree, root);
+                } else {
+                    // Have to go through DefaultTreeModol to dynamically
+                    // add a node
+                    ComponentSelector.this.treeModel.insertNodeInto(componentTree, root, index);
+                }
+                makeVisible(componentTree);
+            }
+
+        });
+    }
+
+    /**
+     * Removes a registry currently selected.
+     */
+    public void removeSelectedRegistry() {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                TreePath selectionPath = ComponentSelector.this.tree.getSelectionPath();
+                ComponentTreeNode selectedNode = (ComponentTreeNode) selectionPath.getLastPathComponent();
+                if (selectedNode.getLevel() == 1) {
+                    ComponentSelector.this.treeModel.removeNodeFromParent(selectedNode);
+                }
+            }
+        });
+    }
+
+    /**
+     * @throws ComponentRegistryException
+     */
+    public void updateSelectedRegistry() throws ComponentRegistryException {
+        final TreePath[] selectionPathHolder = new TreePath[1];
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    selectionPathHolder[0] = ComponentSelector.this.tree.getSelectionPath();
+                }
+            });
+        } catch (InterruptedException e) {
+            // Should not happen.
+            throw new WorkflowRuntimeException(e);
+        } catch (InvocationTargetException e) {
+            // Should not happen.
+            throw new WorkflowRuntimeException(e);
+        }
+
+        TreePath selectionPath = selectionPathHolder[0];
+        if (selectionPath == null) {
+            // TODO this case should be handled in the menu before comming here.
+            return;
+        }
+
+        if (selectionPath.getPathCount() >= 2) {
+            final ComponentTreeNode selectedNode = (ComponentTreeNode) selectionPath.getPath()[1];
+            reloadComponentRegistryNode(selectedNode);
+        }
+    }
+
+	private void reloadComponentRegistryNode(
+			final ComponentTreeNode selectedNode)
+			throws ComponentRegistryException {
+		ComponentRegistry registry = selectedNode.getComponentRegistry();
+		final ComponentTreeNode componentTree = ComponentController.getComponentTree(registry);
+
+		SwingUtilities.invokeLater(new Runnable() {
+		    public void run() {
+		        ComponentTreeNode root = ComponentSelector.this.treeModel.getRoot();
+		        int index = root.getIndex(selectedNode);
+		        ComponentSelector.this.treeModel.removeNodeFromParent(selectedNode);
+		        ComponentSelector.this.treeModel.insertNodeInto(componentTree, root, index);
+		    }
+		});
+	}
+
+    /**
+     * Updates all the registry entries.
+     * 
+     * @throws ComponentRegistryException
+     */
+    public void update() throws ComponentRegistryException {
+        final List<ComponentRegistry> registries = new ArrayList<ComponentRegistry>();
+        if (SwingUtilities.isEventDispatchThread()) {
+            getRegistries(registries);
+        } else {
+            try {
+                SwingUtilities.invokeAndWait(new Runnable() {
+                    public void run() {
+                        getRegistries(registries);
+                    }
+                });
+            } catch (InterruptedException e) {
+                // Should not happen.
+                throw new WorkflowRuntimeException(e);
+            } catch (InvocationTargetException e) {
+                // Should not happen.
+                throw new WorkflowRuntimeException(e);
+            }
+        }
+
+        final List<ComponentTreeNode> newSubTrees = new ArrayList<ComponentTreeNode>();
+        for (ComponentRegistry registry : registries) {
+            ComponentTreeNode componentTree = ComponentController.getComponentTree(registry);
+            newSubTrees.add(componentTree);
+        }
+
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                ComponentTreeNode root = ComponentSelector.this.treeModel.getRoot();
+                ComponentSelector.this.treeModel.removeChildren(root);
+                logger.debug("Removed all");
+                for (ComponentTreeNode subTree : newSubTrees) {
+                    ComponentSelector.this.treeModel.addNodeInto(subTree, root);
+                }
+                makeVisible((ComponentTreeNode) root.getFirstChild());
+            }
+        });
+
+    }
+
+    /**
+     * Returns the selectedComponent.
+     * 
+     * @return The selectedComponent
+     */
+    public Component getSelectedComponent() {
+        return this.selectedComponent;
+    }
+
+    /**
+     * @param listener
+     */
+    public synchronized void addComponentSelectorListener(ComponentSelectorListener listener) {
+        this.listeners.add(listener);
+    }
+
+    /**
+     * @param listener
+     */
+    public synchronized void removeComponentSelectorListener(ComponentSelectorListener listener) {
+        this.listeners.remove(listener);
+    }
+
+    private void dragGestureRecognized(DragGestureEvent event) {
+        if (this.selectedComponentReference != null) {
+            event.startDrag(DragSource.DefaultCopyDrop,
+                    new ComponentSourceTransferable(this.selectedComponentReference), this.dragSourceListener);
+        }
+    }
+
+    private List<ComponentRegistry> getRegistries(List<ComponentRegistry> registries) {
+        ComponentTreeNode root = this.treeModel.getRoot();
+        for (ComponentTreeNode componentTree : root.getChildren()) {
+            registries.add(componentTree.getComponentRegistry());
+        }
+        return registries;
+    }
+
+    private void makeVisible(ComponentTreeNode node) {
+        // Make sure the user can see the new node, but don't scroll to
+        // right.
+        TreePath treePath = new TreePath(node.getPath());
+        Rectangle bounds = ComponentSelector.this.tree.getPathBounds(treePath);
+        if (bounds != null) {
+            // Prevent right scroll.
+            bounds.x = 0;
+            bounds.width = 0;
+            this.tree.scrollRectToVisible(bounds);
+        } else {
+            // null during the initialization.
+            this.tree.scrollPathToVisible(treePath);
+        }
+    }
+
+    /**
+     * This method is called when a component is selected. It reads the component information from the server and set
+     * the selectedComponent.
+     * 
+     * @param treePath
+     *            The path of the selected selectedComponent.
+     */
+    private void select(TreePath treePath) {
+        final ComponentTreeNode selectedNode = (ComponentTreeNode) treePath.getLastPathComponent();
+        final ComponentReference componentReference = selectedNode.getComponentReference();
+        selectComponent(null);
+        this.selectedComponentReference = null;
+        if (componentReference != null) {
+            this.selectedComponentReference = componentReference;
+            new Thread() {
+                @Override
+                public void run() {
+                    try {
+                        // get all components and check the number of
+                        // components. If there are multiple, expand the tree.
+                        final List<? extends Component> components = componentReference.getComponents();
+                        if (components.size() == 1) {
+                            selectComponent(components.get(0));
+                        } else {
+                            SwingUtilities.invokeLater(new Runnable() {
+                                public void run() {
+                                    expandTreeLeaf(selectedNode, components);
+                                }
+                            });
+                        }
+
+                    } catch (ComponentException e) {
+                        selectComponent(null);
+                        ComponentSelector.this.engine.getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
+                    } catch (ComponentRegistryException e) {
+                        selectComponent(null);
+                        ComponentSelector.this.engine.getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LOAD_ERROR, e);
+                    } catch (RuntimeException e) {
+                        selectComponent(null);
+                        ComponentSelector.this.engine.getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LOAD_ERROR, e);
+                    } catch (Exception e) {
+                        selectComponent(null);
+                        ComponentSelector.this.engine.getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LOAD_ERROR, e);
+                    }
+                }
+            }.start();
+
+        }
+    }
+
+    private void expandTreeLeaf(ComponentTreeNode selectedNode, List<? extends Component> components) {
+        ComponentReference componentReference = selectedNode.getComponentReference();
+        ComponentTreeNode newNode = new ComponentTreeNode(componentReference.getName());
+
+        ComponentTreeNode parent = (ComponentTreeNode) selectedNode.getParent();
+        int index = this.treeModel.getIndexOfChild(parent, selectedNode);
+        this.treeModel.removeNodeFromParent(selectedNode);
+        this.treeModel.insertNodeInto(newNode, parent, index);
+
+        for (Component component : components) {
+            WSComponent wsComponent = (WSComponent) component;
+            String operationName = wsComponent.getOperationName();
+            ComponentOperationReference reference = new ComponentOperationReference(operationName, wsComponent);
+            ComponentTreeNode child = new ComponentTreeNode(reference);
+            this.treeModel.addNodeInto(child, newNode);
+        }
+        // expand
+        TreeNode[] path = newNode.getPath();
+        this.tree.expandPath(new TreePath(path));
+    }
+
+    private void selectComponent(Component component) {
+        this.selectedComponent = component;
+        notifyListeners(new ComponentSelectorEvent(ComponentSelectorEventType.COMPONENT_SELECTED, this, component));
+    }
+
+    private void showPopupIfNecessary(MouseEvent event) {
+        Point point = event.getPoint();
+        TreePath path = this.tree.getClosestPathForLocation(point.x, point.y);
+        this.tree.setSelectionPath(path);
+
+        if (path.getPathCount() >= 2) {
+            this.popup.show(event.getComponent(), point.x, point.y);
+        }
+    }
+
+    private void notifyListeners(ComponentSelectorEvent event) {
+        for (ComponentSelectorListener listener : this.listeners) {
+            listener.componentSelectorChanged(event);
+        }
+    }
+
+    private void initGUI() {
+        this.treeModel = new ComponentTreeModel(new ComponentTreeNode("Components"));
+        this.tree = new JTree(this.treeModel);
+
+        // Add a tool tip.
+        ToolTipManager.sharedInstance().registerComponent(this.tree);
+        DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer() {
+            @Override
+            public java.awt.Component getTreeCellRendererComponent(JTree t, Object value, boolean sel,
+                    boolean expanded, boolean leaf, int row, boolean focus) {
+                super.getTreeCellRendererComponent(t, value, sel, expanded, leaf, row, focus);
+
+                ComponentTreeNode node = (ComponentTreeNode) value;
+                if (node.getComponentReference() == null) {
+                    setToolTipText(null);
+                } else {
+                    setToolTipText("Drag a component to the composer to add");
+                }
+                return this;
+            }
+        };
+
+        // Change icons
+        try {
+            renderer.setOpenIcon(SwingUtil.createImageIcon("opened.gif"));
+            renderer.setClosedIcon(SwingUtil.createImageIcon("closed.gif"));
+            renderer.setLeafIcon(SwingUtil.createImageIcon("leaf.gif"));
+        } catch (RuntimeException e) {
+            logger.warn("Failed to load image icons.  " + "It will use the default icons instead.", e);
+        }
+
+        this.tree.setCellRenderer(renderer);
+        this.tree.setShowsRootHandles(true);
+        this.tree.setEditable(false);
+        this.tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
+
+        this.tree.addTreeSelectionListener(new TreeSelectionListener() {
+            public void valueChanged(TreeSelectionEvent event) {
+                // Doesn't do anything if deselected, which happens during the
+                // update.
+                if (event.isAddedPath()) {
+                    TreePath path = event.getPath();
+                    select(path);
+                }
+            }
+        });
+
+        // Drag and dtop
+        DragGestureListener dragGestureListener = new DragGestureListener() {
+            public void dragGestureRecognized(DragGestureEvent event) {
+                ComponentSelector.this.dragGestureRecognized(event);
+            }
+        };
+        DragSource dragSource = DragSource.getDefaultDragSource();
+        dragSource.createDefaultDragGestureRecognizer(this.tree, DnDConstants.ACTION_COPY_OR_MOVE, dragGestureListener);
+
+        this.dragSourceListener = new DragSourceAdapter() {
+            // Overwrite some methods when needed.
+        };
+
+        // Popup
+        this.tree.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mousePressed(MouseEvent event) {
+                if (event.isPopupTrigger()) {
+                    showPopupIfNecessary(event);
+                }
+            }
+        });
+        createNodePopupMenu();
+    }
+
+    private void createNodePopupMenu() {
+        this.popup = new JPopupMenu();
+        JMenuItem refreshItem = new JMenuItem("Refresh Registry");
+        refreshItem.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent event) {
+                new Thread() {
+                    @Override
+                    public void run() {
+                        try {
+                            updateSelectedRegistry();
+                        } catch (ComponentRegistryException e) {
+                            ComponentSelector.this.engine.getGUI().getErrorWindow().error(
+                                    ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
+                        } catch (RuntimeException e) {
+                            ComponentSelector.this.engine.getGUI().getErrorWindow().error(
+                                    ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
+                        } catch (Error e) {
+                            ComponentSelector.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                        }
+                    }
+                }.start();
+            }
+        });
+        this.popup.add(refreshItem);
+    }
+
+    public void refresh() {
+        this.getSwingComponent().repaint();
+
+        this.tree.repaint();
+        this.treeModel.reload();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelectorEvent.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelectorEvent.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelectorEvent.java
new file mode 100644
index 0000000..7288950
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelectorEvent.java
@@ -0,0 +1,85 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets.component;
+
+import org.apache.airavata.workflow.model.component.Component;
+
+public class ComponentSelectorEvent {
+
+    /**
+     * The type of an event.
+     */
+    public enum ComponentSelectorEventType {
+        /**
+         * A component was selected.
+         */
+        COMPONENT_SELECTED,
+    }
+
+    private ComponentSelectorEventType type;
+
+    private ComponentSelector componentSelector;
+
+    private Component component;
+
+    /**
+     * Constructs a ComponentSelectorEvent.
+     * 
+     * @param type
+     * @param componentSelector
+     * @param component
+     */
+    public ComponentSelectorEvent(ComponentSelectorEventType type, ComponentSelector componentSelector,
+            Component component) {
+        this.type = type;
+        this.componentSelector = componentSelector;
+        this.component = component;
+    }
+
+    /**
+     * Returns the type.
+     * 
+     * @return The type
+     */
+    public ComponentSelectorEventType getType() {
+        return this.type;
+    }
+
+    /**
+     * Returns the componentSelector.
+     * 
+     * @return The componentSelector
+     */
+    public ComponentSelector getComponentSelector() {
+        return this.componentSelector;
+    }
+
+    /**
+     * Returns the component.
+     * 
+     * @return The component
+     */
+    public Component getComponent() {
+        return this.component;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelectorListener.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelectorListener.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelectorListener.java
new file mode 100644
index 0000000..b5eab7c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSelectorListener.java
@@ -0,0 +1,32 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets.component;
+
+public interface ComponentSelectorListener {
+
+    /**
+     * Called when a component selector changes
+     * 
+     * @param event
+     */
+    public void componentSelectorChanged(ComponentSelectorEvent event);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSourceTransferable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSourceTransferable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSourceTransferable.java
new file mode 100644
index 0000000..62b706c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentSourceTransferable.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets.component;
+
+import java.awt.datatransfer.DataFlavor;
+import java.awt.datatransfer.Transferable;
+
+import org.apache.airavata.workflow.model.component.ComponentReference;
+
+/**
+ * To transfer ComponentSource by drag-and-drop. This is really over-spec, but this is the only way.
+ * 
+ */
+public class ComponentSourceTransferable implements Transferable {
+
+    /**
+     * FLAVOR
+     */
+    public static final DataFlavor FLAVOR = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType,
+            ComponentReference.class.toString());
+
+    private ComponentReference componentReference;
+
+    /**
+     * Constructs a ComponentSourceTransferable.
+     * 
+     * @param componentReference
+     */
+    public ComponentSourceTransferable(ComponentReference componentReference) {
+        this.componentReference = componentReference;
+    }
+
+    /**
+     * @see java.awt.datatransfer.Transferable#getTransferDataFlavors()
+     */
+    public DataFlavor[] getTransferDataFlavors() {
+        return new DataFlavor[] { FLAVOR };
+    }
+
+    /**
+     * @see java.awt.datatransfer.Transferable#isDataFlavorSupported(java.awt.datatransfer.DataFlavor)
+     */
+    public boolean isDataFlavorSupported(DataFlavor flavor) {
+        return flavor.equals(FLAVOR);
+    }
+
+    /**
+     * @see java.awt.datatransfer.Transferable#getTransferData(java.awt.datatransfer.DataFlavor)
+     */
+    public ComponentReference getTransferData(DataFlavor flavor) {
+        return this.componentReference;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentTreeModel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentTreeModel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentTreeModel.java
new file mode 100644
index 0000000..52e9f51
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/component/ComponentTreeModel.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets.component;
+
+import javax.swing.tree.DefaultTreeModel;
+
+public class ComponentTreeModel extends DefaultTreeModel {
+
+    private ComponentTreeNode root;
+
+    /**
+     * Constructs a ComponentTreeModel.
+     * 
+     * @param root
+     */
+    public ComponentTreeModel(ComponentTreeNode root) {
+        super(root);
+        this.root = root;
+    }
+
+    /**
+     * @see javax.swing.tree.DefaultTreeModel#getRoot()
+     */
+    @Override
+    public ComponentTreeNode getRoot() {
+        return this.root;
+    }
+
+    /**
+     * @param newChild
+     * @param parent
+     */
+    public void addNodeInto(ComponentTreeNode newChild, ComponentTreeNode parent) {
+        insertNodeInto(newChild, parent, parent.getChildCount());
+    }
+
+    /**
+     * @param parent
+     */
+    public void removeChildren(ComponentTreeNode parent) {
+        int numChild = parent.getChildCount();
+        int[] childIndices = new int[numChild];
+        Object[] removedChildren = new Object[numChild];
+        for (int i = numChild - 1; i >= 0; i--) {
+            childIndices[i] = i;
+            removedChildren[i] = parent.getChildAt(i);
+            parent.remove(i);
+        }
+        nodesWereRemoved(parent, childIndices, removedChildren);
+    }
+
+}
\ No newline at end of file


[34/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
deleted file mode 100644
index f111cbe..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/DescriptorRegistryResource.java
+++ /dev/null
@@ -1,889 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException;
-import org.apache.airavata.registry.api.exception.gateway.DescriptorDoesNotExistsException;
-import org.apache.airavata.registry.api.exception.gateway.MalformedDescriptorException;
-import org.apache.airavata.rest.mappings.resourcemappings.*;
-import org.apache.airavata.rest.mappings.utils.DescriptorUtil;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This class is the REST interface for all the operation regarding descriptors that are
- * exposed from Airavatas Registry API
- */
-@Path(ResourcePathConstants.DecResourcePathConstants.DESC_RESOURCE_PATH)
-public class DescriptorRegistryResource {
-
-    @Context
-    ServletContext context;
-
-    /**
-     * ---------------------------------Descriptor Registry----------------------------------*
-     */
-
-
-    /**
-     * This method will check whether the host descriptor exists
-     *
-     * @param hostDescriptorName host descriptor name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_EXISTS)
-    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
-    public Response isHostDescriptorExists(@QueryParam("hostDescriptorName") String hostDescriptorName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        boolean state;
-        try {
-            state = airavataRegistry.isHostDescriptorExists(hostDescriptorName);
-            if (state) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_EXISTS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will save the host descriptor
-     *
-     * @param host JSON message send according to HostDescriptor class
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_SAVE)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response addHostDescriptor(HostDescriptor host) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            HostDescription hostDescription = DescriptorUtil.createHostDescription(host);
-            airavataRegistry.addHostDescriptor(hostDescription);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Host descriptor saved successfully...");
-            return builder.build();
-        } catch (DescriptorAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_SAVE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the host descriptor
-     *
-     * @param host JSON message send according to HostDescriptor class
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_UPDATE)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response updateHostDescriptor(HostDescriptor host) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            HostDescription hostDescription = DescriptorUtil.createHostDescription(host);
-            airavataRegistry.updateHostDescriptor(hostDescription);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Host descriptor updated successfully...");
-            return builder.build();
-        } catch (DescriptorDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_UPDATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve host descriptor. Clients will get a JSON message that is generated
-     * according to HostDescriptor class
-     *
-     * @param hostName host name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getHostDescriptor(@QueryParam("hostName") String hostName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            HostDescription hostDescription = airavataRegistry.getHostDescriptor(hostName);
-            if (hostDescription != null) {
-                HostDescriptor hostDescriptor = DescriptorUtil.createHostDescriptor(hostDescription);
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(hostDescriptor);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-                builder.entity("Host Descriptor does not exist...");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     * This method will delete the given host descriptor
-     *
-     * @param hostName host descriptor name
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_DELETE)
-    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
-    public Response removeHostDescriptor(@QueryParam("hostName") String hostName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removeHostDescriptor(hostName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Host descriptor deleted successfully...");
-            return builder.build();
-        } catch (DescriptorDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.HOST_DESC_DELETE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve all the host descriptors available.
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getHostDescriptors() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<HostDescription> hostDescriptionList = airavataRegistry.getHostDescriptors();
-            HostDescriptionList list = new HostDescriptionList();
-            HostDescriptor[] hostDescriptions = new HostDescriptor[hostDescriptionList.size()];
-            for (int i = 0; i < hostDescriptionList.size(); i++) {
-                HostDescriptor hostDescriptor = DescriptorUtil.createHostDescriptor(hostDescriptionList.get(i));
-                hostDescriptions[i] = hostDescriptor;
-            }
-            list.setHostDescriptions(hostDescriptions);
-            if (hostDescriptionList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(list);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the host descriptor names available
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS_NAMES)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getHostDescriptorNames() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<HostDescription> hostDescriptionList = airavataRegistry.getHostDescriptors();
-            List<String> hostDescriptorNames = new ArrayList<String>();
-            DescriptorNameList descriptorNameList = new DescriptorNameList();
-            for (HostDescription aHostDescriptionList : hostDescriptionList) {
-                hostDescriptorNames.add(aHostDescriptionList.getType().getHostName());
-            }
-            descriptorNameList.setDescriptorNames(hostDescriptorNames);
-            if (hostDescriptionList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(descriptorNameList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS_NAMES, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will check whether the service descriptor available
-     *
-     * @param serviceDescriptorName service descriptor name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_EXISTS)
-    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
-    public Response isServiceDescriptorExists(@QueryParam("serviceDescriptorName") String serviceDescriptorName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        boolean state;
-        try {
-            state = airavataRegistry.isServiceDescriptorExists(serviceDescriptorName);
-            if (state) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_EXISTS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will save the service descriptor
-     *
-     * @param service this is a JSON message created according to ServiceDescriptor class
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_SAVE)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response addServiceDescriptor(ServiceDescriptor service) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(service);
-            airavataRegistry.addServiceDescriptor(serviceDescription);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Service descriptor saved successfully...");
-            return builder.build();
-        } catch (DescriptorAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_SAVE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the service descriptor
-     *
-     * @param service this is a JSON message generated according to Service Descriptor class
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_UPDATE)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response updateServiceDescriptor(ServiceDescriptor service) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(service);
-            airavataRegistry.updateServiceDescriptor(serviceDescription);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Service descriptor updated successfully...");
-            return builder.build();
-        } catch (DescriptorAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_UPDATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve service descriptor for a given service descriptor name. Clients
-     * will get a JSON message that is generated according to Service Descriptor class
-     *
-     * @param serviceName service name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getServiceDescriptor(@QueryParam("serviceName") String serviceName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ServiceDescription serviceDescription = airavataRegistry.getServiceDescriptor(serviceName);
-            if (serviceDescription != null) {
-                ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(serviceDescriptor);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-                builder.entity("No service descriptor available with given service name...");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will delete a given service descriptor
-     *
-     * @param serviceName service descriptor name
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_DELETE)
-    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
-    public Response removeServiceDescriptor(@QueryParam("serviceName") String serviceName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removeServiceDescriptor(serviceName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Service descriptor deleted successfully...");
-            return builder.build();
-        } catch (DescriptorDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_DELETE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve all the service descriptors
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.GET_SERVICE_DESCS)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getServiceDescriptors() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<ServiceDescription> serviceDescriptors = airavataRegistry.getServiceDescriptors();
-            ServiceDescriptionList list = new ServiceDescriptionList();
-            ServiceDescriptor[] serviceDescriptions = new ServiceDescriptor[serviceDescriptors.size()];
-            for (int i = 0; i < serviceDescriptors.size(); i++) {
-                ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescriptors.get(i));
-                serviceDescriptions[i] = serviceDescriptor;
-            }
-            list.setServiceDescriptions(serviceDescriptions);
-            if (serviceDescriptors.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(list);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.GET_SERVICE_DESCS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-
-    /**
-     * This method will check whether the given application descriptor exists
-     *
-     * @param serviceName       service descriptor name
-     * @param hostName          host descriptor name
-     * @param appDescriptorName application descriptor name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.APPL_DESC_EXIST)
-    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
-    public Response isApplicationDescriptorExists(@QueryParam("serviceName") String serviceName,
-                                                  @QueryParam("hostName") String hostName,
-                                                  @QueryParam("appDescName") String appDescriptorName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        boolean state;
-        try {
-            state = airavataRegistry.isApplicationDescriptorExists(serviceName, hostName, appDescriptorName);
-            if (state) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APPL_DESC_EXIST, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will save given application descriptor
-     *
-     * @param applicationDescriptor this is a JSON message created according to
-     *                              ApplicationDescriptor class
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.DecResourcePathConstants.APP_DESC_BUILD_SAVE)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response addApplicationDescriptor(ApplicationDescriptor applicationDescriptor) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            String hostdescName = applicationDescriptor.getHostdescName();
-            if (!airavataRegistry.isHostDescriptorExists(hostdescName)) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-                builder.entity("Given host does not exist...");
-                return builder.build();
-            }
-            ApplicationDescription applicationDescription = DescriptorUtil.createApplicationDescription(applicationDescriptor);
-            ServiceDescriptor serviceDescriptor = applicationDescriptor.getServiceDescriptor();
-            String serviceName;
-            if (serviceDescriptor != null) {
-                if (serviceDescriptor.getServiceName() == null) {
-                    serviceName = applicationDescriptor.getName();
-                    serviceDescriptor.setServiceName(serviceName);
-                } else {
-                    serviceName = serviceDescriptor.getServiceName();
-                }
-//                ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(serviceDescriptor);
-//                if (!airavataRegistry.isServiceDescriptorExists(serviceName)) {
-//                    airavataRegistry.addServiceDescriptor(serviceDescription);
-//                }
-            } else {
-                serviceName = applicationDescriptor.getName();
-            }
-            airavataRegistry.addApplicationDescriptor(serviceName, hostdescName, applicationDescription);
-
-
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Application descriptor saved successfully...");
-            return builder.build();
-        } catch (DescriptorAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_BUILD_SAVE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the application descriptor
-     *
-     * @param applicationDescriptor JSON message of ApplicationDescriptor class
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.DecResourcePathConstants.APP_DESC_UPDATE)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response udpateApplicationDescriptor(ApplicationDescriptor applicationDescriptor) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            String hostdescName = applicationDescriptor.getHostdescName();
-            if (!airavataRegistry.isHostDescriptorExists(hostdescName)) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-                builder.entity("Host does not available...");
-                return builder.build();
-            }
-            ApplicationDescription applicationDescription = DescriptorUtil.createApplicationDescription(applicationDescriptor);
-            ServiceDescriptor serviceDescriptor = applicationDescriptor.getServiceDescriptor();
-            String serviceName;
-            if (serviceDescriptor != null) {
-                if (serviceDescriptor.getServiceName() == null) {
-                    serviceName = applicationDescriptor.getName();
-                    serviceDescriptor.setServiceName(serviceName);
-                } else {
-                    serviceName = serviceDescriptor.getServiceName();
-                }
-//                ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(serviceDescriptor);
-//                if (airavataRegistry.isServiceDescriptorExists(serviceName)) {
-//                    airavataRegistry.updateServiceDescriptor(serviceDescription);
-//                } else {
-//                    airavataRegistry.addServiceDescriptor(serviceDescription);
-//                }
-
-            } else {
-                serviceName = applicationDescriptor.getName();
-            }
-            airavataRegistry.updateApplicationDescriptor(serviceName, hostdescName, applicationDescription);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Application descriptor updated successfully...");
-            return builder.build();
-        } catch (DescriptorAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_UPDATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve an application descriptor according to given service name, host name
-     * and application name
-     *
-     * @param serviceName     service name
-     * @param hostName        host name
-     * @param applicationName application name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.APP_DESC_DESCRIPTION)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getApplicationDescriptor(@QueryParam("serviceName") String serviceName,
-                                             @QueryParam("hostName") String hostName,
-                                             @QueryParam("applicationName") String applicationName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ApplicationDescription applicationDescription = airavataRegistry.getApplicationDescriptor(serviceName, hostName, applicationName);
-            if (applicationDescription != null) {
-                ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(applicationDescription);
-                applicationDescriptor.setHostdescName(hostName);
-                ServiceDescription serviceDescription = airavataRegistry.getServiceDescriptor(serviceName);
-                ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-                applicationDescriptor.setServiceDescriptor(serviceDescriptor);
-
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(applicationDescriptor);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-                builder.entity("Application descriptor does not exist...");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_DESCRIPTION, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve application descriptors for a given service and host
-     *
-     * @param serviceName service name
-     * @param hostName    host name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.APP_DESC_PER_HOST_SERVICE)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getApplicationDescriptorPerServiceHost(@QueryParam("serviceName") String serviceName,
-                                                           @QueryParam("hostName") String hostName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ApplicationDescription applicationDescription = airavataRegistry.getApplicationDescriptors(serviceName, hostName);
-            ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(applicationDescription);
-            applicationDescriptor.setHostdescName(hostName);
-            ServiceDescription serviceDescription = airavataRegistry.getServiceDescriptor(serviceName);
-            ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-            applicationDescriptor.setServiceDescriptor(serviceDescriptor);
-
-            if (applicationDescription != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(applicationDescriptor);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-                builder.entity("Application descriptor does not exist...");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_PER_HOST_SERVICE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will get all the application descriptors for a given service
-     *
-     * @param serviceName service name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.APP_DESC_ALL_DESCS_SERVICE)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getApplicationDescriptors(@QueryParam("serviceName") String serviceName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Map<String, ApplicationDescription> applicationDeploymentDescriptionMap = airavataRegistry.getApplicationDescriptors(serviceName);
-            ApplicationDescriptorList applicationDescriptorList = new ApplicationDescriptorList();
-            ApplicationDescriptor[] applicationDescriptors = new ApplicationDescriptor[applicationDeploymentDescriptionMap.size()];
-            int i = 0;
-            for (String hostName : applicationDeploymentDescriptionMap.keySet()) {
-                ApplicationDescription applicationDescription = applicationDeploymentDescriptionMap.get(hostName);
-                ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(applicationDescription);
-                applicationDescriptor.setHostdescName(hostName);
-
-                ServiceDescription serviceDescription = airavataRegistry.getServiceDescriptor(serviceName);
-                ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-                applicationDescriptor.setServiceDescriptor(serviceDescriptor);
-
-                applicationDescriptors[i] = applicationDescriptor;
-                i++;
-            }
-            applicationDescriptorList.setApplicationDescriptors(applicationDescriptors);
-            if (applicationDeploymentDescriptionMap.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(applicationDescriptorList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (MalformedDescriptorException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_ALL_DESCS_SERVICE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve all the application descriptors available
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.APP_DESC_ALL_DESCRIPTORS)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getApplicationDescriptors() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Map<String[], ApplicationDescription> applicationDeploymentDescriptionMap = airavataRegistry.getApplicationDescriptors();
-            ApplicationDescriptorList applicationDescriptorList = new ApplicationDescriptorList();
-            ApplicationDescriptor[] applicationDescriptors = new ApplicationDescriptor[applicationDeploymentDescriptionMap.size()];
-            int i = 0;
-            for (String[] descriptors : applicationDeploymentDescriptionMap.keySet()) {
-                ApplicationDescription applicationDescription = applicationDeploymentDescriptionMap.get(descriptors);
-                ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(applicationDescription);
-                applicationDescriptor.setHostdescName(descriptors[1]);
-                ServiceDescription serviceDescription = airavataRegistry.getServiceDescriptor(descriptors[0]);
-                if (serviceDescription == null) {
-                    Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                    return builder.build();
-                }
-                ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-                applicationDescriptor.setServiceDescriptor(serviceDescriptor);
-                applicationDescriptors[i] = applicationDescriptor;
-                i++;
-            }
-            applicationDescriptorList.setApplicationDescriptors(applicationDescriptors);
-            if (applicationDeploymentDescriptionMap.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(applicationDescriptorList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (MalformedDescriptorException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_ALL_DESCRIPTORS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the application names available
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.DecResourcePathConstants.APP_DESC_NAMES)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getApplicationDescriptorNames() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Map<String[], ApplicationDescription> applicationDeploymentDescriptionMap = airavataRegistry.getApplicationDescriptors();
-            DescriptorNameList descriptorNameList = new DescriptorNameList();
-            List<String> appDesNames = new ArrayList<String>();
-            for (String[] descriptors : applicationDeploymentDescriptionMap.keySet()) {
-                ApplicationDescription applicationDescription = applicationDeploymentDescriptionMap.get(descriptors);
-                appDesNames.add(applicationDescription.getType().getApplicationName().getStringValue());
-            }
-            descriptorNameList.setDescriptorNames(appDesNames);
-            if (applicationDeploymentDescriptionMap.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(descriptorNameList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (MalformedDescriptorException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_NAMES, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method wil remove an application descriptor according to given service name, host name
-     * and application name
-     *
-     * @param serviceName service name
-     * @param hostName    host name
-     * @param appName     application name
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.DecResourcePathConstants.APP_DESC_DELETE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removeApplicationDescriptor(@QueryParam("serviceName") String serviceName,
-                                                @QueryParam("hostName") String hostName,
-                                                @QueryParam("appName") String appName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removeApplicationDescriptor(serviceName, hostName, appName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Application descriptor deleted successfully...");
-            return builder.build();
-        } catch (DescriptorDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.DecResourcePathConstants.APP_DESC_DELETE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
deleted file mode 100644
index 1b667f1..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ExperimentRegistryResource.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-import org.apache.airavata.registry.api.AiravataExperiment;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.registry.api.Gateway;
-import org.apache.airavata.registry.api.exception.worker.ExperimentDoesNotExistsException;
-import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectDoesNotExistsException;
-import org.apache.airavata.rest.mappings.resourcemappings.ExperimentList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-/**
- * This class is a REST interface all the methods related to experiments that are exposed by
- * Airavata Registry API
- */
-@Path(ResourcePathConstants.ExperimentResourcePathConstants.EXP_RESOURCE_PATH)
-public class ExperimentRegistryResource {
-
-    @Context
-    ServletContext context;
-
-    /**
-     * ---------------------------------Experiments----------------------------------*
-     */
-
-    /**
-     * This method will delete an experiment with given experiment ID
-     *
-     * @param experimentId experiment ID
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ExperimentResourcePathConstants.DELETE_EXP)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removeExperiment(@QueryParam("experimentId") String experimentId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removeExperiment(experimentId);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Experiment removed successfully...");
-            return builder.build();
-        } catch (ExperimentDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.DELETE_EXP, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the experiments available
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ExperimentResourcePathConstants.GET_ALL_EXPS)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getExperiments() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<AiravataExperiment> airavataExperimentList = airavataRegistry.getExperiments();
-            ExperimentList experimentList = new ExperimentList();
-            AiravataExperiment[] experiments = new AiravataExperiment[airavataExperimentList.size()];
-            for (int i = 0; i < airavataExperimentList.size(); i++) {
-                experiments[i] = airavataExperimentList.get(i);
-            }
-            experimentList.setExperiments(experiments);
-            if (airavataExperimentList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.GET_ALL_EXPS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the experiments for a given project
-     *
-     * @param projectName project name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_PROJECT)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getExperimentsByProject(@QueryParam("projectName") String projectName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<AiravataExperiment> airavataExperimentList = airavataRegistry.getExperiments(projectName);
-            ExperimentList experimentList = new ExperimentList();
-            AiravataExperiment[] experiments = new AiravataExperiment[airavataExperimentList.size()];
-            for (int i = 0; i < airavataExperimentList.size(); i++) {
-                experiments[i] = airavataExperimentList.get(i);
-            }
-            experimentList.setExperiments(experiments);
-            if (airavataExperimentList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_PROJECT, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the experiments in a given period of time
-     *
-     * @param fromDate starting date
-     * @param toDate   end date
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_DATE)
-    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getExperimentsByDate(@QueryParam("fromDate") String fromDate,
-                                         @QueryParam("toDate") String toDate) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedFromDate = dateFormat.parse(fromDate);
-            Date formattedToDate = dateFormat.parse(toDate);
-            List<AiravataExperiment> airavataExperimentList = airavataRegistry.getExperiments(formattedFromDate, formattedToDate);
-            ExperimentList experimentList = new ExperimentList();
-            AiravataExperiment[] experiments = new AiravataExperiment[airavataExperimentList.size()];
-            for (int i = 0; i < airavataExperimentList.size(); i++) {
-                experiments[i] = airavataExperimentList.get(i);
-            }
-            experimentList.setExperiments(experiments);
-            if (airavataExperimentList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (ParseException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_DATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the experiments for a given project in a given period of time
-     *
-     * @param projectName project name
-     * @param fromDate    starting date
-     * @param toDate      end date
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_PER_PROJECT_BY_DATE)
-    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON})
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getExperimentsByProjectDate(@QueryParam("projectName") String projectName,
-                                                @QueryParam("fromDate") String fromDate,
-                                                @QueryParam("toDate") String toDate) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedFromDate = dateFormat.parse(fromDate);
-            Date formattedToDate = dateFormat.parse(toDate);
-            List<AiravataExperiment> airavataExperimentList = airavataRegistry.getExperiments(projectName, formattedFromDate, formattedToDate);
-            ExperimentList experimentList = new ExperimentList();
-            AiravataExperiment[] experiments = new AiravataExperiment[airavataExperimentList.size()];
-            for (int i = 0; i < airavataExperimentList.size(); i++) {
-                experiments[i] = airavataExperimentList.get(i);
-            }
-            experimentList.setExperiments(experiments);
-            if (airavataExperimentList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (ParseException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_PER_PROJECT_BY_DATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will add a new experiment
-     *
-     * @param projectName   project name
-     * @param experimentID  experiment ID
-     * @param submittedDate submitted date
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ExperimentResourcePathConstants.ADD_EXP)
-    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addExperiment(@FormParam("projectName") String projectName,
-                                  @FormParam("experimentID") String experimentID,
-                                  @FormParam("submittedDate") String submittedDate) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            AiravataExperiment experiment = new AiravataExperiment();
-            experiment.setExperimentId(experimentID);
-            Gateway gateway = airavataRegistry.getGateway();
-            AiravataUser airavataUser = airavataRegistry.getAiravataUser();
-            experiment.setGateway(gateway);
-            experiment.setUser(airavataUser);
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(submittedDate);
-            experiment.setSubmittedDate(formattedDate);
-            airavataRegistry.addExperiment(projectName, experiment);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Experiment added successfully...");
-            return builder.build();
-        } catch (ExperimentDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (WorkspaceProjectDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (ParseException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.ADD_EXP, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     * This method will check whether the given experiment ID exists
-     *
-     * @param experimentId experiment ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ExperimentResourcePathConstants.EXP_EXISTS)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isExperimentExists(@QueryParam("experimentId") String experimentId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.isExperimentExists(experimentId);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("True");
-            return builder.build();
-        } catch (ExperimentDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-            builder.entity("False");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.EXP_EXISTS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will check whether an experiment exist and create if not exists according to the
-     * createIfNotPresent flag
-     *
-     * @param experimentId       experiment ID
-     * @param createIfNotPresent flag to check whether to create a new experiment or not
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ExperimentResourcePathConstants.EXP_EXISTS_CREATE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isExperimentExistsThenCreate(@FormParam("experimentId") String experimentId,
-                                                 @FormParam("createIfNotPresent") String createIfNotPresent) {
-        boolean createIfNotPresentStatus = Boolean.valueOf(createIfNotPresent);
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.isExperimentExists(experimentId, createIfNotPresentStatus);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("New experiment created...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentResourcePathConstants.EXP_EXISTS_CREATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java
deleted file mode 100644
index 3a64fe2..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProjectRegistryResource.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.WorkspaceProject;
-import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectAlreadyExistsException;
-import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectDoesNotExistsException;
-import org.apache.airavata.rest.mappings.resourcemappings.WorkspaceProjectList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.List;
-
-/**
- * This class is a REST interface for all the operations related to Project that are exposed in
- * Airavata Registry API
- */
-@Path(ResourcePathConstants.ProjectResourcePathConstants.REGISTRY_API_PROJECTREGISTRY)
-public class ProjectRegistryResource {
-
-    @Context
-    ServletContext context;
-
-    /**
-     * ---------------------------------Project Registry----------------------------------*
-     */
-
-    /**
-     * This method will check whether a given project name exists
-     * @param projectName project name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProjectResourcePathConstants.PROJECT_EXIST)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isWorkspaceProjectExists(@QueryParam("projectName") String projectName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            boolean result = airavataRegistry.isWorkspaceProjectExists(projectName);
-            if (result) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.PROJECT_EXIST, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will check whether a project exists and create according to the createIfNotExists
-     * flag
-     * @param projectName project name
-     * @param createIfNotExists  flag to check whether a new project should be created or not
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProjectResourcePathConstants.PROJECT_EXIST_CREATE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isWorkspaceProjectExistsCreate(@FormParam("projectName") String projectName,
-                                             @FormParam("createIfNotExists") String createIfNotExists) {
-        boolean createIfNotExistStatus = Boolean.valueOf(createIfNotExists);
-
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            boolean result = airavataRegistry.isWorkspaceProjectExists(projectName, createIfNotExistStatus);
-            if (result) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.PROJECT_EXIST_CREATE, e);
-        }finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will add new workspace project
-     * @param projectName project name
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProjectResourcePathConstants.ADD_PROJECT)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addWorkspaceProject(@FormParam("projectName") String projectName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkspaceProject workspaceProject = new WorkspaceProject(projectName, airavataRegistry);
-            airavataRegistry.addWorkspaceProject(workspaceProject);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workspace project added successfully...");
-            return builder.build();
-        } catch (WorkspaceProjectAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.ADD_PROJECT, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the workspace project
-     * @param projectName project name
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProjectResourcePathConstants.UPDATE_PROJECT)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateWorkspaceProject(@FormParam("projectName") String projectName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkspaceProject workspaceProject = new WorkspaceProject(projectName, airavataRegistry);
-            airavataRegistry.updateWorkspaceProject(workspaceProject);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workspace project updated successfully...");
-            return builder.build();
-        } catch (WorkspaceProjectDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.UPDATE_PROJECT, e);
-        }  finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will delete workspace project
-     * @param projectName project name
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ProjectResourcePathConstants.DELETE_PROJECT)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response deleteWorkspaceProject(@QueryParam("projectName") String projectName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.deleteWorkspaceProject(projectName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workspace project deleted successfully...");
-            return builder.build();
-        } catch (WorkspaceProjectDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.DELETE_PROJECT, e);
-        }  finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve the workspace project
-     * @param projectName project name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProjectResourcePathConstants.GET_PROJECT)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getWorkspaceProject(@QueryParam("projectName") String projectName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkspaceProject workspaceProject = airavataRegistry.getWorkspaceProject(projectName);
-            if (workspaceProject != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workspaceProject);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-                return builder.build();
-            }
-        } catch (WorkspaceProjectDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.GET_PROJECT, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve all the workspace projects
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProjectResourcePathConstants.GET_PROJECTS)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getWorkspaceProjects() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<WorkspaceProject> workspaceProjects = airavataRegistry.getWorkspaceProjects();
-            WorkspaceProjectList workspaceProjectList = new WorkspaceProjectList();
-            WorkspaceProject[] workspaceProjectSet = new WorkspaceProject[workspaceProjects.size()];
-            for (int i = 0; i < workspaceProjects.size(); i++) {
-                workspaceProjectSet[i] = workspaceProjects.get(i);
-            }
-            workspaceProjectList.setWorkspaceProjects(workspaceProjectSet);
-            if (workspaceProjects.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workspaceProjectList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProjectResourcePathConstants.GET_PROJECTS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-}


[05/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/AddAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/AddAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/AddAction.java
deleted file mode 100644
index 625aaf8..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/AddAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.actions.registry.browser;
-
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class AddAction extends AbstractBrowserActionItem {
-    public static final String ID = "action.add";
-
-    public AddAction() {
-        setCaption(getDefaultCaption());
-    }
-
-    @Override
-    public String getID() {
-        return ID;
-    }
-
-    @Override
-    public String getDefaultCaption() {
-        return "Add";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/BrowserAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/BrowserAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/BrowserAction.java
deleted file mode 100644
index cf85809..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/BrowserAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.actions.registry.browser;
-
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class BrowserAction extends AbstractBrowserActionItem {
-    public static final String ID = "action.browser";
-
-    @Override
-    public String getID() {
-        return ID;
-    }
-
-    @Override
-    public String getDefaultCaption() {
-        return "Open in web browser...";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/CopyAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/CopyAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/CopyAction.java
deleted file mode 100644
index 8f8e024..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/CopyAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.actions.registry.browser;
-
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class CopyAction extends AbstractBrowserActionItem {
-    public static final String ID = "action.copy";
-
-    @Override
-    public String getID() {
-        return ID;
-    }
-
-    @Override
-    public String getDefaultCaption() {
-        return "Copy";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/DeleteAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/DeleteAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/DeleteAction.java
deleted file mode 100644
index 30b531a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/DeleteAction.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.actions.registry.browser;
-
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class DeleteAction extends AbstractBrowserActionItem {
-    public static final String ID = "action.delete";
-
-    public DeleteAction() {
-        setCaption(getDefaultCaption());
-    }
-
-    @Override
-    public String getID() {
-        return ID;
-    }
-
-    @Override
-    public String getDefaultCaption() {
-        return "Remove";
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/EditAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/EditAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/EditAction.java
deleted file mode 100644
index 1f007f4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/EditAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.actions.registry.browser;
-
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class EditAction extends AbstractBrowserActionItem {
-    public static final String ID = "action.edit";
-
-    @Override
-    public String getID() {
-        return ID;
-    }
-
-    @Override
-    public String getDefaultCaption() {
-        return "Edit";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ImportAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ImportAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ImportAction.java
deleted file mode 100644
index f2ce0c1..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ImportAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.actions.registry.browser;
-
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class ImportAction extends AbstractBrowserActionItem {
-    public static final String ID = "action.import";
-
-    @Override
-    public String getID() {
-        return ID;
-    }
-
-    @Override
-    public String getDefaultCaption() {
-        return "Import";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/RefreshAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/RefreshAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/RefreshAction.java
deleted file mode 100644
index cb95e4e..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/RefreshAction.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.actions.registry.browser;
-
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class RefreshAction extends AbstractBrowserActionItem {
-    public static String ID = "action.refresh";
-
-    public RefreshAction() {
-        setCaption(getDefaultCaption());
-    }
-
-    @Override
-    public String getID() {
-        return ID;
-    }
-
-    @Override
-    public String getDefaultCaption() {
-        return "Refresh";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ViewAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ViewAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ViewAction.java
deleted file mode 100644
index c7fa0db..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ViewAction.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.actions.registry.browser;
-
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class ViewAction extends AbstractBrowserActionItem {
-    public static final String ID = "action.view";
-
-    @Override
-    public String getID() {
-        return ID;
-    }
-
-    @Override
-    public String getDefaultCaption() {
-        return "View";
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/AboutWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/AboutWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/AboutWindow.java
deleted file mode 100644
index 75d9bbe..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/AboutWindow.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs;
-
-import java.awt.event.ActionEvent;
-import java.net.URL;
-
-import javax.swing.AbstractAction;
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JEditorPane;
-import javax.swing.JPanel;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkEvent.EventType;
-import javax.swing.event.HyperlinkListener;
-
-import org.apache.airavata.common.utils.BrowserLauncher;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.XBayaVersion;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul5.XmlConstants;
-
-public class AboutWindow {
-
-    private static final Logger logger = LoggerFactory.getLogger(AboutWindow.class);
-
-    private XBayaEngine engine;
-
-    private XBayaDialog dialog;
-
-    /**
-     * Creates the AboutWindow.
-     * 
-     * @param engine
-     */
-    public AboutWindow(XBayaEngine engine) {
-        this.engine = engine;
-        init();
-    }
-
-    /**
-     * Shows the dialog.
-     */
-    public void show() {
-        this.dialog.show();
-    }
-
-    private void hide() {
-        this.dialog.hide();
-    }
-
-    @SuppressWarnings("serial")
-	private void init() {
-        JPanel buttonPanel = new JPanel();
-        JButton okButton = new JButton("OK");
-        okButton.setDefaultCapable(true);
-        okButton.addActionListener(new AbstractAction() {
-            public void actionPerformed(ActionEvent e) {
-                hide();
-            }
-        });
-        buttonPanel.add(okButton);
-        String styles="<style type=\"text/css\">"+
-		        		"body {"+
-			        	"font-family:Arial, Helvetica, sans-serif"+
-			        	"}"+
-        				".centeredImage"+
-        				"{"+
-        				"	text-align:center;"+
-        				"	display:block;"+
-        				"}"+
-        				"</style>";
-        buttonPanel.setBorder(BorderFactory.createEtchedBorder());
-        String imgLogoTag="";//"<img src=\""+SwingUtil.getImageURL("airavata-2.png").toString()+"\" class=\".centeredImage\" /><br>";
-        String imgHeadingTag="<div style=\"width:100%;margin-right:10px;margin-left:10px;margin-top:5px;\" ><img src=\""+SwingUtil.getImageURL("airavata-title-text.png").toString()+"\" class=\".centeredImage\" /></div><br>";
-        String projectNameText = "";//"<h1>" + XBayaConstants.PROJECT_NAME + "</h1>";
-		String message = "<html>"+ styles +"<body align=\"center\">" + "<div style=\"background-color:white;width:100%;margin-bottom:0px;\">"+projectNameText + imgHeadingTag+ imgLogoTag +"</div><br><h2>" +XBayaConstants.APPLICATION_NAME + "</h2>" + "Version: "
-				+ XBayaVersion.VERSION + "<br>" + "<a href='" + XBayaConstants.WEB_URL.toString() + "'>" + XBayaConstants.WEB_URL.toString() + "</a>"
-				+ "<br>&nbsp</body></html>";
-        JEditorPane editorPane = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, message);
-        editorPane.setEditable(false);
-        editorPane.setBorder(BorderFactory.createEtchedBorder());
-        editorPane.setBackground(buttonPanel.getBackground());
-        editorPane.addHyperlinkListener(new HyperlinkListener() {
-            public void hyperlinkUpdate(HyperlinkEvent event) {
-                logger.debug("Event:" + event);
-                if (event.getEventType() == EventType.ACTIVATED) {
-                    URL url = event.getURL();
-                    try {
-                        BrowserLauncher.openURL(url.toString());
-                    } catch (Exception e) {
-                        AboutWindow.this.engine.getGUI().getErrorWindow().error(AboutWindow.this.dialog.getDialog(),
-                                e.getMessage(), e);
-                    }
-                }
-            }
-        });
-
-        this.dialog = new XBayaDialog(this.engine.getGUI(), XBayaConstants.PROJECT_NAME, editorPane, buttonPanel);
-        this.dialog.setDefaultButton(okButton);
-//        this.dialog.setCancelButton(okButton);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/ErrorWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/ErrorWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/ErrorWindow.java
deleted file mode 100644
index 2ffb642..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/ErrorWindow.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs;
-
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-import javax.swing.AbstractAction;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.SwingUtilities;
-
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ErrorWindow {
-
-    private static final String DEFAULT_ERROR_TITLE = "Error";
-
-    private static final String DEFAULT_WARNING_TITLE = "Warning";
-
-    private static final String DEFAULT_INFORMATION_TITLE = "Information";
-
-    private static final Logger logger = LoggerFactory.getLogger(ErrorWindow.class);
-
-    private Component defaultParent;
-
-    /**
-     * @param parent
-     */
-    public ErrorWindow(Component parent) {
-        this.defaultParent = parent;
-    }
-
-    /**
-     * @param message
-     */
-    public void error(String message) {
-        error(null, null, message, null);
-    }
-
-    /**
-     * @param message
-     * @param e
-     */
-    public void error(String message, Throwable e) {
-        error(null, null, message, e);
-    }
-
-    /**
-     * @param e
-     */
-    public void error(Throwable e) {
-        error(null, null, null, e);
-    }
-
-    /**
-     * @param parent
-     * @param message
-     */
-    public void error(Component parent, String message) {
-        error(parent, null, message, null);
-    }
-
-    /**
-     * @param parent
-     * @param message
-     * @param e
-     */
-    public void error(Component parent, String message, Throwable e) {
-        error(parent, null, message, e);
-    }
-
-    /**
-     * @param parent
-     * @param title
-     * @param message
-     */
-    public void error(Component parent, String title, String message) {
-        error(parent, title, message, null);
-    }
-
-    /**
-     * @param parent
-     * @param title
-     * @param message
-     * @param e
-     */
-    public void error(Component parent, String title, String message, Throwable e) {
-
-        logger.error(e==null? message:e.getMessage(), e);
-
-        // If the parent component is not specified, set the frame the one.
-        if (parent == null) {
-            parent = this.defaultParent;
-        }
-
-        // If the title is still null, set it to the default.
-        if (title == null) {
-            title = DEFAULT_ERROR_TITLE;
-        }
-
-        // If the message is still null, try to get it from the exception first,
-        // and set it to the default if it is still null.
-        if (message == null) {
-            if (e != null) {
-                message = messageSplitter(e.getMessage());
-            }
-        }
-        if (message == null) {
-            message = ErrorMessages.UNEXPECTED_ERROR;
-        }
-
-        showErrorDialog(parent, title, message, e);
-    }
-
-    /**
-     * Shows a warning dialog
-     * 
-     * @param message
-     */
-    public void warning(String message) {
-        warning(null, null, message);
-    }
-
-    /**
-     * Shows a warning dialog.
-     * 
-     * @param parent
-     * @param title
-     * @param message
-     */
-    public void warning(Component parent, String title, String message) {
-        if (parent == null) {
-            parent = this.defaultParent;
-        }
-        if (title == null) {
-            title = DEFAULT_WARNING_TITLE;
-        }
-        showWarningDialog(parent, title, message);
-    }
-
-    /**
-     * Shows a information dialog
-     * 
-     * @param message
-     */
-    public void info(String message) {
-        info(null, null, message);
-    }
-
-    /**
-     * Shows a information dialog.
-     * 
-     * @param parent
-     * @param title
-     * @param message
-     */
-    public void info(Component parent, String title, String message) {
-        if (parent == null) {
-            parent = this.defaultParent;
-        }
-        if (title == null) {
-            title = DEFAULT_INFORMATION_TITLE;
-        }
-        showInformationDialog(parent, title, message);
-    }
-
-    private void showErrorDialog(Component parent, String title, String message, Throwable e) {
-
-        String[] options = new String[] { "OK", "Detail" };
-        int result = JOptionPane.showOptionDialog(parent, message, title, JOptionPane.DEFAULT_OPTION,
-                JOptionPane.ERROR_MESSAGE, null, options, options[0]);
-
-        if (result == 1) {
-            // A user clicked "Detail".
-
-            // Gets the stack trace as a string
-            StringWriter stringWriter = new StringWriter();
-            PrintWriter printWriter = new PrintWriter(stringWriter);
-            if (e != null) {
-                e.printStackTrace(printWriter);
-            }
-            printWriter.close();
-            String stackTrace = stringWriter.toString();
-
-            JLabel messageLabel = new JLabel(messageSplitter(message));
-
-            XBayaTextArea textArea = new XBayaTextArea();
-            textArea.setEditable(false);
-            textArea.setSize(800, 600);
-            textArea.setText(stackTrace);
-
-            GridPanel mainPanel = new GridPanel();
-            mainPanel.add(messageLabel);
-            mainPanel.add(textArea);
-            mainPanel.layout(2, 1, 1, 0);
-
-            JButton okButton = new JButton("OK");
-            okButton.setDefaultCapable(true);
-
-            JPanel buttonPanel = new JPanel();
-            buttonPanel.add(okButton);
-
-            final XBayaDialog dialog = new XBayaDialog(SwingUtilities.getWindowAncestor(parent), title, mainPanel,
-                    buttonPanel);
-
-            okButton.addActionListener(new AbstractAction() {
-                public void actionPerformed(ActionEvent event) {
-                    dialog.hide();
-                }
-            });
-
-            dialog.setDefaultButton(okButton);
-            dialog.show();
-        }
-    }
-
-    private void showWarningDialog(Component parent, String title, String message) {
-        JOptionPane.showMessageDialog(parent, message, title, JOptionPane.WARNING_MESSAGE);
-    }
-
-    private void showInformationDialog(Component parent, String title, String message) {
-
-        JOptionPane.showMessageDialog(parent, message, title, JOptionPane.INFORMATION_MESSAGE);
-    }
-
-    private String messageSplitter(String message){
-        int interval = 150;
-        char[] sAr = message.toCharArray();
-        int i = 0;
-        StringBuffer buffer = new StringBuffer("");
-        if(sAr.length > interval){
-        do{
-            String subString = "";
-            if(i + interval > message.length()){
-             subString = message.substring(i,message.length());
-            }else{
-             subString = message.substring(i, i + interval);
-            }
-            buffer.append(subString);
-            if(!subString.contains("\n")){
-               buffer.append("\n");
-            }
-            i = i + interval;
-        }while(i < sAr.length);
-            return buffer.toString();
-        }else{
-            return message;
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/GlobusFileTransferWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/GlobusFileTransferWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/GlobusFileTransferWindow.java
deleted file mode 100644
index 21c4c95..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/GlobusFileTransferWindow.java
+++ /dev/null
@@ -1,258 +0,0 @@
-///*
-//*
-//* Licensed to the Apache Software Foundation (ASF) under one
-//* or more contributor license agreements.  See the NOTICE file
-//* distributed with this work for additional information
-//* regarding copyright ownership.  The ASF licenses this file
-//* to you under the Apache License, Version 2.0 (the
-//* "License"); you may not use this file except in compliance
-//* with the License.  You may obtain a copy of the License at
-//*
-//*   http://www.apache.org/licenses/LICENSE-2.0
-//*
-//* Unless required by applicable law or agreed to in writing,
-//* software distributed under the License is distributed on an
-//* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-//* KIND, either express or implied.  See the License for the
-//* specific language governing permissions and limitations
-//* under the License.
-//*
-//*/
-//
-//package org.apache.airavata.xbaya.ui.dialogs;
-//
-//import org.apache.airavata.xbaya.XBayaEngine;
-//import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-//import org.apache.airavata.xbaya.ui.widgets.XBayaComboBox;
-//import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-//import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-//import org.apache.airavata.xbaya.util.GlobusOnlineUtils;
-//import org.apache.airavata.xbaya.util.TransferFile;
-//import org.globusonline.transfer.APIError;
-//import org.json.JSONException;
-//
-//import javax.swing.*;
-//import java.awt.event.ActionEvent;
-//import java.awt.event.ActionListener;
-//import java.io.IOException;
-//import java.security.GeneralSecurityException;
-//import java.util.ArrayList;
-//import java.util.List;
-//
-//
-//public class GlobusFileTransferWindow {
-//    private XBayaEngine engine;
-//
-//    private XBayaDialog dialog;
-//
-//    private XBayaTextField usernameTextField;
-//
-//    private JPasswordField pwdTextField;
-//
-//    private XBayaComboBox sourceEndpointTextField;
-//
-//    private XBayaTextField sourceFilePathTextField;
-//
-//    private XBayaComboBox destEndpointTextField;
-//
-//    private XBayaTextField destFilePathTextField;
-//
-//    private XBayaTextField transferLabelTextField;
-//
-//    private GlobusOnlineUtils globusOnlineUtils;
-//
-//
-//    private String goUserName;
-//    private String goPWD;
-//
-//    /**
-//     * @param engine XBaya workflow engine
-//     */
-//    public GlobusFileTransferWindow(XBayaEngine engine) {
-//        this.engine = engine;
-//        initGUI();
-//    }
-//
-//    /**
-//     * Displays the dialog.
-//     */
-//    public void show() {
-//        this.dialog.show();
-//    }
-//
-//    private void hide() {
-//        this.dialog.hide();
-//    }
-//
-//    private void ok() {
-//
-//        goUserName = this.usernameTextField.getText();
-//        goPWD  = new String(this.pwdTextField.getPassword());
-//
-//        String sourceEndpoint = this.sourceEndpointTextField.getText();
-//        String sourceFilePath = this.sourceFilePathTextField.getText();
-//        String destEndpoint = this.destEndpointTextField.getText();
-//        String destFilePath = this.destFilePathTextField.getText();
-//        String transferLabel = this.transferLabelTextField.getText();
-//
-//        if(globusOnlineUtils == null){
-//            globusOnlineUtils = new GlobusOnlineUtils(goUserName, goPWD);
-//        }
-//        TransferFile transferFile = globusOnlineUtils.getTransferFile(sourceEndpoint, destEndpoint, sourceFilePath, destFilePath, transferLabel);
-//        globusOnlineUtils.transferFiles(transferFile);
-//    }
-//
-//    private String[] getGOEndpointList(){
-//        if (getGoUserName() != null && getGoPWD() != null){
-//            globusOnlineUtils = new GlobusOnlineUtils(goUserName, goPWD);
-//        }
-//        List<String> epList = new ArrayList<String>();
-//        try {
-//            if (globusOnlineUtils != null){
-//                epList = globusOnlineUtils.getEPList();
-//            }
-//        } catch (IOException e) {
-//            e.printStackTrace();
-//        } catch (APIError apiError) {
-//            apiError.printStackTrace();
-//        } catch (GeneralSecurityException e) {
-//            e.printStackTrace();
-//        } catch (JSONException e) {
-//            e.printStackTrace();
-//        }
-//        return epList.toArray(new String[]{});
-//    }
-//
-//    /**
-//     * Initializes the GUI.
-//     */
-//    private void initGUI() {
-//        this.usernameTextField = new XBayaTextField();
-//        this.pwdTextField = new JPasswordField();
-//        JButton authenticateButton = new JButton("Authenticate");
-//
-//        XBayaLabel nameLabel = new XBayaLabel("GO Username", this.usernameTextField);
-//        XBayaLabel pwdLabel = new XBayaLabel("GO Password", this.pwdTextField);
-//        JLabel authLabel = new JLabel("");
-//
-//        GridPanel infoPanel = new GridPanel();
-//        GridPanel authButtonPanel = new GridPanel();
-//        GridPanel otherPanel = new GridPanel();
-//
-//        authButtonPanel.add(nameLabel.getSwingComponent());
-//        authButtonPanel.add(this.usernameTextField.getSwingComponent());
-//        authButtonPanel.add(pwdLabel.getSwingComponent());
-//        authButtonPanel.add(this.pwdTextField);
-//        authButtonPanel.add(authLabel);
-//        authButtonPanel.add(authenticateButton);
-//
-//        authButtonPanel.layout(3,2,GridPanel.WEIGHT_NONE, 1);
-//
-//        String[] goEndpointList = getGOEndpointList();
-//        DefaultComboBoxModel cmbModelJobType1 = new DefaultComboBoxModel(goEndpointList);
-//        sourceEndpointTextField = new XBayaComboBox(cmbModelJobType1);
-//        sourceEndpointTextField.setEditable(true);
-//
-//        sourceFilePathTextField = new XBayaTextField();
-//        DefaultComboBoxModel cmbModelJobType2 = new DefaultComboBoxModel(goEndpointList);
-//        destEndpointTextField = new XBayaComboBox(cmbModelJobType2);
-//        destEndpointTextField.setEditable(true);
-//        destFilePathTextField = new XBayaTextField();
-//        transferLabelTextField = new XBayaTextField();
-//
-//        XBayaLabel sourceEprLabel = new XBayaLabel("Source Endpoint", sourceEndpointTextField);
-//        XBayaLabel sourceFilePathLabel = new XBayaLabel("Source File Path", sourceFilePathTextField);
-//        XBayaLabel destEprLabel = new XBayaLabel("Destination Endpoint", destEndpointTextField);
-//        XBayaLabel destFilePathLabel = new XBayaLabel("Destination FIle path", destFilePathTextField);
-//        XBayaLabel labelTransferLabel = new XBayaLabel("Label This Transfer", destFilePathTextField);
-//
-//
-//        otherPanel.add(sourceEprLabel.getSwingComponent());
-//        otherPanel.add(sourceEndpointTextField.getSwingComponent());
-//        otherPanel.add(sourceFilePathLabel.getSwingComponent());
-//        otherPanel.add(sourceFilePathTextField.getSwingComponent());
-//        otherPanel.add(destEprLabel.getSwingComponent());
-//        otherPanel.add(destEndpointTextField.getSwingComponent());
-//        otherPanel.add(destFilePathLabel.getSwingComponent());
-//        otherPanel.add(destFilePathTextField.getSwingComponent());
-//        otherPanel.add(labelTransferLabel.getSwingComponent());
-//        otherPanel.add(transferLabelTextField.getSwingComponent());
-//
-//        otherPanel.layout(5, 2, GridPanel.WEIGHT_NONE, 1);
-//        infoPanel.add(authButtonPanel);
-//
-//        infoPanel.add(otherPanel);
-//        JPanel buttonPanel = new JPanel();
-//        infoPanel.add(buttonPanel);
-//
-//        infoPanel.layout(3, 1, GridPanel.WEIGHT_NONE, GridPanel.WEIGHT_NONE);
-//
-//        JButton okButton = new JButton("OK");
-//        okButton.addActionListener(new AbstractAction() {
-//            public void actionPerformed(ActionEvent e) {
-//                ok();
-//            }
-//        });
-//
-//        JButton cancelButton = new JButton("Cancel");
-//        cancelButton.addActionListener(new AbstractAction() {
-//            public void actionPerformed(ActionEvent e) {
-//                hide();
-//            }
-//        });
-//
-//        buttonPanel.add(okButton);
-//        buttonPanel.add(cancelButton);
-//
-//        usernameTextField.getSwingComponent().addActionListener(new ActionListener() {
-//            public void actionPerformed(ActionEvent event) {
-//                setGoUserName(usernameTextField.getText());
-//            }
-//        }
-//        );
-//
-//        pwdTextField.addActionListener(new ActionListener() {
-//            public void actionPerformed(ActionEvent event) {
-//                setGoPWD(new String(pwdTextField.getPassword()));
-//            }
-//        }
-//        );
-//
-//        authenticateButton.addActionListener(new ActionListener() {
-//
-//            @Override
-//            public void actionPerformed(ActionEvent actionEvent) {
-//                goUserName = usernameTextField.getText();
-//                goPWD = new String(pwdTextField.getPassword());
-//
-//                if (goUserName != null && goPWD != null){
-//                    globusOnlineUtils = new GlobusOnlineUtils(usernameTextField.getText(), new String(pwdTextField.getPassword()));
-//                    String[] goEndpointList = getGOEndpointList();
-//                    DefaultComboBoxModel comboBoxModel1 = new DefaultComboBoxModel(goEndpointList);
-//                    DefaultComboBoxModel comboBoxModel2 = new DefaultComboBoxModel(goEndpointList);
-//                    sourceEndpointTextField.setModel(comboBoxModel1);
-//                    destEndpointTextField.setModel(comboBoxModel2);
-//                }
-//            }
-//        });
-//
-//        this.dialog = new XBayaDialog(this.engine.getGUI(), "Globus file transfer", infoPanel, buttonPanel);
-//        this.dialog.setDefaultButton(okButton);
-//    }
-//
-//    public String getGoUserName() {
-//        return goUserName;
-//    }
-//
-//    public void setGoUserName(String goUserName) {
-//        this.goUserName = goUserName;
-//    }
-//
-//    public String getGoPWD() {
-//        return goPWD;
-//    }
-//
-//    public void setGoPWD(String goPWD) {
-//        this.goPWD = goPWD;
-//    }
-//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/TextWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/TextWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/TextWindow.java
deleted file mode 100644
index 400346e..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/TextWindow.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.awt.event.ActionEvent;
-import java.net.URL;
-
-import javax.swing.AbstractAction;
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JEditorPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkEvent.EventType;
-import javax.swing.event.HyperlinkListener;
-
-import org.apache.airavata.common.utils.BrowserLauncher;
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul5.XmlConstants;
-
-public class TextWindow {
-
-    private static final Logger logger = LoggerFactory.getLogger(TextWindow.class);
-
-    private XBayaEngine engine;
-
-    private XBayaDialog dialog;
-    
-    private String key;
-    private String value;
-    private String title;
-    
-    /**
-     * Creates the AboutWindow.
-     * 
-     * @param engine
-     */
-    public TextWindow(XBayaEngine engine, String key, String value, String title) {
-        this.engine = engine;
-        this.key=key;
-        this.value=value;
-        this.title=title;
-        init();
-    }
-
-    /**
-     * Shows the dialog.
-     */
-    public void show() {
-        this.dialog.show();
-    }
-
-    private void hide() {
-        this.dialog.hide();
-    }
-
-    @SuppressWarnings("serial")
-	private void init() {
-        final JEditorPane editorPane = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, StringUtil.createHTMLUrlTaggedString(value));
-        editorPane.setEditable(false);
-        editorPane.setBackground(Color.WHITE);
-        editorPane.addHyperlinkListener(new HyperlinkListener() {
-            public void hyperlinkUpdate(HyperlinkEvent event) {
-                logger.debug("Event:" + event);
-                if (event.getEventType() == EventType.ACTIVATED) {
-                    URL url = event.getURL();
-                    try {
-                        BrowserLauncher.openURL(url.toString());
-                    } catch (Exception e) {
-                        TextWindow.this.engine.getGUI().getErrorWindow().error(TextWindow.this.dialog.getDialog(),
-                                e.getMessage(), e);
-                    }
-                }
-            }
-        });
-        JScrollPane pane = new JScrollPane(editorPane);
-        GridPanel gridPanel = new GridPanel();
-        XBayaTextField txtKey=new XBayaTextField(key);
-        txtKey.getTextField().setEditable(false);
-        gridPanel.add(txtKey);
-        gridPanel.add(pane);
-        gridPanel.getContentPanel().setBorder(BorderFactory.createEtchedBorder());
-        gridPanel.layout(2, 1, 1, 0);
-        
-        JPanel buttonPanel = new JPanel();
-        JButton okButton = new JButton("Close");
-        okButton.setDefaultCapable(true);
-        okButton.addActionListener(new AbstractAction() {
-            public void actionPerformed(ActionEvent e) {
-                hide();
-            }
-        });
-        JButton btnCopy = new JButton("Copy to clipboard");
-        btnCopy.addActionListener(new AbstractAction(){
-			@Override
-			public void actionPerformed(ActionEvent arg0) {
-				Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(value), null);
-			}
-        	
-        });
-        buttonPanel.add(btnCopy);
-        buttonPanel.add(okButton);
-        buttonPanel.setBorder(BorderFactory.createEtchedBorder());
-        
-        this.dialog = new XBayaDialog(this.engine.getGUI(), title, gridPanel, buttonPanel);
-        dialog.getDialog().setMinimumSize(new Dimension(400, 400));
-        this.dialog.setDefaultButton(okButton);
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java
deleted file mode 100644
index b92c679..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-
-import javax.swing.AbstractAction;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.SwingConstants;
-import javax.swing.WindowConstants;
-
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.xbaya.ui.XBayaGUI;
-import org.apache.airavata.xbaya.ui.utils.Cancelable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WaitDialog {
-
-    private static final Logger logger = LoggerFactory.getLogger(WaitDialog.class);
-
-    private XBayaGUI xbayaGUI;
-
-    private Cancelable cancelable;
-
-    private String title;
-
-    private String message;
-
-    private XBayaDialog dialog;
-
-    private boolean done;
-
-    /**
-     * Constructs a WaitDialog.
-     * 
-     * @param cancelable
-     * @param title
-     * @param message
-     * @param engine
-     */
-    public WaitDialog(Cancelable cancelable, String title, String message, XBayaGUI xbayaGUI) {
-        this.cancelable = cancelable;
-        this.title = title;
-        this.message = message;
-        this.xbayaGUI = xbayaGUI;
-        this.done = true;
-    }
-
-    /**
-     * Shows the dialog.
-     */
-    public void show() {
-        synchronized (this) {
-            // We cannot check if this.done is false because show() might be
-            // called more than once at the same time.
-            this.done = false;
-            // We cannot make the whole method synchronized because
-            // this.dialog.show() blocks.
-            if (this.dialog == null) {
-                initGUI();
-            }
-        }
-        this.dialog.show();
-    }
-
-    /**
-     * Hides the dialog.
-     */
-    public synchronized void hide() {
-        if (this.done) {
-            // The dialog is already hidden.
-            return;
-        }
-        while (this.dialog == null || !this.dialog.getDialog().isVisible()) {
-            try {
-                // Wait for at least one show is called. We have to rely on
-                // ComponentEvent because this.dialog.show() blocks.
-                wait();
-            } catch (InterruptedException e) {
-                logger.error(e.getMessage(), e);
-            }
-        }
-        this.done = true;
-        this.dialog.hide();
-    }
-
-    private void initGUI() {
-        JLabel label = new JLabel(this.message, SwingConstants.CENTER);
-        JButton cancelButton = new JButton("Cancel");
-        cancelButton.addActionListener(new AbstractAction() {
-            public void actionPerformed(ActionEvent e) {
-                WaitDialog.this.dialog.hide();
-                WaitDialog.this.cancelable.cancel();
-            }
-        });
-
-        JPanel buttonPanel = new JPanel();
-        buttonPanel.add(cancelButton);
-
-        this.dialog = new XBayaDialog(this.xbayaGUI, this.title, label, buttonPanel);
-
-        this.dialog.getDialog().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
-        this.dialog.getDialog().setCursor(SwingUtil.WAIT_CURSOR);
-
-        this.dialog.getDialog().addComponentListener(new ComponentAdapter() {
-            @Override
-            public void componentShown(ComponentEvent e) {
-                shown();
-            }
-        });
-    }
-
-    private synchronized void shown() {
-        notifyAll();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/XBayaDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/XBayaDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/XBayaDialog.java
deleted file mode 100644
index 24a0cbb..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/XBayaDialog.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs;
-
-import java.awt.Container;
-import java.awt.Dialog;
-import java.awt.Dimension;
-import java.awt.Frame;
-import java.awt.Toolkit;
-import java.awt.Window;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.xbaya.ui.XBayaGUI;
-import org.apache.airavata.xbaya.ui.widgets.XBayaComponent;
-
-public class XBayaDialog {
-
-    private Window owner;
-
-    private String title;
-
-    private String description;
-
-    private JDialog dialog;
-
-    private JComponent mainPanel;
-
-    private JComponent buttonPanel;
-
-    /**
-     * Constructs an XBayaDialog.
-     * 
-     * @param engine
-     * @param title
-     * @param mainPanel
-     * @param buttonPanel
-     */
-    public XBayaDialog(XBayaGUI xbayaGUI, String title, XBayaComponent mainPanel, XBayaComponent buttonPanel) {
-        this(xbayaGUI.getFrame(), title, mainPanel.getSwingComponent(), buttonPanel.getSwingComponent());
-    }
-
-    /**
-     * Constructs an XBayaDialog.
-     * 
-     * @param engine
-     * @param title
-     * @param mainPanel
-     * @param buttonPanel
-     */
-    public XBayaDialog(XBayaGUI xbayaGUI, String title, XBayaComponent mainPanel, JComponent buttonPanel) {
-        this(xbayaGUI.getFrame(), title, mainPanel.getSwingComponent(), buttonPanel);
-    }
-
-    /**
-     * Constructs an XBayaDialog.
-     * 
-     * @param engine
-     * @param title
-     * @param description
-     * @param mainPanel
-     * @param buttonPanel
-     */
-    public XBayaDialog(XBayaGUI xbayaGUI, String title, String description, XBayaComponent mainPanel,
-            JComponent buttonPanel) {
-        this(xbayaGUI.getFrame(), title, description, mainPanel.getSwingComponent(), buttonPanel);
-    }
-
-    /**
-     * Constructs an XBayaDialog.
-     * 
-     * @param engine
-     * @param title
-     * @param mainPanel
-     * @param buttonPanel
-     */
-    public XBayaDialog(XBayaGUI xbayaGUI, String title, JComponent mainPanel, JComponent buttonPanel) {
-        this(xbayaGUI.getFrame(), title, mainPanel, buttonPanel);
-    }
-
-    /**
-     * Constructs an XBayaDialog.
-     * 
-     * @param owner
-     * @param title
-     * @param mainPanel
-     * @param buttonPanel
-     */
-    public XBayaDialog(Window owner, String title, XBayaComponent mainPanel, JComponent buttonPanel) {
-        this(owner, title, mainPanel.getSwingComponent(), buttonPanel);
-    }
-
-    /**
-     * Constructs an XBayaDialog.
-     * 
-     * @param owner
-     * @param title
-     * @param mainPanel
-     * @param buttonPanel
-     */
-    public XBayaDialog(Window owner, String title, JComponent mainPanel, JComponent buttonPanel) {
-        this(owner, title, null, mainPanel, buttonPanel);
-    }
-
-    /**
-     * Constructs an XBayaDialog.
-     * 
-     * @param owner
-     * @param title
-     * @param description
-     * @param mainPanel
-     * @param buttonPanel
-     */
-    public XBayaDialog(Window owner, String title, String description, JComponent mainPanel, JComponent buttonPanel) {
-        this.owner = owner;
-        this.title = title;
-        this.description = description;
-        this.mainPanel = mainPanel;
-        this.buttonPanel = buttonPanel;
-        init();
-    }
-
-    /**
-     * @return The dialog.
-     */
-    public JDialog getDialog() {
-        return this.dialog;
-    }
-
-    /**
-     * Determines whether this component should be visible when its parent is visible. Components are initially visible,
-     * with the exception of top level components such as <code>Frame</code> objects.
-     * 
-     * @return <code>true</code> if the component is visible, <code>false</code> otherwise
-     */
-    public boolean isVisible() {
-        return this.dialog.isVisible();
-    }
-
-    /**
-     * Shows the dialog.
-     */
-    public void show() {
-        this.dialog.pack();
-
-        // Adjust the size if it's bigger than the screen.
-        Dimension size = this.dialog.getSize();
-        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        final int inset = 100;
-        int width = size.width;
-        if (width > screenSize.width) {
-            width = screenSize.width - inset;
-        }
-        int height = size.height;
-        if (height > screenSize.height) {
-            height = screenSize.height - inset;
-        }
-        this.dialog.setSize(width, height);
-
-        this.dialog.setLocationRelativeTo(this.owner);
-        this.dialog.setVisible(true);
-    }
-
-    /**
-     * Just set dialog visible Do NOTHING to layout
-     */
-    public void simpeShow() {
-        this.dialog.setVisible(true);
-    }
-
-    /**
-     * Hides the dialog.
-     */
-    public void hide() {
-        this.dialog.setVisible(false);
-    }
-
-    /**
-     * @param title
-     */
-    public void setTitle(String title) {
-        this.title = title;
-        this.dialog.setTitle(title);
-    }
-
-    /**
-     * @param button
-     */
-    public void setDefaultButton(JButton button) {
-        this.dialog.getRootPane().setDefaultButton(button);
-    }
-    
-    public void setCancelButton(final JButton button){
-    	this.dialog.getRootPane().addKeyListener(new KeyListener(){
-
-			@Override
-			public void keyPressed(KeyEvent event) {
-				if (event.getKeyCode()==27){
-					button.getAction().actionPerformed(null);
-				}
-			}
-
-			@Override
-			public void keyReleased(KeyEvent arg0) {
-			}
-
-			@Override
-			public void keyTyped(KeyEvent arg0) {
-			}
-    		
-    	});
-    }
-
-    private void init() {
-        if (this.owner instanceof Frame) {
-            this.dialog = new JDialog((Frame) this.owner);
-        } else if (this.owner instanceof Dialog) {
-            this.dialog = new JDialog((Dialog) this.owner);
-        } else {
-            // This should not happen.
-            throw new WorkflowRuntimeException("The owner component was neither Frame or Dialog.");
-        }
-        this.dialog.setTitle(this.title);
-        this.dialog.setModal(true);
-        this.dialog.setResizable(true);
-
-        Container contentPane = this.dialog.getContentPane();
-        int numRow = 0;
-        if (this.description != null && this.description.length() > 0) {
-            JLabel descriptionLabel = new JLabel("<html>" + this.description + "</html>");
-
-            contentPane.add(descriptionLabel);
-            numRow++;
-        }
-        contentPane.add(this.mainPanel);
-        numRow++;
-        contentPane.add(this.buttonPanel);
-        numRow++;
-        SwingUtil.layoutToGrid(contentPane, numRow, 1, numRow - 2, 0);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonEC2InvokerWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonEC2InvokerWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonEC2InvokerWindow.java
deleted file mode 100644
index c9f3051..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonEC2InvokerWindow.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.amazon;
-
-//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceCallbackHandler;
-//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceStub;
-//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceStub.JobStatusResponse;
-//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceStub.JobSubmissionReceipt;
-//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceStub.JobSubmitOperation;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.apache.axis2.AxisFault;
-
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-import java.rmi.RemoteException;
-
-public class AmazonEC2InvokerWindow {
-    private XBayaEngine engine;
-
-    private XBayaTextField accessKeyIDTextField;
-    private XBayaTextField secretAccessKeyTextField;
-    private XBayaTextField keyPairNameTextField;
-    private XBayaTextField numOfInstancesTextField;
-    private XBayaTextField jobFlowNameTextField;
-    private XBayaTextField logLocationOnS3TextField;
-    private XBayaTextField inputLocationOnS3TextField;
-    private XBayaTextField outputLocationOnS3TextField;
-    private XBayaTextField jarFilePathOnS3TextField;
-    private XBayaTextField mainClassNameTextField;
-    private XBayaDialog dialog;
-
-    /**
-     * Constructs a PegasusInvokerWindow.
-     */
-    public AmazonEC2InvokerWindow(XBayaEngine engine) {
-        this.engine = engine;
-        initGUI();
-    }
-
-    @SuppressWarnings("serial")
-	protected void initGUI() {
-
-        this.accessKeyIDTextField = new XBayaTextField();
-        XBayaLabel accessKeyIDLabel = new XBayaLabel("Access Key", this.accessKeyIDTextField);
-
-        this.secretAccessKeyTextField = new XBayaTextField();
-        XBayaLabel secretAccessKeyLabel = new XBayaLabel("Secret Access Key", this.secretAccessKeyTextField);
-
-        this.keyPairNameTextField = new XBayaTextField();
-        XBayaLabel keyPairNameLabel = new XBayaLabel("Key Pair Name", this.keyPairNameTextField);
-
-        this.numOfInstancesTextField = new XBayaTextField();
-        XBayaLabel numOfInstancesLabel = new XBayaLabel("Number of Instances", this.numOfInstancesTextField);
-
-        this.jobFlowNameTextField = new XBayaTextField();
-        XBayaLabel jobFlowNameLabel = new XBayaLabel("Job Flow Name", this.jobFlowNameTextField);
-
-        this.logLocationOnS3TextField = new XBayaTextField();
-        XBayaLabel logLocationOnS3Label = new XBayaLabel("Log Location(S3)", this.logLocationOnS3TextField);
-
-        this.inputLocationOnS3TextField = new XBayaTextField();
-        XBayaLabel inputLocationOnS3Label = new XBayaLabel("Input Location(S3)", this.inputLocationOnS3TextField);
-
-        this.outputLocationOnS3TextField = new XBayaTextField();
-        XBayaLabel outputLocationOnS3Label = new XBayaLabel("Output Location(S3)", this.outputLocationOnS3TextField);
-
-        this.jarFilePathOnS3TextField = new XBayaTextField();
-        XBayaLabel jarFilePathOnS3Label = new XBayaLabel("Jar File Location(S3)", this.jarFilePathOnS3TextField);
-
-        this.mainClassNameTextField = new XBayaTextField();
-        XBayaLabel mainClassNameLabel = new XBayaLabel("Main Class Name", this.mainClassNameTextField);
-
-        this.accessKeyIDTextField.setText("AKIAI3GNMQVYA5LSQNEQ");
-        this.secretAccessKeyTextField.setText("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");
-        this.keyPairNameTextField.setText("XbayaHadoopTest");
-        this.numOfInstancesTextField.setText("4");
-        this.jobFlowNameTextField.setText("Test-job-flow");
-        this.logLocationOnS3TextField.setText("s3n://xbaya-ec2-test/logs");
-        this.inputLocationOnS3TextField.setText("s3n://xbaya-ec2-test/input/");
-        this.outputLocationOnS3TextField.setText("s3n://xbaya-ec2-test/output/");
-        this.jarFilePathOnS3TextField.setText("s3n://xbaya-ec2-test/jars/Hadoopv400.jar");
-        this.mainClassNameTextField.setText("edu.indiana.extreme.HadoopRayTracer");
-
-        GridPanel infoPanel = new GridPanel();
-        infoPanel.add(accessKeyIDLabel);
-        infoPanel.add(this.accessKeyIDTextField);
-        infoPanel.add(secretAccessKeyLabel);
-        infoPanel.add(this.secretAccessKeyTextField);
-        infoPanel.add(keyPairNameLabel);
-        infoPanel.add(this.keyPairNameTextField);
-        infoPanel.add(numOfInstancesLabel);
-        infoPanel.add(this.numOfInstancesTextField);
-        infoPanel.add(jobFlowNameLabel);
-        infoPanel.add(this.jobFlowNameTextField);
-        infoPanel.add(logLocationOnS3Label);
-        infoPanel.add(this.logLocationOnS3TextField);
-        infoPanel.add(inputLocationOnS3Label);
-        infoPanel.add(this.inputLocationOnS3TextField);
-        infoPanel.add(outputLocationOnS3Label);
-        infoPanel.add(this.outputLocationOnS3TextField);
-        infoPanel.add(jarFilePathOnS3Label);
-        infoPanel.add(this.jarFilePathOnS3TextField);
-        infoPanel.add(mainClassNameLabel);
-        infoPanel.add(this.mainClassNameTextField);
-
-        infoPanel.layout(10, 2, GridPanel.WEIGHT_NONE, 1);
-
-        GridPanel mainPanel = new GridPanel();
-        mainPanel.add(infoPanel);
-        mainPanel.layout(1, 1, 0, 0);
-
-        JButton invokeButton = new JButton("Invoke");
-        invokeButton.addActionListener(new AbstractAction() {
-            public void actionPerformed(ActionEvent e) {
-                execute();
-            }
-
-        });
-
-        JButton cancelButton = new JButton("Cancel");
-        cancelButton.addActionListener(new AbstractAction() {
-            public void actionPerformed(ActionEvent e) {
-                hide();
-            }
-        });
-
-        JPanel buttonPanel = new JPanel();
-        buttonPanel.add(invokeButton);
-        buttonPanel.add(cancelButton);
-
-        this.dialog = new XBayaDialog(this.engine.getGUI(), "Deploy Workflow", mainPanel, buttonPanel);
-    }
-
-    /**
-     * Deploy Work Flow to Amazon EC2
-     */
-    protected void execute() {
-//        try {
-//            AmazonEC2WebserviceStub stub = new AmazonEC2WebserviceStub();
-//            JobSubmitOperation jobInfo = new JobSubmitOperation();
-//            jobInfo.setAccessKeyID(this.accessKeyIDTextField.getText());
-//            jobInfo.setSecretAccessKey(this.secretAccessKeyTextField.getText());
-//            jobInfo.setKeyPairName(this.keyPairNameTextField.getText());
-//            jobInfo.setNumOfInstances(this.numOfInstancesTextField.getText());
-//            jobInfo.setJobFlowName(this.jobFlowNameTextField.getText());
-//            jobInfo.setLogLocationOnS3(this.logLocationOnS3TextField.getText());
-//            jobInfo.setInputLocationOnS3(this.inputLocationOnS3TextField.getText());
-//            jobInfo.setOutputLocationOnS3(this.outputLocationOnS3TextField.getText());
-//            jobInfo.setJarFilePathOnS3(this.jarFilePathOnS3TextField.getText());
-//            jobInfo.setMainClassName(this.mainClassNameTextField.getText());
-//            stub.startjobSubmitOperation(jobInfo, new MyHandler());
-//            this.hide();
-//        } catch (AxisFault e) {
-//            e.printStackTrace();
-//        } catch (RemoteException e) {
-//            e.printStackTrace();
-//        }
-    }
-
-    /**
-     * hide the dialog (when user clicked on cancel)
-     */
-    public void hide() {
-        this.dialog.hide();
-    }
-
-    /**
-     * show the dialog (when user clicked on invoke)
-     */
-    public void show() {
-        this.dialog.show();
-    }
-
-//    class MyHandler extends AmazonEC2WebserviceCallbackHandler {
-//
-//        @Override
-//        public void receiveResultjobSubmitOperation(JobSubmissionReceipt result) {
-//            JOptionPane.showMessageDialog(null, "Job Submitted, ID: " + result.getJobFlowID(), "",
-//                    JOptionPane.INFORMATION_MESSAGE);
-//        }
-//
-//        @Override
-//        public void receiveErrorjobSubmitOperation(java.lang.Exception e) {
-//            JOptionPane.showMessageDialog(null, "Job Submit Failed!", "", JOptionPane.ERROR_MESSAGE);
-//        }
-//
-//        @Override
-//        public void receiveResultjobStatus(JobStatusResponse result) {
-//            System.out.println("In call back, response is: " + result.getStatus());
-//        }
-//
-//        @Override
-//        public void receiveErrorjobStatus(java.lang.Exception e) {
-//            throw new WorkflowRuntimeException(e);
-//        }
-
-//    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java
deleted file mode 100644
index 1fd86a4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java
+++ /dev/null
@@ -1,312 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.amazon;
-
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
-import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.apache.airavata.xbaya.ui.widgets.amazon.S3Tree;
-import org.jets3t.service.S3Service;
-import org.jets3t.service.S3ServiceException;
-import org.jets3t.service.impl.rest.httpclient.RestS3Service;
-import org.jets3t.service.security.AWSCredentials;
-
-import javax.swing.*;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.tree.DefaultMutableTreeNode;
-import java.awt.event.ActionEvent;
-import java.io.File;
-
-public class AmazonS3UtilsWindow {
-    private XBayaDialog dialog;
-
-    private static XBayaEngine xBayaEngine;
-
-    private static AmazonS3UtilsWindow window;
-
-    private XBayaTextField fileTextField;
-    private XBayaTextField uploadBucketTextField;
-    private XBayaTextField downloadBucketTextField;
-    private XBayaTextField keyTextField;
-    private XBayaTextField folderTextField;
-
-    private S3Tree s3Tree;
-
-    /**
-     * Constructs a AmazonS3UtilsWindow.
-     *
-     * @param engine XBayaEngine
-     */
-    private AmazonS3UtilsWindow(XBayaEngine engine) {
-        xBayaEngine = engine;
-        initGUI();
-    }
-
-    /**
-     * getErrorWindow
-     *
-     * @param engine XBayaEngine
-     */
-    public static AmazonS3UtilsWindow getInstance(XBayaEngine engine) {
-        if (window == null) {
-            window = new AmazonS3UtilsWindow(engine);
-        } else if (xBayaEngine != engine) {
-            window = new AmazonS3UtilsWindow(engine);
-        }
-        return window;
-    }
-
-    /**
-     * Get S3 Service
-     *
-     * @return S3Service
-     */
-    private S3Service getS3Service() {
-        S3Service s3Service = null;
-        try {
-            s3Service = new RestS3Service(new AWSCredentials(AmazonCredential.getInstance().getAwsAccessKeyId(),
-                    AmazonCredential.getInstance().getAwsSecretAccessKey()));
-        } catch (S3ServiceException s3ex) {
-            xBayaEngine.getGUI().getErrorWindow().error(s3ex);
-        }
-        return s3Service;
-    }
-
-    @SuppressWarnings("serial")
-    protected void initGUI() {
-
-        /* Upload Panel */
-        this.fileTextField = new XBayaTextField();
-        XBayaLabel fileLabel = new XBayaLabel("Upload File Path", this.fileTextField);
-
-        this.uploadBucketTextField = new XBayaTextField();
-        XBayaLabel uploadBucketLabel = new XBayaLabel("Bucket Name", this.uploadBucketTextField);
-
-        GridPanel uploadPanel = new GridPanel();
-        uploadPanel.getSwingComponent().setBorder(BorderFactory.createTitledBorder("Upload"));
-        uploadPanel.add(fileLabel);
-        uploadPanel.add(this.fileTextField);
-        uploadPanel.add(uploadBucketLabel);
-        uploadPanel.add(this.uploadBucketTextField);
-        uploadPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);
-
-        /* Download Panel */
-        if (AmazonCredential.getInstance().getAwsAccessKeyId().equals("AKIAI3GNMQVYA5LSQNEQ")) {
-            // Avoid to use default Aws Access Key
-            JOptionPane.showMessageDialog(AmazonS3UtilsWindow.this.dialog.getDialog(), "Aws Access Key not set!",
-                    "Error", JOptionPane.ERROR_MESSAGE);
-            return;
-        }
-        this.downloadBucketTextField = new XBayaTextField();
-        XBayaLabel downloadBucketLabel = new XBayaLabel("Bucket Name", this.downloadBucketTextField);
-
-        this.keyTextField = new XBayaTextField();
-        XBayaLabel keyLabel = new XBayaLabel("Key Name", this.keyTextField);
-
-        this.folderTextField = new XBayaTextField();
-        XBayaLabel folderLabel = new XBayaLabel("Download Location", this.folderTextField);
-
-        GridPanel downloadPanel = new GridPanel();
-        downloadPanel.getSwingComponent().setBorder(BorderFactory.createTitledBorder("Download"));
-        downloadPanel.add(downloadBucketLabel);
-        downloadPanel.add(this.downloadBucketTextField);
-        downloadPanel.add(keyLabel);
-        downloadPanel.add(this.keyTextField);
-        downloadPanel.add(folderLabel);
-        downloadPanel.add(this.folderTextField);
-        downloadPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
-
-        /* Button Panel */
-        JButton refreshButton = new JButton("Connect/Refresh");
-        refreshButton.addActionListener(new AbstractAction() {
-
-            private ChangeCredentialWindow credentialWindow;
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (AmazonCredential.getInstance().getAwsAccessKeyId().isEmpty()
-                        || AmazonCredential.getInstance().getAwsSecretAccessKey().isEmpty()) {
-                    JOptionPane.showMessageDialog(AmazonS3UtilsWindow.this.dialog.getDialog(),
-                            "Aws Access Key not set!", "Error", JOptionPane.ERROR_MESSAGE);
-
-                    if (this.credentialWindow == null) {
-                        this.credentialWindow = new ChangeCredentialWindow(AmazonS3UtilsWindow.this.dialog.getDialog());
-                    }
-                    try {
-                        this.credentialWindow.show();
-                    } catch (Exception e1) {
-                        xBayaEngine.getGUI().getErrorWindow().error(e1);
-                    }
-
-                    return;
-                }
-                AmazonS3UtilsWindow.this.s3Tree.clean();
-                BucketsLoader bucketsLoader = new BucketsLoader(xBayaEngine.getGUI(), window.dialog.getDialog());
-                bucketsLoader.load(getS3Service(), AmazonS3UtilsWindow.this.s3Tree);
-            }
-        });
-
-        JButton uploadButton = new JButton("Upload");
-        uploadButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if ((window.fileTextField.getText().length() != 0)
-                        && (window.uploadBucketTextField.getText().length() != 0)) {
-                    S3Uploader s3Uploader = new S3Uploader(xBayaEngine, window.dialog.getDialog());
-                    s3Uploader.upload(getS3Service(), AmazonS3UtilsWindow.this.s3Tree,
-                            window.uploadBucketTextField.getText(), window.fileTextField.getText());
-
-                    window.fileTextField.setText("");
-                    window.folderTextField.setText("");
-                } else {
-                    xBayaEngine.getGUI().getErrorWindow().error(window.dialog.getDialog(),
-                            "Please give input to every upload fields");
-                }
-            }
-        });
-
-        JButton downloadButton = new JButton("Download");
-        downloadButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if ((window.downloadBucketTextField.getText().length() != 0)
-                        && (window.keyTextField.getText().length() != 0)
-                        && (window.folderTextField.getText().length() != 0)) {
-                    S3Downloader s3Downloader = new S3Downloader(xBayaEngine, window.dialog.getDialog());
-                    s3Downloader.download(getS3Service(), window.downloadBucketTextField.getText(),
-                            window.keyTextField.getText(), window.folderTextField.getText());
-
-                    window.downloadBucketTextField.setText("");
-                    window.keyTextField.setText("");
-                    window.folderTextField.setText("");
-
-                } else {
-                    xBayaEngine.getGUI().getErrorWindow().error(window.dialog.getDialog(),
-                            "Please give input to every download fields");
-                }
-            }
-        });
-
-        JButton fileButton = new JButton("Choose File & Flolder");
-        fileButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                final JFileChooser fc = new JFileChooser();
-                fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
-                int returnVal = fc.showOpenDialog(AmazonS3UtilsWindow.this.dialog.getDialog());
-
-                if (returnVal == JFileChooser.APPROVE_OPTION) {
-                    String filePath = fc.getSelectedFile().getAbsolutePath();
-                    File file = fc.getSelectedFile();
-                    if (file.isFile()) {
-                        window.fileTextField.setText(filePath);
-                        window.folderTextField.setText("");
-                    } else if (file.isDirectory()) {
-                        window.folderTextField.setText(filePath);
-                        window.fileTextField.setText("");
-                    }
-                }
-            }
-        });
-
-        JButton cancelButton = new JButton("Cancel");
-        cancelButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                hide();
-            }
-        });
-
-        JPanel buttonPanel = new JPanel();
-        buttonPanel.add(refreshButton);
-        buttonPanel.add(uploadButton);
-        buttonPanel.add(downloadButton);
-        buttonPanel.add(fileButton);
-        buttonPanel.add(cancelButton);
-
-        /* Main Panel */
-        GridPanel mainPanel = new GridPanel(true);
-        this.s3Tree = new S3Tree();
-        mainPanel.add(new JScrollPane(this.s3Tree));
-        mainPanel.add(uploadPanel);
-        mainPanel.add(downloadPanel);
-        mainPanel.layout(3, 1, 0, GridPanel.WEIGHT_EQUALLY);
-
-        this.s3Tree.addTreeSelectionListener(new TreeSelectionListener() {
-            @Override
-            public void valueChanged(TreeSelectionEvent e) {
-                DefaultMutableTreeNode node = AmazonS3UtilsWindow.this.s3Tree.getSelectedNode();
-
-                if (node == null)
-                    return;
-
-                Object nodeInfo = node.getUserObject();
-                String bucketName;
-                String downloadPanelBucketName = "";
-                if (node.isLeaf() && node.getParent() != null) { // Node is probably a key
-                    DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();
-                    bucketName = (String) parentNode.getUserObject();
-                    if (!bucketName.equals("S3 Contents")) { // Node is indeed a key
-                        downloadPanelBucketName = (String) parentNode.getUserObject();
-                        String currentNodeName = (String) node.getUserObject();
-                        int index = currentNodeName.lastIndexOf('/');
-                        index = index >= 0 ? index : 0;
-                        if (index > 0) {
-                            bucketName = bucketName + "/" + currentNodeName.substring(0, index);
-                        }
-                        String keyName = (String) nodeInfo;
-                        window.keyTextField.setText(keyName);
-                    } // Node is a bucket
-                    else {
-                        bucketName = (String) nodeInfo;
-                        window.keyTextField.setText("");
-                    }
-                } else { // Node is a bucket
-                    bucketName = (String) nodeInfo;
-                    window.keyTextField.setText("");
-                }
-
-                window.uploadBucketTextField.setText(bucketName);
-                window.downloadBucketTextField.setText(downloadPanelBucketName);
-            }
-        });
-
-        this.dialog = new XBayaDialog(xBayaEngine.getGUI(), "Amazon S3 Upload/Download Tool", mainPanel, buttonPanel);
-
-    }
-
-    public void hide() {
-        this.dialog.hide();
-    }
-
-    public void show() {
-        this.dialog.show();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java
deleted file mode 100644
index 32c373c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.amazon;
-
-import org.apache.airavata.xbaya.ui.XBayaGUI;
-import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
-import org.apache.airavata.xbaya.ui.utils.Cancelable;
-import org.apache.airavata.xbaya.ui.widgets.amazon.S3Tree;
-import org.apache.airavata.xbaya.ui.widgets.amazon.S3TreeModel;
-import org.jets3t.service.S3Service;
-import org.jets3t.service.S3ServiceException;
-import org.jets3t.service.model.S3Bucket;
-import org.jets3t.service.model.S3Object;
-
-import javax.swing.*;
-import javax.swing.tree.DefaultMutableTreeNode;
-
-public class BucketsLoader implements Cancelable {
-    private XBayaGUI xbayaGUI;
-    private JDialog parent;
-
-    private boolean canceled;
-
-    private WaitDialog loadingDialog;
-
-    /**
-     * Constructs a BucketsLoader.
-     *
-     * @param xbayaGUI XBayaGUI
-     * @param parent JDialog
-     */
-    public BucketsLoader(XBayaGUI xbayaGUI, JDialog parent) {
-        this.xbayaGUI=xbayaGUI;
-        this.parent = parent;
-        this.loadingDialog = new WaitDialog(this, "Loading S3 Buckets.", "Loading S3 Buckets.\n"
-                + "Please wait for a moment.", this.xbayaGUI);
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
-     */
-    @Override
-    public void cancel() {
-        this.canceled = true;
-    }
-
-    /**
-     * 
-     * @param s3 S3Service
-     * @param s3Tree S3Tree
-     */
-    public void load(final S3Service s3, final S3Tree s3Tree) {
-
-        new Thread(new Runnable() {
-
-            @Override
-            public void run() {
-                S3Bucket[] bucketArray;
-                try {
-                    bucketArray = s3.listAllBuckets();
-                    for (S3Bucket s3Bucket : bucketArray) {
-                        DefaultMutableTreeNode tempTreeNode = s3Tree.addObject((DefaultMutableTreeNode) null,
-                                s3Bucket.getName());
-
-                        if (BucketsLoader.this.canceled)
-                            return;
-
-                        S3Object[] s3ObjectArray = s3.listObjects(s3Bucket.getName());
-                        for (S3Object s3Object : s3ObjectArray) {
-                            String keyName = s3Object.getName();
-                            if (keyName.contains("$")) {
-                                keyName = keyName.substring(0, keyName.indexOf('_'));
-                            }
-                            s3Tree.addObject(tempTreeNode, keyName);
-                        }
-                    }
-
-                    s3Tree.refresh();
-
-                    if (bucketArray.length == 0) {
-                        JOptionPane.showMessageDialog(BucketsLoader.this.parent, "Connection Failed!", "Error",
-                                JOptionPane.ERROR_MESSAGE);
-                        return;
-                    }
-
-                    JOptionPane.showMessageDialog(BucketsLoader.this.parent, "Connection Successfully!", "Info",
-                            JOptionPane.INFORMATION_MESSAGE);
-
-                    // already connect
-                    S3TreeModel.getInstance().connect();
-
-                } catch (S3ServiceException ex) {
-                    BucketsLoader.this.xbayaGUI.getErrorWindow().error(BucketsLoader.this.parent,
-                            "Cannot List S3 buckets", ex);
-                } finally {
-                    BucketsLoader.this.loadingDialog.hide();
-                }
-            }
-        }).start();
-
-        this.loadingDialog.show();
-    }
-
-}
\ No newline at end of file


[71/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java
new file mode 100644
index 0000000..81a5589
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java
@@ -0,0 +1,142 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptions;
+import org.apache.airavata.xbaya.model.registrybrowser.InputParameters;
+import org.apache.airavata.xbaya.model.registrybrowser.OutputParameters;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.DeploymentDescriptionDialog;
+
+public class ServiceDescriptionNode extends AbstractAiravataTreeNode {
+	private ServiceDescription serviceDescription;
+
+	public ServiceDescriptionNode(ServiceDescription serviceDescription, TreeNode parent) {
+		super(parent);
+		setServiceDescription(serviceDescription);
+	}
+
+	@Override
+	protected List<TreeNode> getChildren() {
+		List<Object> parameterTypeList=new ArrayList<Object>();
+		if (getServiceDescription().getType().getInputParametersArray().length>0){
+			parameterTypeList.add(new InputParameters(getServiceDescription().getType().getInputParametersArray()));
+		}
+		if (getServiceDescription().getType().getOutputParametersArray().length>0){
+			parameterTypeList.add(new OutputParameters(getServiceDescription().getType().getOutputParametersArray()));
+		}
+		parameterTypeList.add(new ApplicationDeploymentDescriptions(getRegistry(),getServiceDescription().getType().getName()));
+		return getTreeNodeList(parameterTypeList.toArray(), this);
+	}
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return getServiceDescription().getType().getName();
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.SERVICE_ICON;
+    }
+
+    public ServiceDescription getServiceDescription() {
+        return serviceDescription;
+    }
+
+    public void setServiceDescription(ServiceDescription serviceDescription) {
+        this.serviceDescription = serviceDescription;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(EditAction.ID, DeleteAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(DeleteAction.ID)) {
+        	return deleteServiceDescription(tree);
+        } else if (action.equals(EditAction.ID)) {
+        	return editServiceDescription(tree);
+        }
+        return super.triggerAction(tree, action);
+    }
+
+	private boolean editServiceDescription(JTree tree) {
+		DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(getRegistry(),false,getServiceDescription(), null);
+    	serviceDescriptionDialog.open();
+//		ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),false,getServiceDescription());
+//		serviceDescriptionDialog.open();
+		if (serviceDescriptionDialog.isServiceCreated()) {
+		    refresh();
+		    reloadTreeNode(tree, this);
+		}
+		return true;
+	}
+
+    private boolean deleteServiceDescription(JTree tree) throws AiravataAPIInvocationException {
+        if (askQuestion("Application", "Are you sure that you want to remove the applications associated with \""
+                + getServiceDescription().getType().getName() + "\"?")) {
+            getRegistry().getApplicationManager().deleteServiceDescription(getServiceDescription().getType().getName());
+            ((AbstractAiravataTreeNode) getParent()).refresh();
+            reloadTreeNode(tree, getParent());
+        }
+        return true;
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(DeleteAction.ID)) {
+            return "Remove";
+        } else if (action.getID().equals(EditAction.ID)) {
+            return "View/Edit";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	@Override
+	public String getDefaultAction() {
+		return EditAction.ID;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java
new file mode 100644
index 0000000..dbfce2e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java
@@ -0,0 +1,137 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.xbaya.model.registrybrowser.ServiceDescriptions;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.DeploymentDescriptionDialog;
+
+public class ServiceDescriptionsNode extends AbstractAiravataTreeNode {
+    private ServiceDescriptions serviceDescriptions;
+
+    public ServiceDescriptionsNode(ServiceDescriptions serviceDescriptions, TreeNode parent) {
+        super(parent);
+        setServiceDescriptions(serviceDescriptions);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        try {
+            return getTreeNodeList(getServiceDescriptions().getDescriptions().toArray(), this);
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();
+            return emptyList();
+        } catch (RegistryException e) {
+            e.printStackTrace();
+            return emptyList();
+        }
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return "Applications";
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.SERVICES_ICON;
+    }
+
+    public ServiceDescriptions getServiceDescriptions() {
+        return serviceDescriptions;
+    }
+
+    public void setServiceDescriptions(ServiceDescriptions serviceDescriptions) {
+        this.serviceDescriptions = serviceDescriptions;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(AddAction.ID, RefreshAction.ID, DeleteAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(DeleteAction.ID)) {
+            deleteServiceDescription(tree);
+            return true;
+        } else if (action.equals(AddAction.ID)) {
+        	DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(null, getRegistry());
+        	serviceDescriptionDialog.open();
+//            ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry());
+//            serviceDescriptionDialog.open();
+            if (serviceDescriptionDialog.isServiceCreated()) {
+                refresh();
+                reloadTreeNode(tree, this);
+            }
+            return true;
+        }
+        return super.triggerAction(tree, action);
+    }
+
+    private void deleteServiceDescription(JTree tree) throws Exception {
+        if (askQuestion("Applications",
+                "Are you sure that you want to remove all applications defined in this registry?")) {
+            AiravataAPI registry = getRegistry();
+            List<ServiceDescription> descriptions = getServiceDescriptions().getDescriptions();
+            for (ServiceDescription descriptionWrap : descriptions) {
+                registry.getApplicationManager().deleteServiceDescription(descriptionWrap.getType().getName());
+            }
+            refresh();
+            reloadTreeNode(tree, this);
+        }
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(DeleteAction.ID)) {
+            return "Remove all Applicatons";
+        } else if (action.getID().equals(AddAction.ID)) {
+            return "Register Application...";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentNode.java
new file mode 100644
index 0000000..d7294db
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentNode.java
@@ -0,0 +1,141 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.awt.*;
+import java.awt.datatransfer.StringSelection;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.registry.api.workflow.ExperimentName;
+import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiment;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
+
+public class XBayaWorkflowExperimentNode extends AbstractAiravataTreeNode {
+	private XBayaWorkflowExperiment experiment;
+	private String workflowExecutionName;
+	
+    public XBayaWorkflowExperimentNode(XBayaWorkflowExperiment experiment, TreeNode parent) {
+        super(parent);
+        setExperiment(experiment);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return getTreeNodeList(getExperiment().getWorkflows().toArray(), this);
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+    	if (workflowExecutionName==null) {
+			try {
+				workflowExecutionName = getRegistry().getProvenanceManager().getExperimentName(getExperiment().getExperimentId()).getInstanceName();
+			} catch (AiravataAPIInvocationException e) {
+				e.printStackTrace();
+			}
+			if (workflowExecutionName==null){
+				workflowExecutionName="["+getExperiment().getExperimentId()+"]";
+			}
+		}
+    	String caption=workflowExecutionName;
+    	try {
+			WorkflowExecutionStatus workflowExecutionStatus = getRegistry().getProvenanceManager().getWorkflowInstanceStatus(getExperiment().getExperimentId(), getExperiment().getExperimentId());
+			if (workflowExecutionStatus!=null && workflowExecutionStatus.getExecutionStatus()!=null){
+				caption += " - <i>" + workflowExecutionStatus.getExecutionStatus().toString()+"</i>";
+				if (workflowExecutionStatus.getStatusUpdateTime()!=null) {
+						caption += "<i> as of " + workflowExecutionStatus.getStatusUpdateTime().toString() + "</i>";
+				}
+			}
+		} catch (AiravataAPIInvocationException e) {
+			e.printStackTrace();
+		}
+		return wrapAsHtml(caption);
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.WORKFLOW_EXPERIMENT_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(CopyAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(CopyAction.ID)) {
+            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getExperimentInfo()), null);
+        }
+        return super.triggerAction(tree, action);
+    }
+
+    private String getExperimentName (){
+        String experimentId = getExperiment().getExperimentId();
+        try {
+            ExperimentName experimentName = getExperiment().getAiravataAPI().getProvenanceManager().getExperimentName(experimentId);
+            return experimentName.getInstanceName();
+        } catch (AiravataAPIInvocationException e) {
+            return null;
+        }
+    }
+
+    private String getExperimentInfo (){
+        String experimetName = getExperimentName();
+        String experimetID = getExperiment().getExperimentId();
+        return "[Experiment Name = " + experimetName + ", Experiment ID = " + experimetID + "]";
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(CopyAction.ID)) {
+            return "Copy Experiment Info to clipboard";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public XBayaWorkflowExperiment getExperiment() {
+		return experiment;
+	}
+
+	public void setExperiment(XBayaWorkflowExperiment experiment) {
+		this.experiment = experiment;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentsNode.java
new file mode 100644
index 0000000..420dea3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentsNode.java
@@ -0,0 +1,89 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiments;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+
+public class XBayaWorkflowExperimentsNode extends AbstractAiravataTreeNode {
+	private XBayaWorkflowExperiments experiments;
+	
+    public XBayaWorkflowExperimentsNode(XBayaWorkflowExperiments experiments, TreeNode parent) {
+        super(parent);
+        setExperiments(experiments);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return getTreeNodeList(getExperiments().getAllExperiments().toArray(), this);
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return "Experiments";
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.WORKFLOW_EXPERIMENTS_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(RefreshAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        return super.triggerAction(tree, action);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public XBayaWorkflowExperiments getExperiments() {
+		return experiments;
+	}
+
+	public void setExperiments(XBayaWorkflowExperiments experiments) {
+		this.experiments = experiments;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNode.java
new file mode 100644
index 0000000..1d38b80
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNode.java
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.awt.*;
+import java.awt.datatransfer.StringSelection;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflow;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
+
+public class XBayaWorkflowNode extends AbstractAiravataTreeNode {
+    private XBayaWorkflow xbayaWorkflow;
+
+    public XBayaWorkflowNode(XBayaWorkflow xbayaWorkflow, TreeNode parent) {
+        super(parent);
+        setXbayaWorkflow(xbayaWorkflow);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return getTreeNodeList(getXbayaWorkflow().getWorkflowServices().toArray(),this);
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+    	String caption=getXbayaWorkflow().getWorkflowId();
+    	if (getXbayaWorkflow().getWorkflowName()!=null){
+    		caption=getXbayaWorkflow().getWorkflowName()+" : "+caption;
+    	}
+        return caption;
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.WORKFLOW_ICON;
+    }
+
+    public XBayaWorkflow getXbayaWorkflow() {
+        return xbayaWorkflow;
+    }
+
+    public void setXbayaWorkflow(XBayaWorkflow xbayaWorkflow) {
+        this.xbayaWorkflow = xbayaWorkflow;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(CopyAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(CopyAction.ID)) {
+            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getWorkflowInfo()), null);
+        }
+        return super.triggerAction(tree, action);
+    }
+
+    private String getWorkflowInfo (){
+        String workflowName = getXbayaWorkflow().getWorkflowName();
+        String workflowId = getXbayaWorkflow().getWorkflowId();
+        return "[Worklfow Name = " + workflowName + ", Workflow Instance ID = " + workflowId + "]";
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(CopyAction.ID)) {
+            return "Copy Workflow Info to clipboard";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNodeElementNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNodeElementNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNodeElementNode.java
new file mode 100644
index 0000000..5cf32de
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNodeElementNode.java
@@ -0,0 +1,101 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.ServiceParameters;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowNodeElement;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class XBayaWorkflowNodeElementNode extends AbstractAiravataTreeNode {
+    private XBayaWorkflowNodeElement xbayaWorkflowService;
+
+    public XBayaWorkflowNodeElementNode(XBayaWorkflowNodeElement xbayaWorkflowNodeElement, TreeNode parent) {
+        super(parent);
+        setXbayaWorkflowNodeElement(xbayaWorkflowNodeElement);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+		List<ServiceParameters> parameterTypeList=new ArrayList<ServiceParameters>();
+		if (getXbayaWorkflowNodeElement().getInputParameters()!=null && getXbayaWorkflowNodeElement().getInputParameters().getParameters().size()>0){
+			parameterTypeList.add(getXbayaWorkflowNodeElement().getInputParameters());
+		}
+		if (getXbayaWorkflowNodeElement().getOutputParameters()!=null && getXbayaWorkflowNodeElement().getOutputParameters().getParameters().size()>0){
+			parameterTypeList.add(getXbayaWorkflowNodeElement().getOutputParameters());
+		}
+		return getTreeNodeList(parameterTypeList.toArray(), this);
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        String type = getXbayaWorkflowNodeElement().getNodeData().getType().toString();
+//        if (selected) {
+//			type = " <font color=\"#D3D3D3\">Service call</font>";
+//		}
+		return wrapAsHtml(getXbayaWorkflowNodeElement().getNodeId()," [", type, "]");
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.WORKFLOW_SERVICE_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList();
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        return super.triggerAction(tree, action);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public XBayaWorkflowNodeElement getXbayaWorkflowNodeElement() {
+		return xbayaWorkflowService;
+	}
+
+	public void setXbayaWorkflowNodeElement(XBayaWorkflowNodeElement xbayaWorkflowNodeElement) {
+		this.xbayaWorkflowService = xbayaWorkflowNodeElement;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplateNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplateNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplateNode.java
new file mode 100644
index 0000000..0edc847
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplateNode.java
@@ -0,0 +1,130 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.jcr.PathNotFoundException;
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.registry.api.exception.ServiceDescriptionRetrieveException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplate;
+import org.apache.airavata.xbaya.registry.RegistryAccesser;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.ImportAction;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+
+public class XBayaWorkflowTemplateNode extends AbstractAiravataTreeNode {
+    private XBayaWorkflowTemplate xbayaWorkflow;
+
+    public XBayaWorkflowTemplateNode(XBayaWorkflowTemplate xbayaWorkflow, TreeNode parent) {
+        super(parent);
+        setXbayaWorkflow(xbayaWorkflow);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return emptyList();
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return getXbayaWorkflow().getWorkflowName();
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.WORKFLOW_TEMPLATE_ICON;
+    }
+
+    public XBayaWorkflowTemplate getXbayaWorkflow() {
+        return xbayaWorkflow;
+    }
+
+    public void setXbayaWorkflow(XBayaWorkflowTemplate xbayaWorkflow) {
+        this.xbayaWorkflow = xbayaWorkflow;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(ImportAction.ID,DeleteAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(DeleteAction.ID)) {
+            deleteHostDescription(tree);
+            return true;
+        } else if (action.equals(ImportAction.ID)) {
+        	Workflow workflow = new RegistryAccesser(getXBayaEngine()).getWorkflow(getXbayaWorkflow().getWorkflowName());
+            GraphCanvas newGraphCanvas = getXBayaEngine().getGUI().newGraphCanvas(true);
+            newGraphCanvas.setWorkflow(workflow);
+            getXBayaEngine().getGUI().getGraphCanvas().setWorkflowFile(null);
+            return true;
+        }
+        return super.triggerAction(tree, action);
+    }
+
+    private void deleteHostDescription(JTree tree) throws PathNotFoundException, ServiceDescriptionRetrieveException {
+        if (askQuestion("XBaya Workflow", "Are you sure that you want to remove the workflow \""
+                + getXbayaWorkflow().getWorkflowName() + "\"?")) {
+            try {
+				getRegistry().getWorkflowManager().removeWorkflow(getXbayaWorkflow().getWorkflowName());
+				((AbstractAiravataTreeNode) getParent()).refresh();
+				reloadTreeNode(tree, getParent());
+			} catch (AiravataAPIInvocationException e) {
+				e.printStackTrace();
+			}
+        }
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(DeleteAction.ID)) {
+            return "Remove";
+        } else if (action.getID().equals(ImportAction.ID)) {
+            return "Import";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+    
+    @Override
+    public String getDefaultAction() {
+    	return ImportAction.ID;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplatesNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplatesNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplatesNode.java
new file mode 100644
index 0000000..f3b0c43
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplatesNode.java
@@ -0,0 +1,99 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JOptionPane;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplates;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+
+public class XBayaWorkflowTemplatesNode extends AbstractAiravataTreeNode {
+    private XBayaWorkflowTemplates xbayaWorkflows;
+
+    public XBayaWorkflowTemplatesNode(XBayaWorkflowTemplates xbayaWorkflows, TreeNode parent) {
+        super(parent);
+        setXbayaWorkflows(xbayaWorkflows);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return getTreeNodeList(getXbayaWorkflows().getWorkflows().toArray(), this);
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return "Workflow Templates";
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.WORKFLOW_TEMPLATES_ICON;
+    }
+
+    public XBayaWorkflowTemplates getXbayaWorkflows() {
+        return xbayaWorkflows;
+    }
+
+    public void setXbayaWorkflows(XBayaWorkflowTemplates xbayaWorkflows) {
+        this.xbayaWorkflows = xbayaWorkflows;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(RefreshAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(AddAction.ID)) {
+            JOptionPane.showMessageDialog(null, "TODO");
+            // TODO
+            return true;
+        }
+        return super.triggerAction(tree, action);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(AddAction.ID)) {
+            return "New workflow...";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/scufl/script/ScuflScript.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/scufl/script/ScuflScript.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/scufl/script/ScuflScript.java
new file mode 100644
index 0000000..27442e4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/scufl/script/ScuflScript.java
@@ -0,0 +1,539 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.scufl.script;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
+import org.apache.airavata.workflow.model.graph.system.ConstantNode;
+import org.apache.airavata.workflow.model.graph.system.EndifNode;
+import org.apache.airavata.workflow.model.graph.system.IfNode;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.MemoNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.xmlpull.infoset.impl.XmlElementWithViewsImpl;
+import org.xmlpull.v1.builder.XmlBuilderException;
+import org.xmlpull.v1.builder.XmlDocument;
+import org.xmlpull.v1.builder.XmlElement;
+import org.xmlpull.v1.builder.XmlInfosetBuilder;
+import org.xmlpull.v1.builder.XmlNamespace;
+
+import xsul.XmlConstants;
+import xsul5.wsdl.WsdlMessage;
+import xsul5.wsdl.WsdlMessagePart;
+import xsul5.wsdl.WsdlPort;
+import xsul5.wsdl.WsdlPortType;
+import xsul5.wsdl.WsdlPortTypeOperation;
+import xsul5.wsdl.WsdlService;
+
+public class ScuflScript {
+
+    private Workflow workflow;
+
+    private XBayaConfiguration configuration;
+
+    private WSGraph graph;
+
+    private ArrayList<String> arguments;
+
+    private List<InputNode> inputNodes;
+
+    private List<OutputNode> outputNodes;
+
+    private XmlInfosetBuilder builder = XmlConstants.BUILDER;
+
+    private LinkedList<Node> notYetInvokedNodes;
+
+    private LinkedList<Node> executingNodes;
+
+    private XmlNamespace scuflNS = builder.newNamespace("s", "http://org.embl.ebi.escience/xscufl/0.1alpha");
+
+    private Map<String, XmlElement> sources = new HashMap<String, XmlElement>();
+
+    private List<XmlElement> links = new ArrayList<XmlElement>();
+
+    private List<XmlElement> sinks = new ArrayList<XmlElement>();
+
+    private XmlDocument script;
+
+    public ScuflScript(Workflow workflow, XBayaConfiguration configuration) {
+        this.workflow = workflow;
+        this.configuration = configuration;
+        this.graph = this.workflow.getGraph();
+
+        this.arguments = new ArrayList<String>();
+
+        this.notYetInvokedNodes = new LinkedList<Node>();
+        for (Node node : this.graph.getNodes()) {
+            if (!(node instanceof MemoNode)) {
+                this.notYetInvokedNodes.add(node);
+            }
+        }
+        this.executingNodes = new LinkedList<Node>();
+        this.inputNodes = GraphUtil.getInputNodes(this.graph);
+        this.outputNodes = GraphUtil.getOutputNodes(this.graph);
+    }
+
+    public void create() throws GraphException {
+
+        XmlDocument doc = builder.newDocument();
+
+        XmlElement scufl = doc.addDocumentElement(scuflNS, "scufl");
+        scufl.addAttribute("version", "0.2");
+        scufl.addAttribute("log", "0");
+        XmlElement description = scufl.addElement(scuflNS, "workflowdescription");
+        description.addAttribute("lsid", "urn:lsid:net.sf.taverna:wfDefinition:" + UUID.randomUUID());
+        description.addAttribute("author", "");
+        description.addAttribute("title", workflow.getName());
+        writeServices(scufl);
+
+        writeSplitors(scufl);
+
+        // add links
+        for (XmlElement link : this.links) {
+            scufl.addElement(link);
+        }
+
+        // add source
+        for (String key : this.sources.keySet()) {
+            scufl.addElement(this.sources.get(key));
+        }
+
+        // add sinks
+        for (XmlElement sink : this.sinks) {
+            scufl.addElement(sink);
+        }
+
+        this.script = doc;
+
+    }
+
+    public String getScript() {
+        return builder.serializeToString(this.script);
+    }
+
+    /**
+     * @param scufl
+     * @throws GraphException
+     */
+    private void writeSplitors(XmlElement scufl) throws GraphException {
+
+        Collection<Node> nextNodes = getNextNodes();
+        while (nextNodes.size() > 0) {
+            for (Node node : nextNodes) {
+
+                if (node instanceof WSNode) {
+                    WSNode wsNode = (WSNode) node;
+                    node.getInputPorts();
+                    writeSplitorPerService(scufl, wsNode);
+
+                } else {
+                    // TODO conditions, loops might come here.
+                }
+                this.notYetInvokedNodes.remove(node);
+                nextNodes = getNextNodes();
+            }
+        }
+    }
+
+    /**
+     * @param scufl
+     * @param node
+     * @throws GraphException
+     */
+    private void writeSplitorPerService(XmlElement scufl, WSNode node) throws GraphException {
+        List<DataPort> inputPorts = node.getInputPorts();
+        XmlElement processor = scufl.addElement(scuflNS, "processor");
+        processor.addAttribute("name", getValidName(node) + "InputMessagePartXML");
+        XmlElement local = processor.addElement(scuflNS, "local");
+        local.addChild(0, "org.embl.ebi.escience.scuflworkers.java.XMLInputSplitter");
+        XmlElement extensions = local.addElement(scuflNS, "extensions");
+
+        QName inputName = getInputElementName(node);
+        if (null == inputName) {
+            throw new GraphException("No Valid input type found for WS Node" + node.getName());
+        }
+        if (node.getOutputPorts().size() != 1) {
+            throw new GraphException("Number of out ports in WS node " + node.getName() + "is invalid:"
+                    + node.getOutputPorts().size());
+        }
+        DataPort outputPort = node.getOutputPort(0);
+
+        WSComponent component = node.getComponent();
+        String inputPartName = component.getInputPartName();
+        String inputTypeName = component.getInputTypeName();
+
+        XmlElement complexType = extensions.addElement(scuflNS, "complextype");
+        complexType.addAttribute("optional", "false");
+        complexType.addAttribute("unbounded", "false");
+        complexType.addAttribute("typename", inputTypeName);
+
+        String spliterName = inputPartName;
+        complexType.addAttribute("name", spliterName);
+        complexType.addAttribute("qname", inputName.toString());
+
+        XmlElement element = complexType.addElement(scuflNS, "elements");
+        for (DataPort port : inputPorts) {
+            if ("http://www.w3.org/2001/XMLSchema".equals(port.getType().getNamespaceURI())) {
+                XmlElement baseType = element.addElement(scuflNS, "basetype");
+                baseType.addAttribute("optional", "false");
+                baseType.addAttribute("unbounded", "false");
+                baseType.addAttribute("typename", port.getType().getLocalPart());
+                baseType.addAttribute("name", port.getName());
+                baseType.addAttribute("qname", inputTypeName + "&gt;" + port.getName());
+
+            }
+            // all the sources are written here
+            // the links from input nodes to the spiters are done here
+            // links from the from node output splitter to the this service's
+            // inputsplitter is done here
+
+            if (port.getFromNode() instanceof InputNode) {
+                XmlElement source = builder.newFragment(scuflNS, "source");
+                source.addAttribute("name", port.getFromNode().getID());
+                if (!sourceExist(port.getFromNode().getID())) {
+                    this.sources.put(port.getFromNode().getID(), source);
+                }
+                XmlElement link = builder.newFragment(scuflNS, "link");
+                link.addAttribute("source", port.getFromNode().getID());
+                link.addAttribute("sink", getValidName(node) + "InputMessagePartXML:" + port.getName());
+                this.links.add(link);
+
+            } else if (port.getFromNode() instanceof WSNode) {
+                XmlElement link = builder.newFragment(scuflNS, "link");
+                if (port.getFromNode().getOutputPorts().size() != 1) {
+                    throw new GraphException("Number of out ports in from WS node " + port.getFromNode().getName()
+                            + "is invalid:" + node.getOutputPorts().size());
+                }
+                link.addAttribute("source", getValidName((WSNode) port.getFromNode()) + "OutputMessagePartXML:"
+                        + port.getFromNode().getOutputPort(0).getName());
+                link.addAttribute("sink", getValidName(node) + "InputMessagePartXML:" + port.getName());
+                this.links.add(link);
+            } else {
+                throw new GraphException("Unhandled from node type:" + port.getFromNode() + " for node"
+                        + node.getName());
+            }
+        }
+
+        // link from the spliter to the service
+
+        XmlElement link = builder.newFragment(scuflNS, "link");
+        link.addAttribute("source", getValidName(node) + "InputMessagePartXML:output");
+        link.addAttribute("sink", getValidName(node) + ":" + spliterName);
+        this.links.add(link);
+
+        // link from service out to the ouput spliter
+
+        link = builder.newFragment(scuflNS, "link");
+        link.addAttribute("source", getValidName(node) + ":" + node.getComponent().getOutputPartName());
+        link.addAttribute("sink", getValidName(node) + "OutputMessagePartXML:input");
+        this.links.add(link);
+
+        // /outspiltor
+        XmlElement outProcessor = scufl.addElement(scuflNS, "processor");
+        outProcessor.addAttribute("name", getValidName(node) + "OutputMessagePartXML");
+        XmlElement outLocal = outProcessor.addElement(scuflNS, "local");
+        outLocal.addChild(0, "org.embl.ebi.escience.scuflworkers.java.XMLOutputSplitter");
+        XmlElement outExtensions = outLocal.addElement(scuflNS, "extensions");
+        XmlElement outComplextype = outExtensions.addElement(scuflNS, "complextype");
+        outComplextype.addAttribute("optional", "false");
+        outComplextype.addAttribute("unbounded", "false");
+        outComplextype.addAttribute("typename", component.getOutputTypeName());
+        outComplextype.addAttribute("name", component.getOutputPartName());
+        QName outputName = getOutputElementName(node);
+        if (null == outputName) {
+            throw new GraphException("No Valid output type found for WS Node" + node.getName());
+        }
+        outComplextype.addAttribute("qname", outputName.toString());
+        XmlElement elements = outComplextype.addElement(scuflNS, "elements");
+        XmlElement outBaseType = elements.addElement(scuflNS, "basetype");
+        outBaseType.addAttribute("optional", "false");
+        outBaseType.addAttribute("unbounded", "false");
+
+        outBaseType.addAttribute("typename", outputPort.getType().getLocalPart());
+        String Z = component.getOutputPort(0).getName();
+        outBaseType.addAttribute("name", Z);
+
+        outBaseType.addAttribute("qname", component.getOutputTypeName() + "&gt;" + Z);
+
+        List<DataPort> outputPorts = node.getOutputPorts();
+        for (DataPort port : outputPorts) {
+            List<Node> toNodes = port.getToNodes();
+            for (Node toNode : toNodes) {
+                if (toNode instanceof OutputNode) {
+                    if ("http://www.w3.org/2001/XMLSchema".equals(port.getType().getNamespaceURI())) {
+                        XmlElement sink = builder.newFragment(scuflNS, "sink");
+                        sink.addAttribute("name", toNode.getID());
+                        sinks.add(sink);
+                        link = builder.newFragment(scuflNS, "link");
+                        link.addAttribute("source", getValidName(node) + "OutputMessagePartXML:" + outputPort.getName());
+                        link.addAttribute("sink", toNode.getID());
+                        this.links.add(link);
+                    }
+                }
+            }
+        }
+
+    }
+
+    private boolean sourceExist(String name) {
+        Set<String> keys = this.sources.keySet();
+        for (String string : keys) {
+            if (name.equals(string))
+                return true;
+        }
+        return false;
+    }
+
+    /**
+     * @param node
+     * @return
+     * @throws GraphException
+     */
+    private QName getInputElementName(WSNode node) throws GraphException {
+        WSComponent component = node.getComponent();
+        String portTypeName = component.getPortTypeQName().getLocalPart();
+        WsdlPortType portType = component.getWSDL().getPortType(portTypeName);
+        WsdlPortTypeOperation operation = portType.getOperation(component.getOperationName());
+        QName message = operation.getInput().getMessage();
+        WsdlMessage wsdlMessage = component.getWSDL().getMessage(message.getLocalPart());
+        Iterator<WsdlMessagePart> iterator = wsdlMessage.parts().iterator();
+        QName inputName = null;
+        if (iterator.hasNext()) {
+            inputName = iterator.next().getElement();
+        } else {
+            throw new GraphException("No input part found for WS Node" + node.getName());
+        }
+        return inputName;
+    }
+
+    private QName getOutputElementName(WSNode node) throws GraphException {
+        WSComponent component = node.getComponent();
+        String portTypeName = component.getPortTypeQName().getLocalPart();
+        WsdlPortType portType = component.getWSDL().getPortType(portTypeName);
+        WsdlPortTypeOperation operation = portType.getOperation(component.getOperationName());
+        QName message = operation.getOutput().getMessage();
+        WsdlMessage wsdlMessage = component.getWSDL().getMessage(message.getLocalPart());
+        Iterator<WsdlMessagePart> iterator = wsdlMessage.parts().iterator();
+        QName inputName = null;
+        if (iterator.hasNext()) {
+            inputName = iterator.next().getElement();
+        } else {
+            throw new GraphException("No output part found for WS Node" + node.getName());
+        }
+        return inputName;
+    }
+
+    private void writeServices(XmlElement scufl) throws GraphException {
+
+        Collection<NodeImpl> nextNodes = this.graph.getNodes();
+        for (NodeImpl node : nextNodes) {
+            if (node instanceof WSNode) {
+                WSNode wsNode = (WSNode) node;
+                createWSProcess(wsNode, scufl);
+            }
+        }
+    }
+
+    private XmlElement createWSProcess(WSNode node, XmlElement scufl) throws GraphException, XmlBuilderException {
+
+        XmlElement processor = scufl.addElement(scuflNS, "processor");
+        String name = getValidName(node);
+        processor.addAttribute("name", name);
+        XmlElement description = processor.addElement(scuflNS, "description");
+        String txt = node.getComponent().getDescription();
+        if (null == txt) {
+            description.addChild(name);
+        } else {
+            description.addChild(txt);
+        }
+
+        XmlElement arbitrarywsdl = processor.addElement(scuflNS, "arbitrarywsdl");
+        XmlElement wsdl = arbitrarywsdl.addElement(scuflNS, "wsdl");
+
+        String epr = getEPR(node);
+        if (null == epr) {
+            throw new GraphException("EPR not found for the WS-node:" + builder.serializeToString(node));
+        }
+        wsdl.addChild(epr + "?wsdl");
+
+        XmlElement operation = arbitrarywsdl.addElement(scuflNS, "operation");
+        operation.addChild(node.getOperationName());
+
+        return processor;
+
+    }
+
+    /**
+     * @param node
+     * @return
+     */
+    private String getValidName(WSNode node) {
+        return node.getID();
+        // String name = node.getName();
+        // if (name.indexOf(":") != -1) {
+        // name = name.substring(0, name.indexOf(":"));
+        // }
+        // return name;
+    }
+
+    /**
+     * @param wsNode
+     */
+    private String getEPR(WSNode wsNode) {
+        Iterable<WsdlService> services = wsNode.getComponent().getWSDL().services();
+        Iterator<WsdlService> iterator = services.iterator();
+        if (iterator.hasNext()) {
+            Iterable<WsdlPort> ports = iterator.next().ports();
+            Iterator<WsdlPort> portIterator = ports.iterator();
+            if (portIterator.hasNext()) {
+                WsdlPort port = portIterator.next();
+                Iterable children = port.xml().children();
+                Iterator childIterator = children.iterator();
+                while (childIterator.hasNext()) {
+                    Object next = childIterator.next();
+                    if (next instanceof XmlElementWithViewsImpl) {
+                        org.xmlpull.infoset.XmlAttribute epr = ((XmlElementWithViewsImpl) next).attribute("location");
+                        return epr.getValue();
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    public boolean validate(List<String> warnings) {
+        // Empty
+        if (this.graph.getNodes().size() == 0) {
+            String message = "The workflow is empty.";
+            warnings.add(message);
+        }
+
+        // Input ports need to be connected.
+        Collection<Port> inputPorts = GraphUtil.getPorts(this.graph, Port.Kind.DATA_IN);
+        for (Port inputPort : inputPorts) {
+            Collection<Port> fromPorts = inputPort.getFromPorts();
+            if (fromPorts.size() == 0) {
+                Node node = inputPort.getNode();
+                String message = node.getID() + " has an unconnected input " + inputPort.getName();
+                warnings.add(message);
+            }
+        }
+
+        // Input nodes need to be connected.
+        for (InputNode inputNode : this.inputNodes) {
+            if (inputNode.getPort().getToPorts().size() == 0) {
+                String message = inputNode.getID() + " is not connected to any service.";
+                warnings.add(message);
+            }
+        }
+
+        // Cycle
+        if (GraphUtil.containsCycle(this.graph)) {
+            String message = "There is a cycle in the workflow.";
+            warnings.add(message);
+        }
+
+        // Constants are not supported.
+        List<ConstantNode> constantNodes = GraphUtil.getNodes(this.graph, ConstantNode.class);
+        if (constantNodes.size() > 0) {
+            String message = "Constants are not supported for Scufl scripts.";
+            warnings.add(message);
+        }
+
+        // If/endif are not supported.
+        List<IfNode> ifNodes = GraphUtil.getNodes(this.graph, IfNode.class);
+        List<EndifNode> endifNodes = GraphUtil.getNodes(this.graph, EndifNode.class);
+        if (ifNodes.size() > 0 || endifNodes.size() > 0) {
+            String message = "If/endif are not supported for Scufl scripts.";
+            warnings.add(message);
+        }
+
+        if (warnings.size() > 0) {
+            return false;
+        } else {
+            // No error.
+            return true;
+        }
+    }
+
+    private Collection<Node> getNextNodes() throws GraphException {
+        Collection<Node> nextNodes = new ArrayList<Node>();
+        for (Node node : this.notYetInvokedNodes) {
+            if (isNextNode(node)) {
+                nextNodes.add(node);
+            }
+        }
+        return nextNodes;
+    }
+
+    private boolean isNextNode(Node node) throws GraphException {
+        if (node instanceof OutputNode) {
+            return false;
+        }
+        for (Port port : node.getInputPorts()) {
+            Collection<Node> fromNodes = port.getFromNodes();
+            if (fromNodes.isEmpty()) {
+                throw new GraphException("There is a port that is not connected to any.");
+            } else {
+                for (Node fromNode : fromNodes) {
+                    if (this.notYetInvokedNodes.contains(fromNode)) {
+                        // There is a node that should be executed before this
+                        // node.
+                        return false;
+                    }
+                }
+            }
+        }
+        Port port = node.getControlInPort();
+        if (port != null) {
+            Collection<Node> fromNodes = port.getFromNodes();
+            for (Node fromNode : fromNodes) {
+                if (this.notYetInvokedNodes.contains(fromNode)) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BPELScriptTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BPELScriptTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BPELScriptTestCase.java
new file mode 100644
index 0000000..bcfb604
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BPELScriptTestCase.java
@@ -0,0 +1,209 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.airavata.common.utils.IOUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.gpel.script.BPELScript;
+import org.apache.airavata.workflow.model.gpel.script.BPELScriptType;
+import org.apache.airavata.workflow.model.gpel.script.WorkflowWSDL;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+import org.gpel.model.GpelProcess;
+import org.xmlpull.infoset.XmlElement;
+
+import xsul5.wsdl.WsdlDefinitions;
+
+public class BPELScriptTestCase extends XBayaTestCase {
+
+    // private static final Logger logger = LoggerFactory.getLogger();
+
+    private WorkflowCreator workflowCreator;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        this.workflowCreator = new WorkflowCreator();
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws IOException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public void testSimpleMath() throws ComponentException, IOException, GraphException, ComponentRegistryException {
+        Workflow workflow = this.workflowCreator.createSimpleMathWorkflow();
+        testWrokflow(workflow, "simple-math");
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws IOException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public void testMath() throws ComponentException, IOException, GraphException, ComponentRegistryException {
+        Workflow workflow = this.workflowCreator.createMathWorkflow();
+        testWrokflow(workflow, "math");
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws IOException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public void testComplexMath() throws ComponentException, IOException, GraphException, ComponentRegistryException {
+        Workflow workflow = this.workflowCreator.createComplexMathWorkflow();
+        testWrokflow(workflow, "complex-math");
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws IOException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public void testMathWithConstant() throws ComponentException, IOException, GraphException,
+            ComponentRegistryException {
+        Workflow workflow = this.workflowCreator.createMathWithConstWorkflow();
+        testWrokflow(workflow, "constant-test");
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testArray() throws ComponentException, GraphException, IOException, ComponentRegistryException {
+        Workflow workflow = this.workflowCreator.createArrayWorkflow();
+        testWrokflow(workflow, "array-test");
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testForEach() throws ComponentException, GraphException, IOException, ComponentRegistryException {
+        Workflow workflow = this.workflowCreator.createForEachWorkflow();
+        testWrokflow(workflow, "foreach-test");
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testIf() throws ComponentException, GraphException, IOException, ComponentRegistryException {
+        Workflow workflow = this.workflowCreator.createIfWorkflow();
+        testWrokflow(workflow, "if-test");
+    }
+
+    /**
+     * @throws GraphException
+     * @throws ComponentException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testReceive() throws GraphException, ComponentException, IOException, ComponentRegistryException {
+        Workflow workflow = this.workflowCreator.createReceiveWorkflow();
+        testWrokflow(workflow, "receive-test");
+    }
+
+    /**
+     * @throws GraphException
+     * @throws ComponentException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testLoan() throws GraphException, ComponentException, IOException, ComponentRegistryException {
+        Workflow workflow = this.workflowCreator.createLoanWorkflow();
+        testWrokflow(workflow, "loan");
+    }
+
+    private void testWrokflow(Workflow workflow, String filename) throws GraphException, IOException,
+            ComponentException {
+
+        // This one is for debuggin in case something below fails.
+        XMLUtil.saveXML(workflow.toXML(), new File(this.temporalDirectory, filename + "-0.xwf"));
+
+        // Create BPEL
+        BPELScript bpel = new BPELScript(workflow);
+        bpel.create(BPELScriptType.GPEL);
+        GpelProcess gpelProcess = bpel.getGpelProcess();
+        WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL();
+        WsdlDefinitions definitions = workflowWSDL.getWsdlDefinitions();
+
+        File bpelFile = new File(this.temporalDirectory, filename + XBayaConstants.BPEL_SUFFIX);
+        File wsdlFile = new File(this.temporalDirectory, filename + XBayaConstants.WSDL_SUFFIX);
+        XMLUtil.saveXML(gpelProcess.xml(), bpelFile);
+        XMLUtil.saveXML(definitions.xml(), wsdlFile);
+
+        // Save the workflow
+        File workflowFile = new File(this.temporalDirectory, filename + XBayaConstants.WORKFLOW_FILE_SUFFIX);
+        XMLUtil.saveXML(workflow.toXML(), workflowFile);
+
+        // Read the workflow
+        XmlElement workflowElement = XMLUtil.loadXML(workflowFile);
+        workflow = new Workflow(workflowElement);
+
+        // Create BPEL again
+        bpel = new BPELScript(workflow);
+        bpel.create(BPELScriptType.GPEL);
+        gpelProcess = bpel.getGpelProcess();
+        workflowWSDL = bpel.getWorkflowWSDL();
+        definitions = workflowWSDL.getWsdlDefinitions();
+
+        File bpelFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.BPEL_SUFFIX);
+        File wsdlFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.WSDL_SUFFIX);
+        XMLUtil.saveXML(gpelProcess.xml(), bpelFile2);
+        XMLUtil.saveXML(definitions.xml(), wsdlFile2);
+
+        File workflowFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.WORKFLOW_FILE_SUFFIX);
+        XMLUtil.saveXML(workflow.toXML(), workflowFile2);
+
+        // Compare
+        String workflowString = IOUtil.readFileToString(workflowFile);
+        String workflowString2 = IOUtil.readFileToString(workflowFile2);
+        assertEquals(workflowString, workflowString2);
+
+        String bpelString = IOUtil.readFileToString(bpelFile);
+        String bpelString2 = IOUtil.readFileToString(bpelFile2);
+        assertEquals(bpelString, bpelString2);
+
+        String wsdlString = IOUtil.readFileToString(wsdlFile);
+        String wsdlString2 = IOUtil.readFileToString(wsdlFile2);
+        assertEquals(wsdlString, wsdlString2);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BrowserTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BrowserTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BrowserTestCase.java
new file mode 100644
index 0000000..3d68557
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BrowserTestCase.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.common.utils.BrowserLauncher;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+
+public class BrowserTestCase extends TestCase {
+
+    /**
+     * @throws WorkflowException
+     * 
+     */
+    public void testBrowserLauncher() throws Exception {
+        BrowserLauncher.openURL("http://www.google.com");
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCTestCase.java
new file mode 100644
index 0000000..e6ae107
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCTestCase.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestSuite;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.gpel.DSCUtil;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.lead.LeadContextHeader;
+import xsul.util.XsulUtil;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xwsif_runtime.WSIFClient;
+import xsul.xwsif_runtime.WSIFRuntime;
+import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
+import xsul.xwsif_runtime_async_http.XsulSoapHttpWsaResponsesCorrelator;
+import xsul5.wsdl.WsdlDefinitions;
+import xsul5.wsdl.WsdlException;
+import xsul5.wsdl.WsdlResolver;
+
+public class DSCTestCase extends XBayaTestCase {
+
+    private static final String SAMPLE_AWSDL = XBayaPathConstants.WSDL_DIRECTORY + "/test/TestCMD_Example1_AWSDL.xml";
+
+    private static final Logger logger = LoggerFactory.getLogger(DSCTestCase.class);
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        junit.textui.TestRunner.run(new TestSuite(DSCTestCase.class));
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.test.XBayaTestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    /**
+     * @throws WsdlException
+     */
+    public void test() throws WsdlException {
+        WsdlDefinitions definitions = WsdlResolver.getInstance().loadWsdl(new File(".").toURI(),
+                new File(SAMPLE_AWSDL).toURI());
+        URI dscURL = this.configuration.getDSCURL();
+        logger.info("dscURL: " + dscURL);
+        DSCUtil.convertToCWSDL(definitions, dscURL);
+
+        logger.info(definitions.xmlStringPretty());
+
+        // client
+        int clientPort = 0;
+        WSIFAsyncResponsesCorrelator correlator = new XsulSoapHttpWsaResponsesCorrelator(clientPort);
+        String serverLoc = ((XsulSoapHttpWsaResponsesCorrelator) correlator).getServerLocation();
+        logger.info("client is waiting at " + serverLoc);
+
+        // LEAD Context Header
+        // Create lead context.
+        LeadContextHeaderHelper leadContextHelper = new LeadContextHeaderHelper();
+        leadContextHelper.setXBayaConfiguration(this.configuration);
+        LeadContextHeader leadContext = leadContextHelper.getLeadContextHeader();
+        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
+        leadContext.setNodeId("decoder1");
+        leadContext.setTimeStep("5");
+        leadContext.setServiceInstanceId(URI.create("decoder-instance-10"));
+
+        XmlElement element3 = XMLUtil.xmlElement5ToXmlElement3(definitions.xml());
+        xsul.wsdl.WsdlDefinitions definitions3 = new xsul.wsdl.WsdlDefinitions(element3);
+
+        WSIFClient wclient = WSIFRuntime.getDefault().newClientFor(definitions3, "TestCMD_Example1SoapPort");
+        StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-lead-header", leadContext);
+
+        wclient.addHandler(handler);
+        wclient.useAsyncMessaging(correlator);
+        wclient.setAsyncResponseTimeoutInMs(33000L);
+
+        WSIFPort port = wclient.getPort();
+        WSIFOperation operation = port.createOperation("Run");
+        WSIFMessage inputMessage = operation.createInputMessage();
+        WSIFMessage outputMessage = operation.createOutputMessage();
+        WSIFMessage faultMessage = operation.createFaultMessage();
+
+        // inputMessage.setObjectPart("InputParam1", "Hello");
+        inputMessage.setObjectPart("InputParam1", "100");
+
+        logger.info("inputMessage: " + XsulUtil.safeXmlToString((XmlElement) inputMessage));
+        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
+
+        XmlElement result;
+        if (success) {
+            result = (XmlElement) outputMessage;
+        } else {
+            result = (XmlElement) faultMessage;
+        }
+        logger.info("result:\n" + XsulUtil.safeXmlToString(result));
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCUtilTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCUtilTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCUtilTestCase.java
new file mode 100644
index 0000000..866aa6a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCUtilTestCase.java
@@ -0,0 +1,79 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.io.File;
+
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.gpel.DSCUtil;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul5.wsdl.WsdlDefinitions;
+import xsul5.wsdl.WsdlException;
+import xsul5.wsdl.WsdlResolver;
+
+public class DSCUtilTestCase extends XBayaTestCase {
+
+    private static final String SAMPLE_AWSDL = XBayaPathConstants.WSDL_DIRECTORY + "/test/adder-awsdl.xml";
+
+    private static final String WSDL_WITH_MULTIPLE_PORT_TYPES = XBayaPathConstants.BPEL_SCRIPT_DIRECTORY
+            + File.separator + "receive-test-wsdl.xml";
+
+    private static final Logger logger = LoggerFactory.getLogger(DSCUtilTestCase.class);
+
+    /**
+     * @throws WsdlException
+     */
+    public void testConvertToCWSDL() throws WsdlException {
+        WsdlDefinitions definitions = WsdlResolver.getInstance().loadWsdl(new File(".").toURI(),
+                new File(SAMPLE_AWSDL).toURI());
+        DSCUtil.convertToCWSDL(definitions, this.configuration.getDSCURL());
+        logger.info(definitions.xmlStringPretty());
+    }
+
+    /**
+     * 
+     */
+    public void testMultiplePortTypes() {
+        WsdlDefinitions definitions = WsdlResolver.getInstance().loadWsdl(new File(".").toURI(),
+                new File(WSDL_WITH_MULTIPLE_PORT_TYPES).toURI());
+        DSCUtil.convertToCWSDL(definitions, this.configuration.getDSCURL());
+        logger.info(definitions.xmlStringPretty());
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public void testConvertToCWSDLs() throws ComponentException, GraphException, ComponentRegistryException {
+        WorkflowCreator creator = new WorkflowCreator();
+        Workflow workflow = creator.createComplexMathWorkflow();
+        DSCUtil.createCWSDLs(workflow, this.configuration.getDSCURL());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java
new file mode 100644
index 0000000..1dca11e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java
@@ -0,0 +1,120 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.IOUtil;
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.invoker.GenericInvoker;
+import org.apache.airavata.xbaya.invoker.Invoker;
+import org.apache.airavata.xbaya.jython.lib.GFacServiceCreator;
+import org.apache.airavata.xbaya.jython.lib.NotificationSender;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class GFacServiceCreaterTestCase extends XBayaTestCase {
+
+    private static final String TEST_SERVICE_QNAME = "{http://www.extreme.indiana.edu/lead}TestCMD_Simple";
+
+    private static final String TEST_AWSDL = XBayaPathConstants.WSDL_DIRECTORY + File.separator
+            + WorkflowCreator.GFAC_TEST_AWSDL;
+
+    private static final Logger logger = LoggerFactory.getLogger(GFacServiceCreaterTestCase.class);
+
+    /**
+     * @throws WorkflowException
+     */
+    public void testCreate() throws WorkflowException {
+        URI gFacURL = this.configuration.getGFacURL();
+        URI gFacWSDLURL = WSDLUtil.appendWSDLQuary(gFacURL);
+        GFacServiceCreator creator = new GFacServiceCreator(gFacWSDLURL);
+        creator.createService(TEST_SERVICE_QNAME);
+        creator.shutdownService();
+    }
+
+    /**
+     * @throws WorkflowException
+     */
+    public void testService() throws WorkflowException {
+        NotificationSender notifier = new NotificationSender(this.configuration.getBrokerURL(), "test-topic2");
+        Invoker invoker = new GenericInvoker(QName.valueOf(TEST_SERVICE_QNAME), TEST_AWSDL, "test-node", null,
+                this.configuration.getGFacURL().toString(), notifier);
+        invoker.setup();
+        invoker.setOperation("Run");
+        invoker.setInput("inparam1", "test");
+        invoker.invoke();
+        Object output = invoker.getOutput("outparam1");
+        logger.info("output: " + output);
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws IOException
+     * @throws GraphException
+     * @throws InterruptedException
+     * @throws ComponentRegistryException
+     */
+    public void testWorkflow() throws ComponentException, IOException, GraphException, InterruptedException,
+            ComponentRegistryException {
+        WorkflowCreator creator = new WorkflowCreator();
+        Workflow workflow = creator.createGFacWorkflow();
+
+        File workflowFile = new File("tmp/gfac-test.xwf");
+        XMLUtil.saveXML(workflow.toXML(), workflowFile);
+
+        JythonScript script = new JythonScript(workflow, this.configuration);
+        script.create();
+        String jythonString = script.getJythonString();
+        String filename = "tmp/gfac-test.py";
+        IOUtil.writeToFile(jythonString, filename);
+
+        // String[] argv = new String[] { filename, "-TestCMD_Simple_wsdl",
+        // GFAC_TEST_WSDL };
+        // jython.main(argv);
+
+        String[] commands = new String[] { "./jython.sh", filename, "-TestCMD_Simple_wsdl", TEST_AWSDL };
+        Process process = Runtime.getRuntime().exec(commands);
+        int exitValue = process.waitFor();
+        logger.info("Exit value: " + exitValue);
+        InputStream inputStream = process.getInputStream();
+        String output = IOUtil.readToString(inputStream);
+        logger.info("output: " + output);
+        InputStream errorStream = process.getErrorStream();
+        String error = IOUtil.readToString(errorStream);
+        logger.info("error: " + error);
+    }
+}
\ No newline at end of file


[74/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/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
new file mode 100644
index 0000000..17e6620
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/script/JythonScript.java
@@ -0,0 +1,671 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.jython.script;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.system.ConstantNode;
+import org.apache.airavata.workflow.model.graph.system.EndifNode;
+import org.apache.airavata.workflow.model.graph.system.IfNode;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.MemoNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+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 {
+
+    /**
+     * GFAC_VARIABLE
+     */
+    public static final String GFAC_VARIABLE = "gfacURL";
+
+    /**
+     * BROKER_LOC_VARIABLE
+     */
+    public static final String BROKER_URL_VARIABLE = "brokerURL";
+
+    /**
+     * MESSAGE_BOX_URL_VARIABLE
+     */
+    public static final String MESSAGE_BOX_URL_VARIABLE = "msgBoxURL";
+
+    /**
+     * TOPIC_VARIABLE
+     */
+    public static final String TOPIC_VARIABLE = "topic";
+
+    private static final String INVOKER_CLASS = StringUtil.getClassName(GenericInvoker.class);
+
+    private static final String NOTIFICATION_CLASS = StringUtil.getClassName(NotificationSender.class);
+
+    private static final String WORKFLOW_STARTED_METHOD = "workflowStarted";
+
+    private static final String WORKFLOW_COMPLETED_METHOD = "workflowFinished";
+
+    private static final String WORKFLOW_INCOMPLETED_METHOD = "workflowFailed";
+
+    private static final String SETUP_METHOD = "setup";
+
+    private static final String SET_OPERATION_METHOD = "setOperation";
+
+    private static final String SET_INPUT_METHOD = "setInput";
+
+    private static final String GET_OUTPUT_METHOD = "getOutput";
+
+    private static final String WAIT_METHOD = "waitToFinish";
+
+    private static final String INVOKE_METHOD = "invoke";
+
+    private static final String GET_PROPERTY_METHOD = "getProperty";
+
+    private static final String NOTIFICATION_VARIABLE = "notifier";
+
+    private static final String PROPERTIES_VARIABLE = "properties";
+
+    private static final String INVOKER_SUFFIX = "_invoker";
+
+    private static final String QNAME_SUFFIX = "_qname";
+
+    private static final String VALUE_SUFFIX = "_value";
+
+    private static final String TAB = "    ";
+
+    /**
+     * Suffix to put after node ID to create WSDL ID.
+     */
+    private static final String WSDL_SUFFIX = "_wsdl";
+
+    private XBayaConfiguration configuration;
+
+    private Workflow workflow;
+
+    private Graph graph;
+
+    /**
+     * Collection of nodes that are not invoked yet
+     */
+    private Collection<Node> notYetInvokedNodes;
+
+    /**
+     * Collection of nodes that are executing now, and not finished yet.
+     */
+    private Collection<Node> executingNodes;
+
+    private Collection<InputNode> inputNodes;
+
+    private Collection<OutputNode> outputNodes;
+
+    /**
+     * List of command-line arguments
+     */
+    private List<String> arguments;
+
+    private String scriptString;
+
+    /**
+     * Constructs a JythonScript.
+     * 
+     * @param workflow
+     * @param configuration
+     */
+    public JythonScript(Workflow workflow, XBayaConfiguration configuration) {
+        this.workflow = workflow;
+        this.configuration = configuration;
+        this.graph = this.workflow.getGraph();
+
+        this.arguments = new ArrayList<String>();
+
+        this.notYetInvokedNodes = new LinkedList<Node>();
+        for (Node node : this.graph.getNodes()) {
+            if (!(node instanceof MemoNode)) {
+                this.notYetInvokedNodes.add(node);
+            }
+        }
+        this.executingNodes = new LinkedList<Node>();
+        this.inputNodes = GraphUtil.getInputNodes(this.graph);
+        this.outputNodes = GraphUtil.getOutputNodes(this.graph);
+    }
+
+    /**
+     * Returns the WSDL ID.
+     * 
+     * @param node
+     * 
+     * @return the WSDL ID
+     */
+    public static String getWSDLID(Node node) {
+        return node.getID() + WSDL_SUFFIX;
+    }
+
+    /**
+     * @return The Jython script string
+     */
+    public String getJythonString() {
+        return this.scriptString;
+    }
+
+    /**
+     * 
+     * @param parameters
+     * @return the jython script with prefilled argument
+     */
+    public String getJythonString(List<String> parameters) {
+        int index = this.scriptString.indexOf("# Process command-line arguments.");
+        StringBuilder builder = new StringBuilder(this.scriptString.substring(0, index));
+        builder.append("sys.argv = [");
+        for (String string : parameters) {
+            builder.append("'");
+            builder.append(string);
+            builder.append("',");
+        }
+        builder.deleteCharAt(builder.length() - 1);
+        builder.append("]");
+        builder.append("\n");
+        builder.append(this.scriptString.substring(index));
+        return builder.toString();
+    }
+
+    /**
+     * @param warnings
+     *            returns the warning messages.
+     * @return true if the workflow is valid; false otherwise.
+     */
+    public boolean validate(List<String> warnings) {
+        // Empty
+        if (this.graph.getNodes().size() == 0) {
+            String message = "The workflow is empty.";
+            warnings.add(message);
+        }
+
+        // Input ports need to be connected.
+        Collection<Port> inputPorts = GraphUtil.getPorts(this.graph, Port.Kind.DATA_IN);
+        for (Port inputPort : inputPorts) {
+            Collection<Port> fromPorts = inputPort.getFromPorts();
+            if (fromPorts.size() == 0) {
+                Node node = inputPort.getNode();
+                String message = node.getID() + " has an unconnected input " + inputPort.getName();
+                warnings.add(message);
+            }
+        }
+
+        // Input nodes need to be connected.
+        for (InputNode inputNode : this.inputNodes) {
+            if (inputNode.getPort().getToPorts().size() == 0) {
+                String message = inputNode.getID() + " is not connected to any service.";
+                warnings.add(message);
+            }
+        }
+
+        // Cycle
+        if (GraphUtil.containsCycle(this.graph)) {
+            String message = "There is a cycle in the workflow, only acyclic workflows are supported";
+            warnings.add(message);
+        }
+
+        // Constants are not supported.
+        List<ConstantNode> constantNodes = GraphUtil.getNodes(this.graph, ConstantNode.class);
+        if (constantNodes.size() > 0) {
+            String message = "Constants are not supported for Jython scripts.";
+            warnings.add(message);
+        }
+
+        // If/endif are not supported.
+        List<IfNode> ifNodes = GraphUtil.getNodes(this.graph, IfNode.class);
+        List<EndifNode> endifNodes = GraphUtil.getNodes(this.graph, EndifNode.class);
+        if (ifNodes.size() > 0 || endifNodes.size() > 0) {
+            String message = "If/endif are not supported for Jython scripts.";
+            warnings.add(message);
+        }
+
+        if (warnings.size() > 0) {
+            return false;
+        } else {
+            // No error.
+            return true;
+        }
+    }
+
+    /**
+     * @throws GraphExceptionconcreteWSDL
+     */
+    public void create() throws GraphException {
+        StringWriter stringWriter = new StringWriter();
+        PrintWriter printWriter = new PrintWriter(stringWriter);
+
+        writeHeader(printWriter);
+        writeParameters(printWriter);
+        writeWSDLLocations(printWriter);
+        writeCommandLineArguments(printWriter);
+        writeSetup(printWriter);
+        writeInvocations(printWriter);
+        writeOutputs(printWriter);
+        writeWaitAll(printWriter);
+        writeFooter(printWriter);
+
+        printWriter.close();
+        this.scriptString = stringWriter.toString();
+    }
+
+    /**
+     * @param pw
+     */
+    private void writeCommandLineArguments(PrintWriter pw) {
+        pw.println("def usage():");
+        pw.println(TAB + "print '''");
+        pw.println("Options: -help");
+        pw.println(TAB + TAB + " -f properties_file");
+        for (String argument : this.arguments) {
+            pw.println(TAB + TAB + " -" + argument + " value");
+        }
+        pw.println("'''");
+        pw.println(TAB + "sys.exit(0)");
+        pw.println();
+
+        pw.println("# Process command-line arguments.");
+        pw.println("if sys.argv[0][0] != '-':");
+        pw.println(TAB + "sys.argv = sys.argv[1:]");
+        pw.println("while sys.argv:");
+        pw.println(TAB + "if sys.argv[0] == '-f':");
+        pw.println(TAB + TAB + "# Read parameters from a file.");
+        pw.println(TAB + TAB + "propertyFilename = sys.argv[1]");
+        pw.println(TAB + TAB + "inputStream = FileInputStream(propertyFilename)");
+        pw.println(TAB + TAB + PROPERTIES_VARIABLE + ".load(inputStream)");
+
+        for (String argument : this.arguments) {
+            pw.println(TAB + "elif sys.argv[0] == '-" + argument + "':");
+            pw.println(TAB + TAB + PROPERTIES_VARIABLE + ".put('" + argument + "', sys.argv[1])");
+        }
+
+        pw.println(TAB + "else:");
+        pw.println(TAB + TAB + "usage()");
+        pw.println(TAB + "sys.argv = sys.argv[2:]");
+        pw.println();
+    }
+
+    /**
+     * Writes import statements
+     * 
+     * @param pw
+     */
+    private void writeHeader(PrintWriter pw) {
+        pw.println("#");
+        pw.println("# This script is automatically generated by " + XBayaConstants.APPLICATION_NAME + " "
+                + XBayaVersion.VERSION + ".");
+        pw.println("#");
+        pw.println();
+        pw.println("import sys, thread");
+        pw.println("from java.lang import Throwable");
+        pw.println("from java.util import Properties");
+        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();
+    }
+
+    /**
+     * Handles parameters
+     * 
+     * @param pw
+     */
+    private void writeParameters(PrintWriter pw) {
+        pw.println(PROPERTIES_VARIABLE + " = Properties()");
+        pw.println();
+        pw.println("# Set up defaut parameter values.");
+
+        writeSetProperty(BROKER_URL_VARIABLE, XBayaConstants.DEFAULT_BROKER_URL, pw);
+        writeSetProperty(MESSAGE_BOX_URL_VARIABLE, this.configuration.getMessageBoxURL(), pw);
+        writeSetProperty(TOPIC_VARIABLE, XBayaConstants.DEFAULT_TOPIC, pw);
+        writeSetProperty(GFAC_VARIABLE, this.configuration.getGFacURL(), pw);
+
+        for (InputNode paramNode : this.inputNodes) {
+            writeParameter(paramNode, pw);
+            this.notYetInvokedNodes.remove(paramNode);
+        }
+
+        pw.println();
+    }
+
+    /**
+     * @param inputNode
+     * @param pw
+     */
+    private void writeParameter(InputNode inputNode, PrintWriter pw) {
+        String id = inputNode.getID();
+        Object value = inputNode.getDefaultValue();
+        String valueString = "";
+        if (value instanceof String) {
+            valueString = (String) value;
+        }
+        writeSetProperty(id, valueString, pw);
+    }
+
+    /**
+     * @param pw
+     */
+    private void writeWSDLLocations(PrintWriter pw) {
+        pw.println("# Set up default WSDL URLs.");
+        for (WSNode node : GraphUtil.getWSNodes(this.graph)) {
+            writeWSDLLocation(node, pw);
+        }
+        pw.println();
+
+    }
+
+    /**
+     * @param node
+     * @param pw
+     */
+    private void writeWSDLLocation(WSNode node, PrintWriter pw) {
+        String defaultWsdlLocation = ""; // TODO
+        writeSetProperty(getWSDLID(node), defaultWsdlLocation, pw);
+    }
+
+    private void writeSetProperty(String name, URI uri, PrintWriter pw) {
+        writeSetProperty(name, StringUtil.toString(uri), pw);
+    }
+
+    private void writeSetProperty(String name, String value, PrintWriter pw) {
+        if (value == null) {
+            value = "";
+        }
+        pw.println(PROPERTIES_VARIABLE + ".setProperty(");
+        pw.println(TAB + TAB + "'" + name + "',");
+        pw.println(TAB + TAB + "'" + value + "')");
+
+        // This will be used to read from command-line
+        this.arguments.add(name);
+    }
+
+    /**
+     * @param pw
+     */
+    private void writeSetup(PrintWriter pw) {
+        // Initialize some variables.
+        pw.println(GFAC_VARIABLE + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + GFAC_VARIABLE
+                + "')");
+        pw.println(TOPIC_VARIABLE + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + TOPIC_VARIABLE
+                + "')");
+        pw.println(BROKER_URL_VARIABLE + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('"
+                + BROKER_URL_VARIABLE + "')");
+        pw.println(MESSAGE_BOX_URL_VARIABLE + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('"
+                + MESSAGE_BOX_URL_VARIABLE + "')");
+
+        // Initialize a notification sender.
+        pw.println(NOTIFICATION_VARIABLE + " = " + NOTIFICATION_CLASS + "(" + BROKER_URL_VARIABLE + ", "
+                + TOPIC_VARIABLE + ")");
+
+        // Send a START_WORKFLOW notification.
+        pw.println(NOTIFICATION_VARIABLE + "." + WORKFLOW_STARTED_METHOD + "(");
+        boolean first = true;
+        for (InputNode inputNode : this.inputNodes) {
+            String id = inputNode.getID();
+            if (first) {
+                first = false;
+            } else {
+                pw.println(",");
+            }
+            pw.print(TAB + id + "=" + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + id + "')");
+        }
+        pw.println(")");
+
+        pw.println();
+
+        // The biggining of try
+        pw.println("try:");
+    }
+
+    /**
+     * @param pw
+     * @throws GraphException
+     */
+    private void writeInvocations(PrintWriter pw) throws GraphException {
+        Collection<Node> nextNodes = getNextNodes();
+        while (nextNodes.size() > 0) {
+            // If there are more than one nodes to invoke, they can run
+            // concurrently using threads.
+            boolean thread = (nextNodes.size() > 1);
+            for (Node node : nextNodes) {
+                if (node instanceof WSNode) {
+                    WSNode wsNode = (WSNode) node;
+                    writeInvocation(wsNode, thread, pw);
+
+                } else {
+                    // TODO conditions, loops might come here.
+                }
+                this.notYetInvokedNodes.remove(node);
+            }
+
+            nextNodes = getNextNodes();
+        }
+    }
+
+    /**
+     * @param node
+     * @param thread
+     * @param pw
+     */
+    private void writeInvocation(WSNode node, boolean thread, PrintWriter pw) {
+        String id = node.getID();
+        String wsdlID = getWSDLID(node);
+
+        WSComponent component = node.getComponent();
+        QName portTypeQName = component.getPortTypeQName();
+        String operation = component.getOperationName();
+
+        pw.println(TAB + "# Invoke " + id + ".");
+        pw.println(TAB + id + QNAME_SUFFIX + " = QName('" + portTypeQName.getNamespaceURI() + "', '"
+                + portTypeQName.getLocalPart() + "')");
+        pw.println(TAB + wsdlID + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + wsdlID + "')");
+        pw.println(TAB + id + INVOKER_SUFFIX + " = " + INVOKER_CLASS + "(" + id + QNAME_SUFFIX + ", " + wsdlID + ", '"
+                + id + "',");
+        pw.println(TAB + TAB + MESSAGE_BOX_URL_VARIABLE + ", " + GFAC_VARIABLE + ", " + NOTIFICATION_VARIABLE + ")");
+
+        pw.println(TAB + "def " + INVOKE_METHOD + id + "():");
+        pw.println(TAB + TAB + id + INVOKER_SUFFIX + "." + SETUP_METHOD + "()");
+        pw.println(TAB + TAB + id + INVOKER_SUFFIX + "." + SET_OPERATION_METHOD + "('" + operation + "')");
+
+        // Ports
+        for (Port port : node.getInputPorts()) {
+            String portName = port.getName();
+            String value;
+            Node fromNode = port.getFromNode();
+            if (fromNode instanceof InputNode) {
+                value = PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + fromNode.getID() + "')";
+            } else {
+                Port fromPort = port.getFromPort();
+                value = "" + fromNode.getID() + INVOKER_SUFFIX + "." + GET_OUTPUT_METHOD + "('" + fromPort.getName()
+                        + "')";
+
+                // This might try to remove a node that has been removed
+                // already, but it's OK.
+                this.executingNodes.remove(fromNode);
+            }
+            pw.println(TAB + TAB + portName + VALUE_SUFFIX + " = " + value);
+            pw.println(TAB + TAB + id + INVOKER_SUFFIX + "." + SET_INPUT_METHOD + "('" + portName + "', " + portName
+                    + VALUE_SUFFIX + ")");
+        }
+
+        pw.println(TAB + TAB + "print 'Invoking " + id + ".'");
+        pw.println(TAB + TAB + id + INVOKER_SUFFIX + "." + INVOKE_METHOD + "()");
+
+        if (thread) {
+            pw.println(TAB + "thread.start_new_thread(" + INVOKE_METHOD + id + ", ())");
+        } else {
+            pw.println(TAB + INVOKE_METHOD + id + "()");
+        }
+
+        pw.println();
+
+        this.executingNodes.add(node);
+    }
+
+    private void writeOutputs(PrintWriter pw) throws GraphException {
+        for (OutputNode outputNode : this.outputNodes) {
+            writeOutput(outputNode, pw);
+        }
+    }
+
+    private void writeOutput(OutputNode node, PrintWriter pw) throws GraphException {
+        String id = node.getID();
+        Port port = node.getPort();
+
+        Node fromNode = port.getFromNode();
+        if (fromNode == null) {
+            throw new GraphException("Output parameter has to be connected to some node.");
+        }
+        Port fromPort = port.getFromPort();
+        if (fromNode instanceof InputNode) {
+            // The OutputNode is directly connected to an InputNode.
+            pw.println(TAB + id + VALUE_SUFFIX + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('"
+                    + fromNode.getID() + "')");
+        } else {
+            pw.println(TAB + "# Wait output " + id);
+            pw.println(TAB + id + VALUE_SUFFIX + " = " + fromNode.getID() + INVOKER_SUFFIX + "." + GET_OUTPUT_METHOD
+                    + "('" + fromPort.getName() + "')");
+        }
+        pw.println(TAB + "print '" + id + " = ', " + id + VALUE_SUFFIX);
+
+        // This might try to remove a node that has been removed
+        // already, but it's OK.
+        this.executingNodes.remove(fromNode);
+
+        pw.println();
+    }
+
+    /**
+     * @param pw
+     */
+    private void writeWaitAll(PrintWriter pw) {
+        pw.println(TAB + "# Wait all executing services.");
+        for (Node node : this.executingNodes) {
+            writeWait(node, pw);
+        }
+        pw.println();
+    }
+
+    /**
+     * @param node
+     * @param pw
+     */
+    private void writeWait(Node node, PrintWriter pw) {
+        String id = node.getID();
+        pw.println(TAB + "print 'Waiting " + id + " to be done.'");
+        pw.println(TAB + id + INVOKER_SUFFIX + "." + WAIT_METHOD + "()");
+    }
+
+    /**
+     * @param pw
+     */
+    private void writeFooter(PrintWriter pw) {
+        // Send a COMPLETE_WORKFLOW notification.
+        pw.println(TAB + NOTIFICATION_VARIABLE + "." + WORKFLOW_COMPLETED_METHOD + "(");
+        boolean first = true;
+        for (OutputNode node : this.outputNodes) {
+            if (first) {
+                first = false;
+            } else {
+                pw.println(",");
+            }
+            String id = node.getID();
+            pw.print(TAB + TAB + id + "=" + id + VALUE_SUFFIX);
+        }
+        pw.println(")");
+
+        pw.println(TAB + "print 'Everything is done successfully.'");
+
+        pw.println();
+        pw.println("except Throwable, e:");
+        pw.println(TAB + "print 'Error: ', e");
+        pw.println(TAB + NOTIFICATION_VARIABLE + "." + WORKFLOW_INCOMPLETED_METHOD + "(e)");
+    }
+
+    private Collection<Node> getNextNodes() throws GraphException {
+        Collection<Node> nextNodes = new ArrayList<Node>();
+        for (Node node : this.notYetInvokedNodes) {
+            if (isNextNode(node)) {
+                nextNodes.add(node);
+            }
+        }
+        return nextNodes;
+    }
+
+    /**
+     * Checks is a specified node can be executed next. A node can be executed if all the previous node are done or
+     * there is no input ports.
+     * 
+     * @param node
+     *            the specified node
+     * @return true if the specified node can be executed next; false otherwise
+     * @throws GraphException
+     */
+    private boolean isNextNode(Node node) throws GraphException {
+        if (node instanceof OutputNode) {
+            return false;
+        }
+        for (Port port : node.getInputPorts()) {
+            Collection<Node> fromNodes = port.getFromNodes();
+            if (fromNodes.isEmpty()) {
+                throw new GraphException("There is a port that is not connected to any.");
+            } else {
+                for (Node fromNode : fromNodes) {
+                    if (this.notYetInvokedNodes.contains(fromNode)) {
+                        // There is a node that should be executed before this
+                        // node.
+                        return false;
+                    }
+                }
+            }
+        }
+        Port port = node.getControlInPort();
+        if (port != null) {
+            Collection<Node> fromNodes = port.getFromNodes();
+            for (Node fromNode : fromNodes) {
+                if (this.notYetInvokedNodes.contains(fromNode)) {
+                    return false;
+                }
+            }
+        }
+        return true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADTypes.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADTypes.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADTypes.java
new file mode 100644
index 0000000..dc0b8bc
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADTypes.java
@@ -0,0 +1,225 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.lead;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.WSConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class LEADTypes {
+
+    private static final Logger logger = LoggerFactory.getLogger(LEADTypes.class);
+
+    /**
+     * http://www.extreme.indiana.edu/lead/xsd
+     */
+    public static final String LEAD_XSD_NS_URI = "http://airavata.apache.org/schemas/gfac/2012/12";
+
+    // Simple types
+
+    /**
+     * LEADFileIDType
+     */
+    public static final QName LEAD_FILE_ID_TYPE = new QName(LEAD_XSD_NS_URI, "LEADFileIDType");
+
+    /**
+     * DATA_ID_TYPE
+     */
+    public static final QName DATA_ID_TYPE = new QName(LEAD_XSD_NS_URI, "DataIDType");
+
+    /**
+     * LEADWorkflowIDType
+     */
+    public static final QName LEAD_WORKFLOW_ID_TYPE = new QName(LEAD_XSD_NS_URI, "LEADWorkflowIDType");
+
+    /**
+     * LEADNameListFileType
+     */
+    public static final QName LEAD_NAME_LIST_FILE_TYPE = new QName(LEAD_XSD_NS_URI, "LEADNameListFileType");
+
+    /**
+     * LEADNameListPropertiesFileType
+     */
+    public static final QName LEAD_NAME_LIST_PROPERTIES_FILE_TYPE = new QName(LEAD_XSD_NS_URI,
+            "LEADNameListPropertiesFileType");
+
+    /**
+     * HostNameType
+     */
+    public static final QName HOST_NAME_TYPE = new QName(LEAD_XSD_NS_URI, "HostNameType");
+
+    // Array types
+
+    /**
+     * StringArrayType
+     */
+    public static final QName STRING_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "StringArrayType");
+
+    /**
+     * IntegerArrayType
+     */
+    public static final QName INTEGER_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "IntegerArrayType");
+
+    /**
+     * FloatArrayType
+     */
+    public static final QName FLOAT_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "FloatArrayType");
+
+    /**
+     * DoubleArrayType
+     */
+    public static final QName DOUBLE_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "DoubleArrayType");
+
+    /**
+     * BooleanArrayType
+     */
+    public static final QName BOOLEAN_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "BooleanArrayType");
+
+    /**
+     * QNameArrayType
+     */
+    public static final QName QNAME_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "QNameArrayType");
+
+    /**
+     * URIArrayType
+     */
+    public static final QName URI_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "URIArrayType");
+
+    /**
+     * LEADFileIDArrayType
+     */
+    public static final QName LEAD_FILE_ID_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "LEADFileIDArrayType");
+
+    /**
+     * DATA_ID_ARRAY_TYPE
+     */
+    public static final QName DATA_ID_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "DataIDArrayType");
+
+    public static final QName STRING_TYPE = new QName(LEAD_XSD_NS_URI, "StringParameterType");
+
+      /**
+       * IntegerArrayType
+       */
+      public static final QName INTEGER_TYPE = new QName(LEAD_XSD_NS_URI, "IntegerParameterType");
+
+      /**
+       * FloatArrayType
+       */
+      public static final QName FLOAT_TYPE = new QName(LEAD_XSD_NS_URI, "FloatParameterType");
+
+      /**
+       * DoubleArrayType
+       */
+      public static final QName DOUBLE_TYPE = new QName(LEAD_XSD_NS_URI, "DoubleParameterType");
+
+      /**
+       * BooleanArrayType
+       */
+      public static final QName BOOLEAN_TYPE = new QName(LEAD_XSD_NS_URI, "BooleanParameterType");
+
+      /**
+       * URIArrayType
+       */
+      public static final QName URI_TYPE = new QName(LEAD_XSD_NS_URI, "URIParameterType");
+
+
+    /**
+     * Checks if a specified type is known. If the type is known, the GUI accepts string as a user's input. If not
+     * known, the GUI accepts XML as the input.
+     * 
+     * @param type
+     * @return true if the type is known; otherwise false;
+     */
+    public static boolean isKnownType(QName type) {
+        if (WSConstants.XSD_ANY_TYPE.equals(type)) {
+            // we need to input XML directly for xsd:any
+            return false;
+        } else if (WSConstants.XSD_NS_URI.equals(type.getNamespaceURI())) {
+            return true;
+        } else if (LEAD_FILE_ID_TYPE.equals(type) || DATA_ID_TYPE.equals(type) || LEAD_WORKFLOW_ID_TYPE.equals(type)
+                || LEAD_NAME_LIST_FILE_TYPE.equals(type) || LEAD_NAME_LIST_PROPERTIES_FILE_TYPE.equals(type)
+                || HOST_NAME_TYPE.equals(type) || STRING_ARRAY_TYPE.equals(type) || INTEGER_ARRAY_TYPE.equals(type)
+                || FLOAT_ARRAY_TYPE.equals(type) || DOUBLE_ARRAY_TYPE.equals(type) || BOOLEAN_ARRAY_TYPE.equals(type)
+                || QNAME_ARRAY_TYPE.equals(type) || URI_ARRAY_TYPE.equals(type) || LEAD_FILE_ID_ARRAY_TYPE.equals(type)
+                || DATA_ID_ARRAY_TYPE.equals(type) || STRING_TYPE.equals(type) || URI_TYPE.equals(type)
+                || INTEGER_TYPE.equals(type) || FLOAT_TYPE.equals(type) || DOUBLE_TYPE.equals(type)
+                || BOOLEAN_TYPE.equals(type)) {
+            return true;
+        } else if (DATA_ID_TYPE.getLocalPart().equals(type.getLocalPart())) {
+            // XXX temporary hack.
+            logger.warn("The name space of " + type.getLocalPart() + " should be " + DATA_ID_TYPE.getNamespaceURI()
+                    + ", not " + type.getNamespaceURI() + ".");
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * @param type
+     * @return true if type is an uri type; false otherwise.
+     */
+    public static boolean isURIType(QName type) {
+        if (WSConstants.XSD_ANY_URI.equals(type) || LEAD_NAME_LIST_PROPERTIES_FILE_TYPE.equals(type)
+                || LEAD_FILE_ID_TYPE.equals(type) || LEAD_NAME_LIST_FILE_TYPE.equals(type)
+                || LEAD_WORKFLOW_ID_TYPE.equals(type) || URI_TYPE.equals(type)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * @param type
+     * @return true if type is an array type; false otherwise.
+     */
+    public static boolean isArrayType(QName type) {
+        if (STRING_ARRAY_TYPE.equals(type) || INTEGER_ARRAY_TYPE.equals(type) || FLOAT_ARRAY_TYPE.equals(type)
+                || DOUBLE_ARRAY_TYPE.equals(type) || BOOLEAN_ARRAY_TYPE.equals(type) || QNAME_ARRAY_TYPE.equals(type)
+                || URI_ARRAY_TYPE.equals(type) || LEAD_FILE_ID_ARRAY_TYPE.equals(type)
+                || DATA_ID_ARRAY_TYPE.equals(type)) {
+            return true;
+        } else if (LEAD_FILE_ID_ARRAY_TYPE.getLocalPart().equals(type.getLocalPart())) {
+            // TODO remove this.
+            // for workflow input message created from workflow template
+            logger.warn("The name space of " + type.getLocalPart() + " should be "
+                    + LEAD_FILE_ID_ARRAY_TYPE.getNamespaceURI() + ", not " + type.getNamespaceURI() + ".");
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * @param type
+     * @return true if type is an uri array type; false otherwise.
+     */
+    public static boolean isURIArrayType(QName type) {
+        if (URI_ARRAY_TYPE.equals(type) || LEAD_FILE_ID_ARRAY_TYPE.equals(type)) {
+            return true;
+        } else {
+            return false;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/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
new file mode 100644
index 0000000..c8db9fd
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java
@@ -0,0 +1,155 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+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;
+
+public class LeadContextHeaderHelper {
+
+    /**
+     * DEFAULT_USER
+     */
+    private static final String DEFAULT_USER = "xbaya-user";
+
+    /**
+     * DEFAULT_EXPERIMENT
+     */
+    private static final String DEFAULT_EXPERIMENT = "xbaya-experiment";
+
+    private LeadContextHeader leadContextHeader;
+
+    /**
+     * Constructs a LeadContextHeaderHelper.
+     * 
+     */
+    public LeadContextHeaderHelper() {
+        // The default experiment and user will be will be overwritten.
+        this.leadContextHeader = new LeadContextHeader(DEFAULT_EXPERIMENT, DEFAULT_USER);
+    }
+
+    /**
+     * @return The leadContextHeader.
+     */
+    public LeadContextHeader getLeadContextHeader() {
+        return this.leadContextHeader;
+    }
+
+    /**
+     * @param user
+     */
+    public void setUser(String user) {
+        if (user == null || user.length() == 0) {
+            user = DEFAULT_USER;
+        }
+        this.leadContextHeader.setUserDn(user);
+    }
+
+    /**
+     * @param workflowTemplateID
+     */
+    public void setWorkflowTemplateID(URI workflowTemplateID) {
+        if (workflowTemplateID != null) {
+            this.leadContextHeader.setWorkflowTemplateId(workflowTemplateID);
+        }
+    }
+
+    /**
+     * @param workflowInstanceID
+     */
+    public void setWorkflowInstanceID(URI workflowInstanceID) {
+        if (workflowInstanceID != null) {
+            this.leadContextHeader.setWorkflowInstanceId(workflowInstanceID);
+        }
+    }
+
+    /**
+     * @param brokerURL
+     * @param topic
+     */
+    public void setEventSink(URI brokerURL, String topic) {
+        if (brokerURL != null) {
+            if (topic == null || topic.length() == 0) {
+                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);
+        }
+    }
+
+    /**
+     * @param gFacURL
+     */
+    public void setGFacURL(URI gFacURL) {
+        if (gFacURL != null) {
+            this.leadContextHeader.setGfacUrl(WSDLUtil.appendWSDLQuary(gFacURL));
+        }
+    }
+
+    //
+    // The followings are higer-level APIs.
+    //
+
+    /**
+     * @param workflow
+     */
+    public void setWorkflow(Workflow workflow) {
+        if (workflow != null) {
+            setWorkflowTemplateID(workflow.getGPELTemplateID());
+            setWorkflowInstanceID(workflow.getGPELInstanceID());
+        }
+    }
+
+    /**
+     * @param monitorConfiguration
+     */
+    public void setMonitorConfiguration(MonitorConfiguration monitorConfiguration) {
+        setEventSink(monitorConfiguration.getBrokerURL(), monitorConfiguration.getTopic());
+    }
+
+    /**
+     * This method has to be called before setMonitorConfiguration because this will overwrite some variables.
+     * 
+     * @param xbayaConfiguration
+     */
+    public void setXBayaConfiguration(XBayaConfiguration xbayaConfiguration) {
+        setGFacURL(xbayaConfiguration.getGFacURL());
+
+        // The followings might overwrite some variables.
+        setWorkflowTemplateID(xbayaConfiguration.getGPELTemplateID());
+        setWorkflowInstanceID(xbayaConfiguration.getGPELInstanceID());
+        setEventSink(xbayaConfiguration.getBrokerURL(), xbayaConfiguration.getTopic());
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/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
new file mode 100644
index 0000000..982cdf3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/NotificationHandler.java
@@ -0,0 +1,190 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+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;
+import xsul.message_router.MessageContext;
+import xsul.xbeans_util.XBeansUtil;
+import xsul.xhandler.BaseHandler;
+
+public class NotificationHandler extends BaseHandler {
+
+    private static final Logger logger = LoggerFactory.getLogger(NotificationHandler.class);
+
+    private static final String INVOKING_MESSAGE = "Invoking a workflow";
+
+    private static final String RECEIVE_RESULT_MESSAGE = "A workflow finished successfully.";
+
+    private static final String RECEIVE_FAULT_MESSAGE = "A workflow failed.";
+
+    private LeadContextHeader leadContext;
+
+    private WorkflowNotifier notifier;
+
+    private WorkflowTrackingContext context;
+
+    private InvocationContext invocationContext;
+
+    private InvocationEntity invocationEntity;
+
+    private WorkflowContextHeaderBuilder builder;
+
+    /**
+     * Constructs a NotificationHandler.
+     * 
+     * @param leadContext
+     */
+    public NotificationHandler(LeadContextHeader leadContext) {
+        super(NotificationHandler.class.getName());
+        this.leadContext = leadContext;
+        this.notifier = NotifierFactory.createNotifier();
+        URI myWorkflowID = null;
+        URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
+        String userDN = this.leadContext.getUserDn();
+        if (userDN != null ){
+            if(userDN.trim().length() == 0) {
+                String serviceIDAsString = XBayaConstants.APPLICATION_SHORT_NAME + ":" + userDN.trim();
+                try {
+                    myServiceID = new URI(null, null, serviceIDAsString, null);
+                } catch (URISyntaxException e) {
+                    logger.error(e.getMessage(), e);
+                }
+            }
+        }
+        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);
+    }
+
+    public NotificationHandler(WorkflowContextHeaderBuilder builder) {
+        super(NotificationHandler.class.getName());
+        this.builder = builder;
+        this.notifier = NotifierFactory.createNotifier();
+        URI myWorkflowID = null;
+        URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
+        String userDN = this.builder.getUserIdentifier();
+        if (userDN != null) {
+            if (userDN.trim().length() == 0) {
+                String serviceIDAsString = XBayaConstants.APPLICATION_SHORT_NAME + ":" + userDN.trim();
+                try {
+                    myServiceID = new URI(null, null, serviceIDAsString, null);
+                } catch (URISyntaxException e) {
+                    logger.error(e.getMessage(), e);
+                }
+            }
+        }
+        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);
+    }
+
+    /**
+     * @see xsul.xhandler.BaseHandler#processOutgoingXml(org.xmlpull.v1.builder.XmlElement,
+     *      xsul.message_router.MessageContext)
+     */
+    @Override
+    public boolean processOutgoingXml(XmlElement soapEnvelope, MessageContext context)
+            throws DynamicInfosetInvokerException {
+        logger.debug("soapEnvelope: " + XMLUtil.xmlElementToString(soapEnvelope));
+
+        URI serviceWorkflowID = null;
+        URI serviceServiceID = URI.create(this.builder.getWorkflowMonitoringContext().getServiceInstanceId());
+        if (serviceServiceID == null) {
+            serviceServiceID = URI.create("NoWorkflowIDSet");
+        }
+//        Integer serviceTimestep = null;
+/*        String timeStep = Integer.toString(this.builder.getWorkflowMonitoringContext().getWorkflowTimeStep());
+        if (timeStep != null) {
+            try {
+                serviceTimestep = new Integer(this.builder.getWorkflowMonitoringContext().getWorkflowTimeStep());
+            } catch (NumberFormatException e) {
+                logger.error(e.getMessage(), e);
+            }
+        }*/
+        XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
+        XmlElement soapBody = soapEnvelope.element(null, XmlConstants.S_BODY);
+        XmlObject headerObject = null;
+        if (soapHeader != null) {
+            headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
+        }
+        XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody);
+
+        this.invocationContext = this.notifier.invokingService(this.context, this.invocationEntity, headerObject,
+                bodyObject, INVOKING_MESSAGE);
+        return super.processOutgoingXml(soapEnvelope, context);
+    }
+
+    /**
+     * @see xsul.xhandler.BaseHandler#processIncomingXml(org.xmlpull.v1.builder.XmlElement,
+     *      xsul.message_router.MessageContext)
+     */
+    @Override
+    public boolean processIncomingXml(XmlElement soapEnvelope, MessageContext context)
+            throws DynamicInfosetInvokerException {
+        logger.info("soapEnvelope: " + XMLUtil.xmlElementToString(soapEnvelope));
+
+        XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
+        XmlObject headerObject = null;
+        if (soapHeader != null) {
+            headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
+        }
+
+        XmlElement soapBody = soapEnvelope.element(null, XmlConstants.S_BODY);
+        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);
+        } else {
+            this.notifier.receivedFault(this.context, this.invocationContext, headerObject, bodyObject,
+                    RECEIVE_FAULT_MESSAGE);
+        }
+
+        return super.processIncomingXml(soapEnvelope, context);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/tools/ToolsMenuItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/tools/ToolsMenuItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/tools/ToolsMenuItem.java
new file mode 100644
index 0000000..972088d
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/tools/ToolsMenuItem.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.menues.tools;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+//import org.apache.airavata.xbaya.ui.dialogs.GlobusFileTransferWindow;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+public class ToolsMenuItem {
+
+    private XBayaEngine engine;
+
+    private JMenu toolsMenu;
+
+    private static final Logger logger = LoggerFactory.getLogger(ToolsMenuItem.class);
+
+    /**
+     * Constructs a WorkflowMenu.
+     * 
+     * @param engine
+     */
+    public ToolsMenuItem(XBayaEngine engine) {
+        this.engine = engine;
+        createWorkflowMenu();
+    }
+
+    /**
+     * @return The workflow menu.
+     */
+    public JMenu getMenu() {
+        return this.toolsMenu;
+    }
+
+    /**
+     * Creates workflow menu.
+     */
+    private void createWorkflowMenu() {
+//        JMenuItem globusFileTransferItem = createGlobusFileTransferItem();
+//        toolsMenu = new JMenu("Tools");
+//        toolsMenu.setMnemonic(KeyEvent.VK_T);
+//        toolsMenu.add(globusFileTransferItem);
+
+    }
+    
+//    private JMenuItem createGlobusFileTransferItem() {
+//        JMenuItem item = new JMenuItem("Globus File Transfer...");
+//        item.setMnemonic(KeyEvent.VK_J);
+//        item.addActionListener(new AbstractAction() {
+//            private GlobusFileTransferWindow window;
+//
+//            public void actionPerformed(ActionEvent e) {
+//                if (this.window == null) {
+//                    this.window = new GlobusFileTransferWindow(engine);
+//                }
+//                this.window.show();
+//            }
+//        });
+//        return item;
+//    }
+
+//    private JMenuItem createAmberRunItem() {
+//        JMenuItem item = new JMenuItem("Amber Run...");
+//        item.setMnemonic(KeyEvent.VK_J);
+//        item.addActionListener(new AbstractAction() {
+//            private AmberRunWindow window;
+//
+//            public void actionPerformed(ActionEvent e) {
+//                if (this.window == null) {
+//                    this.window = new AmberRunWindow(engine);
+//                }
+//                this.window.show();
+//            }
+//        });
+//        return item;
+//    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java
new file mode 100644
index 0000000..6702f1c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class AiravataConfigurations {
+//    private AiravataRegistry2 registry;
+    private AiravataAPI airavataAPI;
+
+//    public AiravataConfigurations(AiravataRegistry2 registry) {
+//        setRegistry(registry);
+//    }
+    public AiravataConfigurations(AiravataAPI airavataAPI) {
+        setAiravataAPI(airavataAPI);
+    }
+
+//    public AiravataRegistry2 getRegistry() {
+//        return registry;
+//    }
+//
+//    public void setRegistry(AiravataRegistry2 registry) {
+//        this.registry = registry;
+//    }
+
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java
new file mode 100644
index 0000000..3c66c43
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java
@@ -0,0 +1,98 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class ApplicationDeploymentDescriptionWrap {
+    private ApplicationDescription applicationDescription;
+    private String service;
+    private String host;
+//    private AiravataRegistry2 registry;
+    private AiravataAPI airavataAPI;
+
+    public ApplicationDeploymentDescriptionWrap(AiravataAPI airavataAPI,
+            ApplicationDescription applicationDescription, String service, String host) {
+        setApplicationDescription(applicationDescription);
+        setService(service);
+        setHost(host);
+        setAiravataAPI(airavataAPI);
+    }
+
+    public ApplicationDescription getDescription() {
+        return applicationDescription;
+    }
+
+    public void setApplicationDescription(ApplicationDescription applicationDescription) {
+        this.applicationDescription = applicationDescription;
+    }
+
+    public String getService() {
+        return service;
+    }
+
+    public ServiceDescription getServiceDescription() throws AiravataAPIInvocationException {
+        ServiceDescription desc = getAiravataAPI().getApplicationManager().getServiceDescription(getService());
+        if(desc!=null){
+        	return desc;
+        }
+        throw new AiravataAPIInvocationException(new Exception("Service Description not found in registry."));
+    }
+
+    public void setService(String service) {
+        this.service = service;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public HostDescription getHostDescription() throws AiravataAPIInvocationException {
+        return getAiravataAPI().getApplicationManager().getHostDescription(getHost());
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+//    public AiravataRegistry2 getRegistry() {
+//        return registry;
+//    }
+//
+//    public void setRegistry(AiravataRegistry2 registry) {
+//        this.registry = registry;
+//    }
+
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java
new file mode 100644
index 0000000..247a7e8
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.ApplicationManager;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class ApplicationDeploymentDescriptions {
+//    private AiravataRegistry2 registry;
+    private AiravataAPI airavataAPI;
+    private String serviceName;
+    
+//    public ApplicationDeploymentDescriptions(AiravataRegistry2 registry, String serviceName) {
+//        setRegistry(registry);
+//        setServiceName(serviceName);
+//    }
+
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public ApplicationDeploymentDescriptions(AiravataAPI airavataAPI, String serviceName) {
+        setAiravataAPI(airavataAPI);
+        setServiceName(serviceName);
+    }
+    
+//    public ApplicationDeploymentDescriptions(AiravataRegistry2 registry) {
+//        this(registry,null);
+//    }
+
+    public ApplicationDeploymentDescriptions(AiravataAPI airavataAPI) {
+        this(airavataAPI,null);
+    }
+
+//    public AiravataRegistry2 getRegistry() {
+//        return registry;
+//    }
+//
+//    public void setRegistry(AiravataRegistry2 registry) {
+//        this.registry = registry;
+//    }
+
+    public List<ApplicationDeploymentDescriptionWrap> getDescriptions() throws RegistryException, AiravataAPIInvocationException {
+        List<ApplicationDeploymentDescriptionWrap> list = new ArrayList<ApplicationDeploymentDescriptionWrap>();
+        if (getServiceName()==null) {
+            ApplicationManager applicationManager = getAiravataAPI().getApplicationManager();
+            List<ServiceDescription> serviceDescriptors = applicationManager.getAllServiceDescriptions();
+        	for (ServiceDescription serviceDescription : serviceDescriptors) {
+        		String serviceName = serviceDescription.getType().getName();
+				Map<String,ApplicationDescription> deploymentDescriptions = applicationManager.getApplicationDescriptors(serviceName);
+				for (String hostName : deploymentDescriptions.keySet()) {
+					ApplicationDescription descriptionWrap=deploymentDescriptions.get(hostName);
+					list.add(new ApplicationDeploymentDescriptionWrap(getAiravataAPI(), descriptionWrap, serviceName,hostName));
+				}
+			}
+			
+		}else{
+			Map<String,ApplicationDescription> deploymentDescriptions = getAiravataAPI().getApplicationManager().getApplicationDescriptors(serviceName);
+			for (String hostName : deploymentDescriptions.keySet()) {
+				ApplicationDescription descriptionWrap=deploymentDescriptions.get(hostName);
+				list.add(new ApplicationDeploymentDescriptionWrap(getAiravataAPI(), descriptionWrap, getServiceName(),hostName));
+			}
+		}
+		return list;
+    }
+
+	public String getServiceName() {
+		return serviceName;
+	}
+
+	public void setServiceName(String serviceName) {
+		this.serviceName = serviceName;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java
new file mode 100644
index 0000000..480848b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+
+import java.net.URI;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class EventingServiceURL {
+    private AiravataAPI airavataAPI;
+    private URI eventingServiceURL;
+
+    public EventingServiceURL(AiravataAPI airavataAPI, URI eventingServiceURL) {
+        setAiravataAPI(airavataAPI);
+        setEventingServiceURL(eventingServiceURL);
+    }
+
+	public URI getEventingServiceURL() {
+		return eventingServiceURL;
+	}
+
+	public void setEventingServiceURL(URI eventingServiceURL) {
+		this.eventingServiceURL = eventingServiceURL;
+	}
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java
new file mode 100644
index 0000000..8669821
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class EventingServiceURLs {
+    private AiravataAPI airavataAPI;
+
+    public EventingServiceURLs(AiravataAPI airavataAPI) {
+        setAiravataAPI(airavataAPI);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public List<EventingServiceURL> getURLS() throws AiravataAPIInvocationException {
+        List<EventingServiceURL> urls = new ArrayList<EventingServiceURL>();
+        URI gfacDescriptor = getAiravataAPI().getAiravataManager().getEventingServiceURL();
+		urls.add(new EventingServiceURL(getAiravataAPI(), gfacDescriptor));
+        return urls;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURL.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURL.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURL.java
new file mode 100644
index 0000000..3f45bdd
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURL.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+
+import java.net.URI;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class GFacURL {
+    private AiravataAPI airavataAPI;
+    private URI gfacURL;
+
+    public GFacURL(AiravataAPI airavataAPI, URI url) {
+        setAiravataAPI(airavataAPI);
+        setGfacURL(url);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public URI getGfacURL() {
+        return gfacURL;
+    }
+
+    public void setGfacURL(URI url) {
+        this.gfacURL = url;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
new file mode 100644
index 0000000..2c2b89c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
@@ -0,0 +1,56 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class GFacURLs {
+    private AiravataAPI airavataAPI;
+
+    public GFacURLs(AiravataAPI airavataAPI) {
+        setAiravataAPI(airavataAPI);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+//    public List<GFacURL> getURLS() throws AiravataAPIInvocationException {
+//        List<GFacURL> urls = new ArrayList<GFacURL>();
+//        List<URI> gfacDescriptorList = getAiravataAPI().getAiravataManager().getGFaCURLs();
+//		for (URI url : gfacDescriptorList) {
+//		    urls.add(new GFacURL(getAiravataAPI(), url));
+//		}
+//        return urls;
+//    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/HostDescriptions.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/HostDescriptions.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/HostDescriptions.java
new file mode 100644
index 0000000..aba3fc2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/HostDescriptions.java
@@ -0,0 +1,50 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import java.util.List;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class HostDescriptions {
+    private AiravataAPI airavataAPI;
+
+    public HostDescriptions(AiravataAPI airavataAPI) {
+        setAiravataAPI(airavataAPI);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public List<HostDescription> getDescriptions() throws AiravataAPIInvocationException {
+        return getAiravataAPI().getApplicationManager().getAllHostDescriptions();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InputParameters.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InputParameters.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InputParameters.java
new file mode 100644
index 0000000..41bf8b0
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InputParameters.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.schemas.gfac.Parameter;
+
+public class InputParameters extends ServiceParameters {
+
+	public InputParameters(NodeParameter[] parameters) {
+		super(parameters);
+	}
+	
+	public InputParameters(Parameter[] parameters) {
+		super(parameters);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURL.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURL.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURL.java
new file mode 100644
index 0000000..d648af3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURL.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+
+import java.net.URI;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class InterpreterServiceURL {
+    private AiravataAPI airavataAPI;
+    private URI interpreterServiceURL;
+
+    public InterpreterServiceURL(AiravataAPI airavataAPI, URI interpreterServiceURI) {
+        setAiravataAPI(airavataAPI);
+        setInterpreterServiceURI(interpreterServiceURI);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public URI getInterpreterServiceURL() {
+        return interpreterServiceURL;
+    }
+
+    public void setInterpreterServiceURI(URI interpreterServiceURI) {
+        this.interpreterServiceURL = interpreterServiceURI;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURLs.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURLs.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURLs.java
new file mode 100644
index 0000000..71ae486
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURLs.java
@@ -0,0 +1,56 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class InterpreterServiceURLs {
+    private AiravataAPI airavataAPI;
+
+    public InterpreterServiceURLs(AiravataAPI airavataAPI) {
+        setAiravataAPI(airavataAPI);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public List<InterpreterServiceURL> getURLS() throws AiravataAPIInvocationException {
+        List<InterpreterServiceURL> urls = new ArrayList<InterpreterServiceURL>();
+        List<URI> gfacDescriptorList = getAiravataAPI().getAiravataManager().getWorkflowInterpreterServiceURLs();
+		for (URI uri : gfacDescriptorList) {
+		    urls.add(new InterpreterServiceURL(getAiravataAPI(), uri));
+		}
+        return urls;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURL.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURL.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURL.java
new file mode 100644
index 0000000..3754f16
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURL.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+
+import java.net.URI;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class MessageBoxURL {
+    private AiravataAPI airavataAPI;
+    private URI messageBoxURL;
+
+    public MessageBoxURL(AiravataAPI airavataAPI, URI messageBoxURL) {
+        setAiravataAPI(airavataAPI);
+        setMessageBoxURL(messageBoxURL);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public URI getMessageBoxURL() {
+		return messageBoxURL;
+	}
+
+	public void setMessageBoxURL(URI messageBoxURL) {
+		this.messageBoxURL = messageBoxURL;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURLs.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURLs.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURLs.java
new file mode 100644
index 0000000..600af77
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURLs.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class MessageBoxURLs {
+    private AiravataAPI airavataAPI;
+
+    public MessageBoxURLs(AiravataAPI airavataAPI) {
+        setAiravataAPI(airavataAPI);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public List<MessageBoxURL> getURLS() throws AiravataAPIInvocationException {
+        List<MessageBoxURL> urls = new ArrayList<MessageBoxURL>();
+        URI gfacDescriptor = getAiravataAPI().getAiravataManager().getMessageBoxServiceURL();
+		urls.add(new MessageBoxURL(getAiravataAPI(), gfacDescriptor));
+        return urls;
+    }
+}


[48/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/NOTICE
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/NOTICE b/modules/distribution/xbaya-gui/src/main/resources/NOTICE
deleted file mode 100644
index 431db59..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/NOTICE
+++ /dev/null
@@ -1,163 +0,0 @@
-Apache Airavata
-Copyright 2014 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-===============================================================================
-Apache Xerces Java Notice:
-
-   Portions of this software were originally based on the following:
-     - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
-     - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
-     - voluntary contributions made by Paul Eng on behalf of the
-       Apache Software Foundation that were originally developed at iClick, Inc.,
-       software copyright (c) 1999.
-
-================================================================================
-Apache XmlBeans Notice: 
-
-   Portions of this software were originally based on the following:
-     - software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-   Aside from contributions to the Apache XMLBeans project, this
-   software also includes:
-
-    - one or more source files from the Apache Xerces-J and Apache Axis
-      products, Copyright (c) 1999-2003 Apache Software Foundation
-
-    - W3C XML Schema documents Copyright 2001-2003 (c) World Wide Web
-      Consortium (Massachusetts Institute of Technology, European Research
-      Consortium for Informatics and Mathematics, Keio University)
-
-    - resolver.jar from Apache Xml Commons project,
-      Copyright (c) 2001-2003 Apache Software Foundation
-
-    - Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
-      Copyright 2002 Yuval Oren under the terms of the Apache Software License 2.0
-
-    - JSR-173 Streaming API for XML from http://sourceforge.net/projects/xmlpullparser/,
-      Copyright 2005 BEA under the terms of the Apache Software License 2.0
-      
-=========================================================================================
-Apache Axis2 Notice: (axis2-*, mex-1.5.1-impl)
-
-Portions Copyright 2006 International Business Machines Corp.
-Portions Copyright 2005-2007 WSO2, Inc.
-
-This product also includes schemas and specification developed by:
-- the W3C consortium (http://www.w3c.org)
-
-This product also includes WS-* schemas developed by International
-Business Machines Corporation, Microsoft Corporation, BEA Systems, 
-TIBCO Software, SAP AG, Sonic Software, and VeriSign
-
-This product also includes a WSDL developed by salesforce.com
-- Copyright 1999-2006 salesforce.com, inc.
-Portions of the included xmlbeans library were originally based on the following:
-- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-====================================================================================
-Apache Derby Notice:
-
-Portions of Derby were originally developed by
-International Business Machines Corporation and are
-licensed to the Apache Software Foundation under the
-"Software Grant and Corporate Contribution License Agreement",
-informally known as the "Derby CLA".
-The following copyright notice(s) were affixed to portions of the code
-with which this file is now or was at one time distributed
-and are placed here unaltered.
-
-(C) Copyright 1997,2004 International Business Machines Corporation.  All rights reserved.
-
-(C) Copyright IBM Corp. 2003. 
-
-=======================
-
-The portion of the functionTests under 'nist' was originally 
-developed by the National Institute of Standards and Technology (NIST), 
-an agency of the United States Department of Commerce, and adapted by
-International Business Machines Corporation in accordance with the NIST
-Software Acknowledgment and Redistribution document at
-http://www.itl.nist.gov/div897/ctg/sql_form.htm
-
-========================
-
-The JDBC apis for small devices and JDBC3 (under java/stubs/jsr169 and
-java/stubs/jdbc3) were produced by trimming sources supplied by the
-Apache Harmony project. In addition, the Harmony SerialBlob and
-SerialClob implementations are used. The following notice covers the Harmony sources:
-
-Portions of Harmony were originally developed by
-Intel Corporation and are licensed to the Apache Software
-Foundation under the "Software Grant and Corporate Contribution
-License Agreement", informally known as the "Intel Harmony CLA".
-
-=============================================================================
-Apache Woden Notice:
-
-   This product also includes software developed by :
-   
-     - IBM Corporation (http://www.ibm.com),
-         WSDL4J was the initial code contribution for the Apache Woden
-         project and some of the WSDL4J design and code has been reused.
-     - The W3C Consortium (http://www.w3c.org),
-         Common W3C XML Schema and DTD files are packaged with Apache Woden.
-
-   Please read the different LICENSE files present in the root directory of
-   this distribution.
-
-=========================================================================
-Woodstox Notice: 
-
-This product includes software developed by the Woodstox Project 
-(http://woodstox.codehaus.org/)
-
-This product currently only contains code developed by authors
-of specific components, as identified by the source code files.
-
-Since product implements StAX API, it has dependencies to StAX API
-classes.
-
-For additional credits (generally to people who reported problems)
-see CREDITS file.
-
-===========================================================================
-Apache xml-commons xml-apis Notice:
-
-   Portions of this software were originally based on the following:
-     - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
-     - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
-     - software copyright (c) 2000 World Wide Web Consortium, http://www.w3.org
-
-================================================================================================
-Apache  Xalan Notice: 
-
-Portions of this software was originally based on the following:
-     - software copyright (c) 1999-2002, Lotus Development Corporation., http://www.lotus.com.
-     - software copyright (c) 2001-2002, Sun Microsystems., http://www.sun.com.
-     - software copyright (c) 2003, IBM Corporation., http://www.ibm.com.
-     - voluntary contributions made by Ovidiu Predescu (ovidiu@cup.hp.com) on behalf of the 
-       Apache Software Foundation and was originally developed at Hewlett Packard Company. 
-================================================================================================
-Apache  OpenJPA Notice: 
-
-OpenJPA includes software developed by the SERP project
-Copyright (c) 2002-2006, A. Abram White. All rights reserved.
-
-OpenJPA includes the persistence and orm schemas from the JPA specifications.
-Copyright 2005-2009 Sun Microsystems, Inc. All rights reserved.
-OpenJPA elects to include this software in this distribution under the
-CDDL license.  You can obtain a copy of the License at:
-    https://glassfish.dev.java.net/public/CDDL+GPL.html
-The source code is available at:
-    https://glassfish.dev.java.net/source/browse/glassfish/
-
-OpenJPA includes software written by Miroslav Nachev
-OpenJPA uses test code written by Charles Tillman.
-================================================================================================
-Apache XmlSchema Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-================================================================================================
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/README
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/README b/modules/distribution/xbaya-gui/src/main/resources/README
deleted file mode 100644
index 6ca8faf..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/README
+++ /dev/null
@@ -1,101 +0,0 @@
-Apache Airavata XBaya - README.txt
-Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
---------------------------------------------------------------------------------
-
-About
-=====
-Apache Airavata, a software framework to executing and managing computational jobs on 
-distributed computing resources including local clusters, supercomputers, national grids, 
-academic and commercial clouds. Airavata can be used as individual components or 
-as an integrated solution to build science gateways or general-purpose distributed 
-application and workflow management systems. Users can use Airavata back end services 
-and build gadgets to deploy in open social containers such as Apache Rave and modify them 
-to suit their needs. Airavata builds on general concepts of service oriented computing, 
-distributed messaging, and workflow composition and orchestration.
-
-This distribution is a client gui application capable of composing workflows, application 
-descriptors & communicating with the airavata server to persist user data, run & monitor 
-experiments and analyze the results.
-
-Release Notes
-=============
-0.11 is the tenth release of Airavata (skipped 0.1-INCUBATNG). This release focuses GFac rearchitecturing and more GFac level changes. For detailed tasks list, please see RELEASE_NOTES.
-
-Building from source
-====================
-For brief installation instructions, see INSTALL
-For detailed installation and further instructions refer http://airavata.apache.org/ - Documentation section in left hand panel. Step by step with proper documentation are provided.
-
-Known Issues in This Release
-============================
-This is the base release and is focused on a good foundation and less on features. This 
-version is not recommended for production usage.
-
-Airavata XBaya Distribution Directory Structure
-================================================
-
-    AIRAVATA_XBAYA
-		├── bin
-		│   ├── airavata-client.properties
-		│   ├── log4j.properties
-		│   ├── setenv.bat
-		│   ├── setenv.sh
-		│   ├── xbaya-gui.bat
-		│   └── xbaya-gui.sh
-		├── lib
-		├── samples
-		├── INSTALL
-		├── LICENSE
-		├── NOTICE
-		└── README
-
-How to test and run samples
-===========================
-* If you built Airavata from source, and if you see "BUILD SUCCESS", then the test cases should have passes.
-* The test cases are beyond unit level, they startup embedded services and run through basic workflow use cases.
-* To walk through Airavata features, follow "Airavata in Five Minutes" tutorial at http://airavata.apache.org/documentation/tutorials/airavata-in-5-minutes.html
-* For intermediate level Airavata features, follow "Airavata in Ten Minutes" tutorial at http://airavata.apache.org/documentation/tutorials/airavata-in-10-minutes.html 
-* For advanced use cases, please contact mailing lists - http://airavata.apache.org/community/mailing-lists.html
-
-Description of Directory Structure
-==================================
-
-    - bin
-      This contains the configuration files for Airavata XBaya & the scripts to run XBaya GUI Application.
-
-    - samples
-      This contains sample scripts to define the sample descriptor in http://airavata.apache.org/documentation/tutorials/airavata-in-10-minutes.html
-
-    - lib
-      This contains all the libraries required to run the client side code with the jars required to run XBaya GUI.
-
-    - README
-      This document.
-
-    - INSTALL
-          This document will contain information on installing Apache-Airavata XBaya.
-
-Other Available Distributions
-=============================
-
-Server Distributions
---------------------
-* Airavata Server
-  The Airavata Server binary distribution allows you to run a standalone Airavata Server which includes all the airavata services 
-  shipped with a default derby database as the backend registry. For stable purposes, a mysql configuration is recommended. 
-
-* Airavata Server Web Application
-  This is similar package as the Airavata Server but is distributed as the server Web Application archive.
-  This war is compatible with Apache Tomcat application server. The war bundles all airavata services 
-  enabled by defualt to startup a derby database as the backend registry. For stable purposes, a mysql configuration is recommended. 
-
-Client Distributions
---------------------
-* Airavata XBaya
-  The Airavata XBaya distribution is a client GUI application with features to register applications as web services, construct workflows,
-  execute and monitor workflows and browse the generated results from the airavata registry.
-
-* Airavata XBaya JNLP
-  The Airavata XBaya JNLP distribution is the simular GUI distribution but prepackeged to be ready to be deployed to 
-   a web server as a web start application. The GUI provides features to register applications as web services, construct workflows,
-  execute and monitor workflows and browse the generated results from the airavata registry. 

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/airavata-logo.gif
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/airavata-logo.gif b/modules/distribution/xbaya-gui/src/main/resources/airavata-logo.gif
deleted file mode 100755
index 46749c1..0000000
Binary files a/modules/distribution/xbaya-gui/src/main/resources/airavata-logo.gif and /dev/null differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/bin/setenv.bat
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/bin/setenv.bat b/modules/distribution/xbaya-gui/src/main/resources/bin/setenv.bat
deleted file mode 100644
index e02e0d6..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/bin/setenv.bat
+++ /dev/null
@@ -1,42 +0,0 @@
-rem Licensed to the Apache Software Foundation (ASF) under one
-rem or more contributor license agreements. See the NOTICE file
-rem distributed with this work for additional information
-rem regarding copyright ownership. The ASF licenses this file
-rem to you under the Apache License, Version 2.0 (the
-rem "License"); you may not use this file except in compliance
-rem with the License. You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing,
-rem software distributed under the License is distributed on an
-rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-rem KIND, either express or implied. See the License for the
-rem specific language governing permissions and limitations
-rem under the License.
-
-@echo off
-
-:checkJava
-if "%JAVA_HOME%" == "" goto noJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto initialize
-
-:noJavaHome
-echo You must set the JAVA_HOME environment variable before running Airavata.
-goto end
-
-:initialize
-if "%XBAYA_HOME%"=="" set XBAYA_HOME=%~sdp0..
-SET curDrive=%cd:~0,1%
-SET xBayaDrive=%XBAYA_HOME:~0,1%
-if not "%curDrive%" == "%xBayaDrive%" %xBayaDrive%:
-goto updateClasspath
-
-rem ----- update classpath -----------------------------------------------------
-:updateClasspath
-cd %XBAYA_HOME%
-set XBAYA_CLASSPATH=
-FOR %%C in ("%XBAYA_HOME%\lib\*.jar") DO set XBAYA_CLASSPATH=!XBAYA_CLASSPATH!;..\lib\%%~nC%%~xC
-
-:end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/bin/setenv.sh
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/bin/setenv.sh b/modules/distribution/xbaya-gui/src/main/resources/bin/setenv.sh
deleted file mode 100755
index 84673db..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/bin/setenv.sh
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-# Get standard environment variables
-# if JAVA_HOME is not set we're not happy
-if [ -z "$JAVA_HOME" ]; then
-  echo "You must set the JAVA_HOME variable before running Airavata Scripts."
-  exit 1
-fi
-
-# OS specific support.  $var _must_ be set to either true or false.
-cygwin=false
-os400=false
-case "`uname`" in
-CYGWIN*) cygwin=true;;
-OS400*) os400=true;;
-esac
-
-# resolve links - $0 may be a softlink
-PRG="$0"
-
-while [ -h "$PRG" ]; do
-  ls=`ls -ld "$PRG"`
-  link=`expr "$ls" : '.*-> \(.*\)$'`
-  if expr "$link" : '.*/.*' > /dev/null; then
-    PRG="$link"
-  else
-    PRG=`dirname "$PRG"`/"$link"
-  fi
-done
-
-
-PRGDIR=`dirname "$PRG"`
-
-# Only set AIRAVATA_HOME if not already set
-[ -z "$AIRAVATA_HOME" ] && AIRAVATA_HOME=`cd "$PRGDIR/.." ; pwd`
-
-XBAYA_CLASSPATH=""
-
-
-
-for f in "$AIRAVATA_HOME"/lib/*.jar
-do
-  XBAYA_CLASSPATH="$XBAYA_CLASSPATH":$f
-done
-
-for f in "$AIRAVATA_HOME"/repository/services/*.jar
-do
-  XBAYA_CLASSPATH="$XBAYA_CLASSPATH":$f
-done
-
-XBAYA_CLASSPATH="$XBAYA_HOME":"$XBAYA_HOME/conf":"$XBAYA_CLASSPATH":"$CLASSPATH"
-
-
-
-
-export AIRAVATA_HOME
-export XBAYA_CLASSPATH
-
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/bin/xbaya-gui.bat
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/bin/xbaya-gui.bat b/modules/distribution/xbaya-gui/src/main/resources/bin/xbaya-gui.bat
deleted file mode 100644
index 1f46002..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/bin/xbaya-gui.bat
+++ /dev/null
@@ -1,23 +0,0 @@
-@echo off
-rem Licensed to the Apache Software Foundation (ASF) under one
-rem or more contributor license agreements. See the NOTICE file
-rem distributed with this work for additional information
-rem regarding copyright ownership. The ASF licenses this file
-rem to you under the Apache License, Version 2.0 (the
-rem "License"); you may not use this file except in compliance
-rem with the License. You may obtain a copy of the License at
-rem
-rem http://www.apache.org/licenses/LICENSE-2.0
-rem
-rem Unless required by applicable law or agreed to in writing,
-rem software distributed under the License is distributed on an
-rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-rem KIND, either express or implied. See the License for the
-rem specific language governing permissions and limitations
-rem under the License.
-
-setlocal EnableDelayedExpansion
-call "%~dp0"setenv.bat
-
-cd "%XBAYA_HOME%\bin"
-"%JAVA_HOME%\bin\java.exe" %JAVA_OPTS% -classpath "%XBAYA_CLASSPATH%" org.apache.airavata.xbaya.XBaya %*

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/bin/xbaya-gui.sh
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/bin/xbaya-gui.sh b/modules/distribution/xbaya-gui/src/main/resources/bin/xbaya-gui.sh
deleted file mode 100755
index 13ffe10..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/bin/xbaya-gui.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-. `dirname $0`/setenv.sh
-$JAVA_HOME/bin/java $JAVA_OPTS -classpath "$XBAYA_CLASSPATH" \
-    org.apache.airavata.xbaya.XBaya $* 

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/jnlp/INSTALL
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/jnlp/INSTALL b/modules/distribution/xbaya-gui/src/main/resources/jnlp/INSTALL
deleted file mode 100644
index 24ae962..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/jnlp/INSTALL
+++ /dev/null
@@ -1,48 +0,0 @@
-Installing  Apache Airavata XBaya 0.11
--------------------------------------
-
-Prerequisites
--------------
-Java 1.5 or later
-Maven (tested on v 3.0.2)
-
-Build Apache Airavata XBaya JNLP from Source
---------------------------------------------
-* Unzip/untar the source file or check out from svn.
-* cd to project folder and type
-	$ mvn clean install
-	Note: in order to skip tests use the command
-			$ mvn clean install -Dmaven.test.skip=true
-* The compressed binary distribution is created at <PROJECT DIR>/modules/distribution/xbaya-gui/target/apache-airavata-xbaya-gui-<airavata-version>-jnlp.zip
-
-Installing the JNLP Distribution
---------------------------------
-* Extract the Apache Airavata XBaya JNLP distribution to a web accessible location
-* Update the the xbaya.jnlp file "codebase" with the web access location of the jnlp
-      eg: <jnlp ... codebase="http://example-server.com/airavata/xbaya/" ...>
-           ...
-           ...
-          </jnlp> 
-
-Starting Apache Airavata XBaya JNLP
------------------------------------
-Using the web browser
-	* Using a browser navigate to the url <JNLP-web-access-url>/xbaya.jnlp
-		eg: http://example-server.com/airavata/xbaya/xbaya.jnlp
-	* Following the web start download instructions to run XBaya
-
-Using the commandline
-	* type for following command in the commandline to start the Airavata XBaya
-			$ javaws <JNLP-web-access-url>/xbaya.jnlp
-				eg: $ javaws http://example-server.com/airavata/xbaya/xbaya.jnlp
-
-Running Tests
--------------
-Once the binary is unzipped, instructions to run the tests should be followed from README
-
-Tutorials 
-----------
-The airavata website has instructions for basic tutorials:
-* For basic understanding of how Airavata works - http://airavata.apache.org/documentation/tutorials/airavata-in-5-minutes.html
-* Describing and executing applications using Airavata - http://airavata.apache.org/documentation/tutorials/airavata-in-10-minutes.html
-* Advanced tutorial to provide understanding of how to run sample workflows distributed with Airavata - http://airavata.apache.org/documentation/tutorials/advanced-workflow-samples.html


[29/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReaderTest.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReaderTest.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReaderTest.java
deleted file mode 100644
index d0f99ac..0000000
--- a/modules/security/src/test/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReaderTest.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.configurations;
-
-import junit.framework.TestCase;
-import org.apache.airavata.security.Authenticator;
-import org.apache.airavata.security.userstore.JDBCUserStore;
-import org.apache.airavata.security.userstore.LDAPUserStore;
-
-import java.io.File;
-import java.net.URLDecoder;
-import java.util.List;
-
-/**
- * A test class for authenticator configuration reader. Reads the authenticators.xml in resources directory.
- */
-public class AuthenticatorConfigurationReaderTest extends TestCase {
-
-    private String configurationFile = URLDecoder.decode(this.getClass().getClassLoader()
-            .getResource("authenticators.xml").getFile());
-
-    public void setUp() throws Exception {
-
-        File f = new File(".");
-        System.out.println(f.getAbsolutePath());
-
-        File file = new File(configurationFile);
-
-        if (!file.exists() && !file.canRead()) {
-            throw new Exception("Error reading configuration file " + configurationFile);
-
-        }
-    }
-
-    public void testInit() throws Exception {
-
-        AuthenticatorConfigurationReader authenticatorConfigurationReader = new AuthenticatorConfigurationReader();
-        authenticatorConfigurationReader.init(configurationFile);
-
-        assertTrue(AuthenticatorConfigurationReader.isAuthenticationEnabled());
-
-        List<Authenticator> authenticators = authenticatorConfigurationReader.getAuthenticatorList();
-
-        assertEquals(authenticators.size(), 3);
-
-        for (Authenticator authenticator : authenticators) {
-            if (authenticator instanceof TestDBAuthenticator1) {
-                assertEquals("dbAuthenticator1", authenticator.getAuthenticatorName());
-                assertEquals(6, authenticator.getPriority());
-                assertEquals(true, authenticator.isEnabled());
-                assertEquals("jdbc:sql:thin:@//myhost:1521/mysql1",
-                        ((TestDBAuthenticator1) authenticator).getDatabaseURL());
-                assertEquals("org.apache.derby.jdbc.ClientDriver", ((TestDBAuthenticator1) authenticator).getDatabaseDriver());
-                assertEquals("mysql1", ((TestDBAuthenticator1) authenticator).getDatabaseUserName());
-                assertEquals("secret1", ((TestDBAuthenticator1) authenticator).getDatabasePassword());
-                assertNotNull(authenticator.getUserStore());
-                assertTrue(authenticator.getUserStore() instanceof JDBCUserStore);
-
-                JDBCUserStore jdbcUserStore = (JDBCUserStore) authenticator.getUserStore();
-                assertEquals("MD5", jdbcUserStore.getPasswordDigester().getHashMethod());
-            } else if (authenticator instanceof TestDBAuthenticator2) {
-                assertEquals("dbAuthenticator2", authenticator.getAuthenticatorName());
-                assertEquals(7, authenticator.getPriority());
-                assertEquals(true, authenticator.isEnabled());
-                assertTrue(authenticator.getUserStore() instanceof LDAPUserStore);
-
-            } else if (authenticator instanceof TestDBAuthenticator3) {
-                assertEquals("dbAuthenticator3", authenticator.getAuthenticatorName());
-                assertEquals(8, authenticator.getPriority());
-                assertEquals(true, authenticator.isEnabled());
-                assertEquals("jdbc:sql:thin:@//myhost:1521/mysql3",
-                        ((TestDBAuthenticator3) authenticator).getDatabaseURL());
-                assertEquals("org.apache.derby.jdbc.ClientDriver", ((TestDBAuthenticator3) authenticator).getDatabaseDriver());
-                assertEquals("mysql3", ((TestDBAuthenticator3) authenticator).getDatabaseUserName());
-                assertEquals("secret3", ((TestDBAuthenticator3) authenticator).getDatabasePassword());
-                assertNotNull(authenticator.getUserStore());
-                assertTrue(authenticator.getUserStore() instanceof JDBCUserStore);
-
-            }
-        }
-
-        assertEquals(8, authenticators.get(0).getPriority());
-        assertEquals(7, authenticators.get(1).getPriority());
-        assertEquals(6, authenticators.get(2).getPriority());
-
-    }
-
-    public void testDisabledAuthenticator() throws Exception {
-
-        String disabledConfiguration = URLDecoder.decode(this.getClass().getClassLoader()
-                .getResource("disabled-authenticator.xml").getFile());
-
-        AuthenticatorConfigurationReader authenticatorConfigurationReader = new AuthenticatorConfigurationReader();
-        authenticatorConfigurationReader.init(disabledConfiguration);
-
-        assertFalse(AuthenticatorConfigurationReader.isAuthenticationEnabled());
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator1.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator1.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator1.java
deleted file mode 100644
index 00712c0..0000000
--- a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator1.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.configurations;
-
-import org.apache.airavata.security.AbstractDatabaseAuthenticator;
-import org.apache.airavata.security.AuthenticationException;
-
-public class TestDBAuthenticator1 extends AbstractDatabaseAuthenticator {
-
-    public TestDBAuthenticator1() {
-        super();
-    }
-
-    @Override
-    public void onSuccessfulAuthentication(Object authenticationInfo) {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void onFailedAuthentication(Object authenticationInfo) {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean authenticate(Object credentials) throws AuthenticationException {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isAuthenticated(Object credentials) {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator2.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator2.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator2.java
deleted file mode 100644
index 75f45c4..0000000
--- a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator2.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.configurations;
-
-import org.apache.airavata.security.AbstractAuthenticator;
-import org.apache.airavata.security.AuthenticationException;
-import org.w3c.dom.Node;
-
-public class TestDBAuthenticator2 extends AbstractAuthenticator {
-
-    public TestDBAuthenticator2() {
-        super();
-    }
-
-    @Override
-    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void onSuccessfulAuthentication(Object authenticationInfo) {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void onFailedAuthentication(Object authenticationInfo) {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isAuthenticated(Object credentials) {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void configure(Node node) throws RuntimeException {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator3.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator3.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator3.java
deleted file mode 100644
index 7523835..0000000
--- a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator3.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.security.configurations;
-
-import org.apache.airavata.security.AbstractDatabaseAuthenticator;
-import org.apache.airavata.security.AuthenticationException;
-
-public class TestDBAuthenticator3 extends AbstractDatabaseAuthenticator {
-
-    public TestDBAuthenticator3() {
-        super();
-    }
-
-    @Override
-    public void onSuccessfulAuthentication(Object authenticationInfo) {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void onFailedAuthentication(Object authenticationInfo) {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean authenticate(Object credentials) throws AuthenticationException {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isAuthenticated(Object credentials) {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/java/org/apache/airavata/security/configurations/TestUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestUserStore.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestUserStore.java
deleted file mode 100644
index a16c0ac..0000000
--- a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestUserStore.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- *  *
- *  * Licensed to the Apache Software Foundation (ASF) under one
- *  * or more contributor license agreements.  See the NOTICE file
- *  * distributed with this work for additional information
- *  * regarding copyright ownership.  The ASF licenses this file
- *  * to you under the Apache License, Version 2.0 (the
- *  * "License"); you may not use this file except in compliance
- *  * with the License.  You may obtain a copy of the License at
- *  *
- *  *   http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing,
- *  * software distributed under the License is distributed on an
- *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  * KIND, either express or implied.  See the License for the
- *  * specific language governing permissions and limitations
- *  * under the License.
- *  *
- *
- */
-
-package org.apache.airavata.security.configurations;
-
-import org.apache.airavata.security.UserStore;
-import org.w3c.dom.Node;
-
-/**
- * Test user store class.
- */
-public class TestUserStore implements UserStore {
-    @Override
-    public boolean authenticate(String userName, Object credentials) {
-        return false;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean authenticate(Object credentials) {
-        return false;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void configure(Node node) throws RuntimeException {
-        //To change body of implemented methods use File | Settings | File Templates.
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/java/org/apache/airavata/security/userstore/JDBCUserStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/userstore/JDBCUserStoreTest.java b/modules/security/src/test/java/org/apache/airavata/security/userstore/JDBCUserStoreTest.java
deleted file mode 100644
index 65bb924..0000000
--- a/modules/security/src/test/java/org/apache/airavata/security/userstore/JDBCUserStoreTest.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- *  *
- *  * Licensed to the Apache Software Foundation (ASF) under one
- *  * or more contributor license agreements.  See the NOTICE file
- *  * distributed with this work for additional information
- *  * regarding copyright ownership.  The ASF licenses this file
- *  * to you under the Apache License, Version 2.0 (the
- *  * "License"); you may not use this file except in compliance
- *  * with the License.  You may obtain a copy of the License at
- *  *
- *  *   http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing,
- *  * software distributed under the License is distributed on an
- *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  * KIND, either express or implied.  See the License for the
- *  * specific language governing permissions and limitations
- *  * under the License.
- *  *
- *
- */
-
-package org.apache.airavata.security.userstore;
-
-import org.apache.airavata.common.utils.DatabaseTestCases;
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.apache.airavata.security.UserStore;
-import org.junit.*;
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-/**
- * Test class for JDBC user store.
- */
-public class JDBCUserStoreTest extends DatabaseTestCases {
-
-    /**
-     * <specificConfigurations>
-     <database>
-     <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
-     <jdbcUrl>jdbc:h2:src/test/resources/testdb/test</jdbcUrl>
-     <userName>sa</userName>
-     <password>sa</password>
-     <databaseDriver>org.h2.Driver</databaseDriver>
-     <userTableName>AIRAVATA_USER</userTableName>
-     <userNameColumnName>USERID</userNameColumnName>
-     <passwordColumnName>PASSWORD</passwordColumnName>
-     </database>
-     </specificConfigurations>
-     * @throws Exception
-     */
-
-
-    @BeforeClass
-    public static void setUpDatabase() throws Exception{
-        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
-
-        waitTillServerStarts();
-
-        String dropTable = "drop table AIRAVATA_USER";
-
-        try {
-            executeSQL(dropTable);
-        } catch (Exception e) {
-        }
-
-        String createTable = "create table AIRAVATA_USER ( USERID varchar(255), PASSWORD varchar(255) )";
-        executeSQL(createTable);
-
-        String insertSQL = "INSERT INTO AIRAVATA_USER VALUES('amilaj', 'secret')";
-        executeSQL(insertSQL);
-
-
-    }
-
-    @AfterClass
-    public static void shutDownDatabase() throws Exception {
-        DerbyUtil.stopDerbyServer();
-    }
-
-    @Before
-    public void setUp() throws Exception{
-    }
-
-    @Test
-    public void testAuthenticate() throws Exception {
-
-        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
-        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
-        Document doc = dBuilder.parse(this.getClass().getClassLoader().getResourceAsStream("jdbc-authenticator.xml"));
-        doc.getDocumentElement().normalize();
-
-        NodeList configurations = doc.getElementsByTagName("specificConfigurations");
-        UserStore userStore = new JDBCUserStore();
-        userStore.configure(configurations.item(0));
-
-        Assert.assertTrue(userStore.authenticate("amilaj", "secret"));
-        Assert.assertFalse(userStore.authenticate("amilaj", "1secret"));
-        Assert.assertFalse(userStore.authenticate("lahiru", "1234"));
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/java/org/apache/airavata/security/userstore/LDAPUserStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/userstore/LDAPUserStoreTest.java b/modules/security/src/test/java/org/apache/airavata/security/userstore/LDAPUserStoreTest.java
deleted file mode 100644
index 5749d8a..0000000
--- a/modules/security/src/test/java/org/apache/airavata/security/userstore/LDAPUserStoreTest.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- *  *
- *  * Licensed to the Apache Software Foundation (ASF) under one
- *  * or more contributor license agreements.  See the NOTICE file
- *  * distributed with this work for additional information
- *  * regarding copyright ownership.  The ASF licenses this file
- *  * to you under the Apache License, Version 2.0 (the
- *  * "License"); you may not use this file except in compliance
- *  * with the License.  You may obtain a copy of the License at
- *  *
- *  *   http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing,
- *  * software distributed under the License is distributed on an
- *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  * KIND, either express or implied.  See the License for the
- *  * specific language governing permissions and limitations
- *  * under the License.
- *  *
- *
- */
-
-package org.apache.airavata.security.userstore;
-
-import junit.framework.TestCase;
-import org.apache.airavata.security.UserStore;
-import org.junit.Ignore;
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-/**
- * User store test 2
- */
-@Ignore("Need LDAP server to run these tests")
-public class LDAPUserStoreTest extends TestCase{
-
-    private LDAPUserStore ldapUserStore;
-
-    public void setUp() {
-        ldapUserStore = new LDAPUserStore();
-
-        ldapUserStore.initializeLDAP("ldap://localhost:10389", "admin", "secret", "uid={0},ou=system");
-    }
-
-    public void testAuthenticate() throws Exception {
-        assertTrue(ldapUserStore.authenticate("amilaj", "secret"));
-        assertFalse(ldapUserStore.authenticate("amilaj", "secret1"));
-    }
-
-    public void testConfigure() throws Exception {
-        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
-        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
-        Document doc = dBuilder.parse(this.getClass().getClassLoader().getResourceAsStream("ldap-authenticator.xml"));
-        doc.getDocumentElement().normalize();
-
-        NodeList configurations = doc.getElementsByTagName("specificConfigurations");
-        UserStore userStore = new LDAPUserStore();
-        userStore.configure(configurations.item(0));
-
-        assertTrue(userStore.authenticate("amilaj", "secret"));
-    }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/java/org/apache/airavata/security/userstore/SessionDBUserStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/userstore/SessionDBUserStoreTest.java b/modules/security/src/test/java/org/apache/airavata/security/userstore/SessionDBUserStoreTest.java
deleted file mode 100644
index 9059c9a..0000000
--- a/modules/security/src/test/java/org/apache/airavata/security/userstore/SessionDBUserStoreTest.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- *
- *  *
- *  * Licensed to the Apache Software Foundation (ASF) under one
- *  * or more contributor license agreements.  See the NOTICE file
- *  * distributed with this work for additional information
- *  * regarding copyright ownership.  The ASF licenses this file
- *  * to you under the Apache License, Version 2.0 (the
- *  * "License"); you may not use this file except in compliance
- *  * with the License.  You may obtain a copy of the License at
- *  *
- *  *   http://www.apache.org/licenses/LICENSE-2.0
- *  *
- *  * Unless required by applicable law or agreed to in writing,
- *  * software distributed under the License is distributed on an
- *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- *  * KIND, either express or implied.  See the License for the
- *  * specific language governing permissions and limitations
- *  * under the License.
- *  *
- *
- */
-
-package org.apache.airavata.security.userstore;
-
-import junit.framework.TestCase;
-import org.apache.airavata.common.utils.DatabaseTestCases;
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.junit.*;
-import org.w3c.dom.Document;
-import org.w3c.dom.NodeList;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import java.io.File;
-import java.io.InputStream;
-
-/**
- * Test class for session DB authenticator.
- */
-
-public class SessionDBUserStoreTest extends DatabaseTestCases {
-
-    @BeforeClass
-    public static void setUpDatabase() throws Exception{
-        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
-
-        waitTillServerStarts();
-
-        String dropTable = "drop table Persons";
-
-        try {
-            executeSQL(dropTable);
-        } catch (Exception e) {
-        }
-
-        String createTable = "create table Persons ( sessionId varchar(255) )";
-        executeSQL(createTable);
-
-        String insertSQL = "INSERT INTO Persons VALUES('1234')";
-        executeSQL(insertSQL);
-    }
-
-    @AfterClass
-    public static void shutDownDatabase() throws Exception {
-        DerbyUtil.stopDerbyServer();
-    }
-
-    @Before
-    public void setUp() throws Exception{
-
-        loadConfigurations();
-
-    }
-
-    private SessionDBUserStore sessionDBUserStore = new SessionDBUserStore();
-
-    private InputStream configurationFileStream
-            = this.getClass().getClassLoader().getResourceAsStream("session-authenticator.xml");
-
-    private void loadConfigurations () throws Exception {
-        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
-        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
-        Document doc = dBuilder.parse(configurationFileStream);
-        doc.getDocumentElement().normalize();
-
-        NodeList specificConfigurations = doc.getElementsByTagName("specificConfigurations");
-        sessionDBUserStore.configure(specificConfigurations.item(0));
-    }
-
-    @Test
-    public void testAuthenticate() throws Exception {
-        Assert.assertTrue(sessionDBUserStore.authenticate("1234"));
-
-    }
-
-    @Test
-    public void testAuthenticateFailure() throws Exception  {
-        Assert.assertFalse(sessionDBUserStore.authenticate("12345"));
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/resources/authenticators.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/authenticators.xml b/modules/security/src/test/resources/authenticators.xml
deleted file mode 100644
index 46d71cd..0000000
--- a/modules/security/src/test/resources/authenticators.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
-    contributor license agreements. See the NOTICE file ~ distributed with this
-    work for additional information ~ regarding copyright ownership. The ASF
-    licenses this file ~ to you under the Apache License, Version 2.0 (the ~
-    "License"); you may not use this file except in compliance ~ with the License.
-    You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
-    ~ ~ Unless required by applicable law or agreed to in writing, ~ software
-    distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
-    WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
-    License for the ~ specific language governing permissions and limitations
-    ~ under the License. -->
-
-<!--
-This file contains a sample authenticator configuration. We can define all authenticators in this file. Each authenticator
-configuration has to start with tag "authenticator". The name is the name given to the authenticator. The actual
-authenticator implementation is implemented in the class. There are configurations specific to authenticators.
-Those configurations are reside inside &lt;specificConfigurations&gt; tags.
--->
-
-<authenticators>
-    <authenticator name="dbAuthenticator1" class="org.apache.airavata.security.configurations.TestDBAuthenticator1"
-                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql1</jdbcUrl>
-                <userName>mysql1</userName>
-                <password>secret1</password>
-                <passwordHashMethod>MD5</passwordHashMethod>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Session1</sessionTable>
-                <sessionColumn>sessioncolumn</sessionColumn>
-                <comparingColumn>comparecolumn</comparingColumn>
-                <!-- TODO add datasource.name></datasource.name -->
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-    <authenticator name="dbAuthenticator2" class="org.apache.airavata.security.configurations.TestDBAuthenticator2"
-                   enabled="true" priority="7" userstore="org.apache.airavata.security.userstore.LDAPUserStore">
-        <specificConfigurations>
-            <ldap>
-                <!--
-                url - The URL which LDAP server is listening for requests
-                systemUser - The DN of the LDAP server connection user
-                systemUserPassword - The password of the LDAP server connection user
-                userDNTemplate - The DN structure of the users in LDAP
-            -->
-                <url>ldap://localhost:10389</url>
-                <systemUser>admin</systemUser>
-                <systemUserPassword>secret</systemUserPassword>
-                <userDNTemplate>uid={0},ou=system</userDNTemplate>
-            </ldap>
-        </specificConfigurations>
-    </authenticator>
-
-    <authenticator name="dbAuthenticator4" class="org.apache.airavata.security.configurations.TestDBAuthenticator2"
-                   enabled="false" priority="7" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql2</jdbcUrl>
-                <userName>mysql2</userName>
-                <password>secret2</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Session2</sessionTable>
-                <sessionColumn>sessioncolumn2</sessionColumn>
-                <comparingColumn>comparecolumn2</comparingColumn>
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-    <authenticator name="dbAuthenticator3" class="org.apache.airavata.security.configurations.TestDBAuthenticator3"
-                   enabled="true" priority="8" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql3</jdbcUrl>
-                <userName>mysql3</userName>
-                <password>secret3</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Session3</sessionTable>
-                <sessionColumn>sessioncolumn3</sessionColumn>
-                <comparingColumn>comparecolumn3</comparingColumn>
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-</authenticators>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/resources/disabled-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/disabled-authenticator.xml b/modules/security/src/test/resources/disabled-authenticator.xml
deleted file mode 100644
index 627ba57..0000000
--- a/modules/security/src/test/resources/disabled-authenticator.xml
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
-    contributor license agreements. See the NOTICE file ~ distributed with this
-    work for additional information ~ regarding copyright ownership. The ASF
-    licenses this file ~ to you under the Apache License, Version 2.0 (the ~
-    "License"); you may not use this file except in compliance ~ with the License.
-    You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
-    ~ ~ Unless required by applicable law or agreed to in writing, ~ software
-    distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
-    WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
-    License for the ~ specific language governing permissions and limitations
-    ~ under the License. -->
-
-<!--
-This file contains a sample authenticator configuration. We can define all authenticators in this file. Each authenticator
-configuration has to start with tag "authenticator". The name is the name given to the authenticator. The actual
-authenticator implementation is implemented in the class. There are configurations specific to authenticators.
-Those configurations are reside inside &lt;specificConfigurations&gt; tags.
--->
-
-<authenticators enabled="false">
-    <authenticator name="dbAuthenticator1" class="org.apache.airavata.security.configurations.TestDBAuthenticator1"
-                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql1</jdbcUrl>
-                <userName>mysql1</userName>
-                <password>secret1</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Session1</sessionTable>
-                <sessionColumn>sessioncolumn</sessionColumn>
-                <comparingColumn>comparecolumn</comparingColumn>
-                <!-- TODO add datasource.name></datasource.name -->
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-    <authenticator name="dbAuthenticator2" class="org.apache.airavata.security.configurations.TestDBAuthenticator2"
-                   enabled="true" priority="7" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql2</jdbcUrl>
-                <userName>mysql2</userName>
-                <password>secret2</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Session2</sessionTable>
-                <sessionColumn>sessioncolumn2</sessionColumn>
-                <comparingColumn>comparecolumn2</comparingColumn>
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-    <authenticator name="dbAuthenticator4" class="org.apache.airavata.security.configurations.TestDBAuthenticator2"
-                   enabled="false" priority="7" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql2</jdbcUrl>
-                <userName>mysql2</userName>
-                <password>secret2</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Session2</sessionTable>
-                <sessionColumn>sessioncolumn2</sessionColumn>
-                <comparingColumn>comparecolumn2</comparingColumn>
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-    <authenticator name="dbAuthenticator3" class="org.apache.airavata.security.configurations.TestDBAuthenticator3"
-                   enabled="true" priority="8" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql3</jdbcUrl>
-                <userName>mysql3</userName>
-                <password>secret3</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Session3</sessionTable>
-                <sessionColumn>sessioncolumn3</sessionColumn>
-                <comparingColumn>comparecolumn3</comparingColumn>
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-</authenticators>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/resources/jdbc-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/jdbc-authenticator.xml b/modules/security/src/test/resources/jdbc-authenticator.xml
deleted file mode 100644
index c27b60f..0000000
--- a/modules/security/src/test/resources/jdbc-authenticator.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<!--
-  ~ /*
-  ~  *
-  ~  * Licensed to the Apache Software Foundation (ASF) under one
-  ~  * or more contributor license agreements.  See the NOTICE file
-  ~  * distributed with this work for additional information
-  ~  * regarding copyright ownership.  The ASF licenses this file
-  ~  * to you under the Apache License, Version 2.0 (the
-  ~  * "License"); you may not use this file except in compliance
-  ~  * with the License.  You may obtain a copy of the License at
-  ~  *
-  ~  *   http://www.apache.org/licenses/LICENSE-2.0
-  ~  *
-  ~  * Unless required by applicable law or agreed to in writing,
-  ~  * software distributed under the License is distributed on an
-  ~  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~  * KIND, either express or implied.  See the License for the
-  ~  * specific language governing permissions and limitations
-  ~  * under the License.
-  ~  *
-  ~  */
-  -->
-<authenticators>
-    <authenticator name="dbAuthenticator1" class="org.apache.airavata.security.configurations.TestDBAuthenticator1"
-                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
-                <jdbcUrl>jdbc:derby://localhost:20000/persistent_data;create=true</jdbcUrl>
-                <userName>admin</userName>
-                <password>admin</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <userTableName>AIRAVATA_USER</userTableName>
-                <userNameColumnName>USERID</userNameColumnName>
-                <passwordColumnName>PASSWORD</passwordColumnName>
-            </database>
-        </specificConfigurations>
-    </authenticator>
-</authenticators>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/resources/ldap-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/ldap-authenticator.xml b/modules/security/src/test/resources/ldap-authenticator.xml
deleted file mode 100644
index 651920f..0000000
--- a/modules/security/src/test/resources/ldap-authenticator.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
-  ~ /*
-  ~  *
-  ~  * Licensed to the Apache Software Foundation (ASF) under one
-  ~  * or more contributor license agreements.  See the NOTICE file
-  ~  * distributed with this work for additional information
-  ~  * regarding copyright ownership.  The ASF licenses this file
-  ~  * to you under the Apache License, Version 2.0 (the
-  ~  * "License"); you may not use this file except in compliance
-  ~  * with the License.  You may obtain a copy of the License at
-  ~  *
-  ~  *   http://www.apache.org/licenses/LICENSE-2.0
-  ~  *
-  ~  * Unless required by applicable law or agreed to in writing,
-  ~  * software distributed under the License is distributed on an
-  ~  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~  * KIND, either express or implied.  See the License for the
-  ~  * specific language governing permissions and limitations
-  ~  * under the License.
-  ~  *
-  ~  */
-  -->
-<authenticators>
-    <authenticator name="dbAuthenticator1" class="org.apache.airavata.security.configurations.TestDBAuthenticator1"
-                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.LDAPUserStore">
-        <specificConfigurations>
-            <ldap>
-                <!--
-                url - The URL which LDAP server is listening for requests
-                systemUser - The DN of the LDAP server connection user
-                systemUserPassword - The password of the LDAP server connection user
-                userDNTemplate - The DN structure of the users in LDAP
-            -->
-                <url>ldap://localhost:10389</url>
-                <systemUser>admin</systemUser>
-                <systemUserPassword>secret</systemUserPassword>
-                <userDNTemplate>uid={0},ou=system</userDNTemplate>
-            </ldap>
-        </specificConfigurations>
-    </authenticator>
-</authenticators>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/security/src/test/resources/session-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/session-authenticator.xml b/modules/security/src/test/resources/session-authenticator.xml
deleted file mode 100644
index 670913e..0000000
--- a/modules/security/src/test/resources/session-authenticator.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<!--
-  ~ /*
-  ~  *
-  ~  * Licensed to the Apache Software Foundation (ASF) under one
-  ~  * or more contributor license agreements.  See the NOTICE file
-  ~  * distributed with this work for additional information
-  ~  * regarding copyright ownership.  The ASF licenses this file
-  ~  * to you under the Apache License, Version 2.0 (the
-  ~  * "License"); you may not use this file except in compliance
-  ~  * with the License.  You may obtain a copy of the License at
-  ~  *
-  ~  *   http://www.apache.org/licenses/LICENSE-2.0
-  ~  *
-  ~  * Unless required by applicable law or agreed to in writing,
-  ~  * software distributed under the License is distributed on an
-  ~  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~  * KIND, either express or implied.  See the License for the
-  ~  * specific language governing permissions and limitations
-  ~  * under the License.
-  ~  *
-  ~  */
-  -->
-
-<authenticators>
-    <authenticator name="sessionAuthenticator" class="org.apache.airavata.services.registry.rest.security.session.SessionAuthenticator"
-                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.SessionDBUserStore">
-        <specificConfigurations>
-            <database>
-                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
-                <!-- Points to /Users/thejaka/development/apache/airavata/trunk/modules/commons/airavata-registry-rest/target/tomcat6x/. -->
-                <jdbcUrl>jdbc:derby://localhost:20000/persistent_data;create=true</jdbcUrl>
-
-                <!--jdbcUrl>jdbc:h2:modules/security/src/test/resources/testdb/test</jdbcUrl-->
-
-                <userName>admin</userName>
-                <password>admin</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Persons</sessionTable>
-                <sessionColumn>sessionId</sessionColumn>
-                <comparingColumn>sessionId</comparingColumn>
-            </database>
-        </specificConfigurations>
-    </authenticator>
- </authenticators>
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/workflow-interpreter/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-interpreter/pom.xml b/modules/workflow-interpreter/pom.xml
deleted file mode 100644
index c0845d1..0000000
--- a/modules/workflow-interpreter/pom.xml
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata</artifactId>
-        <version>0.6-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-workflow-interpreter</artifactId>
-    <name>Airavata Workflow Interpreter</name>
-    <url>http://airavata.apache.org/</url>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-xbaya-gui</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-
-    <build>
-        <defaultGoal>install</defaultGoal>
-        <sourceDirectory>src</sourceDirectory>
-        <testSourceDirectory>test</testSourceDirectory>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.axis2</groupId>
-                <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
-                <version>${axis2.version}</version>
-                <configuration>
-                    <generateServerSide>true</generateServerSide>
-                    <generateServicesXml>false</generateServicesXml>
-                    <generateTestcase>true</generateTestcase>
-                    <outputDirectory>target/generated/wsdl2code</outputDirectory>
-                    <packageName>org.apache.airavata.workflow.interpreter</packageName>
-                    <wsdlFile>${pom.basedir}/src/main/resources/WorkflowInterpretor.wsdl</wsdlFile>
-                    <databindingName>xmlbeans</databindingName>
-                </configuration>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>wsdl2code</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.axis2</groupId>
-                <artifactId>axis2-aar-maven-plugin</artifactId>
-                <version>${axis2.version}</version>
-                <configuration>
-                    <servicesXmlFile>${pom.basedir}/src/main/resources/services.xml</servicesXmlFile>
-                    <wsdlFile>${pom.basedir}/src/main/resources/WorkflowInterpretor.wsdl</wsdlFile>
-                </configuration>
-                <executions>
-                    <execution>
-                        <id>createAAR</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>aar</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-        <resources>
-            <resource>
-                <directory>resources</directory>
-                <targetPath>META-INF</targetPath>
-                <includes>
-                    <include>**/*.wsdl</include>
-                    <include>**/*.xml</include>
-                </includes>
-            </resource>
-            <resource>
-                <directory>${pom.basedir}/target/generated/wsdl2code/resources</directory>
-                <includes>
-                    <include>**/**</include>
-                </includes>
-            </resource>
-        </resources>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/workflow-interpreter/src/main/resources/WorkflowInterpretor.wsdl
----------------------------------------------------------------------
diff --git a/modules/workflow-interpreter/src/main/resources/WorkflowInterpretor.wsdl b/modules/workflow-interpreter/src/main/resources/WorkflowInterpretor.wsdl
deleted file mode 100644
index dd5a8a0..0000000
--- a/modules/workflow-interpreter/src/main/resources/WorkflowInterpretor.wsdl
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY ~ KIND, either express or implied. See the License for the specific 
-	language governing permissions and limitations under the License. -->
-
-<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
-	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
-	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ns="http://workflow.airavata.apache.org"
-	xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" targetNamespace="http://workflow.airavata.apache.org">
-
-	<wsdl:types>
-		<xs:schema targetNamespace="http://workflow.airavata.apache.org">
-			<xs:element name="launchWorkflow">
-				<xs:complexType>
-					<xs:sequence>
-						<xs:element minOccurs="0" name="workflowAsString"
-							nillable="true" type="xs:string" />
-						<xs:element minOccurs="0" name="topic" nillable="true"
-							type="xs:string" />
-						<xs:element maxOccurs="unbounded" minOccurs="0" name="inputs"
-							nillable="true" type="ns:NameValue" />
-						<xs:element maxOccurs="unbounded" minOccurs="0"
-							name="configurations" nillable="true" type="ns:NameValue" />
-					</xs:sequence>
-				</xs:complexType>
-			</xs:element>
-			<xs:element name="launchWorkflowResponse">
-				<xs:complexType>
-					<xs:sequence>
-						<xs:element minOccurs="0" name="return" nillable="true"
-							type="xs:string" />
-					</xs:sequence>
-				</xs:complexType>
-			</xs:element>
-			<xs:complexType name="NameValue">
-				<xs:sequence>
-					<xs:element minOccurs="0" name="name" nillable="true"
-						type="xs:string" />
-					<xs:element minOccurs="0" name="value" nillable="true"
-						type="xs:string" />
-				</xs:sequence>
-			</xs:complexType>
-		</xs:schema>
-	</wsdl:types>
-	<wsdl:message name="launchWorkflowRequest">
-		<wsdl:part name="parameters" element="ns:launchWorkflow">
-		</wsdl:part>
-	</wsdl:message>
-	<wsdl:message name="launchWorkflowResponse">
-		<wsdl:part name="parameters" element="ns:launchWorkflowResponse">
-		</wsdl:part>
-	</wsdl:message>
-	<wsdl:portType name="WorkflowInterpretorPortType">
-		<wsdl:operation name="launchWorkflow">
-			<wsdl:input message="ns:launchWorkflowRequest"
-				wsaw:Action="urn:launchWorkflow">
-			</wsdl:input>
-			<wsdl:output message="ns:launchWorkflowResponse"
-				wsaw:Action="urn:launchWorkflowResponse">
-			</wsdl:output>
-		</wsdl:operation>
-	</wsdl:portType>
-	<wsdl:binding name="WorkflowInterpretorSoap11Binding"
-		type="ns:WorkflowInterpretorPortType">
-		<soap:binding style="document"
-			transport="http://schemas.xmlsoap.org/soap/http" />
-		<wsdl:operation name="launchWorkflow">
-			<soap:operation soapAction="urn:launchWorkflow" style="document" />
-			<wsdl:input>
-				<soap:body use="literal" />
-			</wsdl:input>
-			<wsdl:output>
-				<soap:body use="literal" />
-			</wsdl:output>
-		</wsdl:operation>
-	</wsdl:binding>
-	<wsdl:service name="WorkflowInterpretor">
-		<wsdl:port name="WorkflowInterpretorHttpSoap11Endpoint"
-			binding="ns:WorkflowInterpretorSoap11Binding">
-			<soap:address
-				location="http://localhost:8080/axis2/services/WorkflowInterpretor" />
-		</wsdl:port>
-	</wsdl:service>
-</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/workflow-interpreter/src/main/resources/services.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-interpreter/src/main/resources/services.xml b/modules/workflow-interpreter/src/main/resources/services.xml
deleted file mode 100644
index 5a5b034..0000000
--- a/modules/workflow-interpreter/src/main/resources/services.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY ~ KIND, either express or implied. See the License for the specific 
-	language governing permissions and limitations under the License. -->
-
-<serviceGroup>
-    <service name="WorkflowInterpretor">
-        <messageReceivers>
-            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.airavata.workflow.interpreter.WorkflowInterpretorMessageReceiverInOut"/>
-        </messageReceivers>
-        <parameter name="ServiceClass">org.apache.airavata.workflow.interpreter.WorkflowInterpretorSkeleton</parameter>
-        <parameter name="useOriginalwsdl">true</parameter>
-        <parameter name="modifyUserWSDLPortAddress">true</parameter>
-        <operation name="launchWorkflow" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://workflow.airavata.apache.org">
-            <actionMapping>urn:launchWorkflow</actionMapping>
-            <outputActionMapping>urn:launchWorkflowResponse</outputActionMapping>
-        </operation>
-    </service>
-</serviceGroup>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/workflow-model/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/pom.xml b/modules/workflow-model/pom.xml
index b58f5e0..81959da 100644
--- a/modules/workflow-model/pom.xml
+++ b/modules/workflow-model/pom.xml
@@ -25,8 +25,5 @@
 
 	<modules>
 		<module>workflow-model-core</module>
-		<!--module>workflow-model-component</module>
-		<module>workflow-model-component-node</module-->
-		<!--module>workflow-engine</module-->
 	</modules>
 </project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/workflow-model/workflow-model-component-node/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-model-component-node/pom.xml b/modules/workflow-model/workflow-model-component-node/pom.xml
deleted file mode 100644
index c901bd9..0000000
--- a/modules/workflow-model/workflow-model-component-node/pom.xml
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata-workflow-model-parent</artifactId>
-        <version>0.12-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-workflow-model-component-node</artifactId>
-    <packaging>jar</packaging>
-    <name>Airavata Workflow Component Node</name>
-    <url>http://airavata.apache.org/</url>
-
-    <!-- Edit the following properties. -->
-    <profiles>
-        <profile>
-            <id>collective</id>
-            <activation>
-                <file>
-                    <exists>betacollective</exists>
-                </file>
-            </activation>
-            <properties>
-                <!-- Inherited from the parent in this collective build. -->
-                <ssl.trustedCertsFile>${trustedCertsLocation}</ssl.trustedCertsFile>
-                <build.scope>provided</build.scope>
-                <build.jsf>compile</build.jsf>
-            </properties>
-        </profile>
-    </profiles>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>xsul</artifactId>
-            <version>${xsul.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>atomixmiser</artifactId>
-            <version>${atomixmiser.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-common-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-            <version>${org.slf4j.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>${org.slf4j.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/workflow-model/workflow-model-component/pom.xml
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-model-component/pom.xml b/modules/workflow-model/workflow-model-component/pom.xml
deleted file mode 100644
index 0a08064..0000000
--- a/modules/workflow-model/workflow-model-component/pom.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata-workflow-model-parent</artifactId>
-        <version>0.12-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-workflow-model-component</artifactId>
-    <packaging>jar</packaging>
-    <name>Airavata Workflow Component</name>
-    <url>http://airavata.apache.org/</url>
-
-    <!-- Edit the following properties. -->
-    <profiles>
-        <profile>
-            <id>collective</id>
-            <activation>
-                <file>
-                    <exists>betacollective</exists>
-                </file>
-            </activation>
-            <properties>
-                <!-- Inherited from the parent in this collective build. -->
-                <ssl.trustedCertsFile>${trustedCertsLocation}</ssl.trustedCertsFile>
-                <build.scope>provided</build.scope>
-                <build.jsf>compile</build.jsf>
-            </properties>
-        </profile>
-    </profiles>
-
-
-    <dependencies>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>xsul</artifactId>
-            <version>${xsul.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-common-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-client-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-            <version>${org.slf4j.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>${org.slf4j.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentReference.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentReference.java b/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentReference.java
deleted file mode 100644
index de5f78c..0000000
--- a/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentReference.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.workflow.model.component.registry;
-
-import java.util.List;
-
-import org.apache.airavata.workflow.model.component.Component;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentReference;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.component.ws.WSComponent;
-import org.apache.airavata.workflow.model.component.ws.WSComponentFactory;
-
-public class JCRComponentReference extends ComponentReference {
-
-    private String wsdl;
-
-    private List<WSComponent> components;
-
-    public JCRComponentReference(String name, String wsdl) {
-        super(name);
-        this.wsdl = wsdl;
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws ComponentRegistryException
-     * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponent()
-     */
-    @Override
-    @Deprecated
-    public Component getComponent() throws ComponentException, ComponentRegistryException {
-        return getComponents().get(0);
-    }
-
-    /**
-     * @see org.apache.airavata.workflow.model.component.ComponentReference#getComponents()
-     */
-    @Override
-    public List<WSComponent> getComponents() throws ComponentRegistryException, ComponentException {
-        if (this.components == null) {
-            this.components = WSComponentFactory.createComponents(wsdl);
-        }
-        return this.components;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
----------------------------------------------------------------------
diff --git a/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java b/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
deleted file mode 100644
index 5062dfd..0000000
--- a/modules/workflow-model/workflow-model-component/src/main/java/org/apache/airavata/workflow/model/component/registry/JCRComponentRegistry.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.workflow.model.component.registry;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.util.WebServiceUtil;
-import org.apache.airavata.workflow.model.component.ComponentReference;
-import org.apache.airavata.workflow.model.component.ComponentRegistry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JCRComponentRegistry extends ComponentRegistry {
-
-    private static final Logger log = LoggerFactory.getLogger(JCRComponentRegistry.class);
-    private static final String NAME = "Application Services";
-//    public static final String REPOSITORY_PROPERTIES = "airavata-server.properties";
-
-    private AiravataAPI airavataAPI;
-
-    public JCRComponentRegistry(AiravataAPI airavataAPI) {
-        this.setAiravataAPI(airavataAPI);
-    }
-
-//    public JCRComponentRegistry(String username, String password) throws RegistryException {
-//        String gatewayName=null;
-//        String registryURL = null;
-//        AiravataRegistryConnectionDataProvider provider = AiravataRegistryFactory.getRegistryConnectionDataProvider();
-//		if (provider==null){
-//	        URL configURL = this.getClass().getClassLoader().getResource(REPOSITORY_PROPERTIES);
-//	        if(configURL != null){
-//		        try {
-//			        Properties properties = new Properties();
-//		            properties.load(configURL.openStream());
-//		            if (username==null){
-//			            if(properties.get(RegistryConstants.KEY_DEFAULT_REGISTRY_USER) != null){
-//			                username = (String)properties.get(RegistryConstants.KEY_DEFAULT_REGISTRY_USER);
-//			            }
-//		            }
-//		            gatewayName = (String)properties.get(RegistryConstants.KEY_DEFAULT_GATEWAY_ID);
-//                    registryURL =  properties.getProperty(RegistryConstants.KEY_DEFAULT_REGISTRY_URL);
-//		        } catch (MalformedURLException e) {
-//		            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//		        } catch (IOException e) {
-//		            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//		        }
-//	        }
-//        }else{
-//        	try {
-//				if (username==null){
-//					username=provider.getValue(RegistryConstants.KEY_DEFAULT_REGISTRY_USER).toString();
-//				}
-//				gatewayName = provider.getValue(RegistryConstants.KEY_DEFAULT_GATEWAY_ID).toString();
-//                registryURL = provider.getValue(RegistryConstants.KEY_DEFAULT_REGISTRY_URL).toString();
-//			} catch (Exception e) {
-//				log.warn(e.getMessage());
-//			}
-//        }
-//        if (username==null){
-//        	username="admin";
-//        }
-//        if (gatewayName==null){
-//        	gatewayName="default";
-//        }
-//        try {
-//            URI baseUri = new URI(registryURL);
-//            //TODO callback class
-////            PasswordCallBackImpl passwordCallBack = new PasswordCallBackImpl(username, password);
-//            this.airavataAPI = AiravataAPIFactory.getAPI(baseUri, gatewayName, username, (PasswordCallback)null);
-//        }  catch (URISyntaxException e) {
-//            log.error("Error initializing Airavata Client");
-//        } catch (AiravataAPIInvocationException e) {
-//            log.error("Error initializing Airavata Client");
-//        }
-//
-//    }
-
-    static {
-        registerUserManagers();
-    }
-
-    /**
-     * to manually trigger user manager registrations
-     */
-    private static void registerUserManagers() {
-        try {
-            Class.forName("org.apache.airavata.xbaya.component.registry.jackrabbit.user.JackRabbitUserManagerWrap");
-        } catch (ClassNotFoundException e) {
-            // error in registering user managers
-        }
-    }
-
-    /**
-     * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getComponentReferenceList()
-     */
-    @Override
-    public List<ComponentReference> getComponentReferenceList() {
-        List<ComponentReference> tree = new ArrayList<ComponentReference>();
-        try {
-            List<ServiceDescription> services = this.getAiravataAPI().getApplicationManager().getAllServiceDescriptions();
-            for (ServiceDescription serviceDescription : services) {
-                String serviceName = serviceDescription.getType().getName();
-                JCRComponentReference jcr = new JCRComponentReference(serviceName,
-                        WebServiceUtil.getWSDL(serviceDescription));
-                tree.add(jcr);
-            }
-        } catch (RegistryException e) {
-            log.error(e.getMessage(), e);
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-		}
-
-        return tree;
-    }
-
-    /**
-     * @see org.apache.airavata.workflow.model.component.registry.ComponentRegistry#getName()
-     */
-    @Override
-    public String getName() {
-        return NAME;
-    }
-
-//    public String saveApplicationDescription(String service, String host, ApplicationDeploymentDescription app) {
-//        // deploy the service on host
-//        registry.deployServiceOnHost(service, host);
-//
-//        // save deployment description
-//        return registry.saveApplicationDescription(service, host, app);
-//    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-	public void setAiravataAPI(AiravataAPI airavataAPI) {
-		this.airavataAPI = airavataAPI;
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/pom.xml b/modules/ws-messenger/distribution/pom.xml
deleted file mode 100644
index ca93942..0000000
--- a/modules/ws-messenger/distribution/pom.xml
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata-ws-messenger</artifactId>
-        <version>0.5-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-ws-messenger-distribution</artifactId>
-    <name>distribution</name>
-    <url>http://airavata.apache.org/</url>
-    <packaging>pom</packaging>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <version>2.0-alpha-4</version>
-                <inherited>false</inherited>
-                <executions>
-                    <execution>
-                        <id>unpack-axis2</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>unpack</goal>
-                        </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>org.apache.axis2</groupId>
-                                    <artifactId>axis2-webapp</artifactId>
-                                    <version>${axis2.version}</version>
-                                    <type>war</type>
-                                    <overWrite>true</overWrite>
-                                    <outputDirectory>target/axis2-${axis2.version}</outputDirectory>
-                                </artifactItem>
-                            </artifactItems>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-assembly-plugin</artifactId>
-                <version>2.2-beta-5</version>
-                <executions>
-                    <execution>
-                        <id>distribution-package</id>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>single</goal>
-                        </goals>
-                        <configuration>
-                            <finalName>${archieve.name}-${project.version}</finalName>
-                            <descriptors>
-                                <descriptor>src/main/assembly/bin-assembly.xml</descriptor>
-                            </descriptors>
-                            <attach>false</attach>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <artifactId>maven-clean-plugin</artifactId>
-                <version>2.4.1</version>
-                <configuration>
-                    <filesets>
-                        <fileset>
-                            <directory>axis2-${axis2.version}</directory>
-                        </fileset>
-                    </filesets>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-    <dependencies>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derby</artifactId>
-            <version>${derby.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbytools</artifactId>
-            <version>${derby.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>yfilter</artifactId>
-            <version>${yfilter.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>wsdl4j</groupId>
-            <artifactId>wsdl4j</artifactId>
-            <version>1.5.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-messenger-client</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-messenger-commons</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-message-box</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-message-broker</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-    </dependencies>
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <archieve.name>airavata-ws-messenger</archieve.name>
-        <used.axis2.release>${axis2.version}</used.axis2.release>
-    </properties>
-</project>


[10/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
deleted file mode 100644
index f62f538..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.model.registrybrowser.AiravataConfigurations;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptions;
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURL;
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURL;
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.HostDescriptions;
-import org.apache.airavata.xbaya.model.registrybrowser.InputParameters;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURL;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURL;
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.OutputParameters;
-import org.apache.airavata.xbaya.model.registrybrowser.ServiceDescriptions;
-import org.apache.airavata.xbaya.model.registrybrowser.NodeParameter;
-import org.apache.airavata.xbaya.model.registrybrowser.ServiceParameters;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflow;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiment;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiments;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowNodeElement;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplate;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplates;
-
-public class AiravataTreeNodeFactory {
-	public static TreeNode getTreeNode(Object o,TreeNode parent){
-		if (o instanceof XBayaEngine){
-            return new RegistryNode((XBayaEngine)o,parent);
-        }else if (o instanceof AiravataConfigurations){
-			return new AiravataConfigurationsNode((AiravataConfigurations)o,parent);
-//		}else if (o instanceof GFacURLs){
-//			return new GFacURLsNode((GFacURLs)o,parent);
-		}else if (o instanceof GFacURL){
-			return new GFacURLNode((GFacURL)o,parent);
-		}else if (o instanceof InterpreterServiceURLs){
-			return new InterpreterServiceURLsNode((InterpreterServiceURLs)o,parent);
-		}else if (o instanceof InterpreterServiceURL){
-			return new InterpreterServiceURLNode((InterpreterServiceURL)o,parent);
-		}else if (o instanceof MessageBoxURLs){
-			return new MessageBoxURLsNode((MessageBoxURLs)o,parent);
-		}else if (o instanceof MessageBoxURL){
-			return new MessageBoxURLNode((MessageBoxURL)o,parent);
-		}else if (o instanceof EventingServiceURLs){
-			return new EventingServiceURLsNode((EventingServiceURLs)o,parent);
-		}else if (o instanceof EventingServiceURL){
-			return new EventingServiceURLNode((EventingServiceURL)o,parent);
-		}else if (o instanceof HostDescriptions){
-			return new HostDescriptionsNode((HostDescriptions)o,parent);
-		}else if (o instanceof HostDescription){
-			return new HostDescriptionNode((HostDescription)o,parent);
-		}else if (o instanceof ServiceDescriptions){
-			return new ServiceDescriptionsNode((ServiceDescriptions)o,parent);
-		}else if (o instanceof ServiceDescription){
-			return new ServiceDescriptionNode((ServiceDescription)o,parent);
-		}else if (o instanceof ApplicationDeploymentDescriptions){
-			return new ApplicationDeploymentDescriptionsNode((ApplicationDeploymentDescriptions)o,parent);
-		}else if (o instanceof ApplicationDeploymentDescriptionWrap){
-			return new ApplicationDeploymentDescriptionNode((ApplicationDeploymentDescriptionWrap)o,parent);
-		}else if (o instanceof XBayaWorkflowTemplates){
-			return new XBayaWorkflowTemplatesNode((XBayaWorkflowTemplates)o,parent);
-		}else if (o instanceof XBayaWorkflowTemplate){
-			return new XBayaWorkflowTemplateNode((XBayaWorkflowTemplate)o,parent);
-		}else if (o instanceof NodeParameter){
-			return new ParameterNode((NodeParameter)o,parent);
-		}else if (o instanceof InputParameters){
-			return new InputParametersNode((InputParameters)o,parent);
-		}else if (o instanceof OutputParameters){
-			return new OutputParametersNode((OutputParameters)o,parent);
-		}else if (o instanceof ServiceParameters){
-			return new ParametersNode((ServiceParameters)o,parent);
-		}else if (o instanceof XBayaWorkflowExperiments){
-			return new XBayaWorkflowExperimentsNode((XBayaWorkflowExperiments)o,parent);
-		}else if (o instanceof XBayaWorkflowExperiment){
-			return new XBayaWorkflowExperimentNode((XBayaWorkflowExperiment)o,parent);
-		}else if (o instanceof XBayaWorkflow){
-			return new XBayaWorkflowNode((XBayaWorkflow)o,parent);
-		}else if (o instanceof XBayaWorkflowNodeElement){
-			return new XBayaWorkflowNodeElementNode((XBayaWorkflowNodeElement)o,parent);
-		}else{
-			return new DefaultMutableTreeNode(o);
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
deleted file mode 100644
index 8a3d82a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.ApplicationDescriptionDialog;
-
-public class ApplicationDeploymentDescriptionNode extends AbstractAiravataTreeNode {
-    private ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap;
-
-    public ApplicationDeploymentDescriptionNode(
-            ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap, TreeNode parent) {
-        super(parent);
-        setApplicationDeploymentDescriptionWrap(applicationDeploymentDescriptionWrap);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return emptyList();
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return getApplicationDeploymentDescriptionWrap().getDescription().getType().getApplicationName().getStringValue();
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.APPLICATION_ICON;
-    }
-
-    public ApplicationDeploymentDescriptionWrap getApplicationDeploymentDescriptionWrap() {
-        return applicationDeploymentDescriptionWrap;
-    }
-
-    public void setApplicationDeploymentDescriptionWrap(
-            ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap) {
-        this.applicationDeploymentDescriptionWrap = applicationDeploymentDescriptionWrap;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(DeleteAction.ID);
-    }
-
-//    @Override
-//    public String getDefaultAction() {
-//    	return EditAction.ID;
-//    }
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(DeleteAction.ID)) {
-        	return deleteApplicationDescription(tree);
-        } else if (action.equals(EditAction.ID)) {
-        	return editDescriptor(tree);
-        }
-        return super.triggerAction(tree, action);
-    }
-
-	private boolean editDescriptor(JTree tree) {
-		ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(getXBayaEngine(),false,getApplicationDeploymentDescriptionWrap().getDescription(),getApplicationDeploymentDescriptionWrap().getHost(),getApplicationDeploymentDescriptionWrap().getService());
-		applicationDescriptionDialog.open();
-		if (applicationDescriptionDialog.isApplicationDescCreated()) {
-		    refresh();
-		    reloadTreeNode(tree, this);
-		}
-		return true;
-	}
-
-    private boolean deleteApplicationDescription(JTree tree) throws AiravataAPIInvocationException {
-        if (askQuestion("Application description",
-                "Are you sure that you want to remove the application description \""
-                        + getApplicationDeploymentDescriptionWrap().getDescription().getType().getApplicationName().getStringValue() + "\"?")) {
-            getRegistry().getApplicationManager().deleteApplicationDescription(getApplicationDeploymentDescriptionWrap().getService(),
-                    getApplicationDeploymentDescriptionWrap().getHost(),
-                    getApplicationDeploymentDescriptionWrap().getDescription().getType().getApplicationName().getStringValue());
-            ((AbstractAiravataTreeNode) getParent()).refresh();
-            reloadTreeNode(tree, getParent());
-        }
-        return true;
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(DeleteAction.ID)) {
-            return "Remove";
-        } else if (action.getID().equals(EditAction.ID)) {
-            return "View/Edit";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
deleted file mode 100644
index 5d58fe9..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptions;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.ApplicationDescriptionDialog;
-
-public class ApplicationDeploymentDescriptionsNode extends AbstractAiravataTreeNode {
-    private ApplicationDeploymentDescriptions applicationDeploymentDescriptions;
-
-    public ApplicationDeploymentDescriptionsNode(ApplicationDeploymentDescriptions applicationDeploymentDescriptions,
-            TreeNode parent) {
-        super(parent);
-        setApplicationDeploymentDescriptions(applicationDeploymentDescriptions);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        try {
-            return getTreeNodeList(getApplicationDeploymentDescriptions().getDescriptions().toArray(), this);
-        } catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();
-            return emptyList();
-        } catch (RegistryException e) {
-            e.printStackTrace();
-            return emptyList();
-        }
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return "Deployments";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.APPLICATIONS_ICON;
-    }
-
-    public ApplicationDeploymentDescriptions getApplicationDeploymentDescriptions() {
-        return applicationDeploymentDescriptions;
-    }
-
-    public void setApplicationDeploymentDescriptions(ApplicationDeploymentDescriptions applicationDeploymentDescriptions) {
-        this.applicationDeploymentDescriptions = applicationDeploymentDescriptions;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(RefreshAction.ID, DeleteAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(DeleteAction.ID)) {
-            deleteApplicationDescription(tree);
-            return true;
-        } else if (action.equals(AddAction.ID)) {
-            ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(getXBayaEngine());
-            applicationDescriptionDialog.open();
-            if (applicationDescriptionDialog.isApplicationDescCreated()) {
-                refresh();
-                reloadTreeNode(tree, this);
-            }
-            return true;
-        }
-        return super.triggerAction(tree, action);
-    }
-
-    private void deleteApplicationDescription(JTree tree) throws Exception {
-        if (askQuestion("Application descriptions",
-                "Are you sure that you want to remove all application descriptions in this registry?")) {
-            AiravataAPI airavataAPI = getRegistry();
-            List<ApplicationDeploymentDescriptionWrap> descriptions = getApplicationDeploymentDescriptions()
-                    .getDescriptions();
-            for (ApplicationDeploymentDescriptionWrap descriptionWrap : descriptions) {
-                airavataAPI.getApplicationManager().removeApplicationDescriptor(descriptionWrap.getService(), descriptionWrap.getHost(),
-                        descriptionWrap.getDescription().getType().getApplicationName().getStringValue());
-            }
-            refresh();
-            reloadTreeNode(tree, this);
-        }
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(DeleteAction.ID)) {
-            return "Remove all applications";
-        } else if (action.getID().equals(AddAction.ID)) {
-            return "New application...";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java
deleted file mode 100644
index f762efe..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURL;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-
-public class EventingServiceURLNode extends AbstractAiravataTreeNode {
-    private EventingServiceURL eventingServiceURL;
-
-    public EventingServiceURLNode(EventingServiceURL eventingServiceURL, TreeNode parent) {
-        super(parent);
-        setEventingServiceURL(eventingServiceURL);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return emptyList();
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return getEventingServiceURL().getEventingServiceURL().toString();
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.GFAC_URL_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(CopyAction.ID);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-    	if (action.getID().equals(CopyAction.ID)) {
-            return "Copy to clipboard";
-        }
-    	return null;
-    }
-
-    @Override
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(CopyAction.ID)) {
-        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getEventingServiceURL().getEventingServiceURL().toString()), null);
-        }
-        return super.triggerAction(tree, action);
-    }
-    
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public EventingServiceURL getEventingServiceURL() {
-		return eventingServiceURL;
-	}
-
-	public void setEventingServiceURL(EventingServiceURL eventingServiceURL) {
-		this.eventingServiceURL = eventingServiceURL;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java
deleted file mode 100644
index 336e817..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class EventingServiceURLsNode extends AbstractAiravataTreeNode {
-    private EventingServiceURLs eventingServiceURLs;
-
-    public EventingServiceURLsNode(EventingServiceURLs eventingServiceURLs, TreeNode parent) {
-        super(parent);
-        setEventingServiceURLs(eventingServiceURLs);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        try {
-            return getTreeNodeList(getEventingServiceURLs().getURLS().toArray(), this);
-        } catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return "Eventing Services";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.GFAC_URLS_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(RefreshAction.ID);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public EventingServiceURLs getEventingServiceURLs() {
-		return eventingServiceURLs;
-	}
-
-	public void setEventingServiceURLs(EventingServiceURLs eventingServiceURLs) {
-		this.eventingServiceURLs = eventingServiceURLs;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java
deleted file mode 100644
index 4270c29..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURL;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-
-public class GFacURLNode extends AbstractAiravataTreeNode {
-    private GFacURL gfacURL;
-
-    public GFacURLNode(GFacURL gfacURL, TreeNode parent) {
-        super(parent);
-        setGfacURL(gfacURL);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return emptyList();
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return getGfacURL().getGfacURL().toString();
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.GFAC_URL_ICON;
-    }
-
-    public GFacURL getGfacURL() {
-        return gfacURL;
-    }
-
-    public void setGfacURL(GFacURL gfacURL) {
-        this.gfacURL = gfacURL;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(CopyAction.ID);
-    }
-
-    @Override
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(CopyAction.ID)) {
-        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getGfacURL().getGfacURL().toString()), null);
-        }
-        return super.triggerAction(tree, action);
-    }
-    
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-    	if (action.getID().equals(CopyAction.ID)) {
-            return "Copy to clipboard";
-        }
-    	return null;
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
deleted file mode 100644
index 97b18c7..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class GFacURLsNode{
-//        extends AbstractAiravataTreeNode {
-//    private GFacURLs gfacURLs;
-//
-//    public GFacURLsNode(GFacURLs gfacURLs, TreeNode parent) {
-//        super(parent);
-//        setGfacURLs(gfacURLs);
-//    }
-//
-//    @Override
-//    protected List<TreeNode> getChildren() {
-//        try {
-//            return getTreeNodeList(getGfacURLs().getURLS().toArray(), this);
-//        } catch (AiravataAPIInvocationException e) {
-//            e.printStackTrace();
-//        }
-//        return null;
-//    }
-//
-//    @Override
-//    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-//        return "GFac Locations";
-//    }
-//
-//    @Override
-//    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-//        return JCRBrowserIcons.GFAC_URLS_ICON;
-//    }
-//
-//    public GFacURLs getGfacURLs() {
-//        return gfacURLs;
-//    }
-//
-//    public void setGfacURLs(GFacURLs gfacURLs) {
-//        this.gfacURLs = gfacURLs;
-//    }
-//
-//    @Override
-//    public List<String> getSupportedActions() {
-//        return Arrays.asList(RefreshAction.ID);
-//    }
-//
-//    @Override
-//    public String getActionCaption(AbstractBrowserActionItem action) {
-//        return action.getDefaultCaption();
-//    }
-//
-//    @Override
-//    public Icon getActionIcon(AbstractBrowserActionItem action) {
-//        return null;
-//    }
-//
-//    @Override
-//    public String getActionDescription(AbstractBrowserActionItem action) {
-//        return null;
-//    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
deleted file mode 100644
index 2fba319..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.HostDescriptionDialog;
-
-public class HostDescriptionNode extends AbstractAiravataTreeNode {
-    private HostDescription hostDescription;
-
-    public HostDescriptionNode(HostDescription hostDescription, TreeNode parent) {
-        super(parent);
-        setHostDescription(hostDescription);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return emptyList();
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return getHostDescription().getType().getHostName();
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.HOST_ICON;
-    }
-
-    public HostDescription getHostDescription() {
-        return hostDescription;
-    }
-
-    public void setHostDescription(HostDescription hostDescription) {
-        this.hostDescription = hostDescription;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(EditAction.ID, DeleteAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(DeleteAction.ID)) {
-        	return deleteHostDescription(tree);
-        } else if (action.equals(EditAction.ID)) {
-            return editHostDescription(tree);
-        }
-        return super.triggerAction(tree, action);
-    }
-    
-    @Override
-    public String getDefaultAction() {
-    	return EditAction.ID;
-    }
-    
-	private boolean editHostDescription(JTree tree) {
-		HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getXBayaEngine().getConfiguration().getAiravataAPI(),false,getHostDescription(), null);
-		hostDescriptionDialog.open();
-		if (hostDescriptionDialog.isHostCreated()) {
-		    refresh();
-		    reloadTreeNode(tree, this);
-		}
-		return true;
-	}
-
-    private boolean deleteHostDescription(JTree tree) throws AiravataAPIInvocationException {
-        if (askQuestion("Host description", "Are you sure that you want to remove the host description \""
-                + getHostDescription().getType().getHostName() + "\"?")) {
-            getRegistry().getApplicationManager().deleteHostDescription(getHostDescription().getType().getHostName());
-            ((AbstractAiravataTreeNode) getParent()).refresh();
-            reloadTreeNode(tree, getParent());
-        }
-        return true;
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(DeleteAction.ID)) {
-            return "Remove";
-        } else if (action.getID().equals(EditAction.ID)) {
-            return "View/Edit";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
deleted file mode 100644
index 525c15b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.xbaya.model.registrybrowser.HostDescriptions;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.HostDescriptionDialog;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class HostDescriptionsNode extends AbstractAiravataTreeNode {
-    private HostDescriptions hostDescriptions;
-
-    public HostDescriptionsNode(HostDescriptions hostDescriptions, TreeNode parent) {
-        super(parent);
-        setHostDescriptions(hostDescriptions);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        try {
-            return getTreeNodeList(getHostDescriptions().getDescriptions().toArray(), this);
-        } catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();
-            return emptyList();
-        }
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return "Hosts";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.HOSTS_ICON;
-    }
-
-    public HostDescriptions getHostDescriptions() {
-        return hostDescriptions;
-    }
-
-    public void setHostDescriptions(HostDescriptions hostDescriptions) {
-        this.hostDescriptions = hostDescriptions;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(AddAction.ID, RefreshAction.ID, DeleteAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(DeleteAction.ID)) {
-            deleteHostDescription(tree);
-            return true;
-        } else if (action.equals(AddAction.ID)) {
-            HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getXBayaEngine().getConfiguration().getAiravataAPI(), null);
-            hostDescriptionDialog.open();
-            if (hostDescriptionDialog.isHostCreated()) {
-                refresh();
-                reloadTreeNode(tree, this);
-            }
-            return true;
-        }
-        return super.triggerAction(tree, action);
-    }
-
-    private void deleteHostDescription(JTree tree) throws Exception {
-        if (askQuestion("Host descriptions",
-                "Are you sure that you want to remove all host descriptions in this registry?")) {
-            AiravataAPI registry = getRegistry();
-            List<HostDescription> descriptions = getHostDescriptions().getDescriptions();
-            for (HostDescription descriptionWrap : descriptions) {
-                registry.getApplicationManager().removeHostDescriptor(descriptionWrap.getType().getHostName());
-            }
-            refresh();
-            reloadTreeNode(tree, this);
-        }
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(DeleteAction.ID)) {
-            return "Remove all hosts";
-        } else if (action.getID().equals(AddAction.ID)) {
-            return "New host...";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java
deleted file mode 100644
index 4116fcb..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.InputParameters;
-
-public class InputParametersNode extends ParametersNode {
-
-	public InputParametersNode(InputParameters parameters, TreeNode parent) {
-		super(parameters, parent);
-	}
-
-	@Override
-	public String getCaption(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		return "Input";
-	}
-	
-	@Override
-	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		return JCRBrowserIcons.INPUT_PARAMETERS_ICON;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java
deleted file mode 100644
index eb595e7..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURL;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-
-public class InterpreterServiceURLNode extends AbstractAiravataTreeNode {
-    private InterpreterServiceURL interpreterServiceURL;
-
-    public InterpreterServiceURLNode(InterpreterServiceURL interpreterServiceURL, TreeNode parent) {
-        super(parent);
-        setInterpreterServiceURL(interpreterServiceURL);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return emptyList();
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return getInterpreterServiceURL().getInterpreterServiceURL().toString();
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.GFAC_URL_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(CopyAction.ID);
-    }
-
-    @Override
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(CopyAction.ID)) {
-        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getInterpreterServiceURL().getInterpreterServiceURL().toString()), null);
-        }
-        return super.triggerAction(tree, action);
-    }
-    
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-    	if (action.getID().equals(CopyAction.ID)) {
-            return "Copy to clipboard";
-        }
-    	return null;
-	}
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public InterpreterServiceURL getInterpreterServiceURL() {
-		return interpreterServiceURL;
-	}
-
-	public void setInterpreterServiceURL(InterpreterServiceURL interpreterServiceURL) {
-		this.interpreterServiceURL = interpreterServiceURL;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java
deleted file mode 100644
index 1835dde..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class InterpreterServiceURLsNode extends AbstractAiravataTreeNode {
-    private InterpreterServiceURLs interpreterServiceURLs;
-
-    public InterpreterServiceURLsNode(InterpreterServiceURLs interpreterServiceURLs, TreeNode parent) {
-        super(parent);
-        setInterpreterServiceURLs(interpreterServiceURLs);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        try {
-            return getTreeNodeList(getInterpreterServiceURLs().getURLS().toArray(), this);
-        } catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return "Interpreter Servers";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.GFAC_URLS_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(RefreshAction.ID);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public InterpreterServiceURLs getInterpreterServiceURLs() {
-		return interpreterServiceURLs;
-	}
-
-	public void setInterpreterServiceURLs(InterpreterServiceURLs interpreterServiceURLs) {
-		this.interpreterServiceURLs = interpreterServiceURLs;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java
deleted file mode 100644
index 17b7be2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import javax.swing.Icon;
-
-import org.apache.airavata.common.utils.SwingUtil;
-
-public class JCRBrowserIcons {
-	public static final Icon APPLICATION_ICON=SwingUtil.createImageIcon("application.png");
-	public static final Icon APPLICATIONS_ICON=SwingUtil.createImageIcon("applications.png");
-	public static final Icon REGISTRY_ICON=SwingUtil.createImageIcon("jcr-repo.png");
-	public static final Icon AIRAVATA_CONFIG_ICON=SwingUtil.createImageIcon("airavata-config.png");
-	public static final Icon GFAC_URLS_ICON=SwingUtil.createImageIcon("gfac_urls.png");
-	public static final Icon GFAC_URL_ICON=SwingUtil.createImageIcon("gfac_url.png");
-	public static final Icon HOST_ICON=SwingUtil.createImageIcon("host.png");
-	public static final Icon HOSTS_ICON=SwingUtil.createImageIcon("hosts.png");
-	public static final Icon INPUT_PARAMETERS_ICON=SwingUtil.createImageIcon("input_para.png");
-	public static final Icon OUTPUT_PARAMETERS_ICON=SwingUtil.createImageIcon("output_para.png");
-	public static final Icon PARAMETER_ICON=SwingUtil.createImageIcon("parameter.png");
-	public static final Icon PARAMETERS_ICON=SwingUtil.createImageIcon("parameter.png");
-	public static final Icon PARAMETER_VALUE_ICON=SwingUtil.createImageIcon("parameter.png");
-	public static final Icon SERVICE_ICON=SwingUtil.createImageIcon("service.png");
-	public static final Icon SERVICES_ICON=SwingUtil.createImageIcon("services.png");
-	public static final Icon WORKFLOW_EXPERIMENT_ICON=SwingUtil.createImageIcon("experiment.png");
-	public static final Icon WORKFLOW_EXPERIMENTS_ICON=SwingUtil.createImageIcon("experiments.png");
-	public static final Icon WORKFLOW_ICON=SwingUtil.createImageIcon("workflow.png");
-	public static final Icon WORKFLOW_SERVICE_ICON=SwingUtil.createImageIcon("service.png");
-	public static final Icon WORKFLOW_TEMPLATE_ICON=SwingUtil.createImageIcon("workflow.png");
-	public static final Icon WORKFLOW_TEMPLATES_ICON=SwingUtil.createImageIcon("workflow_templates.png");
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java
deleted file mode 100644
index 23a9c37..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURL;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-
-public class MessageBoxURLNode extends AbstractAiravataTreeNode {
-    private MessageBoxURL messageBoxURL;
-
-    public MessageBoxURLNode(MessageBoxURL messageBoxURL, TreeNode parent) {
-        super(parent);
-        setMessageBoxURL(messageBoxURL);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return emptyList();
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return getMessageBoxURL().getMessageBoxURL().toString();
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.GFAC_URL_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(CopyAction.ID);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-    	if (action.getID().equals(CopyAction.ID)) {
-            return "Copy to clipboard";
-        }
-    	return null;
-    }
-
-    @Override
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(CopyAction.ID)) {
-        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getMessageBoxURL().getMessageBoxURL().toString()), null);
-        }
-        return super.triggerAction(tree, action);
-    }
-    
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public MessageBoxURL getMessageBoxURL() {
-		return messageBoxURL;
-	}
-
-	public void setMessageBoxURL(MessageBoxURL messageBoxURL) {
-		this.messageBoxURL = messageBoxURL;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java
deleted file mode 100644
index 5f521d3..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class MessageBoxURLsNode extends AbstractAiravataTreeNode {
-    private MessageBoxURLs messageBoxURLs;
-
-    public MessageBoxURLsNode(MessageBoxURLs messageBoxURLs, TreeNode parent) {
-        super(parent);
-        setMessageBoxURLs(messageBoxURLs);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        try {
-            return getTreeNodeList(getMessageBoxURLs().getURLS().toArray(), this);
-        } catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return "Message Boxes";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.GFAC_URLS_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(RefreshAction.ID);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public MessageBoxURLs getMessageBoxURLs() {
-		return messageBoxURLs;
-	}
-
-	public void setMessageBoxURLs(MessageBoxURLs messageBoxURLs) {
-		this.messageBoxURLs = messageBoxURLs;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java
deleted file mode 100644
index bed1a70..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.OutputParameters;
-
-public class OutputParametersNode extends ParametersNode {
-
-	public OutputParametersNode(OutputParameters parameters, TreeNode parent) {
-		super(parameters, parent);
-	}
-
-	@Override
-	public String getCaption(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		return "Output";
-	}
-	
-	@Override
-	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		return JCRBrowserIcons.OUTPUT_PARAMETERS_ICON;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
deleted file mode 100644
index 5ce637f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Toolkit;
-import java.awt.datatransfer.StringSelection;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.common.utils.BrowserLauncher;
-import org.apache.airavata.xbaya.model.registrybrowser.NodeParameter;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.BrowserAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.ViewAction;
-import org.apache.airavata.xbaya.ui.dialogs.TextWindow;
-
-public class ParameterNode extends AbstractAiravataTreeNode {
-	private NodeParameter parameter;
-	
-	public ParameterNode(NodeParameter parameter, TreeNode parent) {
-		super(parent);
-		setParameter(parameter);
-	}
-
-	@Override
-	protected List<TreeNode> getChildren() {
-		return emptyList();
-	}
-
-	@Override
-	public String getCaption(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		if (getParameter().getValue()!=null){
-			String parameterValue = getParameter().getValue().toString();
-			if (parameterValue.length()>200){
-				parameterValue=parameterValue.substring(0, 200)+"...";
-			}
-			return wrapAsHtml("<b>"+getParameter().getName()+"</b>",": ",""+parameterValue+"");
-		}else{
-			return getParameter().getName();
-		}
-	}
-
-	@Override
-	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		return JCRBrowserIcons.PARAMETER_ICON;
-	}
-
-	@Override
-	public String getDefaultAction() {
-		return ViewAction.ID;
-	}
-	
-    @Override
-    public List<String> getSupportedActions() {
-        try {
-			new URL(getParameter().getValue().toString());
-			return Arrays.asList(ViewAction.ID,CopyAction.ID,BrowserAction.ID);
-		} catch (MalformedURLException e) {
-			//the content is not a proper url
-			return Arrays.asList(ViewAction.ID,CopyAction.ID);
-		}
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-    	if (action.getID().equals(ViewAction.ID)) {
-    		return "View";
-    	} else if (action.getID().equals(CopyAction.ID)) {
-            return "Copy to clipboard";
-    	} else if (action.getID().equals(BrowserAction.ID)) {
-            return "Open in web browser...";
-        }
-    	return null;
-    }
-    
-	public boolean triggerAction(JTree tree,String action) throws Exception{
-		String value = getParameter().getValue().toString();
-		if (action.equals(ViewAction.ID)) {
-			TextWindow textWindow = new TextWindow(getXBayaEngine(), getParameter().getName(), value,"Parameter Content");
-			textWindow.show();
-		} else if (action.equals(CopyAction.ID)) {
-        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(value), null);
-		} else if (action.equals(BrowserAction.ID)) {
-			BrowserLauncher.openURL(getParameter().getValue().toString());
-        } 
-		return super.triggerAction(tree, action);
-	}
-
-	@Override
-	public Icon getActionIcon(AbstractBrowserActionItem action) {
-		return null;
-	}
-
-	@Override
-	public String getActionDescription(AbstractBrowserActionItem action) {
-		return null;
-	}
-
-	public NodeParameter getParameter() {
-		return parameter;
-	}
-
-	public void setParameter(NodeParameter parameter) {
-		this.parameter = parameter;
-	}
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterValueNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterValueNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterValueNode.java
deleted file mode 100644
index 38a7d16..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterValueNode.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.schemas.gfac.Parameter;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class ParameterValueNode extends AbstractAiravataTreeNode {
-	private Parameter parameter;
-	
-	public ParameterValueNode(Parameter parameter, TreeNode parent) {
-		super(parent);
-		setParameter(parameter);
-	}
-
-	@Override
-	protected List<TreeNode> getChildren() {
-		return emptyList();
-	}
-
-	@Override
-	public String getCaption(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		return getParameter().getParameterName();
-	}
-
-	@Override
-	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		return JCRBrowserIcons.PARAMETER_VALUE_ICON;
-	}
-
-	@Override
-	public List<String> getSupportedActions() {
-		return Arrays.asList();
-	}
-
-	public boolean triggerAction(JTree tree,String action) throws Exception{
-		return super.triggerAction(tree, action);
-	}
-
-	@Override
-	public String getActionCaption(AbstractBrowserActionItem action) {
-		return action.getDefaultCaption();
-	}
-
-	@Override
-	public Icon getActionIcon(AbstractBrowserActionItem action) {
-		return null;
-	}
-
-	@Override
-	public String getActionDescription(AbstractBrowserActionItem action) {
-		return null;
-	}
-
-	public Parameter getParameter() {
-		return parameter;
-	}
-
-	public void setParameter(Parameter parameter) {
-		this.parameter = parameter;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParametersNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParametersNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParametersNode.java
deleted file mode 100644
index 33e409a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParametersNode.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.ServiceParameters;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class ParametersNode extends AbstractAiravataTreeNode {
-	private ServiceParameters parametersList;
-	public ParametersNode(ServiceParameters parameters,TreeNode parent) {
-		super(parent);
-		setParametersList(parameters);
-	}
-
-	@Override
-	protected List<TreeNode> getChildren() {
-		return getTreeNodeList(getParametersList().getParameters().toArray(), this);
-	}
-
-	@Override
-	public String getCaption(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		return "Parameters";
-	}
-
-	@Override
-	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
-			boolean hasFocus) {
-		return JCRBrowserIcons.PARAMETERS_ICON;
-	}
-
-	@Override
-	public List<String> getSupportedActions() {
-		return Arrays.asList();
-	}
-	
-	public boolean triggerAction(JTree tree,String action) throws Exception{
-		return super.triggerAction(tree, action);
-	}
-
-	@Override
-	public String getActionCaption(AbstractBrowserActionItem action) {
-		return action.getDefaultCaption();
-	}
-
-	@Override
-	public Icon getActionIcon(AbstractBrowserActionItem action) {
-		return null;
-	}
-
-	@Override
-	public String getActionDescription(AbstractBrowserActionItem action) {
-		return null;
-	}
-
-	public ServiceParameters getParametersList() {
-		return parametersList;
-	}
-
-	public void setParametersList(ServiceParameters parametersList) {
-		this.parametersList = parametersList;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java
deleted file mode 100644
index 09af7c8..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.model.registrybrowser.AiravataConfigurations;
-import org.apache.airavata.xbaya.model.registrybrowser.HostDescriptions;
-import org.apache.airavata.xbaya.model.registrybrowser.ServiceDescriptions;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiments;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplates;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class RegistryNode extends AbstractAiravataTreeNode {
-    private AiravataAPI registry;
-    private XBayaEngine engine;
-
-    public RegistryNode(XBayaEngine engine, TreeNode parent) {
-        super(parent);
-        setRegistry(engine.getConfiguration().getAiravataAPI());
-        this.engine=engine;
-    }
-
-    protected List<TreeNode> getChildren() {
-        List<Object> children = new ArrayList<Object>();
-        AiravataConfigurations airavataConfigurations = new AiravataConfigurations(getRegistry());
-        children.add(airavataConfigurations);
-        HostDescriptions hostDescriptions = new HostDescriptions(getRegistry());
-        children.add(hostDescriptions);
-        ServiceDescriptions serviceDescriptions = new ServiceDescriptions(getRegistry());
-        children.add(serviceDescriptions);
-//        ApplicationDeploymentDescriptions applicationDeploymentDescriptions = new ApplicationDeploymentDescriptions(
-//                getRegistry());
-//        children.add(applicationDeploymentDescriptions);
-        XBayaWorkflowTemplates xBayaWorkflows = new XBayaWorkflowTemplates(getRegistry());
-        children.add(xBayaWorkflows);
-        XBayaWorkflowExperiments xBayaWorkflowExperiments = new XBayaWorkflowExperiments(getRegistry());
-        children.add(xBayaWorkflowExperiments);
-        return getTreeNodeList(children.toArray(), this);
-    }
-
-    public AiravataAPI getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        try {
-            return getRegistry().getAiravataManager().getGateway().getGatewayName() + " - " + getRegistry().getAiravataManager().getUser().getUserName();
-        } catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();
-        }
-        return null;
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.REGISTRY_ICON;
-    }
-
-    // @Override
-    // public void refresh() {
-    // List<TreeNode> children = getChildren();
-    // for (TreeNode node : children) {
-    // if (node instanceof AbstractAiravataTreeNode){
-    // ((AbstractAiravataTreeNode)node).refresh();
-    // }
-    // }
-    // }
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(RefreshAction.ID);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    public XBayaEngine getEngine() {
-        return engine;
-    }
-
-    public void setEngine(XBayaEngine engine) {
-        this.engine = engine;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryTreeCellRenderer.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryTreeCellRenderer.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryTreeCellRenderer.java
deleted file mode 100644
index fe3baac..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryTreeCellRenderer.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Component;
-
-import javax.swing.JTree;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import javax.swing.tree.TreeCellRenderer;
-
-public class RegistryTreeCellRenderer implements TreeCellRenderer {
-
-    @Override
-    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded,
-            boolean leaf, int row, boolean hasFocus) {
-        if (value instanceof AbstractAiravataTreeNode) {
-            AbstractAiravataTreeNode node = (AbstractAiravataTreeNode) value;
-            return node.getNodeComponent(tree, value, selected, expanded, leaf, row, hasFocus);
-        }
-        return new DefaultTreeCellRenderer().getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row,
-                hasFocus);
-    }
-
-}


[63/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java
new file mode 100644
index 0000000..98277ce
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ServiceDescriptionDialog.java
@@ -0,0 +1,727 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.descriptors;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.PathNotFoundException;
+import javax.swing.BorderFactory;
+import javax.swing.DefaultCellEditor;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import javax.swing.WindowConstants;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.schemas.gfac.DataType;
+import org.apache.airavata.schemas.gfac.InputParameterType;
+import org.apache.airavata.schemas.gfac.OutputParameterType;
+import org.apache.airavata.schemas.gfac.ParameterType;
+import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.DescriptorListDialog.DescriptorType;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.xmlbeans.XmlCursor;
+
+public class ServiceDescriptionDialog extends JDialog {
+
+    private static final long serialVersionUID = 2705760838264284423L;
+    private final GridPanel contentPanel = new GridPanel();
+    private XBayaLabel lblServiceName;
+    private XBayaTextField txtServiceName;
+    private JTable tblParameters;
+    private boolean serviceCreated = false;
+    private JLabel lblError;
+    private ServiceDescription serviceDescription;
+    private ServiceDescription orginalServiceDescription;
+    private JButton okButton;
+    private JButton btnDeleteParameter;
+    private DefaultTableModel defaultTableModel;
+    private AiravataAPI registry;
+    private boolean newDescription;
+    private boolean ignoreTableChanges=false;
+	private JCheckBox chkForceFileStagingToWorkDir;
+	private boolean serviceDescriptionMode;
+	private String suggestedNamePrefix;
+	private String titlePrefix;
+	
+    /**
+     * Launch the application.
+     */
+    public static void main(String[] args) {
+        try {
+            ServiceDescriptionDialog dialog = new ServiceDescriptionDialog(null,true,null);
+            dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+            dialog.setVisible(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public ServiceDescriptionDialog(AiravataAPI registry) {
+    	this(registry,true,null);
+    }
+    
+    public ServiceDescriptionDialog(AiravataAPI registry, boolean newDescription, ServiceDescription serviceDescription) {
+    	this(registry, newDescription, serviceDescription, true, null);
+    }
+    
+    /**
+     * Create the dialog.
+     */
+    public ServiceDescriptionDialog(AiravataAPI registry, boolean newDescription, ServiceDescription serviceDescription, boolean serviceDescriptionMode, String suggestedNamePrefix) {
+    	setNewDescription(newDescription);
+    	this.setOrginalServiceDescription(serviceDescription);
+    	setServiceDescriptionMode(serviceDescriptionMode);
+    	setSuggestedNamePrefix(suggestedNamePrefix);
+    	if (isNewDescription()) {
+			setTitlePrefix(isServiceDescriptionMode()? "New Service Description":"Input/Output parameters for "+getSuggestedNamePrefix());
+		}else{
+			setTitlePrefix(isServiceDescriptionMode()? "Update Service Description: "+getOrginalServiceDescription().getType().getName():"Update Input/Output parameters for "+getSuggestedNamePrefix());
+		}
+        addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowOpened(WindowEvent arg0) {
+                if (isNewDescription() && !isServiceDescriptionMode()) {
+					String baseName = isServiceDescriptionMode()? "Service":getSuggestedNamePrefix()+"_Service";
+					int i;
+					String defaultName;
+					if (isServiceDescriptionMode()) {
+						i = 1;
+						defaultName = baseName+i;
+					}else{
+						i = 0;
+						defaultName = baseName;
+					}
+					try {
+						while (getRegistry().getApplicationManager().isServiceDescriptorExists(defaultName)) {
+							defaultName = baseName + (++i);
+						}
+					} catch (Exception e) {
+					}
+					txtServiceName.setText(defaultName);
+					setServiceName(txtServiceName.getText());
+				}
+            }
+        });
+        setRegistry(registry);
+        initGUI();
+
+    }
+
+    public void open() {
+        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        setVisible(true);
+    }
+
+    protected ServiceDescriptionDialog getDialog() {
+        return this;
+    }
+
+    private void initGUI() {
+    	setTitle(getTitlePrefix());
+//        if (isNewDescription()) {
+//			setTitle("New Service Description");
+//		}else{
+//			setTitle("Update Service Description: "+getOrginalServiceDescription().getType().getName());
+//		}
+		setBounds(100, 100, 463, 459);
+        setModal(true);
+        setLocationRelativeTo(null);
+        BorderLayout borderLayout = new BorderLayout();
+        borderLayout.setVgap(5);
+        borderLayout.setHgap(5);
+        getContentPane().setLayout(borderLayout);
+
+        txtServiceName = new XBayaTextField();
+        txtServiceName.getSwingComponent().addKeyListener(new KeyAdapter() {
+            @Override
+            public void keyReleased(KeyEvent e) {
+                setServiceName(txtServiceName.getText());
+            }
+        });
+        txtServiceName.setColumns(10);
+        lblServiceName = new XBayaLabel(isServiceDescriptionMode()? "Service name":"Bind parameters to service",txtServiceName);
+        if (!isServiceDescriptionMode()){
+        	lblServiceName.getSwingComponent().setFont(new Font("Tahoma", Font.ITALIC, 11));
+        }
+        JLabel lblInputParameters = new JLabel(isServiceDescriptionMode()? "Service Parameters":"Input/Output Parameters");
+        lblInputParameters.setFont(new Font("Tahoma", Font.BOLD, 11));
+
+        JScrollPane scrollPane = new JScrollPane();
+
+        btnDeleteParameter = new JButton("Delete parameter");
+        btnDeleteParameter.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent arg0) {
+                deleteSelectedRows();
+            }
+        });
+        btnDeleteParameter.setEnabled(false);
+
+        tblParameters = new JTable();
+        tblParameters.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
+        tblParameters.setFillsViewportHeight(true);
+        defaultTableModel = new DefaultTableModel(new Object[][] { { null, null, null, null }, }, new String[] { "I/O",
+                "Parameter Name", "Type", "Description" });
+        tblParameters.setModel(defaultTableModel);
+        defaultTableModel.addTableModelListener(new TableModelListener() {
+
+            @Override
+            public void tableChanged(TableModelEvent arg0) {
+                if (!ignoreTableChanges) {
+					int selectedRow = tblParameters.getSelectedRow();
+					if (selectedRow != -1
+							&& defaultTableModel.getRowCount() > 0) {
+						Object parameterIOType = defaultTableModel.getValueAt(
+								selectedRow, 0);
+						Object parameterDataType = defaultTableModel
+								.getValueAt(selectedRow, 2);
+						if (parameterIOType == null
+								|| parameterIOType.equals("")) {
+							defaultTableModel.setValueAt(getIOStringList()[0],
+									selectedRow, 0);
+						}
+						if (parameterDataType == null
+								|| parameterDataType.equals("")) {
+							defaultTableModel.setValueAt(getDataTypes()[0],
+									selectedRow, 2);
+						}
+					}
+					addNewRowIfLastIsNotEmpty();
+				}
+            }
+
+        });
+        TableColumn ioColumn = tblParameters.getColumnModel().getColumn(0);
+        String[] ioStringList = getIOStringList();
+        ioColumn.setCellEditor(new StringArrayComboBoxEditor(ioStringList));
+
+        TableColumn datatypeColumn = tblParameters.getColumnModel().getColumn(2);
+        String[] dataTypeStringList = getDataTypes();
+        datatypeColumn.setCellEditor(new StringArrayComboBoxEditor(dataTypeStringList));
+
+        TableColumn parameterNameCol = tblParameters.getColumnModel().getColumn(1);
+        parameterNameCol.setPreferredWidth(190);
+        scrollPane.setViewportView(tblParameters);
+        ListSelectionModel selectionModel = tblParameters.getSelectionModel();
+        selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+
+        selectionModel.addListSelectionListener(new ListSelectionListener() {
+            @Override
+            public void valueChanged(ListSelectionEvent e) {
+                btnDeleteParameter.setEnabled(tblParameters.getSelectedRows().length > 0);
+            }
+
+        });
+        JLabel lblTableParameterNote=null;
+        if (!isServiceDescriptionMode()) {
+			final JPopupMenu popup = new JPopupMenu();
+			JMenuItem menuItem = new JMenuItem(
+					"Bind to parameters in existing service...");
+			menuItem.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent arg0) {
+					bindExistingServiceDescriptionAsParameters();
+				}
+
+			});
+			popup.add(menuItem);
+			tblParameters.addMouseListener(new MouseAdapter() {
+				@Override
+				public void mouseClicked(MouseEvent e) {
+					showPopup(e);
+				}
+
+				public void mousePressed(MouseEvent e) {
+					showPopup(e);
+				}
+
+				public void mouseReleased(MouseEvent e) {
+					showPopup(e);
+				}
+
+				private void showPopup(MouseEvent e) {
+					if (e.isPopupTrigger()) {
+						popup.show(tblParameters, e.getX(), e.getY());
+					}
+				}
+			});
+			lblTableParameterNote = new JLabel("*Note: Right click on the table to bind an existing service");
+			lblTableParameterNote.setFont(new Font("Tahoma", Font.ITALIC, 11));
+		}
+		chkForceFileStagingToWorkDir=new JCheckBox("Advanced: Force input file staging to working directory");
+        chkForceFileStagingToWorkDir.addActionListener(new ActionListener(){
+
+			@Override
+			public void actionPerformed(ActionEvent arg0) {
+				setForceFileStagingToWorkDir(chkForceFileStagingToWorkDir.isSelected());
+			}
+        	
+        });
+        GridPanel buttonPane = new GridPanel();
+        {
+            GridBagLayout gbl_buttonPane = new GridBagLayout();
+            gbl_buttonPane.columnWidths = new int[] { 307, 136, 0 };
+            gbl_buttonPane.rowHeights = new int[] { 33, 0 };
+            gbl_buttonPane.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
+            gbl_buttonPane.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
+            
+
+            lblError = new JLabel("");
+            lblError.setForeground(Color.RED);
+            GridBagConstraints gbc_lblError = new GridBagConstraints();
+            gbc_lblError.insets = new Insets(0, 0, 0, 5);
+            gbc_lblError.gridx = 0;
+            gbc_lblError.gridy = 0;
+            buttonPane.add(lblError);
+            JPanel panel = new JPanel();
+            GridBagConstraints gbc_panel = new GridBagConstraints();
+            gbc_panel.anchor = GridBagConstraints.NORTHWEST;
+            gbc_panel.gridx = 1;
+            gbc_panel.gridy = 0;
+            buttonPane.add(panel);
+            {
+            	JButton resetButton = new JButton("Reset");
+                resetButton.addActionListener(new ActionListener() {
+                    @Override
+                    public void actionPerformed(ActionEvent e) {
+                    	loadData();
+                    }
+                });
+                panel.add(resetButton);
+            }
+            {
+                okButton = new JButton("Save");
+                if (!isNewDescription()){
+                	okButton.setText("Update");
+                }
+                okButton.setEnabled(false);
+                okButton.addActionListener(new ActionListener() {
+                    @Override
+                    public void actionPerformed(ActionEvent e) {
+                        saveServiceDescription();
+                        close();
+                    }
+                });
+                panel.add(okButton);
+                okButton.setActionCommand("OK");
+                getRootPane().setDefaultButton(okButton);
+            }
+            {
+                JButton cancelButton = new JButton("Cancel");
+                cancelButton.addActionListener(new ActionListener() {
+                    @Override
+                    public void actionPerformed(ActionEvent e) {
+                        setServiceCreated(false);
+                        close();
+                    }
+                });
+                panel.add(cancelButton);
+                cancelButton.setActionCommand("Cancel");
+            }
+        }
+        
+        contentPanel.add(lblServiceName);
+        contentPanel.add(txtServiceName);
+        GridPanel parameterPanel=new GridPanel();
+        if (isServiceDescriptionMode()) {
+			parameterPanel.add(lblInputParameters);
+		}
+		if (lblTableParameterNote!=null) {
+			parameterPanel.add(lblTableParameterNote);
+		}
+        parameterPanel.add(scrollPane);
+			//        if (isServiceDescriptionMode()){
+    	parameterPanel.add(btnDeleteParameter);
+//        }else{
+//            GridPanel parameterOptionPanel=new GridPanel();
+//        	JButton btnLoadExistingServiceData = new JButton("Bind to parameters in existing service description...");
+//        	btnLoadExistingServiceData.addActionListener(new ActionListener(){
+//				@Override
+//				public void actionPerformed(ActionEvent arg0) {
+//					bindExistingServiceDescriptionAsParameters();
+//				}
+//        	});
+//        	parameterOptionPanel.add(btnLoadExistingServiceData);
+//        	parameterOptionPanel.add(btnDeleteParameter);
+//        	parameterPanel.add(parameterOptionPanel);
+//        }
+        
+        SwingUtil.layoutToGrid(contentPanel.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, 1);
+//        if (lblTableParameterNote==null){
+        	SwingUtil.layoutToGrid(parameterPanel.getSwingComponent(), 3, 1, 1, 0);
+//        }else{
+//        	SwingUtil.layoutToGrid(parameterPanel.getSwingComponent(), 4, 1, 2, 0);
+//        }
+        GridPanel infoPanel = new GridPanel();
+        if (isServiceDescriptionMode()) {
+			infoPanel.add(contentPanel);
+		}
+		infoPanel.add(parameterPanel);
+        infoPanel.add(chkForceFileStagingToWorkDir);
+        if (!isServiceDescriptionMode()) {
+			infoPanel.add(contentPanel);
+		}
+        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+        if (isServiceDescriptionMode()) {
+			infoPanel.layout(3, 1, 1, 0);
+		}else{
+			infoPanel.layout(3, 1, 0, 0);
+		}
+		getContentPane().add(infoPanel.getSwingComponent());
+        getContentPane().add(buttonPane.getSwingComponent());
+        buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
+        setResizable(true);
+        getRootPane().setDefaultButton(okButton);
+        if (!isNewDescription()){
+        	loadData();
+        }
+    }
+
+    private void loadData() {
+    	ServiceDescriptionType descType = getOrginalServiceDescription().getType();
+		txtServiceName.setText(descType.getName());
+		setServiceName(txtServiceName.getText());
+
+		txtServiceName.setEditable(!isServiceDescriptionMode() || isNewDescription());
+    	ignoreTableChanges=true;
+    	while(defaultTableModel.getRowCount()>0){
+    		defaultTableModel.removeRow(0);
+    	}
+    	InputParameterType[] iparameters = descType.getInputParametersArray();
+    	for (InputParameterType parameter : iparameters) {
+    		defaultTableModel.addRow(new Object[] { getIOStringList()[0], parameter.getParameterName(),parameter.getParameterType().getName(),parameter.getParameterDescription()});	
+		}
+    	OutputParameterType[] oparameters = descType.getOutputParametersArray();
+    	for (OutputParameterType parameter : oparameters) {
+    		defaultTableModel.addRow(new Object[] { getIOStringList()[1], parameter.getParameterName(), parameter.getParameterType().getName(),parameter.getParameterDescription()});	
+		}
+    	addNewRowIfLastIsNotEmpty();
+    	Boolean selected = false;
+    	if (descType.getPortType()!=null && descType.getPortType().getMethod()!=null) {
+			XmlCursor cursor = descType.getPortType().getMethod().newCursor();
+//			cursor.toNextToken();
+			String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
+			cursor.dispose();
+			selected = false;
+			if (value != null) {
+				selected = Boolean.parseBoolean(value);
+			}
+		}
+		chkForceFileStagingToWorkDir.setSelected(selected);
+    	setForceFileStagingToWorkDir(selected);
+    	ignoreTableChanges=false;
+	}
+
+    private String[] getIOStringList() {
+        String[] ioStringList = new String[] { "Input", "Output" };
+        return ioStringList;
+    }
+
+    private String[] getDataTypes() {
+        String[] type = new String[DataType.Enum.table.lastInt()];
+        for (int i = 1; i <= DataType.Enum.table.lastInt(); i++) {
+            type[i - 1] = DataType.Enum.forInt(i).toString();
+        }
+        return type;
+    }
+
+    public boolean isServiceCreated() {
+        return serviceCreated;
+    }
+
+    public void setServiceCreated(boolean serviceCreated) {
+        this.serviceCreated = serviceCreated;
+    }
+
+    public ServiceDescription getServiceDescription() {
+        if (serviceDescription == null) {
+            serviceDescription = new ServiceDescription();
+        }
+        return serviceDescription;
+    }
+
+    public ServiceDescriptionType getServiceDescriptionType() {
+        return getServiceDescription().getType();
+    }
+
+    public String getServiceName() {
+        return getServiceDescription().getType().getName();
+    }
+
+    public void setServiceName(String serviceName) {
+        getServiceDescription().getType().setName(serviceName);
+        updateDialogStatus();
+    }
+
+    private void setupMethod(){
+    	if (getServiceDescriptionType().getPortType()==null){
+    		getServiceDescriptionType().setPortType(getServiceDescriptionType().addNewPortType());
+    	}
+    	if (getServiceDescriptionType().getPortType().getMethod()==null){
+    		getServiceDescriptionType().getPortType().setMethod(getServiceDescriptionType().getPortType().addNewMethod());
+    	}
+    }
+    public void setForceFileStagingToWorkDir(Boolean force){
+    	setupMethod();
+    	XmlCursor cursor = getServiceDescriptionType().getPortType().getMethod().newCursor();
+    	cursor.toNextToken();
+		if (!cursor.setAttributeText(new QName("http://airavata.apache.org/schemas/gfac/2012/12","forceFileStagingToWorkDir"),force.toString())){
+			cursor.insertAttributeWithValue("forceFileStagingToWorkDir",force.toString());
+		}
+		cursor.dispose();
+    }
+    
+    public Boolean getForceFileStagingToWorkDir(){
+    	setupMethod();
+    	XmlCursor cursor = getServiceDescriptionType().getPortType().getMethod().newCursor();    	
+    	cursor.toNextToken();
+		String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
+		cursor.dispose();
+		if (value==null){
+			return false;
+		}else{
+			return Boolean.parseBoolean(value);
+		}
+		
+    }
+    
+    private void updateDialogStatus() {
+        String message = null;
+        try {
+            validateDialog();
+        } catch (Exception e) {
+            message = e.getLocalizedMessage();
+        }
+        okButton.setEnabled(message == null);
+        setError(message);
+    }
+
+    private void validateDialog() throws Exception {
+        if (getServiceName() == null || getServiceName().trim().equals("")) {
+            throw new Exception("Name of the service cannot be empty!!!");
+        }
+
+        ServiceDescription serviceDescription2 = null;
+        try {
+            serviceDescription2 = getRegistry().getApplicationManager().getServiceDescription(getServiceName());
+        } catch (AiravataAPIInvocationException e) {
+            if (e.getCause() instanceof PathNotFoundException) {
+                // non-existant name. just want we want
+            } else {
+                throw e;
+            }
+        }
+        if (isNewDescription() && serviceDescription2 != null) {
+            throw new Exception("Service descriptor with the given name already exists!!!");
+        }
+    }
+
+    public void saveServiceDescription() {
+        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
+        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
+
+        for (int i = 0; i < defaultTableModel.getRowCount(); i++) {
+            String parameterName = (String) defaultTableModel.getValueAt(i, 1);
+            String paramType = (String) defaultTableModel.getValueAt(i, 2);
+            String parameterDescription = (String) defaultTableModel.getValueAt(i, 3);
+            if (parameterName != null && !parameterName.trim().equals("")) {
+                // todo how to handle Enum
+                if (getIOStringList()[0].equals(defaultTableModel.getValueAt(i, 0))) {
+                    InputParameterType parameter = InputParameterType.Factory.newInstance();
+                    parameter.setParameterName(parameterName);
+                    parameter.setParameterDescription(parameterDescription);
+                    ParameterType parameterType = parameter.addNewParameterType();
+                    parameterType.setType(DataType.Enum.forString(paramType));
+                    parameterType.setName(paramType);
+                    inputParameters.add(parameter);
+
+                } else {
+                    OutputParameterType parameter = OutputParameterType.Factory.newInstance();
+                    parameter.setParameterName(parameterName);
+                    parameter.setParameterDescription(parameterDescription);
+                    ParameterType parameterType = parameter.addNewParameterType();
+                    parameterType.setType(DataType.Enum.forString(paramType));
+                    parameterType.setName(paramType);
+                    outputParameters.add(parameter);
+                }
+            }
+        }
+        getServiceDescriptionType().setInputParametersArray(inputParameters.toArray(new InputParameterType[] {}));
+        getServiceDescriptionType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[] {}));
+
+        try {
+			if (getRegistry().getApplicationManager().isServiceDescriptorExists(getServiceDescription().getType().getName())) {
+				getRegistry().getApplicationManager().updateServiceDescriptor(getServiceDescription());
+			}else{
+				getRegistry().getApplicationManager().saveServiceDescription(getServiceDescription());
+			}
+			setServiceCreated(true);
+		} catch (AiravataAPIInvocationException e) {
+			e.printStackTrace();
+			setError(e.getMessage());
+		}
+    }
+
+    public void close() {
+        getDialog().setVisible(false);
+    }
+
+    private void setError(String errorMessage) {
+        if (errorMessage == null || errorMessage.trim().equals("")) {
+            lblError.setText("");
+        } else {
+            lblError.setText(errorMessage.trim());
+        }
+    }
+
+    private void deleteSelectedRows() {
+        // TODO confirm deletion of selected rows
+        int selectedRow = tblParameters.getSelectedRow();
+        while (selectedRow >= 0 && tblParameters.getRowCount()>0) {
+            defaultTableModel.removeRow(selectedRow);
+            selectedRow = tblParameters.getSelectedRow();
+        }
+        addNewRowIfLastIsNotEmpty();
+    }
+
+    private void addNewRowIfLastIsNotEmpty() {
+    	
+        if (defaultTableModel.getRowCount()>0) {
+			Object parameterName = defaultTableModel.getValueAt(
+					defaultTableModel.getRowCount() - 1, 1);
+			if (parameterName != null && !parameterName.equals("")) {
+				defaultTableModel
+						.addRow(new Object[] { null, null, null, null });
+			}
+		}else{
+			if (tblParameters.getSelectedRow()==-1){
+				defaultTableModel.addRow(new Object[] { null, null, null, null });
+			}
+			
+		}
+    }
+
+    public AiravataAPI getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+
+    public boolean isNewDescription() {
+		return newDescription;
+	}
+
+	public void setNewDescription(boolean newDescription) {
+		this.newDescription = newDescription;
+	}
+
+	public ServiceDescription getOrginalServiceDescription() {
+		return orginalServiceDescription;
+	}
+
+	public void setOrginalServiceDescription(ServiceDescription orginalServiceDescription) {
+		this.orginalServiceDescription = orginalServiceDescription;
+	}
+
+	public boolean isServiceDescriptionMode() {
+		return serviceDescriptionMode;
+	}
+
+	public void setServiceDescriptionMode(boolean serviceDescriptionMode) {
+		this.serviceDescriptionMode = serviceDescriptionMode;
+	}
+
+	public String getSuggestedNamePrefix() {
+		return suggestedNamePrefix;
+	}
+
+	public void setSuggestedNamePrefix(String suggestedNamePrefix) {
+		this.suggestedNamePrefix = suggestedNamePrefix;
+	}
+
+	public String getTitlePrefix() {
+		return titlePrefix;
+	}
+
+	public void setTitlePrefix(String titlePrefix) {
+		this.titlePrefix = titlePrefix;
+	}
+
+	private void bindExistingServiceDescriptionAsParameters() {
+		DescriptorListDialog descriptorListDialog = new DescriptorListDialog(getRegistry(),DescriptorType.SERVICE);
+		descriptorListDialog.open();
+		if (descriptorListDialog.isServiceSelected()){
+			setOrginalServiceDescription((ServiceDescription) descriptorListDialog.getSelected());
+			setNewDescription(false);
+			loadData();
+		}
+	}
+
+	private class StringArrayComboBoxEditor extends DefaultCellEditor {
+        private static final long serialVersionUID = -304464739219209395L;
+
+        public StringArrayComboBoxEditor(Object[] items) {
+            super(new JComboBox(items));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/amazon/InstanceConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/amazon/InstanceConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/amazon/InstanceConfigurationDialog.java
new file mode 100644
index 0000000..9c519c6
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/amazon/InstanceConfigurationDialog.java
@@ -0,0 +1,224 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.amazon;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractAction;
+import javax.swing.ButtonGroup;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaComboBox;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.airavata.xbaya.util.AmazonUtil;
+
+public class InstanceConfigurationDialog {
+    private XBayaGUI xbayaGUI;
+
+    private InstanceNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField nameTextField;
+    private XBayaTextField idTextField;
+    private XBayaTextField usernameTextField;
+    private XBayaComboBox instanceTypeComboBox;
+
+    private JRadioButton amiButton;
+
+    private JRadioButton idButton;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public InstanceConfigurationDialog(InstanceNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+
+        // set name
+        String name = this.node.getName();
+        this.nameTextField.setText(name);
+
+        // set Selected
+        this.amiButton.setSelected(this.node.isStartNewInstance());
+        this.idButton.setSelected(!this.node.isStartNewInstance());
+
+        // instance type
+        if (this.node.isStartNewInstance())
+            this.instanceTypeComboBox.getJComboBox().setEnabled(true);
+        else
+            this.instanceTypeComboBox.getJComboBox().setEnabled(false);
+
+        // set Value
+        this.idTextField.setText(this.node.getIdAsValue());
+        this.usernameTextField.setText(this.node.getUsername());
+        if (this.node.getInstanceType() != null)
+            this.instanceTypeComboBox.setSelectedItem(this.node.getInstanceType());
+        else
+            this.instanceTypeComboBox.setSelectedItem(AmazonUtil.INSTANCE_TYPE[1]);
+
+        // show
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+
+        /*
+         * Name
+         */
+        this.nameTextField = new XBayaTextField();
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+        this.nameTextField.setEditable(false);
+
+        /*
+         * Radio button
+         */
+        this.amiButton = new JRadioButton("Start new instance");
+        this.amiButton.setSelected(true);
+        this.amiButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent paramActionEvent) {
+                InstanceConfigurationDialog.this.instanceTypeComboBox.getJComboBox().setEnabled(true);
+            }
+        });
+        this.instanceTypeComboBox = new XBayaComboBox(new DefaultComboBoxModel(AmazonUtil.INSTANCE_TYPE));
+        this.instanceTypeComboBox.setSelectedItem(AmazonUtil.INSTANCE_TYPE[1]);
+        GridPanel amiPanel = new GridPanel();
+        amiPanel.add(this.amiButton);
+        amiPanel.add(this.instanceTypeComboBox);
+        amiPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);
+
+        this.idButton = new JRadioButton("Use existing instance");
+        this.idButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent paramActionEvent) {
+                InstanceConfigurationDialog.this.instanceTypeComboBox.getJComboBox().setEnabled(false);
+            }
+        });
+        ButtonGroup serviceTypeButtonGroup = new ButtonGroup();
+        serviceTypeButtonGroup.add(this.amiButton);
+        serviceTypeButtonGroup.add(this.idButton);
+        XBayaLabel radioLabel = new XBayaLabel("Options", this.amiButton);
+
+        /*
+         * AMI/Instance ID
+         */
+        this.idTextField = new XBayaTextField();
+        XBayaLabel idLabel = new XBayaLabel("AMI/Instance ID", this.amiButton);
+
+        /*
+         * Username
+         */
+        this.usernameTextField = new XBayaTextField();
+        XBayaLabel usernameLabel = new XBayaLabel("Username", this.amiButton);
+
+        GridPanel gridPanel = new GridPanel();
+        gridPanel.add(nameLabel);
+        gridPanel.add(this.nameTextField);
+        gridPanel.add(radioLabel);
+        gridPanel.add(amiPanel);
+        gridPanel.add(new JPanel());
+        gridPanel.add(this.idButton);
+        gridPanel.add(idLabel);
+        gridPanel.add(this.idTextField);
+        gridPanel.add(usernameLabel);
+        gridPanel.add(this.usernameTextField);
+        gridPanel.layout(5, 2, GridPanel.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                if (InstanceConfigurationDialog.this.idTextField.getText() == null
+                        || InstanceConfigurationDialog.this.idTextField.getText().isEmpty()) {
+                    InstanceConfigurationDialog.this.xbayaGUI.getErrorWindow()
+                            .error("Please input AMI ID or Instance ID");
+                    return;
+                }
+                if (InstanceConfigurationDialog.this.usernameTextField.getText() == null
+                        || InstanceConfigurationDialog.this.usernameTextField.getText().isEmpty()) {
+                    InstanceConfigurationDialog.this.xbayaGUI.getErrorWindow().error(
+                            "Please input username to access instance");
+                    return;
+                }
+
+                InstanceConfigurationDialog.this.node.setStartNewInstance(InstanceConfigurationDialog.this.amiButton
+                        .isSelected());
+                if (InstanceConfigurationDialog.this.amiButton.isSelected()) {
+                    InstanceConfigurationDialog.this.node.setAmiId(InstanceConfigurationDialog.this.idTextField
+                            .getText());
+                    InstanceConfigurationDialog.this.node
+                            .setInstanceType(InstanceConfigurationDialog.this.instanceTypeComboBox.getText());
+                } else {
+                    InstanceConfigurationDialog.this.node.setInstanceId(InstanceConfigurationDialog.this.idTextField
+                            .getText());
+                    InstanceConfigurationDialog.this.node.setInstanceType(null);
+                }
+                InstanceConfigurationDialog.this.node.setUsername(InstanceConfigurationDialog.this.usernameTextField
+                        .getText());
+                hide();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Instance Configuration", gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java
new file mode 100644
index 0000000..724b091
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicNodeWindow.java
@@ -0,0 +1,472 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.dynamic;
+
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JFileChooser;
+import javax.swing.JPanel;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.workflow.model.component.url.URLComponentRegistry;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.dynamic.BasicTypeMapping;
+import org.apache.airavata.workflow.model.graph.dynamic.DynamicNode;
+import org.apache.airavata.workflow.model.graph.dynamic.SchemaCompilerUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.graph.ws.WSPort;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.component.registry.ComponentController;
+import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
+import org.apache.airavata.xbaya.invoker.DynamicServiceCreator;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
+import org.apache.airavata.xbaya.util.RegistryConstants;
+import org.xmlpull.infoset.XmlElement;
+import org.xmlpull.infoset.XmlNamespace;
+import org.xmlpull.v1.builder.XmlBuilderException;
+
+import xsul5.wsdl.WsdlDefinitions;
+
+public class DynamicNodeWindow {
+
+    /**
+     * CLASSES_DIR
+     */
+    private static final String CLASSES_DIR = "classes";
+
+    /**
+     * SRC_DIR
+     */
+    private static final String SRC_DIR = "src";
+
+
+    /**
+     * CLASS
+     */
+    private static final String CLASS = "class";
+
+    /**
+     * PACKAGE
+     */
+    private static final String PACKAGE = "package";
+
+    /**
+     * LINE
+     */
+    private static final String LINE = "\n";
+
+    /**
+     * TAB
+     */
+    private static final String TAB = "\t";
+
+    /**
+     * SPACE
+     */
+    private static final String SPACE = " ";
+
+    private XBayaEngine engine;
+
+    private DynamicNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextArea javaCodeTxtArea;
+
+    private String typesPath;
+
+    private String functionStr;
+
+    private JCheckBox checkBox;
+
+    /**
+     * Constructs a WSNodeWindow.
+     * 
+     * @param engine
+     *            The XBayaEngine
+     * @param node
+     */
+    public DynamicNodeWindow(XBayaEngine engine, DynamicNode node) {
+        this.engine = engine;
+        this.node = node;
+        initGUI();
+
+    }
+
+    /**
+     * Shows the notification.
+     * 
+     * @param event
+     *            The notification to show
+     */
+    public void show() {
+
+        JFileChooser fileChooser = new JFileChooser();
+        fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+        int ret = fileChooser.showOpenDialog(this.engine.getGUI().getFrame());
+        if (JFileChooser.APPROVE_OPTION != ret) {
+            throw new WorkflowRuntimeException("Cannot proceed without valid directory");
+        }
+        File selectedDir = fileChooser.getSelectedFile();
+        File rootDir = new File(selectedDir, "xbaya");
+        deleteDir(rootDir);
+        rootDir.mkdir();
+        File srcDir = new File(rootDir, SRC_DIR);
+        srcDir.mkdir();
+        File classesDir = new File(rootDir, CLASSES_DIR);
+        classesDir.mkdir();
+        initSchema(rootDir, srcDir, srcDir);
+
+        this.javaCodeTxtArea.setText(generateClass());
+
+        this.dialog.show();
+        if (this.checkBox.isSelected()) {
+            deployWebservice();
+        } else {
+            this.compileAndRegisterJar(rootDir, srcDir, srcDir);
+        }
+
+    }
+
+    private void deployWebservice() {
+        try {
+            DynamicServiceCreator factory = new DynamicServiceCreator(
+                    "http://129.79.246.108:8080/axis2/services/ServiceCreator?wsdl");
+            String code = this.javaCodeTxtArea.getText();
+            factory.createService(code);
+            URLComponentRegistry registry = null;
+            Thread.sleep(10000);
+            registry = new URLComponentRegistry(new URI("http://129.79.246.108:8080/axis2/services/"
+                    + getClassName(code) + "?wsdl"));
+            ComponentRegistryLoader.getLoader(this.engine, RegistryConstants.REGISTRY_TYPE_URL).load(registry);
+
+            Node newNode = this.engine
+                    .getGUI()
+                    .getGraphCanvas()
+                    .addNode(
+                            ((ComponentTreeNode) ComponentController.getComponentTree(registry).getFirstLeaf()).getComponentReference()
+                                    .getComponent(), this.node.getPosition());
+            List<DataPort> inputPorts = newNode.getInputPorts();
+            Graph graph = this.engine.getGUI().getGraphCanvas().getGraph();
+            for (int i = 0; i < inputPorts.size(); ++i) {
+                graph.addEdge(this.node.getInputPort(i).getFromPort(), inputPorts.get(i));
+            }
+            List<DataPort> outputPorts = newNode.getOutputPorts();
+
+            for (int i = 0; i < outputPorts.size(); ++i) {
+                List<Port> toPorts = this.node.getOutputPort(i).getToPorts();
+                for (Port port : toPorts) {
+                    graph.removeEdge(this.node.getOutputPort(i), port);
+                    graph.addEdge(outputPorts.get(i), port);
+                }
+
+            }
+
+            this.engine.getGUI().getWorkflow().removeNode(this.node);
+
+        } catch (Exception e) {
+            this.engine.getGUI().getErrorWindow().error(e);
+        }
+
+    }
+
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void initGUI() {
+        BasicTypeMapping.reset();
+
+        this.javaCodeTxtArea = new XBayaTextArea();
+        XBayaLabel operationLabel = new XBayaLabel("Operation", this.javaCodeTxtArea);
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(operationLabel);
+        infoPanel.add(this.javaCodeTxtArea);
+        checkBox = new JCheckBox("Export as webservice");
+        infoPanel.add(new XBayaLabel("", checkBox));
+
+        infoPanel.add(checkBox);
+        infoPanel.layout(2, 2, 0, 0);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+
+                hide();
+            }
+        });
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), this.node.getName(), infoPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+    private String generateClass() {
+
+        String ret = "package org.apache.airavata.xbaya;";
+        ret += LINE + LINE;
+        ret += "public class DefaultClassName{";
+        ret += LINE + LINE + TAB + "public";
+        String function = "";
+        List<Port> toNodes = this.node.getOutputPort(0).getToPorts();
+        XmlElement returnElement = null;
+        QName returnType = null;
+        if (toNodes.size() == 0) {
+            function += SPACE + "void";
+        } else {
+
+            if (toNodes.size() == 1 && toNodes.get(0) instanceof WSPort) {
+                WSPort outPort = (WSPort) toNodes.get(0);
+                returnElement = outPort.getComponentPort().getElement();
+                returnType = outPort.getType();
+            } else {
+                throw new WorkflowRuntimeException("Unhandled  port type for Dynamic component or to many outputs");
+            }
+            for (Port port : toNodes) {
+                if (toNodes.get(0) instanceof DataPort) {
+                    if (!returnType.equals(((DataPort) toNodes.get(0)).getType())) {
+                        throw new WorkflowRuntimeException(
+                                "Dynamic output port connected to input ports of different types.");
+                    }
+                } else {
+                    throw new WorkflowRuntimeException("Unhandled  port type for Dynamic component");
+                }
+            }
+            int index = BasicTypeMapping.getSimpleTypeIndex(returnElement);
+            if (-1 != index) {
+                function += SPACE + BasicTypeMapping.getTypeName(index);
+            } else {
+                throw new WorkflowRuntimeException("WIll be fixed with complex type mappign");
+            }
+        }
+
+        function += SPACE + "operationName(";
+        List<DataPort> inputPorts = this.node.getInputPorts();
+        boolean first = true;
+
+        // variable list in function prototype
+        for (DataPort inPort : inputPorts) {
+            Port fromPort = inPort.getFromPort();
+            if (fromPort instanceof WSPort) {
+                WSPort wsPort = (WSPort) fromPort;
+                XmlElement element = wsPort.getComponentPort().getElement();
+
+                // QName inType = ((DataPort) fromPort).getType();
+                int typeIndex = BasicTypeMapping.getSimpleTypeIndex(element);
+                if (-1 != typeIndex) {
+                    if (first) {
+                        first = false;
+                    } else {
+                        function += SPACE + ",";
+                    }
+                    function += BasicTypeMapping.getTypeName(typeIndex) + SPACE
+                            + BasicTypeMapping.getTypeVariableName(typeIndex);
+                } else {
+                    throw new WorkflowRuntimeException("Complex Type occured:This will be fixed!!!!!");
+                }
+            } else {
+                throw new WorkflowRuntimeException("Dynamic Node connected to non data port");
+            }
+        }
+
+        function += ")";
+        ret += function;
+        this.functionStr = function;
+        // body
+        ret += "{" + LINE + LINE;
+        if (null != returnElement) {
+            ret += TAB + TAB + "return" + SPACE
+                    + BasicTypeMapping.getTypeDefault(BasicTypeMapping.getSimpleTypeIndex(returnElement)) + ";";
+        }
+        ret += LINE;
+        ret += TAB + "}";
+        ret += LINE + "}";
+        return ret;
+
+    }
+
+    private void initSchema(File rootDir, File srcDir, File classesDir) {
+
+        List<DataPort> inputPorts = node.getInputPorts();
+        for (DataPort inPort : inputPorts) {
+            Port fromPort = inPort.getFromPort();
+            Node fromNode = inPort.getFromNode();
+            if (fromNode instanceof WSNode) {
+                WSNode fromWsNode = (WSNode) fromNode;
+                if (null != fromPort && fromPort instanceof DataPort) {
+                    DataPort fromDataPort = (DataPort) fromPort;
+                    WsdlDefinitions wsdl = engine.getGUI().getWorkflow().getWSDLs().get(fromWsNode.getWSDLID());
+                    Iterator<XmlNamespace> itr = wsdl.xml().namespaces().iterator();
+                    try {
+                        XmlElement schema = wsdl.getTypes().element("schema").clone();
+                        // do not change the following ordering of setting
+                        // namespaces.
+                        schema.setNamespace(xsul5.XmlConstants.BUILDER.newNamespace("http://www.w3.org/2001/XMLSchema"));
+                        while (itr.hasNext()) {
+                            XmlNamespace next = itr.next();
+                            if (!"".equals(next.getPrefix()) && null != next.getPrefix()) {
+                                schema.setAttributeValue("xmlns:" + next.getPrefix(), next.getName());
+                            }
+
+                        }
+
+                        try {
+                            xsul5.XmlConstants.BUILDER
+                                    .serializeToOutputStream(schema, new FileOutputStream(rootDir.getCanonicalPath()
+                                            + File.separatorChar + "types.xsd"));
+                        } catch (Exception e) {
+                            // TODO Auto-generated catch block
+                            e.printStackTrace();
+                        }
+
+                        typesPath = rootDir.getCanonicalPath() + File.separatorChar + "mytype.jar";
+                        String[] args = new String[] { "-d", classesDir.getCanonicalPath(), "-src",
+                                srcDir.getCanonicalPath(), "-out", typesPath,
+                                rootDir.getCanonicalPath() + File.separatorChar + "types.xsd" };
+                        SchemaCompilerUtil.compile(args);
+
+                    } catch (XmlBuilderException e) {
+                        this.engine.getGUI().getErrorWindow().error(e);
+                    } catch (CloneNotSupportedException e) {
+                        this.engine.getGUI().getErrorWindow().error(e);
+                    } catch (IOException e) {
+                        // TODO Auto-generated catch block
+                        e.printStackTrace();
+                    }
+
+                } else {
+                    throw new WorkflowRuntimeException("Unknown port for code generation" + fromPort);
+                }
+            } else {
+                throw new WorkflowRuntimeException("Unknown from node for code generation" + fromNode);
+            }
+        }
+    }
+
+    private void compileAndRegisterJar(File rootDir, File srcDir, File classesDir) {
+        // String code = this.javaCodeTxtArea.getText();
+        // String packageName = getPackageName(code);
+        // String className = getClassName(code);
+        // try {
+        // File classFile = new File(srcDir.getCanonicalPath()+ File.separator
+        // + packageName.replace('.', File.separatorChar)
+        // + File.separator + className+".java");
+        // classFile.getParentFile().mkdirs();
+        //
+        // FileWriter out = new FileWriter(classFile);
+        // out.write(code);
+        // out.flush();
+        // out.close();
+        //
+        // JarHelper jarHelper = new JarHelper();
+        // jarHelper.unjarDir(new File(this.typesPath), classesDir);
+        //
+        // Main.compile(new String[]{classFile.getCanonicalPath(), "-d", classesDir.getCanonicalPath()});
+        // File implJar = new File(rootDir, "impl.jar");
+        // jarHelper.jarDir( classesDir, implJar);
+        // node.setImplURL(implJar.toURL());
+        // node.setOperationName(getOperationName(code));
+        // node.setClassName(getPackageName(code)+"."+getClassName(code));
+        // } catch (IOException e) {
+        // this.engine.getGUI().getErrorWindow().error(e);
+        // }
+
+    }
+
+    private String getOperationName(String code) {
+        String[] publicSplit = code.split("public");
+        String searchStr = this.functionStr.substring(this.functionStr.indexOf("("), this.functionStr.indexOf(")"));
+        int index = -1;
+        for (int i = 0; i < publicSplit.length; ++i) {
+            if (publicSplit[i].indexOf(searchStr) != -1) {
+                index = i;
+                break;
+            }
+        }
+        if (index == -1) {
+            throw new WorkflowRuntimeException("Operation name not found");
+        }
+        return publicSplit[index].substring(0, publicSplit[index].indexOf(searchStr)).trim().split(" ")[1];
+    }
+
+    private String getPackageName(String code) {
+        return code.substring(code.indexOf(PACKAGE) + PACKAGE.length(), code.indexOf(";")).trim();
+    }
+
+    private String getClassName(String code) {
+        return code.substring(code.indexOf(CLASS) + CLASS.length(), code.indexOf("{")).trim().split(" ")[0].trim();
+
+    }
+
+    private boolean hasComplexTypes() {
+        List<DataPort> inputPorts = node.getInputPorts();
+        for (DataPort inPort : inputPorts) {
+            Port fromPort = inPort.getFromPort();
+            Node fromNode = inPort.getFromNode();
+            if (fromNode instanceof WSNode) {
+                if (null != fromPort && fromPort instanceof DataPort) {
+
+                } else {
+                    return false;
+                }
+            } else {
+                return false;
+            }
+        }
+        return false;
+    }
+
+    public static boolean deleteDir(File dir) {
+        if (dir.isDirectory()) {
+            String[] children = dir.list();
+            for (int i = 0; i < children.length; i++) {
+                boolean success = deleteDir(new File(dir, children[i]));
+                if (!success) {
+                    return false;
+                }
+            }
+        }
+
+        // The directory is now empty so delete it
+        return dir.delete();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
new file mode 100644
index 0000000..0b18de4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/dynamic/DynamicWorkflowRunnerWindow.java
@@ -0,0 +1,394 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.dynamic;
+
+import java.awt.event.ActionEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.UUID;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.ode.ODEClient;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.ws.monitor.MonitorConfiguration;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.interpretor.GUIWorkflowInterpreterInteractorImpl;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.graph.ws.WSNodeGUI;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+import org.xmlpull.v1.builder.XmlInfosetBuilder;
+
+import xsul.XmlConstants;
+import xsul.lead.LeadResourceMapping;
+
+public class DynamicWorkflowRunnerWindow {
+
+    private static final Logger logger = LoggerFactory.getLogger(DynamicWorkflowRunnerWindow.class);
+
+    private XBayaEngine engine;
+
+    private Workflow workflow;
+
+    private XBayaDialog dialog;
+
+    private GridPanel parameterPanel;
+
+    private XBayaTextField topicTextField;
+
+    private List<XBayaTextField> parameterTextFields = new ArrayList<XBayaTextField>();
+
+    private XBayaLabel resourceSelectionLabel;
+
+    // private XBayaComboBox resourceSelectionComboBox;
+
+//    private JComboBox gfacUrlListField;
+
+    private JCheckBox interactChkBox;
+
+	private JCheckBox chkRunWithCrossProduct;
+
+	private XBayaTextField instanceNameTextField;
+
+    protected final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
+
+    /**
+     * Constructs a TavernaRunnerWindow.
+     * 
+     * @param engine
+     * 
+     */
+    public DynamicWorkflowRunnerWindow(XBayaEngine engine) {
+        this.engine = engine;
+        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
+            initGUI();
+        }
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        this.workflow = this.engine.getGUI().getWorkflow();
+//        List<URI> urlList=null;
+//        try {
+//            urlList = this.engine.getConfiguration().getAiravataAPI().getAiravataManager().getGFaCURLs();
+//        } catch (AiravataAPIInvocationException e) {
+//            e.printStackTrace();
+//        }
+        // When run xbaya continously urls can be repeating, so first remove everything and then add
+//        this.gfacUrlListField.removeAllItems();
+//        for (URI gfacUrl : urlList) {
+//            if (XBayaUtil.isURLExists(gfacUrl + "?wsdl")) {
+//                this.gfacUrlListField.addItem(gfacUrl);
+//            }
+//        }
+//        this.gfacUrlListField.setEditable(true);
+        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
+        if (notifConfig.getBrokerURL() == null) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
+            return;
+        }
+
+        // Create input fields
+        List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
+        for (Iterator<InputNode> iterator = inputNodes.iterator(); iterator.hasNext();) {
+            InputNode node = iterator.next();
+            String id = node.getID();
+            QName parameterType = node.getParameterType();
+
+            /*
+             * If input node has no connection, skip it
+             */
+            if (parameterType == null) {
+                iterator.remove();
+                continue;
+            }
+
+            JLabel nameLabel = new JLabel(id);
+            JLabel typeField = new JLabel(parameterType.getLocalPart());
+            XBayaTextField paramField = new XBayaTextField();
+            Object value = node.getDefaultValue();
+
+            String valueString;
+            if (value == null) {
+                valueString = "";
+            } else {
+                if (value instanceof XmlElement) {
+                    XmlElement valueElement = (XmlElement) value;
+                    valueString = XMLUtil.xmlElementToString(valueElement);
+                } else {
+                    // Only string comes here for now.
+                    valueString = value.toString();
+                }
+            }
+
+            if (!node.isVisibility()) {
+                paramField.setEditable(false);
+            }
+            paramField.setText(valueString);
+            this.parameterPanel.add(nameLabel);
+            this.parameterPanel.add(typeField);
+            this.parameterPanel.add(paramField);
+            this.parameterTextFields.add(paramField);
+        }
+        this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE, 2);
+
+//        this.instanceNameTextField.setText(workflow.getName()+"_"+Calendar.getInstance().getTime().toString());
+
+        this.topicTextField.setText(UUID.randomUUID().toString());
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    public void hide() {
+        this.dialog.hide();
+
+        this.parameterPanel.resetPanel();
+        this.parameterTextFields.clear();
+    }
+
+    /**
+     * ReInit Host Name ComboBox
+     */
+    // public void reinitHostComboBox() {
+    // if (this.resourceSelectionComboBox == null)
+    // this.resourceSelectionComboBox = new XBayaComboBox(new DefaultComboBoxModel(initHostNameList()));
+    // else
+    // this.resourceSelectionComboBox.setModel(new DefaultComboBoxModel(initHostNameList()));
+    // }
+
+    private void initGUI() {
+        this.parameterPanel = new GridPanel(true);
+
+        // reinitHostComboBox();
+        // this.resourceSelectionLabel = new XBayaLabel("Select a Compute Resource", this.resourceSelectionComboBox);
+        this.instanceNameTextField = new XBayaTextField();
+        XBayaLabel instanceNameLabel = new XBayaLabel("Experiment name", this.instanceNameTextField);
+
+        this.topicTextField = new XBayaTextField();
+        XBayaLabel topicLabel = new XBayaLabel("Notification topic", this.topicTextField);
+//        this.gfacUrlListField = new JComboBox();
+//        XBayaLabel gfacURLLabel = new XBayaLabel("GFac URL", this.gfacUrlListField);
+        this.interactChkBox = new JCheckBox();
+        this.interactChkBox.setSelected(false);
+        XBayaLabel interactLabel = new XBayaLabel("Enable Service Interactions", this.interactChkBox);
+
+    	chkRunWithCrossProduct=new JCheckBox();
+    	XBayaLabel crossProductLabel = new XBayaLabel("Execute in cross product", chkRunWithCrossProduct);
+
+        GridPanel infoPanel = new GridPanel();
+        // infoPanel.add(this.resourceSelectionLabel);
+        // infoPanel.add(this.resourceSelectionComboBox);
+        infoPanel.add(instanceNameLabel);
+        infoPanel.add(this.instanceNameTextField);
+        infoPanel.add(topicLabel);
+        infoPanel.add(this.topicTextField);
+//        infoPanel.add(gfacURLLabel);
+//        infoPanel.add(this.gfacUrlListField);
+        infoPanel.add(interactLabel);
+        infoPanel.add(this.interactChkBox);
+        infoPanel.add(crossProductLabel);
+        infoPanel.add(chkRunWithCrossProduct);
+        
+        infoPanel.layout(5, 2, GridPanel.WEIGHT_NONE, 1);
+
+        GridPanel mainPanel = new GridPanel();
+        mainPanel.add(this.parameterPanel);
+        mainPanel.add(infoPanel);
+        mainPanel.layout(2, 1, 0, 0);
+
+        JButton okButton = new JButton("Run");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                execute();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Invoke workflow", mainPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+    private void execute() {
+        final List<String> arguments = new ArrayList<String>();
+        String instanceName = this.instanceNameTextField.getText();
+        if (instanceName.trim().equals("")){
+        	JOptionPane.showMessageDialog(engine.getGUI().getFrame(),
+        		    "Experiment name cannot be empty",
+        		    "Experiment Name",
+        		    JOptionPane.ERROR_MESSAGE);
+        	return;
+        }
+//        if (instanceName.equals("")){
+//        	instanceName=workflow.getName();
+//        }
+        final String instanceNameFinal=instanceName;
+        String topic = this.topicTextField.getText();
+        if (topic.length() == 0) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.TOPIC_EMPTY_ERROR);
+            return;
+        }
+
+        // Use topic as a base of workflow instance ID so that the monitor can
+        // find it.
+        URI workfowInstanceID = URI.create(StringUtil.convertToJavaIdentifier(topic));
+        this.workflow.setGPELInstanceID(workfowInstanceID);
+
+        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
+        notifConfig.setTopic(topic);
+        arguments.add("-" + JythonScript.TOPIC_VARIABLE);
+        arguments.add(topic);
+        Collection<WSNode> wsNodes = GraphUtil.getWSNodes(this.engine.getGUI().getWorkflow().getGraph());
+        // This is to enable service interaction with the back end
+        if (this.interactChkBox.isSelected()) {
+            LinkedList<String> nodeIDs = new LinkedList<String>();
+            for (WSNode node : wsNodes) {
+                nodeIDs.add(node.getID());
+                ((WSNodeGUI) NodeController.getGUI(node)).setInteractiveMode(true);
+            }
+            notifConfig.setInteractiveNodeIDs(nodeIDs);
+        } else {
+            for (WSNode node : wsNodes) {
+                ((WSNodeGUI) NodeController.getGUI(node)).setInteractiveMode(false);
+            }
+        }
+
+        final boolean isRunCrossProduct=chkRunWithCrossProduct.isSelected();
+        // TODO error check for user inputs
+
+        final List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
+        builder.newFragment("inputs");
+        new ODEClient();
+        for (int i = 0; i < inputNodes.size(); i++) {
+            InputNode inputNode = inputNodes.get(i);
+            XBayaTextField parameterTextField = this.parameterTextFields.get(i);
+            inputNode.getID();
+            String value = parameterTextField.getText();
+            inputNode.setDefaultValue(value);
+        }
+
+//        final String gFacUrl = ((URI) this.gfacUrlListField.getSelectedItem()).toASCIIString();
+//        if (null != gFacUrl && !"".equals(gFacUrl)) {
+//            try {
+//                this.engine.getConfiguration().setGFacURL(new URI(gFacUrl));
+//            } catch (URISyntaxException e) {
+//                this.engine.getGUI().getErrorWindow().error(e);
+//            }
+//        }
+        this.engine.getConfiguration().setTopic(topic);
+
+        /*
+         * Load host description from xregistry and add to interpreter
+         */
+        LeadResourceMapping mapping = null;
+        
+        final LeadResourceMapping resourceMapping = mapping;
+        final String topicString = topic;
+        new Thread() {
+            /**
+             * @see java.lang.Thread#run()
+             */
+            @Override
+            public void run() {
+                XBayaConfiguration conf = DynamicWorkflowRunnerWindow.this.engine.getConfiguration();
+                WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(engine.getGUI().getWorkflow(),topicString,conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, DynamicWorkflowRunnerWindow.this.engine.getGUI(), DynamicWorkflowRunnerWindow.this.engine.getMonitor());
+                workflowInterpreterConfiguration.setRunWithCrossProduct(isRunCrossProduct);
+
+                WorkflowInterpreter workflowInterpreter = new WorkflowInterpreter(
+                		workflowInterpreterConfiguration, new GUIWorkflowInterpreterInteractorImpl(engine, engine.getGUI().getWorkflow()));
+                DynamicWorkflowRunnerWindow.this.engine.registerWorkflowInterpreter(workflowInterpreter);
+                try {
+                    MonitorConfiguration notifConfig = DynamicWorkflowRunnerWindow.this.engine.getMonitor()
+                            .getConfiguration();
+                    notifConfig.setTopic(topicString);
+                    DynamicWorkflowRunnerWindow.this.engine.getMonitor().start();
+
+                    if (resourceMapping != null)
+                        workflowInterpreter.setResourceMapping(resourceMapping);
+
+                    workflowInterpreter.scheduleDynamically();
+//                    try {
+//						engine.getConfiguration().getJcrComponentRegistry().getRegistry().saveWorkflowExecutionName(topicString, instanceNameFinal);
+//					} catch (RegistryException e) {
+//						e.printStackTrace();
+//					}
+                } catch (WorkflowException e) {
+                    try {
+                        workflowInterpreter.cleanup();
+                    } catch (MonitorException e1) {
+                        DynamicWorkflowRunnerWindow.this.engine.getGUI().getErrorWindow().error(e1);
+                    }
+                    DynamicWorkflowRunnerWindow.this.engine.getGUI().getErrorWindow().error(e);
+                }
+
+            }
+        }.start();
+
+        hide();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ConstantConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ConstantConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ConstantConfigurationDialog.java
new file mode 100644
index 0000000..52b89a7
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ConstantConfigurationDialog.java
@@ -0,0 +1,213 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.graph.system.ConstantNode;
+import org.apache.airavata.xbaya.lead.LEADTypes;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextComponent;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.xmlpull.infoset.XmlElement;
+
+public class ConstantConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private ConstantNode node;
+
+    private XBayaDialog dialog;
+
+    private GridPanel gridPanel;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextField idTextField;
+
+    private XBayaTextField typeTextField;
+
+    private XBayaLabel valueLabel;
+
+    private XBayaTextField valueTextField;
+
+    private XBayaTextArea valueTextArea;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public ConstantConfigurationDialog(ConstantNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        QName type = this.node.getType();
+        XBayaTextComponent textComponent;
+        if (LEADTypes.isKnownType(type)) {
+            textComponent = this.valueTextField;
+            this.valueLabel.setText("Default value");
+        } else {
+            textComponent = this.valueTextArea;
+            this.valueLabel.setText("Default value (in XML)");
+        }
+        this.valueLabel.setLabelFor(textComponent);
+        final int index = 7;
+        this.gridPanel.remove(index);
+        this.gridPanel.add(textComponent, index);
+        this.gridPanel.layout(4, 2, 3, 1);
+
+        String name = this.node.getName();
+        this.nameTextField.setText(name);
+        this.idTextField.setText(this.node.getID());
+        this.typeTextField.setText(type.toString());
+        Object value = this.node.getValue();
+        String valueString;
+        if (value == null) {
+            valueString = "";
+        } else if (value instanceof XmlElement) {
+            valueString = XMLUtil.xmlElementToString((XmlElement) value);
+        } else {
+            valueString = value.toString();
+        }
+        textComponent.setText(valueString);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        String name = this.nameTextField.getText();
+        QName type = this.node.getType();
+        String valueString;
+        if (LEADTypes.isKnownType(type)) {
+            valueString = this.valueTextField.getText();
+        } else {
+            valueString = this.valueTextArea.getText();
+        }
+
+        if (name.length() == 0) {
+            String warning = "The name cannot be empty.";
+            this.xbayaGUI.getErrorWindow().error(warning);
+            return;
+        }
+        Object value = null;
+        if (valueString.length() > 0) {
+            if (LEADTypes.isKnownType(type)) {
+                if (!this.node.isInputValid(valueString)) {
+                    String warning = "The defalut value is not valid for " + this.node.getType() + ".";
+                    this.xbayaGUI.getErrorWindow().error(warning);
+                }
+                value = valueString;
+            } else {
+                try {
+                    value = XMLUtil.stringToXmlElement(valueString);
+                } catch (RuntimeException e) {
+                    String warning = "The XML for the default value is not valid.";
+                    this.xbayaGUI.getErrorWindow().error(warning, e);
+                }
+            }
+        }
+
+        this.node.setName(name);
+        this.node.setValue(value);
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.idTextField = new XBayaTextField();
+        this.idTextField.setEditable(false);
+        XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+        this.typeTextField = new XBayaTextField();
+        this.typeTextField.setEditable(false);
+        XBayaLabel typeLabel = new XBayaLabel("Type", this.typeTextField);
+
+        this.valueTextField = new XBayaTextField(); // for string
+        this.valueTextArea = new XBayaTextArea(); // for XML
+        // temporaly set text field.
+        this.valueLabel = new XBayaLabel("", this.valueTextField);
+
+        this.gridPanel = new GridPanel();
+        this.gridPanel.add(nameLabel);
+        this.gridPanel.add(this.nameTextField);
+        this.gridPanel.add(idLabel);
+        this.gridPanel.add(this.idTextField);
+        this.gridPanel.add(typeLabel);
+        this.gridPanel.add(this.typeTextField);
+        this.gridPanel.add(this.valueLabel);
+        this.gridPanel.add(this.valueTextField);
+        this.gridPanel.layout(4, 2, 3, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Constant Configuration", this.gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+}
\ No newline at end of file


[65/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
new file mode 100644
index 0000000..ca72e5f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
@@ -0,0 +1,822 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.descriptors;
+
+import java.awt.Color;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusAdapter;
+import java.awt.event.FocusEvent;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.io.File;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JDialog;
+import javax.swing.JFileChooser;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JSeparator;
+import javax.swing.JTextField;
+import javax.swing.ProgressMonitor;
+import javax.swing.SwingConstants;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
+import org.apache.airavata.schemas.gfac.GlobusHostType;
+import org.apache.airavata.schemas.gfac.GsisshHostType;
+import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
+import org.apache.airavata.schemas.gfac.SSHHostType;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.menues.MenuIcons;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLinkButton;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.xmlbeans.XmlException;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class ApplicationDescriptionDialog extends JDialog implements ActionListener {
+    /**
+	 * 
+	 */
+    private static final long serialVersionUID = -2745085755585610025L;
+    private XBayaTextField txtExecPath;
+    private XBayaTextField txtAppName;
+    private XBayaTextField txtTempDir;
+
+    private AiravataAPI registry;
+    private ApplicationDescription shellApplicationDescription;
+    private JLabel lblError;
+    private boolean applcationDescCreated = false;
+    private JButton okButton;
+
+    private String serviceName;
+    private String hostName;
+    private JComboBox cmbHostName;
+
+    private XBayaEngine engine;
+	private JButton btnHostAdvanceOptions;
+	private boolean newDescritor;
+	private ApplicationDescription originalDescription;
+	private String originalHost; 
+	private String originalService;
+    private ServiceDescription serviceDescription=null;
+	private JButton btnTmpDirBrowse;
+	private JButton btnExecBrowse;
+
+    /**
+     * Launch the application.
+     */
+    public static void main(String[] args) {
+        try {
+            ApplicationDescriptionDialog dialog = new ApplicationDescriptionDialog(null);
+            dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+            dialog.setVisible(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public ApplicationDescriptionDialog(XBayaEngine engine) {
+    	this(engine,true,null,null,null);
+    }
+    /**
+     * Create the dialog.
+     */
+    public ApplicationDescriptionDialog(XBayaEngine engine, boolean newDescritor, ApplicationDescription originalDescription, String originalHost, String originalService) {
+    	setNewDescritor(newDescritor);
+    	setOriginalDescription(originalDescription);
+    	setOriginalHost(originalHost);
+    	setOriginalService(originalService);
+        setRegistry(engine.getConfiguration().getAiravataAPI());
+        addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowOpened(WindowEvent arg0) {
+                if (isNewDescritor()) {
+					String baseName = "Application";
+					int i = 1;
+					String defaultName = baseName + i;
+					try {
+						ApplicationDescription applicationDescription = getRegistry()
+								.getApplicationManager().getApplicationDescription(getServiceName(),
+                                        getHostName());
+						while (true) {
+							boolean notFound = true;
+							if (applicationDescription.getType()
+									.getApplicationName().getStringValue()
+									.equals(defaultName)) {
+								notFound = false;
+								break;
+							}
+							if (notFound) {
+								break;
+							}
+							defaultName = baseName + (++i);
+						}
+					} catch (Exception e) {
+						e.printStackTrace();
+					}
+					txtAppName.setText(defaultName);
+					setApplicationName(txtAppName.getText());
+				}
+            }
+        });
+        this.engine=engine;
+        iniGUI();
+        if (originalService!=null){
+    		try {
+    			ServiceDescription disc = getRegistry().getApplicationManager().getServiceDescription(originalService);
+    			if(disc!=null){
+    				setServiceDescription(disc);
+    			}
+    			throw new AiravataAPIInvocationException(new Exception("Service Description not found in registry."));
+			} catch (AiravataAPIInvocationException e) {
+				e.printStackTrace();
+			}
+    	}
+    }
+
+    public void open() {
+        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+        setVisible(true);
+    }
+
+    protected ApplicationDescriptionDialog getDialog() {
+        return this;
+    }
+    
+    private void iniGUI() {
+        if (isNewDescritor()) {
+			setTitle("Application Description");
+		}else{
+			setTitle("Update Application Description: "+ getOriginalDescription().getType().getApplicationName().getStringValue());
+		}
+		setBounds(100, 100, 600, 620);
+        setModal(true);
+        setLocationRelativeTo(null);
+        GridPanel buttonPane = new GridPanel();
+//        getContentPane().setLayout(new BorderLayout());
+        {
+        	
+//            buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+//            getContentPane().add(buttonPane, BorderLayout.SOUTH);
+
+            lblError = new JLabel("");
+            lblError.setForeground(Color.RED);
+            buttonPane.add(lblError);
+            if (!isNewDescritor()){
+            	JButton resetButton = new JButton("Reset");
+                resetButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        loadData();
+                    }
+                });
+                buttonPane.add(resetButton);
+            }
+            {
+                okButton = new JButton("Save");
+                if (!isNewDescritor()){
+                	okButton.setText("Update");
+                }
+                okButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        saveApplicationDescription();
+                        close();
+                    }
+                });
+                okButton.setEnabled(false);
+                okButton.setActionCommand("OK");
+                buttonPane.add(okButton);
+                getRootPane().setDefaultButton(okButton);
+            }
+            {
+                JButton cancelButton = new JButton("Cancel");
+                cancelButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        setApplicationDescCreated(false);
+                        close();
+                    }
+                });
+                cancelButton.setActionCommand("Cancel");
+                buttonPane.add(cancelButton);
+            }
+        }
+        {
+//            JPanel panel = new JPanel();
+//            getContentPane().add(panel, BorderLayout.CENTER);
+        	JPanel execPath=new JPanel();
+            txtExecPath = new XBayaTextField();
+            txtExecPath.getTextField().addKeyListener(new KeyAdapter() {
+                @Override
+                public void keyReleased(KeyEvent e) {
+                    setExecutablePath(txtExecPath.getText());
+                }
+            });
+            txtExecPath.getTextField().addFocusListener(new FocusAdapter() {
+            	@Override
+            	public void focusLost(FocusEvent e) {
+            		super.focusLost(e);
+            		updateTempDirWithExecPath(txtExecPath.getText());
+            	}
+			});
+            txtExecPath.setColumns(10);
+            btnExecBrowse=new JButton(MenuIcons.OPEN_ICON);
+            btnExecBrowse.addActionListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent arg0) {
+					JFileChooser c = new JFileChooser();
+					int rVal = c.showOpenDialog(null);
+					if (rVal == JFileChooser.APPROVE_OPTION) {
+						txtExecPath.setText(c.getSelectedFile().toString());
+						setExecutablePath(txtExecPath.getText());
+					}
+				}
+            });
+            execPath.add(txtExecPath.getSwingComponent());
+            execPath.add(btnExecBrowse);
+            JButton btnIOParameters = new JButton("IO Parameters...");
+            btnIOParameters.addActionListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent event) {
+					try {
+                        ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),getServiceDescription()==null,getServiceDescription(),false,getApplicationName());
+                        serviceDescriptionDialog.setLocationRelativeTo(getContentPane());
+                        serviceDescriptionDialog.open();
+                        if (serviceDescriptionDialog.isServiceCreated()) {
+                        	setServiceDescription(serviceDescriptionDialog.getServiceDescription());
+                        }
+                    } catch (Exception e1) {
+                        e1.printStackTrace();
+                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
+                    }
+				}
+            });
+            execPath.add(new JLabel("   "));
+            execPath.add(btnIOParameters);
+            
+            setupLayoutForBrowse(execPath,txtExecPath.getSwingComponent());
+
+            txtAppName = new XBayaTextField();
+            txtAppName.getTextField().addKeyListener(new KeyAdapter() {
+                @Override
+                public void keyReleased(KeyEvent arg0) {
+                    setApplicationName(txtAppName.getText());
+                }
+            });
+            txtAppName.setColumns(10);
+            XBayaLabel lblApplicationName = new XBayaLabel("Application name",txtAppName);
+            JLabel lblExecutablePath = new JLabel("Executable path");
+        	JPanel tmpDirPath=new JPanel();
+
+            txtTempDir = new XBayaTextField();
+            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
+                @Override
+                public void keyReleased(KeyEvent e) {
+                    setTempDir(txtTempDir.getText());
+                }
+            });
+            txtTempDir.setColumns(10);
+            btnTmpDirBrowse=new JButton(MenuIcons.OPEN_DIR_ICON);
+            btnTmpDirBrowse.addActionListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent arg0) {
+					JFileChooser c = new JFileChooser();
+					c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+					int rVal = c.showOpenDialog(null);
+					if (rVal == JFileChooser.APPROVE_OPTION) {
+						txtTempDir.setText(c.getSelectedFile().toString());
+						setTempDir(txtTempDir.getText());
+					}
+				}
+            });
+            JTextField component = txtTempDir.getSwingComponent();
+			tmpDirPath.add(component);
+            tmpDirPath.add(btnTmpDirBrowse);
+//            tmpDirPath.layout(1, 2, 0, 0);
+            
+            setupLayoutForBrowse(tmpDirPath, component);
+
+
+            JLabel lblTemporaryDirectory = new JLabel("Scratch working directory");
+
+            JButton btnAdvance = new JButton("Advanced application configurations...");
+            btnAdvance.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    try {
+                        ApplicationDescriptionAdvancedOptionDialog serviceDescriptionDialog = new ApplicationDescriptionAdvancedOptionDialog(
+                                getRegistry(), getShellApplicationDescription());
+                        serviceDescriptionDialog.open();
+                    } catch (Exception e1) {
+                        e1.printStackTrace();
+                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
+                    }
+                }
+            });
+
+//            cmbServiceName.setRenderer(new DefaultListCellRenderer());
+            cmbHostName = new JComboBox();
+            cmbHostName.addActionListener(this);
+
+            XBayaLabel lblHostName = new XBayaLabel("Application host",cmbHostName);
+//            lblHostName.getSwingComponent().setFont(new Font("Tahoma", Font.ITALIC, 11));
+            XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
+            lnkNewHost.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent e) {
+                    try {
+                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine.getConfiguration().getAiravataAPI(), null);
+                        hostDescriptionDialog.setLocationRelativeTo(getContentPane());
+                        hostDescriptionDialog.open();
+
+                        if (hostDescriptionDialog.isHostCreated()) {
+                        	ProgressMonitor progressMonitor = new ProgressMonitor(getContentPane(), "Host Descriptions", "Refreshing host list..", 0, 200);
+                        	int progress=1;
+                        	progressMonitor.setProgress(progress++);
+                        	while(cmbHostName.getSelectedIndex()==-1 || !cmbHostName.getSelectedItem().toString().equals(hostDescriptionDialog.getHostLocation())){
+	                            loadHostDescriptions();
+	                            cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
+	                            progressMonitor.setProgress(progress++);
+	                            Thread.sleep(50);
+                        	}
+                        	progressMonitor.setProgress(200);
+                        }
+                    } catch (Exception e1) {
+                        e1.printStackTrace();
+                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
+                    }
+                }
+            });
+            lnkNewHost.setText("Create new host...");
+            lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);
+
+//            JLabel lblBindThisDeployment = new JLabel("Bind this deployment description to:");
+//            lblBindThisDeployment.setFont(new Font("Tahoma", Font.BOLD, 11));
+
+            btnHostAdvanceOptions=new JButton("HPC Configuration...");
+            btnHostAdvanceOptions.addActionListener(new ActionListener() {
+				@Override
+				public void actionPerformed(ActionEvent arg0) {
+					try {
+						ApplicationDescriptionHostAdvancedOptionDialog hostAdvancedOptionsDialog = new ApplicationDescriptionHostAdvancedOptionDialog(getRegistry(),getShellApplicationDescription());
+                        hostAdvancedOptionsDialog.open();
+                    } catch (Exception e1) {
+                        e1.printStackTrace();
+                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
+                    }
+				}
+			});
+            btnHostAdvanceOptions.setVisible(false);
+            GridPanel hostPanel=new GridPanel();
+            hostPanel.add(cmbHostName);
+            hostPanel.add(btnHostAdvanceOptions);
+            
+            SwingUtil.layoutToGrid(hostPanel.getSwingComponent(), 1, 2, 0, 0);
+            GridPanel infoPanel0 = new GridPanel();
+
+            infoPanel0.add(lblApplicationName);
+            infoPanel0.add(txtAppName);
+            
+            GridPanel infoPanel1 = new GridPanel();
+
+            
+            infoPanel1.add(lblExecutablePath);
+            infoPanel1.add(execPath);
+//            infoPanel1.add(new JLabel());
+//            infoPanel1.add(btnIOParameters);
+            infoPanel1.add(lblTemporaryDirectory);
+            infoPanel1.add(tmpDirPath);
+//            infoPanel1.add(new JLabel());
+//            infoPanel1.add(btnAdvance);
+            
+//            GridPanel infoPanel2 = new GridPanel();
+//            infoPanel2.add(new JSeparator());
+//            infoPanel2.add(lblBindThisDeployment);
+            
+            GridPanel infoPanel3 = new GridPanel();
+
+            infoPanel3.add(lblHostName);
+            infoPanel3.add(hostPanel);
+            infoPanel3.add(new JLabel());
+            infoPanel3.add(lnkNewHost);
+            
+            GridPanel infoPanel4=new GridPanel();
+            infoPanel4.add(new JLabel());
+            infoPanel4.add(btnAdvance);
+            infoPanel4.layout(1, 2, 0, 0);
+            
+            SwingUtil.layoutToGrid(infoPanel0.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, 1);
+
+            SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 4, 1, SwingUtil.WEIGHT_NONE, 0);
+//            SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE, 0);
+            SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
+
+            GridPanel infoPanel = new GridPanel();
+            infoPanel.add(infoPanel0);
+            infoPanel.add(new JSeparator());
+            infoPanel.add(infoPanel1);
+            infoPanel.add(new JSeparator());
+//          infoPanel.add(infoPanel2);
+			infoPanel.add(infoPanel3);
+			
+
+            infoPanel.add(new JSeparator());
+            infoPanel.add(infoPanel4);
+            
+            SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 7, 1, SwingUtil.WEIGHT_NONE, 0);
+            SwingUtil.layoutToGrid(buttonPane.getSwingComponent(), 1, buttonPane.getContentPanel().getComponentCount(),SwingUtil.WEIGHT_NONE,0);
+            getContentPane().add(infoPanel.getSwingComponent());
+            getContentPane().add(buttonPane.getSwingComponent());
+            
+            buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+            infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+
+            SwingUtil.layoutToGrid(getContentPane(), 2, 1, -1, 0);
+//            loadServiceDescriptions();
+            loadHostDescriptions();
+        }
+        setResizable(true);
+        getRootPane().setDefaultButton(okButton);
+        if (!isNewDescritor()){
+        	loadData();
+        }
+        pack();
+        if (getSize().getWidth()<500){
+        	setSize(500, getSize().height);
+        }
+    }
+
+	private void setupLayoutForBrowse(JPanel tmpDirPath, JTextField component) {
+		GridBagLayout layout;
+		GridBagConstraints constraints;
+		layout = new GridBagLayout();
+		constraints = new GridBagConstraints();
+		constraints.fill = GridBagConstraints.BOTH;
+		constraints.weightx = 1;
+		layout.setConstraints(component, constraints);
+		tmpDirPath.setLayout(layout);
+	}
+
+//    private void loadServiceDescriptions() {
+//        cmbServiceName.removeAllItems();
+//        setServiceName(null);
+//        try {
+//            List<ServiceDescription> serviceDescriptions = getRegistry().searchServiceDescription("");
+//            for (ServiceDescription serviceDescription : serviceDescriptions) {
+//                cmbServiceName.addItem(serviceDescription.getType().getName());
+//            }
+//        } catch (Exception e) {
+//            setError(e.getLocalizedMessage());
+//        }
+//        updateServiceName();
+//    }
+
+    private void loadData(){
+    	txtAppName.setText(getOriginalDescription().getType().getApplicationName().getStringValue());
+    	setApplicationName(txtAppName.getText());
+    	txtExecPath.setText(getOriginalDescription().getType().getExecutableLocation());
+    	setExecutablePath(txtExecPath.getText());
+    	txtTempDir.setText(getOriginalDescription().getType().getScratchWorkingDirectory());
+    	setTempDir(txtTempDir.getText());
+
+    	cmbHostName.setSelectedItem(getOriginalHost());
+    	setHostName(cmbHostName.getSelectedItem().toString());
+//    	cmbServiceName.setSelectedItem(getOriginalService());
+    	setServiceName(null);
+    	txtAppName.setEditable(isNewDescritor());
+    }
+    
+    private void loadHostDescriptions() {
+        cmbHostName.removeAllItems();
+        setHostName(null);
+        try {
+            List<HostDescription> hostDescriptions = getRegistry().getApplicationManager().getAllHostDescriptions();
+            for (HostDescription hostDescription : hostDescriptions) {
+                if (hostDescription.getType().getHostName() == null) {
+                    cmbHostName.addItem(hostDescription.getType().getHostName());
+                } else {
+                    cmbHostName.addItem(hostDescription.getType().getHostName());
+                }
+            }
+        } catch (Exception e) {
+            setError(e.getLocalizedMessage());
+        }
+        updateHostName();
+    }
+
+    public ApplicationDescription getShellApplicationDescription() {
+        if(shellApplicationDescription == null){
+            if (isNewDescritor()) {
+				shellApplicationDescription = new ApplicationDescription();
+			}else{
+				try {
+					shellApplicationDescription= ApplicationDescription.fromXML(getOriginalDescription().toXML());
+				} catch (XmlException e) {
+					//shouldn't happen (hopefully)
+				}
+			}
+        }
+        return shellApplicationDescription;
+    }
+
+    public ApplicationDeploymentDescriptionType getApplicationDescriptionType() {
+    	return getShellApplicationDescription().getType();
+    }
+    
+    public String getApplicationName() {
+        return getApplicationDescriptionType().getApplicationName().getStringValue();
+    }
+
+    public void setApplicationName(String applicationName) {
+//        ApplicationDeploymentDescriptionType.ApplicationName applicationName1 = getApplicationDescriptionType().addNewApplicationName();
+//        applicationName1.setStringValue(applicationName);
+    	if (getApplicationDescriptionType().getApplicationName()==null){
+    		getApplicationDescriptionType().addNewApplicationName();
+    	}
+    	getApplicationDescriptionType().getApplicationName().setStringValue(applicationName);
+        updateDialogStatus();
+    }
+
+    public String getExecutablePath() {
+        return getApplicationDescriptionType().getExecutableLocation();
+    }
+
+    public void setExecutablePath(String executablePath) {
+    	getApplicationDescriptionType().setExecutableLocation(executablePath);
+    	updateTempDirWithExecPath(executablePath);
+        updateDialogStatus();
+    }
+
+	private void updateTempDirWithExecPath(String executablePath) {
+		if (!executablePath.trim().equals("") && (!txtExecPath.getSwingComponent().isFocusOwner()) && 
+				(getApplicationDescriptionType().getScratchWorkingDirectory()==null || getApplicationDescriptionType().getScratchWorkingDirectory().trim().equalsIgnoreCase(""))){
+    		String temp_location = "workflow_runs";
+			String tempDir = new File(new File(executablePath).getParentFile(),temp_location).toString();
+			txtTempDir.setText(tempDir);
+    		txtTempDir.getSwingComponent().setSelectionStart(tempDir.length()-temp_location.length());
+    		txtTempDir.getSwingComponent().setSelectionEnd(tempDir.length());
+    		setTempDir(txtTempDir.getText());
+    		txtTempDir.getSwingComponent().requestFocus();
+    	}
+	}
+
+    public String getTempDir() {
+        return getApplicationDescriptionType().getScratchWorkingDirectory();
+    }
+
+    public void setTempDir(String tempDir) {
+    	getApplicationDescriptionType().setScratchWorkingDirectory(tempDir);
+        updateDialogStatus();
+    }
+
+    public void close() {
+        getDialog().setVisible(false);
+    }
+
+    public void saveApplicationDescription() {
+        try {
+			try {
+				getRegistry().getApplicationManager().saveApplicationDescription(getServiceName(), getHostName(), getShellApplicationDescription());
+			} catch (AiravataAPIInvocationException e) {
+				getRegistry().getApplicationManager().updateApplicationDescriptor(getServiceName(), getHostName(), getShellApplicationDescription());
+			}
+			if (!isNewDescritor() && (!getServiceName().equals(getOriginalService()) || !getHostName().equals(getOriginalHost()))) {
+				try {
+					getRegistry().getApplicationManager().deleteApplicationDescription(getOriginalService(),
+                            getOriginalHost(), getOriginalDescription().getType()
+                            .getApplicationName().getStringValue());
+				} catch (AiravataAPIInvocationException e) {
+					engine.getGUI().getErrorWindow().error(e);
+				}
+			}
+			setApplicationDescCreated(true);
+		} catch (AiravataAPIInvocationException e) {
+			engine.getGUI().getErrorWindow().error(e);
+		}
+    }
+
+    public boolean isApplicationDescCreated() {
+        return applcationDescCreated;
+    }
+
+    public void setApplicationDescCreated(boolean applicationDescCreated) {
+        this.applcationDescCreated = applicationDescCreated;
+    }
+
+    private void setError(String errorMessage) {
+        if (errorMessage == null || errorMessage.trim().equals("")) {
+            lblError.setText("");
+        } else {
+            lblError.setText(errorMessage.trim());
+        }
+    }
+
+    private void updateDialogStatus() {
+        String message = null;
+        try {
+            validateDialog();
+        } catch (Exception e) {
+            message = e.getLocalizedMessage();
+        }
+        okButton.setEnabled(message == null);
+        setError(message);
+    }
+
+    private void validateDialog() throws Exception {
+        if (getApplicationName() == null || getApplicationName().trim().equals("")) {
+            throw new Exception("Name of the application cannot be empty!!!");
+        }
+
+        ApplicationDescription descriptions = null;
+        try {
+            descriptions = getRegistry().getApplicationManager().getApplicationDescriptor(getServiceName(), getHostName(),
+                    getApplicationName());
+        } catch (AiravataAPIInvocationException e) {
+            throw e;
+        }
+        if (descriptions !=null && (isNewDescritor() || (!getServiceName().equals(getOriginalService()) || !getHostName().equals(getOriginalHost())))) {
+            throw new Exception("Application name already exists for the selected service & host!!!");
+        }
+
+        if (getExecutablePath() == null || getExecutablePath().trim().equals("")) {
+            throw new Exception("Executable path cannot be empty!!!");
+        }
+
+        if (getTempDir() == null || getTempDir().trim().equals("")) {
+            throw new Exception("Temporary directory location cannot be empty!!!");
+        }
+
+        if (getServiceName() == null || getServiceName().trim().equals("")) {
+            throw new Exception("Click on IO Parameters...  to define parameters for the application");
+        }
+
+        if (getHostName() == null || getHostName().trim().equals("")) {
+            throw new Exception("Please select/create host to bind to this deployment description");
+        }
+
+    }
+
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+        updateDialogStatus();
+    }
+
+    public String getHostName() {
+        return hostName;
+    }
+
+    public void setHostName(String hostName) {
+        this.hostName = hostName;
+        if (hostName!=null) {
+			HostDescription hostDescription;
+			try {
+				hostDescription = registry.getApplicationManager().getHostDescription(hostName);
+				if (hostDescription.getType() instanceof GlobusHostType) {
+					getShellApplicationDescription().getType().changeType(
+					        HpcApplicationDeploymentType.type);
+				} else if (hostDescription.getType() instanceof GsisshHostType) {
+						getShellApplicationDescription().getType().changeType(
+						        HpcApplicationDeploymentType.type);
+				} else if (hostDescription.getType() instanceof SSHHostType && ((SSHHostType)hostDescription.getType()).getHpcResource()) {
+					getShellApplicationDescription().getType().changeType(
+					        HpcApplicationDeploymentType.type);
+				} else {
+					getShellApplicationDescription().getType().changeType(
+							ApplicationDeploymentDescriptionType.type);
+				}
+				btnHostAdvanceOptions.setVisible(getShellApplicationDescription().getType() instanceof HpcApplicationDeploymentType);
+				String hostAddress = hostDescription.getType().getHostAddress();
+				boolean isLocal = isLocalAddress(hostAddress);
+				btnExecBrowse.setVisible(isLocal);
+				btnTmpDirBrowse.setVisible(isLocal);
+				
+			} catch (AiravataAPIInvocationException e) {
+				//not there - ouch
+			}
+		}
+		updateDialogStatus();
+    }
+
+	private boolean isLocalAddress(String hostAddress) {
+		return hostAddress.equalsIgnoreCase("localhost") || hostAddress.equalsIgnoreCase("127.0.0.1");
+	}
+
+    private void updateServiceName() {
+        if (getServiceDescription() == null) {
+        	setServiceName(null);
+        }else{
+            setServiceName(getServiceDescription().getType().getName());
+        }
+    }
+
+    private void updateHostName() {
+        if (cmbHostName.getSelectedItem() != null) {
+            setHostName(cmbHostName.getSelectedItem().toString());
+        }
+    }
+
+    @Override
+    public void actionPerformed(ActionEvent e) {
+//        if (e.getSource() == cmbServiceName) {
+//            updateServiceName();
+//        }
+        if (e.getSource() == cmbHostName) {
+            updateHostName();
+        }
+        if (e.getSource() == txtAppName) {
+            setApplicationName(txtAppName.getText());
+        }
+        if (e.getSource() == txtExecPath) {
+            setExecutablePath(txtExecPath.getText());
+        }
+        if (e.getSource() == txtTempDir) {
+            setTempDir(txtTempDir.getText());
+        }
+    }
+
+    public AiravataAPI getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+
+	public boolean isNewDescritor() {
+		return newDescritor;
+	}
+
+	public void setNewDescritor(boolean newDescritor) {
+		this.newDescritor = newDescritor;
+	}
+
+	public ApplicationDescription getOriginalDescription() {
+		return originalDescription;
+	}
+
+	public void setOriginalDescription(
+            ApplicationDescription originalDescription) {
+		this.originalDescription = originalDescription;
+	}
+
+	public String getOriginalService() {
+		return originalService;
+	}
+
+	public void setOriginalService(String originalService) {
+		this.originalService = originalService;
+	}
+
+	public String getOriginalHost() {
+		return originalHost;
+	}
+
+	public void setOriginalHost(String originalHost) {
+		this.originalHost = originalHost;
+	}
+
+	public ServiceDescription getServiceDescription() {
+		return serviceDescription;
+	}
+
+	private void setServiceDescription(ServiceDescription serviceDescription) {
+		this.serviceDescription = serviceDescription;
+		updateServiceName();
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionHostAdvancedOptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionHostAdvancedOptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionHostAdvancedOptionDialog.java
new file mode 100644
index 0000000..ac7d234
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionHostAdvancedOptionDialog.java
@@ -0,0 +1,459 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.descriptors;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultComboBoxModel;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+import javax.swing.JScrollPane;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
+import org.apache.airavata.schemas.gfac.JobTypeType;
+import org.apache.airavata.schemas.gfac.JobTypeType.Enum;
+import org.apache.airavata.schemas.gfac.ProjectAccountType;
+import org.apache.airavata.schemas.gfac.QueueType;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaComboBox;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class ApplicationDescriptionHostAdvancedOptionDialog extends JDialog {
+    private static final long serialVersionUID = 3920479739097405014L;
+    private XBayaComboBox cmbJobType;
+    private XBayaTextField txtProjectAccountNumber;
+    private XBayaTextField txtProjectAccountDescription;
+    private XBayaTextField txtQueueType;
+    private XBayaTextField txtMaxWallTime = new XBayaTextField();
+    private XBayaTextField txtMinMemory = new XBayaTextField();
+    private XBayaTextField txtMaxMemory = new XBayaTextField();
+    private XBayaTextField txtCpuCount = new XBayaTextField();
+    private XBayaTextField txtNodeCount = new XBayaTextField();
+    private XBayaTextField txtProcessorsPerNode = new XBayaTextField();
+    private JButton okButton;
+    private AiravataAPI registry;
+    private ApplicationDescription descriptor;
+	private XBayaLabel lblCpuCount;
+	private XBayaLabel lblProcessorPerNode;
+    private XBayaLabel lbNodeCount;
+	private XBayaTextField txtjobSubmitterCommand;
+	private XBayaTextField txtinstalledParentPath;
+
+    /**
+     * Create the dialog.
+     */
+    public ApplicationDescriptionHostAdvancedOptionDialog(AiravataAPI registry, ApplicationDescription descriptor) {
+        addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowOpened(WindowEvent arg0) {
+                loadApplicationDescriptionAdvancedOptions();
+            }
+        });
+        setRegistry(registry);
+        setShellApplicationDescription(descriptor);
+        initGUI();
+    }
+
+    public void open() {
+        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+        setVisible(true);
+    }
+
+    protected ApplicationDescriptionHostAdvancedOptionDialog getDialog() {
+        return this;
+    }
+
+    public void close() {
+        getDialog().setVisible(false);
+    }
+
+    private void initGUI() {
+        setTitle("HPC Configuration Options");
+        setModal(true);
+        setBounds(100, 100, 500, 500);
+        setLocationRelativeTo(null);
+        GridPanel buttonPane = new GridPanel();
+        okButton = new JButton("Update");
+        okButton.setActionCommand("OK");
+        okButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                if (saveApplicationDescriptionAdvancedOptions()){
+                	close();
+                }
+            }
+        });
+        getRootPane().setDefaultButton(okButton);
+    
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.setActionCommand("Cancel");
+        cancelButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                close();
+            }
+        });
+            
+        
+    	GridPanel panel = new GridPanel();
+		txtProjectAccountNumber = new XBayaTextField();
+		txtProjectAccountDescription = new XBayaTextField();
+
+        txtQueueType = new XBayaTextField();
+        txtMaxWallTime = new XBayaTextField();
+        txtMinMemory = new XBayaTextField();
+        txtMaxMemory = new XBayaTextField();
+        txtCpuCount = new XBayaTextField();
+        txtProcessorsPerNode = new XBayaTextField();
+        txtNodeCount = new XBayaTextField();
+        txtjobSubmitterCommand = new XBayaTextField();
+        txtinstalledParentPath = new XBayaTextField();
+        
+
+        DefaultComboBoxModel cmbModelJobType = new DefaultComboBoxModel(getJobTypesAsStrings());
+		cmbJobType = new XBayaComboBox(cmbModelJobType);
+        cmbJobType.setEditable(false);
+        //FIXME:: Machines like trestles are mandating to have cpu and node types set. So better to have these enabled.
+//        cmbJobType.getSwingComponent().addActionListener(new ActionListener(){
+//			@Override
+//			public void actionPerformed(ActionEvent arg0) {
+//				boolean disabled=cmbJobType.getText().equalsIgnoreCase(JobTypeType.SERIAL.toString()) || cmbJobType.getText().equalsIgnoreCase(JobTypeType.SINGLE.toString());
+//				txtCpuCount.setEnabled(!disabled);
+//				txtProcessorsPerNode.setEnabled(!disabled);
+//				lblCpuCount.getSwingComponent().setEnabled(!disabled);
+//				lblProcessorPerNode.getSwingComponent().setEnabled(!disabled);
+//			}
+//        });
+        
+		XBayaLabel lbljobType = new XBayaLabel("Job Type",cmbJobType);
+		XBayaLabel lblProjectAccountNumber = new XBayaLabel("Project Account Number *",txtProjectAccountNumber);
+		XBayaLabel lblProjectAccountDescription = new XBayaLabel("Project Account Description",txtProjectAccountDescription);
+        XBayaLabel lblQueueType = new XBayaLabel("Queue Type *",txtQueueType);
+		XBayaLabel lblMaxWallTime = new XBayaLabel("Max Wall Time",txtMaxWallTime);
+		lblCpuCount = new XBayaLabel("CPU Count",txtCpuCount);
+		lblProcessorPerNode = new XBayaLabel("Processor Per Node", txtProcessorsPerNode);
+		XBayaLabel lblMinMemory = new XBayaLabel("Min Memory",txtMinMemory);
+		XBayaLabel lblMaxMemory = new XBayaLabel("Max Memory",txtMaxMemory);
+        lbNodeCount = new XBayaLabel("Node Count", txtNodeCount);
+        XBayaLabel lbljobSubmitterCommand = new XBayaLabel("Job Submitter Command",txtjobSubmitterCommand);
+        XBayaLabel lblinstalledParentPath = new XBayaLabel("Installed Parent Path",txtinstalledParentPath);
+        
+		panel.add(lbljobType);
+		panel.add(cmbJobType);
+		panel.add(lblProjectAccountNumber);
+		panel.add(txtProjectAccountNumber);
+		panel.add(lblProjectAccountDescription);
+		panel.add(txtProjectAccountDescription);
+		panel.add(lblQueueType);
+		panel.add(txtQueueType);
+        panel.add(lblMaxWallTime);
+		panel.add(txtMaxWallTime);
+        panel.add(lblCpuCount);
+		panel.add(txtCpuCount);
+        panel.add(lbNodeCount);
+        panel.add(txtNodeCount);
+        panel.add(lblProcessorPerNode);
+		panel.add(txtProcessorsPerNode);
+        panel.add(lblMinMemory);
+		panel.add(txtMinMemory);
+        panel.add(lblMaxMemory);
+        panel.add(txtMaxMemory);
+        panel.add(lbljobSubmitterCommand);
+        panel.add(txtjobSubmitterCommand);
+        panel.add(lblinstalledParentPath);
+        panel.add(txtinstalledParentPath);
+		panel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+        buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+
+        SwingUtil.layoutToGrid(panel.getSwingComponent(), 12, 2, SwingUtil.WEIGHT_NONE, 1);
+        
+        buttonPane.add(okButton);
+        buttonPane.add(cancelButton);
+        
+        JScrollPane thePane = new JScrollPane(panel.getSwingComponent());
+
+        getContentPane().add(thePane);
+        getContentPane().add(buttonPane.getSwingComponent());
+        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
+        setResizable(true);
+        getRootPane().setDefaultButton(okButton);
+    }
+    
+    private static List<JobTypeType.Enum> jobTypes;
+    
+	private List<JobTypeType.Enum> getJobTypes() {
+		if (jobTypes==null){
+			jobTypes = new ArrayList<Enum>();
+			jobTypes.add(JobTypeType.SERIAL);
+			jobTypes.add(JobTypeType.OPEN_MP);
+			jobTypes.add(JobTypeType.MPI);
+//            jobTypes.add(JobTypeType.SINGLE);
+		}
+		return jobTypes;
+	}
+
+	private String[] getJobTypesAsStrings() {
+		List<String> typeList=new ArrayList<String>();
+		for (Enum jtype : getJobTypes()) {
+			typeList.add(jtype.toString());
+		}
+		return typeList.toArray(new String[]{});
+	}
+
+	private Enum getJobTypeEnum(String jobTypeString){
+		for (Enum jtype : getJobTypes()) {
+			if (jtype.toString().equalsIgnoreCase(jobTypeString)){
+				return jtype;
+			}
+		}
+		return null;
+	}
+	
+    public ApplicationDescription getApplicationDescription() {
+        return descriptor;
+    }
+
+    public HpcApplicationDeploymentType getHPCApplicationDescriptionType() {
+        return (HpcApplicationDeploymentType)descriptor.getType();
+    }
+    
+    public void setShellApplicationDescription(ApplicationDescription shellApplicationDescription) {
+        this.descriptor = shellApplicationDescription;
+    }
+
+    private boolean isValueNotEmpty(String s){
+    	return !s.trim().isEmpty();
+    }
+    
+    private void showError(String message, String title){
+    	JOptionPane.showMessageDialog(null, message, title, JOptionPane.ERROR_MESSAGE);
+    }
+    private boolean saveApplicationDescriptionAdvancedOptions() {
+		if (isValueNotEmpty(cmbJobType.getText())) {
+		    getHPCApplicationDescriptionType().setJobType(
+					getJobTypeEnum(cmbJobType.getText()));
+		}
+		try {
+			if (isValueNotEmpty(txtMaxWallTime.getText())) {
+			    getHPCApplicationDescriptionType().setMaxWallTime(
+						Integer.parseInt(txtMaxWallTime.getText()));
+			}
+		} catch (NumberFormatException e) {
+			showError("Max wall time must be a number", "Invalid value");
+			return false;
+		}
+		try {
+			if (isValueNotEmpty(txtCpuCount.getText())) {
+			    getHPCApplicationDescriptionType().setCpuCount(
+						Integer.parseInt(txtCpuCount.getText()));
+			}
+		} catch (NumberFormatException e) {
+			showError("CPU count must be a number", "Invalid value");
+			return false;
+		}
+		try {
+			if (isValueNotEmpty(txtProcessorsPerNode.getText())) {
+			    getHPCApplicationDescriptionType().setProcessorsPerNode(
+						Integer.parseInt(txtProcessorsPerNode.getText()));
+			}
+		} catch (NumberFormatException e) {
+			showError("Processors per node must be a number", "Invalid value");
+			return false;
+		}
+        try {
+			if (isValueNotEmpty(txtNodeCount.getText())) {
+			    getHPCApplicationDescriptionType().setNodeCount(
+						Integer.parseInt(txtNodeCount.getText()));
+			}
+		} catch (NumberFormatException e) {
+			showError("Node count must be a number", "Invalid value");
+			return false;
+		}
+		try {
+			if (isValueNotEmpty(txtMinMemory.getText())) {
+			    getHPCApplicationDescriptionType().setMinMemory(
+						Integer.parseInt(txtMinMemory.getText()));
+			}
+		} catch (NumberFormatException e) {
+			showError("Minimum memory must be a number", "Invalid value");
+			return false;
+		}
+	    try {
+			if (isValueNotEmpty(txtMaxMemory.getText())) {
+			    getHPCApplicationDescriptionType().setMaxMemory(
+		                Integer.parseInt(txtMaxMemory.getText()));
+		    }
+		} catch (NumberFormatException e) {
+			showError("Maximum memory must be a number", "Invalid value");
+			return false;
+		}
+	    try {
+			if (isValueNotEmpty(txtjobSubmitterCommand.getText())) {
+			    getHPCApplicationDescriptionType().setJobSubmitterCommand(
+		                txtjobSubmitterCommand.getText());
+		    }else{
+		    	getHPCApplicationDescriptionType().setJobSubmitterCommand(null);
+		    }
+		} catch (NumberFormatException e) {
+			showError("Maximum memory must be a number", "Invalid value");
+			return false;
+		}
+	    try {
+			if (isValueNotEmpty(txtinstalledParentPath.getText())) {
+			    getHPCApplicationDescriptionType().setInstalledParentPath(
+			    		txtinstalledParentPath.getText());
+		    }else{
+		    	getHPCApplicationDescriptionType().setInstalledParentPath(null);
+		    }
+		} catch (NumberFormatException e) {
+			showError("Maximum memory must be a number", "Invalid value");
+			return false;
+		}	    
+		ProjectAccountType projectAccount = getProjectAccountType();
+		if (isValueNotEmpty(txtProjectAccountNumber.getText())) {
+			projectAccount.setProjectAccountNumber(txtProjectAccountNumber
+					.getText());
+		}
+		if (isValueNotEmpty(txtProjectAccountDescription.getText())) {
+			projectAccount
+					.setProjectAccountDescription(txtProjectAccountDescription
+							.getText());
+		}
+		if (isValueNotEmpty(txtQueueType.getText())) {
+			QueueType queueName = getQueueName();
+			queueName.setQueueName(txtQueueType.getText());
+		}
+		return true;
+    }
+
+	private QueueType getQueueName() {
+		if (getHPCApplicationDescriptionType().getQueue()==null){
+		    getHPCApplicationDescriptionType().addNewQueue();
+		}
+		return getHPCApplicationDescriptionType().getQueue();
+	}
+
+	private ProjectAccountType getProjectAccountType() {
+		if (getHPCApplicationDescriptionType().getProjectAccount()==null){
+		    getHPCApplicationDescriptionType().addNewProjectAccount();
+		}
+		return getHPCApplicationDescriptionType().getProjectAccount();
+	}
+    
+	private String getPropValue(int num){
+		if (num==0){
+			return "";
+		}else{
+			return String.valueOf(num);
+		}
+	}
+	
+    private void loadApplicationDescriptionAdvancedOptions() {
+        HpcApplicationDeploymentType hpcAppType = getHPCApplicationDescriptionType();
+		if (hpcAppType.getJobType()!=null) {
+			cmbJobType.setSelectedItem(hpcAppType
+					.getJobType().toString());
+		}
+    	txtMaxWallTime.setText(getPropValue(hpcAppType.getMaxWallTime()));
+        txtCpuCount.setText(getPropValue(hpcAppType.getCpuCount()));
+        txtNodeCount.setText(getPropValue(hpcAppType.getNodeCount()));
+        txtProcessorsPerNode.setText(getPropValue(hpcAppType.getProcessorsPerNode()));
+        txtMinMemory.setText(getPropValue(hpcAppType.getMinMemory()));
+        txtMaxMemory.setText(getPropValue(hpcAppType.getMaxMemory()));
+        txtNodeCount.setText(getPropValue(hpcAppType.getNodeCount()));
+        txtjobSubmitterCommand.setText(hpcAppType.getJobSubmitterCommand()==null?"":hpcAppType.getJobSubmitterCommand());
+        txtinstalledParentPath.setText(hpcAppType.getInstalledParentPath()==null?"":hpcAppType.getInstalledParentPath());
+		ProjectAccountType projectAccount = getProjectAccountType();
+
+		txtProjectAccountNumber.setText(projectAccount.getProjectAccountNumber()==null? "":projectAccount.getProjectAccountNumber());
+		txtProjectAccountDescription.setText(projectAccount.getProjectAccountDescription()==null? "":projectAccount.getProjectAccountDescription());
+
+		QueueType queueName = getQueueName();
+		txtQueueType.setText(queueName.getQueueName()==null?"":queueName.getQueueName());
+    }
+
+    public AiravataAPI getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+
+    // private void updateDialogStatus(){
+    // String message=null;
+    // try {
+    // validateDialog();
+    // } catch (Exception e) {
+    // message=e.getLocalizedMessage();
+    // }
+    // okButton.setEnabled(message==null);
+    // setError(message);
+    // }
+    //
+    // private void validateDialog() throws Exception{
+    // if (getApplicationName()==null || getApplicationName().trim().equals("")){
+    // throw new Exception("Name of the application cannot be empty!!!");
+    // }
+    //
+    // List<ApplicationDeploymentDescription> deploymentDescriptions=null;
+    // try {
+    // deploymentDescriptions = getJCRComponentRegistry().getRegistry().searchApplicationDescription(getServiceName(),
+    // getHostName(), Pattern.quote(getApplicationName()));
+    // } catch (PathNotFoundException e) {
+    // //what we want
+    // } catch (Exception e){
+    // throw e;
+    // }
+    // if (deploymentDescriptions.size()>0){
+    // throw new Exception("Application descriptor with the given name already exists!!!");
+    // }
+    //
+    // if (getExecutablePath()==null || getExecutablePath().trim().equals("")){
+    // throw new Exception("Executable path cannot be empty!!!");
+    // }
+    //
+    // if (getTempDir()==null || getTempDir().trim().equals("")){
+    // throw new Exception("Temporary directory location cannot be empty!!!");
+    // }
+    //
+    // if (getServiceName()==null || getServiceName().trim().equals("")){
+    // throw new Exception("Please select/create service to bind to this deployment description");
+    // }
+    //
+    // if (getHostName()==null || getHostName().trim().equals("")){
+    // throw new Exception("Please select/create host to bind to this deployment description");
+    // }
+    //
+    // }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DeploymentDescriptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DeploymentDescriptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DeploymentDescriptionDialog.java
new file mode 100644
index 0000000..8b52d01
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DeploymentDescriptionDialog.java
@@ -0,0 +1,816 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.descriptors;
+
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.*;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableColumn;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
+import org.apache.airavata.schemas.gfac.DataType;
+import org.apache.airavata.schemas.gfac.HostDescriptionType;
+import org.apache.airavata.schemas.gfac.InputParameterType;
+import org.apache.airavata.schemas.gfac.OutputParameterType;
+import org.apache.airavata.schemas.gfac.ParameterType;
+import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.HostDeploymentDialog.HostDeployment;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.xmlbeans.XmlCursor;
+
+public class DeploymentDescriptionDialog extends JDialog {
+
+    private static final long serialVersionUID = 2705760838264284423L;
+    private final GridPanel contentPanel = new GridPanel();
+    private XBayaLabel lblServiceName;
+    private XBayaTextField txtApplicationServiceName;
+    private JTable tblParameters;
+    private boolean serviceCreated = false;
+    private JLabel lblError;
+    private ServiceDescription serviceDescription;
+    private ServiceDescription orginalServiceDescription;
+    private JButton okButton;
+    private JButton btnDeleteParameter;
+    private DefaultTableModel defaultTableModel;
+    private AiravataAPI registry;
+    private boolean newDescription;
+    private boolean ignoreTableChanges=false;
+	private JCheckBox chkForceFileStagingToWorkDir;
+	private String suggestedNamePrefix;
+	private String titlePrefix;
+	private Map<String,HostDeployment> deployments;
+	private JTable tblHosts;
+	private DefaultTableModel tblModelHosts;
+	
+    /**
+     * Launch the application.
+     */
+    public static void main(String[] args) {
+        try {
+            DeploymentDescriptionDialog dialog = new DeploymentDescriptionDialog(null,true,null,null);
+            dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+            dialog.setVisible(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    public DeploymentDescriptionDialog(JFrame parent, AiravataAPI registry) {
+    	this(registry, true, null, parent);
+    }
+
+//    public DeploymentDescriptionDialog(Frame parent) {
+//        super(parent);
+//    }
+
+    /**
+     * Create the dialog.
+     */
+    public DeploymentDescriptionDialog(AiravataAPI registry, boolean newDescription, ServiceDescription serviceDescription, JFrame parent) {
+        super(parent);
+        setNewDescription(newDescription);
+    	this.setOrginalServiceDescription(serviceDescription);
+    	setSuggestedNamePrefix(suggestedNamePrefix);
+
+    	if (isNewDescription()) {
+			setTitlePrefix("Register Application");
+		}else{
+			setTitlePrefix("Update Application: "+getOrginalServiceDescription().getType().getName());
+		}
+        addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowOpened(WindowEvent arg0) {
+//                if (isNewDescription()) {
+//					String baseName = "Application";
+//					int i;
+//					String defaultName;
+//					i = 1;
+//					defaultName = baseName+i;
+//					try {
+//						while (getRegistry().getServiceDescription(defaultName) != null) {
+//							defaultName = baseName + (++i);
+//						}
+//					} catch (Exception e) {
+//					}
+//					txtApplicationServiceName.setText(defaultName);
+//					setServiceName(txtApplicationServiceName.getText());
+//				}
+            }
+        });
+        setRegistry(registry);
+        initGUI();
+
+    }
+
+    public void open() {
+//        pack();
+//        setAlwaysOnTop(true);
+        setLocationRelativeTo(getOwner());
+        setModal(true);
+        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        setVisible(true);
+    }
+
+    protected DeploymentDescriptionDialog getDialog() {
+        return this;
+    }
+
+    private void initGUI() {
+    	setTitle(getTitlePrefix());
+		setBounds(100, 100, 463, 459);
+        setModal(true);
+        setLocationRelativeTo(null);
+        BorderLayout borderLayout = new BorderLayout();
+        borderLayout.setVgap(5);
+        borderLayout.setHgap(5);
+        getContentPane().setLayout(borderLayout);
+
+        txtApplicationServiceName = new XBayaTextField();
+        txtApplicationServiceName.getSwingComponent().addKeyListener(new KeyAdapter() {
+            @Override
+            public void keyReleased(KeyEvent e) {
+                setServiceName(txtApplicationServiceName.getText());
+            }
+        });
+        txtApplicationServiceName.setColumns(10);
+        lblServiceName = new XBayaLabel("Application name",txtApplicationServiceName);
+        JLabel lblInputParameters = new JLabel("Application Parameters");
+        lblInputParameters.setFont(new Font("Tahoma", Font.BOLD, 11));
+
+        JScrollPane scrollPane = new JScrollPane();
+        tblParameters=createParameterTableControls();
+        scrollPane.setViewportView(tblParameters);
+        
+		chkForceFileStagingToWorkDir=new JCheckBox("Advanced: Force input file staging to working directory");
+        chkForceFileStagingToWorkDir.addActionListener(new ActionListener(){
+
+			public void actionPerformed(ActionEvent arg0) {
+				setForceFileStagingToWorkDir(chkForceFileStagingToWorkDir.isSelected());
+			}
+        	
+        });
+        GridPanel buttonPane = new GridPanel();
+        {
+            GridBagLayout gbl_buttonPane = new GridBagLayout();
+            gbl_buttonPane.columnWidths = new int[] { 307, 136, 0 };
+            gbl_buttonPane.rowHeights = new int[] { 33, 0 };
+            gbl_buttonPane.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
+            gbl_buttonPane.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
+            
+
+            lblError = new JLabel("");
+            lblError.setForeground(Color.RED);
+            GridBagConstraints gbc_lblError = new GridBagConstraints();
+            gbc_lblError.insets = new Insets(0, 0, 0, 5);
+            gbc_lblError.gridx = 0;
+            gbc_lblError.gridy = 0;
+            buttonPane.add(lblError);
+            JPanel panel = new JPanel();
+            GridBagConstraints gbc_panel = new GridBagConstraints();
+            gbc_panel.anchor = GridBagConstraints.NORTHWEST;
+            gbc_panel.gridx = 1;
+            gbc_panel.gridy = 0;
+            buttonPane.add(panel);
+            {
+            	JButton resetButton = new JButton("Reset");
+                resetButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                    	loadData();
+                    }
+                });
+                panel.add(resetButton);
+            }
+            {
+                okButton = new JButton("Register");
+                if (!isNewDescription()){
+                	okButton.setText("Update");
+                }
+                okButton.setEnabled(false);
+                okButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        try {
+                            if ("Register".equals(okButton.getText())) {
+                                saveServiceDescription(false);
+                            } else {
+                                saveServiceDescription(true);
+                            }
+							close();
+						} catch (AiravataAPIInvocationException e1) {
+							e1.printStackTrace();
+						}
+                    }
+                });
+                panel.add(okButton);
+                okButton.setActionCommand("OK");
+                getRootPane().setDefaultButton(okButton);
+            }
+            {
+                JButton cancelButton = new JButton("Cancel");
+                cancelButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        setServiceCreated(false);
+                        close();
+                    }
+                });
+                panel.add(cancelButton);
+                cancelButton.setActionCommand("Cancel");
+            }
+        }
+        contentPanel.add(lblServiceName);
+        contentPanel.add(txtApplicationServiceName);
+        GridPanel pnlTables=new GridPanel();
+        
+        GridPanel parameterPanel=new GridPanel();
+		parameterPanel.add(lblInputParameters);
+        parameterPanel.add(scrollPane);
+    	parameterPanel.add(btnDeleteParameter);
+    	parameterPanel.add(chkForceFileStagingToWorkDir);
+    	
+        SwingUtil.layoutToGrid(contentPanel.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, 1);
+    	SwingUtil.layoutToGrid(parameterPanel.getSwingComponent(), 4, 1, 1, 0);
+    	
+    	pnlTables.add(parameterPanel);
+    	pnlTables.add(createHostDeploymentTable());
+    	
+    	pnlTables.layout(2, 1, SwingUtil.WEIGHT_EQUALLY, 0);
+    	
+        GridPanel infoPanel = new GridPanel();
+		infoPanel.add(contentPanel);
+		infoPanel.add(pnlTables);
+        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+		infoPanel.layout(2, 1, 1, 0);
+		getContentPane().add(infoPanel.getSwingComponent());
+        getContentPane().add(buttonPane.getSwingComponent());
+        buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
+        setResizable(true);
+        getRootPane().setDefaultButton(okButton);
+        if (!isNewDescription()){
+        	loadData();
+        }
+    }
+    
+    private GridPanel createHostDeploymentTable() {
+    	tblHosts = new JTable();
+    	tblHosts.setTableHeader(null);
+        tblHosts.setFillsViewportHeight(true);
+        tblModelHosts = new DefaultTableModel(new Object[][] {}, new String[] { "Host"}){
+			private static final long serialVersionUID = -5973463590447809117L;
+			@Override
+            public boolean isCellEditable(int row, int column) {
+               return false;
+            }
+        };
+        tblHosts.setModel(tblModelHosts);
+       
+        ListSelectionModel selectionModel = tblHosts.getSelectionModel();
+        selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+
+        JButton btnNewDeployment = new JButton("New deployment");
+        btnNewDeployment.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent e) {
+				HostDeploymentDialog hostDeploymentDialog = new HostDeploymentDialog(getRegistry(),true,null,null,Arrays.asList(getDeployments().keySet().toArray(new String[]{})));
+				try {
+					HostDeployment deployDesc = hostDeploymentDialog.execute();
+					if (deployDesc!=null){
+						ApplicationDeploymentDescriptionType appType = deployDesc.getApplicationDescription().getType();
+						if (appType.getApplicationName()==null){
+							appType.addNewApplicationName();
+				    	}
+						HostDescriptionType hostType = deployDesc.getHostDescription().getType();
+						appType.getApplicationName().setStringValue(hostType.getHostName()+"_application");
+						getDeployments().put(hostType.getHostName(), deployDesc);
+						updateDeploymentTable();
+					}
+				} catch (AiravataAPIInvocationException e1) {
+					setError(e1.getLocalizedMessage());
+					e1.printStackTrace();
+				}
+			}
+		});
+        
+        final JButton btnEditDeployment = new JButton("Edit deployment");
+        btnEditDeployment.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent e) {
+				editSelectedDeployment();
+			}
+		});
+        
+        final JButton btnDeleteDeployment = new JButton("Delete deployment");
+        btnDeleteDeployment.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent e) {
+				String hostName = tblModelHosts.getValueAt(tblHosts.getSelectedRow(),0).toString();
+				int result = JOptionPane.showConfirmDialog(null, "Are you sure you want to remove the host deployment '"+hostName+"'?", "Remove Host Deployment",
+                        JOptionPane.YES_NO_OPTION);
+				if (result==JOptionPane.YES_OPTION){
+					tblModelHosts.removeRow(tblHosts.getSelectedRow());
+					getDeployments().remove(hostName);
+				}
+			}
+		});
+        
+        selectionModel.addListSelectionListener(new ListSelectionListener() {
+            public void valueChanged(ListSelectionEvent e) {
+            	btnEditDeployment.setEnabled(tblHosts.getSelectedRows().length > 0);
+            	btnDeleteDeployment.setEnabled(tblHosts.getSelectedRows().length > 0);
+            }
+
+        });
+        tblHosts.addMouseListener(new MouseAdapter(){
+        	@Override
+        	public void mouseClicked(MouseEvent e) {
+        		if (e.getClickCount()==2 && tblHosts.getSelectedRows().length>0){
+        			editSelectedDeployment();
+        		}
+        	}
+        });
+        JScrollPane scrollPane = new JScrollPane();
+        scrollPane.setViewportView(tblHosts);
+        
+        GridPanel pnlTableButtons = new GridPanel();
+        pnlTableButtons.add(btnNewDeployment);
+        pnlTableButtons.add(btnEditDeployment);
+        pnlTableButtons.add(btnDeleteDeployment);
+        pnlTableButtons.layout(1, 3,SwingUtil.WEIGHT_NONE,SwingUtil.WEIGHT_EQUALLY);
+        
+        GridPanel pnlMainPanel = new GridPanel();
+        pnlMainPanel.add(scrollPane);
+        
+        pnlMainPanel.add(pnlTableButtons);
+        pnlMainPanel.layout(2, 1, 0, 0);
+        btnEditDeployment.setEnabled(false);
+    	btnDeleteDeployment.setEnabled(false);
+        return pnlMainPanel;
+	}
+
+    private void updateDeploymentTable(){
+    	List<String> hosts=new ArrayList<String>();
+    	for (int i = 0; i < tblModelHosts.getRowCount(); i++) {
+    		hosts.add((String) tblModelHosts.getValueAt(i, 0));
+        }
+    	for (String hostName : getDeployments().keySet()) {
+			if (!hosts.contains(hostName)){
+				tblModelHosts.addRow(new Object[] { hostName });
+			}
+		}
+    }
+    
+	private JTable createParameterTableControls() {
+		final JTable tblParameters = new JTable();
+        tblParameters.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
+        tblParameters.setFillsViewportHeight(true);
+        defaultTableModel = new DefaultTableModel(new Object[][] { { null, null, null, null }, }, new String[] { "I/O",
+                "Parameter Name", "Type", "Description" });
+        tblParameters.setModel(defaultTableModel);
+        defaultTableModel.addTableModelListener(new TableModelListener() {
+
+            public void tableChanged(TableModelEvent arg0) {
+                if (!ignoreTableChanges) {
+					int selectedRow = tblParameters.getSelectedRow();
+					if (selectedRow != -1
+							&& defaultTableModel.getRowCount() > 0) {
+						Object parameterIOType = defaultTableModel.getValueAt(
+								selectedRow, 0);
+						Object parameterDataType = defaultTableModel
+								.getValueAt(selectedRow, 2);
+						if (parameterIOType == null
+								|| parameterIOType.equals("")) {
+							defaultTableModel.setValueAt(getIOStringList()[0],
+									selectedRow, 0);
+						}
+						if (parameterDataType == null
+								|| parameterDataType.equals("")) {
+							defaultTableModel.setValueAt(getDataTypes()[0],
+									selectedRow, 2);
+						}
+					}
+					addNewRowIfLastIsNotEmpty();
+				}
+            }
+
+        });
+        TableColumn ioColumn = tblParameters.getColumnModel().getColumn(0);
+        String[] ioStringList = getIOStringList();
+        ioColumn.setCellEditor(new StringArrayComboBoxEditor(ioStringList));
+
+        TableColumn datatypeColumn = tblParameters.getColumnModel().getColumn(2);
+        String[] dataTypeStringList = getDataTypes();
+        datatypeColumn.setCellEditor(new StringArrayComboBoxEditor(dataTypeStringList));
+
+        TableColumn parameterNameCol = tblParameters.getColumnModel().getColumn(1);
+        parameterNameCol.setPreferredWidth(190);
+        ListSelectionModel selectionModel = tblParameters.getSelectionModel();
+        selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+
+        selectionModel.addListSelectionListener(new ListSelectionListener() {
+            public void valueChanged(ListSelectionEvent e) {
+                btnDeleteParameter.setEnabled(tblParameters.getSelectedRows().length > 0);
+            }
+
+        });
+        
+        btnDeleteParameter = new JButton("Delete parameter");
+        btnDeleteParameter.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent arg0) {
+                deleteSelectedRows();
+            }
+        });
+        btnDeleteParameter.setEnabled(false);
+        return tblParameters;
+	}
+
+    private void loadData() {
+    	ServiceDescriptionType descType = getOrginalServiceDescription().getType();
+		txtApplicationServiceName.setText(descType.getName());
+		setServiceName(txtApplicationServiceName.getText());
+
+		txtApplicationServiceName.setEditable(isNewDescription());
+    	ignoreTableChanges=true;
+    	updateIODataTable(descType);
+        getDeployments().clear();
+        try {
+			Map<String, ApplicationDescription> descs = getRegistry().getApplicationManager().getApplicationDescriptors(descType.getName());
+			for (String hostDescName : descs.keySet()) {
+			    getDeployments().put(hostDescName, new HostDeployment(getRegistry().getApplicationManager().getHostDescription(hostDescName), descs.get(hostDescName)));
+			}
+
+			updateDeploymentTable();
+			Boolean selected = false;
+			if (descType.getPortType()!=null && descType.getPortType().getMethod()!=null) {
+				XmlCursor cursor = descType.getPortType().getMethod().newCursor();
+				String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
+				cursor.dispose();
+				selected = false;
+				if (value != null) {
+					selected = Boolean.parseBoolean(value);
+				}
+			}
+			chkForceFileStagingToWorkDir.setSelected(selected);
+			setForceFileStagingToWorkDir(selected);
+			ignoreTableChanges=false;
+		} catch (AiravataAPIInvocationException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+
+	private void updateIODataTable(ServiceDescriptionType descType) {
+		while(defaultTableModel.getRowCount()>0){
+    		defaultTableModel.removeRow(0);
+    	}
+    	InputParameterType[] iparameters = descType.getInputParametersArray();
+    	for (InputParameterType parameter : iparameters) {
+    		defaultTableModel.addRow(new Object[] { getIOStringList()[0], parameter.getParameterName(),parameter.getParameterType().getName(),parameter.getParameterDescription()});	
+		}
+    	OutputParameterType[] oparameters = descType.getOutputParametersArray();
+    	for (OutputParameterType parameter : oparameters) {
+    		defaultTableModel.addRow(new Object[] { getIOStringList()[1], parameter.getParameterName(), parameter.getParameterType().getName(),parameter.getParameterDescription()});	
+		}
+    	addNewRowIfLastIsNotEmpty();
+	}
+
+    private String[] getIOStringList() {
+        String[] ioStringList = new String[] { "Input", "Output" };
+        return ioStringList;
+    }
+
+    private String[] getDataTypes() {
+        String[] type = new String[DataType.Enum.table.lastInt()];
+        for (int i = 1; i <= DataType.Enum.table.lastInt(); i++) {
+            type[i - 1] = DataType.Enum.forInt(i).toString();
+        }
+        return type;
+    }
+
+    public boolean isServiceCreated() {
+        return serviceCreated;
+    }
+
+    public void setServiceCreated(boolean serviceCreated) {
+        this.serviceCreated = serviceCreated;
+    }
+
+    public ServiceDescription getServiceDescription() {
+        if (serviceDescription == null) {
+            serviceDescription = new ServiceDescription();
+        }
+        return serviceDescription;
+    }
+
+    public ServiceDescriptionType getServiceDescriptionType() {
+        return getServiceDescription().getType();
+    }
+
+    public String getServiceName() {
+        return getServiceDescription().getType().getName();
+    }
+
+    public void setServiceName(String serviceName) {
+        getServiceDescription().getType().setName(serviceName);
+        updateDialogStatus();
+    }
+
+    private void setupMethod(){
+    	if (getServiceDescriptionType().getPortType()==null){
+    		getServiceDescriptionType().setPortType(getServiceDescriptionType().addNewPortType());
+    	}
+    	if (getServiceDescriptionType().getPortType().getMethod()==null){
+    		getServiceDescriptionType().getPortType().setMethod(getServiceDescriptionType().getPortType().addNewMethod());
+    	}
+    }
+    public void setForceFileStagingToWorkDir(Boolean force){
+    	setupMethod();
+    	XmlCursor cursor = getServiceDescriptionType().getPortType().getMethod().newCursor();
+    	cursor.toNextToken();
+		if (!cursor.setAttributeText(new QName("http://airavata.apache.org/schemas/gfac/2012/12","forceFileStagingToWorkDir"),force.toString())){
+			cursor.insertAttributeWithValue("forceFileStagingToWorkDir",force.toString());
+		}
+		cursor.dispose();
+    }
+    
+    public Boolean getForceFileStagingToWorkDir(){
+    	setupMethod();
+    	XmlCursor cursor = getServiceDescriptionType().getPortType().getMethod().newCursor();    	
+    	cursor.toNextToken();
+		String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
+		cursor.dispose();
+		if (value==null){
+			return false;
+		}else{
+			return Boolean.parseBoolean(value);
+		}
+		
+    }
+    
+    private void updateDialogStatus() {
+        String message = null;
+        try {
+            validateDialog();
+        } catch (Exception e) {
+            message = e.getLocalizedMessage();
+        }
+        okButton.setEnabled(message == null);
+        setError(message);
+    }
+
+    private void validateDialog() throws Exception {
+        if (getServiceName() == null || getServiceName().trim().equals("")) {
+            throw new Exception("Name of the application cannot be empty!!!");
+        }
+        ServiceDescription serviceDescription2 = null;
+        serviceDescription2 = getRegistry().getApplicationManager().getServiceDescription(getServiceName());
+        if (isNewDescription() && serviceDescription2 != null) {
+            throw new Exception("Service descriptor with the given name already exists!!!");
+        }
+    }
+
+    public void saveServiceDescription(boolean update) throws AiravataAPIInvocationException {
+        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
+        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
+
+        for (int i = 0; i < defaultTableModel.getRowCount(); i++) {
+            String parameterName = (String) defaultTableModel.getValueAt(i, 1);
+            String paramType = (String) defaultTableModel.getValueAt(i, 2);
+            String parameterDescription = (String) defaultTableModel.getValueAt(i, 3);
+            if (parameterName != null && !parameterName.trim().equals("")) {
+                // todo how to handle Enum
+                if (getIOStringList()[0].equals(defaultTableModel.getValueAt(i, 0))) {
+                    InputParameterType parameter = InputParameterType.Factory.newInstance();
+                    parameter.setParameterName(parameterName);
+                    parameter.setParameterDescription(parameterDescription);
+                    ParameterType parameterType = parameter.addNewParameterType();
+                    parameterType.setType(DataType.Enum.forString(paramType));
+                    parameterType.setName(paramType);
+                    inputParameters.add(parameter);
+
+                } else {
+                    OutputParameterType parameter = OutputParameterType.Factory.newInstance();
+                    parameter.setParameterName(parameterName);
+                    parameter.setParameterDescription(parameterDescription);
+                    ParameterType parameterType = parameter.addNewParameterType();
+                    parameterType.setType(DataType.Enum.forString(paramType));
+                    parameterType.setName(paramType);
+                    outputParameters.add(parameter);
+                }
+            }
+        }
+        getServiceDescriptionType().setInputParametersArray(inputParameters.toArray(new InputParameterType[] {}));
+        getServiceDescriptionType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[] {}));
+        if (update) {
+            getRegistry().getApplicationManager().updateServiceDescriptor(getServiceDescription());
+        } else {
+            getRegistry().getApplicationManager().saveServiceDescription(getServiceDescription());
+        }
+        if (!isNewDescription()) {
+            Map<String, ApplicationDescription> descs = getRegistry().getApplicationManager().getApplicationDescriptors(getServiceName());
+            for (String hostDescName : descs.keySet()) {
+                getRegistry().getApplicationManager().deleteApplicationDescription(getServiceName(), hostDescName, descs.get(hostDescName).getType().getApplicationName().getStringValue());
+            }
+        }
+        for (String hostName : getDeployments().keySet()) {
+            getRegistry().getApplicationManager().saveApplicationDescription(getServiceName(), hostName, getDeployments().get(hostName).getApplicationDescription());
+        }
+        setServiceCreated(true);
+        JOptionPane.showMessageDialog(this, "Application '" + getServiceName() + "' is registered Successfully !");
+    }
+
+    public void saveServiceDescription() throws AiravataAPIInvocationException {
+        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
+        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
+
+        for (int i = 0; i < defaultTableModel.getRowCount(); i++) {
+            String parameterName = (String) defaultTableModel.getValueAt(i, 1);
+            String paramType = (String) defaultTableModel.getValueAt(i, 2);
+            String parameterDescription = (String) defaultTableModel.getValueAt(i, 3);
+            if (parameterName != null && !parameterName.trim().equals("")) {
+                // todo how to handle Enum
+                if (getIOStringList()[0].equals(defaultTableModel.getValueAt(i, 0))) {
+                    InputParameterType parameter = InputParameterType.Factory.newInstance();
+                    parameter.setParameterName(parameterName);
+                    parameter.setParameterDescription(parameterDescription);
+                    ParameterType parameterType = parameter.addNewParameterType();
+                    parameterType.setType(DataType.Enum.forString(paramType));
+                    parameterType.setName(paramType);
+                    inputParameters.add(parameter);
+
+                } else {
+                    OutputParameterType parameter = OutputParameterType.Factory.newInstance();
+                    parameter.setParameterName(parameterName);
+                    parameter.setParameterDescription(parameterDescription);
+                    ParameterType parameterType = parameter.addNewParameterType();
+                    parameterType.setType(DataType.Enum.forString(paramType));
+                    parameterType.setName(paramType);
+                    outputParameters.add(parameter);
+                }
+            }
+        }
+        getServiceDescriptionType().setInputParametersArray(inputParameters.toArray(new InputParameterType[] {}));
+        getServiceDescriptionType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[] {}));
+        getRegistry().getApplicationManager().saveServiceDescription(getServiceDescription());
+        if (!isNewDescription()) {
+            Map<String, ApplicationDescription> descs = getRegistry().getApplicationManager().getApplicationDescriptors(getServiceName());
+            for (String hostDescName : descs.keySet()) {
+                getRegistry().getApplicationManager().deleteApplicationDescription(getServiceName(), hostDescName, descs.get(hostDescName).getType().getApplicationName().getStringValue());
+            }
+        }
+        for (String hostName : getDeployments().keySet()) {
+            getRegistry().getApplicationManager().saveApplicationDescription(getServiceName(), hostName, getDeployments().get(hostName).getApplicationDescription());
+        }
+        setServiceCreated(true);
+        JOptionPane.showMessageDialog(this, "Application '" + getServiceName() + "' is registered Successfully !");
+    }
+    public void close() {
+        getDialog().setVisible(false);
+    }
+
+    private void setError(String errorMessage) {
+        if (errorMessage == null || errorMessage.trim().equals("")) {
+            lblError.setText("");
+        } else {
+            lblError.setText(errorMessage.trim());
+        }
+    }
+
+    private void deleteSelectedRows() {
+        // TODO confirm deletion of selected rows
+        int selectedRow = tblParameters.getSelectedRow();
+        while (selectedRow >= 0 && tblParameters.getRowCount()>0) {
+            defaultTableModel.removeRow(selectedRow);
+            selectedRow = tblParameters.getSelectedRow();
+        }
+        addNewRowIfLastIsNotEmpty();
+    }
+
+    private void addNewRowIfLastIsNotEmpty() {
+    	
+        if (defaultTableModel.getRowCount()>0) {
+			Object parameterName = defaultTableModel.getValueAt(
+					defaultTableModel.getRowCount() - 1, 1);
+			if (parameterName != null && !parameterName.equals("")) {
+				defaultTableModel
+						.addRow(new Object[] { null, null, null, null });
+			}
+		}else{
+			if (tblParameters.getSelectedRow()==-1){
+				defaultTableModel.addRow(new Object[] { null, null, null, null });
+			}
+			
+		}
+    }
+
+    public AiravataAPI getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+
+    public boolean isNewDescription() {
+		return newDescription;
+	}
+
+	public void setNewDescription(boolean newDescription) {
+		this.newDescription = newDescription;
+	}
+
+	public ServiceDescription getOrginalServiceDescription() {
+		return orginalServiceDescription;
+	}
+
+	public void setOrginalServiceDescription(ServiceDescription orginalServiceDescription) {
+		this.orginalServiceDescription = orginalServiceDescription;
+	}
+
+	public String getSuggestedNamePrefix() {
+		return suggestedNamePrefix;
+	}
+
+	public void setSuggestedNamePrefix(String suggestedNamePrefix) {
+		this.suggestedNamePrefix = suggestedNamePrefix;
+	}
+
+	public String getTitlePrefix() {
+		return titlePrefix;
+	}
+
+	public void setTitlePrefix(String titlePrefix) {
+		this.titlePrefix = titlePrefix;
+	}
+
+	public Map<String,HostDeployment> getDeployments() {
+		if (deployments==null){
+			deployments=new HashMap<String, HostDeployment>();
+		}
+		return deployments;
+	}
+
+	private void editSelectedDeployment() {
+		String hostName = tblModelHosts.getValueAt(tblHosts.getSelectedRow(),0).toString();
+		HostDeploymentDialog hostDeploymentDialog = new HostDeploymentDialog(getRegistry(),false,getDeployments().get(hostName).getApplicationDescription(),hostName,Arrays.asList(getDeployments().keySet().toArray(new String[]{})));
+		try {
+			HostDeployment deployDesc = hostDeploymentDialog.execute();
+			if (deployDesc!=null){
+				getDeployments().put(deployDesc.getHostDescription().getType().getHostName(), deployDesc);
+				updateDeploymentTable();
+			}
+		} catch (AiravataAPIInvocationException e1) {
+			setError(e1.getLocalizedMessage());
+			e1.printStackTrace();
+		}
+	}
+
+	private class StringArrayComboBoxEditor extends DefaultCellEditor {
+        private static final long serialVersionUID = -304464739219209395L;
+
+        public StringArrayComboBoxEditor(Object[] items) {
+            super(new JComboBox(items));
+        }
+    }
+}


[70/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GraphTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GraphTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GraphTestCase.java
new file mode 100644
index 0000000..e35dacf
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GraphTestCase.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+
+public class GraphTestCase extends TestCase {
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public void testRemoveNode() throws ComponentException, GraphException, ComponentRegistryException {
+        WorkflowCreator creator = new WorkflowCreator();
+        Workflow workflow = creator.createSimpleMathWorkflow();
+        Graph graph = workflow.getGraph();
+
+        Node node = graph.getNode("Adder_add");
+        assertNotNull(node);
+        int originalSize = graph.getPorts().size();
+        int portNum = node.getAllPorts().size();
+        graph.removeNode(node);
+
+        assertEquals(originalSize - portNum, graph.getPorts().size());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MetadataTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MetadataTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MetadataTestCase.java
new file mode 100644
index 0000000..2ab432f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MetadataTestCase.java
@@ -0,0 +1,221 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.awt.Point;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
+import org.apache.airavata.workflow.model.component.system.InputComponent;
+import org.apache.airavata.workflow.model.component.system.OutputComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponentPort;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+public class MetadataTestCase extends TestCase {
+
+    private static final String WSDL_DIRECTORY = "/u/sshirasu/codes/appservices/gfac2/wsdls";
+
+    private static final String WRF_STATIC_PREPROCESSOR_WSDL = "WrfStaticPreprocessor.wsdl";
+
+    private static final String TERRAIN_PREPROCESSOR_WSDL = "TerrainPreprocessor.wsdl";
+
+    private static final String ADAS_INTERPOLATOR_WSDL = "ADASInterpolator.wsdl";
+
+    private static final String LATERAL_BOUNDARY_INTERPOLATOR_WSDL = "LateralBoundaryInterpolator.wsdl";
+
+    private static final String ARPS2WRF_INTERPOLATOR_WSDL = "ARPS2WRFInterpolator.wsdl";
+
+    private static final String WRF_FORECASTING_MODEL_WSDL = "WRFForecastingModel.wsdl";
+
+    private static final Logger logger = LoggerFactory.getLogger(MetadataTestCase.class);
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testWorkflow() throws ComponentException, GraphException, IOException, ComponentRegistryException {
+        Workflow workflow = createWorkflow();
+
+        File workflowFile = new File("tmp/ADASInitializedWRFForecast.xwf");
+        XMLUtil.saveXML(workflow.toXML(), workflowFile);
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testPreInvoke() throws ComponentException, GraphException, IOException, ComponentRegistryException {
+        Workflow workflow = createWorkflow();
+        workflow.createScript();
+
+        File workflowWSDLFile = new File("tmp/ADASInitializedWRFForecast-wsdl.xml");
+        XMLUtil.saveXML(workflow.getWorkflowWSDL().xml(), workflowWSDLFile);
+        File bpelFile = new File("tmp/ADASInitializedWRFForecast-bpel.xml");
+        XMLUtil.saveXML(workflow.getGpelProcess().xml(), bpelFile);
+
+        // Get the metadata for input.
+        XmlElement inputAppinfo = workflow.getInputMetadata();
+
+        // Get the input information
+        List<WSComponentPort> inputs = workflow.getInputs();
+
+        for (WSComponentPort input : inputs) {
+            // Show the information of each input.
+
+            // Name
+            String name = input.getName();
+            logger.info("name: " + name);
+
+            // Type
+            QName type = input.getType();
+            logger.info("type: " + type);
+
+            // Metadata as XML
+            XmlElement appinfo = input.getAppinfo();
+            logger.info("appinfo: " + XMLUtil.xmlElementToString(appinfo));
+
+            if (appinfo != null) {
+                // Parse the simple case.
+                for (XmlElement element : appinfo.requiredElementContent()) {
+                    String tag = element.getName();
+                    String value = element.requiredText();
+                    logger.info(tag + " = " + value);
+                }
+            }
+
+            // Set a value to each input.
+            input.setValue("200");
+        }
+    }
+
+    private Workflow createWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
+
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("ADASInitializedWRFForecast");
+        workflow.setDescription("");
+
+        WSGraph graph = workflow.getGraph();
+
+        LocalComponentRegistry componentRegistry = new LocalComponentRegistry(WSDL_DIRECTORY);
+
+        // WRF_STATIC_PREPROCESSOR_WSDL
+        Component wrfPreComp = componentRegistry.getComponent(WRF_STATIC_PREPROCESSOR_WSDL);
+        Node wrfPreNode = workflow.addNode(wrfPreComp);
+        wrfPreNode.setPosition(new Point(313, 0));
+
+        // TERRAIN_PREPROCESSOR_WSDL
+        Component terrainPreComp = componentRegistry.getComponent(TERRAIN_PREPROCESSOR_WSDL);
+        Node terrainPreNode = workflow.addNode(terrainPreComp);
+        terrainPreNode.setPosition(new Point(59, 289));
+
+        // ADAS_INTERPOLATOR_WSDL
+        Component adasIntComp = componentRegistry.getComponent(ADAS_INTERPOLATOR_WSDL);
+        Node adasIntNode = workflow.addNode(adasIntComp);
+        adasIntNode.setPosition(new Point(373, 235));
+
+        // LATERAL_BOUNDARY_INTERPOLATOR_WSDL
+        Component lateralIntComp = componentRegistry.getComponent(LATERAL_BOUNDARY_INTERPOLATOR_WSDL);
+        Node lateralIntNode = workflow.addNode(lateralIntComp);
+        lateralIntNode.setPosition(new Point(371, 369));
+
+        // ARPS2WRF_INTERPOLATOR_WSDL
+        Component arp2wrfComp = componentRegistry.getComponent(ARPS2WRF_INTERPOLATOR_WSDL);
+        Node arp2wrfNode = workflow.addNode(arp2wrfComp);
+        arp2wrfNode.setPosition(new Point(607, 104));
+
+        // WRF_FORECASTING_MODEL_WSDL
+        Component wrfComp = componentRegistry.getComponent(WRF_FORECASTING_MODEL_WSDL);
+        Node wrfNode = workflow.addNode(wrfComp);
+        wrfNode.setPosition(new Point(781, 14));
+
+        // Parameters
+        Component inputComponent = new InputComponent();
+        Component outputComponent = new OutputComponent();
+
+        // Input parameter node
+        InputNode confInput = (InputNode) workflow.addNode(inputComponent);
+        confInput.setPosition(new Point(0, 100));
+
+        // Input parameter node
+        InputNode adasInput = (InputNode) workflow.addNode(inputComponent);
+        adasInput.setPosition(new Point(286, 145));
+
+        // Input parameter node
+        InputNode namInput = (InputNode) workflow.addNode(inputComponent);
+        namInput.setPosition(new Point(179, 438));
+
+        // Output parameter
+        OutputNode outParamNode = (OutputNode) workflow.addNode(outputComponent);
+        outParamNode.setPosition(new Point(863, 169));
+
+        // Connect ports
+        graph.addEdge(confInput.getOutputPort(0), wrfPreNode.getInputPort(0));
+        graph.addEdge(confInput.getOutputPort(0), arp2wrfNode.getInputPort(0));
+        graph.addEdge(confInput.getOutputPort(0), adasIntNode.getInputPort(1));
+        graph.addEdge(confInput.getOutputPort(0), lateralIntNode.getInputPort(1));
+        graph.addEdge(confInput.getOutputPort(0), terrainPreNode.getInputPort(0));
+        graph.addEdge(terrainPreNode.getOutputPort(0), adasIntNode.getInputPort(2));
+        graph.addEdge(terrainPreNode.getOutputPort(0), lateralIntNode.getInputPort(0));
+        graph.addEdge(adasInput.getOutputPort(0), adasIntNode.getInputPort(0));
+        graph.addEdge(namInput.getOutputPort(0), lateralIntNode.getInputPort(2));
+        graph.addEdge(wrfPreNode.getOutputPort(0), arp2wrfNode.getInputPort(1));
+        graph.addEdge(adasIntNode.getOutputPort(0), arp2wrfNode.getInputPort(2));
+        graph.addEdge(lateralIntNode.getOutputPort(0), arp2wrfNode.getInputPort(3));
+        graph.addEdge(arp2wrfNode.getOutputPort(0), wrfNode.getInputPort(0));
+        graph.addEdge(wrfNode.getOutputPort(0), outParamNode.getInputPort(0));
+
+        // Add metadata
+        String inputMetadata = "<appinfo "
+                + "xmlns:lsm=\"http://www.extreme.indiana.edu/namespaces/2006/lead-service-metadata\">"
+                + "<lsm:constraints>" + "<lsm:constraint type=\"temporalSync\">"
+                + "<lsm:elementref name=\"ADASDataFiles\" />" + "<lsm:elementref name=\"NAMDataFiles\" />"
+                + "</lsm:constraint>" + "</lsm:constraints>" + "</appinfo>";
+        graph.setInputMetadata(XMLUtil.stringToXmlElement(inputMetadata));
+
+        return workflow;
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MonitorTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MonitorTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MonitorTestCase.java
new file mode 100644
index 0000000..1962104
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MonitorTestCase.java
@@ -0,0 +1,67 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Properties;
+
+import org.apache.airavata.workflow.tracking.Notifier;
+import org.apache.airavata.workflow.tracking.NotifierFactory;
+import org.apache.airavata.workflow.tracking.common.InvocationEntity;
+import org.apache.airavata.workflow.tracking.common.WorkflowTrackingContext;
+import org.apache.airavata.workflow.tracking.impl.state.DataObjImpl;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.axis2.addressing.EndpointReference;
+
+public class MonitorTestCase extends XBayaTestCase {
+
+    private final static URI WORKFLOW_INSTANCE_ID = URI
+            .create("tag:gpel.leadproject.org,2006:6B9/GFacTestWorkflow1/instance1");
+
+    /**
+     */
+    public void test() {
+        EndpointReference brokerEPR = WseMsgBrokerClient.createEndpointReference(this.configuration.getBrokerURL()
+                .toString(), this.configuration.getTopic());
+
+        Notifier notifier = NotifierFactory.createNotifier();
+
+        WorkflowTrackingContext context = notifier.createTrackingContext(new Properties(), brokerEPR.toString(),
+                URI.create("workflowID"), URI.create("serviceID"), "workflowNodeID", new Integer(1));
+        notifier.publishURL(context, "title", "http://www.google.com", "descriptionAndAnnotation");
+
+        notifier.workflowInitialized(context, WORKFLOW_INSTANCE_ID);
+
+        DataObjImpl dataObj = new DataObjImpl(URI.create("test"), new ArrayList<URI>());
+        notifier.dataConsumed(context, dataObj, "description");
+    }
+
+    /**
+     * 
+     */
+    public void testScalability() {
+        for (int i = 0; i < 100; i++) {
+            test();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/ResourceNotifierTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/ResourceNotifierTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/ResourceNotifierTestCase.java
new file mode 100644
index 0000000..00dbcb5
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/ResourceNotifierTestCase.java
@@ -0,0 +1,59 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.net.URI;
+import java.util.Properties;
+
+import org.apache.airavata.workflow.tracking.Notifier;
+import org.apache.airavata.workflow.tracking.NotifierFactory;
+import org.apache.airavata.workflow.tracking.common.WorkflowTrackingContext;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+
+import org.apache.axis2.addressing.EndpointReference;
+
+public class ResourceNotifierTestCase extends XBayaTestCase {
+
+    /**
+     * 
+     */
+    public void test() {
+        EndpointReference brokerEPR = WseMsgBrokerClient.createEndpointReference(this.configuration.getBrokerURL()
+                .toString(), this.configuration.getTopic());
+        Notifier notifier = NotifierFactory.createNotifier();
+
+        URI initiatorWorkflowID = URI.create("Workflow");
+        URI initiatorServiceID = URI.create("Adder_add");
+        String initiatorWorkflowNodeID1 = "Adder_add";
+        Integer workflowTimeStep = new Integer(0);
+        WorkflowTrackingContext context = notifier.createTrackingContext(new Properties(), brokerEPR.toString(),
+                initiatorWorkflowID, initiatorServiceID, initiatorWorkflowNodeID1, workflowTimeStep);
+        notifier.resourceMapping(context, "resource1.example.com", 1, null);
+        notifier.resourceMapping(context, "resource2.example.com", 2);
+        notifier.resourceMapping(context, "resource3.example.com", 3);
+
+        String initiatorWorkflowNodeID2 = "Adder_add_2";
+        context = notifier.createTrackingContext(new Properties(), brokerEPR.toString(), initiatorWorkflowID,
+                initiatorServiceID, initiatorWorkflowNodeID2, workflowTimeStep);
+        notifier.resourceMapping(context, "resource.example.com", 0);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/StringUtilTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/StringUtilTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/StringUtilTestCase.java
new file mode 100644
index 0000000..0ece074
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/StringUtilTestCase.java
@@ -0,0 +1,55 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.common.utils.StringUtil;
+
+public class StringUtilTestCase extends TestCase {
+
+    /**
+     * 
+     */
+    public void testIncrementName() {
+        String name1 = "test";
+        String name2 = StringUtil.incrementName(name1);
+        assertEquals(name2, "test_2");
+        String name3 = StringUtil.incrementName(name2);
+        assertEquals(name3, "test_3");
+
+        String name9 = "test_9";
+        String name10 = StringUtil.incrementName(name9);
+        assertEquals(name10, "test_10");
+        String name11 = StringUtil.incrementName(name10);
+        assertEquals(name11, "test_11");
+
+        String nameA = "test_a";
+        String nameA2 = StringUtil.incrementName(nameA);
+        assertEquals(nameA2, "test_a_2");
+
+        String name = "test_";
+        String name_2 = StringUtil.incrementName(name);
+        assertEquals(name_2, "test__2");
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLTestCase.java
new file mode 100644
index 0000000..4476474
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLTestCase.java
@@ -0,0 +1,92 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+import org.apache.airavata.common.utils.IOUtil;
+
+public class WSDLTestCase extends XBayaTestCase {
+
+    // private static final Logger logger = LoggerFactory.getLogger();
+
+    private WorkflowCreator graphCreater;
+
+    /*
+     * @see TestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        File tmpDir = new File("tmp");
+        tmpDir.mkdir();
+
+        this.graphCreater = new WorkflowCreator();
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testSimpleMath() throws ComponentException, GraphException, IOException, ComponentRegistryException {
+
+        Workflow workflow = this.graphCreater.createSimpleMathWorkflow();
+
+        File workflowFile = new File("tmp/simple-math.xwf");
+        XMLUtil.saveXML(workflow.toXML(), workflowFile);
+
+        // Creates a Jython script
+        File jythonFile = new File("tmp/simple-math.py");
+        JythonScript script = new JythonScript(workflow, this.configuration);
+        script.create();
+        IOUtil.writeToFile(script.getJythonString(), jythonFile);
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testComplexMath() throws ComponentException, GraphException, IOException, ComponentRegistryException {
+        Workflow workflow = this.graphCreater.createComplexMathWorkflow();
+        File graphFile = new File("tmp/complex-math.xwf");
+        XMLUtil.saveXML(workflow.toXML(), graphFile);
+
+        // Creates a Jython script
+        File jythonFile = new File("tmp/complex-math.py");
+        JythonScript script = new JythonScript(workflow, this.configuration);
+        script.create();
+        IOUtil.writeToFile(script.getJythonString(), jythonFile);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java
new file mode 100644
index 0000000..9386734
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java
@@ -0,0 +1,51 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.net.URI;
+
+import org.apache.airavata.common.utils.WSDLUtil;
+
+public class WSDLUtilTestCase extends XBayaTestCase {
+
+    /**
+     *
+     */
+    public void testAppendWSDLQuary() {
+        URI uri0 = URI.create("http://localhost:8080");
+        URI wsdlURI0 = WSDLUtil.appendWSDLQuary(uri0);
+        assertEquals("http://localhost:8080/?wsdl", wsdlURI0.toString());
+
+        URI uri1 = URI.create("http://localhost:8080/");
+        URI wsdlURI1 = WSDLUtil.appendWSDLQuary(uri1);
+        assertEquals("http://localhost:8080/?wsdl", wsdlURI1.toString());
+
+        URI uri2 = URI.create("http://localhost:8080/service");
+        URI wsdlURI2 = WSDLUtil.appendWSDLQuary(uri2);
+        assertEquals("http://localhost:8080/service?wsdl", wsdlURI2.toString());
+
+        URI uri3 = URI.create("http://localhost:8080/?wsdl");
+        URI wsdlURI3 = WSDLUtil.appendWSDLQuary(uri3);
+        assertEquals("http://localhost:8080/?wsdl", wsdlURI3.toString());
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSIFTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSIFTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSIFTestCase.java
new file mode 100644
index 0000000..4b43502
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSIFTestCase.java
@@ -0,0 +1,53 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import junit.framework.TestSuite;
+
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WSIFTestCase extends XBayaTestCase {
+
+    private static final Logger logger = LoggerFactory.getLogger(WSIFTestCase.class);
+
+    private ComponentTreeNode resouceCatalogComponentTree;
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        junit.textui.TestRunner.run(new TestSuite(WSIFTestCase.class));
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.test.XBayaTestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        this.resouceCatalogComponentTree = null;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java
new file mode 100644
index 0000000..89839db
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java
@@ -0,0 +1,282 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+
+public class WaitDialogTestCase extends XBayaTestCase {
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        // Prevent to connect to GPEL engine every time.
+        this.configuration.setGPELEngineURL(null);
+
+        this.configuration.setHeight(200);
+        this.configuration.setWidth(200);
+    }
+
+    /**
+     * @throws InterruptedException
+     * 
+     */
+    public void testShowHide() throws InterruptedException {
+        XBayaEngine engine = new XBayaEngine(this.configuration);
+        Cancelable cancelable = new Cancelable() {
+            public void cancel() {
+                // Nothing
+            }
+        };
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
+        Thread showThread = new Thread() {
+            @Override
+            public void run() {
+                dialog.show();
+            }
+
+        };
+        showThread.start();
+
+        Thread.sleep(1000);
+
+        dialog.hide();
+
+        showThread.join();
+    }
+
+    /**
+     * @throws InterruptedException
+     * 
+     */
+    public void testShowShowHide() throws InterruptedException {
+        XBayaEngine engine = new XBayaEngine(this.configuration);
+        Cancelable cancelable = new Cancelable() {
+            public void cancel() {
+                // Nothing
+            }
+        };
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
+        Thread showThread1 = new Thread() {
+            @Override
+            public void run() {
+                dialog.show();
+            }
+
+        };
+
+        Thread showThread2 = new Thread() {
+            @Override
+            public void run() {
+                dialog.show();
+            }
+
+        };
+
+        Thread hideThread1 = new Thread() {
+            @Override
+            public void run() {
+                dialog.hide();
+            }
+
+        };
+
+        showThread1.start();
+        showThread2.start();
+
+        Thread.sleep(1000);
+
+        hideThread1.start();
+
+        showThread1.join();
+        showThread2.join();
+        hideThread1.join();
+    }
+
+    /**
+     * @throws InterruptedException
+     * 
+     */
+    public void testShowHideShowHide() throws InterruptedException {
+        XBayaEngine engine = new XBayaEngine(this.configuration);
+        Cancelable cancelable = new Cancelable() {
+            public void cancel() {
+                // Nothing
+            }
+        };
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
+        Thread showThread1 = new Thread() {
+            @Override
+            public void run() {
+                dialog.show();
+            }
+
+        };
+
+        Thread showThread2 = new Thread() {
+            @Override
+            public void run() {
+                dialog.show();
+            }
+
+        };
+
+        Thread hideThread1 = new Thread() {
+            @Override
+            public void run() {
+                dialog.hide();
+            }
+
+        };
+
+        Thread hideThread2 = new Thread() {
+            @Override
+            public void run() {
+                dialog.hide();
+            }
+
+        };
+
+        showThread1.start();
+
+        Thread.sleep(1000);
+
+        hideThread1.start();
+
+        Thread.sleep(1000);
+        showThread2.start();
+
+        Thread.sleep(1000);
+        hideThread2.start();
+
+        showThread1.join();
+        showThread2.join();
+        hideThread1.join();
+        hideThread2.join();
+    }
+
+    /**
+     * @throws InterruptedException
+     */
+    public void testShowHideHide() throws InterruptedException {
+        XBayaEngine engine = new XBayaEngine(this.configuration);
+        Cancelable cancelable = new Cancelable() {
+            public void cancel() {
+                // Nothing
+            }
+        };
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
+        Thread showThread1 = new Thread() {
+            @Override
+            public void run() {
+                dialog.show();
+            }
+
+        };
+
+        Thread hideThread1 = new Thread() {
+            @Override
+            public void run() {
+                dialog.hide();
+            }
+
+        };
+
+        Thread hideThread2 = new Thread() {
+            @Override
+            public void run() {
+                dialog.hide();
+            }
+
+        };
+
+        showThread1.start();
+
+        Thread.sleep(1000);
+
+        hideThread1.start();
+        hideThread2.start();
+
+        showThread1.join();
+        hideThread1.join();
+        hideThread2.join();
+    }
+
+    /**
+     * @throws InterruptedException
+     */
+    public void testShowShowHideHide() throws InterruptedException {
+        XBayaEngine engine = new XBayaEngine(this.configuration);
+        Cancelable cancelable = new Cancelable() {
+            public void cancel() {
+                // Nothing
+            }
+        };
+        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
+        Thread showThread1 = new Thread() {
+            @Override
+            public void run() {
+                dialog.show();
+            }
+
+        };
+
+        Thread showThread2 = new Thread() {
+            @Override
+            public void run() {
+                dialog.show();
+            }
+
+        };
+
+        Thread hideThread1 = new Thread() {
+            @Override
+            public void run() {
+                dialog.hide();
+            }
+
+        };
+
+        Thread hideThread2 = new Thread() {
+            @Override
+            public void run() {
+                dialog.hide();
+            }
+
+        };
+
+        showThread1.start();
+        showThread2.start();
+
+        Thread.sleep(1000);
+
+        hideThread1.start();
+        hideThread2.start();
+
+        showThread1.join();
+        showThread2.join();
+        hideThread1.join();
+        hideThread2.join();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WebComponentRegistryClientTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WebComponentRegistryClientTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WebComponentRegistryClientTestCase.java
new file mode 100644
index 0000000..8db2612
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WebComponentRegistryClientTestCase.java
@@ -0,0 +1,173 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.awt.Point;
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.airavata.common.utils.IOUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.system.InputComponent;
+import org.apache.airavata.workflow.model.component.system.OutputComponent;
+import org.apache.airavata.workflow.model.component.web.WebComponentRegistry;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.xmlpull.infoset.XmlElement;
+
+public class WebComponentRegistryClientTestCase extends XBayaTestCase {
+
+    /**
+     * MATH_ADDER_WSDL
+     */
+    private static final String MATH_ADDER_WSDL = "adder-wsdl.xml";
+
+    /**
+     * MATH_MULTIPLIER_WSDL
+     */
+    private static final String MATH_MULTIPLIER_WSDL = "multiplier-wsdl.xml";
+
+    private Component inputComponent;
+
+    private Component outputComponent;
+
+    private WebComponentRegistry componentRegistry;
+
+    private File temporaryDirectory;
+
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        this.temporaryDirectory = new File("tmp");
+        this.temporaryDirectory.mkdir();
+
+        this.componentRegistry = new WebComponentRegistry(XBayaConstants.DEFAULT_WEB_REGISTRY.toURL());
+        this.componentRegistry.getComponentReferenceList(); // To read components
+        this.inputComponent = new InputComponent();
+        this.outputComponent = new OutputComponent();
+    }
+
+    /**
+     * @throws GraphException
+     * @throws ComponentException
+     * @throws IOException
+     */
+    public void testComplexMath() throws GraphException, ComponentException, IOException {
+
+        Workflow workflow = createComplexMathWorkflow();
+        File workflowFile = new File(this.temporaryDirectory, "web-complex-math.xwf");
+        XMLUtil.saveXML(workflow.toXML(), workflowFile);
+
+        // Load the same graph again from the file, saves it, and compare them.
+        XmlElement workflowElement = XMLUtil.loadXML(workflowFile);
+        Workflow workflow2 = new Workflow(workflowElement);
+        File workflowFile2 = new File(this.temporaryDirectory, "web-complex-math-2.xwf");
+        XMLUtil.saveXML(workflow2.toXML(), workflowFile2);
+
+        String workflowFileString = IOUtil.readFileToString(workflowFile);
+        String workflowFile2String = IOUtil.readFileToString(workflowFile2);
+        assertEquals(workflowFileString, workflowFile2String);
+
+        // Create a Jython script
+        File jythonFile = new File(this.temporaryDirectory, "web-complex-math.py");
+        JythonScript script = new JythonScript(workflow, this.configuration);
+        script.create();
+        IOUtil.writeToFile(script.getJythonString(), jythonFile);
+    }
+
+    /**
+     * @return The graph
+     * @throws GraphException
+     */
+    private Workflow createComplexMathWorkflow() throws GraphException {
+
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("Complex math workflow");
+        workflow.setDescription("Complex math workflow");
+
+        Graph graph = workflow.getGraph();
+
+        // Adder nodes
+        Component adderComp = this.componentRegistry.getComponents(MATH_ADDER_WSDL).get(0);
+
+        Node adderNode1 = workflow.addNode(adderComp);
+        adderNode1.setPosition(new Point(170, 50));
+
+        Node adderNode2 = workflow.addNode(adderComp);
+        adderNode2.setPosition(new Point(170, 210));
+
+        // Multiplier node
+        Component multiComp = this.componentRegistry.getComponents(MATH_MULTIPLIER_WSDL).get(0);
+
+        Node multiNode = workflow.addNode(multiComp);
+        multiNode.setPosition(new Point(320, 130));
+
+        // Parameter node 1
+        InputNode paramNode1 = (InputNode) workflow.addNode(this.inputComponent);
+        paramNode1.setPosition(new Point(20, 30));
+        String paramValue1 = "2";
+        paramNode1.setDefaultValue(paramValue1);
+
+        // Parameter node 2
+        InputNode paramNode2 = (InputNode) workflow.addNode(this.inputComponent);
+        paramNode2.setPosition(new Point(20, 100));
+        String paramValue2 = "3";
+        paramNode2.setDefaultValue(paramValue2);
+
+        // Parameter node 3
+        InputNode paramNode3 = (InputNode) workflow.addNode(this.inputComponent);
+        paramNode3.setPosition(new Point(20, 170));
+        String paramValue3 = "4";
+        paramNode3.setDefaultValue(paramValue3);
+
+        // Parameter node 4
+        InputNode paramNode4 = (InputNode) workflow.addNode(this.inputComponent);
+        paramNode4.setPosition(new Point(20, 240));
+        String paramValue4 = "5";
+        paramNode4.setDefaultValue(paramValue4);
+
+        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
+        outParamNode.setPosition(new Point(370, 240));
+
+        // Connect ports
+        graph.addEdge(paramNode1.getOutputPort(0), adderNode1.getInputPort(0));
+        graph.addEdge(paramNode2.getOutputPort(0), adderNode1.getInputPort(1));
+        graph.addEdge(paramNode3.getOutputPort(0), adderNode2.getInputPort(0));
+        graph.addEdge(paramNode4.getOutputPort(0), adderNode2.getInputPort(1));
+        graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
+        graph.addEdge(adderNode2.getOutputPort(0), multiNode.getInputPort(1));
+        graph.addEdge(multiNode.getOutputPort(0), outParamNode.getInputPort(0));
+
+        return workflow;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
new file mode 100644
index 0000000..737ebcf
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
@@ -0,0 +1,373 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.awt.Point;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
+import org.apache.airavata.workflow.model.component.system.OutputComponent;
+import org.apache.airavata.workflow.model.gpel.DSCUtil;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.tracking.client.Callback;
+import org.apache.airavata.workflow.tracking.client.NotificationType;
+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.workflow.tracking.impl.NotifierImpl;
+import org.apache.airavata.workflow.tracking.impl.publish.LoopbackPublisher;
+import org.apache.airavata.workflow.tracking.impl.publish.NotificationPublisher;
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.ws.monitor.MonitorConfiguration;
+import org.apache.airavata.ws.monitor.EventDataRepository;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.ws.monitor.event.Event;
+import org.apache.airavata.ws.monitor.event.Event.Type;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.modifier.WorkflowModifier;
+import org.apache.airavata.xbaya.test.service.adder.Adder;
+import org.apache.airavata.xbaya.test.service.multiplier.Multiplier;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.xmlbeans.XmlObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.view.XmlValidationException;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.soap11_util.Soap11Util;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.wsif.WSIFService;
+import xsul.wsif.WSIFServiceFactory;
+import xsul.xbeans_util.XBeansUtil;
+import xsul.xwsif_runtime.WSIFClient;
+import xsul.xwsif_runtime.WSIFRuntime;
+import xsul5.wsdl.WsdlDefinitions;
+import xsul5.wsdl.WsdlResolver;
+
+public class WorkflowModificationTestCase extends XBayaTestCase {
+
+    private static final Logger logger = LoggerFactory.getLogger(WorkflowModificationTestCase.class);
+
+    private boolean gui = false;
+
+    private XBayaEngine engine;
+
+    private GraphCanvas graphCanvas;
+
+    /**
+     * @see org.apache.airavata.xbaya.test.XBayaTestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        String guiProperty = System.getProperty("xbaya.gui.test");
+        this.gui = Boolean.parseBoolean(guiProperty);
+    }
+
+    /**
+     * @throws IOException
+     * @throws ComponentRegistryException
+     * @throws GraphException
+     * @throws ComponentException
+     * @throws MonitorException
+     */
+    public void test() throws IOException, ComponentException, GraphException, ComponentRegistryException,
+            MonitorException {
+
+        WorkflowCreator creator = new WorkflowCreator();
+        Workflow workflow = creator.createComplexMathWorkflow();
+        workflow.createScript();
+
+        Monitor monitor;
+        if (this.gui) {
+            this.engine = new XBayaEngine(this.configuration);
+            this.graphCanvas = this.engine.getGUI().getGraphCanvas();
+            this.graphCanvas.setWorkflow(workflow);
+            monitor = this.engine.getMonitor();
+            this.engine.getGUI().eventReceived(new Event(Type.MONITOR_STARTED));
+            repaintAndWait(2);
+        } else {
+            MonitorConfiguration monitorConfiguration = new MonitorConfiguration(this.configuration.getBrokerURL(),
+                    this.configuration.getTopic(), this.configuration.isPullMode(),
+                    this.configuration.getMessageBoxURL());
+            monitor = new Monitor(monitorConfiguration);
+        }
+
+        EventDataRepository eventData = monitor.getEventDataRepository();
+        MonitorCallback callback = new MonitorCallback(eventData);
+        LoopbackPublisher publisher = new LoopbackPublisher(callback, this.configuration.getTopic());
+        MonitorNotifier notifier = new MonitorNotifier(publisher);
+
+        executeToMiddle(workflow, notifier);
+
+        modifyWorkflow(workflow);
+
+        File modifiedWorkflowFile = new File(this.temporalDirectory, "complex-math-modified.xwf");
+        XMLUtil.saveXML(workflow.toXML(), modifiedWorkflowFile);
+
+        // Create a diff workflow
+        WorkflowModifier modifier = new WorkflowModifier(workflow, eventData);
+        Workflow diffWorkflow = modifier.createDifference();
+
+        if (this.gui) {
+            GraphCanvas canvas = this.engine.getGUI().newGraphCanvas(true);
+            canvas.setWorkflow(diffWorkflow);
+            repaintAndWait(5);
+        }
+
+        File diffWorkflowFile = new File(this.temporalDirectory, "complex-math-diff.xwf");
+        XMLUtil.saveXML(diffWorkflow.toXML(), diffWorkflowFile);
+
+    }
+
+    private void executeToMiddle(Workflow workflow, MonitorNotifier notifier) throws XmlValidationException,
+            ComponentException {
+        WSGraph graph = workflow.getGraph();
+
+        String adder1ID = "Adder_add";
+        String adder2ID = "Adder_add_2";
+
+        NodeImpl a = graph.getNode("a");
+        NodeImpl b = graph.getNode("b");
+        NodeImpl c = graph.getNode("c");
+        NodeImpl d = graph.getNode("d");
+        NodeImpl adder = graph.getNode(adder1ID);
+        NodeImpl adder2 = graph.getNode(adder2ID);
+
+        WsdlDefinitions workflowWSDL = workflow.getWorkflowWSDL();
+        DSCUtil.convertToCWSDL(workflowWSDL, URI.create("http://example.com"));
+        HashMap<String, String> inputMap = new HashMap<String, String>();
+        inputMap.put("a", "2");
+        inputMap.put("b", "3");
+        inputMap.put("c", "4");
+        inputMap.put("d", "5");
+
+        try {
+            sendNotification(workflowWSDL, null, WSDLUtil.getFirstOperation(workflowWSDL).getName(), inputMap, null,
+                    notifier);
+        } catch (UtilsException e) {
+            e.printStackTrace();
+        }
+
+        WsdlDefinitions adderWSDL = WsdlResolver.getInstance().loadWsdl(
+                new File(XBayaPathConstants.WSDL_DIRECTORY + File.separator + Adder.WSDL_PATH).toURI());
+
+        HashMap<String, String> inputMap1 = new HashMap<String, String>();
+        inputMap1.put("x", "2");
+        inputMap1.put("y", "3");
+        HashMap<String, String> outputMap1 = new HashMap<String, String>();
+        outputMap1.put("z", "5");
+        sendNotification(adderWSDL, adder1ID, "add", inputMap1, outputMap1, notifier);
+        // These are needed because without GUI, the nodes' color won't be
+        // changed.
+        a.setState(NodeExecutionState.FINISHED);
+        b.setState(NodeExecutionState.FINISHED);
+        adder.setState(NodeExecutionState.FINISHED);
+        repaintAndWait(3);
+
+        HashMap<String, String> inputMap2 = new HashMap<String, String>();
+        inputMap2.put("x", "4");
+        inputMap2.put("y", "5");
+        HashMap<String, String> outputMap2 = new HashMap<String, String>();
+        outputMap2.put("z", "9");
+        sendNotification(adderWSDL, adder2ID, "add", inputMap2, outputMap2, notifier);
+
+        c.setState(NodeExecutionState.FINISHED);
+        d.setState(NodeExecutionState.FINISHED);
+        adder2.setState(NodeExecutionState.FINISHED);
+        repaintAndWait(3);
+    }
+
+    private void modifyWorkflow(Workflow workflow) throws ComponentException, ComponentRegistryException,
+            GraphException {
+        WSGraph graph = workflow.getGraph();
+
+        OutputComponent outputComponent = new OutputComponent();
+        LocalComponentRegistry registry = new LocalComponentRegistry(XBayaPathConstants.WSDL_DIRECTORY);
+        Component adderComponent = registry.getComponent(Adder.WSDL_PATH);
+        Component multiplierComponent = registry.getComponent(Multiplier.WSDL_PATH);
+
+        NodeImpl c = graph.getNode("c");
+        NodeImpl d = graph.getNode("d");
+        NodeImpl adder = graph.getNode("Adder_add");
+        NodeImpl adder2 = graph.getNode("Adder_add_2");
+        NodeImpl multiplier = graph.getNode("Multiplier_multiply");
+
+        // Remove Adder_2 and replace with Multiplier_2.
+        graph.removeNode(adder2);
+        repaintAndWait(1);
+
+        Node multiplier2 = workflow.addNode(multiplierComponent);
+        multiplier2.setPosition(new Point(170, 210));
+        repaintAndWait(1);
+
+        graph.addEdge(c.getOutputPort(0), multiplier2.getInputPort(0));
+        repaintAndWait(1);
+
+        graph.addEdge(d.getOutputPort(0), multiplier2.getInputPort(1));
+        repaintAndWait(1);
+
+        graph.addEdge(multiplier2.getOutputPort(0), multiplier.getInputPort(1));
+        repaintAndWait(1);
+
+        // Add one more adder and an output.
+        Node adder3 = workflow.addNode(adderComponent);
+        adder3.setPosition(new Point(320, 300));
+        repaintAndWait(1);
+
+        graph.addEdge(adder.getOutputPort(0), adder3.getInputPort(0));
+        repaintAndWait(1);
+
+        graph.addEdge(multiplier2.getOutputPort(0), adder3.getInputPort(1));
+        repaintAndWait(1);
+
+        Node output2 = workflow.addNode(outputComponent);
+        output2.setPosition(new Point(500, 300));
+        repaintAndWait(1);
+
+        graph.addEdge(adder3.getOutputPort(0), output2.getInputPort(0));
+        repaintAndWait(1);
+    }
+
+    private void sendNotification(WsdlDefinitions definitions, String nodeID, String operationName,
+            Map<String, String> inputMap, Map<String, String> outputMap, MonitorNotifier notifier) {
+
+        WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
+        WSIFService service = factory.getService(WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(definitions));
+        WSIFClient client = WSIFRuntime.getDefault().newClientFor(service, null);
+        WSIFPort port = client.getPort();
+        WSIFOperation operation = port.createOperation(operationName);
+        WSIFMessage inputMessage = operation.createInputMessage();
+
+        for (String key : inputMap.keySet()) {
+            String value = inputMap.get(key);
+            inputMessage.setObjectPart(key, value);
+        }
+
+        URI myWorkflowID = null;
+        URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
+        String myNodeID = null;
+        Integer myTimestep = null;
+        InvocationEntity myEntity = notifier.createEntity(myWorkflowID, myServiceID, myNodeID, myTimestep);
+
+        URI serviceWorkflowID = null;
+        URI serviceServiceID = URI.create("ServiceID");
+        String serviceNodeID = nodeID;
+        Integer serviceTimestep = null;
+        InvocationEntity serviceEntity = notifier.createEntity(serviceWorkflowID, serviceServiceID, serviceNodeID,
+                serviceTimestep);
+        WorkflowTrackingContext workflowContext = notifier.createTrackingContext(new Properties(), this.configuration
+                .getBrokerURL().toASCIIString(), myWorkflowID, myServiceID, myNodeID, myTimestep);
+
+        XmlElement inputBody = (XmlElement) ((XmlElement) inputMessage).getParent();
+        XmlObject inputBodyObject = XBeansUtil.xmlElementToXmlObject(inputBody);
+
+        InvocationContext context = notifier.invokingService(workflowContext, serviceEntity, null, inputBodyObject);
+
+        if (outputMap != null) {
+            WSIFMessage outputMessage = operation.createOutputMessage();
+            Soap11Util.getInstance().wrapBodyContent((XmlElement) outputMessage);
+            for (String key : outputMap.keySet()) {
+                String value = outputMap.get(key);
+                outputMessage.setObjectPart(key, value);
+            }
+            XmlElement outputBody = (XmlElement) ((XmlElement) outputMessage).getParent();
+            XmlObject outputBodyObject = XBeansUtil.xmlElementToXmlObject(outputBody);
+
+            notifier.receivedResult(workflowContext, context, null, outputBodyObject);
+        }
+    }
+
+    private void repaintAndWait(int second) {
+        if (this.gui) {
+            this.graphCanvas.repaint();
+            try {
+                Thread.sleep(second * 1000);
+            } catch (InterruptedException e) {
+                logger.error(e.getMessage(), e);
+            }
+        }
+    }
+
+    private class MonitorNotifier extends NotifierImpl {
+
+        /**
+         * Constructs a MonitorNotifier.
+         * 
+         * @param publisher
+         */
+        public MonitorNotifier(NotificationPublisher publisher) {
+            super();
+        }
+    }
+
+    private class MonitorCallback implements Callback {
+
+        private EventDataRepository eventData;
+
+        /**
+         * Constructs a MonitorCallback.
+         * 
+         * @param eventData
+         */
+        public MonitorCallback(EventDataRepository eventData) {
+            this.eventData = eventData;
+        }
+
+        /**
+         * 
+         * @param topic
+         *            the topic to which this message was sent. This can also be retrieved from the messageObj XMlObject
+         *            directly after typecasting.
+         * @param type
+         * @param message
+         */
+        public void deliverMessage(String topic, NotificationType type, XmlObject message) {
+
+            XmlElement event = XBeansUtil.xmlObjectToXmlElement(message);
+            this.eventData.addEvent(XMLUtil.xmlElement3ToXmlElement5(event));
+        }
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowTestCase.java
new file mode 100644
index 0000000..8eb5092
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowTestCase.java
@@ -0,0 +1,120 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Collection;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+public class WorkflowTestCase extends XBayaTestCase {
+
+    private static Logger logger = LoggerFactory.getLogger(WorkflowTestCase.class);
+
+    private WorkflowCreator workflowCreator;
+
+    /*
+     * @see TestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+        this.workflowCreator = new WorkflowCreator();
+    }
+
+    /**
+     * @throws IOException
+     * @throws GraphException
+     * @throws ComponentException
+     */
+    public void testParse() throws IOException, GraphException, ComponentException {
+
+        File file = new File(XBayaPathConstants.WORKFLOW_DIRECTORY, "complex-math.xwf");
+        XmlElement workflowXML = XMLUtil.loadXML(file);
+
+        // Parse the workflow
+        Workflow workflow = new Workflow(workflowXML);
+
+        // Take out the graph of the workflow.
+        Graph graph = workflow.getGraph();
+
+        // Extract inputs of the workflow.
+        Collection<InputNode> inputNodes = GraphUtil.getInputNodes(graph);
+
+        for (InputNode inputNode : inputNodes) {
+
+            // Name of the input.
+            String inputName = inputNode.getName();
+            logger.info("inputName: " + inputName);
+
+            // Get next nodes.
+            Collection<Node> nextNodes = GraphUtil.getNextNodes(inputNode);
+
+            for (Node nextNode : nextNodes) {
+
+                String name = nextNode.getName();
+                logger.info("name: " + name);
+            }
+        }
+    }
+
+    /**
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws IOException
+     * @throws ComponentRegistryException
+     */
+    public void testSaveAndLoad() throws ComponentException, GraphException, IOException, ComponentRegistryException {
+
+        Workflow workflow = this.workflowCreator.createComplexMathWorkflow();
+
+        XmlElement workflowElement = workflow.toXML();
+        File file = new File(this.temporalDirectory, "complex-math.xwf");
+        XMLUtil.saveXML(workflowElement, file);
+
+        XmlElement loadedWorkflowElement = XMLUtil.loadXML(file);
+        Workflow loadedWorkflow = new Workflow(loadedWorkflowElement);
+
+        Graph loadedGraph = loadedWorkflow.getGraph();
+        Collection<WSNode> loadedWSNodes = GraphUtil.getWSNodes(loadedGraph);
+        assertTrue(loadedWSNodes.size() != 0);
+
+        for (WSNode loadedWSNode : loadedWSNodes) {
+            assertNotNull(loadedWSNode.getComponent());
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java
new file mode 100644
index 0000000..728151a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java
@@ -0,0 +1,68 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.net.URI;
+
+import junit.framework.TestSuite;
+
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.wsdl.WsdlResolver;
+
+public class XBayaSecurityTestCase extends XBayaTestCase {
+
+    private static final Logger logger = LoggerFactory.getLogger(XBayaSecurityTestCase.class);
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        junit.textui.TestRunner.run(new TestSuite(XBayaSecurityTestCase.class));
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.test.XBayaTestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        // Security related XSUL is configured in super.setUp();
+        super.setUp();
+    }
+
+    /**
+     *
+     */
+    public void testWSDL() {
+        URI gFacURL = this.configuration.getGFacURL();
+        URI gFacWSDLURL = WSDLUtil.appendWSDLQuary(gFacURL);
+        gFacWSDLURL = URI.create("https://tyr12.cs.indiana.edu:22443/data_catalog?wsdl"); // FAIL
+        gFacWSDLURL = URI.create("https://tyr12.cs.indiana.edu:9443/wcs?wsdl"); // FAIL
+        gFacWSDLURL = URI.create("https://tyr13.cs.indiana.edu:7443/gpel/"); // OK
+
+        logger.info("accessing " + gFacWSDLURL);
+        WsdlResolver.getInstance().loadWsdl(gFacWSDLURL);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaTestCase.java
new file mode 100644
index 0000000..8114543
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaTestCase.java
@@ -0,0 +1,77 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.slf4j.Logger;
+
+public abstract class XBayaTestCase extends TestCase {
+
+
+    protected XBayaConfiguration configuration;
+
+    protected File temporalDirectory;
+
+    /**
+     * @see junit.framework.TestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+
+        this.configuration = new XBayaConfiguration();
+
+        // tmp directory
+        this.temporalDirectory = new File("tmp/");
+        this.temporalDirectory.mkdir();
+
+        // topic
+        if (this.configuration.getTopic() == null) {
+            this.configuration.setTopic("xbaya-test");
+        }
+
+        // Overwrite some default setting.
+        String gpelURLString = System.getProperty("gpel.url");
+        if (gpelURLString != null) {
+            this.configuration.setGPELEngineURL(URI.create(gpelURLString));
+        }
+        String dscURLString = System.getProperty("dsc.url");
+        if (dscURLString != null) {
+            this.configuration.setDSCURL(URI.create(dscURLString));
+        }
+
+        String myProxyUsername = System.getProperty("myproxy.username");
+        if (myProxyUsername != null) {
+            this.configuration.setMyProxyUsername(myProxyUsername);
+        }
+        String myProxyPassphrase = System.getProperty("myproxy.passphrase");
+        if (myProxyPassphrase != null) {
+            this.configuration.setMyProxyPassphrase(myProxyPassphrase);
+        }
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XppTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XppTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XppTestCase.java
new file mode 100644
index 0000000..38df89f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XppTestCase.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test;
+
+import java.io.IOException;
+import java.io.StringWriter;
+
+import junit.framework.TestCase;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.XmlPullParserException;
+import org.xmlpull.v1.XmlPullParserFactory;
+import org.xmlpull.v1.XmlSerializer;
+
+public class XppTestCase extends TestCase {
+
+    private static final Logger logger = LoggerFactory.getLogger(XppTestCase.class);
+
+    /*
+     * @see TestCase#setUp()
+     */
+    @Override
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    /**
+     * @throws XmlPullParserException
+     * @throws IllegalArgumentException
+     * @throws IllegalStateException
+     * @throws IOException
+     */
+    public void testEscape() throws XmlPullParserException, IllegalArgumentException, IllegalStateException,
+            IOException {
+
+        String testString = "<tag>&lt;test/><[CDATA[<tag2/>]]></tag>";
+
+        logger.info("before:");
+        logger.info(testString);
+
+        XmlPullParserFactory xppFactory = XmlPullParserFactory.newInstance();
+        XmlSerializer xmlSerializer = xppFactory.newSerializer();
+        StringWriter stringwriter = new StringWriter();
+        xmlSerializer.setOutput(stringwriter);
+        xmlSerializer.text(testString);
+        String afterString = stringwriter.toString();
+
+        logger.info("after:");
+        logger.info(afterString);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonClassLoaderTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonClassLoaderTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonClassLoaderTestCase.java
new file mode 100644
index 0000000..d50c9dc
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonClassLoaderTestCase.java
@@ -0,0 +1,44 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.jython;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.xbaya.jython.runner.JythonClassLoader;
+import org.python.util.jython;
+
+public class JythonClassLoaderTestCase extends TestCase {
+
+    /**
+     * @throws ClassNotFoundException
+     */
+    public void testLoadClass() throws ClassNotFoundException {
+        JythonClassLoader loader = new JythonClassLoader(this.getClass().getClassLoader());
+
+        Class<?> newJythonClass = loader.loadClass(jython.class.getName(), true);
+        assertNotSame(jython.class, newJythonClass);
+
+        Class<?> newStringClass = loader.loadClass(String.class.getName(), true);
+        assertEquals(String.class, newStringClass);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonLibraryTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonLibraryTest.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonLibraryTest.java
new file mode 100644
index 0000000..773edfc
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonLibraryTest.java
@@ -0,0 +1,115 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.jython;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.invoker.GenericInvoker;
+import org.apache.airavata.xbaya.invoker.Invoker;
+import org.apache.airavata.xbaya.jython.lib.NotificationSender;
+import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
+import org.apache.airavata.xbaya.test.service.adder.AdderService;
+import org.apache.airavata.xbaya.test.service.multiplier.MultiplierService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class JythonLibraryTest extends TestCase {
+
+    private static final Logger logger = LoggerFactory.getLogger(JythonLibraryTest.class);
+
+    /**
+     * @throws WorkflowException
+     */
+    @SuppressWarnings("boxing")
+    public void testSimpleMath() throws WorkflowException {
+
+        AdderService service = new AdderService();
+        service.run();
+        String adderWSDLLoc = service.getServiceWsdlLocation();
+
+        WorkflowNotifiable notifier = new NotificationSender(XBayaConstants.DEFAULT_BROKER_URL.toString(), "test-topic");
+
+        Invoker invoker = new GenericInvoker(null, adderWSDLLoc, "adder", null, null, notifier);
+        invoker.setup();
+        invoker.setOperation("add");
+        invoker.setInput("x", 2);
+        invoker.setInput("y", 3);
+        invoker.invoke();
+
+        Object output = invoker.getOutput("z");
+        logger.info("z = " + output);
+
+        service.shutdownServer();
+    }
+
+    /**
+     * @throws WorkflowException
+     */
+    @SuppressWarnings("boxing")
+    public void testComplexMath() throws WorkflowException {
+
+        AdderService adder = new AdderService();
+        adder.run();
+        String adderWSDLLoc = adder.getServiceWsdlLocation();
+
+        MultiplierService multiplier = new MultiplierService();
+        multiplier.run();
+        String multiplierWSDLLoc = multiplier.getServiceWsdlLocation();
+
+        WorkflowNotifiable notifier = new NotificationSender(XBayaConstants.DEFAULT_BROKER_URL.toString(), "test-topic");
+
+        Invoker adderInvoker1 = new GenericInvoker(null, adderWSDLLoc, "adder", null, null, notifier);
+        adderInvoker1.setup();
+        adderInvoker1.setOperation("add");
+        adderInvoker1.setInput("x", 2);
+        adderInvoker1.setInput("y", 3);
+        adderInvoker1.invoke();
+
+        Object output1 = adderInvoker1.getOutput("z");
+        logger.info("output1 = " + output1);
+
+        Invoker adderInvoker2 = new GenericInvoker(null, adderWSDLLoc, "adder", null, null, notifier);
+        adderInvoker2.setup();
+        adderInvoker2.setOperation("add");
+        adderInvoker2.setInput("x", 4);
+        adderInvoker2.setInput("y", 5);
+        adderInvoker2.invoke();
+
+        Object output2 = adderInvoker2.getOutput("z");
+        logger.info("output2 = " + output2);
+
+        Invoker multiplierInvoker = new GenericInvoker(null, multiplierWSDLLoc, "multiplier", null, null, notifier);
+        multiplierInvoker.setup();
+        multiplierInvoker.setOperation("multiply");
+        multiplierInvoker.setInput("x", output1);
+        multiplierInvoker.setInput("y", output2);
+        multiplierInvoker.invoke();
+
+        Object output3 = multiplierInvoker.getOutput("z");
+        logger.info("output3 = " + output3);
+
+        adder.shutdownServer();
+        multiplier.shutdownServer();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonOneTimeRunnerTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonOneTimeRunnerTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonOneTimeRunnerTestCase.java
new file mode 100644
index 0000000..fa3f2e4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonOneTimeRunnerTestCase.java
@@ -0,0 +1,70 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.jython;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.jython.runner.JythonOneTimeRunnerImpl;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.apache.airavata.xbaya.test.XBayaTestCase;
+import org.apache.airavata.xbaya.test.service.adder.AdderService;
+import org.apache.airavata.xbaya.test.service.multiplier.MultiplierService;
+import org.apache.airavata.xbaya.test.util.WorkflowCreator;
+
+public class JythonOneTimeRunnerTestCase extends XBayaTestCase {
+
+    /**
+     * @throws WorkflowException
+     */
+    public void testRun() throws WorkflowException {
+
+        WorkflowCreator creator = new WorkflowCreator();
+        Workflow workflow = creator.createComplexMathWorkflow();
+        JythonScript script = new JythonScript(workflow, this.configuration);
+        script.create();
+        String jythonString = script.getJythonString();
+
+        AdderService adder = new AdderService();
+        adder.run();
+        String adderWSDLLoc = adder.getServiceWsdlLocation();
+
+        MultiplierService multiplier = new MultiplierService();
+        multiplier.run();
+        String multiplierWSDLLoc = multiplier.getServiceWsdlLocation();
+
+        String[] arguments = new String[] { "-topic", "complex-math", "-Adder_wsdl", adderWSDLLoc, "-Adder_2_wsdl",
+                adderWSDLLoc, "-Multiplier_wsdl", multiplierWSDLLoc };
+
+        JythonOneTimeRunnerImpl runner = new JythonOneTimeRunnerImpl();
+        runner.run(jythonString, arguments);
+
+        try {
+            runner.run(jythonString, arguments);
+            fail();
+        } catch (Exception e) {
+            // It succeeds only once.
+        }
+
+        adder.shutdownServer();
+        multiplier.shutdownServer();
+    }
+}
\ No newline at end of file


[26/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
deleted file mode 100644
index 4737ef9..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker;
-
-import java.lang.reflect.Constructor;
-import java.net.URI;
-
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.client.tools.PeriodicExecutorThread;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.common.utils.ServiceUtils;
-import org.apache.airavata.wsmg.broker.handler.PublishedMessageHandler;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionManager;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.config.ConfigurationManager;
-import org.apache.airavata.wsmg.commons.storage.WsmgInMemoryStorage;
-import org.apache.airavata.wsmg.commons.storage.WsmgPersistantStorage;
-import org.apache.airavata.wsmg.commons.util.Axis2Utils;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
-import org.apache.airavata.wsmg.messenger.ConsumerUrlManager;
-import org.apache.airavata.wsmg.messenger.Deliverable;
-import org.apache.airavata.wsmg.messenger.DeliveryProcessor;
-import org.apache.airavata.wsmg.messenger.SenderUtils;
-import org.apache.airavata.wsmg.messenger.protocol.DeliveryProtocol;
-import org.apache.airavata.wsmg.messenger.protocol.impl.Axis2Protocol;
-import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
-import org.apache.airavata.wsmg.messenger.strategy.impl.FixedParallelSender;
-import org.apache.airavata.wsmg.messenger.strategy.impl.ParallelSender;
-import org.apache.airavata.wsmg.messenger.strategy.impl.SerialSender;
-import org.apache.airavata.wsmg.util.RunTimeStatistics;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.engine.ServiceLifeCycle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class BrokerServiceLifeCycle implements ServiceLifeCycle {
-
-    private static final Logger log = LoggerFactory.getLogger(BrokerServiceLifeCycle.class);
-//    public static final String REPOSITORY_PROPERTIES = "airavata-server.properties";
-    public static final int GFAC_URL_UPDATE_INTERVAL = 1000 * 60 * 60 * 3;
-
-    public static final int JCR_AVAIALABILITY_WAIT_INTERVAL = 1000 * 10;
-    public static final String JCR_CLASS = "jcr.class";
-    public static final String JCR_USER = "jcr.user";
-    public static final String JCR_PASS = "jcr.pass";
-    public static final String ORG_APACHE_JACKRABBIT_REPOSITORY_URI = "org.apache.jackrabbit.repository.uri";
-    private static final String MESSAGE_BROKER_SERVICE_NAME = "EventingService";
-    private static final String SERVICE_URL = "message_broker_service_url";
-    private static final String JCR_REGISTRY = "registry";
-    private Thread thread;
-
-    private static final long DEFAULT_SOCKET_TIME_OUT = 20000l;
-
-    private DeliveryProcessor proc;
-    private ConsumerUrlManager urlManager;
-
-    private static Boolean initialized = false;
-
-    public void shutDown(ConfigurationContext configurationcontext, AxisService service) {
-        log.info("broker shutting down");
-        if (proc != null) {
-            proc.stop();
-            proc = null;
-        }
-        if (urlManager != null) {
-            urlManager.stop();
-            urlManager = null;
-        }
-
-        synchronized (initialized) {
-            if (initialized) {
-                initialized = false;
-                AiravataAPI registry = (AiravataAPI) configurationcontext.getProperty(JCR_REGISTRY);
-                if(registry != null && thread != null){
-                    try {
-                        registry.getAiravataManager().unsetEventingURI();
-                    } catch (AiravataAPIInvocationException e) {
-                        e.printStackTrace();
-                    }
-                    thread.interrupt();
-                try {
-                    thread.join();
-                } catch (InterruptedException e) {
-                    log.info("Message box url update thread is interrupted");
-                }
-                }
-            }
-        }
-        log.info("broker shut down");
-    }
-
-    public void startUp(ConfigurationContext configContext, AxisService axisService) {
-    	AiravataUtils.setExecutionAsServer();
-        Boolean inited = (Boolean) configContext.getProperty(WsmgCommonConstants.BROKER_INITED);
-
-        if (inited == null || inited == false) {
-            log.info("Starting Message Broker...");
-            Axis2Utils.overrideAddressingPhaseHander(configContext, new PublishedMessageHandler());
-            WsmgConfigurationContext brokerConext = initConfigurations(configContext, axisService);
-            initQueue(brokerConext);
-            initDeliveryMethod(brokerConext.getConfigurationManager());
-
-            inited = true;
-            configContext.setProperty(WsmgCommonConstants.BROKER_INITED, inited);
-        } else {
-            log.debug("init was already done by another webservice");
-        }
-
-        final ConfigurationContext context = configContext;
-        synchronized (initialized) {
-            if (!initialized) {
-                initialized = true;
-                new Thread() {
-                    @Override
-                    public void run() {
-//                        Properties properties = new Properties();
-                        try {
-//                            URL url = this.getClass().getClassLoader()
-//                                    .getResource(REPOSITORY_PROPERTIES);
-//                            properties.load(url.openStream());
-//                            Map<String, String> map = new HashMap<String, String>(
-//                                    (Map) properties);
-                            try {
-                                Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
-                            } catch (InterruptedException e1) {
-                                e1.printStackTrace();
-                            }
-
-                            String userName = ServerSettings.getSystemUser();
-                            String gateway = ServerSettings.getSystemUserGateway();
-
-                            AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(gateway, userName);
-                            String localAddress = ServiceUtils
-                                    .generateServiceURLFromConfigurationContext(
-                                            context,
-                                            MESSAGE_BROKER_SERVICE_NAME);
-                            log.debug("MESSAGE BOX SERVICE_ADDRESS:"
-                                    + localAddress);
-                            context.setProperty(SERVICE_URL, new URI(
-                                    localAddress));
-                            context.setProperty(JCR_REGISTRY, airavataAPI);
-                            /*
-                                    * Heart beat message to registry
-                                    */
-                            thread = new MsgBrokerURLRegisterThread(airavataAPI, context);
-                            thread.start();
-                        } catch (Exception e) {
-                            log.error(e.getMessage(), e);
-                        }
-                    }
-                }.start();
-            }
-        }
-    }
-
-    private WsmgConfigurationContext initConfigurations(ConfigurationContext configContext, AxisService axisService) {
-
-        WsmgConfigurationContext wsmgConfig = new WsmgConfigurationContext();
-        configContext.setProperty(WsmgCommonConstants.BROKER_WSMGCONFIG, wsmgConfig);
-
-        ConfigurationManager configMan = new ConfigurationManager();
-
-        wsmgConfig.setConfigurationManager(configMan);
-
-        String type = configMan.getConfig(WsmgCommonConstants.CONFIG_STORAGE_TYPE,
-                WsmgCommonConstants.STORAGE_TYPE_PERSISTANT);
-
-        /*
-         * Determine Storage
-         */
-        if (WsmgCommonConstants.STORAGE_TYPE_IN_MEMORY.equalsIgnoreCase(type)) {
-            WsmgInMemoryStorage inmem = new WsmgInMemoryStorage();
-
-            wsmgConfig.setStorage(inmem);
-            wsmgConfig.setQueue(inmem);
-            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, inmem));
-
-        } else {
-            String jdbcUrl = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_URL);
-            String jdbcDriver = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_DRIVER);
-            WsmgPersistantStorage persis = new WsmgPersistantStorage(jdbcUrl, jdbcDriver);
-
-            wsmgConfig.setStorage(persis);
-            wsmgConfig.setQueue(persis);
-            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, persis));
-        }
-
-        NotificationProcessor notificatonProcessor = new NotificationProcessor(wsmgConfig);
-        wsmgConfig.setNotificationProcessor(notificatonProcessor);
-
-        return wsmgConfig;
-    }
-
-    private void initQueue(WsmgConfigurationContext context) {
-
-        log.debug("setting up queue");
-
-        WSMGParameter.OUT_GOING_QUEUE = context.getQueue();
-
-        if (WSMGParameter.cleanQueueonStartUp) {
-            log.debug("cleaning up persistant queue");
-            WSMGParameter.OUT_GOING_QUEUE.cleanup();
-            log.debug("cleaned up persistant queue");
-        }
-
-        RunTimeStatistics.setStartUpTime();
-
-    }
-
-    private void initDeliveryMethod(ConfigurationManager configMan) {
-
-        String shouldStart = configMan.getConfig(WsmgCommonConstants.CONFIG_START_DELIVERY_THREADS);
-
-        if (!Boolean.parseBoolean(shouldStart)) {
-
-            if (configMan.getConfig(WsmgCommonConstants.CONFIG_STORAGE_TYPE,
-                    WsmgCommonConstants.STORAGE_TYPE_PERSISTANT).equalsIgnoreCase(
-                    WsmgCommonConstants.STORAGE_TYPE_IN_MEMORY)) {
-
-                /*
-                 * user has asked to use in memory queue but without starting the delivery thread. this will accumulate
-                 * message in memory.
-                 */
-                log.error("conflicting configuration detected, using in memory queue without starting delivery thread will result memory growth.");
-
-            }
-            return;
-        }
-
-        /*
-         * Create Protocol
-         */
-        DeliveryProtocol protocol;
-        String protocolClass = configMan
-                .getConfig(WsmgCommonConstants.DELIVERY_PROTOCOL, Axis2Protocol.class.getName());
-        try {
-            Class cl = Class.forName(protocolClass);
-            Constructor<DeliveryProtocol> co = cl.getConstructor(null);
-            protocol = co.newInstance((Object[]) null);
-
-        } catch (Exception e) {
-            log.error("Cannot initial protocol sender", e);
-            return;
-        }
-        protocol.setTimeout(configMan.getConfig(WsmgCommonConstants.CONFIG_SOCKET_TIME_OUT, DEFAULT_SOCKET_TIME_OUT));
-
-        /*
-         * Create delivery method
-         */
-        SendingStrategy method = null;
-        String initedmethod = null;
-        String deliveryMethod = configMan.getConfig(WsmgCommonConstants.CONFIG_DELIVERY_METHOD,
-                WsmgCommonConstants.DELIVERY_METHOD_SERIAL);
-        if (WsmgCommonConstants.DELIVERY_METHOD_PARALLEL.equalsIgnoreCase(deliveryMethod)) {
-            method = new ParallelSender();
-            initedmethod = WsmgCommonConstants.DELIVERY_METHOD_PARALLEL;
-
-        } else if (WsmgCommonConstants.DELIVERY_METHOD_THREAD_CREW.equalsIgnoreCase(deliveryMethod)) {
-            int poolsize = configMan.getConfig(WsmgCommonConstants.CONFIG_SENDING_THREAD_POOL_SIZE,
-                    WsmgCommonConstants.DEFAULT_SENDING_THREAD_POOL_SIZE);
-            int batchsize = configMan.getConfig(WsmgCommonConstants.CONFIG_SENDING_BATCH_SIZE,
-                    WsmgCommonConstants.DEFAULT_SENDING_BATCH_SIZE);
-            method = new FixedParallelSender(poolsize, batchsize);
-            initedmethod = WsmgCommonConstants.DELIVERY_METHOD_THREAD_CREW;
-
-        } else {
-            method = new SerialSender();
-            initedmethod = WsmgCommonConstants.DELIVERY_METHOD_SERIAL;
-        }
-
-        /*
-         * Create Deliverable
-         */
-        urlManager = new ConsumerUrlManager(configMan);
-        Deliverable senderUtils = new SenderUtils(urlManager);
-        senderUtils.setProtocol(protocol);
-
-        proc = new DeliveryProcessor(senderUtils, method);
-        proc.start();
-        log.debug(initedmethod + " sending method inited");
-    }
-
-    class MsgBrokerURLRegisterThread extends PeriodicExecutorThread {
-
-        private ConfigurationContext context = null;
-
-        public MsgBrokerURLRegisterThread(AiravataAPI registry, ConfigurationContext context) {
-            super(registry);
-            this.context = context;
-        }
-
-
-        protected void updateRegistry(AiravataAPI registry) {
-            try {
-                URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
-                registry.getAiravataManager().setEventingURI(localAddress);
-            } catch (AiravataAPIInvocationException e) {
-                e.printStackTrace();
-            }
-            log.debug("Updated Eventing service URL in to Repository");
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerInfo.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerInfo.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerInfo.java
deleted file mode 100644
index d087a87..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerInfo.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker;
-
-import java.io.Serializable;
-
-public class ConsumerInfo implements Serializable {
-    static final long serialVersionUID = 2274650724788817903L;
-
-    // TODO : change this to OM, EndpointReference.
-    String consumerEprStr;
-
-    String type; // Either "wsnt" or "wse"
-
-    boolean useNotify;
-
-    boolean paused = false;
-
-    boolean wsrmEnabled;
-
-    /**
-     * @param consumerEprStr
-     * @param type
-     * @param useNotify
-     * @param paused
-     */
-    public ConsumerInfo(String consumerEprStr, String type, boolean useNotify, boolean paused) {
-        super();
-        // TODO Auto-generated constructor stub
-        this.consumerEprStr = consumerEprStr;
-        this.type = type;
-        this.useNotify = useNotify;
-        this.paused = paused;
-    }
-
-    /**
-     * @return Returns the consumerEprStr.
-     */
-    public String getConsumerEprStr() {
-        return consumerEprStr;
-    }
-
-    /**
-     * @param consumerEprStr
-     *            The consumerEprStr to set.
-     */
-    public void setConsumerEprStr(String consumerEprStr) {
-        this.consumerEprStr = consumerEprStr;
-    }
-
-    /**
-     * @return Returns the paused.
-     */
-    public boolean isPaused() {
-        return paused;
-    }
-
-    /**
-     * @param paused
-     *            The paused to set.
-     */
-    public void setPaused(boolean paused) {
-        this.paused = paused;
-    }
-
-    /**
-     * @return Returns the type.
-     */
-    public String getType() {
-        return type;
-    }
-
-    /**
-     * @param type
-     *            The type to set.
-     */
-    public void setType(String type) {
-        this.type = type;
-    }
-
-    /**
-     * @return Returns the useNotify.
-     */
-    public boolean isUseNotify() {
-        return useNotify;
-    }
-
-    /**
-     * @param useNotify
-     *            The useNotify to set.
-     */
-    public void setUseNotify(boolean useNotify) {
-        this.useNotify = useNotify;
-    }
-
-    public boolean isWsrmEnabled() {
-        return wsrmEnabled;
-    }
-
-    public void setWsrmEnabled(boolean wsrmEnabled) {
-        this.wsrmEnabled = wsrmEnabled;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerList.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerList.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerList.java
deleted file mode 100644
index 38d8a3a..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerList.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-public class ConsumerList {
-    Map<String, ConsumerInfo> subId2ConsumerInfo = new HashMap<String, ConsumerInfo>();
-
-    ArrayList<ConsumerInfo> consumerInfoList = new ArrayList<ConsumerInfo>();
-
-    boolean changed = true;
-    int size = 0; // use size instead of consumerInfoList.size() to avoid
-
-    // unnecessary copy of subId2ConsumerInfo in
-    // refreshConsumerInfoList() if just need the size
-
-    public void addConsumer(String subId, ConsumerInfo consumerInfo) {
-        subId2ConsumerInfo.put(subId, consumerInfo);
-        changed = true;
-        size++;
-    }
-
-    public int removeConsumer(String subId) {
-        ConsumerInfo result = subId2ConsumerInfo.remove(subId);
-        if (result == null) {
-            return 0;
-        }
-        changed = true;
-        size--;
-        return 1;
-
-    }
-
-    public ArrayList<ConsumerInfo> getConsumerList() {
-        if (changed) {
-            refreshConsumerInfoList();
-        }
-        return consumerInfoList;
-    }
-
-    public int size() {
-        return size;
-    }
-
-    private void refreshConsumerInfoList() {
-        consumerInfoList.clear();
-        consumerInfoList.addAll(subId2ConsumerInfo.values());
-        changed = false;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerListManager.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerListManager.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerListManager.java
deleted file mode 100644
index b5ca1bb..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerListManager.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConsumerListManager {
-
-    private static final Logger logger = LoggerFactory.getLogger(ConsumerListManager.class);
-
-    protected Map<String, ConsumerList> token2ConsumerListMap = new HashMap<String, ConsumerList>();
-
-    protected Map<String, String> subId2Token = new HashMap<String, String>();
-
-    // token can be a topic or an XPath String
-    public void addToConsumerList(String token, SubscriptionState subscribeRequest, String subscriptionId) {
-        ConsumerList consumerList = token2ConsumerListMap.get(token);
-        if (consumerList == null) { // new topic
-            consumerList = new ConsumerList();
-            token2ConsumerListMap.put(token, consumerList);
-        }
-        consumerList.addConsumer(subscriptionId, subscribeRequest.getConsumerInfo());
-        subId2Token.put(subscriptionId, token);
-
-    }
-
-    public String getTokenBySubscriptionId(String subscriptionId) {
-        String token = subId2Token.get(subscriptionId);
-        return token;
-    }
-
-    public int removeFromConsumerList(String subscriptionId, String token) {
-        String tokenString = null;
-        if (token == null) {
-            tokenString = subId2Token.get(subscriptionId);
-        } else {
-            tokenString = token;
-        }
-
-        ConsumerList consumerList = token2ConsumerListMap.get(tokenString);
-        if (consumerList == null) {
-            logger.error("*****ERROR:Cannot find the token to delete: " + tokenString);
-            return 0;
-        }
-        int result = consumerList.removeConsumer(subscriptionId);
-        subId2Token.remove(subscriptionId);
-        return result;
-    }
-
-    public ConsumerList getConsumerListByToken(String token) {
-        ConsumerList consumerList = token2ConsumerListMap.get(token);
-        return consumerList;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
deleted file mode 100644
index 10ae03b..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker;
-
-import java.util.*;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.airavata.wsmg.broker.amqp.AMQPNotificationProcessor;
-import org.apache.airavata.wsmg.broker.context.ContextParameters;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.commons.OutGoingMessage;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
-import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
-import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-import org.apache.airavata.wsmg.util.BrokerUtil;
-import org.apache.airavata.wsmg.util.RunTimeStatistics;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.xpath.AXIOMXPath;
-import org.apache.axis2.AxisFault;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NotificationProcessor {
-
-    private static final Logger logger = LoggerFactory.getLogger(NotificationProcessor.class);
-
-    private WsmgConfigurationContext wsmgConfigContext;
-
-    protected long messageCounter = 0;
-    protected long messageId = 0;
-
-    OMFactory factory = OMAbstractFactory.getOMFactory();
-
-    private OutGoingQueue outgoingQueue;
-
-    private AMQPNotificationProcessor amqpNotificationProcessor = new AMQPNotificationProcessor();
-
-    public NotificationProcessor(WsmgConfigurationContext config) {
-        init(config);
-        amqpNotificationProcessor.init();
-    }
-
-    private void init(WsmgConfigurationContext config) {
-        this.wsmgConfigContext = config;
-        outgoingQueue = config.getOutgoingQueue();
-    }
-
-    private synchronized long getNextTrackId() {
-        messageCounter++;
-        return messageCounter;
-    }
-
-    private synchronized long getNextMsgId() {
-        messageId++;
-        return messageId;
-    }
-
-    public void processMsg(ProcessingContext ctx, OMNamespace protocolNs) throws OMException, AxisFault {
-
-        String trackId = "trackId_A_" + getNextTrackId();
-        if (WSMGParameter.showTrackId) {
-            logger.debug(trackId + ": received.");
-        }
-
-        AdditionalMessageContent additionalMessageContent = new AdditionalMessageContent(ctx.getMessageContext()
-                .getSoapAction(), ctx.getMessageContext().getMessageID());
-        additionalMessageContent.setTrackId(trackId);
-
-        handleExtendedNotifications(ctx, protocolNs);
-
-        if (NameSpaceConstants.WSNT_NS.equals(protocolNs)) {
-
-            onWSNTMsg(ctx, additionalMessageContent);
-            setResponseMsg(ctx, trackId, protocolNs);
-        } else { // WSE Notifications No specific namespace
-
-            onWSEMsg(ctx, trackId, additionalMessageContent);
-           setResponseMsg(ctx, trackId, protocolNs);
-        }
-    }
-
-    /**
-     * @param ctx
-     * @param topicElString
-     * @param trackId
-     * @param additionalMessageContent
-     * @throws OMException
-     * @throws XMLStreamException
-     */
-    private void onWSEMsg(ProcessingContext ctx, String trackId, AdditionalMessageContent additionalMessageContent)
-            throws OMException, AxisFault {
-
-        String topicElString = null;
-        String topicLocalString = null;
-
-        QName qName = new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(), "Topic");
-
-        OMElement topicEl = ctx.getMessageContext().getEnvelope().getHeader().getFirstChildWithName(qName);
-
-        if (topicEl == null) {
-
-            topicLocalString = ctx.getContextParameter(ContextParameters.TOPIC_FROM_URL);
-
-            if (topicLocalString != null) {
-
-                topicElString = "<wsnt:Topic "
-                        + "Dialect=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-Topics/TopicExpression/simple\" "
-                        + "xmlns:ns2=\"http://tutorial.globus.org/auction\" "
-                        + "xmlns:wsnt=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification\">" + "ns2:"
-                        + topicLocalString + "</wsnt:Topic>";
-                // / }
-                additionalMessageContent.setTopicElement(topicElString);
-            } else {
-
-                topicLocalString = "wseTopic";
-                topicElString = "<wsnt:Topic "
-                        + "Dialect=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-Topics/TopicExpression/simple\" "
-                        + "xmlns:ns2=\"http://tutorial.globus.org/auction\" "
-                        + "xmlns:wsnt=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification\">"
-                        + "ns2:wseTopic</wsnt:Topic>";
-                // / }
-                additionalMessageContent.setTopicElement(topicElString);
-            }
-        } else {
-
-            topicLocalString = BrokerUtil.getTopicLocalString(topicEl.getText());
-            try {
-                topicElString = topicEl.toStringWithConsume();
-            } catch (XMLStreamException e) {
-                logger.error("exceptions occured at WSE eventing notification creating", e);
-            }
-            additionalMessageContent.setTopicElement(topicElString);
-        }
-
-        OMElement messageEl = ctx.getSoapBody().getFirstElement();
-        if (messageEl == null) {
-            throw new AxisFault("no message found");
-        }
-
-        String message = null;
-        try {
-            message = messageEl.toStringWithConsume();
-        } catch (XMLStreamException e) {
-            logger.error("unable to serialize the message", e);
-            throw new AxisFault("unable to serialize the message", e);
-        }
-
-        matchAndSave(message, topicLocalString, additionalMessageContent);
-    }
-
-    /**
-     * @param ctx
-     * @param trackId
-     * @throws OMException
-     */
-    private void setResponseMsg(ProcessingContext ctx, String trackId, OMNamespace responseNS) throws OMException {
-        // set response message
-
-        ctx.addResponseMsgNameSpaces(responseNS);
-
-        OMAttribute trackIdAttribute = factory.createOMAttribute("trackId", null, trackId);
-        OMElement messageElement = ctx.getMessageContext().getEnvelope().getBody().getFirstElement();
-        OMElement responseMsgElement = factory.createOMElement(messageElement.getLocalName() + "Response", responseNS);
-        responseMsgElement.addAttribute(trackIdAttribute);
-        ctx.setRespMessage(responseMsgElement);
-
-    }
-
-    /**
-     * @param ctx
-     * @param topicLocalString
-     * @param topicElString
-     * @param producerReferenceElString
-     * @param additionalMessageContent
-     * @throws OMException
-     * @throws XMLStreamException
-     * @throws AxisFault
-     */
-    private void onWSNTMsg(ProcessingContext ctx, AdditionalMessageContent additionalMessageContent)
-            throws OMException, AxisFault {
-
-        String producerReferenceElString = null;
-        String topicElString = null;
-
-        boolean noElements = true;
-
-        // TODO: set nicely with a processing context
-        OMElement notifyEl = ctx.getSoapBody().getFirstElement();
-        for (Iterator<OMElement> iter = notifyEl.getChildrenWithLocalName("NotificationMessage"); iter.hasNext();) {
-            noElements = false;
-            OMElement wrappedMessageEl = iter.next();
-
-            String topicLocalString = null;
-
-            OMElement topicEl = wrappedMessageEl.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
-                    .getNamespaceURI(), "Topic"));
-            if (topicEl != null) {
-
-                topicLocalString = BrokerUtil.getTopicLocalString(topicEl.getText()); // get what ever inside this
-                                                                                      // element
-
-                try {
-                    topicElString = topicEl.toStringWithConsume();
-                } catch (XMLStreamException e) {
-                    logger.error("exception occured while creating NotificationConsumer", e);
-                }
-                additionalMessageContent.setTopicElement(topicElString);
-            }
-            OMElement producerReferenceEl = wrappedMessageEl.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
-                    .getNamespaceURI(), "ProducerReference"));
-
-            if (producerReferenceEl != null) {
-                try {
-                    producerReferenceElString = producerReferenceEl.toStringWithConsume();
-                } catch (XMLStreamException e) {
-                    logger.error("exception occured while creating notification consumer", e);
-
-                }
-                additionalMessageContent.setProducerReference(producerReferenceElString);
-            }
-
-            OMElement notificationMessageEl = wrappedMessageEl.getFirstChildWithName(
-                    new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(), "Message")).getFirstElement();
-
-            String message = null;
-            try {
-                message = notificationMessageEl.toStringWithConsume();
-            } catch (XMLStreamException e) {
-                logger.error("exception occured while creating notification consumer", e);
-                throw new AxisFault("unable to serialize the message", e);
-            }
-
-            matchAndSave(message, topicLocalString, additionalMessageContent);
-
-        }
-        if (noElements) {
-            throw new AxisFault("at least one element is required");
-        }
-    }
-
-    private void matchAndSave(String notificationMessage, String topicLocalString,
-            AdditionalMessageContent additionalMessageContent) {
-
-        List<ConsumerInfo> matchedConsumers = new LinkedList<ConsumerInfo>();
-
-        // not use incoming queue
-        // This is a fix for the bug seen in yfilter.
-        try {
-
-            for (AbstractMessageMatcher matcher : wsmgConfigContext.getMessageMatchers()) {
-                matcher.populateMatches(null, additionalMessageContent, notificationMessage, topicLocalString,
-                        matchedConsumers);
-            }
-
-            save(matchedConsumers, notificationMessage, additionalMessageContent);
-
-        } catch (RuntimeException e) {
-            logger.error("Caught RuntimeException", e);
-        }
-
-    }
-
-    public void save(List<ConsumerInfo> consumerInfoList, String message,
-            AdditionalMessageContent additionalMessageContent) {
-
-        if (consumerInfoList.size() == 0) // No subscription
-            return;
-
-        RunTimeStatistics.addNewNotificationMessageSize(message.length());
-        OutGoingMessage outGoingMessage = new OutGoingMessage();
-        outGoingMessage.setTextMessage(message);
-        outGoingMessage.setConsumerInfoList(consumerInfoList);
-        outGoingMessage.setAdditionalMessageContent(additionalMessageContent);
-
-        outgoingQueue.storeNotification(outGoingMessage, getNextMsgId());
-
-        if (WSMGParameter.showTrackId)
-            logger.info(additionalMessageContent.getTrackId() + ": putIn Outgoing queue.");
-    }
-
-    private void handleExtendedNotifications(ProcessingContext ctx, OMNamespace protocolNs) throws OMException {
-        // AMQP
-        amqpNotificationProcessor.notify(ctx, protocolNs);
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/amqp/AMQPNotificationProcessor.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/amqp/AMQPNotificationProcessor.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/amqp/AMQPNotificationProcessor.java
deleted file mode 100644
index 39970ec..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/amqp/AMQPNotificationProcessor.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.amqp;
-
-import org.apache.airavata.common.utils.ApplicationSettings;
-import org.apache.airavata.wsmg.client.amqp.*;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMNamespace;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.w3c.dom.Element;
-
-import javax.xml.namespace.QName;
-
-/**
- * AMQPNotificationProcessor handles AMQP-specific notification processing.
- */
-public class AMQPNotificationProcessor {
-
-    private static final Logger logger = LoggerFactory.getLogger(AMQPNotificationProcessor.class);
-    
-    private boolean amqpEnabled = false;
-    private AMQPSender amqpSender = null;
-    private AMQPTopicSender amqpTopicSender = null;
-    private AMQPBroadcastSender amqpBroadcastSender = null;
-
-    public void init() {
-        String amqpEnabledAppSetting = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_ENABLE, "");
-        if (!amqpEnabledAppSetting.isEmpty() && (1 == Integer.parseInt(amqpEnabledAppSetting))) {
-            try {
-                String host = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_PROVIDER_HOST, "localhost");
-                String port = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_PROVIDER_PORT, "5672");
-                String username = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_PROVIDER_USERNAME, "guest");
-                String password = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_PROVIDER_PASSWORD, "guest");
-
-                Properties properties = new Properties();
-                properties.setProperty(AMQPUtil.CONFIG_AMQP_PROVIDER_HOST, host);
-                properties.setProperty(AMQPUtil.CONFIG_AMQP_PROVIDER_PORT, port);
-                properties.setProperty(AMQPUtil.CONFIG_AMQP_PROVIDER_USERNAME, username);
-                properties.setProperty(AMQPUtil.CONFIG_AMQP_PROVIDER_PASSWORD, password);
-
-                String className = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_SENDER, "");
-                Class clazz = Class.forName(className);
-                amqpSender = (AMQPSender)clazz.getDeclaredConstructor(Properties.class).newInstance(properties);
-
-                className = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_TOPIC_SENDER, "");
-                clazz = Class.forName(className);
-                amqpTopicSender = (AMQPTopicSender)clazz.getDeclaredConstructor(Properties.class).newInstance(properties);
-
-                className = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_BROADCAST_SENDER, "");
-                clazz = Class.forName(className);
-                amqpBroadcastSender = (AMQPBroadcastSender)clazz.getDeclaredConstructor(Properties.class).newInstance(properties);
-
-                Element routingKeys = AMQPUtil.loadRoutingKeys();
-                if (routingKeys != null) {
-                    ((AMQPRoutingAwareClient)amqpSender).init(routingKeys);
-                    ((AMQPRoutingAwareClient)amqpTopicSender).init(routingKeys);
-                    ((AMQPRoutingAwareClient)amqpBroadcastSender).init(routingKeys);
-                }
-
-                amqpEnabled = true;
-            } catch (Exception ex) {
-                logger.error(ex.getMessage());
-            }
-        }
-    }
-
-    public void notify(ProcessingContext ctx, OMNamespace protocolNs) throws OMException {
-        if (amqpEnabled) {
-            // Extract messages
-            List<OMElement> messages = new ArrayList<OMElement>();
-            if (NameSpaceConstants.WSNT_NS.equals(protocolNs)) {
-                // WSNT
-                OMElement messageElements = ctx.getSoapBody().getFirstElement();
-                for (Iterator<OMElement> ite = messageElements.getChildrenWithLocalName("NotificationMessage"); ite.hasNext(); ) {
-                    try {
-                        OMElement messageElement = ite.next();
-                        OMElement message = messageElement.getFirstChildWithName(
-                                new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(), "Message")).getFirstElement();
-                        messages.add(message);
-                    } catch (NullPointerException e) {
-                        throw new OMException(e);
-                    }
-                }
-            } else {
-                // WSE
-                OMElement message = ctx.getSoapBody().getFirstElement();
-                if (message != null) {
-                    messages.add(message);
-                }
-            }
-
-            // Dispatch messages
-            try {
-                for (OMElement message : messages) {
-                    amqpBroadcastSender.Send(message);
-                    amqpTopicSender.Send(message);
-                    amqpSender.Send(message);
-                }
-            } catch (AMQPException e) {
-                logger.warn("Failed to send AMQP notification.[Reason=" + e.getMessage() + "]");
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameterInfo.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameterInfo.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameterInfo.java
deleted file mode 100644
index 8c097d4..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameterInfo.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.context;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-
-public class ContextParameterInfo<T> {
-
-    private Class<T> parameterType;
-    private String parameterName;
-
-    public ContextParameterInfo(Class<T> type, String name) {
-        parameterType = type;
-        parameterName = name;
-
-    }
-
-    public Class<T> getParameterType() {
-        return parameterType;
-    }
-
-    public String getParameterName() {
-        return parameterName;
-    }
-
-    public T cast(Object obj) {
-
-        return parameterType.cast(obj);
-    }
-
-    public static void main(String[] a) {
-
-        new ContextParameterInfo<OMElement>(OMElement.class, "test");
-        OMAbstractFactory.getOMFactory().createOMElement("testtest", null);
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameters.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameters.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameters.java
deleted file mode 100644
index 61624d8..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameters.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.context;
-
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.addressing.EndpointReference;
-
-public class ContextParameters {
-
-    private static <V> ContextParameterInfo<V> createParam(Class<V> c, String name) {
-        ContextParameterInfo<V> info = new ContextParameterInfo<V>(c, name);
-
-        return info;
-    }
-
-    public static ContextParameterInfo<String> RESOURCE_ID = createParam(String.class, "resourceID");
-
-    public static final ContextParameterInfo<String> SUB_ID = createParam(String.class, "subID");
-
-    public static final ContextParameterInfo<String> TOPIC_FROM_URL = createParam(String.class, "topicFromUrl");
-
-    public static final ContextParameterInfo<String> SOAP_ACTION = createParam(String.class, "soapAction");
-
-    public static final ContextParameterInfo<SubscriptionState> SUBSCRIPTION = createParam(SubscriptionState.class,
-            "subscription");
-
-    public static final ContextParameterInfo<String> SUBSCRIBER_EXPIRES = createParam(String.class, "subscriberExpires");
-
-    public ContextParameterInfo<String> USE_NOTIFY_TEXT = createParam(String.class, "useNotifyText");
-
-    public static final ContextParameterInfo<OMElement> USE_NOTIFY_ELEMENT = createParam(OMElement.class, "useNotifyEl");
-
-    public static final ContextParameterInfo<OMElement> NOTIFY_TO_ELEMENT = createParam(OMElement.class, "NotifyTo");
-
-    public static final ContextParameterInfo<EndpointReference> NOTIFY_TO_EPR = createParam(EndpointReference.class,
-            "NotifyToEPR");
-
-    public static final ContextParameterInfo<OMElement> SUB_POLICY = createParam(OMElement.class, "subPolicy");
-
-    public static final ContextParameterInfo<OMElement> FILTER_ELEMENT = createParam(OMElement.class, "filterElement");
-
-    public static final ContextParameterInfo<OMElement> TOPIC_EXPRESSION_ELEMENT = createParam(OMElement.class,
-            "topicExpressionEl");
-
-    public static final ContextParameterInfo<OMElement> XPATH_ELEMENT = createParam(OMElement.class, "xpathEl");
-
-    public static final ContextParameterInfo<OMElement> SUBSCRIBE_ELEMENT = createParam(OMElement.class, "subscribeElement");
-
-    public static final ContextParameterInfo<EndpointReference> SUBSCRIBE_ELEMENT_EPR = createParam(EndpointReference.class,
-            "subscribeElement");
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContext.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContext.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContext.java
deleted file mode 100644
index 06a50ca..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContext.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.context;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.context.MessageContext;
-
-public class ProcessingContext {
-
-    private Map<ContextParameterInfo<? extends Object>, Object> contextInfo = new HashMap<ContextParameterInfo<? extends Object>, Object>();
-
-    private List<OMNamespace> responseMsgNameSpaces;
-
-    private MessageContext messageContext = null;
-
-    private SOAPEnvelope envelope; // Used for WSe notification messages.topics
-    // are
-    // in header.
-
-    private OMElement respMessage;
-
-    private SubscriptionState subscription = null;
-
-    public SOAPEnvelope getEnvelope() {
-        return envelope;
-    }
-
-    public void setEnvelope(SOAPEnvelope envelope) {
-        this.envelope = envelope;
-    }
-
-    public SOAPBody getSoapBody() {
-
-        return envelope.getBody();
-    }
-
-    public OMElement getRespMessage() {
-        return respMessage;
-    }
-
-    public void setRespMessage(OMElement respMessage) {
-        this.respMessage = respMessage;
-    }
-
-    public SubscriptionState getSubscription() {
-        return subscription;
-    }
-
-    public void setSubscription(SubscriptionState subscription) {
-        this.subscription = subscription;
-    }
-
-    public void setMessageConext(MessageContext msgContext) {
-        this.messageContext = msgContext;
-    }
-
-    public MessageContext getMessageContext() {
-        return messageContext;
-    }
-
-    public void addResponseMsgNameSpaces(OMNamespace ns) {
-
-        if (responseMsgNameSpaces == null) {
-            responseMsgNameSpaces = new ArrayList<OMNamespace>();
-        }
-
-        if (!responseMsgNameSpaces.contains(ns)) {
-            responseMsgNameSpaces.add(ns);
-        }
-    }
-
-    public List<OMNamespace> getResponseMsgNamespaces() {
-        return responseMsgNameSpaces;
-    }
-
-    public void setContextParameter(ContextParameterInfo<?> name, Object value) {
-        contextInfo.put(name, value);
-    }
-
-    public <T> T getContextParameter(ContextParameterInfo<T> name) {
-
-        Object o = contextInfo.get(name);
-        return name.cast(o);
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextBuilder.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextBuilder.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextBuilder.java
deleted file mode 100644
index 9d4d4ea..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextBuilder.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.context;
-
-import org.apache.axiom.om.OMElement;
-
-public abstract class ProcessingContextBuilder {
-
-    public abstract ProcessingContext build(OMElement elem);
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/handler/PublishedMessageHandler.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/handler/PublishedMessageHandler.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/handler/PublishedMessageHandler.java
deleted file mode 100644
index ca23506..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/handler/PublishedMessageHandler.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.handler;
-
-import java.util.List;
-
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.AddressingFaultsHelper;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.dispatchers.AddressingBasedDispatcher;
-import org.apache.axis2.engine.Phase;
-import org.apache.axis2.util.JavaUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class PublishedMessageHandler extends AddressingBasedDispatcher {
-
-    private static final Logger logger = LoggerFactory.getLogger(PublishedMessageHandler.class);
-
-    private static final String ADDRESSING_VALIDATE_ACTION = "addressing.validateAction";
-
-    private AxisOperation publishOperation = null;
-
-    private Phase addressingPhase = null;
-
-    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
-
-        InvocationResponse response = InvocationResponse.CONTINUE;
-
-        if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null) {
-            boolean validateAction = JavaUtils.isTrue(msgContext.getProperty(ADDRESSING_VALIDATE_ACTION), true);
-            msgContext.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false));
-            response = super.invoke(msgContext);
-            if (isForBrokerEventingService(msgContext))
-                validateBrokerWSEventingOperation(msgContext);
-            if (validateAction)
-                checkAction(msgContext);
-            msgContext.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(validateAction));
-
-        }
-
-        return response;
-    }
-
-    private void validateBrokerWSEventingOperation(MessageContext msgContext) {
-        if (msgContext.getAxisOperation() == null) {
-            AxisService service = msgContext.getAxisService();
-            AxisOperation pubOperation = getPublishOperation(service);
-            msgContext.setAxisOperation(pubOperation);
-        }
-    }
-
-    private boolean isForBrokerEventingService(MessageContext msgContext) {
-        return msgContext.getAxisService() != null && msgContext.getAxisService().getName().equals("EventingService");
-    }
-
-    private AxisOperation getPublishOperation(AxisService publisherService) {
-        if (publishOperation == null)
-            publishOperation = publisherService.getOperationBySOAPAction(WsmgCommonConstants.WSMG_PUBLISH_SOAP_ACTION);
-        return publishOperation;
-    }
-
-    private Phase getAddressingPhase(MessageContext context) {
-
-        if (addressingPhase == null) {
-
-            List<Phase> inFlowPhases = context.getConfigurationContext().getAxisConfiguration().getPhasesInfo()
-                    .getINPhases();
-
-            for (Phase p : inFlowPhases) {
-                if (p.getName().equalsIgnoreCase("Addressing")) {
-                    addressingPhase = p;
-                }
-            }
-
-        }
-
-        return addressingPhase;
-
-    }
-
-    private void checkAction(MessageContext msgContext) throws AxisFault {
-
-        Phase addPhase = getAddressingPhase(msgContext);
-
-        if (addPhase == null) {
-            logger.error("unable to locate addressing phase object");
-        }
-        if (msgContext != null) {
-            if (msgContext.getCurrentPhaseIndex() + 1 == addPhase.getHandlerCount()) {
-                if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null)
-                    AddressingFaultsHelper.triggerActionNotSupportedFault(msgContext, msgContext.getWSAAction());
-            }
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/CleanupThread.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/CleanupThread.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/CleanupThread.java
deleted file mode 100644
index bcd4ec1..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/CleanupThread.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.subscription;
-
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.airavata.wsmg.commons.CommonRoutines;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.axis2.AxisFault;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-class CleanUpThread implements Runnable {
-
-    private static final Logger logger = LoggerFactory.getLogger(CleanUpThread.class);
-
-    private SubscriptionManager subMan;
-
-    public CleanUpThread(SubscriptionManager manager) {
-        this.subMan = manager;
-    }
-
-    public void run() {
-        logger.debug("CleanUpThread started");
-        String key = null;
-        SubscriptionState subscription = null;
-        Set<String> keySet = null;
-        // long expirationTime=300000*12*24; //5 min*12*24=1 day
-        final long expirationTime = WSMGParameter.expirationTime;
-        final long skipCheckInterval = 1000 * 60 * 10; // 10 minutes
-        final long checkupInterval = 1000 * 60 * 5; // 5 minutes
-        int MAX_TRY = 3;
-        logger.info("Starting Subscription Cleaning up Thread.");
-        while (true) {
-            long currentTime = System.currentTimeMillis();
-            long expiredStartTime = 0;
-            if (WSMGParameter.requireSubscriptionRenew) {
-                expiredStartTime = currentTime - expirationTime; // expired
-            }
-            long availabilityCheckTime = 0;
-            availabilityCheckTime = currentTime - skipCheckInterval; // It's
-            // time
-            // to
-            // check
-            // again
-
-            // logger.finest("CleanUpThread loop");
-            keySet = subMan.getShallowSubscriptionsCopy().keySet();
-            // Go through all the subscriptions and delete expired ones
-            for (Iterator<String> iterator = keySet.iterator(); iterator.hasNext();) {
-                key = iterator.next();
-                subscription = subMan.getShallowSubscriptionsCopy().get(key);
-                if (subscription.isNeverExpire()) {
-                    continue;
-                }
-                long subscriptionCreationTime = subscription.getCreationTime();
-                long lastAvailableTime = subscription.getLastAvailableTime();
-                if (WSMGParameter.requireSubscriptionRenew) { // expired
-                    if (subscriptionCreationTime < expiredStartTime) { // expired
-                        // or
-                        // need
-                        // to
-                        // check
-                        // again
-                        try {
-                            subMan.removeSubscription(key);
-                        } catch (AxisFault e) {
-                            logger.error(e.getMessage(), e);
-                        }
-                        // Not need to remove the key from the keyset since
-                        // the keyset
-                        // "is backed by the map, so changes to the map are reflected in the set, and vice-versa."
-                        // i.remove(); //add this will cause
-                        // ConcurrentModificationException
-                        logger.info("*****Deleted (expiration)" + key + "-->" + subscription.getConsumerIPAddressStr()
-                                + "##" + subscription.getLocalTopic());
-                        logger.info("*****Deleted (expiration)" + key + "-->" + subscription.getConsumerIPAddressStr()
-                                + "##" + subscription.getLocalTopic());
-                        continue;
-                    }
-                }
-                if (lastAvailableTime < availabilityCheckTime) {
-                    // It's time to check again
-                    if (CommonRoutines.isAvailable(subscription.getConsumerAddressURI())) {
-                        // It's time to check but still available and do not
-                        // require subscriptio renew
-                        // set a mark saying it has been check at this time
-                        subscription.setLastAvailableTime(currentTime);
-                        if (subscription.getUnAvailableCounter() > 0) { // failed
-                            // in
-                            // previous
-                            // try
-                            subscription.resetUnAvailableCounter();
-                        }
-                    } else {
-                        int counter = subscription.addUnAvailableCounter();
-                        // System.out.println("UnavailableCounter="+counter);
-                        // logger.finest("UnavailableCounter="+counter);
-                        if (counter > MAX_TRY) {
-                            try {
-                                subMan.removeSubscription(key);
-                            } catch (AxisFault e) {
-                                // TODO Auto-generated catch block
-                                logger.error(e.getMessage(), e);
-                            }
-
-                            // Remove from hashtable seperately to avoid
-                            // conccurent access problem to the hashtable
-                            // with
-                            // i.next()
-                            iterator.remove();
-                            logger.info("*****Deleted (unavailable)" + key + "-->"
-                                    + subscription.getConsumerIPAddressStr() + "##" + subscription.getLocalTopic());
-                            logger.info("*****Deleted (unavailable)" + key + "-->"
-                                    + subscription.getConsumerIPAddressStr() + "##" + subscription.getLocalTopic());
-                        }
-                    }
-                }
-            }
-            try {
-                Thread.sleep(checkupInterval);
-            } catch (InterruptedException e) {
-                logger.error("thread was interrupped", e);
-            }
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionEntry.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionEntry.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionEntry.java
deleted file mode 100644
index a9339fd..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionEntry.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.subscription;
-
-public class SubscriptionEntry {
-
-    private String subscriptionId;
-
-    private String subscribeXml;
-
-    public SubscriptionEntry() {
-    }
-
-    public String getSubscriptionId() {
-        return subscriptionId;
-    }
-
-    public String getSubscribeXml() {
-        return subscribeXml;
-    }
-
-    public void setSubscriptionId(String subscriptionId) {
-        this.subscriptionId = subscriptionId;
-    }
-
-    public void setSubscribeXml(String subscribeXml) {
-        this.subscribeXml = subscribeXml;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionManager.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionManager.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionManager.java
deleted file mode 100644
index e42e4c1..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionManager.java
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.subscription;
-
-import java.io.StringReader;
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.airavata.wsmg.broker.context.ContextParameters;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.broker.context.ProcessingContextBuilder;
-import org.apache.airavata.wsmg.broker.wseventing.WSEProcessingContextBuilder;
-import org.apache.airavata.wsmg.broker.wseventing.WSEProtocolSupport;
-import org.apache.airavata.wsmg.broker.wsnotification.WSNTProtocolSupport;
-import org.apache.airavata.wsmg.broker.wsnotification.WSNotificationProcessingContextBuilder;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.commons.storage.WsmgStorage;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
-import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
-import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-import org.apache.airavata.wsmg.util.RunTimeStatistics;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axis2.AxisFault;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Manages subscribers.
- * 
- */
-public class SubscriptionManager {
-
-    private static final Logger log = LoggerFactory.getLogger(SubscriptionManager.class);
-
-    private HashMap<String, SubscriptionState> subscriptions = new HashMap<String, SubscriptionState>();
-
-    private ReentrantReadWriteLock subscriptionLock = new ReentrantReadWriteLock();
-
-    private WSEProtocolSupport wseProtocalSupport = new WSEProtocolSupport();
-
-    private WSNTProtocolSupport wsntProtocolSupport = new WSNTProtocolSupport();
-
-    private WsmgStorage subscriptionDB;
-
-    private WsmgConfigurationContext wsmgConfig;
-
-    private OutGoingQueue outGoingQueue;
-
-    private int counter = 1;
-
-    public SubscriptionManager(WsmgConfigurationContext paramters, WsmgStorage storage) {
-        init(paramters, storage);
-    }
-
-    private void init(WsmgConfigurationContext parameters, WsmgStorage storage) {
-
-        this.wsmgConfig = parameters;
-
-        subscriptionDB = storage;
-        outGoingQueue = parameters.getOutgoingQueue();
-        if (WSMGParameter.enableAutoCleanSubscriptions) {
-            CleanUpThread cleanUpThread = new CleanUpThread(this);
-            Thread t = new Thread(cleanUpThread);
-            t.start();
-        }
-
-        try {
-            checkSubscriptionDB(storage);
-        } catch (AxisFault e) {
-            log.error("Subscription database has malformed" + " subscriptions. Ignoring them.", e);
-
-        }
-
-    }
-
-    /**
-     * @return Returns the subscriptions.
-     */
-    public AbstractMap<String, SubscriptionState> getShallowSubscriptionsCopy() {
-
-        AbstractMap<String, SubscriptionState> ret = null;
-        readLockUnlockSubscriptions(true);
-        try {
-            ret = new HashMap<String, SubscriptionState>(subscriptions);
-        } finally {
-            readLockUnlockSubscriptions(false);
-        }
-
-        return ret;
-
-    }
-
-    public void subscribe(ProcessingContext ctx) throws AxisFault {
-
-        String subId = createSubscription(null, ctx);
-        if (subId == null) {
-            log.error("ERROR: No subscription created");
-            return;
-        }
-
-        if (NameSpaceConstants.WSE_NS.equals(ctx.getContextParameter(ContextParameters.SUBSCRIBE_ELEMENT)
-                .getNamespace())) {
-            wseProtocalSupport.createSubscribeResponse(ctx, subId);
-
-        } else { // WSNT
-
-            wsntProtocolSupport.createSubscribeResponse(ctx, subId);
-        }
-    }
-
-    /**
-     * @param subscriptionId
-     *            this is the ID that is in the SOAP header
-     * @param ctx
-     *            contexts constructed with the body elements
-     * @return subscription id
-     * @throws AxisFault
-     */
-    private String createSubscription(String subscriptionId, ProcessingContext ctx) throws AxisFault {
-
-        SubscriptionState state = null;
-        String key = null;
-
-        // get the first element element inside the soap body element and check
-        // whether namespace is WSE
-        if (NameSpaceConstants.WSE_NS.equals(ctx.getContextParameter(ContextParameters.SUBSCRIBE_ELEMENT)
-                .getNamespace())) {
-            state = wseProtocalSupport.createSubscriptionState(ctx, outGoingQueue);
-        } else { // Handle WSNT
-
-            state = wsntProtocolSupport.createSubscriptionState(ctx, outGoingQueue);
-        }
-
-        if (subscriptionId == null) { // New subscription entry
-            key = checkSubscriptionExist(state);
-            if (key != null) { // just renew previous subscriptions
-                return key;
-            }
-            // new subscriptions
-
-            state.setCreationTime(System.currentTimeMillis());
-
-            key = generateSubscriptionId(state.getXpathString() != null && state.getXpathString().length() > 0);
-
-        } else { // Startup from previous subscription database
-            key = subscriptionId;
-        }
-
-        for (AbstractMessageMatcher m : wsmgConfig.getMessageMatchers()) {
-            m.handleSubscribe(state, key);
-        }
-
-        if (subscriptionId == null) { // New subscription entry,
-
-            RunTimeStatistics.totalSubscriptions++;
-            try {
-                String subscribeXml = ctx.getContextParameter(ContextParameters.SUBSCRIBE_ELEMENT)
-                        .toStringWithConsume();
-
-                state.setId(key);
-                state.setSubscribeXml(subscribeXml);
-                subscriptionDB.insert(state);
-
-            } catch (Exception ex) {
-                log.error("unable to insert subscription to database", ex);
-                throw new AxisFault("unable to insert subscription to database ", ex);
-            }
-        }
-
-        addToSubscriptionMap(key, state);
-        return key;
-    }
-
-    private void addToSubscriptionMap(String key, SubscriptionState state) {
-
-        writeLockUnlockSubscription(true);
-        try {
-            subscriptions.put(key, state);
-        } finally {
-            writeLockUnlockSubscription(false);
-        }
-
-    }
-
-    /**
-     * @param xpathString
-     * @return
-     */
-    private String generateSubscriptionId(boolean xPath) {
-        String key;
-        String subIdPrefix = null; // Used to indicate weather a subscription
-        // has an XPath subscription Or Topic
-        // only.
-        if (!xPath) {
-            subIdPrefix = "T";
-        } else {
-            subIdPrefix = "X";
-        }
-        key = subIdPrefix + "sub" + (counter++) + "@" + WsmgCommonConstants.PREFIX;
-        return key;
-    }
-
-    /**
-     * if find the subscription already exists, return the current subscriptionId else return null;
-     */
-
-    public String checkSubscriptionExist(SubscriptionState state) {
-
-        String key = null;
-
-        readLockUnlockSubscriptions(true);
-        try {
-
-            for (Iterator<String> keyIterator = subscriptions.keySet().iterator(); keyIterator.hasNext();) {
-
-                String currentKey = keyIterator.next();
-                SubscriptionState value = subscriptions.get(currentKey);
-
-                if (value.equals(state)) {
-                    value.setCreationTime(System.currentTimeMillis());
-                    log.info("Subscription Already exists." + " Using the current subscriptionId");
-                    key = currentKey;
-                    break;
-                }
-
-            }
-
-        } finally {
-            readLockUnlockSubscriptions(false);
-        }
-
-        return key;
-    }
-
-    public void checkSubscriptionDB(WsmgStorage storage) throws AxisFault {
-        OMElement subscribeXmlElement;
-        String subscriptionId;
-        // Read subscription Info from Subscription DB
-        List<SubscriptionEntry> subscriptionEntry = storage.getAllSubscription();
-        if (subscriptionEntry == null) {
-            return;
-        }
-
-        WSNotificationProcessingContextBuilder wsntBuilder = new WSNotificationProcessingContextBuilder();
-        WSEProcessingContextBuilder wseBuilder = new WSEProcessingContextBuilder();
-
-        // Create subscription for these entries from DB
-        for (int i = 0; i < subscriptionEntry.size(); i++) {
-
-            ProcessingContextBuilder processingCtxBuilder = null;
-
-            log.info("Subscription No. " + i + " is " + subscriptionEntry.get(i).getSubscriptionId());
-
-            StringReader sr = new StringReader(subscriptionEntry.get(i).getSubscribeXml());
-            XMLInputFactory inputFactory = XMLInputFactory.newInstance();
-            XMLStreamReader inflow;
-            try {
-                inflow = inputFactory.createXMLStreamReader(sr);
-
-                StAXOMBuilder builder = new StAXOMBuilder(inflow); // get the
-                // root
-                // element (in
-                // this case the
-                // envelope)
-                subscribeXmlElement = builder.getDocumentElement();
-
-                if (subscribeXmlElement.getNamespace().getNamespaceURI()
-                        .equals(NameSpaceConstants.WSNT_NS.getNamespaceURI())) {
-                    processingCtxBuilder = wsntBuilder;
-
-                } else {
-                    processingCtxBuilder = wseBuilder;
-                }
-
-                subscriptionId = subscriptionEntry.get(i).getSubscriptionId();
-
-                ProcessingContext context = processingCtxBuilder.build(subscribeXmlElement);
-                createSubscription(subscriptionId, context);
-
-            } catch (XMLStreamException e) {
-                log.error("error occured while checking subscription db", e);
-            }
-        }
-        RunTimeStatistics.totalSubscriptionsAtStartUp += subscriptionEntry.size();
-    }
-
-    // This is used for debug
-    public void showAllSubscription() {
-        String key = null;
-        SubscriptionState value = null;
-        Set<String> keySet = subscriptions.keySet();
-        log.info("List of all subscriptions:");
-        for (Iterator<String> iterator = keySet.iterator(); iterator.hasNext();) {
-            key = iterator.next();
-            value = subscriptions.get(key);
-            log.info("******" + key + "-->" + value.getConsumerIPAddressStr() + "##" + value.getLocalTopic());
-        }
-    }
-
-    public int unsubscribe(ProcessingContext ctx) throws AxisFault {
-
-        String subscriptionId = ctx.getContextParameter(ContextParameters.SUB_ID);
-        if (subscriptionId == null || subscriptionId.trim().length() == 0) {
-            throw new AxisFault("subscription identifier is not provided");
-        }
-
-        removeSubscription(subscriptionId);
-        RunTimeStatistics.totalUnSubscriptions++;
-        return 0;
-    }
-
-    int removeSubscription(String subId) throws AxisFault {
-
-        SubscriptionState subscription = null;
-
-        writeLockUnlockSubscription(true);
-        try {
-            subscription = subscriptions.remove(subId);
-        } finally {
-            writeLockUnlockSubscription(false);
-        }
-
-        if (subscription == null) {
-            throw AxisFault.makeFault(new RuntimeException("unknown subscription: " + subId));
-
-        }
-
-        subscriptionDB.delete(subId);
-
-        for (AbstractMessageMatcher mm : wsmgConfig.getMessageMatchers()) {
-            mm.handleUnsubscribe(subId);
-        }
-
-        return 0;
-    }
-
-    public void resumeSubscription(ProcessingContext ctx) throws AxisFault {
-
-        String subscriptionId = ctx.getContextParameter(ContextParameters.SUB_ID);
-
-        if (subscriptionId == null) {
-            throw AxisFault.makeFault(new RuntimeException("missing subscription id"));
-        }
-
-        writeLockUnlockSubscription(true);// lock
-        try {
-            SubscriptionState subscription = subscriptions.get(subscriptionId);
-
-            if (subscription == null) {
-
-                throw AxisFault.makeFault(new RuntimeException("no subscription found for id: " + subscriptionId));
-            }
-
-            subscription.resume();
-        } finally {
-            // this will execute even exception is thrown.
-            writeLockUnlockSubscription(false);
-        }
-    }
-
-    public void pauseSubscription(ProcessingContext ctx) throws AxisFault {
-
-        String subscriptionId = ctx.getContextParameter(ContextParameters.SUB_ID);
-
-        if (subscriptionId == null) {
-            throw AxisFault.makeFault(new RuntimeException("missing subscription id"));
-        }
-
-        writeLockUnlockSubscription(true);// read lock should be sufficient
-        // (since we are not modifying the
-        // map)
-        try {
-            SubscriptionState subscription = subscriptions.get(subscriptionId);
-
-            if (subscription == null) {
-
-                throw AxisFault.makeFault(new RuntimeException("no subscription found for id: " + subscriptionId));
-
-            }
-
-            subscription.pause();
-        } finally {
-            // this will execute even exception is thrown.
-            writeLockUnlockSubscription(false);
-        }
-    }
-
-    public void readLockUnlockSubscriptions(boolean lock) {
-        ReadLock readlock = subscriptionLock.readLock();
-        lockUnlock(readlock, lock);
-    }
-
-    public void writeLockUnlockSubscription(boolean lock) {
-        WriteLock writeLock = subscriptionLock.writeLock();
-        lockUnlock(writeLock, lock);
-    }
-
-    private void lockUnlock(Lock l, boolean lock) {
-
-        if (lock) {
-            l.lock();
-        } else {
-            l.unlock();
-        }
-
-    }
-}


[86/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
new file mode 100644
index 0000000..4737ef9
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/BrokerServiceLifeCycle.java
@@ -0,0 +1,328 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker;
+
+import java.lang.reflect.Constructor;
+import java.net.URI;
+
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.client.tools.PeriodicExecutorThread;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.ServiceUtils;
+import org.apache.airavata.wsmg.broker.handler.PublishedMessageHandler;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionManager;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.config.ConfigurationManager;
+import org.apache.airavata.wsmg.commons.storage.WsmgInMemoryStorage;
+import org.apache.airavata.wsmg.commons.storage.WsmgPersistantStorage;
+import org.apache.airavata.wsmg.commons.util.Axis2Utils;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
+import org.apache.airavata.wsmg.messenger.ConsumerUrlManager;
+import org.apache.airavata.wsmg.messenger.Deliverable;
+import org.apache.airavata.wsmg.messenger.DeliveryProcessor;
+import org.apache.airavata.wsmg.messenger.SenderUtils;
+import org.apache.airavata.wsmg.messenger.protocol.DeliveryProtocol;
+import org.apache.airavata.wsmg.messenger.protocol.impl.Axis2Protocol;
+import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
+import org.apache.airavata.wsmg.messenger.strategy.impl.FixedParallelSender;
+import org.apache.airavata.wsmg.messenger.strategy.impl.ParallelSender;
+import org.apache.airavata.wsmg.messenger.strategy.impl.SerialSender;
+import org.apache.airavata.wsmg.util.RunTimeStatistics;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.ServiceLifeCycle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BrokerServiceLifeCycle implements ServiceLifeCycle {
+
+    private static final Logger log = LoggerFactory.getLogger(BrokerServiceLifeCycle.class);
+//    public static final String REPOSITORY_PROPERTIES = "airavata-server.properties";
+    public static final int GFAC_URL_UPDATE_INTERVAL = 1000 * 60 * 60 * 3;
+
+    public static final int JCR_AVAIALABILITY_WAIT_INTERVAL = 1000 * 10;
+    public static final String JCR_CLASS = "jcr.class";
+    public static final String JCR_USER = "jcr.user";
+    public static final String JCR_PASS = "jcr.pass";
+    public static final String ORG_APACHE_JACKRABBIT_REPOSITORY_URI = "org.apache.jackrabbit.repository.uri";
+    private static final String MESSAGE_BROKER_SERVICE_NAME = "EventingService";
+    private static final String SERVICE_URL = "message_broker_service_url";
+    private static final String JCR_REGISTRY = "registry";
+    private Thread thread;
+
+    private static final long DEFAULT_SOCKET_TIME_OUT = 20000l;
+
+    private DeliveryProcessor proc;
+    private ConsumerUrlManager urlManager;
+
+    private static Boolean initialized = false;
+
+    public void shutDown(ConfigurationContext configurationcontext, AxisService service) {
+        log.info("broker shutting down");
+        if (proc != null) {
+            proc.stop();
+            proc = null;
+        }
+        if (urlManager != null) {
+            urlManager.stop();
+            urlManager = null;
+        }
+
+        synchronized (initialized) {
+            if (initialized) {
+                initialized = false;
+                AiravataAPI registry = (AiravataAPI) configurationcontext.getProperty(JCR_REGISTRY);
+                if(registry != null && thread != null){
+                    try {
+                        registry.getAiravataManager().unsetEventingURI();
+                    } catch (AiravataAPIInvocationException e) {
+                        e.printStackTrace();
+                    }
+                    thread.interrupt();
+                try {
+                    thread.join();
+                } catch (InterruptedException e) {
+                    log.info("Message box url update thread is interrupted");
+                }
+                }
+            }
+        }
+        log.info("broker shut down");
+    }
+
+    public void startUp(ConfigurationContext configContext, AxisService axisService) {
+    	AiravataUtils.setExecutionAsServer();
+        Boolean inited = (Boolean) configContext.getProperty(WsmgCommonConstants.BROKER_INITED);
+
+        if (inited == null || inited == false) {
+            log.info("Starting Message Broker...");
+            Axis2Utils.overrideAddressingPhaseHander(configContext, new PublishedMessageHandler());
+            WsmgConfigurationContext brokerConext = initConfigurations(configContext, axisService);
+            initQueue(brokerConext);
+            initDeliveryMethod(brokerConext.getConfigurationManager());
+
+            inited = true;
+            configContext.setProperty(WsmgCommonConstants.BROKER_INITED, inited);
+        } else {
+            log.debug("init was already done by another webservice");
+        }
+
+        final ConfigurationContext context = configContext;
+        synchronized (initialized) {
+            if (!initialized) {
+                initialized = true;
+                new Thread() {
+                    @Override
+                    public void run() {
+//                        Properties properties = new Properties();
+                        try {
+//                            URL url = this.getClass().getClassLoader()
+//                                    .getResource(REPOSITORY_PROPERTIES);
+//                            properties.load(url.openStream());
+//                            Map<String, String> map = new HashMap<String, String>(
+//                                    (Map) properties);
+                            try {
+                                Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
+                            } catch (InterruptedException e1) {
+                                e1.printStackTrace();
+                            }
+
+                            String userName = ServerSettings.getSystemUser();
+                            String gateway = ServerSettings.getSystemUserGateway();
+
+                            AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(gateway, userName);
+                            String localAddress = ServiceUtils
+                                    .generateServiceURLFromConfigurationContext(
+                                            context,
+                                            MESSAGE_BROKER_SERVICE_NAME);
+                            log.debug("MESSAGE BOX SERVICE_ADDRESS:"
+                                    + localAddress);
+                            context.setProperty(SERVICE_URL, new URI(
+                                    localAddress));
+                            context.setProperty(JCR_REGISTRY, airavataAPI);
+                            /*
+                                    * Heart beat message to registry
+                                    */
+                            thread = new MsgBrokerURLRegisterThread(airavataAPI, context);
+                            thread.start();
+                        } catch (Exception e) {
+                            log.error(e.getMessage(), e);
+                        }
+                    }
+                }.start();
+            }
+        }
+    }
+
+    private WsmgConfigurationContext initConfigurations(ConfigurationContext configContext, AxisService axisService) {
+
+        WsmgConfigurationContext wsmgConfig = new WsmgConfigurationContext();
+        configContext.setProperty(WsmgCommonConstants.BROKER_WSMGCONFIG, wsmgConfig);
+
+        ConfigurationManager configMan = new ConfigurationManager();
+
+        wsmgConfig.setConfigurationManager(configMan);
+
+        String type = configMan.getConfig(WsmgCommonConstants.CONFIG_STORAGE_TYPE,
+                WsmgCommonConstants.STORAGE_TYPE_PERSISTANT);
+
+        /*
+         * Determine Storage
+         */
+        if (WsmgCommonConstants.STORAGE_TYPE_IN_MEMORY.equalsIgnoreCase(type)) {
+            WsmgInMemoryStorage inmem = new WsmgInMemoryStorage();
+
+            wsmgConfig.setStorage(inmem);
+            wsmgConfig.setQueue(inmem);
+            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, inmem));
+
+        } else {
+            String jdbcUrl = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_URL);
+            String jdbcDriver = configMan.getConfig(WsmgCommonConstants.CONFIG_JDBC_DRIVER);
+            WsmgPersistantStorage persis = new WsmgPersistantStorage(jdbcUrl, jdbcDriver);
+
+            wsmgConfig.setStorage(persis);
+            wsmgConfig.setQueue(persis);
+            wsmgConfig.setSubscriptionManager(new SubscriptionManager(wsmgConfig, persis));
+        }
+
+        NotificationProcessor notificatonProcessor = new NotificationProcessor(wsmgConfig);
+        wsmgConfig.setNotificationProcessor(notificatonProcessor);
+
+        return wsmgConfig;
+    }
+
+    private void initQueue(WsmgConfigurationContext context) {
+
+        log.debug("setting up queue");
+
+        WSMGParameter.OUT_GOING_QUEUE = context.getQueue();
+
+        if (WSMGParameter.cleanQueueonStartUp) {
+            log.debug("cleaning up persistant queue");
+            WSMGParameter.OUT_GOING_QUEUE.cleanup();
+            log.debug("cleaned up persistant queue");
+        }
+
+        RunTimeStatistics.setStartUpTime();
+
+    }
+
+    private void initDeliveryMethod(ConfigurationManager configMan) {
+
+        String shouldStart = configMan.getConfig(WsmgCommonConstants.CONFIG_START_DELIVERY_THREADS);
+
+        if (!Boolean.parseBoolean(shouldStart)) {
+
+            if (configMan.getConfig(WsmgCommonConstants.CONFIG_STORAGE_TYPE,
+                    WsmgCommonConstants.STORAGE_TYPE_PERSISTANT).equalsIgnoreCase(
+                    WsmgCommonConstants.STORAGE_TYPE_IN_MEMORY)) {
+
+                /*
+                 * user has asked to use in memory queue but without starting the delivery thread. this will accumulate
+                 * message in memory.
+                 */
+                log.error("conflicting configuration detected, using in memory queue without starting delivery thread will result memory growth.");
+
+            }
+            return;
+        }
+
+        /*
+         * Create Protocol
+         */
+        DeliveryProtocol protocol;
+        String protocolClass = configMan
+                .getConfig(WsmgCommonConstants.DELIVERY_PROTOCOL, Axis2Protocol.class.getName());
+        try {
+            Class cl = Class.forName(protocolClass);
+            Constructor<DeliveryProtocol> co = cl.getConstructor(null);
+            protocol = co.newInstance((Object[]) null);
+
+        } catch (Exception e) {
+            log.error("Cannot initial protocol sender", e);
+            return;
+        }
+        protocol.setTimeout(configMan.getConfig(WsmgCommonConstants.CONFIG_SOCKET_TIME_OUT, DEFAULT_SOCKET_TIME_OUT));
+
+        /*
+         * Create delivery method
+         */
+        SendingStrategy method = null;
+        String initedmethod = null;
+        String deliveryMethod = configMan.getConfig(WsmgCommonConstants.CONFIG_DELIVERY_METHOD,
+                WsmgCommonConstants.DELIVERY_METHOD_SERIAL);
+        if (WsmgCommonConstants.DELIVERY_METHOD_PARALLEL.equalsIgnoreCase(deliveryMethod)) {
+            method = new ParallelSender();
+            initedmethod = WsmgCommonConstants.DELIVERY_METHOD_PARALLEL;
+
+        } else if (WsmgCommonConstants.DELIVERY_METHOD_THREAD_CREW.equalsIgnoreCase(deliveryMethod)) {
+            int poolsize = configMan.getConfig(WsmgCommonConstants.CONFIG_SENDING_THREAD_POOL_SIZE,
+                    WsmgCommonConstants.DEFAULT_SENDING_THREAD_POOL_SIZE);
+            int batchsize = configMan.getConfig(WsmgCommonConstants.CONFIG_SENDING_BATCH_SIZE,
+                    WsmgCommonConstants.DEFAULT_SENDING_BATCH_SIZE);
+            method = new FixedParallelSender(poolsize, batchsize);
+            initedmethod = WsmgCommonConstants.DELIVERY_METHOD_THREAD_CREW;
+
+        } else {
+            method = new SerialSender();
+            initedmethod = WsmgCommonConstants.DELIVERY_METHOD_SERIAL;
+        }
+
+        /*
+         * Create Deliverable
+         */
+        urlManager = new ConsumerUrlManager(configMan);
+        Deliverable senderUtils = new SenderUtils(urlManager);
+        senderUtils.setProtocol(protocol);
+
+        proc = new DeliveryProcessor(senderUtils, method);
+        proc.start();
+        log.debug(initedmethod + " sending method inited");
+    }
+
+    class MsgBrokerURLRegisterThread extends PeriodicExecutorThread {
+
+        private ConfigurationContext context = null;
+
+        public MsgBrokerURLRegisterThread(AiravataAPI registry, ConfigurationContext context) {
+            super(registry);
+            this.context = context;
+        }
+
+
+        protected void updateRegistry(AiravataAPI registry) {
+            try {
+                URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
+                registry.getAiravataManager().setEventingURI(localAddress);
+            } catch (AiravataAPIInvocationException e) {
+                e.printStackTrace();
+            }
+            log.debug("Updated Eventing service URL in to Repository");
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerInfo.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerInfo.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerInfo.java
new file mode 100644
index 0000000..d087a87
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerInfo.java
@@ -0,0 +1,123 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker;
+
+import java.io.Serializable;
+
+public class ConsumerInfo implements Serializable {
+    static final long serialVersionUID = 2274650724788817903L;
+
+    // TODO : change this to OM, EndpointReference.
+    String consumerEprStr;
+
+    String type; // Either "wsnt" or "wse"
+
+    boolean useNotify;
+
+    boolean paused = false;
+
+    boolean wsrmEnabled;
+
+    /**
+     * @param consumerEprStr
+     * @param type
+     * @param useNotify
+     * @param paused
+     */
+    public ConsumerInfo(String consumerEprStr, String type, boolean useNotify, boolean paused) {
+        super();
+        // TODO Auto-generated constructor stub
+        this.consumerEprStr = consumerEprStr;
+        this.type = type;
+        this.useNotify = useNotify;
+        this.paused = paused;
+    }
+
+    /**
+     * @return Returns the consumerEprStr.
+     */
+    public String getConsumerEprStr() {
+        return consumerEprStr;
+    }
+
+    /**
+     * @param consumerEprStr
+     *            The consumerEprStr to set.
+     */
+    public void setConsumerEprStr(String consumerEprStr) {
+        this.consumerEprStr = consumerEprStr;
+    }
+
+    /**
+     * @return Returns the paused.
+     */
+    public boolean isPaused() {
+        return paused;
+    }
+
+    /**
+     * @param paused
+     *            The paused to set.
+     */
+    public void setPaused(boolean paused) {
+        this.paused = paused;
+    }
+
+    /**
+     * @return Returns the type.
+     */
+    public String getType() {
+        return type;
+    }
+
+    /**
+     * @param type
+     *            The type to set.
+     */
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    /**
+     * @return Returns the useNotify.
+     */
+    public boolean isUseNotify() {
+        return useNotify;
+    }
+
+    /**
+     * @param useNotify
+     *            The useNotify to set.
+     */
+    public void setUseNotify(boolean useNotify) {
+        this.useNotify = useNotify;
+    }
+
+    public boolean isWsrmEnabled() {
+        return wsrmEnabled;
+    }
+
+    public void setWsrmEnabled(boolean wsrmEnabled) {
+        this.wsrmEnabled = wsrmEnabled;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerList.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerList.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerList.java
new file mode 100644
index 0000000..38d8a3a
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerList.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+public class ConsumerList {
+    Map<String, ConsumerInfo> subId2ConsumerInfo = new HashMap<String, ConsumerInfo>();
+
+    ArrayList<ConsumerInfo> consumerInfoList = new ArrayList<ConsumerInfo>();
+
+    boolean changed = true;
+    int size = 0; // use size instead of consumerInfoList.size() to avoid
+
+    // unnecessary copy of subId2ConsumerInfo in
+    // refreshConsumerInfoList() if just need the size
+
+    public void addConsumer(String subId, ConsumerInfo consumerInfo) {
+        subId2ConsumerInfo.put(subId, consumerInfo);
+        changed = true;
+        size++;
+    }
+
+    public int removeConsumer(String subId) {
+        ConsumerInfo result = subId2ConsumerInfo.remove(subId);
+        if (result == null) {
+            return 0;
+        }
+        changed = true;
+        size--;
+        return 1;
+
+    }
+
+    public ArrayList<ConsumerInfo> getConsumerList() {
+        if (changed) {
+            refreshConsumerInfoList();
+        }
+        return consumerInfoList;
+    }
+
+    public int size() {
+        return size;
+    }
+
+    private void refreshConsumerInfoList() {
+        consumerInfoList.clear();
+        consumerInfoList.addAll(subId2ConsumerInfo.values());
+        changed = false;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerListManager.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerListManager.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerListManager.java
new file mode 100644
index 0000000..b5ca1bb
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/ConsumerListManager.java
@@ -0,0 +1,79 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ConsumerListManager {
+
+    private static final Logger logger = LoggerFactory.getLogger(ConsumerListManager.class);
+
+    protected Map<String, ConsumerList> token2ConsumerListMap = new HashMap<String, ConsumerList>();
+
+    protected Map<String, String> subId2Token = new HashMap<String, String>();
+
+    // token can be a topic or an XPath String
+    public void addToConsumerList(String token, SubscriptionState subscribeRequest, String subscriptionId) {
+        ConsumerList consumerList = token2ConsumerListMap.get(token);
+        if (consumerList == null) { // new topic
+            consumerList = new ConsumerList();
+            token2ConsumerListMap.put(token, consumerList);
+        }
+        consumerList.addConsumer(subscriptionId, subscribeRequest.getConsumerInfo());
+        subId2Token.put(subscriptionId, token);
+
+    }
+
+    public String getTokenBySubscriptionId(String subscriptionId) {
+        String token = subId2Token.get(subscriptionId);
+        return token;
+    }
+
+    public int removeFromConsumerList(String subscriptionId, String token) {
+        String tokenString = null;
+        if (token == null) {
+            tokenString = subId2Token.get(subscriptionId);
+        } else {
+            tokenString = token;
+        }
+
+        ConsumerList consumerList = token2ConsumerListMap.get(tokenString);
+        if (consumerList == null) {
+            logger.error("*****ERROR:Cannot find the token to delete: " + tokenString);
+            return 0;
+        }
+        int result = consumerList.removeConsumer(subscriptionId);
+        subId2Token.remove(subscriptionId);
+        return result;
+    }
+
+    public ConsumerList getConsumerListByToken(String token) {
+        ConsumerList consumerList = token2ConsumerListMap.get(token);
+        return consumerList;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
new file mode 100644
index 0000000..10ae03b
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/NotificationProcessor.java
@@ -0,0 +1,313 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker;
+
+import java.util.*;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.airavata.wsmg.broker.amqp.AMQPNotificationProcessor;
+import org.apache.airavata.wsmg.broker.context.ContextParameters;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.commons.OutGoingMessage;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
+import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
+import org.apache.airavata.wsmg.messenger.OutGoingQueue;
+import org.apache.airavata.wsmg.util.BrokerUtil;
+import org.apache.airavata.wsmg.util.RunTimeStatistics;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.xpath.AXIOMXPath;
+import org.apache.axis2.AxisFault;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class NotificationProcessor {
+
+    private static final Logger logger = LoggerFactory.getLogger(NotificationProcessor.class);
+
+    private WsmgConfigurationContext wsmgConfigContext;
+
+    protected long messageCounter = 0;
+    protected long messageId = 0;
+
+    OMFactory factory = OMAbstractFactory.getOMFactory();
+
+    private OutGoingQueue outgoingQueue;
+
+    private AMQPNotificationProcessor amqpNotificationProcessor = new AMQPNotificationProcessor();
+
+    public NotificationProcessor(WsmgConfigurationContext config) {
+        init(config);
+        amqpNotificationProcessor.init();
+    }
+
+    private void init(WsmgConfigurationContext config) {
+        this.wsmgConfigContext = config;
+        outgoingQueue = config.getOutgoingQueue();
+    }
+
+    private synchronized long getNextTrackId() {
+        messageCounter++;
+        return messageCounter;
+    }
+
+    private synchronized long getNextMsgId() {
+        messageId++;
+        return messageId;
+    }
+
+    public void processMsg(ProcessingContext ctx, OMNamespace protocolNs) throws OMException, AxisFault {
+
+        String trackId = "trackId_A_" + getNextTrackId();
+        if (WSMGParameter.showTrackId) {
+            logger.debug(trackId + ": received.");
+        }
+
+        AdditionalMessageContent additionalMessageContent = new AdditionalMessageContent(ctx.getMessageContext()
+                .getSoapAction(), ctx.getMessageContext().getMessageID());
+        additionalMessageContent.setTrackId(trackId);
+
+        handleExtendedNotifications(ctx, protocolNs);
+
+        if (NameSpaceConstants.WSNT_NS.equals(protocolNs)) {
+
+            onWSNTMsg(ctx, additionalMessageContent);
+            setResponseMsg(ctx, trackId, protocolNs);
+        } else { // WSE Notifications No specific namespace
+
+            onWSEMsg(ctx, trackId, additionalMessageContent);
+           setResponseMsg(ctx, trackId, protocolNs);
+        }
+    }
+
+    /**
+     * @param ctx
+     * @param topicElString
+     * @param trackId
+     * @param additionalMessageContent
+     * @throws OMException
+     * @throws XMLStreamException
+     */
+    private void onWSEMsg(ProcessingContext ctx, String trackId, AdditionalMessageContent additionalMessageContent)
+            throws OMException, AxisFault {
+
+        String topicElString = null;
+        String topicLocalString = null;
+
+        QName qName = new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(), "Topic");
+
+        OMElement topicEl = ctx.getMessageContext().getEnvelope().getHeader().getFirstChildWithName(qName);
+
+        if (topicEl == null) {
+
+            topicLocalString = ctx.getContextParameter(ContextParameters.TOPIC_FROM_URL);
+
+            if (topicLocalString != null) {
+
+                topicElString = "<wsnt:Topic "
+                        + "Dialect=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-Topics/TopicExpression/simple\" "
+                        + "xmlns:ns2=\"http://tutorial.globus.org/auction\" "
+                        + "xmlns:wsnt=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification\">" + "ns2:"
+                        + topicLocalString + "</wsnt:Topic>";
+                // / }
+                additionalMessageContent.setTopicElement(topicElString);
+            } else {
+
+                topicLocalString = "wseTopic";
+                topicElString = "<wsnt:Topic "
+                        + "Dialect=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-Topics/TopicExpression/simple\" "
+                        + "xmlns:ns2=\"http://tutorial.globus.org/auction\" "
+                        + "xmlns:wsnt=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification\">"
+                        + "ns2:wseTopic</wsnt:Topic>";
+                // / }
+                additionalMessageContent.setTopicElement(topicElString);
+            }
+        } else {
+
+            topicLocalString = BrokerUtil.getTopicLocalString(topicEl.getText());
+            try {
+                topicElString = topicEl.toStringWithConsume();
+            } catch (XMLStreamException e) {
+                logger.error("exceptions occured at WSE eventing notification creating", e);
+            }
+            additionalMessageContent.setTopicElement(topicElString);
+        }
+
+        OMElement messageEl = ctx.getSoapBody().getFirstElement();
+        if (messageEl == null) {
+            throw new AxisFault("no message found");
+        }
+
+        String message = null;
+        try {
+            message = messageEl.toStringWithConsume();
+        } catch (XMLStreamException e) {
+            logger.error("unable to serialize the message", e);
+            throw new AxisFault("unable to serialize the message", e);
+        }
+
+        matchAndSave(message, topicLocalString, additionalMessageContent);
+    }
+
+    /**
+     * @param ctx
+     * @param trackId
+     * @throws OMException
+     */
+    private void setResponseMsg(ProcessingContext ctx, String trackId, OMNamespace responseNS) throws OMException {
+        // set response message
+
+        ctx.addResponseMsgNameSpaces(responseNS);
+
+        OMAttribute trackIdAttribute = factory.createOMAttribute("trackId", null, trackId);
+        OMElement messageElement = ctx.getMessageContext().getEnvelope().getBody().getFirstElement();
+        OMElement responseMsgElement = factory.createOMElement(messageElement.getLocalName() + "Response", responseNS);
+        responseMsgElement.addAttribute(trackIdAttribute);
+        ctx.setRespMessage(responseMsgElement);
+
+    }
+
+    /**
+     * @param ctx
+     * @param topicLocalString
+     * @param topicElString
+     * @param producerReferenceElString
+     * @param additionalMessageContent
+     * @throws OMException
+     * @throws XMLStreamException
+     * @throws AxisFault
+     */
+    private void onWSNTMsg(ProcessingContext ctx, AdditionalMessageContent additionalMessageContent)
+            throws OMException, AxisFault {
+
+        String producerReferenceElString = null;
+        String topicElString = null;
+
+        boolean noElements = true;
+
+        // TODO: set nicely with a processing context
+        OMElement notifyEl = ctx.getSoapBody().getFirstElement();
+        for (Iterator<OMElement> iter = notifyEl.getChildrenWithLocalName("NotificationMessage"); iter.hasNext();) {
+            noElements = false;
+            OMElement wrappedMessageEl = iter.next();
+
+            String topicLocalString = null;
+
+            OMElement topicEl = wrappedMessageEl.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
+                    .getNamespaceURI(), "Topic"));
+            if (topicEl != null) {
+
+                topicLocalString = BrokerUtil.getTopicLocalString(topicEl.getText()); // get what ever inside this
+                                                                                      // element
+
+                try {
+                    topicElString = topicEl.toStringWithConsume();
+                } catch (XMLStreamException e) {
+                    logger.error("exception occured while creating NotificationConsumer", e);
+                }
+                additionalMessageContent.setTopicElement(topicElString);
+            }
+            OMElement producerReferenceEl = wrappedMessageEl.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
+                    .getNamespaceURI(), "ProducerReference"));
+
+            if (producerReferenceEl != null) {
+                try {
+                    producerReferenceElString = producerReferenceEl.toStringWithConsume();
+                } catch (XMLStreamException e) {
+                    logger.error("exception occured while creating notification consumer", e);
+
+                }
+                additionalMessageContent.setProducerReference(producerReferenceElString);
+            }
+
+            OMElement notificationMessageEl = wrappedMessageEl.getFirstChildWithName(
+                    new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(), "Message")).getFirstElement();
+
+            String message = null;
+            try {
+                message = notificationMessageEl.toStringWithConsume();
+            } catch (XMLStreamException e) {
+                logger.error("exception occured while creating notification consumer", e);
+                throw new AxisFault("unable to serialize the message", e);
+            }
+
+            matchAndSave(message, topicLocalString, additionalMessageContent);
+
+        }
+        if (noElements) {
+            throw new AxisFault("at least one element is required");
+        }
+    }
+
+    private void matchAndSave(String notificationMessage, String topicLocalString,
+            AdditionalMessageContent additionalMessageContent) {
+
+        List<ConsumerInfo> matchedConsumers = new LinkedList<ConsumerInfo>();
+
+        // not use incoming queue
+        // This is a fix for the bug seen in yfilter.
+        try {
+
+            for (AbstractMessageMatcher matcher : wsmgConfigContext.getMessageMatchers()) {
+                matcher.populateMatches(null, additionalMessageContent, notificationMessage, topicLocalString,
+                        matchedConsumers);
+            }
+
+            save(matchedConsumers, notificationMessage, additionalMessageContent);
+
+        } catch (RuntimeException e) {
+            logger.error("Caught RuntimeException", e);
+        }
+
+    }
+
+    public void save(List<ConsumerInfo> consumerInfoList, String message,
+            AdditionalMessageContent additionalMessageContent) {
+
+        if (consumerInfoList.size() == 0) // No subscription
+            return;
+
+        RunTimeStatistics.addNewNotificationMessageSize(message.length());
+        OutGoingMessage outGoingMessage = new OutGoingMessage();
+        outGoingMessage.setTextMessage(message);
+        outGoingMessage.setConsumerInfoList(consumerInfoList);
+        outGoingMessage.setAdditionalMessageContent(additionalMessageContent);
+
+        outgoingQueue.storeNotification(outGoingMessage, getNextMsgId());
+
+        if (WSMGParameter.showTrackId)
+            logger.info(additionalMessageContent.getTrackId() + ": putIn Outgoing queue.");
+    }
+
+    private void handleExtendedNotifications(ProcessingContext ctx, OMNamespace protocolNs) throws OMException {
+        // AMQP
+        amqpNotificationProcessor.notify(ctx, protocolNs);
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/amqp/AMQPNotificationProcessor.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/amqp/AMQPNotificationProcessor.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/amqp/AMQPNotificationProcessor.java
new file mode 100644
index 0000000..39970ec
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/amqp/AMQPNotificationProcessor.java
@@ -0,0 +1,132 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.amqp;
+
+import org.apache.airavata.common.utils.ApplicationSettings;
+import org.apache.airavata.wsmg.client.amqp.*;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
+import org.apache.axiom.om.OMNamespace;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
+
+import javax.xml.namespace.QName;
+
+/**
+ * AMQPNotificationProcessor handles AMQP-specific notification processing.
+ */
+public class AMQPNotificationProcessor {
+
+    private static final Logger logger = LoggerFactory.getLogger(AMQPNotificationProcessor.class);
+    
+    private boolean amqpEnabled = false;
+    private AMQPSender amqpSender = null;
+    private AMQPTopicSender amqpTopicSender = null;
+    private AMQPBroadcastSender amqpBroadcastSender = null;
+
+    public void init() {
+        String amqpEnabledAppSetting = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_ENABLE, "");
+        if (!amqpEnabledAppSetting.isEmpty() && (1 == Integer.parseInt(amqpEnabledAppSetting))) {
+            try {
+                String host = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_PROVIDER_HOST, "localhost");
+                String port = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_PROVIDER_PORT, "5672");
+                String username = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_PROVIDER_USERNAME, "guest");
+                String password = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_PROVIDER_PASSWORD, "guest");
+
+                Properties properties = new Properties();
+                properties.setProperty(AMQPUtil.CONFIG_AMQP_PROVIDER_HOST, host);
+                properties.setProperty(AMQPUtil.CONFIG_AMQP_PROVIDER_PORT, port);
+                properties.setProperty(AMQPUtil.CONFIG_AMQP_PROVIDER_USERNAME, username);
+                properties.setProperty(AMQPUtil.CONFIG_AMQP_PROVIDER_PASSWORD, password);
+
+                String className = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_SENDER, "");
+                Class clazz = Class.forName(className);
+                amqpSender = (AMQPSender)clazz.getDeclaredConstructor(Properties.class).newInstance(properties);
+
+                className = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_TOPIC_SENDER, "");
+                clazz = Class.forName(className);
+                amqpTopicSender = (AMQPTopicSender)clazz.getDeclaredConstructor(Properties.class).newInstance(properties);
+
+                className = ApplicationSettings.getSetting(AMQPUtil.CONFIG_AMQP_BROADCAST_SENDER, "");
+                clazz = Class.forName(className);
+                amqpBroadcastSender = (AMQPBroadcastSender)clazz.getDeclaredConstructor(Properties.class).newInstance(properties);
+
+                Element routingKeys = AMQPUtil.loadRoutingKeys();
+                if (routingKeys != null) {
+                    ((AMQPRoutingAwareClient)amqpSender).init(routingKeys);
+                    ((AMQPRoutingAwareClient)amqpTopicSender).init(routingKeys);
+                    ((AMQPRoutingAwareClient)amqpBroadcastSender).init(routingKeys);
+                }
+
+                amqpEnabled = true;
+            } catch (Exception ex) {
+                logger.error(ex.getMessage());
+            }
+        }
+    }
+
+    public void notify(ProcessingContext ctx, OMNamespace protocolNs) throws OMException {
+        if (amqpEnabled) {
+            // Extract messages
+            List<OMElement> messages = new ArrayList<OMElement>();
+            if (NameSpaceConstants.WSNT_NS.equals(protocolNs)) {
+                // WSNT
+                OMElement messageElements = ctx.getSoapBody().getFirstElement();
+                for (Iterator<OMElement> ite = messageElements.getChildrenWithLocalName("NotificationMessage"); ite.hasNext(); ) {
+                    try {
+                        OMElement messageElement = ite.next();
+                        OMElement message = messageElement.getFirstChildWithName(
+                                new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(), "Message")).getFirstElement();
+                        messages.add(message);
+                    } catch (NullPointerException e) {
+                        throw new OMException(e);
+                    }
+                }
+            } else {
+                // WSE
+                OMElement message = ctx.getSoapBody().getFirstElement();
+                if (message != null) {
+                    messages.add(message);
+                }
+            }
+
+            // Dispatch messages
+            try {
+                for (OMElement message : messages) {
+                    amqpBroadcastSender.Send(message);
+                    amqpTopicSender.Send(message);
+                    amqpSender.Send(message);
+                }
+            } catch (AMQPException e) {
+                logger.warn("Failed to send AMQP notification.[Reason=" + e.getMessage() + "]");
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameterInfo.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameterInfo.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameterInfo.java
new file mode 100644
index 0000000..8c097d4
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameterInfo.java
@@ -0,0 +1,58 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.context;
+
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+
+public class ContextParameterInfo<T> {
+
+    private Class<T> parameterType;
+    private String parameterName;
+
+    public ContextParameterInfo(Class<T> type, String name) {
+        parameterType = type;
+        parameterName = name;
+
+    }
+
+    public Class<T> getParameterType() {
+        return parameterType;
+    }
+
+    public String getParameterName() {
+        return parameterName;
+    }
+
+    public T cast(Object obj) {
+
+        return parameterType.cast(obj);
+    }
+
+    public static void main(String[] a) {
+
+        new ContextParameterInfo<OMElement>(OMElement.class, "test");
+        OMAbstractFactory.getOMFactory().createOMElement("testtest", null);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameters.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameters.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameters.java
new file mode 100644
index 0000000..61624d8
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ContextParameters.java
@@ -0,0 +1,72 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.context;
+
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.addressing.EndpointReference;
+
+public class ContextParameters {
+
+    private static <V> ContextParameterInfo<V> createParam(Class<V> c, String name) {
+        ContextParameterInfo<V> info = new ContextParameterInfo<V>(c, name);
+
+        return info;
+    }
+
+    public static ContextParameterInfo<String> RESOURCE_ID = createParam(String.class, "resourceID");
+
+    public static final ContextParameterInfo<String> SUB_ID = createParam(String.class, "subID");
+
+    public static final ContextParameterInfo<String> TOPIC_FROM_URL = createParam(String.class, "topicFromUrl");
+
+    public static final ContextParameterInfo<String> SOAP_ACTION = createParam(String.class, "soapAction");
+
+    public static final ContextParameterInfo<SubscriptionState> SUBSCRIPTION = createParam(SubscriptionState.class,
+            "subscription");
+
+    public static final ContextParameterInfo<String> SUBSCRIBER_EXPIRES = createParam(String.class, "subscriberExpires");
+
+    public ContextParameterInfo<String> USE_NOTIFY_TEXT = createParam(String.class, "useNotifyText");
+
+    public static final ContextParameterInfo<OMElement> USE_NOTIFY_ELEMENT = createParam(OMElement.class, "useNotifyEl");
+
+    public static final ContextParameterInfo<OMElement> NOTIFY_TO_ELEMENT = createParam(OMElement.class, "NotifyTo");
+
+    public static final ContextParameterInfo<EndpointReference> NOTIFY_TO_EPR = createParam(EndpointReference.class,
+            "NotifyToEPR");
+
+    public static final ContextParameterInfo<OMElement> SUB_POLICY = createParam(OMElement.class, "subPolicy");
+
+    public static final ContextParameterInfo<OMElement> FILTER_ELEMENT = createParam(OMElement.class, "filterElement");
+
+    public static final ContextParameterInfo<OMElement> TOPIC_EXPRESSION_ELEMENT = createParam(OMElement.class,
+            "topicExpressionEl");
+
+    public static final ContextParameterInfo<OMElement> XPATH_ELEMENT = createParam(OMElement.class, "xpathEl");
+
+    public static final ContextParameterInfo<OMElement> SUBSCRIBE_ELEMENT = createParam(OMElement.class, "subscribeElement");
+
+    public static final ContextParameterInfo<EndpointReference> SUBSCRIBE_ELEMENT_EPR = createParam(EndpointReference.class,
+            "subscribeElement");
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContext.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContext.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContext.java
new file mode 100644
index 0000000..06a50ca
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContext.java
@@ -0,0 +1,114 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.context;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.context.MessageContext;
+
+public class ProcessingContext {
+
+    private Map<ContextParameterInfo<? extends Object>, Object> contextInfo = new HashMap<ContextParameterInfo<? extends Object>, Object>();
+
+    private List<OMNamespace> responseMsgNameSpaces;
+
+    private MessageContext messageContext = null;
+
+    private SOAPEnvelope envelope; // Used for WSe notification messages.topics
+    // are
+    // in header.
+
+    private OMElement respMessage;
+
+    private SubscriptionState subscription = null;
+
+    public SOAPEnvelope getEnvelope() {
+        return envelope;
+    }
+
+    public void setEnvelope(SOAPEnvelope envelope) {
+        this.envelope = envelope;
+    }
+
+    public SOAPBody getSoapBody() {
+
+        return envelope.getBody();
+    }
+
+    public OMElement getRespMessage() {
+        return respMessage;
+    }
+
+    public void setRespMessage(OMElement respMessage) {
+        this.respMessage = respMessage;
+    }
+
+    public SubscriptionState getSubscription() {
+        return subscription;
+    }
+
+    public void setSubscription(SubscriptionState subscription) {
+        this.subscription = subscription;
+    }
+
+    public void setMessageConext(MessageContext msgContext) {
+        this.messageContext = msgContext;
+    }
+
+    public MessageContext getMessageContext() {
+        return messageContext;
+    }
+
+    public void addResponseMsgNameSpaces(OMNamespace ns) {
+
+        if (responseMsgNameSpaces == null) {
+            responseMsgNameSpaces = new ArrayList<OMNamespace>();
+        }
+
+        if (!responseMsgNameSpaces.contains(ns)) {
+            responseMsgNameSpaces.add(ns);
+        }
+    }
+
+    public List<OMNamespace> getResponseMsgNamespaces() {
+        return responseMsgNameSpaces;
+    }
+
+    public void setContextParameter(ContextParameterInfo<?> name, Object value) {
+        contextInfo.put(name, value);
+    }
+
+    public <T> T getContextParameter(ContextParameterInfo<T> name) {
+
+        Object o = contextInfo.get(name);
+        return name.cast(o);
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextBuilder.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextBuilder.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextBuilder.java
new file mode 100644
index 0000000..9d4d4ea
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/context/ProcessingContextBuilder.java
@@ -0,0 +1,30 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.context;
+
+import org.apache.axiom.om.OMElement;
+
+public abstract class ProcessingContextBuilder {
+
+    public abstract ProcessingContext build(OMElement elem);
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/handler/PublishedMessageHandler.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/handler/PublishedMessageHandler.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/handler/PublishedMessageHandler.java
new file mode 100644
index 0000000..ca23506
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/handler/PublishedMessageHandler.java
@@ -0,0 +1,120 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.handler;
+
+import java.util.List;
+
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.AddressingFaultsHelper;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.dispatchers.AddressingBasedDispatcher;
+import org.apache.axis2.engine.Phase;
+import org.apache.axis2.util.JavaUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class PublishedMessageHandler extends AddressingBasedDispatcher {
+
+    private static final Logger logger = LoggerFactory.getLogger(PublishedMessageHandler.class);
+
+    private static final String ADDRESSING_VALIDATE_ACTION = "addressing.validateAction";
+
+    private AxisOperation publishOperation = null;
+
+    private Phase addressingPhase = null;
+
+    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
+
+        InvocationResponse response = InvocationResponse.CONTINUE;
+
+        if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null) {
+            boolean validateAction = JavaUtils.isTrue(msgContext.getProperty(ADDRESSING_VALIDATE_ACTION), true);
+            msgContext.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false));
+            response = super.invoke(msgContext);
+            if (isForBrokerEventingService(msgContext))
+                validateBrokerWSEventingOperation(msgContext);
+            if (validateAction)
+                checkAction(msgContext);
+            msgContext.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(validateAction));
+
+        }
+
+        return response;
+    }
+
+    private void validateBrokerWSEventingOperation(MessageContext msgContext) {
+        if (msgContext.getAxisOperation() == null) {
+            AxisService service = msgContext.getAxisService();
+            AxisOperation pubOperation = getPublishOperation(service);
+            msgContext.setAxisOperation(pubOperation);
+        }
+    }
+
+    private boolean isForBrokerEventingService(MessageContext msgContext) {
+        return msgContext.getAxisService() != null && msgContext.getAxisService().getName().equals("EventingService");
+    }
+
+    private AxisOperation getPublishOperation(AxisService publisherService) {
+        if (publishOperation == null)
+            publishOperation = publisherService.getOperationBySOAPAction(WsmgCommonConstants.WSMG_PUBLISH_SOAP_ACTION);
+        return publishOperation;
+    }
+
+    private Phase getAddressingPhase(MessageContext context) {
+
+        if (addressingPhase == null) {
+
+            List<Phase> inFlowPhases = context.getConfigurationContext().getAxisConfiguration().getPhasesInfo()
+                    .getINPhases();
+
+            for (Phase p : inFlowPhases) {
+                if (p.getName().equalsIgnoreCase("Addressing")) {
+                    addressingPhase = p;
+                }
+            }
+
+        }
+
+        return addressingPhase;
+
+    }
+
+    private void checkAction(MessageContext msgContext) throws AxisFault {
+
+        Phase addPhase = getAddressingPhase(msgContext);
+
+        if (addPhase == null) {
+            logger.error("unable to locate addressing phase object");
+        }
+        if (msgContext != null) {
+            if (msgContext.getCurrentPhaseIndex() + 1 == addPhase.getHandlerCount()) {
+                if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null)
+                    AddressingFaultsHelper.triggerActionNotSupportedFault(msgContext, msgContext.getWSAAction());
+            }
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/CleanupThread.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/CleanupThread.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/CleanupThread.java
new file mode 100644
index 0000000..bcd4ec1
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/CleanupThread.java
@@ -0,0 +1,148 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.subscription;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import org.apache.airavata.wsmg.commons.CommonRoutines;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.apache.axis2.AxisFault;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+class CleanUpThread implements Runnable {
+
+    private static final Logger logger = LoggerFactory.getLogger(CleanUpThread.class);
+
+    private SubscriptionManager subMan;
+
+    public CleanUpThread(SubscriptionManager manager) {
+        this.subMan = manager;
+    }
+
+    public void run() {
+        logger.debug("CleanUpThread started");
+        String key = null;
+        SubscriptionState subscription = null;
+        Set<String> keySet = null;
+        // long expirationTime=300000*12*24; //5 min*12*24=1 day
+        final long expirationTime = WSMGParameter.expirationTime;
+        final long skipCheckInterval = 1000 * 60 * 10; // 10 minutes
+        final long checkupInterval = 1000 * 60 * 5; // 5 minutes
+        int MAX_TRY = 3;
+        logger.info("Starting Subscription Cleaning up Thread.");
+        while (true) {
+            long currentTime = System.currentTimeMillis();
+            long expiredStartTime = 0;
+            if (WSMGParameter.requireSubscriptionRenew) {
+                expiredStartTime = currentTime - expirationTime; // expired
+            }
+            long availabilityCheckTime = 0;
+            availabilityCheckTime = currentTime - skipCheckInterval; // It's
+            // time
+            // to
+            // check
+            // again
+
+            // logger.finest("CleanUpThread loop");
+            keySet = subMan.getShallowSubscriptionsCopy().keySet();
+            // Go through all the subscriptions and delete expired ones
+            for (Iterator<String> iterator = keySet.iterator(); iterator.hasNext();) {
+                key = iterator.next();
+                subscription = subMan.getShallowSubscriptionsCopy().get(key);
+                if (subscription.isNeverExpire()) {
+                    continue;
+                }
+                long subscriptionCreationTime = subscription.getCreationTime();
+                long lastAvailableTime = subscription.getLastAvailableTime();
+                if (WSMGParameter.requireSubscriptionRenew) { // expired
+                    if (subscriptionCreationTime < expiredStartTime) { // expired
+                        // or
+                        // need
+                        // to
+                        // check
+                        // again
+                        try {
+                            subMan.removeSubscription(key);
+                        } catch (AxisFault e) {
+                            logger.error(e.getMessage(), e);
+                        }
+                        // Not need to remove the key from the keyset since
+                        // the keyset
+                        // "is backed by the map, so changes to the map are reflected in the set, and vice-versa."
+                        // i.remove(); //add this will cause
+                        // ConcurrentModificationException
+                        logger.info("*****Deleted (expiration)" + key + "-->" + subscription.getConsumerIPAddressStr()
+                                + "##" + subscription.getLocalTopic());
+                        logger.info("*****Deleted (expiration)" + key + "-->" + subscription.getConsumerIPAddressStr()
+                                + "##" + subscription.getLocalTopic());
+                        continue;
+                    }
+                }
+                if (lastAvailableTime < availabilityCheckTime) {
+                    // It's time to check again
+                    if (CommonRoutines.isAvailable(subscription.getConsumerAddressURI())) {
+                        // It's time to check but still available and do not
+                        // require subscriptio renew
+                        // set a mark saying it has been check at this time
+                        subscription.setLastAvailableTime(currentTime);
+                        if (subscription.getUnAvailableCounter() > 0) { // failed
+                            // in
+                            // previous
+                            // try
+                            subscription.resetUnAvailableCounter();
+                        }
+                    } else {
+                        int counter = subscription.addUnAvailableCounter();
+                        // System.out.println("UnavailableCounter="+counter);
+                        // logger.finest("UnavailableCounter="+counter);
+                        if (counter > MAX_TRY) {
+                            try {
+                                subMan.removeSubscription(key);
+                            } catch (AxisFault e) {
+                                // TODO Auto-generated catch block
+                                logger.error(e.getMessage(), e);
+                            }
+
+                            // Remove from hashtable seperately to avoid
+                            // conccurent access problem to the hashtable
+                            // with
+                            // i.next()
+                            iterator.remove();
+                            logger.info("*****Deleted (unavailable)" + key + "-->"
+                                    + subscription.getConsumerIPAddressStr() + "##" + subscription.getLocalTopic());
+                            logger.info("*****Deleted (unavailable)" + key + "-->"
+                                    + subscription.getConsumerIPAddressStr() + "##" + subscription.getLocalTopic());
+                        }
+                    }
+                }
+            }
+            try {
+                Thread.sleep(checkupInterval);
+            } catch (InterruptedException e) {
+                logger.error("thread was interrupped", e);
+            }
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionEntry.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionEntry.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionEntry.java
new file mode 100644
index 0000000..a9339fd
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionEntry.java
@@ -0,0 +1,49 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.subscription;
+
+public class SubscriptionEntry {
+
+    private String subscriptionId;
+
+    private String subscribeXml;
+
+    public SubscriptionEntry() {
+    }
+
+    public String getSubscriptionId() {
+        return subscriptionId;
+    }
+
+    public String getSubscribeXml() {
+        return subscribeXml;
+    }
+
+    public void setSubscriptionId(String subscriptionId) {
+        this.subscriptionId = subscriptionId;
+    }
+
+    public void setSubscribeXml(String subscribeXml) {
+        this.subscribeXml = subscribeXml;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionManager.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionManager.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionManager.java
new file mode 100644
index 0000000..e42e4c1
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionManager.java
@@ -0,0 +1,440 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.subscription;
+
+import java.io.StringReader;
+import java.util.AbstractMap;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.airavata.wsmg.broker.context.ContextParameters;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.broker.context.ProcessingContextBuilder;
+import org.apache.airavata.wsmg.broker.wseventing.WSEProcessingContextBuilder;
+import org.apache.airavata.wsmg.broker.wseventing.WSEProtocolSupport;
+import org.apache.airavata.wsmg.broker.wsnotification.WSNTProtocolSupport;
+import org.apache.airavata.wsmg.broker.wsnotification.WSNotificationProcessingContextBuilder;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.commons.storage.WsmgStorage;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
+import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
+import org.apache.airavata.wsmg.messenger.OutGoingQueue;
+import org.apache.airavata.wsmg.util.RunTimeStatistics;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axis2.AxisFault;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Manages subscribers.
+ * 
+ */
+public class SubscriptionManager {
+
+    private static final Logger log = LoggerFactory.getLogger(SubscriptionManager.class);
+
+    private HashMap<String, SubscriptionState> subscriptions = new HashMap<String, SubscriptionState>();
+
+    private ReentrantReadWriteLock subscriptionLock = new ReentrantReadWriteLock();
+
+    private WSEProtocolSupport wseProtocalSupport = new WSEProtocolSupport();
+
+    private WSNTProtocolSupport wsntProtocolSupport = new WSNTProtocolSupport();
+
+    private WsmgStorage subscriptionDB;
+
+    private WsmgConfigurationContext wsmgConfig;
+
+    private OutGoingQueue outGoingQueue;
+
+    private int counter = 1;
+
+    public SubscriptionManager(WsmgConfigurationContext paramters, WsmgStorage storage) {
+        init(paramters, storage);
+    }
+
+    private void init(WsmgConfigurationContext parameters, WsmgStorage storage) {
+
+        this.wsmgConfig = parameters;
+
+        subscriptionDB = storage;
+        outGoingQueue = parameters.getOutgoingQueue();
+        if (WSMGParameter.enableAutoCleanSubscriptions) {
+            CleanUpThread cleanUpThread = new CleanUpThread(this);
+            Thread t = new Thread(cleanUpThread);
+            t.start();
+        }
+
+        try {
+            checkSubscriptionDB(storage);
+        } catch (AxisFault e) {
+            log.error("Subscription database has malformed" + " subscriptions. Ignoring them.", e);
+
+        }
+
+    }
+
+    /**
+     * @return Returns the subscriptions.
+     */
+    public AbstractMap<String, SubscriptionState> getShallowSubscriptionsCopy() {
+
+        AbstractMap<String, SubscriptionState> ret = null;
+        readLockUnlockSubscriptions(true);
+        try {
+            ret = new HashMap<String, SubscriptionState>(subscriptions);
+        } finally {
+            readLockUnlockSubscriptions(false);
+        }
+
+        return ret;
+
+    }
+
+    public void subscribe(ProcessingContext ctx) throws AxisFault {
+
+        String subId = createSubscription(null, ctx);
+        if (subId == null) {
+            log.error("ERROR: No subscription created");
+            return;
+        }
+
+        if (NameSpaceConstants.WSE_NS.equals(ctx.getContextParameter(ContextParameters.SUBSCRIBE_ELEMENT)
+                .getNamespace())) {
+            wseProtocalSupport.createSubscribeResponse(ctx, subId);
+
+        } else { // WSNT
+
+            wsntProtocolSupport.createSubscribeResponse(ctx, subId);
+        }
+    }
+
+    /**
+     * @param subscriptionId
+     *            this is the ID that is in the SOAP header
+     * @param ctx
+     *            contexts constructed with the body elements
+     * @return subscription id
+     * @throws AxisFault
+     */
+    private String createSubscription(String subscriptionId, ProcessingContext ctx) throws AxisFault {
+
+        SubscriptionState state = null;
+        String key = null;
+
+        // get the first element element inside the soap body element and check
+        // whether namespace is WSE
+        if (NameSpaceConstants.WSE_NS.equals(ctx.getContextParameter(ContextParameters.SUBSCRIBE_ELEMENT)
+                .getNamespace())) {
+            state = wseProtocalSupport.createSubscriptionState(ctx, outGoingQueue);
+        } else { // Handle WSNT
+
+            state = wsntProtocolSupport.createSubscriptionState(ctx, outGoingQueue);
+        }
+
+        if (subscriptionId == null) { // New subscription entry
+            key = checkSubscriptionExist(state);
+            if (key != null) { // just renew previous subscriptions
+                return key;
+            }
+            // new subscriptions
+
+            state.setCreationTime(System.currentTimeMillis());
+
+            key = generateSubscriptionId(state.getXpathString() != null && state.getXpathString().length() > 0);
+
+        } else { // Startup from previous subscription database
+            key = subscriptionId;
+        }
+
+        for (AbstractMessageMatcher m : wsmgConfig.getMessageMatchers()) {
+            m.handleSubscribe(state, key);
+        }
+
+        if (subscriptionId == null) { // New subscription entry,
+
+            RunTimeStatistics.totalSubscriptions++;
+            try {
+                String subscribeXml = ctx.getContextParameter(ContextParameters.SUBSCRIBE_ELEMENT)
+                        .toStringWithConsume();
+
+                state.setId(key);
+                state.setSubscribeXml(subscribeXml);
+                subscriptionDB.insert(state);
+
+            } catch (Exception ex) {
+                log.error("unable to insert subscription to database", ex);
+                throw new AxisFault("unable to insert subscription to database ", ex);
+            }
+        }
+
+        addToSubscriptionMap(key, state);
+        return key;
+    }
+
+    private void addToSubscriptionMap(String key, SubscriptionState state) {
+
+        writeLockUnlockSubscription(true);
+        try {
+            subscriptions.put(key, state);
+        } finally {
+            writeLockUnlockSubscription(false);
+        }
+
+    }
+
+    /**
+     * @param xpathString
+     * @return
+     */
+    private String generateSubscriptionId(boolean xPath) {
+        String key;
+        String subIdPrefix = null; // Used to indicate weather a subscription
+        // has an XPath subscription Or Topic
+        // only.
+        if (!xPath) {
+            subIdPrefix = "T";
+        } else {
+            subIdPrefix = "X";
+        }
+        key = subIdPrefix + "sub" + (counter++) + "@" + WsmgCommonConstants.PREFIX;
+        return key;
+    }
+
+    /**
+     * if find the subscription already exists, return the current subscriptionId else return null;
+     */
+
+    public String checkSubscriptionExist(SubscriptionState state) {
+
+        String key = null;
+
+        readLockUnlockSubscriptions(true);
+        try {
+
+            for (Iterator<String> keyIterator = subscriptions.keySet().iterator(); keyIterator.hasNext();) {
+
+                String currentKey = keyIterator.next();
+                SubscriptionState value = subscriptions.get(currentKey);
+
+                if (value.equals(state)) {
+                    value.setCreationTime(System.currentTimeMillis());
+                    log.info("Subscription Already exists." + " Using the current subscriptionId");
+                    key = currentKey;
+                    break;
+                }
+
+            }
+
+        } finally {
+            readLockUnlockSubscriptions(false);
+        }
+
+        return key;
+    }
+
+    public void checkSubscriptionDB(WsmgStorage storage) throws AxisFault {
+        OMElement subscribeXmlElement;
+        String subscriptionId;
+        // Read subscription Info from Subscription DB
+        List<SubscriptionEntry> subscriptionEntry = storage.getAllSubscription();
+        if (subscriptionEntry == null) {
+            return;
+        }
+
+        WSNotificationProcessingContextBuilder wsntBuilder = new WSNotificationProcessingContextBuilder();
+        WSEProcessingContextBuilder wseBuilder = new WSEProcessingContextBuilder();
+
+        // Create subscription for these entries from DB
+        for (int i = 0; i < subscriptionEntry.size(); i++) {
+
+            ProcessingContextBuilder processingCtxBuilder = null;
+
+            log.info("Subscription No. " + i + " is " + subscriptionEntry.get(i).getSubscriptionId());
+
+            StringReader sr = new StringReader(subscriptionEntry.get(i).getSubscribeXml());
+            XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+            XMLStreamReader inflow;
+            try {
+                inflow = inputFactory.createXMLStreamReader(sr);
+
+                StAXOMBuilder builder = new StAXOMBuilder(inflow); // get the
+                // root
+                // element (in
+                // this case the
+                // envelope)
+                subscribeXmlElement = builder.getDocumentElement();
+
+                if (subscribeXmlElement.getNamespace().getNamespaceURI()
+                        .equals(NameSpaceConstants.WSNT_NS.getNamespaceURI())) {
+                    processingCtxBuilder = wsntBuilder;
+
+                } else {
+                    processingCtxBuilder = wseBuilder;
+                }
+
+                subscriptionId = subscriptionEntry.get(i).getSubscriptionId();
+
+                ProcessingContext context = processingCtxBuilder.build(subscribeXmlElement);
+                createSubscription(subscriptionId, context);
+
+            } catch (XMLStreamException e) {
+                log.error("error occured while checking subscription db", e);
+            }
+        }
+        RunTimeStatistics.totalSubscriptionsAtStartUp += subscriptionEntry.size();
+    }
+
+    // This is used for debug
+    public void showAllSubscription() {
+        String key = null;
+        SubscriptionState value = null;
+        Set<String> keySet = subscriptions.keySet();
+        log.info("List of all subscriptions:");
+        for (Iterator<String> iterator = keySet.iterator(); iterator.hasNext();) {
+            key = iterator.next();
+            value = subscriptions.get(key);
+            log.info("******" + key + "-->" + value.getConsumerIPAddressStr() + "##" + value.getLocalTopic());
+        }
+    }
+
+    public int unsubscribe(ProcessingContext ctx) throws AxisFault {
+
+        String subscriptionId = ctx.getContextParameter(ContextParameters.SUB_ID);
+        if (subscriptionId == null || subscriptionId.trim().length() == 0) {
+            throw new AxisFault("subscription identifier is not provided");
+        }
+
+        removeSubscription(subscriptionId);
+        RunTimeStatistics.totalUnSubscriptions++;
+        return 0;
+    }
+
+    int removeSubscription(String subId) throws AxisFault {
+
+        SubscriptionState subscription = null;
+
+        writeLockUnlockSubscription(true);
+        try {
+            subscription = subscriptions.remove(subId);
+        } finally {
+            writeLockUnlockSubscription(false);
+        }
+
+        if (subscription == null) {
+            throw AxisFault.makeFault(new RuntimeException("unknown subscription: " + subId));
+
+        }
+
+        subscriptionDB.delete(subId);
+
+        for (AbstractMessageMatcher mm : wsmgConfig.getMessageMatchers()) {
+            mm.handleUnsubscribe(subId);
+        }
+
+        return 0;
+    }
+
+    public void resumeSubscription(ProcessingContext ctx) throws AxisFault {
+
+        String subscriptionId = ctx.getContextParameter(ContextParameters.SUB_ID);
+
+        if (subscriptionId == null) {
+            throw AxisFault.makeFault(new RuntimeException("missing subscription id"));
+        }
+
+        writeLockUnlockSubscription(true);// lock
+        try {
+            SubscriptionState subscription = subscriptions.get(subscriptionId);
+
+            if (subscription == null) {
+
+                throw AxisFault.makeFault(new RuntimeException("no subscription found for id: " + subscriptionId));
+            }
+
+            subscription.resume();
+        } finally {
+            // this will execute even exception is thrown.
+            writeLockUnlockSubscription(false);
+        }
+    }
+
+    public void pauseSubscription(ProcessingContext ctx) throws AxisFault {
+
+        String subscriptionId = ctx.getContextParameter(ContextParameters.SUB_ID);
+
+        if (subscriptionId == null) {
+            throw AxisFault.makeFault(new RuntimeException("missing subscription id"));
+        }
+
+        writeLockUnlockSubscription(true);// read lock should be sufficient
+        // (since we are not modifying the
+        // map)
+        try {
+            SubscriptionState subscription = subscriptions.get(subscriptionId);
+
+            if (subscription == null) {
+
+                throw AxisFault.makeFault(new RuntimeException("no subscription found for id: " + subscriptionId));
+
+            }
+
+            subscription.pause();
+        } finally {
+            // this will execute even exception is thrown.
+            writeLockUnlockSubscription(false);
+        }
+    }
+
+    public void readLockUnlockSubscriptions(boolean lock) {
+        ReadLock readlock = subscriptionLock.readLock();
+        lockUnlock(readlock, lock);
+    }
+
+    public void writeLockUnlockSubscription(boolean lock) {
+        WriteLock writeLock = subscriptionLock.writeLock();
+        lockUnlock(writeLock, lock);
+    }
+
+    private void lockUnlock(Lock l, boolean lock) {
+
+        if (lock) {
+            l.lock();
+        } else {
+            l.unlock();
+        }
+
+    }
+}


[36/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/DescriptorUtil.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/DescriptorUtil.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/DescriptorUtil.java
deleted file mode 100644
index aa4595f..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/DescriptorUtil.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.utils;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.rest.mappings.resourcemappings.ApplicationDescriptor;
-import org.apache.airavata.rest.mappings.resourcemappings.HostDescriptor;
-import org.apache.airavata.rest.mappings.resourcemappings.ServiceDescriptor;
-import org.apache.airavata.rest.mappings.resourcemappings.ServiceParameters;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.schemas.gfac.Ec2ApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.Ec2HostType;
-import org.apache.airavata.schemas.gfac.GlobusHostType;
-import org.apache.airavata.schemas.gfac.GsisshHostType;
-import org.apache.airavata.schemas.gfac.HostDescriptionType;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.InputParameterType;
-import org.apache.airavata.schemas.gfac.JobTypeType;
-import org.apache.airavata.schemas.gfac.NameValuePairType;
-import org.apache.airavata.schemas.gfac.OutputParameterType;
-import org.apache.airavata.schemas.gfac.ParameterType;
-import org.apache.airavata.schemas.gfac.ProjectAccountType;
-import org.apache.airavata.schemas.gfac.QueueType;
-import org.apache.airavata.schemas.gfac.SSHHostType;
-import org.apache.airavata.schemas.gfac.UnicoreHostType;
-
-public class DescriptorUtil {
-
-    public static HostDescription createHostDescription(String hostName, String hostAddress,
-                                                        String hostEndpoint, String gatekeeperEndpoint, String providerType) {
-        HostDescription host = new HostDescription();
-        host.getType().setHostName(hostName);
-        host.getType().setHostAddress(hostAddress);
-        if(providerType.equalsIgnoreCase(HostTypes.GLOBUS_HOST_TYPE)){
-        	 host.getType().changeType(GlobusHostType.type);
-             ((GlobusHostType) host.getType()).
-                     setGridFTPEndPointArray(new String[]{hostEndpoint});
-             ((GlobusHostType) host.getType()).
-                     setGlobusGateKeeperEndPointArray(new String[]{gatekeeperEndpoint});
-        }else if (providerType.equalsIgnoreCase(HostTypes.SSH_HOST_TYPE)){
-          	 host.getType().changeType(SSHHostType.type);
-        }else if (providerType.equalsIgnoreCase(HostTypes.UNICORE_HOST_TYPE)){
-        	 host.getType().changeType(GlobusHostType.type);
-             ((UnicoreHostType) host.getType()).
-                     setGridFTPEndPointArray(new String[]{hostEndpoint});
-             ((UnicoreHostType) host.getType()).
-                     setUnicoreBESEndPointArray(new String[]{gatekeeperEndpoint});
-        }
-        return host;
-    }
-
-    public static ApplicationDescription registerApplication(String appName, String exeuctableLocation, String scratchWorkingDirectory, String hostName,
-                                                                       String projAccNumber, String queueName, String cpuCount, String nodeCount, String maxMemory) throws Exception {
-        // Create Application Description
-        ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
-        HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
-        app.setCpuCount(Integer.parseInt(cpuCount));
-        app.setNodeCount(Integer.parseInt(nodeCount));
-        ApplicationDeploymentDescriptionType.ApplicationName name = appDesc.getType().addNewApplicationName();
-        name.setStringValue(appName);
-        app.setExecutableLocation(exeuctableLocation);
-        app.setScratchWorkingDirectory(scratchWorkingDirectory);
-        ProjectAccountType projectAccountType = ((HpcApplicationDeploymentType) appDesc.getType()).addNewProjectAccount();
-        projectAccountType.setProjectAccountNumber(projAccNumber);
-        QueueType queueType = app.addNewQueue();
-        queueType.setQueueName(queueName);
-        app.setMaxMemory(Integer.parseInt(maxMemory));
-        return appDesc;
-    }
-
-    public static ServiceDescription getServiceDescription(String serviceName, String inputName, String inputType,
-                                                           String outputName, String outputType) {
-        // Create Service Description
-        ServiceDescription serv = new ServiceDescription();
-        serv.getType().setName(serviceName);
-
-        InputParameterType input = InputParameterType.Factory.newInstance();
-        input.setParameterName(inputName);
-        ParameterType parameterType = input.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString(inputType));
-        parameterType.setName(inputName);
-        List<InputParameterType> inputList = new ArrayList<InputParameterType>();
-        inputList.add(input);
-        InputParameterType[] inputParamList = inputList.toArray(new InputParameterType[inputList
-                .size()]);
-
-        OutputParameterType output = OutputParameterType.Factory.newInstance();
-        output.setParameterName(outputName);
-        ParameterType parameterType1 = output.addNewParameterType();
-        parameterType1.setType(DataType.Enum.forString(outputType));
-        parameterType1.setName(outputName);
-        List<OutputParameterType> outputList = new ArrayList<OutputParameterType>();
-        outputList.add(output);
-        OutputParameterType[] outputParamList = outputList
-                .toArray(new OutputParameterType[outputList.size()]);
-        serv.getType().setInputParametersArray(inputParamList);
-        serv.getType().setOutputParametersArray(outputParamList);
-        return serv;
-    }
-
-
-    public static HostDescriptor createHostDescriptor (HostDescription hostDescription){
-        List<String> hostType = new ArrayList<String>();
-        List<String> gridFTPEndPoint = new ArrayList<String>();
-        List<String> gateKeeperEndPoint  = new ArrayList<String>();
-        List<String> imageID  = new ArrayList<String>();
-        List<String> instanceID  = new ArrayList<String>();
-
-        HostDescriptor hostDescriptor = new HostDescriptor();
-        hostDescriptor.setHostname(hostDescription.getType().getHostName());
-        hostDescriptor.setHostAddress(hostDescription.getType().getHostAddress());
-
-        HostDescriptionType hostDescriptionType = hostDescription.getType();
-        if (hostDescriptionType instanceof GlobusHostType){
-            GlobusHostType globusHostType = (GlobusHostType) hostDescriptionType;
-            hostType.add(HostTypes.GLOBUS_HOST_TYPE);
-            String[] globusGateKeeperEndPointArray = globusHostType.getGlobusGateKeeperEndPointArray();
-            for (int i = 0; i < globusGateKeeperEndPointArray.length ; i++){
-                gateKeeperEndPoint.add(globusGateKeeperEndPointArray[i]);
-            }
-
-            String[] gridFTPEndPointArray = globusHostType.getGridFTPEndPointArray();
-            for (int i = 0; i < gridFTPEndPointArray.length ; i++){
-                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
-            }
-        }else if (hostDescriptionType instanceof GsisshHostType) {
-            hostType.add(HostTypes.GSISSH_HOST_TYPE);
-        } else if (hostDescriptionType instanceof SSHHostType) {
-            hostType.add(HostTypes.SSH_HOST_TYPE);
-            SSHHostType sshHostType = (SSHHostType) hostDescriptionType;
-            hostDescriptor.setHpcResource(sshHostType.getHpcResource());
-        } else if (hostDescriptionType instanceof UnicoreHostType) {
-            UnicoreHostType unicoreHostType = (UnicoreHostType) hostDescriptionType;
-            hostType.add(HostTypes.UNICORE_HOST_TYPE);
-            String[] unicoreGateKeeperEndPointArray = unicoreHostType.getUnicoreBESEndPointArray();
-            for (int i = 0; i < unicoreGateKeeperEndPointArray.length; i++) {
-                gateKeeperEndPoint.add(unicoreGateKeeperEndPointArray[i]);
-            }
-
-            String[] gridFTPEndPointArray = unicoreHostType.getGridFTPEndPointArray();
-            for (int i = 0; i < gridFTPEndPointArray.length; i++) {
-                gridFTPEndPoint.add(gridFTPEndPointArray[i]);
-            }
-        } else if (hostDescriptionType instanceof Ec2HostType) {
-            hostType.add(HostTypes.EC2_HOST_TYPE);
-        } else {
-            hostType.add(HostTypes.HOST_DESCRIPTION_TYPE);
-        }
-        hostDescriptor.setGateKeeperEndPoint(gateKeeperEndPoint);
-        hostDescriptor.setGridFTPEndPoint(gridFTPEndPoint);
-        hostDescriptor.setImageID(imageID);
-        hostDescriptor.setInstanceID(instanceID);
-        hostDescriptor.setHostType(hostType);
-        return hostDescriptor;
-    }
-
-    public static HostDescription createHostDescription (HostDescriptor hostDescriptor){
-        HostDescription hostDescription = new HostDescription(HostDescriptionType.type);
-        hostDescription.getType().setHostAddress(hostDescriptor.getHostAddress());
-        hostDescription.getType().setHostName(hostDescriptor.getHostname());
-
-        if (hostDescriptor.getHostType() != null && !hostDescriptor.getHostType().isEmpty()) {
-            if (hostDescriptor.getHostType().get(0).equals(HostTypes.GLOBUS_HOST_TYPE)) {
-                hostDescription.getType().changeType(GlobusHostType.type);
-                if (!hostDescriptor.getGateKeeperEndPoint().isEmpty() && hostDescriptor.getGateKeeperEndPoint() != null){
-                    ((GlobusHostType) hostDescription.getType()).addGlobusGateKeeperEndPoint(hostDescriptor.getGateKeeperEndPoint().get(0));
-                }
-                if (!hostDescriptor.getGridFTPEndPoint().isEmpty() && hostDescriptor.getGridFTPEndPoint() != null){
-                    ((GlobusHostType) hostDescription.getType()).addGridFTPEndPoint(hostDescriptor.getGridFTPEndPoint().get(0));
-                }
-
-            } else if (hostDescriptor.getHostType().get(0).equals(HostTypes.GSISSH_HOST_TYPE)) {
-                hostDescription.getType().changeType(GsisshHostType.type);
-            } else if (hostDescriptor.getHostType().get(0).equals(HostTypes.EC2_HOST_TYPE)) {
-                hostDescription.getType().changeType(Ec2HostType.type);
-                if (!hostDescriptor.getImageID().isEmpty() && hostDescriptor.getImageID() != null ){
-                    ((Ec2HostType) hostDescription).addImageID(hostDescriptor.getImageID().get(0));
-                }
-                if (!hostDescriptor.getInstanceID().isEmpty() && hostDescriptor.getInstanceID() != null){
-                    ((Ec2HostType) hostDescription).addInstanceID(hostDescriptor.getInstanceID().get(0));
-                }
-
-            }else if (hostDescriptor.getHostType().get(0).equals(HostTypes.SSH_HOST_TYPE)) {
-            	hostDescription.getType().changeType(SSHHostType.type);
-                ((SSHHostType)hostDescription.getType()).setHpcResource(hostDescriptor.isHpcResource());
-            } else if (hostDescriptor.getHostType().get(0).equals(HostTypes.UNICORE_HOST_TYPE)) {
-                 hostDescription.getType().changeType(UnicoreHostType.type);
-                 if (!hostDescriptor.getGateKeeperEndPoint().isEmpty() && hostDescriptor.getGateKeeperEndPoint() != null){
-                     ((UnicoreHostType) hostDescription.getType()).addUnicoreBESEndPoint(hostDescriptor.getGateKeeperEndPoint().get(0));
-                 }
-                 if (!hostDescriptor.getGridFTPEndPoint().isEmpty() && hostDescriptor.getGridFTPEndPoint() != null){
-                     ((UnicoreHostType) hostDescription.getType()).addGridFTPEndPoint(hostDescriptor.getGridFTPEndPoint().get(0));
-                 }
-            }
-        }
-
-        return hostDescription;
-    }
-
-    public static ServiceDescription createServiceDescription (ServiceDescriptor serviceDescriptor){
-        ServiceDescription serviceDescription = new ServiceDescription();
-        serviceDescription.getType().setName(serviceDescriptor.getServiceName());
-        serviceDescription.getType().setDescription(serviceDescriptor.getDescription());
-        List<ServiceParameters> inputParams = serviceDescriptor.getInputParams();
-        InputParameterType[] inputParameterTypeArray = new InputParameterType[inputParams.size()];
-        for (int i = 0; i < inputParams.size(); i++){
-            InputParameterType parameter = InputParameterType.Factory.newInstance();
-            parameter.setParameterName(inputParams.get(i).getName());
-            parameter.setParameterValueArray(new String[]{inputParams.get(i).getName()});
-            parameter.setParameterDescription(inputParams.get(i).getDescription());
-            ParameterType parameterType = parameter.addNewParameterType();
-            parameterType.setType(DataType.Enum.forString(inputParams.get(i).getType()));
-            parameterType.setName(inputParams.get(i).getType());
-            parameter.setParameterType(parameterType);
-            inputParameterTypeArray[i] = parameter;
-        }
-        serviceDescription.getType().setInputParametersArray(inputParameterTypeArray);
-
-        List<ServiceParameters> outputParams = serviceDescriptor.getOutputParams();
-        OutputParameterType[] outputParameterTypeArray = new OutputParameterType[outputParams.size()];
-        for (int i = 0; i < outputParams.size(); i++){
-            OutputParameterType parameter = OutputParameterType.Factory.newInstance();
-            parameter.setParameterName(outputParams.get(i).getName());
-            parameter.setParameterDescription(outputParams.get(i).getDescription());
-            ParameterType parameterType = parameter.addNewParameterType();
-            parameterType.setType(DataType.Enum.forString(outputParams.get(i).getType()));
-            parameterType.setName(outputParams.get(i).getType());
-            parameter.setParameterType(parameterType);
-            outputParameterTypeArray[i] = parameter;
-        }
-        serviceDescription.getType().setOutputParametersArray(outputParameterTypeArray);
-        return serviceDescription;
-    }
-
-    public static ServiceDescriptor createServiceDescriptor(ServiceDescription serviceDescription){
-        ServiceDescriptor serviceDescriptor = new ServiceDescriptor();
-        serviceDescriptor.setServiceName(serviceDescription.getType().getName());
-        serviceDescriptor.setDescription(serviceDescription.getType().getDescription());
-        InputParameterType[] inputParametersArray = serviceDescription.getType().getInputParametersArray();
-        OutputParameterType[] outputParametersArray = serviceDescription.getType().getOutputParametersArray();
-        List<ServiceParameters> inputParams = new ArrayList<ServiceParameters>();
-        List<ServiceParameters> outputParams = new ArrayList<ServiceParameters>();
-
-        for (int i = 0; i < inputParametersArray.length; i++){
-            ServiceParameters serviceParameters = new ServiceParameters();
-            serviceParameters.setType(inputParametersArray[i].getParameterType().getType().toString());
-//            String[] parameterValueArray = inputParametersArray[i].getParameterValueArray();
-//            if (parameterValueArray.length != 0){
-//                serviceParameters.setName(parameterValueArray[0]);
-//            }
-            serviceParameters.setName(inputParametersArray[i].getParameterName());
-            serviceParameters.setDescription(inputParametersArray[i].getParameterDescription());
-//            serviceParameters.set(inputParametersArray[i].getParameterType().getType().toString());
-            inputParams.add(serviceParameters);
-        }
-        serviceDescriptor.setInputParams(inputParams);
-
-        for (int i = 0; i < outputParametersArray.length; i++){
-            ServiceParameters serviceParameters = new ServiceParameters();
-            serviceParameters.setType(outputParametersArray[i].getParameterType().getType().toString());
-            serviceParameters.setName(outputParametersArray[i].getParameterName());
-            serviceParameters.setDescription(outputParametersArray[i].getParameterDescription());
-//            serviceParameters.setDataType(outputParametersArray[i].getParameterType().getType().toString());
-            outputParams.add(serviceParameters);
-        }
-        serviceDescriptor.setOutputParams(outputParams);
-        return serviceDescriptor;
-    }
-
-    public static ApplicationDescription createApplicationDescription(ApplicationDescriptor applicationDescriptor){
-        ApplicationDescription applicationDescription = new ApplicationDescription();
-        ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory.newInstance();
-        name.setStringValue(applicationDescriptor.getName());
-        applicationDescription.getType().setApplicationName(name);
-        applicationDescription.getType().setExecutableLocation(applicationDescriptor.getExecutablePath());
-        applicationDescription.getType().setScratchWorkingDirectory(applicationDescriptor.getWorkingDir());
-
-        if (applicationDescriptor.getInputDir() != null){
-            applicationDescription.getType().setInputDataDirectory(applicationDescriptor.getInputDir());
-        }
-        if (applicationDescriptor.getOutputDir() != null){
-            applicationDescription.getType().setOutputDataDirectory(applicationDescriptor.getOutputDir());
-        }
-        if (applicationDescriptor.getStdIn() != null){
-            applicationDescription.getType().setStandardInput(applicationDescriptor.getStdIn());
-        }
-        if (applicationDescriptor.getStdOut() != null){
-            applicationDescription.getType().setStandardOutput(applicationDescriptor.getStdOut());
-        }
-        if (applicationDescriptor.getStdError() != null){
-            applicationDescription.getType().setStandardError(applicationDescriptor.getStdError());
-        }
-        if (applicationDescriptor.getStaticWorkigDir() != null){
-            applicationDescription.getType().setStaticWorkingDirectory(applicationDescriptor.getStaticWorkigDir());
-        }
-        HashMap<String,String> environmentVariables = applicationDescriptor.getEnvironmentVariables();
-        if (environmentVariables != null && !environmentVariables.isEmpty()){
-            NameValuePairType[] appEnviVariablesArray = new NameValuePairType[environmentVariables.size()];
-            for(String key : environmentVariables.keySet()) {
-                int i = 0;
-                NameValuePairType nameValuePairType = applicationDescription.getType().addNewApplicationEnvironment();
-                nameValuePairType.setName(key);
-                nameValuePairType.setValue(environmentVariables.get(key));
-                appEnviVariablesArray[i] = nameValuePairType;
-                i++;
-            }
-            applicationDescription.getType().setApplicationEnvironmentArray(appEnviVariablesArray);
-        }
-
-        //set advanced options according app desc type
-        if(applicationDescriptor.getApplicationDescType() != null && !applicationDescriptor.getApplicationDescType().isEmpty()){
-            if (applicationDescriptor.getApplicationDescType().equals(ApplicationDescriptorTypes.HPC_APP_DEP_DESC_TYPE)){
-                ApplicationDescription appDesc = new ApplicationDescription(HpcApplicationDeploymentType.type);
-                appDesc.getType().setApplicationName(name);
-                appDesc.getType().setExecutableLocation(applicationDescriptor.getExecutablePath());
-                appDesc.getType().setScratchWorkingDirectory(applicationDescriptor.getWorkingDir());
-
-                if (applicationDescriptor.getInputDir() != null){
-                    appDesc.getType().setInputDataDirectory(applicationDescriptor.getInputDir());
-                }
-                if (applicationDescriptor.getOutputDir() != null){
-                    appDesc.getType().setOutputDataDirectory(applicationDescriptor.getOutputDir());
-                }
-                if (applicationDescriptor.getStdIn() != null){
-                    appDesc.getType().setStandardInput(applicationDescriptor.getStdIn());
-                }
-                if (applicationDescriptor.getStdOut() != null){
-                    appDesc.getType().setStandardOutput(applicationDescriptor.getStdOut());
-                }
-                if (applicationDescriptor.getStdError() != null){
-                    appDesc.getType().setStandardError(applicationDescriptor.getStdError());
-                }
-                if (applicationDescriptor.getStaticWorkigDir() != null){
-                    appDesc.getType().setStaticWorkingDirectory(applicationDescriptor.getStaticWorkigDir());
-                }
-
-                HashMap<String,String> envVariables = applicationDescriptor.getEnvironmentVariables();
-                if (envVariables != null && !envVariables.isEmpty()){
-                    NameValuePairType[] appEnviVariablesArray = new NameValuePairType[envVariables.size()];
-                    for(String key : envVariables.keySet()) {
-                        int i = 0;
-                        NameValuePairType nameValuePairType = applicationDescription.getType().addNewApplicationEnvironment();
-                        nameValuePairType.setName(key);
-                        nameValuePairType.setValue(envVariables.get(key));
-                        appEnviVariablesArray[i] = nameValuePairType;
-                        i++;
-                    }
-                    appDesc.getType().setApplicationEnvironmentArray(appEnviVariablesArray);
-                }
-
-                HpcApplicationDeploymentType app = (HpcApplicationDeploymentType) appDesc.getType();
-
-                ProjectAccountType projectAccountType = app.addNewProjectAccount();
-                if (applicationDescriptor.getProjectNumber() != null){
-                    projectAccountType.setProjectAccountNumber(applicationDescriptor.getProjectNumber());
-                }
-                if (applicationDescriptor.getProjectDescription() != null){
-                    projectAccountType.setProjectAccountDescription(applicationDescriptor.getProjectDescription());
-                }
-                app.setProjectAccount(projectAccountType);
-
-                app.setCpuCount(applicationDescriptor.getCpuCount());
-                if (applicationDescriptor.getJobType() != null){
-                    app.setJobType(JobTypeType.Enum.forString(applicationDescriptor.getJobType()));
-                }
-                app.setInstalledParentPath(applicationDescriptor.getInstalledPath());
-                app.setJobSubmitterCommand(applicationDescriptor.getJobSubmitterCommand());
-                app.setMaxMemory(applicationDescriptor.getMaxMemory());
-                app.setMinMemory(applicationDescriptor.getMinMemory());
-                app.setMaxWallTime(applicationDescriptor.getMaxWallTime());
-                app.setNodeCount(applicationDescriptor.getNodeCount());
-                app.setProcessorsPerNode(applicationDescriptor.getProcessorsPerNode());
-
-                QueueType queueType = app.addNewQueue();
-                if (applicationDescriptor.getQueueName() != null){
-                    queueType.setQueueName(applicationDescriptor.getQueueName());
-                }
-                app.setQueue(queueType);
-
-                return appDesc;
-            }
-        }
-        return applicationDescription;
-    }
-
-    public static ApplicationDescriptor createApplicationDescriptor (ApplicationDescription applicationDescription){
-        ApplicationDescriptor applicationDescriptor = new ApplicationDescriptor();
-        applicationDescriptor.setName(applicationDescription.getType().getApplicationName().getStringValue());
-        applicationDescriptor.setExecutablePath(applicationDescription.getType().getExecutableLocation());
-        applicationDescriptor.setWorkingDir(applicationDescription.getType().getScratchWorkingDirectory());
-
-        if (applicationDescription.getType().getInputDataDirectory() != null && !applicationDescription.getType().getInputDataDirectory().equals("") ){
-            applicationDescriptor.setInputDir(applicationDescription.getType().getInputDataDirectory());
-        }
-        if (applicationDescription.getType().getOutputDataDirectory() != null && !applicationDescription.getType().getOutputDataDirectory().equals("")){
-            applicationDescriptor.setOutputDir(applicationDescription.getType().getOutputDataDirectory());
-        }
-        if (applicationDescription.getType().getStaticWorkingDirectory() != null && !applicationDescription.getType().getStaticWorkingDirectory().equals("")){
-            applicationDescriptor.setStaticWorkigDir(applicationDescription.getType().getStaticWorkingDirectory());
-        }
-        if (applicationDescription.getType().getStandardInput() != null && !applicationDescription.getType().getStandardInput().equals("")){
-            applicationDescriptor.setStdIn(applicationDescription.getType().getStandardInput());
-        }
-        if (applicationDescription.getType().getStandardOutput() != null && !applicationDescription.getType().getStandardOutput().equals("")){
-            applicationDescriptor.setStdOut(applicationDescription.getType().getStandardOutput());
-        }
-        if (applicationDescription.getType().getStandardError() != null && !applicationDescription.getType().getStandardError().equals("")){
-            applicationDescriptor.setStdError(applicationDescription.getType().getStandardError());
-        }
-        NameValuePairType[] environmentArray = applicationDescription.getType().getApplicationEnvironmentArray();
-        HashMap<String, String> environmentVariableMap = new HashMap<String, String>();
-        if (environmentArray != null && environmentArray.length != 0){
-            for (NameValuePairType nameValuePairType : environmentArray){
-                environmentVariableMap.put(nameValuePairType.getName(), nameValuePairType.getValue());
-            }
-            applicationDescriptor.setEnvironmentVariables(environmentVariableMap);
-        }
-
-        if(applicationDescription.getType() != null){
-            if(applicationDescription.getType() instanceof HpcApplicationDeploymentType){
-                applicationDescriptor.setApplicationDescType(ApplicationDescriptorTypes.HPC_APP_DEP_DESC_TYPE);
-                HpcApplicationDeploymentType gramApplicationDeploymentType = (HpcApplicationDeploymentType) applicationDescription.getType();
-                if(gramApplicationDeploymentType != null){
-                    applicationDescriptor.setCpuCount(gramApplicationDeploymentType.getCpuCount());
-                    applicationDescriptor.setNodeCount(gramApplicationDeploymentType.getNodeCount());
-                    applicationDescriptor.setMaxMemory(gramApplicationDeploymentType.getMaxMemory());
-                    applicationDescriptor.setMinMemory(gramApplicationDeploymentType.getMinMemory());
-                    applicationDescriptor.setMaxWallTime(gramApplicationDeploymentType.getMaxWallTime());
-                    applicationDescriptor.setJobSubmitterCommand(gramApplicationDeploymentType.getJobSubmitterCommand());
-                    applicationDescriptor.setInstalledPath(gramApplicationDeploymentType.getInstalledParentPath());
-                    if (gramApplicationDeploymentType.getJobType() != null)  {
-                        applicationDescriptor.setJobType(gramApplicationDeploymentType.getJobType().toString());
-                    }
-                    if (gramApplicationDeploymentType.getProjectAccount() != null){
-                        if (gramApplicationDeploymentType.getProjectAccount().getProjectAccountNumber() != null){
-                            applicationDescriptor.setProjectNumber(gramApplicationDeploymentType.getProjectAccount().getProjectAccountNumber());
-                        }
-                    }
-                    if (gramApplicationDeploymentType.getProjectAccount() != null){
-                        if (gramApplicationDeploymentType.getProjectAccount().getProjectAccountDescription() != null){
-                            applicationDescriptor.setProjectDescription(gramApplicationDeploymentType.getProjectAccount().getProjectAccountDescription());
-                        }
-                    }
-                    if(gramApplicationDeploymentType.getQueue() != null){
-                        applicationDescriptor.setQueueName(gramApplicationDeploymentType.getQueue().getQueueName());
-                    }
-                    applicationDescriptor.setProcessorsPerNode(gramApplicationDeploymentType.getProcessorsPerNode());
-                }
-            } else if (applicationDescription.getType() instanceof Ec2ApplicationDeploymentType) {
-                applicationDescriptor.setApplicationDescType(ApplicationDescriptorTypes.EC2_APP_DEP_DESC_TYPE);
-            }
-        }
-
-        return applicationDescriptor;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/HostTypes.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/HostTypes.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/HostTypes.java
deleted file mode 100644
index 0866955..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/HostTypes.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.utils;
-
-public class HostTypes {
-    public static final String GLOBUS_HOST_TYPE = "GlobusHostType";
-    public static final String GSISSH_HOST_TYPE = "GsisshHostType";
-    public static final String EC2_HOST_TYPE = "Ec2HostType";
-    public static final String SSH_HOST_TYPE = "SSHHostType";
-    public static final String UNICORE_HOST_TYPE = "UnicoreHostType";
-    public static final String HOST_DESCRIPTION_TYPE = "HostDescriptionType";
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegIdentifier.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegIdentifier.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegIdentifier.java
deleted file mode 100644
index 7e05f65..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegIdentifier.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.utils;
-
-public class RegIdentifier {
-    private String user;
-    private String gateway;
-
-    public RegIdentifier(String user, String gateway) {
-        this.user = user;
-        this.gateway = gateway;
-    }
-
-    public String getUser() {
-        return user;
-    }
-
-    public String getGateway() {
-        return gateway;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegPoolUtils.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegPoolUtils.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegPoolUtils.java
deleted file mode 100644
index 6e1d5bd..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegPoolUtils.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.utils;
-
-import org.apache.airavata.common.context.WorkflowContext;
-import org.apache.airavata.common.exception.AiravataConfigurationException;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.AiravataRegistryFactory;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.registry.api.Gateway;
-import org.apache.airavata.registry.api.exception.*;
-
-import javax.servlet.ServletContext;
-import java.util.Map;
-
-
-public class RegPoolUtils {
-
-    private final static Object lock = new Object();
-
-
-    public static AiravataRegistry2 acquireRegistry(ServletContext context) {
-        AiravataRegistry2 airavataRegistry=null;
-        String user =  WorkflowContext.getRequestUser();
-        String gatewayId = WorkflowContext.getGatewayId();
-        Gateway gateway = new Gateway(gatewayId);
-        AiravataUser airavataUser = new AiravataUser(user);
-        /*RegistryInstancesPool registryInstancesPool =
-                (RegistryInstancesPool) context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY_POOL);
-        Map<RegIdentifier,AiravataRegistry2> registryMap = registryInstancesPool.getRegistryInstancesList();
-        boolean foundReg=false;*/
-        try{
-            return AiravataRegistryFactory.getRegistry(gateway, airavataUser);
-            /*while(!foundReg){
-                synchronized (lock){
-                    RegIdentifier identifier = new RegIdentifier(user, gateway.getGatewayName());
-                    if (registryMap.size()==0){
-                        registryMap.put(identifier,
-                                AiravataRegistryFactory.getRegistry(gateway, airavataUser));
-                    }else {
-                        airavataRegistry = registryMap.get(identifier);
-                        if (airavataRegistry == null){
-                            registryMap.put(identifier,
-                                    AiravataRegistryFactory.getRegistry(gateway, airavataUser));
-                        }
-                    }
-                    airavataRegistry=registryMap.get(identifier);
-                    registryMap.remove(identifier);
-                    foundReg=true;
-                }
-            }*/
-        }catch (RegistryAccessorInvalidException e) {
-            e.printStackTrace();
-        } catch (RegistryAccessorInstantiateException e) {
-            e.printStackTrace();
-        } catch (RegistryAccessorUndefinedException e) {
-            e.printStackTrace();
-        } catch (RegistryAccessorNotFoundException e) {
-            e.printStackTrace();
-        } catch (AiravataConfigurationException e) {
-            e.printStackTrace();
-        } catch (RegistryException e) {
-            e.printStackTrace();
-        }
-        return airavataRegistry;
-    }
-
-    public static void releaseRegistry(ServletContext context, AiravataRegistry2 airavataRegistry) {
-        /*RegistryInstancesPool registryInstancesPool =
-                (RegistryInstancesPool)context.getAttribute(RestServicesConstants.AIRAVATA_REGISTRY_POOL);
-        Map<RegIdentifier, AiravataRegistry2> registryInstancesList =
-                registryInstancesPool.getRegistryInstancesList();
-        synchronized (lock){
-            RegIdentifier regIdentifier =
-                    new RegIdentifier(airavataRegistry.getUser().getUserName(),
-                            airavataRegistry.getGateway().getGatewayName());
-            registryInstancesList.put(regIdentifier, airavataRegistry);
-        } */
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegistryInstancesPool.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegistryInstancesPool.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegistryInstancesPool.java
deleted file mode 100644
index 5a5d7bb..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegistryInstancesPool.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.utils;
-
-import org.apache.airavata.registry.api.AiravataRegistry2;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class RegistryInstancesPool {
-    private Map<RegIdentifier, AiravataRegistry2> registryInstancesList = new HashMap<RegIdentifier, AiravataRegistry2>();
-    private int maxSize;
-
-    public RegistryInstancesPool(int maxSize) {
-        this.maxSize = maxSize;
-    }
-
-    public int getMaxSize() {
-        return maxSize;
-    }
-
-    public Map<RegIdentifier, AiravataRegistry2> getRegistryInstancesList() {
-        return registryInstancesList;
-    }
-
-    public void setRegistryInstancesList(Map<RegIdentifier, AiravataRegistry2> registryInstancesList) {
-        this.registryInstancesList = registryInstancesList;
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegistryListener.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegistryListener.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegistryListener.java
deleted file mode 100644
index 74ada3f..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RegistryListener.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.utils;
-
-import javax.servlet.ServletContext;
-import javax.servlet.ServletContextEvent;
-import javax.servlet.ServletContextListener;
-
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.registry.api.Gateway;
-
-public class RegistryListener implements ServletContextListener {
-
-    public void contextInitialized(ServletContextEvent servletContextEvent) {
-        try {
-        	AiravataUtils.setExecutionAsServer();
-            ServletContext servletContext = servletContextEvent.getServletContext();
-            String gatewayID = ServerSettings.getSystemUserGateway();
-            String user = ServerSettings.getSystemUser();
-            Gateway gateway =  new Gateway(gatewayID);
-
-            servletContext.setAttribute(RestServicesConstants.GATEWAY, gateway);
-            servletContext.setAttribute(RestServicesConstants.AIRAVATA_USER, user);
-            servletContext.setAttribute(
-                    RestServicesConstants.AIRAVATA_REGISTRY_POOL,new RegistryInstancesPool(100));
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    public void contextDestroyed(ServletContextEvent servletContextEvent) {
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java
deleted file mode 100644
index ddf9396..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ResourcePathConstants.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.utils;
-
-public class ResourcePathConstants {
-
-    public static final String BASE_URL = "http://localhost:8080/airavata/services/registry";
-
-    public final class ConfigResourcePathConstants {
-        public static final String CONFIGURATION_REGISTRY_RESOURCE = "/congfigregistry/";
-        public static final String GET_CONFIGURATION = "get/configuration";
-        public static final String GET_CONFIGURATION_LIST = "get/configurationlist";
-        public static final String SAVE_CONFIGURATION = "save/configuration";
-        public static final String UPDATE_CONFIGURATION = "update/configuration";
-        public static final String DELETE_ALL_CONFIGURATION = "delete/allconfiguration";
-        public static final String DELETE_CONFIGURATION ="delete/configuration";
-        public static final String GET_GFAC_URI_LIST = "get/gfac/urilist";
-        public static final String GET_WFINTERPRETER_URI_LIST = "get/workflowinterpreter/urilist";
-        public static final String GET_EVENTING_URI = "get/eventingservice/uri";
-        public static final String GET_MESSAGE_BOX_URI = "get/messagebox/uri";
-        public static final String ADD_GFAC_URI = "add/gfacuri";
-        public static final String ADD_WFINTERPRETER_URI = "add/workflowinterpreteruri";
-        public static final String ADD_EVENTING_URI = "add/eventinguri";
-        public static final String ADD_MESSAGE_BOX_URI = "add/msgboxuri";
-        public static final String ADD_GFAC_URI_DATE = "add/gfacuri/date";
-        public static final String ADD_WFINTERPRETER_URI_DATE = "add/workflowinterpreteruri/date";
-        public static final String ADD_EVENTING_URI_DATE = "add/eventinguri/date";
-        public static final String ADD_MSG_BOX_URI_DATE = "add/msgboxuri/date";
-        public static final String DELETE_GFAC_URI = "delete/gfacuri";
-        public static final String DELETE_ALL_GFAC_URIS = "delete/allgfacuris";
-        public static final String DELETE_WFINTERPRETER_URI = "delete/workflowinterpreteruri";
-        public static final String DELETE_ALL_WFINTERPRETER_URIS = "delete/allworkflowinterpreteruris";
-        public static final String DELETE_EVENTING_URI = "delete/eventinguri";
-        public static final String DELETE_MSG_BOX_URI = "delete/msgboxuri";
-    }
-
-    public final class DecResourcePathConstants {
-        public static final String DESC_RESOURCE_PATH = "/descriptorsregistry/";
-        public static final String HOST_DESC_EXISTS = "hostdescriptor/exist";
-        public static final String HOST_DESC_SAVE = "hostdescriptor/save";
-        public static final String HOST_DESC_UPDATE = "hostdescriptor/update";
-        public static final String HOST_DESC = "host/description";
-        public static final String HOST_DESC_DELETE = "hostdescriptor/delete";
-        public static final String GET_HOST_DESCS = "get/hostdescriptors";
-        public static final String GET_HOST_DESCS_NAMES = "get/hostdescriptor/names";
-        public static final String SERVICE_DESC_EXISTS = "servicedescriptor/exist";
-        public static final String SERVICE_DESC_SAVE = "servicedescriptor/save";
-        public static final String SERVICE_DESC_UPDATE = "servicedescriptor/update";
-        public static final String SERVICE_DESC = "servicedescriptor/description";
-        public static final String SERVICE_DESC_DELETE = "servicedescriptor/delete";
-        public static final String GET_SERVICE_DESCS = "get/servicedescriptors";
-        public static final String APPL_DESC_EXIST = "applicationdescriptor/exist";
-        public static final String APP_DESC_BUILD_SAVE = "applicationdescriptor/build/save";
-        public static final String APP_DESC_UPDATE = "applicationdescriptor/update";
-        public static final String APP_DESC_DESCRIPTION = "applicationdescriptor/description";
-        public static final String APP_DESC_PER_HOST_SERVICE = "applicationdescriptors/alldescriptors/host/service";
-        public static final String APP_DESC_ALL_DESCS_SERVICE = "applicationdescriptor/alldescriptors/service";
-        public static final String APP_DESC_ALL_DESCRIPTORS = "applicationdescriptor/alldescriptors";
-        public static final String APP_DESC_NAMES = "applicationdescriptor/names";
-        public static final String APP_DESC_DELETE = "applicationdescriptor/delete";
-    }
-
-    public final class ExperimentResourcePathConstants {
-        public static final String EXP_RESOURCE_PATH  =  "/experimentregistry/";
-        public static final String DELETE_EXP = "delete/experiment";
-        public static final String GET_ALL_EXPS = "get/experiments/all" ;
-        public static final String GET_EXPS_BY_PROJECT = "get/experiments/project" ;
-        public static final String GET_EXPS_BY_DATE =  "get/experiments/date";
-        public static final String GET_EXPS_PER_PROJECT_BY_DATE = "get/experiments/project/date";
-        public static final String ADD_EXP = "add/experiment" ;
-        public static final String EXP_EXISTS = "experiment/exist" ;
-        public static final String EXP_EXISTS_CREATE = "experiment/notexist/create" ;
-    }
-
-    public final class ProjectResourcePathConstants {
-        public static final String REGISTRY_API_PROJECTREGISTRY = "/projectregistry/";
-        public static final String PROJECT_EXIST = "project/exist";
-        public static final String PROJECT_EXIST_CREATE = "project/exist";
-        public static final String ADD_PROJECT = "add/project";
-        public static final String UPDATE_PROJECT = "update/project";
-        public static final String DELETE_PROJECT = "delete/project";
-        public static final String GET_PROJECT = "get/project";
-        public static final String GET_PROJECTS = "get/projects";
-    }
-
-    public final class ProvenanceResourcePathConstants {
-
-        public static final String REGISTRY_API_PROVENANCEREGISTRY = "/provenanceregistry/";
-        public static final String UPDATE_EXPERIMENT_EXECUTIONUSER = "update/experiment/executionuser";
-        public static final String GET_EXPERIMENT_EXECUTIONUSER = "get/experiment/executionuser";
-        public static final String GET_EXPERIMENT_NAME = "get/experiment/name";
-        public static final String UPDATE_EXPERIMENTNAME = "update/experimentname";
-        public static final String GET_EXPERIMENTMETADATA = "get/experimentmetadata";
-        public static final String UPDATE_EXPERIMENTMETADATA = "update/experimentmetadata";
-        public static final String GET_WORKFLOWTEMPLATENAME = "get/workflowtemplatename";
-        public static final String UPDATE_WORKFLOWINSTANCETEMPLATENAME = "update/workflowinstancetemplatename";
-        public static final String GET_EXPERIMENTWORKFLOWINSTANCES = "get/experimentworkflowinstances";
-        public static final String WORKFLOWINSTANCE_EXIST_CHECK = "workflowinstance/exist/check";
-        public static final String WORKFLOWINSTANCE_EXIST_CREATE = "workflowinstance/exist/create";
-        public static final String UPDATE_WORKFLOWINSTANCESTATUS_INSTANCEID = "update/workflowinstancestatus/instanceid";
-        public static final String UPDATE_WORKFLOWINSTANCESTATUS = "update/workflowinstancestatus";
-        public static final String GET_WORKFLOWINSTANCESTATUS = "get/workflowinstancestatus";
-        public static final String UPDATE_WORKFLOWNODEINPUT = "update/workflownodeinput";
-        public static final String UPDATE_WORKFLOWNODEOUTPUT = "update/workflownodeoutput";
-        public static final String GET_EXPERIMENT = "get/experiment";
-        public static final String GET_EXPERIMENT_ID_USER = "get/experimentId/user";
-        public static final String GET_EXPERIMENT_USER = "get/experiment/user";
-        public static final String GET_EXPERIMENTS = "get/experiments";
-        public static final String UPDATE_WORKFLOWNODE_STATUS = "update/workflownode/status";
-        public static final String GET_WORKFLOWNODE_STATUS = "get/workflownode/status";
-        public static final String GET_WORKFLOWNODE_STARTTIME = "get/workflownode/starttime";
-        public static final String GET_WORKFLOW_STARTTIME = "get/workflow/starttime";
-        public static final String UPDATE_WORKFLOWNODE_GRAMDATA = "update/workflownode/gramdata";
-        public static final String GET_WORKFLOWINSTANCEDATA = "get/workflowinstancedata";
-        public static final String WORKFLOWINSTANCE_NODE_EXIST = "wfnode/exist";
-        public static final String WORKFLOWINSTANCE_NODE_EXIST_CREATE = "wfnode/exist/create";
-        public static final String WORKFLOWINSTANCE_NODE_DATA = "workflowinstance/nodeData";
-        public static final String ADD_WORKFLOWINSTANCE = "add/workflowinstance";
-        public static final String UPDATE_WORKFLOWNODETYPE = "update/workflownodetype";
-        public static final String ADD_WORKFLOWINSTANCENODE = "add/workflowinstancenode";
-        public static final String EXPERIMENTNAME_EXISTS = "experimentname/exists";
-
-        public static final String GET_EXPERIMENT_METAINFORMATION = "get/experiment/metainformation";
-        public static final String GET_ALL_EXPERIMENT_METAINFORMATION = "get/all/experiment/metainformation";
-        public static final String SEARCH_EXPERIMENTS = "search/experiments";
-
-        public static final String GET_EXPERIMENT_ERRORS = "experiment/errors";
-        public static final String GET_WORKFLOW_ERRORS = "workflow/errors";
-        public static final String GET_NODE_ERRORS = "node/errors";
-        public static final String GET_GFAC_ERRORS = "gfac/errors";
-        public static final String GET_ALL_GFAC_ERRORS = "gfac/all/errors";
-        public static final String GET_EXECUTION_ERRORS = "execution/errors";
-        public static final String ADD_EXPERIMENT_ERROR = "add/experiment/errors";
-        public static final String ADD_WORKFLOW_ERROR = "add/workflow/errors";
-        public static final String ADD_NODE_ERROR = "add/node/errors";
-        public static final String ADD_GFAC_ERROR = "add/gfac/errors";
-        public static final String ADD_APPLICATION_JOB = "add/application/job";
-        public static final String UPDATE_APPLICATION_JOB = "update/application/job";
-        public static final String UPDATE_APPLICATION_JOB_STATUS = "update/application/jobstatus";
-        public static final String UPDATE_APPLICATION_JOB_DATA = "update/application/jobdata";
-        public static final String UPDATE_APPLICATION_JOB_SUBMITTED_TIME = "update/application/job/submit";
-        public static final String UPDATE_APPLICATION_JOB_COMPLETED_TIME = "update/application/job/complete";
-        public static final String UPDATE_APPLICATION_JOB_METADATA = "update/application/job/metadata";
-        public static final String GET_APPLICATION_JOB = "get/application/job";
-        public static final String GET_APPLICATION_JOBS_FOR_DESCRIPTORS = "get/application/jobs/descriptors";
-        public static final String GET_APPLICATION_JOBS = "get/application/jobs";
-        public static final String APPLICATION_JOB_EXIST = "application/job/exists";
-        public static final String GET_APPLICATION_JOBS_STATUS_HISTORY = "get/application/status/history";
-
-    }
-
-    public final class PublishedWFConstants {
-
-        public static final String REGISTRY_API_PUBLISHWFREGISTRY = "/publishwfregistry/";
-        public static final String PUBLISHWF_EXIST = "publishwf/exist";
-        public static final String PUBLISH_WORKFLOW = "publish/workflow";
-        public static final String PUBLISH_DEFAULT_WORKFLOW = "publish/default/workflow";
-        public static final String GET_PUBLISHWORKFLOWGRAPH = "get/publishworkflowgraph";
-        public static final String GET_PUBLISHWORKFLOWNAMES = "get/publishworkflownames";
-        public static final String GET_PUBLISHWORKFLOWS = "get/publishworkflows";
-        public static final String REMOVE_PUBLISHWORKFLOW = "remove/publishworkflow";
-    }
-
-    public final class UserWFConstants {
-
-        public static final String REGISTRY_API_USERWFREGISTRY = "/userwfregistry/";
-        public static final String WORKFLOW_EXIST = "workflow/exist";
-        public static final String ADD_WORKFLOW = "add/workflow";
-        public static final String UPDATE_WORKFLOW = "update/workflow";
-        public static final String GET_WORKFLOWGRAPH = "get/workflowgraph";
-        public static final String GET_WORKFLOWS = "get/workflows";
-        public static final String REMOVE_WORKFLOW = "remove/workflow";
-    }
-    
-    public final class CredentialResourceConstants {
-
-        public static final String REGISTRY_API_CREDENTIALREGISTRY = "/credentialregistry/";
-        public static final String SSH_CREDENTIAL = "ssh/credential";
-        public static final String SSH_CREDENTIAL_EXIST = "ssh/credential/exist";
-    }
-    
-    public final class UserResourceConstants {
-
-        public static final String REGISTRY_API_USERREGISTRY = "/userregistry/";
-        public static final String GET_ALL_USERS = "get/user/all";
-    }
-
-    public final class BasicRegistryConstants {
-
-        public static final String REGISTRY_API_BASICREGISTRY = "/basicregistry/";
-        public static final String GET_GATEWAY = "get/gateway";
-        public static final String GET_USER = "get/user";
-        public static final String SET_GATEWAY = "set/gateway";
-        public static final String SET_USER = "set/user";
-        public static final String VERSION = "get/version";
-        public static final String GET_SERVICE_URL = "get/serviceURL";
-        public static final String SET_SERVICE_URL = "set/serviceURL";
-    }
-    public final class ExperimentExecutionConstants {
-        public static final String EXP_EXEC_PATH  =  "/execution/";
-        public static final String GET_HI= "get/hi";
-        public static final String EXEC_EXPERIMENT= "workflow";
-        public static final String CANCEL_EXPERIMENT = "cancel/experiment";
-        public static final String CANCEL_WORKFLOW = "cancel/workflow";
-        public static final String CANCEL_NODE = "cancel/node";
-        public static final String SUSPEND_EXPERIMENT = "suspend/experiment";
-        public static final String RESUME_EXPERIMENT = "resume/experiment";
-    }
-    
-    public final class ServerManagerConstants{
-    	public static final String PATH="/configuration/";
-    }
-    
-    public final class ExperimentDataConstants{
-    	public static final String PATH="/data/";
-    }
-    
-    public final class ApplicationDataConstants{
-    	public static final String PATH="/application/";
-    }
-    
-    public final class WorkflowDataConstants{
-    	public static final String PATH="/workflows/";
-    }
-    
-    public final class PublishedWorkflowDataConstants{
-    	public static final String PATH="/workflows/published/";
-    }
-    
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RestServicesConstants.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RestServicesConstants.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RestServicesConstants.java
deleted file mode 100644
index a022f62..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/RestServicesConstants.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.utils;
-
-import org.apache.commons.codec.binary.Base64;
-
-public class RestServicesConstants {
-    public static final String GATEWAY = "gateway";
-    public static final String AIRAVATA_USER = "airavataUser";
-    public static final String AIRAVATA_REGISTRY_POOL = "airavataRegistryPool";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest/pom.xml b/modules/rest/pom.xml
deleted file mode 100644
index 4772c75..0000000
--- a/modules/rest/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata</artifactId>
-        <version>0.12-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>rest</artifactId>
-    <packaging>pom</packaging>
-    <name>Airavata REST</name>
-    <url>http://airavata.apache.org/</url>
-    
-    <profiles>
-        <profile>
-            <id>default</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <modules>
-                <module>mappings</module>
-                <module>service</module>
-                <module>webapp</module>
-                <module>client</module>
-            </modules>
-        </profile>
-    </profiles>
-    <properties>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
-    </properties>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest/service/pom.xml b/modules/rest/service/pom.xml
deleted file mode 100644
index 90ebed7..0000000
--- a/modules/rest/service/pom.xml
+++ /dev/null
@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY ~ KIND, either express or implied. See the License for the specific 
-	language governing permissions and limitations under the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	
-	<parent>
-		<groupId>org.apache.airavata</groupId>
-		<artifactId>rest</artifactId>
-		<version>0.12-SNAPSHOT</version>
-		<relativePath>../pom.xml</relativePath>
-	</parent>
-
-	<modelVersion>4.0.0</modelVersion>
-	<artifactId>airavata-rest-services</artifactId>
-	<packaging>jar</packaging>
-	<name>airavata-rest-services</name>
-
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derbyclient</artifactId>
-			<version>${derby.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.sun.jersey.jersey-test-framework</groupId>
-			<artifactId>jersey-test-framework-grizzly2</artifactId>
-			<version>${jersey.version}</version>
-			<scope>test</scope>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.shiro</groupId>
-			<artifactId>shiro-core</artifactId>
-			<version>1.2.1</version>
-		</dependency>
-
-        <dependency>
-            <groupId>de.odysseus.staxon</groupId>
-            <artifactId>staxon</artifactId>
-            <version>1.2</version>
-        </dependency>
-
-		<!-- Airavata -->
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-gfac-schema-utils</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-registry-api</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-security</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<!--dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-jpa-registry</artifactId>
-			<version>${project.version}</version>
-		</dependency-->
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-rest-mappings</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<!-- Logging -->
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-simple</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>jcl-over-slf4j</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-log4j12</artifactId>
-		</dependency>
-	</dependencies>
-	<properties>
-		<jersey.version>1.13</jersey.version>
-	</properties>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentDataService.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentDataService.java b/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentDataService.java
deleted file mode 100644
index b0d6f4b..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentDataService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.experiment;
-
-import javax.ws.rs.Path;
-
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants.ExperimentDataConstants;
-import org.apache.airavata.services.registry.rest.resources.ProvenanceRegistryResource;
-
-@Path(ExperimentDataConstants.PATH)
-public class ExperimentDataService extends ProvenanceRegistryResource{
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java b/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
deleted file mode 100644
index 5cf15f7..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/experiment/ExperimentExecutionService.java
+++ /dev/null
@@ -1,115 +0,0 @@
-///*
-// *
-// * Licensed to the Apache Software Foundation (ASF) under one
-// * or more contributor license agreements.  See the NOTICE file
-// * distributed with this work for additional information
-// * regarding copyright ownership.  The ASF licenses this file
-// * to you under the Apache License, Version 2.0 (the
-// * "License"); you may not use this file except in compliance
-// * with the License.  You may obtain a copy of the License at
-// *
-// *   http://www.apache.org/licenses/LICENSE-2.0
-// *
-// * Unless required by applicable law or agreed to in writing,
-// * software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// * KIND, either express or implied.  See the License for the
-// * specific language governing permissions and limitations
-// * under the License.
-// *
-// */
-//
-//package org.apache.airavata.services.experiment;
-//
-//import java.util.Map;
-//
-//import javax.ws.rs.Consumes;
-//import javax.ws.rs.DELETE;
-//import javax.ws.rs.GET;
-//import javax.ws.rs.POST;
-//import javax.ws.rs.Path;
-//import javax.ws.rs.Produces;
-//import javax.ws.rs.QueryParam;
-//import javax.ws.rs.core.MediaType;
-//import javax.ws.rs.core.Response;
-//
-//import org.apache.airavata.client.AiravataAPIUtils;
-//import org.apache.airavata.client.api.ExperimentAdvanceOptions;
-//import org.apache.airavata.common.context.WorkflowContext;
-//import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-//import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-//import org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton;
-//
-//@Path(ResourcePathConstants.ExperimentExecutionConstants.EXP_EXEC_PATH)
-//public class ExperimentExecutionService {
-//	private WorkflowInterpretorSkeleton interpreterService;
-//	
-//    @POST
-//    @Path(ResourcePathConstants.ExperimentExecutionConstants.EXEC_EXPERIMENT)
-//    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-//    @Produces(MediaType.TEXT_PLAIN)
-//    public Response runExperiment(@QueryParam("workflowTemplateName") String workflowTemplateName, Map<String, String> workflowInputs, ExperimentAdvanceOptions advanceOptions){
-//    	String user =  WorkflowContext.getRequestUser();
-//        String gatewayId = WorkflowContext.getGatewayId();
-//    	try {
-//			String experimentId = getInterpreterService().setupAndLaunch(workflowTemplateName, advanceOptions.getCustomExperimentId(), gatewayId, user, workflowInputs, true, AiravataAPIUtils.createWorkflowContextHeaderBuilder(advanceOptions, advanceOptions.getExperimentExecutionUser(),user));
-//	    	Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-//	        builder.entity(experimentId);
-//	        return builder.build();
-//		} catch (Exception e) {
-//			return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentExecutionConstants.EXEC_EXPERIMENT, e);
-//		}
-//
-//    }
-//
-//    @DELETE
-//    @Path(ResourcePathConstants.ExperimentExecutionConstants.CANCEL_EXPERIMENT)
-//    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-//    @Produces(MediaType.TEXT_PLAIN)
-//    public Response cancelExperiment(@QueryParam("experimentId") String experimentId){
-//    	try {
-//			getInterpreterService().haltWorkflow(experimentId);
-//	    	Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-//	        return builder.build();
-//		} catch (Exception e) {
-//			return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentExecutionConstants.CANCEL_EXPERIMENT, e);
-//		}
-//    }
-//
-//    @DELETE
-//    @Path(ResourcePathConstants.ExperimentExecutionConstants.SUSPEND_EXPERIMENT)
-//    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-//    @Produces(MediaType.TEXT_PLAIN)
-//    public Response suspendExperiment(@QueryParam("experimentId") String experimentId){
-//    	try {
-//			getInterpreterService().suspendWorkflow(experimentId);
-//	    	Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-//	        return builder.build();
-//		} catch (Exception e) {
-//			return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentExecutionConstants.SUSPEND_EXPERIMENT, e);
-//		}
-//    }
-//
-//    @GET
-//    @Path(ResourcePathConstants.ExperimentExecutionConstants.RESUME_EXPERIMENT)
-//    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-//    @Produces(MediaType.TEXT_PLAIN)
-//    public Response resumeExperiment(@QueryParam("experimentId") String experimentId){
-//    	try {
-//			getInterpreterService().resumeWorkflow(experimentId);
-//	    	Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-//	        return builder.build();
-//		} catch (Exception e) {
-//			return WebAppUtil.reportInternalServerError(ResourcePathConstants.ExperimentExecutionConstants.RESUME_EXPERIMENT, e);
-//		}
-//    }
-//    
-//	public WorkflowInterpretorSkeleton getInterpreterService() {
-//		if (interpreterService==null){
-//			interpreterService=new WorkflowInterpretorSkeleton();
-//		}
-//		return interpreterService;
-//	}
-//    
-//
-//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/ApplicationDataService.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/ApplicationDataService.java b/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/ApplicationDataService.java
deleted file mode 100644
index 3365a69..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/ApplicationDataService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.gateway;
-
-import javax.ws.rs.Path;
-
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants.ApplicationDataConstants;
-import org.apache.airavata.services.registry.rest.resources.DescriptorRegistryResource;
-
-@Path(ApplicationDataConstants.PATH)
-public class ApplicationDataService extends DescriptorRegistryResource {
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/PublishedWorkflowDataService.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/PublishedWorkflowDataService.java b/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/PublishedWorkflowDataService.java
deleted file mode 100644
index 2175813..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/PublishedWorkflowDataService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.gateway;
-
-import javax.ws.rs.Path;
-
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants.WorkflowDataConstants;
-
-@Path(WorkflowDataConstants.PATH)
-public class PublishedWorkflowDataService {
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/WorkflowDataService.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/WorkflowDataService.java b/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/WorkflowDataService.java
deleted file mode 100644
index 43c167c..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/gateway/WorkflowDataService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.gateway;
-
-import javax.ws.rs.Path;
-
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants.WorkflowDataConstants;
-
-@Path(WorkflowDataConstants.PATH)
-public class WorkflowDataService {
-
-}


[83/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/SenderUtils.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/SenderUtils.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/SenderUtils.java
new file mode 100644
index 0000000..072cbb3
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/SenderUtils.java
@@ -0,0 +1,161 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger;
+
+import java.io.StringReader;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.commons.CommonRoutines;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.apache.airavata.wsmg.messenger.protocol.DeliveryProtocol;
+import org.apache.airavata.wsmg.messenger.protocol.SendingException;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axis2.addressing.EndpointReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/*
+ * this class is not thread safe
+ * */
+public class SenderUtils implements Deliverable {
+
+    private static final Logger logger = LoggerFactory.getLogger(SenderUtils.class);
+
+    private static OMFactory factory = OMAbstractFactory.getOMFactory();
+
+    private ConsumerUrlManager urlManager;
+
+    private DeliveryProtocol protocol;
+
+    public SenderUtils(ConsumerUrlManager urlMan) {
+        urlManager = urlMan;
+    }
+
+    public void setProtocol(DeliveryProtocol protocol) {
+        this.protocol = protocol;
+    }
+
+    public void send(ConsumerInfo consumerInfo, OMElement notificationMessageBodyEl,
+            AdditionalMessageContent additionalMessageContent) {
+
+        if (consumerInfo.isPaused()) {
+            return;
+        }
+
+        if (notificationMessageBodyEl == null) {
+            logger.info("notification message is null, IGNORED");
+            return;
+        }
+
+        if (urlManager.isUnavailable(consumerInfo.getConsumerEprStr())) {
+            logger.info("consumer url is unavailable: " + consumerInfo.getConsumerEprStr());
+            return;
+        }
+
+        EndpointReference consumerReference = new EndpointReference(consumerInfo.getConsumerEprStr());
+
+        /*
+         * Extract message
+         */
+        OMElement message = null;
+        if (consumerInfo.getType().compareTo("wsnt") == 0) {
+            if (consumerInfo.isUseNotify()) {
+                message = wrapRawMessageToWsntWrappedFormat(notificationMessageBodyEl, additionalMessageContent);
+            } else {
+                message = notificationMessageBodyEl;
+            }
+        } else { // wse
+            message = notificationMessageBodyEl;
+        }
+
+        long timeElapsed = -1;
+        long startTime = -1;
+
+        startTime = System.currentTimeMillis();
+
+        try {
+
+            /*
+             * sending message out
+             */
+            protocol.deliver(consumerInfo, message, additionalMessageContent);
+
+            long finishTime = System.currentTimeMillis();
+            timeElapsed = finishTime - startTime;
+            if (WSMGParameter.showTrackId)
+                logger.info(String.format("track id = %s : delivered to: %s in %d ms",
+                        additionalMessageContent.getTrackId(), consumerReference.getAddress(), timeElapsed));
+
+            urlManager.onSucessfullDelivery(consumerReference, timeElapsed);
+        } catch (SendingException ex) {
+
+            long finishTime = System.currentTimeMillis();
+            timeElapsed = finishTime - startTime;
+
+            urlManager.onFailedDelivery(consumerReference, finishTime, timeElapsed, ex, additionalMessageContent);
+
+        }
+    }
+
+    public OMElement wrapRawMessageToWsntWrappedFormat(OMElement rawNotif,
+            AdditionalMessageContent additionalMessageContent) {
+
+        OMElement fullNotif = factory.createOMElement("Notify", NameSpaceConstants.WSNT_NS);
+
+        OMElement notificationMessageEl = factory.createOMElement("NotificationMessage", NameSpaceConstants.WSNT_NS,
+                fullNotif);
+
+        String topicElString = additionalMessageContent.getTopicElement();
+        if (topicElString != null) {
+            OMElement topicEl = null;
+            try {
+                topicEl = CommonRoutines.reader2OMElement(new StringReader(topicElString));
+            } catch (XMLStreamException e) {
+                logger.error("XMLStreamreader exception when setting topicEl", e);
+            }
+            notificationMessageEl.addChild(topicEl);
+        }
+        String producerReferenceElString = additionalMessageContent.getProducerReference();
+        if (producerReferenceElString != null) {
+            OMElement producerReferenceEl = null;
+            try {
+                producerReferenceEl = CommonRoutines.reader2OMElement(new StringReader(producerReferenceElString));
+            } catch (XMLStreamException e) {
+                logger.error("XMLStreamException at creating producerReferenceEl", e);
+            }
+            notificationMessageEl.addChild(producerReferenceEl);
+        }
+
+        OMElement messageEl = factory.createOMElement("Message", NameSpaceConstants.WSNT_NS, notificationMessageEl);
+        messageEl.addChild(rawNotif);
+
+        return fullNotif;
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/DeliveryProtocol.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/DeliveryProtocol.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/DeliveryProtocol.java
new file mode 100644
index 0000000..417cef7
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/DeliveryProtocol.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger.protocol;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.axiom.om.OMElement;
+
+public interface DeliveryProtocol {
+
+    public void deliver(ConsumerInfo consumerInfo, OMElement message, AdditionalMessageContent additionalMessageContent)
+            throws SendingException;
+
+    public void setTimeout(long timeout);
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/SendingException.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/SendingException.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/SendingException.java
new file mode 100644
index 0000000..c4dd24a
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/SendingException.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger.protocol;
+
+import org.apache.axis2.AxisFault;
+
+public class SendingException extends AxisFault {
+
+    /**
+	 * 
+	 */
+    private static final long serialVersionUID = 6250791562500752579L;
+
+    public SendingException(Throwable cause) {
+        super(cause);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/impl/Axis2Protocol.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/impl/Axis2Protocol.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/impl/Axis2Protocol.java
new file mode 100644
index 0000000..7e2568a
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/impl/Axis2Protocol.java
@@ -0,0 +1,156 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger.protocol.impl;
+
+import java.io.StringReader;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.commons.CommonRoutines;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.messenger.protocol.DeliveryProtocol;
+import org.apache.airavata.wsmg.messenger.protocol.SendingException;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.util.ElementHelper;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class Axis2Protocol implements DeliveryProtocol {
+
+    private static final Logger logger = LoggerFactory.getLogger(Axis2Protocol.class);
+
+    private static SOAPFactory soapfactory = OMAbstractFactory.getSOAP11Factory();
+
+    private ServiceClient nonThreadLocalServiceClient;
+
+    long tcpConnectionTimeout;
+
+    public void deliver(ConsumerInfo consumerInfo, OMElement message, AdditionalMessageContent additionalMessageContent)
+            throws SendingException {
+        EndpointReference consumerReference = new EndpointReference(consumerInfo.getConsumerEprStr());
+
+        /*
+         * Extract information
+         */
+        String actionString = null;
+        List<OMElement> soapHeaders = new LinkedList<OMElement>();
+        if (consumerInfo.getType().compareTo("wsnt") == 0) {
+            actionString = NameSpaceConstants.WSNT_NS.getNamespaceURI() + "/Notify";
+        } else { // wse
+            actionString = additionalMessageContent.getAction();
+            String topicElString = additionalMessageContent.getTopicElement();
+            if (topicElString != null) {
+                OMElement topicEl = null;
+                try {
+                    topicEl = CommonRoutines.reader2OMElement(new StringReader(topicElString));
+                    soapHeaders.add(topicEl);
+                } catch (XMLStreamException e) {
+                    logger.error("exception at topicEl xmlStreamException", e);
+                }
+            }
+        }
+
+        ServiceClient client = null;
+        try {
+
+            client = configureServiceClient(actionString, consumerReference, additionalMessageContent.getMessageID(),
+                    soapHeaders);
+
+            client.sendRobust(message);
+
+        } catch (AxisFault ex) {
+            throw new SendingException(ex.getCause());
+        } finally {
+            if (client != null) {
+                try {
+                    client.cleanup();
+                    client.cleanupTransport();
+                } catch (AxisFault ex) {
+                    logger.error(ex.getMessage(), ex);
+                }
+            }
+        }
+    }
+
+    public void setTimeout(long timeout) {
+        this.tcpConnectionTimeout = timeout;
+    }
+
+    private ServiceClient configureServiceClient(String action, EndpointReference consumerLocation, String msgId,
+            List<OMElement> soapHeaders) throws AxisFault {
+
+        // not engaging addressing modules
+        ServiceClient client = getServiceClient();
+
+        SOAPHeaderBlock msgIdEl = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS);
+        msgIdEl.setText(msgId);
+        SOAPHeaderBlock actionEl = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS);
+        actionEl.setText(action);
+
+        SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS);
+        to.setText(consumerLocation.getAddress());
+
+        client.addHeader(actionEl);
+        client.addHeader(msgIdEl);
+        client.addHeader(to);
+
+        for (OMElement omHeader : soapHeaders) {
+            try {
+                SOAPHeaderBlock headerBlock = ElementHelper.toSOAPHeaderBlock(omHeader, soapfactory);
+                client.addHeader(headerBlock);
+            } catch (Exception e) {
+                throw AxisFault.makeFault(e);
+            }
+        }
+
+        Options opts = new Options();
+        opts.setTimeOutInMilliSeconds(tcpConnectionTimeout);
+        opts.setMessageId(msgId);
+        opts.setTo(consumerLocation);
+        opts.setAction(action);
+        opts.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
+        opts.setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION, HTTPConstants.HEADER_PROTOCOL_10);
+        client.setOptions(opts);
+
+        return client;
+    }
+
+    private ServiceClient getServiceClient() throws AxisFault {
+        if (nonThreadLocalServiceClient == null) {
+            nonThreadLocalServiceClient = new ServiceClient();
+        }
+        nonThreadLocalServiceClient.removeHeaders();
+        return nonThreadLocalServiceClient;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/SendingStrategy.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/SendingStrategy.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/SendingStrategy.java
new file mode 100644
index 0000000..9eb50cc
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/SendingStrategy.java
@@ -0,0 +1,33 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger.strategy;
+
+import org.apache.airavata.wsmg.commons.OutGoingMessage;
+import org.apache.airavata.wsmg.messenger.Deliverable;
+
+public interface SendingStrategy {
+    void init();
+
+    void addMessageToSend(OutGoingMessage outMessage, Deliverable deliverable);
+
+    void shutdown();
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ConsumerHandler.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ConsumerHandler.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ConsumerHandler.java
new file mode 100644
index 0000000..5236f47
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ConsumerHandler.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger.strategy.impl;
+
+import java.io.StringReader;
+import java.util.List;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.apache.airavata.wsmg.commons.CommonRoutines;
+import org.apache.airavata.wsmg.messenger.Deliverable;
+import org.apache.axiom.om.OMElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public abstract class ConsumerHandler implements Runnable {
+
+    private static final Logger log = LoggerFactory.getLogger(FixedParallelSender.class);
+
+    protected LinkedBlockingQueue<LightweightMsg> queue = new LinkedBlockingQueue<LightweightMsg>();
+
+    private String consumerUrl;
+
+    private Deliverable deliverable;
+
+    public ConsumerHandler(String url, Deliverable deliverable) {
+        this.consumerUrl = url;
+        this.deliverable = deliverable;
+    }
+
+    public String getConsumerUrl() {
+        return consumerUrl;
+    }
+
+    public void submitMessage(LightweightMsg msg) {
+        try {
+            queue.put(msg);
+        } catch (InterruptedException e) {
+            log.error("Interrupted when trying to add message");
+        }
+    }
+
+    protected void send(List<LightweightMsg> list) {
+        for (LightweightMsg m : list) {
+            try {
+                OMElement messgae2Send = CommonRoutines.reader2OMElement(new StringReader(m.getPayLoad()));
+                deliverable.send(m.getConsumerInfo(), messgae2Send, m.getHeader());
+            } catch (Exception e) {
+                log.error(e.getMessage(), e);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/FixedParallelSender.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/FixedParallelSender.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/FixedParallelSender.java
new file mode 100644
index 0000000..7d21fdb
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/FixedParallelSender.java
@@ -0,0 +1,185 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger.strategy.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.commons.OutGoingMessage;
+import org.apache.airavata.wsmg.messenger.Deliverable;
+import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class FixedParallelSender implements SendingStrategy {
+
+    private static final Logger log = LoggerFactory.getLogger(FixedParallelSender.class);
+
+    private static final long TIME_TO_WAIT_FOR_SHUTDOWN_SECOND = 30;
+
+    private HashMap<String, ConsumerHandler> activeConsumerHandlers = new HashMap<String, ConsumerHandler>();
+    private HashMap<String, Boolean> submittedConsumerHandlers = new HashMap<String, Boolean>();
+
+    private int batchSize;
+
+    private ExecutorService threadPool;
+
+    private boolean stop;
+
+    private Thread t;
+
+    public FixedParallelSender(int poolsize, int batchsize) {
+        this.threadPool = Executors.newFixedThreadPool(poolsize);
+        this.batchSize = batchsize;
+    }
+
+    public void init() {
+        this.t = new Thread(new ChooseHandlerToSubmit());
+        this.t.start();
+    }
+
+    public void addMessageToSend(OutGoingMessage outMessage, Deliverable deliverable) {
+        List<ConsumerInfo> consumerInfoList = outMessage.getConsumerInfoList();
+        for (ConsumerInfo consumer : consumerInfoList) {
+            sendToConsumerHandler(consumer, outMessage, deliverable);
+        }
+    }
+
+    public void shutdown() {
+        log.debug("Shutting down");
+        this.stop = true;
+
+        try {
+            this.t.join();
+        } catch (InterruptedException ie) {
+            log.error("Wait for ChooseHandlerToSubmit thread to finish (join) is interrupted");
+        }
+
+        threadPool.shutdown();
+        try {
+            threadPool.awaitTermination(TIME_TO_WAIT_FOR_SHUTDOWN_SECOND, TimeUnit.SECONDS);
+        } catch (InterruptedException ie) {
+            log.error("Interrupted while waiting thread pool to shutdown");
+        }
+
+        log.debug("Shut down");
+    }
+
+    private void sendToConsumerHandler(ConsumerInfo consumer, OutGoingMessage message, Deliverable deliverable) {
+
+        String consumerUrl = consumer.getConsumerEprStr();
+
+        LightweightMsg lwm = new LightweightMsg(consumer, message.getTextMessage(),
+                message.getAdditionalMessageContent());
+
+        synchronized (activeConsumerHandlers) {
+            ConsumerHandler handler = activeConsumerHandlers.get(consumerUrl);
+            if (handler == null) {
+                handler = new FixedParallelConsumerHandler(consumerUrl, deliverable);
+                activeConsumerHandlers.put(consumerUrl, handler);
+                submittedConsumerHandlers.put(consumerUrl, Boolean.FALSE);
+            }
+            handler.submitMessage(lwm);
+        }
+    }
+
+    class ChooseHandlerToSubmit implements Runnable {
+        private static final int SLEEP_TIME_SECONDS = 1;
+
+        public void run() {
+            /*
+             * If stop is true, we will not get any message to send from addMessageToSend() method. So,
+             * activeConsumerHandlers size will not increase but decrease only. When shutdown() is invoked, we will have
+             * to send out all messages in our queue.
+             */
+            while (!stop || activeConsumerHandlers.size() > 0) {
+
+                synchronized (activeConsumerHandlers) {
+                    Iterator<String> it = activeConsumerHandlers.keySet().iterator();
+                    while (it.hasNext()) {
+                        String key = it.next();
+                        boolean submitted = submittedConsumerHandlers.get(key);
+
+                        /*
+                         * If consumer handlers is not scheduled to run, submit it to thread pool.
+                         */
+                        if (!submitted) {
+                            threadPool.submit(activeConsumerHandlers.get(key));
+                            submittedConsumerHandlers.put(key, Boolean.TRUE);
+                        }
+                    }
+                }
+
+                try {
+                    TimeUnit.SECONDS.sleep(SLEEP_TIME_SECONDS);
+                } catch (InterruptedException e) {
+                    log.error("interrupted while waiting", e);
+                }
+            }
+        }
+    }
+
+    class FixedParallelConsumerHandler extends ConsumerHandler {
+
+        public FixedParallelConsumerHandler(String url, Deliverable deliverable) {
+            super(url, deliverable);
+        }
+
+        public void run() {
+
+            log.debug(String.format("FixedParallelConsumerHandler starting: %s", getConsumerUrl()));
+
+            ArrayList<LightweightMsg> localList = new ArrayList<LightweightMsg>();
+
+            queue.drainTo(localList, batchSize);
+
+            send(localList);
+            localList.clear();
+
+            /*
+             * Remove handler if and only if there is no message
+             */
+            synchronized (activeConsumerHandlers) {
+
+                /*
+                 * all message is sent or not, we will set it as not submitted. So, it can be put back to thread pool.
+                 */
+                submittedConsumerHandlers.put(getConsumerUrl(), Boolean.FALSE);
+
+                if (queue.size() == 0) {
+                    submittedConsumerHandlers.remove(getConsumerUrl());
+                    activeConsumerHandlers.remove(getConsumerUrl());
+
+                    log.debug(String.format("Consumer handler is already removed: %s", getConsumerUrl()));
+                }
+            }
+
+            log.debug(String.format("FixedParallelConsumerHandler done: %s,", getConsumerUrl()));
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/LightweightMsg.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/LightweightMsg.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/LightweightMsg.java
new file mode 100644
index 0000000..ca56c58
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/LightweightMsg.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger.strategy.impl;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+
+class LightweightMsg {
+    private ConsumerInfo consumerInfo;
+    private String payload;
+    private AdditionalMessageContent header;
+
+    public LightweightMsg(ConsumerInfo c, String pld, AdditionalMessageContent h) {
+        consumerInfo = c;
+        payload = pld;
+        header = h;
+    }
+
+    public String getPayLoad() {
+        return payload;
+    }
+
+    public ConsumerInfo getConsumerInfo() {
+        return consumerInfo;
+    }
+
+    public AdditionalMessageContent getHeader() {
+        return header;
+    }
+
+    public String toString() {
+        return String.format("header: %s, consumer: %s, pld: %s", header, consumerInfo.getConsumerEprStr(), payload);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ParallelSender.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ParallelSender.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ParallelSender.java
new file mode 100644
index 0000000..cede65d
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ParallelSender.java
@@ -0,0 +1,155 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger.strategy.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.commons.OutGoingMessage;
+import org.apache.airavata.wsmg.messenger.Deliverable;
+import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Each subscriber (URL Endpoint) will have its own thread to send a message to
+ * 
+ */
+public class ParallelSender implements SendingStrategy {
+
+    private static final Logger log = LoggerFactory.getLogger(ParallelSender.class);
+
+    private static final long TIME_TO_WAIT_FOR_SHUTDOWN_SECOND = 30;
+
+    private HashMap<String, ConsumerHandler> activeConsumerHandlers = new HashMap<String, ConsumerHandler>();
+
+    private ExecutorService threadPool;
+
+    public void init() {
+        this.threadPool = Executors.newCachedThreadPool();
+    }
+
+    public void addMessageToSend(OutGoingMessage outMessage, Deliverable deliverable) {
+        List<ConsumerInfo> consumerInfoList = outMessage.getConsumerInfoList();
+        for (ConsumerInfo consumer : consumerInfoList) {
+            sendToConsumerHandler(consumer, outMessage, deliverable);
+        }
+    }
+
+    public void shutdown() {
+        log.debug("Shutting down");
+
+        threadPool.shutdown();
+        try {
+            threadPool.awaitTermination(TIME_TO_WAIT_FOR_SHUTDOWN_SECOND, TimeUnit.SECONDS);
+        } catch (InterruptedException ie) {
+            log.error("Interrupted while waiting thread pool to shutdown");
+        }
+        log.debug("Shut down");
+    }
+
+    private void sendToConsumerHandler(ConsumerInfo consumer, OutGoingMessage message, Deliverable deliverable) {
+        String consumerUrl = consumer.getConsumerEprStr();
+
+        LightweightMsg lwm = new LightweightMsg(consumer, message.getTextMessage(),
+                message.getAdditionalMessageContent());
+
+        synchronized (activeConsumerHandlers) {
+            ConsumerHandler handler = activeConsumerHandlers.get(consumerUrl);
+            if (handler == null) {
+                handler = new ParallelConsumerHandler(consumerUrl, deliverable);
+                activeConsumerHandlers.put(consumerUrl, handler);
+                handler.submitMessage(lwm);
+                threadPool.submit(handler);
+            } else {
+                handler.submitMessage(lwm);
+            }
+        }
+    }
+
+    class ParallelConsumerHandler extends ConsumerHandler {
+
+        private static final int MAX_UNSUCCESSFUL_DRAINS = 3;
+        private static final int SLEEP_TIME_SECONDS = 1;
+        private int numberOfUnsuccessfulDrain = 0;
+
+        public ParallelConsumerHandler(String url, Deliverable deliverable) {
+            super(url, deliverable);
+        }
+
+        public void run() {
+            log.debug(String.format("ParallelConsumerHandler starting: %s", getConsumerUrl()));
+
+            ArrayList<LightweightMsg> localList = new ArrayList<LightweightMsg>();
+            while (true) {
+
+                /*
+                 * Try to find more message to send out
+                 */
+                if (queue.drainTo(localList) <= 0) {
+                    numberOfUnsuccessfulDrain++;
+                } else {
+                    numberOfUnsuccessfulDrain = 0;
+                }
+
+                /*
+                 * No new message for sometimes
+                 */
+                if (numberOfUnsuccessfulDrain >= MAX_UNSUCCESSFUL_DRAINS) {
+                    /*
+                     * Stop this thread if and only if there is no message
+                     */
+                    synchronized (activeConsumerHandlers) {
+                        if (queue.size() == 0) {
+                            if (activeConsumerHandlers.remove(getConsumerUrl()) != null) {
+                                log.debug(String.format("Consumer handler is already removed: %s", getConsumerUrl()));
+                            }
+                            log.debug(String.format("ParallelConsumerHandler done: %s,", getConsumerUrl()));
+                            break;
+                        }
+                    }
+                }
+
+                send(localList);
+                localList.clear();
+
+                if (numberOfUnsuccessfulDrain > 0) {
+                    waitForMessages();
+                }
+            }
+        }
+
+        private void waitForMessages() {
+            try {
+                TimeUnit.SECONDS.sleep(SLEEP_TIME_SECONDS);
+                log.debug("finished - waiting for messages");
+            } catch (InterruptedException e) {
+                log.error("interrupted while waiting for messages", e);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/SerialSender.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/SerialSender.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/SerialSender.java
new file mode 100644
index 0000000..380e559
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/SerialSender.java
@@ -0,0 +1,75 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger.strategy.impl;
+
+import java.io.StringReader;
+import java.util.List;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.commons.CommonRoutines;
+import org.apache.airavata.wsmg.commons.OutGoingMessage;
+import org.apache.airavata.wsmg.messenger.Deliverable;
+import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
+import org.apache.axiom.om.OMElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SerialSender implements SendingStrategy {
+
+    private static final Logger log = LoggerFactory.getLogger(SerialSender.class);
+
+    public void init() {
+    }
+
+    public void shutdown() {
+    }
+
+    public void addMessageToSend(OutGoingMessage outMessage, Deliverable deliverable) {
+        sendNotification(outMessage, deliverable);
+    }
+
+    public void sendNotification(OutGoingMessage outGoingMessage, Deliverable deliverable) {
+
+        if (outGoingMessage == null) {
+            log.error("Got a null outgoing message");
+            return;
+        }
+        String messageString = outGoingMessage.getTextMessage();
+
+        List<ConsumerInfo> consumerInfoList = outGoingMessage.getConsumerInfoList();
+        AdditionalMessageContent soapHeader = outGoingMessage.getAdditionalMessageContent();
+
+        try {
+            OMElement messgae2Send = CommonRoutines.reader2OMElement(new StringReader(messageString));
+
+            for (ConsumerInfo obj : consumerInfoList) {
+                deliverable.send(obj, messgae2Send, soapHeader);
+            }
+
+        } catch (XMLStreamException e) {
+            log.error(e.getMessage(), e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java
new file mode 100644
index 0000000..6400f63
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java
@@ -0,0 +1,121 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.util;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+
+public class BrokerUtil {
+
+    /**
+     * Compares String {@code x} with String {@code y}. The result is {@code true} if and only if both arguments are
+     * {@code null} or String {@code x} has the same sequence of characters as String {@code y}.
+     * 
+     * @param x
+     * @param y
+     * @return {@code true} if the String {@code x} and String {@code y} are equivalent, {@code false} otherwise
+     */
+    public static boolean sameStringValue(String x, String y) {
+        return (x == null && y == null) || (x != null && y != null && x.equals(y));
+    }
+
+    public static String getTopicLocalString(String filterText) {
+
+        if (filterText == null)
+            throw new IllegalArgumentException("filter text can't be null");
+
+        String localName = null;
+
+        int pos = filterText.indexOf(':');
+
+        if (pos != -1) {
+            localName = filterText.substring(pos + 1);
+
+        } else {
+
+            localName = filterText;
+        }
+
+        return localName;
+    }
+
+    /**
+     * 
+     * @return localString
+     * @throws AxisFault
+     */
+    public static String getXPathString(OMElement xpathEl) throws AxisFault {
+
+        if (xpathEl == null) {
+            throw new IllegalArgumentException("xpath element can't be null");
+        }
+
+        OMAttribute dialectAttribute = xpathEl.getAttribute(new QName("Dialect"));
+
+        if (dialectAttribute == null) {
+            dialectAttribute = xpathEl.getAttribute(new QName("DIALECT"));
+
+        }
+        if (dialectAttribute == null) {
+            throw new AxisFault("dialect is required for subscribe");
+        }
+        String dialectString = dialectAttribute.getAttributeValue();
+        if (!dialectString.equals(WsmgCommonConstants.XPATH_DIALECT)) {
+            // System.out.println("***Unkown dialect: " + dialectString);
+            throw new AxisFault("Unkown dialect: " + dialectString);
+        }
+        String xpathLocalString = xpathEl.getText();
+        return xpathLocalString;
+    }
+
+    public static String getTopicFromRequestPath(String topicPath) {
+        if (topicPath == null)
+            return null;
+        if (topicPath.length() == 0)
+            return null;
+        if (topicPath.startsWith("/")) {
+            topicPath = topicPath.substring(1);
+            if (topicPath.length() == 0)
+                return null;
+        }
+
+        String ret = null;
+
+        int index = topicPath.indexOf(WsmgCommonConstants.TOPIC_PREFIX);
+        if (index >= 0) {
+
+            ret = topicPath.substring(index + WsmgCommonConstants.TOPIC_PREFIX.length());
+
+            if (ret.length() == 0) {
+                ret = null;
+            }
+
+        }
+
+        return ret;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/Counter.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/Counter.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/Counter.java
new file mode 100644
index 0000000..bcd00a4
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/Counter.java
@@ -0,0 +1,77 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.util;
+
+import java.util.concurrent.atomic.AtomicLong;
+import java.util.concurrent.atomic.AtomicReference;
+
+//Used for stress test. use together with TimerThread
+public class Counter {
+
+    private AtomicLong counter = new AtomicLong(0);
+
+    private AtomicReference<String> otherStringValue = new AtomicReference<String>();
+
+    public void addCounter() {
+        counter.getAndIncrement();
+
+    }
+
+    public synchronized void addCounter(String otherValue) {
+        counter.getAndIncrement();
+        otherStringValue.set(otherValue);
+    }
+
+    /**
+     * @return Returns the counterValue.
+     */
+    public long getCounterValue() {
+
+        return counter.get();
+    }
+
+    /**
+     * @param counterValue
+     *            The counterValue to set.
+     */
+    public void setCounterValue(long counterValue) {
+        counter.set(counterValue);
+
+    }
+
+    /**
+     * @return Returns the otherValueString.
+     */
+    public String getOtherValueString() {
+
+        return otherStringValue.get();
+    }
+
+    /**
+     * @param otherValueString
+     *            The otherValueString to set.
+     */
+    public void setOtherValueString(String otherValueString) {
+        otherStringValue.set(otherValueString);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/RunTimeStatistics.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/RunTimeStatistics.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/RunTimeStatistics.java
new file mode 100644
index 0000000..a2c0bfc
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/RunTimeStatistics.java
@@ -0,0 +1,157 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.util;
+
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.TreeSet;
+
+import org.apache.airavata.wsmg.commons.CommonRoutines;
+import org.apache.airavata.wsmg.commons.WsmgVersion;
+
+public class RunTimeStatistics {
+    public static long totalMessageSize = 0;
+    public static long totalReceivedNotification = 0;
+    public static long totalSentOutNotification = 0;
+    public static long totalFailedNotification = 0;
+    public static long totalSubscriptions = 0;
+    public static long totalSubscriptionsAtStartUp = 0;
+    public static long totalUnSubscriptions = 0;
+    public static long minMessageSize = Long.MAX_VALUE;
+    public static long maxMessageSize = 0;
+    public static String startUpTime = "";
+    public static long totalSuccessfulDeliveryTime = 0;
+    public static long totalFailedDeliveryTime = 0;
+    public static long minSuccessfulDeliveryTime = Long.MAX_VALUE;
+    public static long maxSuccessfulDeliveryTime = 0;
+    public static long minFailedDeliveryTime = Long.MAX_VALUE;
+    public static long maxFailedDeliveryTime = 0;
+    public static final HashMap<String, Integer> failConsumerList = new HashMap<String, Integer>();
+
+    // public static TreeSet currentBlackList=new TreeSet();
+    // public static TreeSet previousBlackList=new TreeSet();
+
+    private static long startUpTimeInMillis;
+
+    public static synchronized void addNewNotificationMessageSize(int size) {
+        if (size < minMessageSize) {
+            minMessageSize = size;
+        }
+        if (size > maxMessageSize) {
+            maxMessageSize = size;
+        }
+        totalMessageSize += size;
+        totalReceivedNotification++;
+    }
+
+    public static synchronized void addNewSuccessfulDeliverTime(long deliveryTime) {
+        if (deliveryTime < minSuccessfulDeliveryTime) {
+            minSuccessfulDeliveryTime = deliveryTime;
+        }
+        if (deliveryTime > maxSuccessfulDeliveryTime) {
+            maxSuccessfulDeliveryTime = deliveryTime;
+        }
+        totalSuccessfulDeliveryTime += deliveryTime;
+        totalSentOutNotification++;
+    }
+
+    public static synchronized void addNewFailedDeliverTime(long deliveryTime) {
+        if (deliveryTime < minFailedDeliveryTime) {
+            minFailedDeliveryTime = deliveryTime;
+        }
+        if (deliveryTime > maxFailedDeliveryTime) {
+            maxFailedDeliveryTime = deliveryTime;
+        }
+        totalFailedDeliveryTime += deliveryTime;
+        totalFailedNotification++;
+    }
+
+    public static synchronized void addFailedConsumerURL(String url) {
+        Integer previousCount = failConsumerList.get(url);
+        if (previousCount == null) {
+            failConsumerList.put(url, 1);
+        } else {
+            previousCount++;
+            failConsumerList.put(url, previousCount);
+        }
+    }
+
+    public static void setStartUpTime() {
+        Date currentDate = new Date(); // Current date
+        startUpTime = CommonRoutines.getXsdDateTime(currentDate);
+        startUpTimeInMillis = currentDate.getTime();
+    }
+
+    public static String getHtmlString() {
+        String htmlString = "";
+
+        htmlString += "<p>Total incoming message number: <span class=\"xml-requests-count\">"
+                + totalReceivedNotification + "</span><br />\n";
+        htmlString += "Total successful outgoing message number: " + totalSentOutNotification + "<br>\n";
+        htmlString += "Total unreachable outgoing message number: " + totalFailedNotification + "<br>\n";
+        htmlString += "Total subscriptions requested: " + totalSubscriptions + "(+" + totalSubscriptionsAtStartUp
+                + " startUp)<br>\n";
+        htmlString += "Total Unsubscriptions requested: " + totalUnSubscriptions + "<br>\n";
+        htmlString += "</p>\n";
+        int averageMessageSize = 0;
+        if (totalReceivedNotification != 0) {
+            averageMessageSize = (int) (totalMessageSize / totalReceivedNotification);
+        }
+        htmlString += "<p>Average message size: " + averageMessageSize + " bytes<br>\n";
+        htmlString += "Max message size: " + maxMessageSize + " bytes<br>\n";
+        htmlString += "Min message size: " + minMessageSize + " bytes<br>\n";
+        htmlString += "</p>\n";
+        long averageSuccessfulDeliveryTime = 0;
+        if (totalSuccessfulDeliveryTime != 0) {
+            averageSuccessfulDeliveryTime = (totalSuccessfulDeliveryTime / totalSentOutNotification);
+        }
+        htmlString += "<p>Average Successful Delivery Time: " + averageSuccessfulDeliveryTime + " ms<br>\n";
+        htmlString += "Max Successful Delivery Time: " + maxSuccessfulDeliveryTime + " ms<br>\n";
+        htmlString += "Min Successful Delivery Time: " + minSuccessfulDeliveryTime + " ms<br>\n";
+        htmlString += "</p>\n";
+        long averageFailedDeliveryTime = 0;
+        if (totalFailedDeliveryTime != 0) {
+            averageFailedDeliveryTime = (totalFailedDeliveryTime / totalFailedNotification);
+        }
+        htmlString += "<p>Average Unreachable Delivery Time: " + averageFailedDeliveryTime + " ms<br>\n";
+        htmlString += "Max Unreachable Delivery Time: " + maxFailedDeliveryTime + " ms<br>\n";
+        htmlString += "Min Unreachable Delivery Time: " + minFailedDeliveryTime + " ms<br>\n";
+        htmlString += "</p>\n";
+        htmlString += "<p>Service started at: " + startUpTime + " <span class=\"starttime-seconds\">"
+                + startUpTimeInMillis + "</span> [seconds] since UNIX epoch)" + "<br />\n";
+
+        htmlString += "Version: <span class=\"service-name\">" + WsmgVersion.getImplementationVersion()
+                + "</span></p>\n";
+
+        htmlString += "<p>Total unreachable consumerUrl: " + failConsumerList.size() + " <br>\n";
+        TreeSet<String> consumerUrlList = new TreeSet<String>(failConsumerList.keySet());
+        Iterator<String> iter = consumerUrlList.iterator();
+        while (iter.hasNext()) {
+            String url = iter.next();
+            int failedCount = failConsumerList.get(url);
+            htmlString += "  " + url + " -->" + failedCount + " <br>\n";
+        }
+        htmlString += "</p>\n";
+        return htmlString;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/TimerThread.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/TimerThread.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/TimerThread.java
new file mode 100644
index 0000000..77f7c57
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/TimerThread.java
@@ -0,0 +1,87 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.util;
+
+public class TimerThread implements Runnable {
+    Counter counter;
+
+    long counterValue = 0;
+
+    long seqNum = 0;
+
+    String comment = "";
+
+    public TimerThread(Counter counter, String comment) {
+        this.counter = counter;
+        this.comment = comment;
+    }
+
+    public void run() {
+        long currentTime = 0;
+        long interval = 1000;
+        long lastCounter = 0;
+        long idleCount = 0;
+        // wait for about 5 sec and start from 000 time so that other thread can
+        // start together
+        currentTime = System.currentTimeMillis();
+        long launchTime = ((currentTime + 2000) / 1000) * 1000;
+        long sleepTime = launchTime - currentTime;
+        System.out.println("launchTime=" + launchTime + " SleepTime=" + sleepTime);
+        try {
+            Thread.sleep(sleepTime);
+        } catch (InterruptedException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        while (true) {
+            currentTime = System.currentTimeMillis();
+            counterValue = counter.getCounterValue();
+            long receivedCount = counterValue - lastCounter;
+            lastCounter = counterValue;
+            if (receivedCount == 0) {
+                idleCount++;
+            } else {
+                idleCount = 0;
+            }
+            if (receivedCount > 0 || (receivedCount == 0 && idleCount < 3)) {
+                // System.out.println("time="+currentTime+" counter="+
+                // counter.getCounterValue()+"
+                // received="+receivedCount+comment);
+                System.out.println(seqNum + " " + counter.getCounterValue() + " " + receivedCount + comment
+                        + counter.getOtherValueString());
+            }
+            seqNum++;
+            launchTime = launchTime + interval;
+            sleepTime = launchTime - currentTime;
+            // System.out.println("launchTime="+launchTime+"
+            // SleepTime="+sleepTime);
+            if (sleepTime < 0)
+                sleepTime = 0;
+            try {
+                Thread.sleep(sleepTime);
+            } catch (InterruptedException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsEventingOperations.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsEventingOperations.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsEventingOperations.java
new file mode 100644
index 0000000..931a5bf
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsEventingOperations.java
@@ -0,0 +1,55 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.util;
+
+public enum WsEventingOperations {
+
+    RENEW("renew"), PUBLISH("publish"), GET_STATUS("getStatus"), SUBSCRIPTION_END("subscriptionEnd"), SUBSCRIBE(
+            "subscribe"), UNSUBSCRIBE("unsubscribe");
+
+    private final String name;
+
+    private WsEventingOperations(String n) {
+        name = n;
+    }
+
+    public String toString() {
+        return name;
+    }
+
+    public boolean equals(String s) {
+        return name.equals(s);
+    }
+
+    public static WsEventingOperations valueFrom(String s) {
+        for (WsEventingOperations status : WsEventingOperations.values()) {
+            if (status.toString().equalsIgnoreCase(s)) {
+                return status;
+            }
+
+        }
+
+        throw new RuntimeException("invalid WsEventingOperation:- " + s);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsNotificationOperations.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsNotificationOperations.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsNotificationOperations.java
new file mode 100644
index 0000000..c771134
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsNotificationOperations.java
@@ -0,0 +1,56 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.util;
+
+public enum WsNotificationOperations {
+
+    NOTIFY("notify"), SUBSCRIBE("subscribe"), GET_CURRENT_MSG("getCurrentMessage"), PAUSE_REQUEST("gause"), RESUME_REQUEST(
+            "resume"), PAUSE_SUBSCRIPTION("pauseSubscription"), RESUME_SUBSCRIPTION("resumeSubscription"), REGISTER_PUBLISHER(
+            "registerPublisher"), UNSUBSCRIBE("unsubscribe");
+
+    private final String name;
+
+    private WsNotificationOperations(String n) {
+        name = n;
+    }
+
+    public String toString() {
+        return name;
+    }
+
+    public boolean equals(String s) {
+        return name.equals(s);
+    }
+
+    public static WsNotificationOperations valueFrom(String s) {
+        for (WsNotificationOperations status : WsNotificationOperations.values()) {
+            if (status.toString().equalsIgnoreCase(s)) {
+                return status;
+            }
+
+        }
+
+        throw new RuntimeException("invalid Ws notification Operation:- " + s);
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/cleanDBScript.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/cleanDBScript.sql b/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/cleanDBScript.sql
new file mode 100755
index 0000000..5663ebf
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/cleanDBScript.sql
@@ -0,0 +1,27 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+ 
+delete from disQ;
+delete from MaxIDTable;
+delete from MinIDTable;
+delete from specialSubscription;
+delete from subscription;
+delete from msgbox;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-derby.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-derby.sql b/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-derby.sql
new file mode 100644
index 0000000..80b51a4
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-derby.sql
@@ -0,0 +1,60 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+ 
+CREATE TABLE SUBSCRIPTION (
+                SUBSCRIPTIONID VARCHAR(200) NOT NULL DEFAULT '',          
+                TOPICS VARCHAR(255) DEFAULT '',                               
+                XPATH VARCHAR(200) DEFAULT '',                       
+                CONSUMERADDRESS VARCHAR(255) DEFAULT '',                      
+                REFERENCEPROPERTIES BLOB,
+                CONTENT BLOB,                                                     
+                WSRM INTEGER NOT NULL DEFAULT 0 ,                                  
+                CREATIONTIME TIMESTAMP NOT NULL  
+              );
+CREATE TABLE SPECIALSUBSCRIPTION (                              
+                       SUBSCRIPTIONID VARCHAR(200) NOT NULL DEFAULT '',              
+                       TOPICS VARCHAR(255) DEFAULT '',                               
+                       XPATH VARCHAR(200) DEFAULT '',                                
+                       CONSUMERADDRESS VARCHAR(255) DEFAULT '',                      
+                       REFERENCEPROPERTIES BLOB,                                     
+                       CONTENT BLOB,                                                     
+                       WSRM INTEGER NOT NULL DEFAULT 0,                         
+                       CREATIONTIME TIMESTAMP NOT NULL 
+                     );               
+
+	
+CREATE TABLE DISQ (                       
+          ID BIGINT GENERATED BY DEFAULT AS IDENTITY,
+          TRACKID VARCHAR(100) DEFAULT NULL,      
+          MESSAGE BLOB,                           
+          STATUS INTEGER  DEFAULT NULL,    
+          TOPIC VARCHAR(255) DEFAULT '',     
+          PRIMARY KEY  (ID)                       
+        );	
+	
+CREATE TABLE MAXIDTABLE(
+	MAXID INTEGER
+	);
+	
+CREATE TABLE MINIDTABLE(
+	MINID INTEGER
+	);
+	

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-mysql.sql b/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-mysql.sql
new file mode 100755
index 0000000..cb506ef
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-mysql.sql
@@ -0,0 +1,61 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+ 
+CREATE DATABASE IF NOT EXISTS wsmg;
+CREATE TABLE `subscription` (
+                `SubscriptionId` varchar(200) NOT NULL default '',
+                `Topics` varchar(255) default '',
+                `XPath` varchar(200) default '',
+                `ConsumerAddress` varchar(255) default '',
+                `ReferenceProperties` blob,
+                `content` blob,
+                `wsrm` tinyint(1) NOT NULL default '0',
+                `CreationTime` datetime NOT NULL default '0000-00-00 00:00:00'
+              );
+CREATE TABLE `specialSubscription` (
+                       `SubscriptionId` varchar(200) NOT NULL default '',
+                       `Topics` varchar(255) default '',
+                       `XPath` varchar(200) default '',
+                       `ConsumerAddress` varchar(255) default '',
+                       `ReferenceProperties` blob,
+                       `content` blob,
+                       `wsrm` tinyint(1) NOT NULL default '0',
+                       `CreationTime` datetime NOT NULL default '0000-00-00 00:00:00'
+                     );
+
+
+CREATE TABLE `disQ` (
+          `id` bigint(11) NOT NULL auto_increment,
+          `trackId` varchar(100) default NULL,
+          `message` longblob,
+          `status` int(11) default NULL,
+          `topic` varchar(255) default '',
+          PRIMARY KEY  (`id`)
+        );
+
+CREATE TABLE MaxIDTable(
+       maxID integer
+       );
+
+CREATE TABLE MinIDTable(
+       minID integer
+       );
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/resources/services.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/resources/services.xml b/modules/ws-messenger/messagebroker/src/main/resources/services.xml
new file mode 100644
index 0000000..229262c
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/resources/services.xml
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<serviceGroup>
+    <service name="EventingService" class="org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle">
+
+        <operation name="renew">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew
+            </actionMapping>
+            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="getStatus">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus
+            </actionMapping>
+            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="subscriptionEnd">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd
+            </actionMapping>
+        </operation>
+
+        <operation name="subscribe">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
+            </actionMapping>
+            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="unsubscribe">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
+            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe
+            </actionMapping>
+            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="publish">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingPublishMsgReceiver" />
+            <actionMapping>http://org.apache.airavata/WseNotification
+            </actionMapping>
+        </operation>
+
+    </service>
+
+    <service name="NotificationService" class="org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle">
+
+        <operation name="notify">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/Notify
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/NotifyResponse
+            </outputActionMapping>
+        </operation>
+        
+        <operation name="subscribe">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequestResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="getCurrentMessage">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageResponse
+            </outputActionMapping>
+        </operation>
+        
+        <operation name="pauseSubscription">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubsriptionRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubscriptionResponse
+            </outputActionMapping>
+        </operation>
+        
+        <operation name="resumeSubscription">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubsriptionRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubscriptionResponse
+            </outputActionMapping>
+        </operation>
+
+        <operation name="unsubscribe">
+            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
+            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubsribeRequest
+            </actionMapping>
+            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubscribeResponse
+            </outputActionMapping>
+        </operation>
+
+    </service>
+
+    <parameter name="configuration.file.name" locked="false">airavata-server.properties</parameter>
+
+</serviceGroup>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSETest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSETest.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSETest.java
new file mode 100644
index 0000000..4867ba7
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSETest.java
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.airavata.wsmg.util.TestUtilServer;
+import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.junit.Test;
+
+public class BrokerWSETest extends TestCase implements ConsumerNotificationHandler {
+
+    private static int port = TestUtilServer.TESTING_PORT;
+    static Properties configs = new Properties();
+
+    public void handleNotification(SOAPEnvelope msgEnvelope) {
+        System.out.println("Received " + msgEnvelope);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        TestUtilServer.start(null, null);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        TestUtilServer.stop();
+    }
+
+    @Test
+    public void testRoundTrip() throws InterruptedException {
+
+        try {
+
+            String brokerEPR = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
+            long value = System.currentTimeMillis();
+            String msg = String.format("<msg> current time is : %d </msg>", value);
+
+            WseMsgBrokerClient wseMsgBrokerClient = new WseMsgBrokerClient();
+            wseMsgBrokerClient.init(brokerEPR);
+            int consumerPort = TestUtilServer.getAvailablePort();
+
+            String[] consumerEPRs = wseMsgBrokerClient.startConsumerService(consumerPort, this);
+
+            assertTrue(consumerEPRs.length > 0);
+
+            String topic = "WseRoundTripTestTopic";
+
+            String subscriptionID = wseMsgBrokerClient.subscribe(consumerEPRs[0], topic, null);
+            System.out.println("topic sub id = " + subscriptionID);
+
+            try {
+                wseMsgBrokerClient.publish(topic, msg);
+                wseMsgBrokerClient.publish(topic, AXIOMUtil.stringToOM("<foo><bar>Test</bar></foo>"));
+            } catch (Exception e) {
+                fail(e.getMessage());
+            }
+
+            Thread.sleep(2000);
+
+            try {
+                wseMsgBrokerClient.unSubscribe(subscriptionID);
+            } catch (AxisFault e) {
+                e.printStackTrace();
+                fail(e.getMessage());
+            }
+            wseMsgBrokerClient.shutdownConsumerService();
+
+        } catch (AxisFault e) {
+            e.printStackTrace();
+            try {
+                System.in.read();
+            } catch (IOException e1) {
+                e1.printStackTrace();
+            }
+            fail("unexpected exception occured");
+        }
+        System.out.println("Broker roundtrip done");
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSNTTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSNTTest.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSNTTest.java
new file mode 100644
index 0000000..baebd31
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSNTTest.java
@@ -0,0 +1,108 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker;
+
+import java.io.IOException;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
+import org.apache.airavata.wsmg.client.WsntMsgBrokerClient;
+import org.apache.airavata.wsmg.util.TestUtilServer;
+import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.junit.Test;
+
+public class BrokerWSNTTest extends TestCase implements ConsumerNotificationHandler {
+
+    static Properties configs = new Properties();
+
+    public void handleNotification(SOAPEnvelope msgEnvelope) {
+        System.out.println("Received " + msgEnvelope);
+    }
+
+    @Override
+    protected void setUp() throws Exception {
+        TestUtilServer.start(null, null);
+    }
+
+    @Override
+    protected void tearDown() throws Exception {
+        TestUtilServer.stop();
+    }
+
+    @Test
+    public void testRoundTrip() throws InterruptedException {
+
+        try {
+            long value = System.currentTimeMillis();
+            String msg = String.format("<msg> current time is : %d </msg>", value);
+
+            WsntMsgBrokerClient wsntMsgBrokerClient = new WsntMsgBrokerClient();
+
+            int consumerPort = 6767;
+
+            String brokerEPR = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/NotificationService";
+            wsntMsgBrokerClient.init(brokerEPR);
+            String[] consumerEPRs = wsntMsgBrokerClient.startConsumerService(consumerPort, this);
+
+            assertTrue(consumerEPRs.length > 0);
+
+            String topic = "/WsntRoundTripTestTopic";
+
+            String topicSubscriptionID = wsntMsgBrokerClient.subscribe(consumerEPRs[0], topic, null);
+            System.out.println("topic subscription id: " + topicSubscriptionID);
+
+            try {
+                wsntMsgBrokerClient.publish(topic, msg);
+                wsntMsgBrokerClient.publish(topic, AXIOMUtil.stringToOM("<foo><bar>Test</bar></foo>"));
+            } catch (Exception e) {
+                fail(e.getMessage());
+            }
+
+            Thread.sleep(2000);
+
+            try {
+                wsntMsgBrokerClient.unSubscribe(topicSubscriptionID);
+            } catch (AxisFault e) {
+                e.printStackTrace();
+                fail(e.getMessage());
+            }
+
+            wsntMsgBrokerClient.shutdownConsumerService();
+
+        } catch (AxisFault e) {
+            e.printStackTrace();
+            try {
+                System.in.read();
+            } catch (IOException e1) {
+                e1.printStackTrace();
+            }
+
+            fail("unexpected exception occured");
+        }
+        System.out.println("Broker roundtrip done");
+
+    }
+}


[03/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
deleted file mode 100644
index ca72e5f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionDialog.java
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.descriptors;
-
-import java.awt.Color;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.io.File;
-import java.util.List;
-
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JDialog;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JSeparator;
-import javax.swing.JTextField;
-import javax.swing.ProgressMonitor;
-import javax.swing.SwingConstants;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.GlobusHostType;
-import org.apache.airavata.schemas.gfac.GsisshHostType;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.SSHHostType;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.menues.MenuIcons;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLinkButton;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.apache.xmlbeans.XmlException;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class ApplicationDescriptionDialog extends JDialog implements ActionListener {
-    /**
-	 * 
-	 */
-    private static final long serialVersionUID = -2745085755585610025L;
-    private XBayaTextField txtExecPath;
-    private XBayaTextField txtAppName;
-    private XBayaTextField txtTempDir;
-
-    private AiravataAPI registry;
-    private ApplicationDescription shellApplicationDescription;
-    private JLabel lblError;
-    private boolean applcationDescCreated = false;
-    private JButton okButton;
-
-    private String serviceName;
-    private String hostName;
-    private JComboBox cmbHostName;
-
-    private XBayaEngine engine;
-	private JButton btnHostAdvanceOptions;
-	private boolean newDescritor;
-	private ApplicationDescription originalDescription;
-	private String originalHost; 
-	private String originalService;
-    private ServiceDescription serviceDescription=null;
-	private JButton btnTmpDirBrowse;
-	private JButton btnExecBrowse;
-
-    /**
-     * Launch the application.
-     */
-    public static void main(String[] args) {
-        try {
-            ApplicationDescriptionDialog dialog = new ApplicationDescriptionDialog(null);
-            dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-            dialog.setVisible(true);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    public ApplicationDescriptionDialog(XBayaEngine engine) {
-    	this(engine,true,null,null,null);
-    }
-    /**
-     * Create the dialog.
-     */
-    public ApplicationDescriptionDialog(XBayaEngine engine, boolean newDescritor, ApplicationDescription originalDescription, String originalHost, String originalService) {
-    	setNewDescritor(newDescritor);
-    	setOriginalDescription(originalDescription);
-    	setOriginalHost(originalHost);
-    	setOriginalService(originalService);
-        setRegistry(engine.getConfiguration().getAiravataAPI());
-        addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowOpened(WindowEvent arg0) {
-                if (isNewDescritor()) {
-					String baseName = "Application";
-					int i = 1;
-					String defaultName = baseName + i;
-					try {
-						ApplicationDescription applicationDescription = getRegistry()
-								.getApplicationManager().getApplicationDescription(getServiceName(),
-                                        getHostName());
-						while (true) {
-							boolean notFound = true;
-							if (applicationDescription.getType()
-									.getApplicationName().getStringValue()
-									.equals(defaultName)) {
-								notFound = false;
-								break;
-							}
-							if (notFound) {
-								break;
-							}
-							defaultName = baseName + (++i);
-						}
-					} catch (Exception e) {
-						e.printStackTrace();
-					}
-					txtAppName.setText(defaultName);
-					setApplicationName(txtAppName.getText());
-				}
-            }
-        });
-        this.engine=engine;
-        iniGUI();
-        if (originalService!=null){
-    		try {
-    			ServiceDescription disc = getRegistry().getApplicationManager().getServiceDescription(originalService);
-    			if(disc!=null){
-    				setServiceDescription(disc);
-    			}
-    			throw new AiravataAPIInvocationException(new Exception("Service Description not found in registry."));
-			} catch (AiravataAPIInvocationException e) {
-				e.printStackTrace();
-			}
-    	}
-    }
-
-    public void open() {
-        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        setVisible(true);
-    }
-
-    protected ApplicationDescriptionDialog getDialog() {
-        return this;
-    }
-    
-    private void iniGUI() {
-        if (isNewDescritor()) {
-			setTitle("Application Description");
-		}else{
-			setTitle("Update Application Description: "+ getOriginalDescription().getType().getApplicationName().getStringValue());
-		}
-		setBounds(100, 100, 600, 620);
-        setModal(true);
-        setLocationRelativeTo(null);
-        GridPanel buttonPane = new GridPanel();
-//        getContentPane().setLayout(new BorderLayout());
-        {
-        	
-//            buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
-//            getContentPane().add(buttonPane, BorderLayout.SOUTH);
-
-            lblError = new JLabel("");
-            lblError.setForeground(Color.RED);
-            buttonPane.add(lblError);
-            if (!isNewDescritor()){
-            	JButton resetButton = new JButton("Reset");
-                resetButton.addActionListener(new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        loadData();
-                    }
-                });
-                buttonPane.add(resetButton);
-            }
-            {
-                okButton = new JButton("Save");
-                if (!isNewDescritor()){
-                	okButton.setText("Update");
-                }
-                okButton.addActionListener(new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        saveApplicationDescription();
-                        close();
-                    }
-                });
-                okButton.setEnabled(false);
-                okButton.setActionCommand("OK");
-                buttonPane.add(okButton);
-                getRootPane().setDefaultButton(okButton);
-            }
-            {
-                JButton cancelButton = new JButton("Cancel");
-                cancelButton.addActionListener(new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        setApplicationDescCreated(false);
-                        close();
-                    }
-                });
-                cancelButton.setActionCommand("Cancel");
-                buttonPane.add(cancelButton);
-            }
-        }
-        {
-//            JPanel panel = new JPanel();
-//            getContentPane().add(panel, BorderLayout.CENTER);
-        	JPanel execPath=new JPanel();
-            txtExecPath = new XBayaTextField();
-            txtExecPath.getTextField().addKeyListener(new KeyAdapter() {
-                @Override
-                public void keyReleased(KeyEvent e) {
-                    setExecutablePath(txtExecPath.getText());
-                }
-            });
-            txtExecPath.getTextField().addFocusListener(new FocusAdapter() {
-            	@Override
-            	public void focusLost(FocusEvent e) {
-            		super.focusLost(e);
-            		updateTempDirWithExecPath(txtExecPath.getText());
-            	}
-			});
-            txtExecPath.setColumns(10);
-            btnExecBrowse=new JButton(MenuIcons.OPEN_ICON);
-            btnExecBrowse.addActionListener(new ActionListener(){
-				@Override
-				public void actionPerformed(ActionEvent arg0) {
-					JFileChooser c = new JFileChooser();
-					int rVal = c.showOpenDialog(null);
-					if (rVal == JFileChooser.APPROVE_OPTION) {
-						txtExecPath.setText(c.getSelectedFile().toString());
-						setExecutablePath(txtExecPath.getText());
-					}
-				}
-            });
-            execPath.add(txtExecPath.getSwingComponent());
-            execPath.add(btnExecBrowse);
-            JButton btnIOParameters = new JButton("IO Parameters...");
-            btnIOParameters.addActionListener(new ActionListener(){
-				@Override
-				public void actionPerformed(ActionEvent event) {
-					try {
-                        ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),getServiceDescription()==null,getServiceDescription(),false,getApplicationName());
-                        serviceDescriptionDialog.setLocationRelativeTo(getContentPane());
-                        serviceDescriptionDialog.open();
-                        if (serviceDescriptionDialog.isServiceCreated()) {
-                        	setServiceDescription(serviceDescriptionDialog.getServiceDescription());
-                        }
-                    } catch (Exception e1) {
-                        e1.printStackTrace();
-                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
-                    }
-				}
-            });
-            execPath.add(new JLabel("   "));
-            execPath.add(btnIOParameters);
-            
-            setupLayoutForBrowse(execPath,txtExecPath.getSwingComponent());
-
-            txtAppName = new XBayaTextField();
-            txtAppName.getTextField().addKeyListener(new KeyAdapter() {
-                @Override
-                public void keyReleased(KeyEvent arg0) {
-                    setApplicationName(txtAppName.getText());
-                }
-            });
-            txtAppName.setColumns(10);
-            XBayaLabel lblApplicationName = new XBayaLabel("Application name",txtAppName);
-            JLabel lblExecutablePath = new JLabel("Executable path");
-        	JPanel tmpDirPath=new JPanel();
-
-            txtTempDir = new XBayaTextField();
-            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
-                @Override
-                public void keyReleased(KeyEvent e) {
-                    setTempDir(txtTempDir.getText());
-                }
-            });
-            txtTempDir.setColumns(10);
-            btnTmpDirBrowse=new JButton(MenuIcons.OPEN_DIR_ICON);
-            btnTmpDirBrowse.addActionListener(new ActionListener(){
-				@Override
-				public void actionPerformed(ActionEvent arg0) {
-					JFileChooser c = new JFileChooser();
-					c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-					int rVal = c.showOpenDialog(null);
-					if (rVal == JFileChooser.APPROVE_OPTION) {
-						txtTempDir.setText(c.getSelectedFile().toString());
-						setTempDir(txtTempDir.getText());
-					}
-				}
-            });
-            JTextField component = txtTempDir.getSwingComponent();
-			tmpDirPath.add(component);
-            tmpDirPath.add(btnTmpDirBrowse);
-//            tmpDirPath.layout(1, 2, 0, 0);
-            
-            setupLayoutForBrowse(tmpDirPath, component);
-
-
-            JLabel lblTemporaryDirectory = new JLabel("Scratch working directory");
-
-            JButton btnAdvance = new JButton("Advanced application configurations...");
-            btnAdvance.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent e) {
-                    try {
-                        ApplicationDescriptionAdvancedOptionDialog serviceDescriptionDialog = new ApplicationDescriptionAdvancedOptionDialog(
-                                getRegistry(), getShellApplicationDescription());
-                        serviceDescriptionDialog.open();
-                    } catch (Exception e1) {
-                        e1.printStackTrace();
-                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
-                    }
-                }
-            });
-
-//            cmbServiceName.setRenderer(new DefaultListCellRenderer());
-            cmbHostName = new JComboBox();
-            cmbHostName.addActionListener(this);
-
-            XBayaLabel lblHostName = new XBayaLabel("Application host",cmbHostName);
-//            lblHostName.getSwingComponent().setFont(new Font("Tahoma", Font.ITALIC, 11));
-            XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
-            lnkNewHost.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent e) {
-                    try {
-                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine.getConfiguration().getAiravataAPI(), null);
-                        hostDescriptionDialog.setLocationRelativeTo(getContentPane());
-                        hostDescriptionDialog.open();
-
-                        if (hostDescriptionDialog.isHostCreated()) {
-                        	ProgressMonitor progressMonitor = new ProgressMonitor(getContentPane(), "Host Descriptions", "Refreshing host list..", 0, 200);
-                        	int progress=1;
-                        	progressMonitor.setProgress(progress++);
-                        	while(cmbHostName.getSelectedIndex()==-1 || !cmbHostName.getSelectedItem().toString().equals(hostDescriptionDialog.getHostLocation())){
-	                            loadHostDescriptions();
-	                            cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
-	                            progressMonitor.setProgress(progress++);
-	                            Thread.sleep(50);
-                        	}
-                        	progressMonitor.setProgress(200);
-                        }
-                    } catch (Exception e1) {
-                        e1.printStackTrace();
-                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
-                    }
-                }
-            });
-            lnkNewHost.setText("Create new host...");
-            lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);
-
-//            JLabel lblBindThisDeployment = new JLabel("Bind this deployment description to:");
-//            lblBindThisDeployment.setFont(new Font("Tahoma", Font.BOLD, 11));
-
-            btnHostAdvanceOptions=new JButton("HPC Configuration...");
-            btnHostAdvanceOptions.addActionListener(new ActionListener() {
-				@Override
-				public void actionPerformed(ActionEvent arg0) {
-					try {
-						ApplicationDescriptionHostAdvancedOptionDialog hostAdvancedOptionsDialog = new ApplicationDescriptionHostAdvancedOptionDialog(getRegistry(),getShellApplicationDescription());
-                        hostAdvancedOptionsDialog.open();
-                    } catch (Exception e1) {
-                        e1.printStackTrace();
-                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
-                    }
-				}
-			});
-            btnHostAdvanceOptions.setVisible(false);
-            GridPanel hostPanel=new GridPanel();
-            hostPanel.add(cmbHostName);
-            hostPanel.add(btnHostAdvanceOptions);
-            
-            SwingUtil.layoutToGrid(hostPanel.getSwingComponent(), 1, 2, 0, 0);
-            GridPanel infoPanel0 = new GridPanel();
-
-            infoPanel0.add(lblApplicationName);
-            infoPanel0.add(txtAppName);
-            
-            GridPanel infoPanel1 = new GridPanel();
-
-            
-            infoPanel1.add(lblExecutablePath);
-            infoPanel1.add(execPath);
-//            infoPanel1.add(new JLabel());
-//            infoPanel1.add(btnIOParameters);
-            infoPanel1.add(lblTemporaryDirectory);
-            infoPanel1.add(tmpDirPath);
-//            infoPanel1.add(new JLabel());
-//            infoPanel1.add(btnAdvance);
-            
-//            GridPanel infoPanel2 = new GridPanel();
-//            infoPanel2.add(new JSeparator());
-//            infoPanel2.add(lblBindThisDeployment);
-            
-            GridPanel infoPanel3 = new GridPanel();
-
-            infoPanel3.add(lblHostName);
-            infoPanel3.add(hostPanel);
-            infoPanel3.add(new JLabel());
-            infoPanel3.add(lnkNewHost);
-            
-            GridPanel infoPanel4=new GridPanel();
-            infoPanel4.add(new JLabel());
-            infoPanel4.add(btnAdvance);
-            infoPanel4.layout(1, 2, 0, 0);
-            
-            SwingUtil.layoutToGrid(infoPanel0.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, 1);
-
-            SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 4, 1, SwingUtil.WEIGHT_NONE, 0);
-//            SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE, 0);
-            SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
-
-            GridPanel infoPanel = new GridPanel();
-            infoPanel.add(infoPanel0);
-            infoPanel.add(new JSeparator());
-            infoPanel.add(infoPanel1);
-            infoPanel.add(new JSeparator());
-//          infoPanel.add(infoPanel2);
-			infoPanel.add(infoPanel3);
-			
-
-            infoPanel.add(new JSeparator());
-            infoPanel.add(infoPanel4);
-            
-            SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 7, 1, SwingUtil.WEIGHT_NONE, 0);
-            SwingUtil.layoutToGrid(buttonPane.getSwingComponent(), 1, buttonPane.getContentPanel().getComponentCount(),SwingUtil.WEIGHT_NONE,0);
-            getContentPane().add(infoPanel.getSwingComponent());
-            getContentPane().add(buttonPane.getSwingComponent());
-            
-            buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-            infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-
-            SwingUtil.layoutToGrid(getContentPane(), 2, 1, -1, 0);
-//            loadServiceDescriptions();
-            loadHostDescriptions();
-        }
-        setResizable(true);
-        getRootPane().setDefaultButton(okButton);
-        if (!isNewDescritor()){
-        	loadData();
-        }
-        pack();
-        if (getSize().getWidth()<500){
-        	setSize(500, getSize().height);
-        }
-    }
-
-	private void setupLayoutForBrowse(JPanel tmpDirPath, JTextField component) {
-		GridBagLayout layout;
-		GridBagConstraints constraints;
-		layout = new GridBagLayout();
-		constraints = new GridBagConstraints();
-		constraints.fill = GridBagConstraints.BOTH;
-		constraints.weightx = 1;
-		layout.setConstraints(component, constraints);
-		tmpDirPath.setLayout(layout);
-	}
-
-//    private void loadServiceDescriptions() {
-//        cmbServiceName.removeAllItems();
-//        setServiceName(null);
-//        try {
-//            List<ServiceDescription> serviceDescriptions = getRegistry().searchServiceDescription("");
-//            for (ServiceDescription serviceDescription : serviceDescriptions) {
-//                cmbServiceName.addItem(serviceDescription.getType().getName());
-//            }
-//        } catch (Exception e) {
-//            setError(e.getLocalizedMessage());
-//        }
-//        updateServiceName();
-//    }
-
-    private void loadData(){
-    	txtAppName.setText(getOriginalDescription().getType().getApplicationName().getStringValue());
-    	setApplicationName(txtAppName.getText());
-    	txtExecPath.setText(getOriginalDescription().getType().getExecutableLocation());
-    	setExecutablePath(txtExecPath.getText());
-    	txtTempDir.setText(getOriginalDescription().getType().getScratchWorkingDirectory());
-    	setTempDir(txtTempDir.getText());
-
-    	cmbHostName.setSelectedItem(getOriginalHost());
-    	setHostName(cmbHostName.getSelectedItem().toString());
-//    	cmbServiceName.setSelectedItem(getOriginalService());
-    	setServiceName(null);
-    	txtAppName.setEditable(isNewDescritor());
-    }
-    
-    private void loadHostDescriptions() {
-        cmbHostName.removeAllItems();
-        setHostName(null);
-        try {
-            List<HostDescription> hostDescriptions = getRegistry().getApplicationManager().getAllHostDescriptions();
-            for (HostDescription hostDescription : hostDescriptions) {
-                if (hostDescription.getType().getHostName() == null) {
-                    cmbHostName.addItem(hostDescription.getType().getHostName());
-                } else {
-                    cmbHostName.addItem(hostDescription.getType().getHostName());
-                }
-            }
-        } catch (Exception e) {
-            setError(e.getLocalizedMessage());
-        }
-        updateHostName();
-    }
-
-    public ApplicationDescription getShellApplicationDescription() {
-        if(shellApplicationDescription == null){
-            if (isNewDescritor()) {
-				shellApplicationDescription = new ApplicationDescription();
-			}else{
-				try {
-					shellApplicationDescription= ApplicationDescription.fromXML(getOriginalDescription().toXML());
-				} catch (XmlException e) {
-					//shouldn't happen (hopefully)
-				}
-			}
-        }
-        return shellApplicationDescription;
-    }
-
-    public ApplicationDeploymentDescriptionType getApplicationDescriptionType() {
-    	return getShellApplicationDescription().getType();
-    }
-    
-    public String getApplicationName() {
-        return getApplicationDescriptionType().getApplicationName().getStringValue();
-    }
-
-    public void setApplicationName(String applicationName) {
-//        ApplicationDeploymentDescriptionType.ApplicationName applicationName1 = getApplicationDescriptionType().addNewApplicationName();
-//        applicationName1.setStringValue(applicationName);
-    	if (getApplicationDescriptionType().getApplicationName()==null){
-    		getApplicationDescriptionType().addNewApplicationName();
-    	}
-    	getApplicationDescriptionType().getApplicationName().setStringValue(applicationName);
-        updateDialogStatus();
-    }
-
-    public String getExecutablePath() {
-        return getApplicationDescriptionType().getExecutableLocation();
-    }
-
-    public void setExecutablePath(String executablePath) {
-    	getApplicationDescriptionType().setExecutableLocation(executablePath);
-    	updateTempDirWithExecPath(executablePath);
-        updateDialogStatus();
-    }
-
-	private void updateTempDirWithExecPath(String executablePath) {
-		if (!executablePath.trim().equals("") && (!txtExecPath.getSwingComponent().isFocusOwner()) && 
-				(getApplicationDescriptionType().getScratchWorkingDirectory()==null || getApplicationDescriptionType().getScratchWorkingDirectory().trim().equalsIgnoreCase(""))){
-    		String temp_location = "workflow_runs";
-			String tempDir = new File(new File(executablePath).getParentFile(),temp_location).toString();
-			txtTempDir.setText(tempDir);
-    		txtTempDir.getSwingComponent().setSelectionStart(tempDir.length()-temp_location.length());
-    		txtTempDir.getSwingComponent().setSelectionEnd(tempDir.length());
-    		setTempDir(txtTempDir.getText());
-    		txtTempDir.getSwingComponent().requestFocus();
-    	}
-	}
-
-    public String getTempDir() {
-        return getApplicationDescriptionType().getScratchWorkingDirectory();
-    }
-
-    public void setTempDir(String tempDir) {
-    	getApplicationDescriptionType().setScratchWorkingDirectory(tempDir);
-        updateDialogStatus();
-    }
-
-    public void close() {
-        getDialog().setVisible(false);
-    }
-
-    public void saveApplicationDescription() {
-        try {
-			try {
-				getRegistry().getApplicationManager().saveApplicationDescription(getServiceName(), getHostName(), getShellApplicationDescription());
-			} catch (AiravataAPIInvocationException e) {
-				getRegistry().getApplicationManager().updateApplicationDescriptor(getServiceName(), getHostName(), getShellApplicationDescription());
-			}
-			if (!isNewDescritor() && (!getServiceName().equals(getOriginalService()) || !getHostName().equals(getOriginalHost()))) {
-				try {
-					getRegistry().getApplicationManager().deleteApplicationDescription(getOriginalService(),
-                            getOriginalHost(), getOriginalDescription().getType()
-                            .getApplicationName().getStringValue());
-				} catch (AiravataAPIInvocationException e) {
-					engine.getGUI().getErrorWindow().error(e);
-				}
-			}
-			setApplicationDescCreated(true);
-		} catch (AiravataAPIInvocationException e) {
-			engine.getGUI().getErrorWindow().error(e);
-		}
-    }
-
-    public boolean isApplicationDescCreated() {
-        return applcationDescCreated;
-    }
-
-    public void setApplicationDescCreated(boolean applicationDescCreated) {
-        this.applcationDescCreated = applicationDescCreated;
-    }
-
-    private void setError(String errorMessage) {
-        if (errorMessage == null || errorMessage.trim().equals("")) {
-            lblError.setText("");
-        } else {
-            lblError.setText(errorMessage.trim());
-        }
-    }
-
-    private void updateDialogStatus() {
-        String message = null;
-        try {
-            validateDialog();
-        } catch (Exception e) {
-            message = e.getLocalizedMessage();
-        }
-        okButton.setEnabled(message == null);
-        setError(message);
-    }
-
-    private void validateDialog() throws Exception {
-        if (getApplicationName() == null || getApplicationName().trim().equals("")) {
-            throw new Exception("Name of the application cannot be empty!!!");
-        }
-
-        ApplicationDescription descriptions = null;
-        try {
-            descriptions = getRegistry().getApplicationManager().getApplicationDescriptor(getServiceName(), getHostName(),
-                    getApplicationName());
-        } catch (AiravataAPIInvocationException e) {
-            throw e;
-        }
-        if (descriptions !=null && (isNewDescritor() || (!getServiceName().equals(getOriginalService()) || !getHostName().equals(getOriginalHost())))) {
-            throw new Exception("Application name already exists for the selected service & host!!!");
-        }
-
-        if (getExecutablePath() == null || getExecutablePath().trim().equals("")) {
-            throw new Exception("Executable path cannot be empty!!!");
-        }
-
-        if (getTempDir() == null || getTempDir().trim().equals("")) {
-            throw new Exception("Temporary directory location cannot be empty!!!");
-        }
-
-        if (getServiceName() == null || getServiceName().trim().equals("")) {
-            throw new Exception("Click on IO Parameters...  to define parameters for the application");
-        }
-
-        if (getHostName() == null || getHostName().trim().equals("")) {
-            throw new Exception("Please select/create host to bind to this deployment description");
-        }
-
-    }
-
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    public void setServiceName(String serviceName) {
-        this.serviceName = serviceName;
-        updateDialogStatus();
-    }
-
-    public String getHostName() {
-        return hostName;
-    }
-
-    public void setHostName(String hostName) {
-        this.hostName = hostName;
-        if (hostName!=null) {
-			HostDescription hostDescription;
-			try {
-				hostDescription = registry.getApplicationManager().getHostDescription(hostName);
-				if (hostDescription.getType() instanceof GlobusHostType) {
-					getShellApplicationDescription().getType().changeType(
-					        HpcApplicationDeploymentType.type);
-				} else if (hostDescription.getType() instanceof GsisshHostType) {
-						getShellApplicationDescription().getType().changeType(
-						        HpcApplicationDeploymentType.type);
-				} else if (hostDescription.getType() instanceof SSHHostType && ((SSHHostType)hostDescription.getType()).getHpcResource()) {
-					getShellApplicationDescription().getType().changeType(
-					        HpcApplicationDeploymentType.type);
-				} else {
-					getShellApplicationDescription().getType().changeType(
-							ApplicationDeploymentDescriptionType.type);
-				}
-				btnHostAdvanceOptions.setVisible(getShellApplicationDescription().getType() instanceof HpcApplicationDeploymentType);
-				String hostAddress = hostDescription.getType().getHostAddress();
-				boolean isLocal = isLocalAddress(hostAddress);
-				btnExecBrowse.setVisible(isLocal);
-				btnTmpDirBrowse.setVisible(isLocal);
-				
-			} catch (AiravataAPIInvocationException e) {
-				//not there - ouch
-			}
-		}
-		updateDialogStatus();
-    }
-
-	private boolean isLocalAddress(String hostAddress) {
-		return hostAddress.equalsIgnoreCase("localhost") || hostAddress.equalsIgnoreCase("127.0.0.1");
-	}
-
-    private void updateServiceName() {
-        if (getServiceDescription() == null) {
-        	setServiceName(null);
-        }else{
-            setServiceName(getServiceDescription().getType().getName());
-        }
-    }
-
-    private void updateHostName() {
-        if (cmbHostName.getSelectedItem() != null) {
-            setHostName(cmbHostName.getSelectedItem().toString());
-        }
-    }
-
-    @Override
-    public void actionPerformed(ActionEvent e) {
-//        if (e.getSource() == cmbServiceName) {
-//            updateServiceName();
-//        }
-        if (e.getSource() == cmbHostName) {
-            updateHostName();
-        }
-        if (e.getSource() == txtAppName) {
-            setApplicationName(txtAppName.getText());
-        }
-        if (e.getSource() == txtExecPath) {
-            setExecutablePath(txtExecPath.getText());
-        }
-        if (e.getSource() == txtTempDir) {
-            setTempDir(txtTempDir.getText());
-        }
-    }
-
-    public AiravataAPI getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-
-	public boolean isNewDescritor() {
-		return newDescritor;
-	}
-
-	public void setNewDescritor(boolean newDescritor) {
-		this.newDescritor = newDescritor;
-	}
-
-	public ApplicationDescription getOriginalDescription() {
-		return originalDescription;
-	}
-
-	public void setOriginalDescription(
-            ApplicationDescription originalDescription) {
-		this.originalDescription = originalDescription;
-	}
-
-	public String getOriginalService() {
-		return originalService;
-	}
-
-	public void setOriginalService(String originalService) {
-		this.originalService = originalService;
-	}
-
-	public String getOriginalHost() {
-		return originalHost;
-	}
-
-	public void setOriginalHost(String originalHost) {
-		this.originalHost = originalHost;
-	}
-
-	public ServiceDescription getServiceDescription() {
-		return serviceDescription;
-	}
-
-	private void setServiceDescription(ServiceDescription serviceDescription) {
-		this.serviceDescription = serviceDescription;
-		updateServiceName();
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionHostAdvancedOptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionHostAdvancedOptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionHostAdvancedOptionDialog.java
deleted file mode 100644
index ac7d234..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionHostAdvancedOptionDialog.java
+++ /dev/null
@@ -1,459 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.descriptors;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.BorderFactory;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JOptionPane;
-import javax.swing.JScrollPane;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.schemas.gfac.HpcApplicationDeploymentType;
-import org.apache.airavata.schemas.gfac.JobTypeType;
-import org.apache.airavata.schemas.gfac.JobTypeType.Enum;
-import org.apache.airavata.schemas.gfac.ProjectAccountType;
-import org.apache.airavata.schemas.gfac.QueueType;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaComboBox;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class ApplicationDescriptionHostAdvancedOptionDialog extends JDialog {
-    private static final long serialVersionUID = 3920479739097405014L;
-    private XBayaComboBox cmbJobType;
-    private XBayaTextField txtProjectAccountNumber;
-    private XBayaTextField txtProjectAccountDescription;
-    private XBayaTextField txtQueueType;
-    private XBayaTextField txtMaxWallTime = new XBayaTextField();
-    private XBayaTextField txtMinMemory = new XBayaTextField();
-    private XBayaTextField txtMaxMemory = new XBayaTextField();
-    private XBayaTextField txtCpuCount = new XBayaTextField();
-    private XBayaTextField txtNodeCount = new XBayaTextField();
-    private XBayaTextField txtProcessorsPerNode = new XBayaTextField();
-    private JButton okButton;
-    private AiravataAPI registry;
-    private ApplicationDescription descriptor;
-	private XBayaLabel lblCpuCount;
-	private XBayaLabel lblProcessorPerNode;
-    private XBayaLabel lbNodeCount;
-	private XBayaTextField txtjobSubmitterCommand;
-	private XBayaTextField txtinstalledParentPath;
-
-    /**
-     * Create the dialog.
-     */
-    public ApplicationDescriptionHostAdvancedOptionDialog(AiravataAPI registry, ApplicationDescription descriptor) {
-        addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowOpened(WindowEvent arg0) {
-                loadApplicationDescriptionAdvancedOptions();
-            }
-        });
-        setRegistry(registry);
-        setShellApplicationDescription(descriptor);
-        initGUI();
-    }
-
-    public void open() {
-        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        setVisible(true);
-    }
-
-    protected ApplicationDescriptionHostAdvancedOptionDialog getDialog() {
-        return this;
-    }
-
-    public void close() {
-        getDialog().setVisible(false);
-    }
-
-    private void initGUI() {
-        setTitle("HPC Configuration Options");
-        setModal(true);
-        setBounds(100, 100, 500, 500);
-        setLocationRelativeTo(null);
-        GridPanel buttonPane = new GridPanel();
-        okButton = new JButton("Update");
-        okButton.setActionCommand("OK");
-        okButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                if (saveApplicationDescriptionAdvancedOptions()){
-                	close();
-                }
-            }
-        });
-        getRootPane().setDefaultButton(okButton);
-    
-        JButton cancelButton = new JButton("Cancel");
-        cancelButton.setActionCommand("Cancel");
-        cancelButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                close();
-            }
-        });
-            
-        
-    	GridPanel panel = new GridPanel();
-		txtProjectAccountNumber = new XBayaTextField();
-		txtProjectAccountDescription = new XBayaTextField();
-
-        txtQueueType = new XBayaTextField();
-        txtMaxWallTime = new XBayaTextField();
-        txtMinMemory = new XBayaTextField();
-        txtMaxMemory = new XBayaTextField();
-        txtCpuCount = new XBayaTextField();
-        txtProcessorsPerNode = new XBayaTextField();
-        txtNodeCount = new XBayaTextField();
-        txtjobSubmitterCommand = new XBayaTextField();
-        txtinstalledParentPath = new XBayaTextField();
-        
-
-        DefaultComboBoxModel cmbModelJobType = new DefaultComboBoxModel(getJobTypesAsStrings());
-		cmbJobType = new XBayaComboBox(cmbModelJobType);
-        cmbJobType.setEditable(false);
-        //FIXME:: Machines like trestles are mandating to have cpu and node types set. So better to have these enabled.
-//        cmbJobType.getSwingComponent().addActionListener(new ActionListener(){
-//			@Override
-//			public void actionPerformed(ActionEvent arg0) {
-//				boolean disabled=cmbJobType.getText().equalsIgnoreCase(JobTypeType.SERIAL.toString()) || cmbJobType.getText().equalsIgnoreCase(JobTypeType.SINGLE.toString());
-//				txtCpuCount.setEnabled(!disabled);
-//				txtProcessorsPerNode.setEnabled(!disabled);
-//				lblCpuCount.getSwingComponent().setEnabled(!disabled);
-//				lblProcessorPerNode.getSwingComponent().setEnabled(!disabled);
-//			}
-//        });
-        
-		XBayaLabel lbljobType = new XBayaLabel("Job Type",cmbJobType);
-		XBayaLabel lblProjectAccountNumber = new XBayaLabel("Project Account Number *",txtProjectAccountNumber);
-		XBayaLabel lblProjectAccountDescription = new XBayaLabel("Project Account Description",txtProjectAccountDescription);
-        XBayaLabel lblQueueType = new XBayaLabel("Queue Type *",txtQueueType);
-		XBayaLabel lblMaxWallTime = new XBayaLabel("Max Wall Time",txtMaxWallTime);
-		lblCpuCount = new XBayaLabel("CPU Count",txtCpuCount);
-		lblProcessorPerNode = new XBayaLabel("Processor Per Node", txtProcessorsPerNode);
-		XBayaLabel lblMinMemory = new XBayaLabel("Min Memory",txtMinMemory);
-		XBayaLabel lblMaxMemory = new XBayaLabel("Max Memory",txtMaxMemory);
-        lbNodeCount = new XBayaLabel("Node Count", txtNodeCount);
-        XBayaLabel lbljobSubmitterCommand = new XBayaLabel("Job Submitter Command",txtjobSubmitterCommand);
-        XBayaLabel lblinstalledParentPath = new XBayaLabel("Installed Parent Path",txtinstalledParentPath);
-        
-		panel.add(lbljobType);
-		panel.add(cmbJobType);
-		panel.add(lblProjectAccountNumber);
-		panel.add(txtProjectAccountNumber);
-		panel.add(lblProjectAccountDescription);
-		panel.add(txtProjectAccountDescription);
-		panel.add(lblQueueType);
-		panel.add(txtQueueType);
-        panel.add(lblMaxWallTime);
-		panel.add(txtMaxWallTime);
-        panel.add(lblCpuCount);
-		panel.add(txtCpuCount);
-        panel.add(lbNodeCount);
-        panel.add(txtNodeCount);
-        panel.add(lblProcessorPerNode);
-		panel.add(txtProcessorsPerNode);
-        panel.add(lblMinMemory);
-		panel.add(txtMinMemory);
-        panel.add(lblMaxMemory);
-        panel.add(txtMaxMemory);
-        panel.add(lbljobSubmitterCommand);
-        panel.add(txtjobSubmitterCommand);
-        panel.add(lblinstalledParentPath);
-        panel.add(txtinstalledParentPath);
-		panel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-
-        SwingUtil.layoutToGrid(panel.getSwingComponent(), 12, 2, SwingUtil.WEIGHT_NONE, 1);
-        
-        buttonPane.add(okButton);
-        buttonPane.add(cancelButton);
-        
-        JScrollPane thePane = new JScrollPane(panel.getSwingComponent());
-
-        getContentPane().add(thePane);
-        getContentPane().add(buttonPane.getSwingComponent());
-        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
-        setResizable(true);
-        getRootPane().setDefaultButton(okButton);
-    }
-    
-    private static List<JobTypeType.Enum> jobTypes;
-    
-	private List<JobTypeType.Enum> getJobTypes() {
-		if (jobTypes==null){
-			jobTypes = new ArrayList<Enum>();
-			jobTypes.add(JobTypeType.SERIAL);
-			jobTypes.add(JobTypeType.OPEN_MP);
-			jobTypes.add(JobTypeType.MPI);
-//            jobTypes.add(JobTypeType.SINGLE);
-		}
-		return jobTypes;
-	}
-
-	private String[] getJobTypesAsStrings() {
-		List<String> typeList=new ArrayList<String>();
-		for (Enum jtype : getJobTypes()) {
-			typeList.add(jtype.toString());
-		}
-		return typeList.toArray(new String[]{});
-	}
-
-	private Enum getJobTypeEnum(String jobTypeString){
-		for (Enum jtype : getJobTypes()) {
-			if (jtype.toString().equalsIgnoreCase(jobTypeString)){
-				return jtype;
-			}
-		}
-		return null;
-	}
-	
-    public ApplicationDescription getApplicationDescription() {
-        return descriptor;
-    }
-
-    public HpcApplicationDeploymentType getHPCApplicationDescriptionType() {
-        return (HpcApplicationDeploymentType)descriptor.getType();
-    }
-    
-    public void setShellApplicationDescription(ApplicationDescription shellApplicationDescription) {
-        this.descriptor = shellApplicationDescription;
-    }
-
-    private boolean isValueNotEmpty(String s){
-    	return !s.trim().isEmpty();
-    }
-    
-    private void showError(String message, String title){
-    	JOptionPane.showMessageDialog(null, message, title, JOptionPane.ERROR_MESSAGE);
-    }
-    private boolean saveApplicationDescriptionAdvancedOptions() {
-		if (isValueNotEmpty(cmbJobType.getText())) {
-		    getHPCApplicationDescriptionType().setJobType(
-					getJobTypeEnum(cmbJobType.getText()));
-		}
-		try {
-			if (isValueNotEmpty(txtMaxWallTime.getText())) {
-			    getHPCApplicationDescriptionType().setMaxWallTime(
-						Integer.parseInt(txtMaxWallTime.getText()));
-			}
-		} catch (NumberFormatException e) {
-			showError("Max wall time must be a number", "Invalid value");
-			return false;
-		}
-		try {
-			if (isValueNotEmpty(txtCpuCount.getText())) {
-			    getHPCApplicationDescriptionType().setCpuCount(
-						Integer.parseInt(txtCpuCount.getText()));
-			}
-		} catch (NumberFormatException e) {
-			showError("CPU count must be a number", "Invalid value");
-			return false;
-		}
-		try {
-			if (isValueNotEmpty(txtProcessorsPerNode.getText())) {
-			    getHPCApplicationDescriptionType().setProcessorsPerNode(
-						Integer.parseInt(txtProcessorsPerNode.getText()));
-			}
-		} catch (NumberFormatException e) {
-			showError("Processors per node must be a number", "Invalid value");
-			return false;
-		}
-        try {
-			if (isValueNotEmpty(txtNodeCount.getText())) {
-			    getHPCApplicationDescriptionType().setNodeCount(
-						Integer.parseInt(txtNodeCount.getText()));
-			}
-		} catch (NumberFormatException e) {
-			showError("Node count must be a number", "Invalid value");
-			return false;
-		}
-		try {
-			if (isValueNotEmpty(txtMinMemory.getText())) {
-			    getHPCApplicationDescriptionType().setMinMemory(
-						Integer.parseInt(txtMinMemory.getText()));
-			}
-		} catch (NumberFormatException e) {
-			showError("Minimum memory must be a number", "Invalid value");
-			return false;
-		}
-	    try {
-			if (isValueNotEmpty(txtMaxMemory.getText())) {
-			    getHPCApplicationDescriptionType().setMaxMemory(
-		                Integer.parseInt(txtMaxMemory.getText()));
-		    }
-		} catch (NumberFormatException e) {
-			showError("Maximum memory must be a number", "Invalid value");
-			return false;
-		}
-	    try {
-			if (isValueNotEmpty(txtjobSubmitterCommand.getText())) {
-			    getHPCApplicationDescriptionType().setJobSubmitterCommand(
-		                txtjobSubmitterCommand.getText());
-		    }else{
-		    	getHPCApplicationDescriptionType().setJobSubmitterCommand(null);
-		    }
-		} catch (NumberFormatException e) {
-			showError("Maximum memory must be a number", "Invalid value");
-			return false;
-		}
-	    try {
-			if (isValueNotEmpty(txtinstalledParentPath.getText())) {
-			    getHPCApplicationDescriptionType().setInstalledParentPath(
-			    		txtinstalledParentPath.getText());
-		    }else{
-		    	getHPCApplicationDescriptionType().setInstalledParentPath(null);
-		    }
-		} catch (NumberFormatException e) {
-			showError("Maximum memory must be a number", "Invalid value");
-			return false;
-		}	    
-		ProjectAccountType projectAccount = getProjectAccountType();
-		if (isValueNotEmpty(txtProjectAccountNumber.getText())) {
-			projectAccount.setProjectAccountNumber(txtProjectAccountNumber
-					.getText());
-		}
-		if (isValueNotEmpty(txtProjectAccountDescription.getText())) {
-			projectAccount
-					.setProjectAccountDescription(txtProjectAccountDescription
-							.getText());
-		}
-		if (isValueNotEmpty(txtQueueType.getText())) {
-			QueueType queueName = getQueueName();
-			queueName.setQueueName(txtQueueType.getText());
-		}
-		return true;
-    }
-
-	private QueueType getQueueName() {
-		if (getHPCApplicationDescriptionType().getQueue()==null){
-		    getHPCApplicationDescriptionType().addNewQueue();
-		}
-		return getHPCApplicationDescriptionType().getQueue();
-	}
-
-	private ProjectAccountType getProjectAccountType() {
-		if (getHPCApplicationDescriptionType().getProjectAccount()==null){
-		    getHPCApplicationDescriptionType().addNewProjectAccount();
-		}
-		return getHPCApplicationDescriptionType().getProjectAccount();
-	}
-    
-	private String getPropValue(int num){
-		if (num==0){
-			return "";
-		}else{
-			return String.valueOf(num);
-		}
-	}
-	
-    private void loadApplicationDescriptionAdvancedOptions() {
-        HpcApplicationDeploymentType hpcAppType = getHPCApplicationDescriptionType();
-		if (hpcAppType.getJobType()!=null) {
-			cmbJobType.setSelectedItem(hpcAppType
-					.getJobType().toString());
-		}
-    	txtMaxWallTime.setText(getPropValue(hpcAppType.getMaxWallTime()));
-        txtCpuCount.setText(getPropValue(hpcAppType.getCpuCount()));
-        txtNodeCount.setText(getPropValue(hpcAppType.getNodeCount()));
-        txtProcessorsPerNode.setText(getPropValue(hpcAppType.getProcessorsPerNode()));
-        txtMinMemory.setText(getPropValue(hpcAppType.getMinMemory()));
-        txtMaxMemory.setText(getPropValue(hpcAppType.getMaxMemory()));
-        txtNodeCount.setText(getPropValue(hpcAppType.getNodeCount()));
-        txtjobSubmitterCommand.setText(hpcAppType.getJobSubmitterCommand()==null?"":hpcAppType.getJobSubmitterCommand());
-        txtinstalledParentPath.setText(hpcAppType.getInstalledParentPath()==null?"":hpcAppType.getInstalledParentPath());
-		ProjectAccountType projectAccount = getProjectAccountType();
-
-		txtProjectAccountNumber.setText(projectAccount.getProjectAccountNumber()==null? "":projectAccount.getProjectAccountNumber());
-		txtProjectAccountDescription.setText(projectAccount.getProjectAccountDescription()==null? "":projectAccount.getProjectAccountDescription());
-
-		QueueType queueName = getQueueName();
-		txtQueueType.setText(queueName.getQueueName()==null?"":queueName.getQueueName());
-    }
-
-    public AiravataAPI getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-
-    // private void updateDialogStatus(){
-    // String message=null;
-    // try {
-    // validateDialog();
-    // } catch (Exception e) {
-    // message=e.getLocalizedMessage();
-    // }
-    // okButton.setEnabled(message==null);
-    // setError(message);
-    // }
-    //
-    // private void validateDialog() throws Exception{
-    // if (getApplicationName()==null || getApplicationName().trim().equals("")){
-    // throw new Exception("Name of the application cannot be empty!!!");
-    // }
-    //
-    // List<ApplicationDeploymentDescription> deploymentDescriptions=null;
-    // try {
-    // deploymentDescriptions = getJCRComponentRegistry().getRegistry().searchApplicationDescription(getServiceName(),
-    // getHostName(), Pattern.quote(getApplicationName()));
-    // } catch (PathNotFoundException e) {
-    // //what we want
-    // } catch (Exception e){
-    // throw e;
-    // }
-    // if (deploymentDescriptions.size()>0){
-    // throw new Exception("Application descriptor with the given name already exists!!!");
-    // }
-    //
-    // if (getExecutablePath()==null || getExecutablePath().trim().equals("")){
-    // throw new Exception("Executable path cannot be empty!!!");
-    // }
-    //
-    // if (getTempDir()==null || getTempDir().trim().equals("")){
-    // throw new Exception("Temporary directory location cannot be empty!!!");
-    // }
-    //
-    // if (getServiceName()==null || getServiceName().trim().equals("")){
-    // throw new Exception("Please select/create service to bind to this deployment description");
-    // }
-    //
-    // if (getHostName()==null || getHostName().trim().equals("")){
-    // throw new Exception("Please select/create host to bind to this deployment description");
-    // }
-    //
-    // }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DeploymentDescriptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DeploymentDescriptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DeploymentDescriptionDialog.java
deleted file mode 100644
index 8b52d01..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DeploymentDescriptionDialog.java
+++ /dev/null
@@ -1,816 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.descriptors;
-
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.*;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumn;
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.DataType;
-import org.apache.airavata.schemas.gfac.HostDescriptionType;
-import org.apache.airavata.schemas.gfac.InputParameterType;
-import org.apache.airavata.schemas.gfac.OutputParameterType;
-import org.apache.airavata.schemas.gfac.ParameterType;
-import org.apache.airavata.schemas.gfac.ServiceDescriptionType;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.HostDeploymentDialog.HostDeployment;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.apache.xmlbeans.XmlCursor;
-
-public class DeploymentDescriptionDialog extends JDialog {
-
-    private static final long serialVersionUID = 2705760838264284423L;
-    private final GridPanel contentPanel = new GridPanel();
-    private XBayaLabel lblServiceName;
-    private XBayaTextField txtApplicationServiceName;
-    private JTable tblParameters;
-    private boolean serviceCreated = false;
-    private JLabel lblError;
-    private ServiceDescription serviceDescription;
-    private ServiceDescription orginalServiceDescription;
-    private JButton okButton;
-    private JButton btnDeleteParameter;
-    private DefaultTableModel defaultTableModel;
-    private AiravataAPI registry;
-    private boolean newDescription;
-    private boolean ignoreTableChanges=false;
-	private JCheckBox chkForceFileStagingToWorkDir;
-	private String suggestedNamePrefix;
-	private String titlePrefix;
-	private Map<String,HostDeployment> deployments;
-	private JTable tblHosts;
-	private DefaultTableModel tblModelHosts;
-	
-    /**
-     * Launch the application.
-     */
-    public static void main(String[] args) {
-        try {
-            DeploymentDescriptionDialog dialog = new DeploymentDescriptionDialog(null,true,null,null);
-            dialog.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
-            dialog.setVisible(true);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    public DeploymentDescriptionDialog(JFrame parent, AiravataAPI registry) {
-    	this(registry, true, null, parent);
-    }
-
-//    public DeploymentDescriptionDialog(Frame parent) {
-//        super(parent);
-//    }
-
-    /**
-     * Create the dialog.
-     */
-    public DeploymentDescriptionDialog(AiravataAPI registry, boolean newDescription, ServiceDescription serviceDescription, JFrame parent) {
-        super(parent);
-        setNewDescription(newDescription);
-    	this.setOrginalServiceDescription(serviceDescription);
-    	setSuggestedNamePrefix(suggestedNamePrefix);
-
-    	if (isNewDescription()) {
-			setTitlePrefix("Register Application");
-		}else{
-			setTitlePrefix("Update Application: "+getOrginalServiceDescription().getType().getName());
-		}
-        addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowOpened(WindowEvent arg0) {
-//                if (isNewDescription()) {
-//					String baseName = "Application";
-//					int i;
-//					String defaultName;
-//					i = 1;
-//					defaultName = baseName+i;
-//					try {
-//						while (getRegistry().getServiceDescription(defaultName) != null) {
-//							defaultName = baseName + (++i);
-//						}
-//					} catch (Exception e) {
-//					}
-//					txtApplicationServiceName.setText(defaultName);
-//					setServiceName(txtApplicationServiceName.getText());
-//				}
-            }
-        });
-        setRegistry(registry);
-        initGUI();
-
-    }
-
-    public void open() {
-//        pack();
-//        setAlwaysOnTop(true);
-        setLocationRelativeTo(getOwner());
-        setModal(true);
-        setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
-        setVisible(true);
-    }
-
-    protected DeploymentDescriptionDialog getDialog() {
-        return this;
-    }
-
-    private void initGUI() {
-    	setTitle(getTitlePrefix());
-		setBounds(100, 100, 463, 459);
-        setModal(true);
-        setLocationRelativeTo(null);
-        BorderLayout borderLayout = new BorderLayout();
-        borderLayout.setVgap(5);
-        borderLayout.setHgap(5);
-        getContentPane().setLayout(borderLayout);
-
-        txtApplicationServiceName = new XBayaTextField();
-        txtApplicationServiceName.getSwingComponent().addKeyListener(new KeyAdapter() {
-            @Override
-            public void keyReleased(KeyEvent e) {
-                setServiceName(txtApplicationServiceName.getText());
-            }
-        });
-        txtApplicationServiceName.setColumns(10);
-        lblServiceName = new XBayaLabel("Application name",txtApplicationServiceName);
-        JLabel lblInputParameters = new JLabel("Application Parameters");
-        lblInputParameters.setFont(new Font("Tahoma", Font.BOLD, 11));
-
-        JScrollPane scrollPane = new JScrollPane();
-        tblParameters=createParameterTableControls();
-        scrollPane.setViewportView(tblParameters);
-        
-		chkForceFileStagingToWorkDir=new JCheckBox("Advanced: Force input file staging to working directory");
-        chkForceFileStagingToWorkDir.addActionListener(new ActionListener(){
-
-			public void actionPerformed(ActionEvent arg0) {
-				setForceFileStagingToWorkDir(chkForceFileStagingToWorkDir.isSelected());
-			}
-        	
-        });
-        GridPanel buttonPane = new GridPanel();
-        {
-            GridBagLayout gbl_buttonPane = new GridBagLayout();
-            gbl_buttonPane.columnWidths = new int[] { 307, 136, 0 };
-            gbl_buttonPane.rowHeights = new int[] { 33, 0 };
-            gbl_buttonPane.columnWeights = new double[] { 0.0, 0.0, Double.MIN_VALUE };
-            gbl_buttonPane.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
-            
-
-            lblError = new JLabel("");
-            lblError.setForeground(Color.RED);
-            GridBagConstraints gbc_lblError = new GridBagConstraints();
-            gbc_lblError.insets = new Insets(0, 0, 0, 5);
-            gbc_lblError.gridx = 0;
-            gbc_lblError.gridy = 0;
-            buttonPane.add(lblError);
-            JPanel panel = new JPanel();
-            GridBagConstraints gbc_panel = new GridBagConstraints();
-            gbc_panel.anchor = GridBagConstraints.NORTHWEST;
-            gbc_panel.gridx = 1;
-            gbc_panel.gridy = 0;
-            buttonPane.add(panel);
-            {
-            	JButton resetButton = new JButton("Reset");
-                resetButton.addActionListener(new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                    	loadData();
-                    }
-                });
-                panel.add(resetButton);
-            }
-            {
-                okButton = new JButton("Register");
-                if (!isNewDescription()){
-                	okButton.setText("Update");
-                }
-                okButton.setEnabled(false);
-                okButton.addActionListener(new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        try {
-                            if ("Register".equals(okButton.getText())) {
-                                saveServiceDescription(false);
-                            } else {
-                                saveServiceDescription(true);
-                            }
-							close();
-						} catch (AiravataAPIInvocationException e1) {
-							e1.printStackTrace();
-						}
-                    }
-                });
-                panel.add(okButton);
-                okButton.setActionCommand("OK");
-                getRootPane().setDefaultButton(okButton);
-            }
-            {
-                JButton cancelButton = new JButton("Cancel");
-                cancelButton.addActionListener(new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        setServiceCreated(false);
-                        close();
-                    }
-                });
-                panel.add(cancelButton);
-                cancelButton.setActionCommand("Cancel");
-            }
-        }
-        contentPanel.add(lblServiceName);
-        contentPanel.add(txtApplicationServiceName);
-        GridPanel pnlTables=new GridPanel();
-        
-        GridPanel parameterPanel=new GridPanel();
-		parameterPanel.add(lblInputParameters);
-        parameterPanel.add(scrollPane);
-    	parameterPanel.add(btnDeleteParameter);
-    	parameterPanel.add(chkForceFileStagingToWorkDir);
-    	
-        SwingUtil.layoutToGrid(contentPanel.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, 1);
-    	SwingUtil.layoutToGrid(parameterPanel.getSwingComponent(), 4, 1, 1, 0);
-    	
-    	pnlTables.add(parameterPanel);
-    	pnlTables.add(createHostDeploymentTable());
-    	
-    	pnlTables.layout(2, 1, SwingUtil.WEIGHT_EQUALLY, 0);
-    	
-        GridPanel infoPanel = new GridPanel();
-		infoPanel.add(contentPanel);
-		infoPanel.add(pnlTables);
-        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-		infoPanel.layout(2, 1, 1, 0);
-		getContentPane().add(infoPanel.getSwingComponent());
-        getContentPane().add(buttonPane.getSwingComponent());
-        buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
-        setResizable(true);
-        getRootPane().setDefaultButton(okButton);
-        if (!isNewDescription()){
-        	loadData();
-        }
-    }
-    
-    private GridPanel createHostDeploymentTable() {
-    	tblHosts = new JTable();
-    	tblHosts.setTableHeader(null);
-        tblHosts.setFillsViewportHeight(true);
-        tblModelHosts = new DefaultTableModel(new Object[][] {}, new String[] { "Host"}){
-			private static final long serialVersionUID = -5973463590447809117L;
-			@Override
-            public boolean isCellEditable(int row, int column) {
-               return false;
-            }
-        };
-        tblHosts.setModel(tblModelHosts);
-       
-        ListSelectionModel selectionModel = tblHosts.getSelectionModel();
-        selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-
-        JButton btnNewDeployment = new JButton("New deployment");
-        btnNewDeployment.addActionListener(new ActionListener() {
-			public void actionPerformed(ActionEvent e) {
-				HostDeploymentDialog hostDeploymentDialog = new HostDeploymentDialog(getRegistry(),true,null,null,Arrays.asList(getDeployments().keySet().toArray(new String[]{})));
-				try {
-					HostDeployment deployDesc = hostDeploymentDialog.execute();
-					if (deployDesc!=null){
-						ApplicationDeploymentDescriptionType appType = deployDesc.getApplicationDescription().getType();
-						if (appType.getApplicationName()==null){
-							appType.addNewApplicationName();
-				    	}
-						HostDescriptionType hostType = deployDesc.getHostDescription().getType();
-						appType.getApplicationName().setStringValue(hostType.getHostName()+"_application");
-						getDeployments().put(hostType.getHostName(), deployDesc);
-						updateDeploymentTable();
-					}
-				} catch (AiravataAPIInvocationException e1) {
-					setError(e1.getLocalizedMessage());
-					e1.printStackTrace();
-				}
-			}
-		});
-        
-        final JButton btnEditDeployment = new JButton("Edit deployment");
-        btnEditDeployment.addActionListener(new ActionListener() {
-			public void actionPerformed(ActionEvent e) {
-				editSelectedDeployment();
-			}
-		});
-        
-        final JButton btnDeleteDeployment = new JButton("Delete deployment");
-        btnDeleteDeployment.addActionListener(new ActionListener() {
-			public void actionPerformed(ActionEvent e) {
-				String hostName = tblModelHosts.getValueAt(tblHosts.getSelectedRow(),0).toString();
-				int result = JOptionPane.showConfirmDialog(null, "Are you sure you want to remove the host deployment '"+hostName+"'?", "Remove Host Deployment",
-                        JOptionPane.YES_NO_OPTION);
-				if (result==JOptionPane.YES_OPTION){
-					tblModelHosts.removeRow(tblHosts.getSelectedRow());
-					getDeployments().remove(hostName);
-				}
-			}
-		});
-        
-        selectionModel.addListSelectionListener(new ListSelectionListener() {
-            public void valueChanged(ListSelectionEvent e) {
-            	btnEditDeployment.setEnabled(tblHosts.getSelectedRows().length > 0);
-            	btnDeleteDeployment.setEnabled(tblHosts.getSelectedRows().length > 0);
-            }
-
-        });
-        tblHosts.addMouseListener(new MouseAdapter(){
-        	@Override
-        	public void mouseClicked(MouseEvent e) {
-        		if (e.getClickCount()==2 && tblHosts.getSelectedRows().length>0){
-        			editSelectedDeployment();
-        		}
-        	}
-        });
-        JScrollPane scrollPane = new JScrollPane();
-        scrollPane.setViewportView(tblHosts);
-        
-        GridPanel pnlTableButtons = new GridPanel();
-        pnlTableButtons.add(btnNewDeployment);
-        pnlTableButtons.add(btnEditDeployment);
-        pnlTableButtons.add(btnDeleteDeployment);
-        pnlTableButtons.layout(1, 3,SwingUtil.WEIGHT_NONE,SwingUtil.WEIGHT_EQUALLY);
-        
-        GridPanel pnlMainPanel = new GridPanel();
-        pnlMainPanel.add(scrollPane);
-        
-        pnlMainPanel.add(pnlTableButtons);
-        pnlMainPanel.layout(2, 1, 0, 0);
-        btnEditDeployment.setEnabled(false);
-    	btnDeleteDeployment.setEnabled(false);
-        return pnlMainPanel;
-	}
-
-    private void updateDeploymentTable(){
-    	List<String> hosts=new ArrayList<String>();
-    	for (int i = 0; i < tblModelHosts.getRowCount(); i++) {
-    		hosts.add((String) tblModelHosts.getValueAt(i, 0));
-        }
-    	for (String hostName : getDeployments().keySet()) {
-			if (!hosts.contains(hostName)){
-				tblModelHosts.addRow(new Object[] { hostName });
-			}
-		}
-    }
-    
-	private JTable createParameterTableControls() {
-		final JTable tblParameters = new JTable();
-        tblParameters.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
-        tblParameters.setFillsViewportHeight(true);
-        defaultTableModel = new DefaultTableModel(new Object[][] { { null, null, null, null }, }, new String[] { "I/O",
-                "Parameter Name", "Type", "Description" });
-        tblParameters.setModel(defaultTableModel);
-        defaultTableModel.addTableModelListener(new TableModelListener() {
-
-            public void tableChanged(TableModelEvent arg0) {
-                if (!ignoreTableChanges) {
-					int selectedRow = tblParameters.getSelectedRow();
-					if (selectedRow != -1
-							&& defaultTableModel.getRowCount() > 0) {
-						Object parameterIOType = defaultTableModel.getValueAt(
-								selectedRow, 0);
-						Object parameterDataType = defaultTableModel
-								.getValueAt(selectedRow, 2);
-						if (parameterIOType == null
-								|| parameterIOType.equals("")) {
-							defaultTableModel.setValueAt(getIOStringList()[0],
-									selectedRow, 0);
-						}
-						if (parameterDataType == null
-								|| parameterDataType.equals("")) {
-							defaultTableModel.setValueAt(getDataTypes()[0],
-									selectedRow, 2);
-						}
-					}
-					addNewRowIfLastIsNotEmpty();
-				}
-            }
-
-        });
-        TableColumn ioColumn = tblParameters.getColumnModel().getColumn(0);
-        String[] ioStringList = getIOStringList();
-        ioColumn.setCellEditor(new StringArrayComboBoxEditor(ioStringList));
-
-        TableColumn datatypeColumn = tblParameters.getColumnModel().getColumn(2);
-        String[] dataTypeStringList = getDataTypes();
-        datatypeColumn.setCellEditor(new StringArrayComboBoxEditor(dataTypeStringList));
-
-        TableColumn parameterNameCol = tblParameters.getColumnModel().getColumn(1);
-        parameterNameCol.setPreferredWidth(190);
-        ListSelectionModel selectionModel = tblParameters.getSelectionModel();
-        selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-
-        selectionModel.addListSelectionListener(new ListSelectionListener() {
-            public void valueChanged(ListSelectionEvent e) {
-                btnDeleteParameter.setEnabled(tblParameters.getSelectedRows().length > 0);
-            }
-
-        });
-        
-        btnDeleteParameter = new JButton("Delete parameter");
-        btnDeleteParameter.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent arg0) {
-                deleteSelectedRows();
-            }
-        });
-        btnDeleteParameter.setEnabled(false);
-        return tblParameters;
-	}
-
-    private void loadData() {
-    	ServiceDescriptionType descType = getOrginalServiceDescription().getType();
-		txtApplicationServiceName.setText(descType.getName());
-		setServiceName(txtApplicationServiceName.getText());
-
-		txtApplicationServiceName.setEditable(isNewDescription());
-    	ignoreTableChanges=true;
-    	updateIODataTable(descType);
-        getDeployments().clear();
-        try {
-			Map<String, ApplicationDescription> descs = getRegistry().getApplicationManager().getApplicationDescriptors(descType.getName());
-			for (String hostDescName : descs.keySet()) {
-			    getDeployments().put(hostDescName, new HostDeployment(getRegistry().getApplicationManager().getHostDescription(hostDescName), descs.get(hostDescName)));
-			}
-
-			updateDeploymentTable();
-			Boolean selected = false;
-			if (descType.getPortType()!=null && descType.getPortType().getMethod()!=null) {
-				XmlCursor cursor = descType.getPortType().getMethod().newCursor();
-				String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
-				cursor.dispose();
-				selected = false;
-				if (value != null) {
-					selected = Boolean.parseBoolean(value);
-				}
-			}
-			chkForceFileStagingToWorkDir.setSelected(selected);
-			setForceFileStagingToWorkDir(selected);
-			ignoreTableChanges=false;
-		} catch (AiravataAPIInvocationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-	}
-
-	private void updateIODataTable(ServiceDescriptionType descType) {
-		while(defaultTableModel.getRowCount()>0){
-    		defaultTableModel.removeRow(0);
-    	}
-    	InputParameterType[] iparameters = descType.getInputParametersArray();
-    	for (InputParameterType parameter : iparameters) {
-    		defaultTableModel.addRow(new Object[] { getIOStringList()[0], parameter.getParameterName(),parameter.getParameterType().getName(),parameter.getParameterDescription()});	
-		}
-    	OutputParameterType[] oparameters = descType.getOutputParametersArray();
-    	for (OutputParameterType parameter : oparameters) {
-    		defaultTableModel.addRow(new Object[] { getIOStringList()[1], parameter.getParameterName(), parameter.getParameterType().getName(),parameter.getParameterDescription()});	
-		}
-    	addNewRowIfLastIsNotEmpty();
-	}
-
-    private String[] getIOStringList() {
-        String[] ioStringList = new String[] { "Input", "Output" };
-        return ioStringList;
-    }
-
-    private String[] getDataTypes() {
-        String[] type = new String[DataType.Enum.table.lastInt()];
-        for (int i = 1; i <= DataType.Enum.table.lastInt(); i++) {
-            type[i - 1] = DataType.Enum.forInt(i).toString();
-        }
-        return type;
-    }
-
-    public boolean isServiceCreated() {
-        return serviceCreated;
-    }
-
-    public void setServiceCreated(boolean serviceCreated) {
-        this.serviceCreated = serviceCreated;
-    }
-
-    public ServiceDescription getServiceDescription() {
-        if (serviceDescription == null) {
-            serviceDescription = new ServiceDescription();
-        }
-        return serviceDescription;
-    }
-
-    public ServiceDescriptionType getServiceDescriptionType() {
-        return getServiceDescription().getType();
-    }
-
-    public String getServiceName() {
-        return getServiceDescription().getType().getName();
-    }
-
-    public void setServiceName(String serviceName) {
-        getServiceDescription().getType().setName(serviceName);
-        updateDialogStatus();
-    }
-
-    private void setupMethod(){
-    	if (getServiceDescriptionType().getPortType()==null){
-    		getServiceDescriptionType().setPortType(getServiceDescriptionType().addNewPortType());
-    	}
-    	if (getServiceDescriptionType().getPortType().getMethod()==null){
-    		getServiceDescriptionType().getPortType().setMethod(getServiceDescriptionType().getPortType().addNewMethod());
-    	}
-    }
-    public void setForceFileStagingToWorkDir(Boolean force){
-    	setupMethod();
-    	XmlCursor cursor = getServiceDescriptionType().getPortType().getMethod().newCursor();
-    	cursor.toNextToken();
-		if (!cursor.setAttributeText(new QName("http://airavata.apache.org/schemas/gfac/2012/12","forceFileStagingToWorkDir"),force.toString())){
-			cursor.insertAttributeWithValue("forceFileStagingToWorkDir",force.toString());
-		}
-		cursor.dispose();
-    }
-    
-    public Boolean getForceFileStagingToWorkDir(){
-    	setupMethod();
-    	XmlCursor cursor = getServiceDescriptionType().getPortType().getMethod().newCursor();    	
-    	cursor.toNextToken();
-		String value = cursor.getAttributeText(new QName("forceFileStagingToWorkDir"));
-		cursor.dispose();
-		if (value==null){
-			return false;
-		}else{
-			return Boolean.parseBoolean(value);
-		}
-		
-    }
-    
-    private void updateDialogStatus() {
-        String message = null;
-        try {
-            validateDialog();
-        } catch (Exception e) {
-            message = e.getLocalizedMessage();
-        }
-        okButton.setEnabled(message == null);
-        setError(message);
-    }
-
-    private void validateDialog() throws Exception {
-        if (getServiceName() == null || getServiceName().trim().equals("")) {
-            throw new Exception("Name of the application cannot be empty!!!");
-        }
-        ServiceDescription serviceDescription2 = null;
-        serviceDescription2 = getRegistry().getApplicationManager().getServiceDescription(getServiceName());
-        if (isNewDescription() && serviceDescription2 != null) {
-            throw new Exception("Service descriptor with the given name already exists!!!");
-        }
-    }
-
-    public void saveServiceDescription(boolean update) throws AiravataAPIInvocationException {
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-
-        for (int i = 0; i < defaultTableModel.getRowCount(); i++) {
-            String parameterName = (String) defaultTableModel.getValueAt(i, 1);
-            String paramType = (String) defaultTableModel.getValueAt(i, 2);
-            String parameterDescription = (String) defaultTableModel.getValueAt(i, 3);
-            if (parameterName != null && !parameterName.trim().equals("")) {
-                // todo how to handle Enum
-                if (getIOStringList()[0].equals(defaultTableModel.getValueAt(i, 0))) {
-                    InputParameterType parameter = InputParameterType.Factory.newInstance();
-                    parameter.setParameterName(parameterName);
-                    parameter.setParameterDescription(parameterDescription);
-                    ParameterType parameterType = parameter.addNewParameterType();
-                    parameterType.setType(DataType.Enum.forString(paramType));
-                    parameterType.setName(paramType);
-                    inputParameters.add(parameter);
-
-                } else {
-                    OutputParameterType parameter = OutputParameterType.Factory.newInstance();
-                    parameter.setParameterName(parameterName);
-                    parameter.setParameterDescription(parameterDescription);
-                    ParameterType parameterType = parameter.addNewParameterType();
-                    parameterType.setType(DataType.Enum.forString(paramType));
-                    parameterType.setName(paramType);
-                    outputParameters.add(parameter);
-                }
-            }
-        }
-        getServiceDescriptionType().setInputParametersArray(inputParameters.toArray(new InputParameterType[] {}));
-        getServiceDescriptionType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[] {}));
-        if (update) {
-            getRegistry().getApplicationManager().updateServiceDescriptor(getServiceDescription());
-        } else {
-            getRegistry().getApplicationManager().saveServiceDescription(getServiceDescription());
-        }
-        if (!isNewDescription()) {
-            Map<String, ApplicationDescription> descs = getRegistry().getApplicationManager().getApplicationDescriptors(getServiceName());
-            for (String hostDescName : descs.keySet()) {
-                getRegistry().getApplicationManager().deleteApplicationDescription(getServiceName(), hostDescName, descs.get(hostDescName).getType().getApplicationName().getStringValue());
-            }
-        }
-        for (String hostName : getDeployments().keySet()) {
-            getRegistry().getApplicationManager().saveApplicationDescription(getServiceName(), hostName, getDeployments().get(hostName).getApplicationDescription());
-        }
-        setServiceCreated(true);
-        JOptionPane.showMessageDialog(this, "Application '" + getServiceName() + "' is registered Successfully !");
-    }
-
-    public void saveServiceDescription() throws AiravataAPIInvocationException {
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-
-        for (int i = 0; i < defaultTableModel.getRowCount(); i++) {
-            String parameterName = (String) defaultTableModel.getValueAt(i, 1);
-            String paramType = (String) defaultTableModel.getValueAt(i, 2);
-            String parameterDescription = (String) defaultTableModel.getValueAt(i, 3);
-            if (parameterName != null && !parameterName.trim().equals("")) {
-                // todo how to handle Enum
-                if (getIOStringList()[0].equals(defaultTableModel.getValueAt(i, 0))) {
-                    InputParameterType parameter = InputParameterType.Factory.newInstance();
-                    parameter.setParameterName(parameterName);
-                    parameter.setParameterDescription(parameterDescription);
-                    ParameterType parameterType = parameter.addNewParameterType();
-                    parameterType.setType(DataType.Enum.forString(paramType));
-                    parameterType.setName(paramType);
-                    inputParameters.add(parameter);
-
-                } else {
-                    OutputParameterType parameter = OutputParameterType.Factory.newInstance();
-                    parameter.setParameterName(parameterName);
-                    parameter.setParameterDescription(parameterDescription);
-                    ParameterType parameterType = parameter.addNewParameterType();
-                    parameterType.setType(DataType.Enum.forString(paramType));
-                    parameterType.setName(paramType);
-                    outputParameters.add(parameter);
-                }
-            }
-        }
-        getServiceDescriptionType().setInputParametersArray(inputParameters.toArray(new InputParameterType[] {}));
-        getServiceDescriptionType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[] {}));
-        getRegistry().getApplicationManager().saveServiceDescription(getServiceDescription());
-        if (!isNewDescription()) {
-            Map<String, ApplicationDescription> descs = getRegistry().getApplicationManager().getApplicationDescriptors(getServiceName());
-            for (String hostDescName : descs.keySet()) {
-                getRegistry().getApplicationManager().deleteApplicationDescription(getServiceName(), hostDescName, descs.get(hostDescName).getType().getApplicationName().getStringValue());
-            }
-        }
-        for (String hostName : getDeployments().keySet()) {
-            getRegistry().getApplicationManager().saveApplicationDescription(getServiceName(), hostName, getDeployments().get(hostName).getApplicationDescription());
-        }
-        setServiceCreated(true);
-        JOptionPane.showMessageDialog(this, "Application '" + getServiceName() + "' is registered Successfully !");
-    }
-    public void close() {
-        getDialog().setVisible(false);
-    }
-
-    private void setError(String errorMessage) {
-        if (errorMessage == null || errorMessage.trim().equals("")) {
-            lblError.setText("");
-        } else {
-            lblError.setText(errorMessage.trim());
-        }
-    }
-
-    private void deleteSelectedRows() {
-        // TODO confirm deletion of selected rows
-        int selectedRow = tblParameters.getSelectedRow();
-        while (selectedRow >= 0 && tblParameters.getRowCount()>0) {
-            defaultTableModel.removeRow(selectedRow);
-            selectedRow = tblParameters.getSelectedRow();
-        }
-        addNewRowIfLastIsNotEmpty();
-    }
-
-    private void addNewRowIfLastIsNotEmpty() {
-    	
-        if (defaultTableModel.getRowCount()>0) {
-			Object parameterName = defaultTableModel.getValueAt(
-					defaultTableModel.getRowCount() - 1, 1);
-			if (parameterName != null && !parameterName.equals("")) {
-				defaultTableModel
-						.addRow(new Object[] { null, null, null, null });
-			}
-		}else{
-			if (tblParameters.getSelectedRow()==-1){
-				defaultTableModel.addRow(new Object[] { null, null, null, null });
-			}
-			
-		}
-    }
-
-    public AiravataAPI getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-
-    public boolean isNewDescription() {
-		return newDescription;
-	}
-
-	public void setNewDescription(boolean newDescription) {
-		this.newDescription = newDescription;
-	}
-
-	public ServiceDescription getOrginalServiceDescription() {
-		return orginalServiceDescription;
-	}
-
-	public void setOrginalServiceDescription(ServiceDescription orginalServiceDescription) {
-		this.orginalServiceDescription = orginalServiceDescription;
-	}
-
-	public String getSuggestedNamePrefix() {
-		return suggestedNamePrefix;
-	}
-
-	public void setSuggestedNamePrefix(String suggestedNamePrefix) {
-		this.suggestedNamePrefix = suggestedNamePrefix;
-	}
-
-	public String getTitlePrefix() {
-		return titlePrefix;
-	}
-
-	public void setTitlePrefix(String titlePrefix) {
-		this.titlePrefix = titlePrefix;
-	}
-
-	public Map<String,HostDeployment> getDeployments() {
-		if (deployments==null){
-			deployments=new HashMap<String, HostDeployment>();
-		}
-		return deployments;
-	}
-
-	private void editSelectedDeployment() {
-		String hostName = tblModelHosts.getValueAt(tblHosts.getSelectedRow(),0).toString();
-		HostDeploymentDialog hostDeploymentDialog = new HostDeploymentDialog(getRegistry(),false,getDeployments().get(hostName).getApplicationDescription(),hostName,Arrays.asList(getDeployments().keySet().toArray(new String[]{})));
-		try {
-			HostDeployment deployDesc = hostDeploymentDialog.execute();
-			if (deployDesc!=null){
-				getDeployments().put(deployDesc.getHostDescription().getType().getHostName(), deployDesc);
-				updateDeploymentTable();
-			}
-		} catch (AiravataAPIInvocationException e1) {
-			setError(e1.getLocalizedMessage());
-			e1.printStackTrace();
-		}
-	}
-
-	private class StringArrayComboBoxEditor extends DefaultCellEditor {
-        private static final long serialVersionUID = -304464739219209395L;
-
-        public StringArrayComboBoxEditor(Object[] items) {
-            super(new JComboBox(items));
-        }
-    }
-}


[56/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/ErrorMessages.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/ErrorMessages.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/ErrorMessages.java
new file mode 100644
index 0000000..cd061ed
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/ErrorMessages.java
@@ -0,0 +1,240 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.utils;
+
+public interface ErrorMessages {
+
+    /**
+     * URL_EMPTY
+     */
+    public static final String URL_EMPTY = "URL cannot be empty.";
+
+    /**
+     * URL_WRONG
+     */
+    public static final String URL_WRONG = "URL is in wrong format.";
+
+    /**
+     * GPEL_USERNAME_EMPTY
+     */
+    public static final String USERNAME_EMPTY = "Username cannot be empty.";
+
+    /**
+     * GPEL_PASSPHRASE_EMPTY
+     */
+    public static final String PASSWORD_EMPTY = "Password cannot be empty.";
+
+    /**
+     * Error message when it fails to open the file.
+     */
+    public static final String OPEN_FILE_ERROR = "Failed to open the file.";
+
+    /**
+     * Error message when it fails to write the file.
+     */
+    public static final String WRITE_FILE_ERROR = "Failed to write the file.";
+
+    /**
+     * Error message when it fails to load the graph
+     */
+    public static final String GRAPH_LOAD_ERROR = "Failed to load the workflow.";
+
+    /**
+     * Error message when it fails to save the graph
+     */
+    public static final String GRAPH_SAVE_ERROR = "Failed to save the workflow.";
+
+    /**
+     * Error message when the format of a workflow (graph) is wrong.
+     */
+    public static final String GRAPH_FORMAT_ERROR = "The workflow file is in wrong format.";
+
+    /**
+     * Errro message indicating the workflow is not complete to create a workflow script.
+     */
+    public static final String GRAPH_NOT_READY_ERROR = "The workflow is not compelete.";
+
+    /**
+     * Error message when it fails to load a component list.
+     */
+    public static final String COMPONENT_LIST_LOAD_ERROR = "Failed to load a component list.";
+
+    /**
+     * Error message when it fails to load a component.
+     */
+    public static final String COMPONENT_LOAD_ERROR = "Failed to load the component.";
+
+    /**
+     * Error message when the format of a component is wrong.
+     */
+    public static final String COMPONENT_FORMAT_ERROR = "The component is in wrong format.";
+
+    /**
+     * GPEL_ERROR
+     */
+    public static final String GPEL_ERROR = "Error occured while communicating with the GPEL Engine.";
+
+    /**
+     * GPEL_CONNECTION_ERROR
+     */
+    public static final String GPEL_CONNECTION_ERROR = "Failed to connect to the GPEL Engine.";
+
+    /**
+     * GPEL_URL_EMPTY
+     */
+    public static final String GPEL_URL_EMPTY = "GPEL Engine URL cannot be empty.";
+
+    /**
+     * Error if the format of the URL of the GPEL Engine is wrong.
+     */
+    public static final String GPEL_WRONG_URL = "The URL of the GPEL Engine is in a wrong format.";
+
+    /**
+     * Error while loading a list of workflows from GPEL Engine.
+     */
+    public static final String GPEL_WORKFLOW_LIST_LOAD_ERROR = "Failed to get list of workflows from GPEL Engine.";
+
+    /**
+     * GPEL_WORKFLOW_NOT_FOUND_ERROR
+     */
+    public static final String GPEL_WORKFLOW_NOT_FOUND_ERROR = "The specified workflow doesn't exist in the GPEL Engine.";
+
+    /**
+     * GPEL_MAX_EMPTY
+     */
+    public static final String GPEL_MAX_EMPTY = "Maximum cannot be empty.";
+
+    /**
+     * GPEL_MAX_WRONG
+     */
+    public static final String GPEL_MAX_WRONG = "Maximum needs to be an integer.";
+
+    /**
+     * WORKFLOW_WSDL_ERROR
+     */
+    public static final String WORKFLOW_WSDL_NOT_EXIST = "You need to generate BPEL script first.";
+
+    /**
+     * WORKFLOW_WSDL_ERROR
+     */
+    public static final String WORKFLOW_WSDL_ERROR = "The workflow WSDL is in wrong format.";
+
+    /**
+     * Error while subscribing to notification.
+     */
+    public static final String MONITOR_SUBSCRIPTION_ERROR = "Failed to subscribe to notification.";
+
+    /**
+     * Some other error related to monitoring.
+     */
+    public static final String MONITOR_ERROR = "Monitor error.";
+
+    /**
+     * KARMA_CONNECTION_ERROR
+     */
+    public static final String KARMA_CONNECTION_ERROR = "Failed to connect to the Karma service.";
+
+    /**
+     * TOPIC_EMPTY_ERROR
+     */
+    public static final String TOPIC_EMPTY_ERROR = "Topic cannot be empty.";
+
+    /**
+     * BROKER_URL_NOT_SET_ERROR
+     */
+    public static final String BROKER_URL_NOT_SET_ERROR = "Broker URL is not set.";
+
+    /**
+     * Error while loading a list of workflows from Registry.
+     */
+    public static final String REGISTRY_WORKFLOW_LIST_LOAD_ERROR = "Failed to get list of workflows from Registry.";
+
+    /**
+     * GFAC_URL_WRONG
+     */
+    public static final String GFAC_URL_WRONG = "GFac URL is in wrong format.";
+
+    /**
+     * DSC_URL_WRONG
+     */
+    public static final String DSC_URL_WRONG = "DSC URL is in wrong format.";
+
+    /**
+     * MYPROXY_LOAD_ERROR
+     */
+    public static final String MYPROXY_LOAD_ERROR = "Failed to load a proxy";
+
+    /**
+     * MYPROXY_HOST_EMPTY
+     */
+    public static final String MYPROXY_HOST_EMPTY = "MyProxy server cannot be empty.";
+
+    /**
+     * MYPROXY_PORT_EMPTY
+     */
+    public static final String MYPROXY_PORT_EMPTY = "MyProxy server port cannot be empty.";
+
+    /**
+     * MYPROXY_PORT_WRONG
+     */
+    public static final String MYPROXY_PORT_WRONG = "MyProxy server port needs to be an integer.";
+
+    /**
+     * MYPROXY_LIFETIME_EMPTY
+     */
+    public static final String MYPROXY_LIFETIME_EMPTY = "Lifetime cannot be empty.";
+
+    /**
+     * MYPROXY_LIFETIME_WRONG
+     */
+    public static final String MYPROXY_LIFETIME_WRONG = "Lifetime needs to be an integer.";
+
+    /**
+     * MYPROXY_PASSPHRASE_WRONG
+     */
+    public static final String MYPROXY_PASSPHRASE_WRONG = "Passphrase must be at least 6 characters long";
+
+    /**
+     * Error message for unexpected errors. When you see this, fix it!!
+     */
+    public static final String UNEXPECTED_ERROR = "Unexpected error.";
+
+    /**
+     * Warning message for no component selected.
+     */
+    public static final String NO_COMPONENT_SELECTED_WARNING = "You need to select a component to add from the Component Selector.";
+
+    /**
+     * Warning message when a user tries to set a default value before a parameter node is connected.
+     */
+    public static final String INPUT_NOT_CONNECTED_WARNING = "You need to connect the input to an input of a service first to configure.";
+
+    /**
+     * Warning message when a user tries to set a value before a parameter node is connected.
+     */
+    public static final String CONSTANT_NOT_CONNECTED_WARNING = "You need to connect the constant to an input of a service first to configure.";
+
+    String CREDENTIALS_WRONG = "Please check credentials";
+    String GIVEN_WORKFLOW_NAME_IS_WRONG = "Given Workflow Name is Wrong ";
+    String REPOSITORY_CONFIGURATION_IS_WRONG_FAILED_TO_LOAD_THE_WORKFLOW = "Repository Configuration is Wrong, Failed to load the Workflow";
+    String WORKFLOW_IS_WRONG = "Workflow is Wrong";
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/ComponentViewer.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/ComponentViewer.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/ComponentViewer.java
new file mode 100644
index 0000000..a56c94f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/ComponentViewer.java
@@ -0,0 +1,139 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.views;
+
+import java.awt.Color;
+
+import javax.swing.JEditorPane;
+import javax.swing.SwingUtilities;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvasListener;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent.GraphCanvasEventType;
+import org.apache.airavata.xbaya.ui.widgets.XBayaComponent;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelector;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelectorEvent;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelectorListener;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelectorEvent.ComponentSelectorEventType;
+
+import xsul5.XmlConstants;
+
+public class ComponentViewer implements GraphCanvasListener, ComponentSelectorListener, XBayaComponent {
+
+    /**
+     * The title
+     */
+    public static final String TITLE = "Component Information";
+
+    private static final String DEFAULT_HTML_MESSAGE = "<html> Select a component from the " + ComponentSelector.TITLE
+            + ".</html>";
+
+    private Component currentComponent;
+
+    private JEditorPane editorPane;
+
+    /**
+     * Creates a ComponentViewer.
+     */
+    public ComponentViewer() {
+        super();
+
+        this.currentComponent = null;
+
+        this.editorPane = new JEditorPane();
+        this.editorPane.setEditable(false);
+        this.editorPane.setBackground(Color.WHITE);
+
+        this.editorPane.setContentType(XmlConstants.CONTENT_TYPE_HTML);
+        this.editorPane.setText(DEFAULT_HTML_MESSAGE);
+    }
+
+    /**
+     * @return the GUI component
+     */
+    public JEditorPane getSwingComponent() {
+        return this.editorPane;
+    }
+
+    /**
+     * Sets a component to show.
+     * 
+     * @param component
+     *            the component to show
+     */
+    public void setComponent(final Component component) {
+        // logger.entering(component);
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                if (component == null) {
+                    ComponentViewer.this.editorPane.setText(DEFAULT_HTML_MESSAGE);
+                } else if (component != ComponentViewer.this.currentComponent) {
+                    ComponentViewer.this.editorPane.setText(component.toHTML());
+                    // To prevent from scrolling down to the bottom.
+                    ComponentViewer.this.editorPane.setCaretPosition(0);
+                }
+                ComponentViewer.this.currentComponent = component;
+            }
+        });
+        // logger.exiting();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphCanvasListener#graphCanvasChanged(org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent)
+     */
+    public void graphCanvasChanged(GraphCanvasEvent event) {
+        GraphCanvasEventType type = event.getType();
+        GraphCanvas graphCanvas = event.getGraphCanvas();
+        switch (type) {
+        case NODE_SELECTED:
+            Node node = graphCanvas.getSelectedNode();
+            if (node == null) {
+                setComponent(null);
+            } else {
+                setComponent(node.getComponent());
+            }
+            break;
+        case GRAPH_LOADED:
+        case NAME_CHANGED:
+        case INPUT_PORT_SELECTED:
+        case OUTPUT_PORT_SELECTED:
+            // do nothing
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.component.ComponentSelectorListener#componentSelectorChanged(org.apache.airavata.xbaya.ui.widgets.component.ComponentSelectorEvent)
+     */
+    public void componentSelectorChanged(ComponentSelectorEvent event) {
+        ComponentSelectorEventType type = event.getType();
+        switch (type) {
+        case COMPONENT_SELECTED:
+            Component component = event.getComponent();
+            setComponent(component);
+            break;
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/JCRBrowserPanel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/JCRBrowserPanel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/JCRBrowserPanel.java
new file mode 100644
index 0000000..33338f0
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/JCRBrowserPanel.java
@@ -0,0 +1,287 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.views;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+import javax.swing.JTree;
+import javax.swing.KeyStroke;
+import javax.swing.border.EmptyBorder;
+import javax.swing.tree.DefaultTreeModel;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.registrybrowser.nodes.AbstractAiravataTreeNode;
+import org.apache.airavata.xbaya.registrybrowser.nodes.AiravataTreeNodeFactory;
+import org.apache.airavata.xbaya.registrybrowser.nodes.RegistryTreeCellRenderer;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.BrowserAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.ImportAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.ViewAction;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class JCRBrowserPanel extends JPanel implements Observer {
+    private List<AbstractBrowserActionItem> browserActions = new ArrayList<AbstractBrowserActionItem>();
+    /**
+	 * 
+	 */
+    private static final long serialVersionUID = -4490110894914580271L;
+    private XBayaEngine engine;
+    private JTree tree;
+    private JPopupMenu popupMenu;
+    private AbstractBrowserActionItem actionDelete;
+
+    /**
+     * Create the dialog.
+     */
+    public JCRBrowserPanel(XBayaEngine engine) {
+        setEngine(engine);
+        initGUI();
+    }
+
+    private void initGUI() {
+        setBounds(100, 100, 450, 300);
+        this.setBorder(new EmptyBorder(5, 5, 5, 5));
+        this.setLayout(new BorderLayout(0, 0));
+        {
+            JScrollPane scrollPane = new JScrollPane();
+            this.add(scrollPane, BorderLayout.CENTER);
+            {
+                tree = new JTree(AiravataTreeNodeFactory.getTreeNode(getJCRRegistry() == null ? "No registry specified"
+                         : getEngine(), null));
+                tree.addKeyListener(new KeyAdapter() {
+                    @Override
+                    public void keyPressed(KeyEvent e) {
+                        if (e.getKeyCode() == KeyEvent.VK_F5) {
+                            triggerNodeAction(RefreshAction.ID);
+                        }
+                    }
+                });
+                tree.setCellRenderer(new RegistryTreeCellRenderer());
+                scrollPane.setViewportView(tree);
+
+                popupMenu = new JPopupMenu();
+                popupMenu.setLabel("");
+                addPopup(tree, popupMenu);
+
+                AbstractBrowserActionItem actionRefresh = new RefreshAction();
+                actionRefresh.getMenuItem().setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F5, 0));
+                actionRefresh.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        triggerNodeAction(RefreshAction.ID);
+                    }
+                });
+
+                actionDelete = new DeleteAction();
+                actionDelete.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent arg0) {
+                        triggerNodeAction(DeleteAction.ID);
+                    }
+                });
+                AddAction actionAdd = new AddAction();
+                actionAdd.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent arg0) {
+                        triggerNodeAction(AddAction.ID);
+                    }
+                });
+
+                EditAction actionEdit = new EditAction();
+                actionEdit.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent arg0) {
+                        triggerNodeAction(EditAction.ID);
+                    }
+                });
+                ImportAction actionImport = new ImportAction();
+                actionImport.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent arg0) {
+                        triggerNodeAction(ImportAction.ID);
+                    }
+                });
+                CopyAction actionCopy = new CopyAction();
+                actionCopy.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent arg0) {
+                        triggerNodeAction(CopyAction.ID);
+                    }
+                });
+                ViewAction actionView = new ViewAction();
+                actionView.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent arg0) {
+                        triggerNodeAction(ViewAction.ID);
+                    }
+                });
+                BrowserAction actionBrowser = new BrowserAction();
+                actionBrowser.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent arg0) {
+                        triggerNodeAction(BrowserAction.ID);
+                    }
+                });
+                
+                tree.addMouseListener(new MouseAdapter(){
+					@Override
+					public void mouseClicked(MouseEvent e) {
+						if (e.getClickCount() == 2){
+							triggerNodeAction(null);
+						}
+					}
+                });
+                browserActions.add(actionAdd);
+                browserActions.add(actionView);
+                browserActions.add(actionImport);
+                browserActions.add(actionEdit);
+                browserActions.add(actionRefresh);
+                browserActions.add(actionDelete);
+                browserActions.add(actionCopy);
+                browserActions.add(actionBrowser);
+
+//                popupMenu.add(actionAdd.getMenuItem());
+//                popupMenu.add(actionDelete.getMenuItem());
+//                popupMenu.add(actionRefresh.getMenuItem());
+            }
+        }
+    }
+
+    public void close() {
+        setVisible(false);
+    }
+
+    public void open() {
+        setVisible(true);
+    }
+
+    public XBayaEngine getEngine() {
+        return engine;
+    }
+
+    public void setEngine(XBayaEngine engine) {
+        if (this.engine != null) {
+            this.engine.getConfiguration().deleteObserver(this);
+        }
+        this.engine = engine;
+        if (this.engine != null) {
+            this.engine.getConfiguration().addObserver(this);
+        }
+    }
+
+    private AiravataAPI getJCRRegistry() {
+        try {
+            return getEngine().getConfiguration().getAiravataAPI();
+        } catch (Exception e) {
+            // JCR registry not specified yet
+            return null;
+        }
+    }
+
+    public void update(Observable observable, Object o) {
+        if (getEngine().getConfiguration() == observable) {
+            if (o instanceof JCRComponentRegistry) {
+                resetModel();
+            } else if (o instanceof AiravataAPI) {
+                resetModel();
+            }
+        }
+    }
+
+    private void resetModel() {
+        tree.setModel(new DefaultTreeModel(AiravataTreeNodeFactory.getTreeNode(
+                getJCRRegistry() == null ? "No registry specified" : getEngine(), null)));
+    }
+
+    private void addPopup(Component component, final JPopupMenu popup) {
+        component.addMouseListener(new MouseAdapter() {
+            public void mousePressed(MouseEvent e) {
+                if (e.isPopupTrigger()) {
+                    showMenu(e);
+                }
+            }
+
+            public void mouseReleased(MouseEvent e) {
+                if (e.isPopupTrigger()) {
+                    showMenu(e);
+                }
+            }
+
+            private void showMenu(MouseEvent e) {
+                int selRow = tree.getRowForLocation(e.getX(), e.getY());
+                if (selRow != -1 && e.isPopupTrigger()) {
+                    tree.setSelectionRow(selRow);
+                    Object o = tree.getLastSelectedPathComponent();
+                    popup.removeAll();
+                    if (o instanceof AbstractAiravataTreeNode) {
+                        AbstractAiravataTreeNode node = ((AbstractAiravataTreeNode) o);
+                        for (AbstractBrowserActionItem action : browserActions) {
+                            boolean actionSupported = node.isActionSupported(action);
+                            action.setVisible(actionSupported);
+                            if (actionSupported) {
+                                action.setCaption(node.getActionCaption(action));
+                                action.setIcon(node.getActionIcon(action));
+                                action.setDescription(node.getActionDescription(action));
+                                popup.add(action.getMenuItem());
+                            }
+                        }
+                    }
+                    
+                    if (popup.getSubElements().length>0) {
+						popup.show(e.getComponent(), e.getX(), e.getY());
+					}
+                }
+            }
+        });
+    }
+
+    private void triggerNodeAction(String action) {
+        Object o = tree.getLastSelectedPathComponent();
+        if (o instanceof AbstractAiravataTreeNode) {
+            AbstractAiravataTreeNode node = ((AbstractAiravataTreeNode) o);
+            try {
+            	if (action==null){
+            		action=node.getDefaultAction();
+            	}
+                if (action!=null) {
+					node.triggerAction(tree, action);
+				}
+            } catch (Exception e) {
+                e.printStackTrace();
+                getEngine().getGUI().getErrorWindow().error(e);
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/MonitorPanel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/MonitorPanel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/MonitorPanel.java
new file mode 100644
index 0000000..33adeef
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/MonitorPanel.java
@@ -0,0 +1,307 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.views;
+
+import java.awt.BorderLayout;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Iterator;
+
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSlider;
+import javax.swing.JTable;
+import javax.swing.SwingUtilities;
+import javax.swing.event.MouseInputAdapter;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.TableColumn;
+import javax.swing.table.TableColumnModel;
+
+import org.apache.airavata.common.utils.BrowserLauncher;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.ws.monitor.EventDataRepository;
+import org.apache.airavata.ws.monitor.MonitorUtil;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.monitor.MonitorWindow;
+import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler;
+import org.apache.airavata.xbaya.ui.widgets.XBayaComponent;
+import org.xmlpull.infoset.XmlElement;
+
+public class MonitorPanel implements XBayaComponent, TableModelListener {
+
+    /**
+     * The title.
+     */
+    public static final String TITLE = "Monitoring";
+
+    private XBayaGUI xbayaGUI;
+
+    private EventDataRepository tableSliderModel;
+
+    private JTable table;
+
+    private JScrollPane scrollPane;
+
+    private JSlider slider;
+
+    private JPanel panel;
+
+    /**
+     * 
+     * Constructs a MonitorPanel.
+     * 
+     * @param engine
+     */
+    public MonitorPanel(XBayaGUI xbayaGUI, Monitor monitor) {
+        this(xbayaGUI, null, monitor);
+    }
+
+    /**
+     * Constructs a NotificationPane.
+     * 
+     * @param engine
+     *            The XBayaEngine.
+     */
+    public MonitorPanel(XBayaGUI xbayaGUI, String nodeID, Monitor monitor) {
+        this.xbayaGUI=xbayaGUI;
+        if (null == nodeID) {
+            this.tableSliderModel = monitor.getEventDataRepository();
+        } else {
+            this.tableSliderModel = monitor.getEventData(nodeID);
+        }
+        init();
+        this.tableSliderModel.addTableModelListener(this);
+
+        // Also create a handler to change colors of graphs here.
+        MonitorEventHandler eventHandler = new MonitorEventHandler(this.xbayaGUI);
+        this.tableSliderModel.addChangeListener(eventHandler);
+    }
+
+    /**
+     * Returns the scroll pane.
+     * 
+     * @return The scroll pane
+     */
+    public JPanel getSwingComponent() {
+        return this.panel;
+    }
+
+    /**
+     * @see javax.swing.event.TableModelListener#tableChanged(javax.swing.event.TableModelEvent)
+     */
+    public void tableChanged(final TableModelEvent event) {
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+                tableChangedInSwingThread(event);
+            }
+        });
+
+    }
+
+    private void tableChangedInSwingThread(TableModelEvent event) {
+        // logger.entering(event);
+        // logger.entering("firstRow: " + event.getFirstRow());
+        // logger.entering("lastRow: " + event.getLastRow());
+        int type = event.getType();
+        if (type == TableModelEvent.INSERT) {
+            int firstRow = event.getFirstRow();
+
+            // check if we need to scroll down the scroll bar.
+            boolean move = false;
+
+            Rectangle visibleRect = this.table.getVisibleRect();
+            // logger.info("visibleRect: " + visibleRect);
+            Rectangle bottomCellRect = this.table.getCellRect(firstRow - 1, 0, true);
+            // logger.info("bottomCellRect: " + bottomCellRect);
+            move = bottomCellRect.intersects(visibleRect);
+            // logger.info("move: " + move);
+
+            if (move) {
+                // When the scroll bar is at the bottom and the slider is at the
+                // right, scroll down.
+                // If the slider is not at the right, this method won't be
+                // called.
+                Rectangle newBottomCellRect = this.table.getCellRect(this.table.getRowCount() - 1, 0, true);
+                // logger.info("cellRect: " + newBottomCellRect);
+                this.table.scrollRectToVisible(newBottomCellRect);
+            }
+
+            // Sometimes, it fails to reprint without this.
+            this.scrollPane.repaint();
+
+        } else if (type == TableModelEvent.DELETE) {
+            // Nothing
+        } else {
+            // No other cases.
+        }
+
+        int size = this.tableSliderModel.getEventSize();
+        boolean empty = (size == 0);
+        this.slider.setEnabled(!empty);
+    }
+
+    private void init() {
+        this.table = new JTable(this.tableSliderModel) {
+            @Override
+            public String getToolTipText(MouseEvent event) {
+                String tip = null;
+                Point point = event.getPoint();
+                int colIndex = columnAtPoint(point);
+                if (colIndex == EventDataRepository.Column.MESSAGE.ordinal()) {
+                    tip = "Double click here to see the full message.";
+                }
+                return tip;
+            }
+        };
+
+        this.table.getTableHeader().setReorderingAllowed(false);
+
+        this.table.addMouseListener(new MouseInputAdapter() {
+            private MonitorWindow window;
+
+            @Override
+            public void mouseClicked(MouseEvent event) {
+                Point point = event.getPoint();
+                int row = MonitorPanel.this.table.rowAtPoint(point);
+                if (row >= 0 && row < MonitorPanel.this.table.getRowCount()) {
+                    XmlElement message = MonitorPanel.this.tableSliderModel.getEvent(row).getEvent();
+
+                    int clickCount = event.getClickCount();
+                    if (clickCount == 1) {
+                        if (MonitorUtil.getType(message) == MonitorUtil.EventType.PUBLISH_URL) {
+                            int column = MonitorPanel.this.table.columnAtPoint(point);
+                            if (column == EventDataRepository.Column.MESSAGE.ordinal()) {
+                                String url = MonitorUtil.getLocation(message);
+                                try {
+                                    BrowserLauncher.openURL(url);
+                                } catch (Exception e) {
+                                    MonitorPanel.this.xbayaGUI.getErrorWindow().error(e.getMessage(), e);
+                                }
+                            }
+                        } else if (MonitorUtil.getType(message) == MonitorUtil.EventType.SENDING_RESULT) {
+                            if (null != message && null != message.element("result")
+                                    && null != message.element("result").element("body")
+                                    && null != message.element("result").element("body").element("Body")) {
+                                XmlElement body = message.element("result").element("body").element("Body");
+                                Iterator bodyItr = body.children().iterator();
+                                // find the first body Element
+                                findAndLaunchBrowser(bodyItr);
+                                // XmlElement output = message.element("result").element("body").
+                                // element("Body").element("Visualize_OutputParams").element("Visualized_Output");
+                                // Iterator children = output.children().iterator();
+                                // while (children.hasNext()) {
+                                // Object object = (Object) children.next();
+                                // if(object instanceof String){
+                                // try {
+                                // new URL(((String)object).trim());
+                                // try {
+                                // BrowserLauncher.openURL(((String)object).trim());
+                                // } catch (Throwable e) {
+                                // //do nothing
+                                // }
+                                // } catch (MalformedURLException e) {
+                                // //do nothing
+                                // }
+                                // }
+                                //
+                                // }
+                            }
+                        }
+                    } else if (clickCount >= 2) {
+                        // Handle double clicks to pop up a window.
+                        if (this.window == null) {
+                            this.window = new MonitorWindow(MonitorPanel.this.xbayaGUI);
+                        }
+                        this.window.show(message);
+                    }
+                }
+            }
+
+            /**
+             * @param bodyItr
+             */
+            private void findAndLaunchBrowser(Iterator bodyItr) {
+                if (bodyItr.hasNext()) {
+                    Object firstElement = bodyItr.next();
+                    if (firstElement instanceof XmlElement) {
+                        findAndLuanchBrowser((XmlElement) firstElement);
+                    }
+                }
+            }
+
+            /**
+             * @param firstElement
+             */
+            private void findAndLuanchBrowser(XmlElement firstElement) {
+                Iterator children = ((XmlElement) firstElement).children().iterator();
+                while (children.hasNext()) {
+                    Object object = (Object) children.next();
+                    if (object instanceof String) {
+                        try {
+                            new URL(((String) object).trim());
+                            try {
+                                BrowserLauncher.openURL(((String) object).trim());
+                            } catch (Throwable e) {
+                                // do nothing
+                            }
+                        } catch (MalformedURLException e) {
+                            // do nothing
+                        }
+                    } else if (object instanceof XmlElement) {
+                        findAndLuanchBrowser((XmlElement) object);
+                    }
+                }
+            }
+        });
+
+        // Adjust size of columns
+        TableColumnModel columnModel = this.table.getColumnModel();
+        int columnCount = columnModel.getColumnCount();
+        for (int i = 0; i < columnCount; i++) {
+            TableColumn column = columnModel.getColumn(i);
+            if (i == columnCount - 1) {
+                column.setPreferredWidth(500);
+            } else {
+                column.setPreferredWidth(50);
+            }
+        }
+        this.table.setAutoResizeMode(JTable.AUTO_RESIZE_LAST_COLUMN);
+
+        this.scrollPane = new JScrollPane(this.table);
+        this.scrollPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+        this.scrollPane.setDoubleBuffered(true);
+
+        this.slider = new JSlider(this.tableSliderModel);
+        this.slider.setSnapToTicks(true);
+        this.slider.setEnabled(false);
+
+        this.panel = new JPanel();
+        this.panel.setLayout(new BorderLayout());
+        this.panel.add(this.scrollPane, BorderLayout.CENTER);
+        this.panel.add(this.slider, BorderLayout.SOUTH);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/ParameterPropertyPanel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/ParameterPropertyPanel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/ParameterPropertyPanel.java
new file mode 100644
index 0000000..d11887b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/ParameterPropertyPanel.java
@@ -0,0 +1,194 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.views;
+
+import java.awt.event.ActionEvent;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import org.apache.airavata.common.utils.WSConstants;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.graph.system.ParameterNode;
+import org.apache.airavata.xbaya.core.workflow.ParameterListModel;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaComponent;
+import org.apache.airavata.xbaya.ui.widgets.XBayaList;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.xmlpull.infoset.XmlElement;
+
+public class ParameterPropertyPanel implements XBayaComponent {
+
+    private String title;
+
+    private XBayaList parameterList;
+
+    private ParameterListModel listModel;
+
+    private GridPanel panel;
+
+    private XBayaTextArea metadataTextArea;
+
+    private JButton upButton;
+
+    private JButton downButton;
+
+    /**
+     * Constructs a ParameterReorderingPanel.
+     * 
+     * @param title
+     */
+    public ParameterPropertyPanel(String title) {
+        this.title = title;
+        initGUI();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.XBayaComponent#getSwingComponent()
+     */
+    public JComponent getSwingComponent() {
+        return getPanel().getSwingComponent();
+    }
+
+    /**
+     * @return The Swing Panel.
+     */
+    public GridPanel getPanel() {
+        return this.panel;
+    }
+
+    /**
+     * @param parameterNodes
+     * @param nodes
+     */
+    public void setParameterNodes(List<? extends ParameterNode> parameterNodes) {
+        this.listModel = new ParameterListModel(parameterNodes);
+        this.parameterList.getList().setModel(this.listModel);
+    }
+
+    /**
+     * @param metadata
+     */
+    public void setMetadata(XmlElement metadata) {
+        String metadataText;
+        if (metadata == null) {
+            metadataText = WSConstants.EMPTY_APPINFO;
+        } else {
+            metadataText = XMLUtil.xmlElementToString(metadata);
+        }
+        this.metadataTextArea.setText(metadataText);
+    }
+
+    /**
+     * @return The metadata.
+     */
+    public String getMetadata() {
+        return this.metadataTextArea.getText();
+    }
+
+    private void up() {
+        int index = this.parameterList.getSelectedIndex();
+        this.parameterList.setSelectedIndex(index - 1);
+        this.listModel.up(index);
+    }
+
+    private void down() {
+        int index = this.parameterList.getSelectedIndex();
+        this.parameterList.setSelectedIndex(index + 1);
+        this.listModel.down(index);
+    }
+
+    private void selectionChanged() {
+        int index = this.parameterList.getSelectedIndex();
+        if (index < 0) {
+            // Nothing is selected.
+            this.upButton.setEnabled(false);
+            this.downButton.setEnabled(false);
+        } else {
+            if (index == 0) {
+                this.upButton.setEnabled(false);
+            } else {
+                this.upButton.setEnabled(true);
+            }
+            if (index == this.listModel.getSize() - 1) {
+                this.downButton.setEnabled(false);
+            } else {
+                this.downButton.setEnabled(true);
+            }
+        }
+    }
+
+    private void initGUI() {
+        this.parameterList = new XBayaList();
+        this.parameterList.addListSelectionListener(new ListSelectionListener() {
+            public void valueChanged(ListSelectionEvent event) {
+                selectionChanged();
+            }
+        });
+
+        this.upButton = new JButton("UP");
+        this.upButton.setEnabled(false);
+        this.upButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                up();
+            }
+        });
+
+        this.downButton = new JButton("DOWN");
+        this.downButton.setEnabled(false);
+        this.downButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                down();
+            }
+        });
+
+        GridPanel buttonPanel = new GridPanel();
+        buttonPanel.add(this.upButton);
+        buttonPanel.add(this.downButton);
+        buttonPanel.layout(2, 1, GridPanel.WEIGHT_NONE, 0);
+
+        GridPanel reorderingPanel = new GridPanel();
+        reorderingPanel.add(this.parameterList);
+        reorderingPanel.add(buttonPanel);
+        reorderingPanel.layout(1, 2, 0, 0);
+
+        this.metadataTextArea = new XBayaTextArea();
+        JLabel metadataLabel = new JLabel("Metadata");
+        metadataLabel.setLabelFor(this.metadataTextArea.getSwingComponent());
+
+        this.panel = new GridPanel();
+        this.panel.add(reorderingPanel);
+        this.panel.add(metadataLabel);
+        this.panel.add(this.metadataTextArea);
+        this.panel.layout(3, 1, 2, 0);
+
+        TitledBorder border = BorderFactory.createTitledBorder(this.title);
+        this.panel.getSwingComponent().setBorder(border);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/PortViewer.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/PortViewer.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/PortViewer.java
new file mode 100644
index 0000000..4c2ba02
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/views/PortViewer.java
@@ -0,0 +1,167 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.views;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridLayout;
+
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvasListener;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent.GraphCanvasEventType;
+
+import xsul5.XmlConstants;
+
+public class PortViewer implements GraphCanvasListener {
+
+    /**
+     * The title.
+     */
+    public static final String TITLE = "Parameters";
+
+    private JPanel panel;
+
+    private JEditorPane outputEditor;
+
+    private JEditorPane inputEditor;
+
+    /**
+     * Creates a PortInformation
+     */
+    public PortViewer() {
+        this.panel = new JPanel();
+        this.panel.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+        this.panel.setPreferredSize(new Dimension(0, 150));
+
+        JPanel inBox = new JPanel(new BorderLayout());
+        inBox.setBorder(new TitledBorder(new EtchedBorder(), "Input Parameter"));
+        this.inputEditor = createEditorPane();
+        JScrollPane inputScrollPane = new JScrollPane(this.inputEditor);
+        inputScrollPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+        inBox.add(inputScrollPane, BorderLayout.CENTER);
+        inBox.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+
+        JPanel outBox = new JPanel(new BorderLayout());
+        outBox.setBorder(new TitledBorder(new EtchedBorder(), "Output Parameter"));
+        this.outputEditor = createEditorPane();
+        JScrollPane outScrollPane = new JScrollPane(this.outputEditor);
+        outScrollPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+        outBox.add(outScrollPane, BorderLayout.CENTER);
+        outBox.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+
+        this.panel.setLayout(new GridLayout(1, 2));
+        this.panel.add(outBox);
+        this.panel.add(inBox);
+    }
+
+    /**
+     * @return The panel
+     */
+    public JComponent getSwingComponent() {
+        return this.panel;
+    }
+
+    /**
+     * @param port
+     */
+    public void setOutputPort(Port port) {
+        showPortInfo(this.outputEditor, port);
+    }
+
+    /**
+     * @param port
+     */
+    public void setInputPort(Port port) {
+        showPortInfo(this.inputEditor, port);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphCanvasListener#graphCanvasChanged(org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent)
+     */
+    public void graphCanvasChanged(GraphCanvasEvent event) {
+        GraphCanvasEventType type = event.getType();
+        GraphCanvas graphCanvas = event.getGraphCanvas();
+        switch (type) {
+        case INPUT_PORT_SELECTED:
+            Port inputPort = graphCanvas.getSelectedInputPort();
+            setInputPort(inputPort);
+            break;
+        case OUTPUT_PORT_SELECTED:
+            Port outputPort = graphCanvas.getSelectedOutputPort();
+            setOutputPort(outputPort);
+            break;
+        case GRAPH_LOADED:
+        case NAME_CHANGED:
+        case NODE_SELECTED:
+            // do nothing
+        }
+    }
+
+    /**
+     * Shows the information of a selected port on the list specified.
+     * 
+     * @param editor
+     * @param port
+     */
+    private void showPortInfo(JEditorPane editor, Port port) {
+        if (port == null) {
+            editor.setText("");
+        } else {
+            // TODO dispatch to each port?.
+            StringBuilder buf = new StringBuilder();
+            buf.append("<strong>Component: " + port.getNode().getName() + "</strong><br>");
+            buf.append("<strong>Port: " + port.getName() + "<br></strong>");
+            if (port instanceof DataPort) {
+                buf.append("<strong>Type</strong>: " + ((DataPort) port).getType() + "<br>");
+            } else {
+                // TODO
+            }
+            buf.append("<strong>Description</strong>: " + port.getComponentPort().getDescription() + "<br>");
+            editor.setText(buf.toString());
+
+            // To prevent from scrolling down to the bottom.
+            editor.setCaretPosition(0);
+        }
+    }
+
+    private JEditorPane createEditorPane() {
+        JEditorPane editorPane = new JEditorPane();
+        editorPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+        editorPane.setEditable(false);
+        editorPane.setBackground(Color.WHITE);
+        editorPane.setContentType(XmlConstants.CONTENT_TYPE_HTML);
+        return editorPane;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/GridPanel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/GridPanel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/GridPanel.java
new file mode 100644
index 0000000..026980b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/GridPanel.java
@@ -0,0 +1,165 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.util.List;
+
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+import org.apache.airavata.common.utils.SwingUtil;
+
+public class GridPanel implements XBayaComponent {
+
+    /**
+     * Wight none of rows or eolumns. Used by layout().
+     */
+    public final static int WEIGHT_NONE = SwingUtil.WEIGHT_NONE;
+
+    /**
+     * Weight all rows or columns equally. Used by layout().
+     */
+    public final static int WEIGHT_EQUALLY = SwingUtil.WEIGHT_EQUALLY;
+
+    private JPanel contentPanel;
+
+    private JComponent rootComponent;
+    
+    private boolean scroll=false;
+
+    /**
+     * Constructs a GridPanel.
+     */
+    public GridPanel() {
+        this(false);
+    }
+
+    /**
+     * Constructs a GridPanel.
+     * 
+     * @param scroll
+     *            true if scroll is needed; false otherwise.
+     */
+    public GridPanel(boolean scroll) {
+        init(scroll);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.XBayaComponent#getSwingComponent()
+     */
+    public JComponent getSwingComponent() {
+        return this.rootComponent;
+    }
+
+    /**
+     * @return The panel.
+     */
+    public JPanel getContentPanel() {
+        return this.contentPanel;
+    }
+
+    /**
+     * @param component
+     */
+    public void add(XBayaComponent component) {
+        add(component.getSwingComponent());
+    }
+
+    /**
+     * @param component
+     * @param index
+     */
+    public void add(XBayaComponent component, int index) {
+        add(component.getSwingComponent(), index);
+    }
+
+    /**
+     * @param component
+     */
+    public void add(JComponent component) {
+        this.contentPanel.add(component);
+    }
+
+    /**
+     * @param component
+     * @param index
+     */
+    public void add(JComponent component, int index) {
+        this.contentPanel.add(component, index);
+    }
+
+    /**
+     * @param index
+     */
+    public void remove(int index) {
+        this.contentPanel.remove(index);
+    }
+
+    /**
+     * Layouts the child components of a specified parent component using GridBagLayout.
+     * 
+     * @param numRow
+     *            The number of rows
+     * @param numColumn
+     *            The number of columns
+     * @param weightedRow
+     *            The row to weight
+     * @param weightedColumn
+     *            The column to weight
+     */
+    public void layout(int numRow, int numColumn, int weightedRow, int weightedColumn) {
+        SwingUtil.layoutToGrid(this.contentPanel, numRow, numColumn, weightedRow, weightedColumn);
+    }
+
+    /**
+     * @param rowWeights
+     * @param columnWeights
+     */
+    public void layout(double[] rowWeights, double[] columnWeights) {
+        SwingUtil.layoutToGrid(this.contentPanel, rowWeights, columnWeights);
+    }
+
+    /**
+     * @param rowWeights
+     * @param columnWeights
+     */
+    public void layout(List<Double> rowWeights, List<Double> columnWeights) {
+        SwingUtil.layoutToGrid(this.contentPanel, rowWeights, columnWeights);
+    }
+
+    private void init(boolean scroll) {
+        this.contentPanel = new JPanel();
+        if (scroll) {
+            this.contentPanel.setOpaque(true);
+            JScrollPane scrollPane = new JScrollPane(this.contentPanel);
+            this.rootComponent = scrollPane;
+        } else {
+            this.rootComponent = this.contentPanel;
+        }
+        this.scroll=scroll;
+    }
+    
+    public void resetPanel(){
+    	init(scroll);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/ScrollPanel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/ScrollPanel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/ScrollPanel.java
new file mode 100644
index 0000000..a566f6c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/ScrollPanel.java
@@ -0,0 +1,124 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+
+import javax.swing.BorderFactory;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.border.Border;
+
+import org.apache.airavata.common.utils.SwingUtil;
+
+public class ScrollPanel implements XBayaComponent {
+
+    private JPanel panel;
+
+    private JComponent component;
+
+    /**
+     * Creates a ScrollPanel.
+     * 
+     * @param component
+     * @param title
+     */
+    public ScrollPanel(XBayaComponent component, String title) {
+        this(component.getSwingComponent(), title);
+    }
+
+    /**
+     * Creates a ScrollPanel.
+     * 
+     * @param component
+     * @param title
+     */
+    public ScrollPanel(JComponent component, String title) {
+        this(component, title, true);
+    }
+
+    /**
+     * Creates a ScrollPanel.
+     * 
+     * @param component
+     * @param title
+     * @param scroll
+     */
+    public ScrollPanel(XBayaComponent component, String title, boolean scroll) {
+        this(component.getSwingComponent(), title, scroll);
+    }
+
+    /**
+     * Creates a ScrollPanel.
+     * 
+     * @param component
+     * @param title
+     * @param scroll
+     */
+    public ScrollPanel(JComponent component, String title, boolean scroll) {
+        this.component = component;
+        init(component, title, scroll);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.XBayaComponent#getSwingComponent()
+     */
+    public JPanel getSwingComponent() {
+        return getPanel();
+    }
+
+    /**
+     * @return The panel.
+     */
+    public JPanel getPanel() {
+        return this.panel;
+    }
+
+    /**
+     * @param preferredSize
+     */
+    public void setPrefferedSize(Dimension preferredSize) {
+        this.component.setPreferredSize(preferredSize);
+    }
+
+    private void init(JComponent comp, String title, boolean scroll) {
+        this.panel = new JPanel();
+        this.panel.setLayout(new BorderLayout());
+
+        JLabel titleLabel = new JLabel(title);
+        Border border = BorderFactory.createEtchedBorder();
+        titleLabel.setBorder(border);
+        this.panel.add(titleLabel, BorderLayout.NORTH);
+
+        if (scroll) {
+            JScrollPane scrollPane = new JScrollPane(comp);
+            scrollPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+            this.panel.add(scrollPane, BorderLayout.CENTER);
+        } else {
+            comp.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+            this.panel.add(comp, BorderLayout.CENTER);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/TabLabelButton.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/TabLabelButton.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/TabLabelButton.java
new file mode 100644
index 0000000..7531b38
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/TabLabelButton.java
@@ -0,0 +1,142 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+ 
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import javax.swing.plaf.basic.BasicButtonUI;
+ 
+public class TabLabelButton extends JPanel implements ActionListener{
+ 
+	private static final long serialVersionUID = 1L;
+	
+	private JTabbedPane tabPanel;
+	
+	private ActionListener closeButtonListener;
+	
+	
+	public TabLabelButton(final JTabbedPane pane, String closeButtonTip) {
+        super();
+        setTabPanel(pane);
+        FlowLayout layout = new FlowLayout(FlowLayout.LEFT);
+        layout.setAlignment(FlowLayout.LEFT);
+        layout.setVgap(0);
+        layout.setHgap(0);
+        setLayout(layout);
+        setOpaque(false);
+        JLabel label = new JLabel() {
+        	String previousText=null;
+			private static final long serialVersionUID = 1L;
+
+			public String getText() {
+                int i = pane.indexOfTabComponent(TabLabelButton.this);
+                if (i != -1) {
+                	if (!pane.getTitleAt(i).equals(previousText)){
+                		previousText=pane.getTitleAt(i);
+                    	TabLabelButton.this.updateUI();
+                	}
+                    return previousText;
+                }
+                return null;
+            }
+        };
+         
+        add(label);
+        label.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
+        final JButton button = new JButton(){
+			private static final long serialVersionUID = 1L;
+            protected void paintComponent(Graphics g) {
+                super.paintComponent(g);
+                //Only if the selected tab is this tab we draw the close
+                if (pane.indexOfTabComponent(TabLabelButton.this)==pane.getSelectedIndex()){
+                	Graphics2D drawer = (Graphics2D) g.create();
+                    if (getModel().isPressed()) {
+                        drawer.translate(1, 1);
+                    }
+                    drawer.setStroke(new BasicStroke(2));
+                	drawer.setColor(Color.GRAY);
+                	if (getModel().isRollover()) {
+                        drawer.setColor(new Color(200,0,0));
+                    }
+                	setBorderPainted(getModel().isRollover());
+                    int delta = 7;
+					int right = (getWidth()-1) - delta;
+					int bottom = (getHeight()-1) - delta;
+					drawer.drawLine(delta, delta, right, bottom);
+                    drawer.drawLine(right, delta, delta, bottom);
+                    drawer.dispose();
+                }
+            }
+        };
+        button.setPreferredSize(new Dimension(20, 20));
+        button.setToolTipText(closeButtonTip);
+        button.setUI(new BasicButtonUI());
+        button.setContentAreaFilled(false);
+        button.setFocusable(false);
+        button.setBorder(BorderFactory.createLineBorder(Color.GRAY));
+        button.setBorderPainted(false);
+        button.setRolloverEnabled(true);
+        button.addActionListener(this);
+        
+        add(button);
+        setBorder(BorderFactory.createEmptyBorder(2, 0, 0, 0));
+    }
+
+	public JTabbedPane getTabPanel() {
+		return tabPanel;
+	}
+
+	public void setTabPanel(JTabbedPane tabPanel) {
+		this.tabPanel = tabPanel;
+	}
+
+	public ActionListener getCloseButtonListener() {
+		return closeButtonListener;
+	}
+
+	public void setCloseButtonListener(ActionListener closeButtonListener) {
+		this.closeButtonListener = closeButtonListener;
+	}
+
+	@Override
+	public void actionPerformed(ActionEvent event) {
+        if (getTabPanel().indexOfTabComponent(TabLabelButton.this)==getTabPanel().getSelectedIndex()){
+        	if (getCloseButtonListener()!=null){
+        		getCloseButtonListener().actionPerformed(event);
+        	}
+        }else{
+        	getTabPanel().setSelectedIndex(getTabPanel().indexOfTabComponent(TabLabelButton.this));
+        }
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/TableRenderable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/TableRenderable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/TableRenderable.java
new file mode 100644
index 0000000..2a19a1d
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/TableRenderable.java
@@ -0,0 +1,31 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+public interface TableRenderable {
+    public int getColumnCount();
+
+    public String getColumnTitle(int index);
+
+    public Object getValue(int index);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/ToolbarButton.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/ToolbarButton.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/ToolbarButton.java
new file mode 100644
index 0000000..4a31eae
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/ToolbarButton.java
@@ -0,0 +1,109 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+
+import javax.swing.Icon;
+import javax.swing.JButton;
+
+public class ToolbarButton extends JButton implements ActionListener, MouseListener{
+	private ActionListener buttonClickListener;
+	private static final long serialVersionUID = -8266744670729158206L;
+	private boolean showCaption=false;
+	private String caption;
+	private int order;
+	
+	public ToolbarButton(Icon icon, String text, String description, int order) {
+		super(icon);
+		setOrder(order);
+		setToolTipText(description);
+		setCaption(text);
+		setBorderPainted(false);
+        setFocusable(false);
+//        setBorder(BorderFactory.create);
+        setRolloverEnabled(true);
+        addMouseListener(this);
+        addActionListener(this);
+	}
+
+	@Override
+	public void actionPerformed(ActionEvent e) {
+		if (getButtonClickListener()!=null){
+			getButtonClickListener().actionPerformed(e);
+		}
+	}
+
+	public ActionListener getButtonClickListener() {
+		return buttonClickListener;
+	}
+
+	public void setButtonClickListener(ActionListener buttonClickListener) {
+		this.buttonClickListener = buttonClickListener;
+	}
+
+	public boolean isShowCaption() {
+		return showCaption;
+	}
+
+	public void setShowCaption(boolean showCaption) {
+		this.showCaption = showCaption;
+	}
+
+	public String getCaption() {
+		return caption;
+	}
+
+	public void setCaption(String caption) {
+		this.caption = caption;
+	}
+	
+	@Override
+	public void mouseEntered(MouseEvent e) {
+		if (isEnabled()) {
+			setBorderPainted(true);
+		}			
+	}
+
+	@Override
+	public void mouseExited(MouseEvent e) {
+		setBorderPainted(false);
+	}
+	
+	@Override
+	public void mouseClicked(MouseEvent e) {}
+	@Override
+	public void mousePressed(MouseEvent e) {}
+	@Override
+	public void mouseReleased(MouseEvent e) {}
+
+	public int getOrder() {
+		return order;
+	}
+
+	public void setOrder(int order) {
+		this.order = order;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaComboBox.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaComboBox.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaComboBox.java
new file mode 100644
index 0000000..7f58c6a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaComboBox.java
@@ -0,0 +1,100 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import java.awt.event.ItemListener;
+
+import javax.swing.ComboBoxModel;
+import javax.swing.JComboBox;
+
+public class XBayaComboBox implements XBayaComponent {
+
+    /**
+     * DEFAULT_COLUMNS
+     */
+    public static final int DEFAULT_COLUMNS = 30;
+
+    private JComboBox comboBox;
+
+    /**
+     * Constructs a XBayaTextArea.
+     * 
+     * @param model
+     */
+    public XBayaComboBox(ComboBoxModel model) {
+        init(model);
+    }
+
+    /**
+     * @return The swing component.
+     */
+    public JComboBox getSwingComponent() {
+        return getJComboBox();
+    }
+
+    /**
+     * @return The text. It never returns null.
+     */
+    public String getText() {
+        return (String) this.comboBox.getSelectedItem();
+    }
+
+    /**
+     * @param str
+     */
+    public void setSelectedItem(String str) {
+        this.comboBox.setSelectedItem(str);
+    }
+
+    /**
+     * @param model
+     */
+    public void setModel(ComboBoxModel model) {
+        this.comboBox.setModel(model);
+    }
+
+    /**
+     * @return The text field
+     */
+    public JComboBox getJComboBox() {
+        return this.comboBox;
+    }
+
+    /**
+     * @param editable
+     */
+    public void setEditable(boolean editable) {
+        this.comboBox.setEditable(editable);
+    }
+
+    private void init(ComboBoxModel model) {
+        this.comboBox = new JComboBox(model);
+        this.comboBox.setEditable(false);
+    }
+
+    /**
+     * @param listener
+     */
+    public void addItemListener(ItemListener listener) {
+        this.comboBox.addItemListener(listener);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaComponent.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaComponent.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaComponent.java
new file mode 100644
index 0000000..96ec49f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaComponent.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.widgets;
+
+import javax.swing.JComponent;
+
+public interface XBayaComponent {
+
+    /**
+     * Returns the swing component.
+     * 
+     * @return The swing component.
+     */
+    public JComponent getSwingComponent();
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaLabel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaLabel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaLabel.java
new file mode 100644
index 0000000..1ebc2c4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/widgets/XBayaLabel.java
@@ -0,0 +1,95 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.xbaya.ui.widgets;
+
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.SwingConstants;
+
+
+public class XBayaLabel implements XBayaComponent {
+
+    private JLabel label;
+
+    /**
+     * Constructs a XBayaLabel.
+     * 
+     * @param text
+     * @param component
+     *            The component to be labeled for.
+     */
+    public XBayaLabel(String text, XBayaComponent component) {
+        this(text, component.getSwingComponent());
+    }
+
+    /**
+     * Constructs a XBayaLabel.
+     * 
+     * @param text
+     * @param component
+     *            The component to be labeled for.
+     */
+    public XBayaLabel(String text, JComponent component) {
+        init();
+        setText(text);
+        setLabelFor(component);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.XBayaComponent#getSwingComponent()
+     */
+    public JLabel getSwingComponent() {
+        return getJLabel();
+    }
+
+    /**
+     * @param text
+     */
+    public void setText(String text) {
+        this.label.setText(text + ": ");
+    }
+
+    /**
+     * @return The text field
+     */
+    public JLabel getJLabel() {
+        return this.label;
+    }
+
+    /**
+     * @param component
+     */
+    public void setLabelFor(XBayaComponent component) {
+        setLabelFor(component.getSwingComponent());
+    }
+
+    /**
+     * @param component
+     */
+    public void setLabelFor(JComponent component) {
+        this.label.setLabelFor(component);
+    }
+
+    private void init() {
+        this.label = new JLabel();
+        this.label.setHorizontalAlignment(SwingConstants.TRAILING);
+    }
+}
\ No newline at end of file


[41/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/DescriptorResourceClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/DescriptorResourceClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/DescriptorResourceClient.java
deleted file mode 100644
index 8252244..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/DescriptorResourceClient.java
+++ /dev/null
@@ -1,1278 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException;
-import org.apache.airavata.rest.mappings.resourcemappings.*;
-import org.apache.airavata.rest.mappings.utils.DescriptorUtil;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.utils.BasicAuthHeaderUtil;
-import org.apache.airavata.rest.utils.ClientConstant;
-import org.apache.airavata.rest.utils.CookieManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class DescriptorResourceClient {
-    private WebResource webResource;
-    private final static Logger logger = LoggerFactory.getLogger(DescriptorResourceClient.class);
-    private String userName;
-    private PasswordCallback callback;
-    private String baseURI;
-    private Cookie cookie;
-    private WebResource.Builder builder;
-    private String gateway;
-//    private CookieManager cookieManager = new CookieManager();
-
-    public DescriptorResourceClient(String userName,
-                                    String gateway,
-                                    String serviceURI,
-                                    PasswordCallback callback,
-                                    Cookie cookie) {
-        this.userName = userName;
-        this.callback = callback;
-        this.baseURI = serviceURI;
-        this.gateway = gateway;
-        this.cookie = cookie;
-    }
-
-    private URI getBaseURI() {
-        logger.debug("Creating Base URI");
-        return UriBuilder.fromUri(baseURI).build();
-    }
-
-    private WebResource getDescriptorRegistryBaseResource() {
-        ClientConfig config = new DefaultClientConfig();
-        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
-                Boolean.TRUE);
-        Client client = Client.create(config);
-        WebResource baseWebResource = client.resource(getBaseURI());
-        webResource = baseWebResource.path(
-                ResourcePathConstants.DecResourcePathConstants.DESC_RESOURCE_PATH);
-        return webResource;
-    }
-
-    public boolean isHostDescriptorExists(String hostDescriptorName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.HOST_DESC_EXISTS);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("hostDescriptorName", hostDescriptorName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-
-    public void addHostDescriptor(HostDescription hostDescription) throws DescriptorAlreadyExistsException {
-        HostDescriptor hostDescriptor = DescriptorUtil.createHostDescriptor(hostDescription);
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.HOST_DESC_SAVE);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, hostDescriptor);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, hostDescriptor);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }else if (status == ClientConstant.HTTP_BAD_REQUEST){
-                logger.debug("Descriptor already exists...");
-                throw new DescriptorAlreadyExistsException(hostDescription.getType().getHostName());
-            } else {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-
-            }
-        }else if (status == ClientConstant.HTTP_BAD_REQUEST){
-            logger.debug("Descriptor already exists...");
-            throw new DescriptorAlreadyExistsException(hostDescription.getType().getHostName());
-        }
-        else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateHostDescriptor(HostDescription hostDescription) {
-        HostDescriptor hostDescriptor = DescriptorUtil.createHostDescriptor(hostDescription);
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.HOST_DESC_UPDATE);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, hostDescriptor);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, hostDescriptor);
-
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public HostDescription getHostDescriptor(String hostName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.HOST_DESC);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("hostName", hostName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).type(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).type(
-                    MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK && status != ClientConstant.HTTP_BAD_REQUEST) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else if (status == ClientConstant.HTTP_BAD_REQUEST) {
-                return null;
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_BAD_REQUEST) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        HostDescriptor hostDescriptor = response.getEntity(HostDescriptor.class);
-        HostDescription hostDescription = DescriptorUtil.createHostDescription(hostDescriptor);
-        return hostDescription;
-    }
-
-    public void removeHostDescriptor(String hostName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.HOST_DESC_DELETE);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("hostName", hostName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public List<HostDescription> getHostDescriptors() {
-        List<HostDescription> hostDescriptions = new ArrayList<HostDescription>();
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return hostDescriptions;
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return hostDescriptions;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        HostDescriptionList hostDescriptionList = response.getEntity(HostDescriptionList.class);
-        HostDescriptor[] hostDescriptors = hostDescriptionList.getHostDescriptions();
-
-        for (HostDescriptor hostDescriptor : hostDescriptors) {
-            HostDescription hostDescription = DescriptorUtil.createHostDescription(hostDescriptor);
-            hostDescriptions.add(hostDescription);
-        }
-
-        return hostDescriptions;
-    }
-
-    public List<String> getHostDescriptorNames() {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.GET_HOST_DESCS_NAMES);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return new ArrayList<String>();
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return new ArrayList<String>();
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        DescriptorNameList descriptorNameList = response.getEntity(DescriptorNameList.class);
-        return descriptorNameList.getDescriptorNames();
-    }
-
-    public boolean isServiceDescriptorExists(String serviceDescriptorName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_EXISTS);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("serviceDescriptorName", serviceDescriptorName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addServiceDescriptor(ServiceDescription serviceDescription) throws DescriptorAlreadyExistsException {
-        ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_SAVE);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, serviceDescriptor);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, serviceDescriptor);
-
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_BAD_REQUEST){
-                logger.debug("Descriptor already exists...");
-                throw new DescriptorAlreadyExistsException(serviceDescriptor.getServiceName());
-            } else if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_BAD_REQUEST){
-            logger.debug("Descriptor already exists...");
-            throw new DescriptorAlreadyExistsException(serviceDescriptor.getServiceName());
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateServiceDescriptor(ServiceDescription serviceDescription) {
-        ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_UPDATE);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, serviceDescriptor);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, serviceDescriptor);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public ServiceDescription getServiceDescriptor(String serviceName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("serviceName", serviceName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK && status != ClientConstant.HTTP_BAD_REQUEST) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else if (status == ClientConstant.HTTP_BAD_REQUEST) {
-                return null;
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_BAD_REQUEST) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ServiceDescriptor serviceDescriptor = response.getEntity(ServiceDescriptor.class);
-        ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(serviceDescriptor);
-        return serviceDescription;
-    }
-
-    public void removeServiceDescriptor(String serviceName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.SERVICE_DESC_DELETE);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("serviceName", serviceName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public List<ServiceDescription> getServiceDescriptors() {
-        List<ServiceDescription> serviceDescriptions = new ArrayList<ServiceDescription>();
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.GET_SERVICE_DESCS);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return serviceDescriptions;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return serviceDescriptions;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ServiceDescriptionList serviceDescriptionList = response.getEntity(ServiceDescriptionList.class);
-        ServiceDescriptor[] serviceDescriptors = serviceDescriptionList.getServiceDescriptions();
-
-        for (ServiceDescriptor serviceDescriptor : serviceDescriptors) {
-            ServiceDescription serviceDescription = DescriptorUtil.createServiceDescription(serviceDescriptor);
-            serviceDescriptions.add(serviceDescription);
-        }
-        return serviceDescriptions;
-    }
-
-    public boolean isApplicationDescriptorExists(String serviceName,
-                                                 String hostName,
-                                                 String appDescriptorName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APPL_DESC_EXIST);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("serviceName", serviceName);
-        queryParams.add("hostName", hostName);
-        queryParams.add("appDescName", appDescriptorName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addApplicationDescriptor(ServiceDescription serviceDescription,
-                                         HostDescription hostDescriptor,
-                                         ApplicationDescription descriptor) throws DescriptorAlreadyExistsException {
-        ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(descriptor);
-        applicationDescriptor.setHostdescName(hostDescriptor.getType().getHostName());
-        ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-        applicationDescriptor.setServiceDescriptor(serviceDescriptor);
-
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_BUILD_SAVE);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, applicationDescriptor);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, applicationDescriptor);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_BAD_REQUEST){
-                logger.debug("Descriptor already exists...");
-                throw new DescriptorAlreadyExistsException(applicationDescriptor.getName());
-            } else if (status != ClientConstant.HTTP_OK && status != ClientConstant.HTTP_UNAUTHORIZED) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_BAD_REQUEST){
-            logger.debug("Descriptor already exists...");
-            throw new DescriptorAlreadyExistsException(applicationDescriptor.getName());
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addApplicationDescriptor(String serviceName,
-                                         String hostName,
-                                         ApplicationDescription descriptor) throws DescriptorAlreadyExistsException {
-        ServiceDescription serviceDescription = getServiceDescriptor(serviceName);
-        ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(descriptor);
-        applicationDescriptor.setHostdescName(hostName);
-        ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-        applicationDescriptor.setServiceDescriptor(serviceDescriptor);
-
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_BUILD_SAVE);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, applicationDescriptor);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, applicationDescriptor);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_BAD_REQUEST){
-                logger.debug("Descriptor already exists...");
-                throw new DescriptorAlreadyExistsException(applicationDescriptor.getName());
-            } else if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_BAD_REQUEST){
-            logger.debug("Descriptor already exists...");
-            throw new DescriptorAlreadyExistsException(applicationDescriptor.getName());
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void udpateApplicationDescriptor(ServiceDescription serviceDescription,
-                                            HostDescription hostDescriptor,
-                                            ApplicationDescription descriptor) {
-        ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(descriptor);
-        applicationDescriptor.setHostdescName(hostDescriptor.getType().getHostName());
-        ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-        applicationDescriptor.setServiceDescriptor(serviceDescriptor);
-
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_UPDATE);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, applicationDescriptor);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, applicationDescriptor);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateApplicationDescriptor(String serviceName,
-                                            String hostName,
-                                            ApplicationDescription descriptor) {
-        ServiceDescription serviceDescription = getServiceDescriptor(serviceName);
-        ApplicationDescriptor applicationDescriptor = DescriptorUtil.createApplicationDescriptor(descriptor);
-        applicationDescriptor.setHostdescName(hostName);
-        ServiceDescriptor serviceDescriptor = DescriptorUtil.createServiceDescriptor(serviceDescription);
-        applicationDescriptor.setServiceDescriptor(serviceDescriptor);
-
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_UPDATE);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, applicationDescriptor);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, applicationDescriptor);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public ApplicationDescription getApplicationDescriptor(String serviceName,
-                                                                     String hostname,
-                                                                     String applicationName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_DESCRIPTION);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("serviceName", serviceName);
-        queryParams.add("hostName", hostname);
-        queryParams.add("applicationName", applicationName);
-
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK && status != ClientConstant.HTTP_BAD_REQUEST) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else if (status == ClientConstant.HTTP_BAD_REQUEST) {
-                return null;
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_BAD_REQUEST) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ApplicationDescriptor applicationDescriptor = response.getEntity(ApplicationDescriptor.class);
-        ApplicationDescription applicationDescription =
-                DescriptorUtil.createApplicationDescription(applicationDescriptor);
-        return applicationDescription;
-    }
-
-    public ApplicationDescription getApplicationDescriptors(String serviceName,
-                                                                      String hostname) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_PER_HOST_SERVICE);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("serviceName", serviceName);
-        queryParams.add("hostName", hostname);
-
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ApplicationDescriptor applicationDescriptor = response.getEntity(ApplicationDescriptor.class);
-        ApplicationDescription applicationDescription =
-                DescriptorUtil.createApplicationDescription(applicationDescriptor);
-        return applicationDescription;
-    }
-
-    public Map<String, ApplicationDescription> getApplicationDescriptors(String serviceName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_ALL_DESCS_SERVICE);
-        Map<String, ApplicationDescription> applicationDeploymentDescriptionMap = new HashMap<String, ApplicationDescription>();
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("serviceName", serviceName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return applicationDeploymentDescriptionMap;
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return applicationDeploymentDescriptionMap;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ApplicationDescriptorList applicationDescriptorList =
-                response.getEntity(ApplicationDescriptorList.class);
-        ApplicationDescriptor[] applicationDescriptors =
-                applicationDescriptorList.getApplicationDescriptors();
-
-        for (ApplicationDescriptor applicationDescriptor : applicationDescriptors) {
-            ApplicationDescription applicationDescription =
-                    DescriptorUtil.createApplicationDescription(applicationDescriptor);
-            applicationDeploymentDescriptionMap.put(
-                    applicationDescriptor.getHostdescName(), applicationDescription);
-        }
-        return applicationDeploymentDescriptionMap;
-    }
-
-    public Map<String[], ApplicationDescription> getApplicationDescriptors() {
-        Map<String[], ApplicationDescription> applicationDeploymentDescriptionMap = new HashMap<String[], ApplicationDescription>();
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_ALL_DESCRIPTORS);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ApplicationDescriptorList applicationDescriptorList =
-                response.getEntity(ApplicationDescriptorList.class);
-        ApplicationDescriptor[] applicationDescriptors =
-                applicationDescriptorList.getApplicationDescriptors();
-        for (ApplicationDescriptor applicationDescriptor : applicationDescriptors) {
-            ApplicationDescription applicationDescription =
-                    DescriptorUtil.createApplicationDescription(applicationDescriptor);
-            String[] descriptors =
-                    {applicationDescriptor.getServiceDescriptor().getServiceName(),
-                            applicationDescriptor.getHostdescName()};
-            applicationDeploymentDescriptionMap.put(descriptors, applicationDescription);
-        }
-        return applicationDeploymentDescriptionMap;
-    }
-
-    public List<String> getApplicationDescriptorNames() {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_NAMES);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return new ArrayList<String>();
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return new ArrayList<String>();
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        DescriptorNameList descriptorNameList = response.getEntity(DescriptorNameList.class);
-        return descriptorNameList.getDescriptorNames();
-    }
-
-    public void removeApplicationDescriptor(String serviceName,
-                                            String hostName,
-                                            String applicationName) {
-        webResource = getDescriptorRegistryBaseResource().path(
-                ResourcePathConstants.DecResourcePathConstants.APP_DESC_DELETE);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("serviceName", serviceName);
-        queryParams.add("hostName", hostName);
-        queryParams.add("appName", applicationName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ExperimentResourceClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ExperimentResourceClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ExperimentResourceClient.java
deleted file mode 100644
index 2c74f00..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ExperimentResourceClient.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import org.apache.airavata.registry.api.AiravataExperiment;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.rest.mappings.resourcemappings.ExperimentList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.utils.BasicAuthHeaderUtil;
-import org.apache.airavata.rest.utils.ClientConstant;
-import org.apache.airavata.rest.utils.CookieManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-public class ExperimentResourceClient {
-    private WebResource webResource;
-    private final static Logger logger = LoggerFactory.getLogger(ExperimentResourceClient.class);
-    private String userName;
-    private PasswordCallback callback;
-    private String baseURI;
-    private Cookie cookie;
-    private WebResource.Builder builder;
-    private String gateway;
-//    private CookieManager cookieManager = new CookieManager();
-
-    public ExperimentResourceClient(String userName,
-                                    String gateway,
-                                    String serviceURI,
-                                    PasswordCallback callback,
-                                    Cookie cookie) {
-        this.userName = userName;
-        this.callback = callback;
-        this.baseURI = serviceURI;
-        this.gateway = gateway;
-        this.cookie = cookie;
-    }
-
-    private URI getBaseURI() {
-        logger.debug("Creating Base URI");
-        return UriBuilder.fromUri(baseURI).build();
-    }
-
-    private WebResource getExperimentRegistryBaseResource() {
-        ClientConfig config = new DefaultClientConfig();
-        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
-                Boolean.TRUE);
-        Client client = Client.create(config);
-        WebResource baseWebResource = client.resource(getBaseURI());
-        webResource = baseWebResource.path(
-                ResourcePathConstants.ExperimentResourcePathConstants.EXP_RESOURCE_PATH);
-        return webResource;
-    }
-
-    public void addExperiment(String projectName, AiravataExperiment experiment) {
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String date = dateFormat.format(experiment.getSubmittedDate());
-        webResource = getExperimentRegistryBaseResource().path(
-                ResourcePathConstants.ExperimentResourcePathConstants.ADD_EXP);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("projectName", projectName);
-        formParams.add("experimentID", experiment.getExperimentId());
-        formParams.add("submittedDate", date);
-
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void removeExperiment(String experimentId) {
-        webResource = getExperimentRegistryBaseResource().path(
-                ResourcePathConstants.ExperimentResourcePathConstants.DELETE_EXP);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentId", experimentId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public List<AiravataExperiment> getExperiments() {
-        List<AiravataExperiment> airavataExperiments = new ArrayList<AiravataExperiment>();
-        webResource = getExperimentRegistryBaseResource().path(
-                ResourcePathConstants.ExperimentResourcePathConstants.GET_ALL_EXPS);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, null, cookie, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return airavataExperiments;
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return airavataExperiments;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentList experimentList = response.getEntity(ExperimentList.class);
-        AiravataExperiment[] experiments = experimentList.getExperiments();
-        for (AiravataExperiment airavataExperiment : experiments) {
-            airavataExperiments.add(airavataExperiment);
-        }
-        return airavataExperiments;
-    }
-
-    public List<AiravataExperiment> getExperiments(String projectName) {
-        webResource = getExperimentRegistryBaseResource().path(
-                ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_PROJECT);
-        List<AiravataExperiment> airavataExperiments = new ArrayList<AiravataExperiment>();
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("projectName", projectName);
-
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return airavataExperiments;
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return airavataExperiments;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentList experimentList = response.getEntity(ExperimentList.class);
-        AiravataExperiment[] experiments = experimentList.getExperiments();
-
-        for (AiravataExperiment airavataExperiment : experiments) {
-            airavataExperiments.add(airavataExperiment);
-        }
-        return airavataExperiments;
-    }
-
-    public List<AiravataExperiment> getExperiments(Date from, Date to) {
-        List<AiravataExperiment> airavataExperiments = new ArrayList<AiravataExperiment>();
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String fromDate = dateFormat.format(from);
-        String toDate = dateFormat.format(to);
-        webResource = getExperimentRegistryBaseResource().path(
-                ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_BY_DATE);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("fromDate", fromDate);
-        queryParams.add("toDate", toDate);
-
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return airavataExperiments;
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return airavataExperiments;
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentList experimentList = response.getEntity(ExperimentList.class);
-        AiravataExperiment[] experiments = experimentList.getExperiments();
-
-        for (AiravataExperiment airavataExperiment : experiments) {
-            airavataExperiments.add(airavataExperiment);
-        }
-        return airavataExperiments;
-    }
-
-    public List<AiravataExperiment> getExperiments(String projectName, Date from, Date to) {
-        List<AiravataExperiment> airavataExperiments = new ArrayList<AiravataExperiment>();
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String fromDate = dateFormat.format(from);
-        String toDate = dateFormat.format(to);
-        webResource = getExperimentRegistryBaseResource().path(
-                ResourcePathConstants.ExperimentResourcePathConstants.GET_EXPS_PER_PROJECT_BY_DATE);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("projectName", projectName);
-        queryParams.add("fromDate", fromDate);
-        queryParams.add("toDate", toDate);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return airavataExperiments;
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return airavataExperiments;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentList experimentList = response.getEntity(ExperimentList.class);
-        AiravataExperiment[] experiments = experimentList.getExperiments();
-
-
-        for (AiravataExperiment airavataExperiment : experiments) {
-            airavataExperiments.add(airavataExperiment);
-        }
-        return airavataExperiments;
-    }
-
-    public boolean isExperimentExists(String experimentId) {
-        webResource = getExperimentRegistryBaseResource().path(
-                ResourcePathConstants.ExperimentResourcePathConstants.EXP_EXISTS);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentId", experimentId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public boolean isExperimentExists(String experimentId, boolean createIfNotPresent) {
-        String createStatus = "false";
-        webResource = getExperimentRegistryBaseResource().path(
-                ResourcePathConstants.ExperimentResourcePathConstants.EXP_EXISTS_CREATE);
-        if (createIfNotPresent) {
-            createStatus = "true";
-        }
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("experimentId", experimentId);
-        formParams.add("createIfNotPresent", createStatus);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, callback.getPassword(userName), null, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, null, cookie, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/PasswordCallbackImpl.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/PasswordCallbackImpl.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/PasswordCallbackImpl.java
deleted file mode 100644
index 8c2c8d1..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/PasswordCallbackImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import org.apache.airavata.registry.api.PasswordCallback;
-
-public class PasswordCallbackImpl implements PasswordCallback {
-
-    private String username;
-    private String password;
-
-    public PasswordCallbackImpl(String password, String username) {
-        this.password = password;
-        this.username = username;
-    }
-
-    @Override
-    public String getPassword(String username) {
-        return password;
-    }
-}


[46/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/jnlp/NOTICE
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/jnlp/NOTICE b/modules/distribution/xbaya-gui/src/main/resources/jnlp/NOTICE
deleted file mode 100644
index 431db59..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/jnlp/NOTICE
+++ /dev/null
@@ -1,163 +0,0 @@
-Apache Airavata
-Copyright 2014 The Apache Software Foundation
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
-
-===============================================================================
-Apache Xerces Java Notice:
-
-   Portions of this software were originally based on the following:
-     - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
-     - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
-     - voluntary contributions made by Paul Eng on behalf of the
-       Apache Software Foundation that were originally developed at iClick, Inc.,
-       software copyright (c) 1999.
-
-================================================================================
-Apache XmlBeans Notice: 
-
-   Portions of this software were originally based on the following:
-     - software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-   Aside from contributions to the Apache XMLBeans project, this
-   software also includes:
-
-    - one or more source files from the Apache Xerces-J and Apache Axis
-      products, Copyright (c) 1999-2003 Apache Software Foundation
-
-    - W3C XML Schema documents Copyright 2001-2003 (c) World Wide Web
-      Consortium (Massachusetts Institute of Technology, European Research
-      Consortium for Informatics and Mathematics, Keio University)
-
-    - resolver.jar from Apache Xml Commons project,
-      Copyright (c) 2001-2003 Apache Software Foundation
-
-    - Piccolo XML Parser for Java from http://piccolo.sourceforge.net/,
-      Copyright 2002 Yuval Oren under the terms of the Apache Software License 2.0
-
-    - JSR-173 Streaming API for XML from http://sourceforge.net/projects/xmlpullparser/,
-      Copyright 2005 BEA under the terms of the Apache Software License 2.0
-      
-=========================================================================================
-Apache Axis2 Notice: (axis2-*, mex-1.5.1-impl)
-
-Portions Copyright 2006 International Business Machines Corp.
-Portions Copyright 2005-2007 WSO2, Inc.
-
-This product also includes schemas and specification developed by:
-- the W3C consortium (http://www.w3c.org)
-
-This product also includes WS-* schemas developed by International
-Business Machines Corporation, Microsoft Corporation, BEA Systems, 
-TIBCO Software, SAP AG, Sonic Software, and VeriSign
-
-This product also includes a WSDL developed by salesforce.com
-- Copyright 1999-2006 salesforce.com, inc.
-Portions of the included xmlbeans library were originally based on the following:
-- software copyright (c) 2000-2003, BEA Systems, <http://www.bea.com/>.
-
-====================================================================================
-Apache Derby Notice:
-
-Portions of Derby were originally developed by
-International Business Machines Corporation and are
-licensed to the Apache Software Foundation under the
-"Software Grant and Corporate Contribution License Agreement",
-informally known as the "Derby CLA".
-The following copyright notice(s) were affixed to portions of the code
-with which this file is now or was at one time distributed
-and are placed here unaltered.
-
-(C) Copyright 1997,2004 International Business Machines Corporation.  All rights reserved.
-
-(C) Copyright IBM Corp. 2003. 
-
-=======================
-
-The portion of the functionTests under 'nist' was originally 
-developed by the National Institute of Standards and Technology (NIST), 
-an agency of the United States Department of Commerce, and adapted by
-International Business Machines Corporation in accordance with the NIST
-Software Acknowledgment and Redistribution document at
-http://www.itl.nist.gov/div897/ctg/sql_form.htm
-
-========================
-
-The JDBC apis for small devices and JDBC3 (under java/stubs/jsr169 and
-java/stubs/jdbc3) were produced by trimming sources supplied by the
-Apache Harmony project. In addition, the Harmony SerialBlob and
-SerialClob implementations are used. The following notice covers the Harmony sources:
-
-Portions of Harmony were originally developed by
-Intel Corporation and are licensed to the Apache Software
-Foundation under the "Software Grant and Corporate Contribution
-License Agreement", informally known as the "Intel Harmony CLA".
-
-=============================================================================
-Apache Woden Notice:
-
-   This product also includes software developed by :
-   
-     - IBM Corporation (http://www.ibm.com),
-         WSDL4J was the initial code contribution for the Apache Woden
-         project and some of the WSDL4J design and code has been reused.
-     - The W3C Consortium (http://www.w3c.org),
-         Common W3C XML Schema and DTD files are packaged with Apache Woden.
-
-   Please read the different LICENSE files present in the root directory of
-   this distribution.
-
-=========================================================================
-Woodstox Notice: 
-
-This product includes software developed by the Woodstox Project 
-(http://woodstox.codehaus.org/)
-
-This product currently only contains code developed by authors
-of specific components, as identified by the source code files.
-
-Since product implements StAX API, it has dependencies to StAX API
-classes.
-
-For additional credits (generally to people who reported problems)
-see CREDITS file.
-
-===========================================================================
-Apache xml-commons xml-apis Notice:
-
-   Portions of this software were originally based on the following:
-     - software copyright (c) 1999, IBM Corporation., http://www.ibm.com.
-     - software copyright (c) 1999, Sun Microsystems., http://www.sun.com.
-     - software copyright (c) 2000 World Wide Web Consortium, http://www.w3.org
-
-================================================================================================
-Apache  Xalan Notice: 
-
-Portions of this software was originally based on the following:
-     - software copyright (c) 1999-2002, Lotus Development Corporation., http://www.lotus.com.
-     - software copyright (c) 2001-2002, Sun Microsystems., http://www.sun.com.
-     - software copyright (c) 2003, IBM Corporation., http://www.ibm.com.
-     - voluntary contributions made by Ovidiu Predescu (ovidiu@cup.hp.com) on behalf of the 
-       Apache Software Foundation and was originally developed at Hewlett Packard Company. 
-================================================================================================
-Apache  OpenJPA Notice: 
-
-OpenJPA includes software developed by the SERP project
-Copyright (c) 2002-2006, A. Abram White. All rights reserved.
-
-OpenJPA includes the persistence and orm schemas from the JPA specifications.
-Copyright 2005-2009 Sun Microsystems, Inc. All rights reserved.
-OpenJPA elects to include this software in this distribution under the
-CDDL license.  You can obtain a copy of the License at:
-    https://glassfish.dev.java.net/public/CDDL+GPL.html
-The source code is available at:
-    https://glassfish.dev.java.net/source/browse/glassfish/
-
-OpenJPA includes software written by Miroslav Nachev
-OpenJPA uses test code written by Charles Tillman.
-================================================================================================
-Apache XmlSchema Notice:
-
-Portions Copyright 2006 International Business Machines Corp.
-================================================================================================
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/jnlp/README
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/jnlp/README b/modules/distribution/xbaya-gui/src/main/resources/jnlp/README
deleted file mode 100644
index 092c20e..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/jnlp/README
+++ /dev/null
@@ -1,91 +0,0 @@
-Apache Airavata XBaya JNLP - README.txt
-Licensed under Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0
---------------------------------------------------------------------------------
-
-About
-=====
-Apache Airavata, a software framework to executing and managing computational jobs on 
-distributed computing resources including local clusters, supercomputers, national grids, 
-academic and commercial clouds. Airavata can be used as individual components or 
-as an integrated solution to build science gateways or general-purpose distributed 
-application and workflow management systems. Users can use Airavata back end services 
-and build gadgets to deploy in open social containers such as Apache Rave and modify them 
-to suit their needs. Airavata builds on general concepts of service oriented computing, 
-distributed messaging, and workflow composition and orchestration.
-
-This distribution is a client gui application designed to be hosted on a web server as 
-a web start application that can compose workflows, application descriptors & communicate 
-with the airavata server to persist user data, run & monitor experiments and analyze 
-the results.
-
-Release Notes
-=============
-0.11 is the tenth release of Airavata (skipped 0.1-INCUBATNG). This release focuses GFac rearchitecturing and more GFac level changes. For detailed tasks list, please see RELEASE_NOTES.
-
-Building from source
-====================
-For brief installation instructions, see INSTALL
-For detailed installation and further instructions refer http://airavata.apache.org/ - Documentation section in left hand panel. Step by step with proper documentation are provided.
-
-Known Issues in This Release
-============================
-This is the base release and is focused on a good foundation and less on features. This 
-version is not recommended for production usage.
-
-Airavata XBaya JNLP Distribution Directory Structure
-====================================================
-
-    AIRAVATA_XBAYA_JNLP
-		├── lib
-		├── airavata-logo.gif
-		├── INSTALL
-		├── LICENSE
-		├── NOTICE
-		├── README
-		└── xbaya.jnlp
-
-How to test and run samples
-===========================
-* If you built Airavata from source, and if you see "BUILD SUCCESS", then the test cases should have passes.
-* The test cases are beyond unit level, they startup embedded services and run through basic workflow use cases.
-* To walk through Airavata features, follow "Airavata in Five Minutes" tutorial at http://airavata.apache.org/documentation/tutorials/airavata-in-5-minutes.html
-* For intermediate level Airavata features, follow "Airavata in Ten Minutes" tutorial at http://airavata.apache.org/documentation/tutorials/airavata-in-10-minutes.html 
-* For advanced use cases, please contact mailing lists - http://airavata.apache.org/community/mailing-lists.html
-
-Description of Directory Structure
-==================================
-
-    - lib
-      This contains all the libraries required to run the XBaya GUI as a Java Web Start Application.
-
-	- xbaya.jnlp
-      Java Web start file
-	
-    - README
-      This document.
-
-    - INSTALL
-      This document will contain information on installing Apache-Airavata XBaya.
-
-Other Available Distributions
-=============================
-
-Server Distributions
---------------------
-* Airavata Server
-  The Airavata Server binary distribution allows you to run a standalone Airavata Server which includes all the airavata services 
-  shipped with a default derby database as the backend registry.
-
-* Airavata Server Web Application
-  The Airavata Server Web Application distribution allows you to run Airavata Server in a tomcat hosted environment. It includes 
-  all the airavata services shipped with a default derby database as the backend registry.
-
-Client Distributions
---------------------
-* Airavata XBaya
-  The Airavata XBaya distribution is a client gui application capable of composing workflows, application descriptors & communicating 
-  with the airavata server to persist user data, run & monitor experiments and analyze the results.
-
-* Airavata Client
-  The Airavata Client distribution is a set of libraries and configurations files that allow a 3rd party application to programatically 
-  access Airavata functionality through Airavata API. 

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/jnlp/xbaya.jnlp
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/jnlp/xbaya.jnlp b/modules/distribution/xbaya-gui/src/main/resources/jnlp/xbaya.jnlp
deleted file mode 100644
index 7f196d3..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/jnlp/xbaya.jnlp
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
-    contributor license agreements. See the NOTICE file ~ distributed with this
-    work for additional information ~ regarding copyright ownership. The ASF
-    licenses this file ~ to you under the Apache License, Version 2.0 (the ~
-    "License"); you may not use this file except in compliance ~ with the License.
-    You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
-    ~ ~ Unless required by applicable law or agreed to in writing, ~ software
-    distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
-    WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
-    License for the ~ specific language governing permissions and limitations
-    ~ under the License. -->
-
-<jnlp spec="1.0+"
-   codebase="http://localhost:8080/airavata-xbaya/"
-   href="xbaya.jnlp">
-<information>
-	<title>XBaya</title>
-	<vendor>Apache Airavata</vendor>
-	<icon href="airavata-logo.gif"/>
-	<offline-allowed/>
-</information>
-<security>
-	<all-permissions/>
-</security>
-<resources>
-	<j2se version="1.5+" java-vm-args="-Xmx1024m" />
-
-	    DEPENDENT_JARS
-
-    <property name="log" value="org.apache.airavata.xbaya:ALL"/>
-    <!--property name="javax.net.ssl.trustStore" value="client.jks"/>
-    <property name="javax.net.ssl.trustStorePassword" value="airavata"/>
-    <property name="javax.net.ssl.trustStoreType" value="JKS"/>
-    <property name="javax.net.ssl.keyStore" value="client.jks"/>
-    <property name="javax.net.ssl.keyStorePassword" value="airavata"/-->
-</resources>
-<application-desc main-class="org.apache.airavata.xbaya.XBaya">
-
-</application-desc>
-</jnlp>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/xbaya.jks
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/xbaya.jks b/modules/distribution/xbaya-gui/src/main/resources/xbaya.jks
deleted file mode 100644
index 15ee6f9..0000000
Binary files a/modules/distribution/xbaya-gui/src/main/resources/xbaya.jks and /dev/null differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/xbaya.jnlp
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/xbaya.jnlp b/modules/distribution/xbaya-gui/src/main/resources/xbaya.jnlp
deleted file mode 100644
index 7f196d3..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/xbaya.jnlp
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
-    contributor license agreements. See the NOTICE file ~ distributed with this
-    work for additional information ~ regarding copyright ownership. The ASF
-    licenses this file ~ to you under the Apache License, Version 2.0 (the ~
-    "License"); you may not use this file except in compliance ~ with the License.
-    You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
-    ~ ~ Unless required by applicable law or agreed to in writing, ~ software
-    distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
-    WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
-    License for the ~ specific language governing permissions and limitations
-    ~ under the License. -->
-
-<jnlp spec="1.0+"
-   codebase="http://localhost:8080/airavata-xbaya/"
-   href="xbaya.jnlp">
-<information>
-	<title>XBaya</title>
-	<vendor>Apache Airavata</vendor>
-	<icon href="airavata-logo.gif"/>
-	<offline-allowed/>
-</information>
-<security>
-	<all-permissions/>
-</security>
-<resources>
-	<j2se version="1.5+" java-vm-args="-Xmx1024m" />
-
-	    DEPENDENT_JARS
-
-    <property name="log" value="org.apache.airavata.xbaya:ALL"/>
-    <!--property name="javax.net.ssl.trustStore" value="client.jks"/>
-    <property name="javax.net.ssl.trustStorePassword" value="airavata"/>
-    <property name="javax.net.ssl.trustStoreType" value="JKS"/>
-    <property name="javax.net.ssl.keyStore" value="client.jks"/>
-    <property name="javax.net.ssl.keyStorePassword" value="airavata"/-->
-</resources>
-<application-desc main-class="org.apache.airavata.xbaya.XBaya">
-
-</application-desc>
-</jnlp>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/pom.xml b/modules/registry/airavata-registry-service/pom.xml
deleted file mode 100644
index bc49133..0000000
--- a/modules/registry/airavata-registry-service/pom.xml
+++ /dev/null
@@ -1,116 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata</artifactId>
-        <version>0.12-SNAPSHOT</version>
-        <relativePath>../../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-registry-service</artifactId>
-    <name>Airavata Registry Service</name>
-    <description>Registry Service to expose Registry as a web service</description>
-    <url>http://airavata.apache.org/</url>
-    
-    <dependencies>
-        <!--dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-adb</artifactId>
-            <version>${axis2.version}</version>
-        </dependency-->
-        <!--dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-kernel</artifactId>
-            <version>${axis2.version}</version>
-        </dependency-->
-        <!--dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-api</artifactId>
-            <version>1.2.8</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-impl</artifactId>
-            <version>1.2.8</version>
-        </dependency-->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-            <version>${org.slf4j.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>${org.slf4j.version}</version>
-            <scope>runtime</scope>
-        </dependency>
-	   <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-jpa-registry</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-            <version>1.1.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derby</artifactId>
-            <version>${derby.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbyclient</artifactId>
-            <version>${derby.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbynet</artifactId>
-            <version>${derby.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbytools</artifactId>
-            <version>${derby.version}</version>
-        </dependency>
-	</dependencies>
-
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <version>${antrun.version}</version>
-                <executions>
-                    <execution>
-                        <id>restore-persistence</id>
-                        <phase>prepare-package</phase>
-                        <configuration>
-                            <tasks>
-                                <copy file="${project.build.outputDirectory}/services.xml" tofile="${project.build.outputDirectory}/META-INF/services.xml" />
-                            </tasks>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ConfigurationRegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ConfigurationRegistryService.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ConfigurationRegistryService.java
deleted file mode 100644
index 4fc9099..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ConfigurationRegistryService.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.registry.services;
-
-import javax.ws.rs.core.Response;
-import java.net.URI;
-import java.util.Date;
-
-public interface ConfigurationRegistryService {
-    public Response getConfiguration(String key);
-
-    public Response getConfigurationList(String key);
-
-    public Response setConfiguration(String key, String value, Date expire);
-
-    public Response addConfiguration(String key, String value, Date expire);
-
-    public Response removeAllConfiguration(String key);
-
-    public Response removeConfiguration(String key, String value);
-
-    public Response getGFacURIs();
-
-    public Response getWorkflowInterpreterURIs();
-
-    public Response getEventingServiceURI();
-
-    public Response getMessageBoxURI();
-
-    public Response addGFacURI(URI uri);
-
-    public Response addWorkflowInterpreterURI(URI uri);
-
-    public Response setEventingURI(URI uri);
-
-    public Response setMessageBoxURI(URI uri);
-
-    public Response addGFacURIByDate(URI uri, Date expire);
-
-    public Response addWorkflowInterpreterURI(URI uri, Date expire);
-
-    public Response setEventingURIByDate(URI uri, Date expire);
-
-    public Response setMessageBoxURIByDate(URI uri, Date expire);
-
-    public Response removeGFacURI(URI uri);
-
-    public Response removeAllGFacURI();
-
-    public Response removeWorkflowInterpreterURI(URI uri);
-
-    public Response removeAllWorkflowInterpreterURI();
-
-    public Response unsetEventingURI();
-
-    public Response unsetMessageBoxURI();
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/DescriptorRegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/DescriptorRegistryService.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/DescriptorRegistryService.java
deleted file mode 100644
index 98c93d7..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/DescriptorRegistryService.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.registry.services;
-
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException;
-import org.apache.airavata.registry.api.exception.gateway.DescriptorDoesNotExistsException;
-import org.apache.airavata.registry.api.exception.gateway.MalformedDescriptorException;
-
-import javax.ws.rs.core.Response;
-
-public interface DescriptorRegistryService {
-    /*
-     * Note Name changes of the descriptors should not be allowed
-     */
-
-    // ---------Host Descriptor data------------
-    public Response isHostDescriptorExists(String descriptorName) throws RegistryException;
-
-    public Response addHostDescriptor(String descriptor) throws DescriptorAlreadyExistsException, RegistryException;
-
-    public Response updateHostDescriptor(String descriptor) throws DescriptorDoesNotExistsException, RegistryException;
-
-    public Response getHostDescriptor(String hostName) throws DescriptorDoesNotExistsException,
-            MalformedDescriptorException, RegistryException;
-
-    public Response removeHostDescriptor(String hostName) throws DescriptorDoesNotExistsException, RegistryException;
-
-    public Response getHostDescriptors() throws MalformedDescriptorException, RegistryException;
-
-    public Response getHostDescriptorMetadata(String hostName) throws DescriptorDoesNotExistsException,
-            RegistryException;
-
-    // ---------Service Descriptor data------------
-    public Response isServiceDescriptorExists(String descriptorName) throws RegistryException;
-
-    public Response addServiceDescriptor(String descriptor) throws DescriptorAlreadyExistsException, RegistryException;
-
-    public Response updateServiceDescriptor(String descriptor) throws DescriptorDoesNotExistsException,
-            RegistryException;
-
-    public Response getServiceDescriptor(String serviceName) throws DescriptorDoesNotExistsException,
-            MalformedDescriptorException, RegistryException;
-
-    public Response removeServiceDescriptor(String serviceName) throws DescriptorDoesNotExistsException,
-            RegistryException;
-
-    public Response getServiceDescriptors() throws MalformedDescriptorException, RegistryException;
-
-    public Response getServiceDescriptorMetadata(String serviceName) throws DescriptorDoesNotExistsException,
-            RegistryException;
-
-    // ---------Application Descriptor data------------
-    public Response isApplicationDescriptorExists(String serviceName, String hostName, String descriptorName)
-            throws RegistryException;
-
-    public Response addApplicationDescriptor(String serviceDescription, String hostDescriptor, String descriptor)
-            throws DescriptorAlreadyExistsException, RegistryException;
-
-    public Response addApplicationDesc(String serviceName, String hostName, String descriptor)
-            throws DescriptorAlreadyExistsException, RegistryException;
-
-    public Response udpateApplicationDescriptorByDescriptors(String serviceDescription, String hostDescriptor,
-            String descriptor) throws DescriptorDoesNotExistsException, RegistryException;
-
-    public Response updateApplicationDescriptor(String serviceName, String hostName, String descriptor)
-            throws DescriptorDoesNotExistsException, RegistryException;
-
-    public Response getApplicationDescriptor(String serviceName, String hostname, String applicationName)
-            throws DescriptorDoesNotExistsException, MalformedDescriptorException, RegistryException;
-
-    public Response getApplicationDescriptors(String serviceName, String hostname) throws MalformedDescriptorException,
-            RegistryException;
-
-    public Response getApplicationDescriptors(String serviceName) throws MalformedDescriptorException,
-            RegistryException;
-
-    public Response getApplicationDescriptors() throws MalformedDescriptorException, RegistryException;
-
-    public Response removeApplicationDescriptor(String serviceName, String hostName, String applicationName)
-            throws DescriptorDoesNotExistsException, RegistryException;
-
-    public Response getApplicationDescriptorMetadata(String serviceName, String hostName, String applicationName)
-            throws DescriptorDoesNotExistsException, RegistryException;
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProjectsRegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProjectsRegistryService.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProjectsRegistryService.java
deleted file mode 100644
index d51cf8c..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProjectsRegistryService.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.registry.services;
-
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.AiravataExperiment;
-import org.apache.airavata.registry.api.exception.worker.ExperimentDoesNotExistsException;
-import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectAlreadyExistsException;
-import org.apache.airavata.registry.api.exception.worker.WorkspaceProjectDoesNotExistsException;
-
-import javax.ws.rs.core.Response;
-import java.util.Date;
-
-public interface ProjectsRegistryService {
-    // ------------Project management
-    public Response isWorkspaceProjectExists(String projectName) throws RegistryException;
-
-    public Response isWorkspaceProjectExists(String projectName, String createIfNotExists) throws RegistryException;
-
-    public Response addWorkspaceProject(String projectName) throws WorkspaceProjectAlreadyExistsException,
-            RegistryException;
-
-    public Response updateWorkspaceProject(String projectName) throws WorkspaceProjectDoesNotExistsException,
-            RegistryException;
-
-    public Response deleteWorkspaceProject(String projectName) throws WorkspaceProjectDoesNotExistsException,
-            RegistryException;
-
-    public Response getWorkspaceProject(String projectName) throws WorkspaceProjectDoesNotExistsException,
-            RegistryException;
-
-    public Response getWorkspaceProjects() throws RegistryException;
-
-    // ------------Experiment management
-    public Response addExperiment(String projectName, AiravataExperiment experiment)
-            throws WorkspaceProjectDoesNotExistsException, ExperimentDoesNotExistsException, RegistryException;
-
-    public Response removeExperiment(String experimentId) throws ExperimentDoesNotExistsException;
-
-    public Response getExperiments() throws RegistryException;
-
-    public Response getExperimentsByProject(String projectName) throws RegistryException;
-
-    public Response getExperimentsByDate(Date from, Date to) throws RegistryException;
-
-    public Response getExperimentsByProjectDate(String projectName, Date from, Date to) throws RegistryException;
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProvenanceRegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProvenanceRegistryService.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProvenanceRegistryService.java
deleted file mode 100644
index 5109a0b..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/ProvenanceRegistryService.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.registry.services;
-
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.workflow.NodeExecutionStatus;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeGramData;
-
-import javax.ws.rs.core.Response;
-import java.util.Date;
-
-public interface ProvenanceRegistryService {
-    /*------------------------------------------- Experiment data ---------------------------------------------*/
-
-    /**
-     * Returns true if the experiment exists
-     * 
-     * @param experimentId
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response isExperimentExists(String experimentId) throws RegistryException;
-
-    public Response isExperimentExistsThenCreate(String experimentId, boolean createIfNotPresent)
-            throws RegistryException;
-
-    /**
-     * Save the username of the user who runs this experiment
-     * 
-     * @param experimentId
-     * @param user
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response updateExperimentExecutionUser(String experimentId, String user) throws RegistryException;
-
-    /**
-     * Retrieve the user who is runing the experiment
-     * 
-     * @param experimentId
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response getExperimentExecutionUser(String experimentId) throws RegistryException;
-
-    /**
-     * Get the name of the workflow intance
-     * 
-     * @param experimentId
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response getExperimentName(String experimentId) throws RegistryException;
-
-    /**
-     * Save a name for this workflow execution
-     * 
-     * @param experimentId
-     * @param experimentName
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response updateExperimentName(String experimentId, String experimentName) throws RegistryException;
-
-    /**
-     * Return the metadata information saved for the experiment
-     * 
-     * @param experimentId
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response getExperimentMetadata(String experimentId) throws RegistryException;
-
-    /**
-     * Save the metadata for the experiment
-     * 
-     * @param experimentId
-     * @param metadata
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response updateExperimentMetadata(String experimentId, String metadata) throws RegistryException;
-
-    /**
-     * Return the template name of the workflow that this intance was created from
-     * 
-     * @param workflowInstanceId
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response getWorkflowExecutionTemplateName(String workflowInstanceId) throws RegistryException;
-
-    /**
-     * Save the template name of the workflow that this intance was created from
-     * 
-     * @param workflowInstanceId
-     * @param templateName
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response setWorkflowInstanceTemplateName(String workflowInstanceId, String templateName)
-            throws RegistryException;
-
-    public Response getExperimentWorkflowInstances(String experimentId) throws RegistryException;
-
-    /*-------------------------------------- Experiment Workflow instance node data ----------------------------------------*/
-
-    public Response isWorkflowInstanceExists(String instanceId) throws RegistryException;
-
-    public Response isWorkflowInstanceExistsThenCreate(String instanceId, boolean createIfNotPresent)
-            throws RegistryException;
-
-    /**
-     * Save a status for this workflow execution with the current time at the moment
-     * 
-     * @param instanceId
-     * @param executionStatus
-     *            - contains the status
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response updateWorkflowInstanceStatusByInstance(String instanceId, String executionStatus)
-            throws RegistryException;
-
-    /**
-     * Save a status for this workflow execution
-     * 
-     * @param experimentID
-     * @param workflowInstanceID
-     * @param executionStatus
-     * @param statusUpdateTime
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response updateWorkflowInstanceStatusByExperiment(String experimentID, String workflowInstanceID,
-            String executionStatus, Date statusUpdateTime) throws RegistryException;
-
-    /**
-     * Return the status of the execution
-     * 
-     * @param instanceId
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response getWorkflowInstanceStatus(String instanceId) throws RegistryException;
-
-    /**
-     * Save the input data of a node in the workflow instance of an experiment
-     * 
-     * @param experimentID
-     * @param nodeID
-     * @param workflowInstanceID
-     * @param data
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response updateWorkflowNodeInput(String experimentID, String nodeID, String workflowInstanceID, String data)
-            throws RegistryException;
-
-    /**
-     * Save the output data of a node in the workflow instance of an experiment
-     * 
-     * @param experimentID
-     * @param nodeID
-     * @param workflowInstanceID
-     * @param data
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response updateWorkflowNodeOutput(String experimentID, String nodeID, String workflowInstanceID, String data)
-            throws RegistryException;
-
-    /**
-     * Return a list of data passed as input for service node which regex matched nodeId, workflow template id &
-     * experiment id
-     * 
-     * @param experimentIdRegEx
-     * @param workflowNameRegEx
-     *            - this is the workflowName or workflow template Id of an experiment
-     * @param nodeNameRegEx
-     *            - nodeId
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response searchWorkflowInstanceNodeInput(String experimentIdRegEx, String workflowNameRegEx,
-            String nodeNameRegEx) throws RegistryException;
-
-    /**
-     * Return a list of data returned as output from service node which regex matched nodeId, workflow template id &
-     * experiment id
-     * 
-     * @param experimentIdRegEx
-     * @param workflowNameRegEx
-     *            - this is the workflowName or workflow template Id of an experiment
-     * @param nodeNameRegEx
-     *            - nodeId
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response searchWorkflowInstanceNodeOutput(String experimentIdRegEx, String workflowNameRegEx,
-            String nodeNameRegEx) throws RegistryException;
-
-    public Response getWorkflowInstanceNodeInput(String workflowInstanceId, String nodeType) throws RegistryException;
-
-    public Response getWorkflowInstanceNodeOutput(String workflowInstanceId, String nodeType) throws RegistryException;
-
-    /*---------------------------------------  Retrieving Experiment ------------------------------------------*/
-    /**
-     * Return workflow execution object fully populated with data currently avaialble for that experiment
-     * 
-     * @param experimentId
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response getExperiment(String experimentId) throws RegistryException;
-
-    /**
-     * Return experiment ids of experiments launched by the given user
-     * 
-     * @param user
-     *            - a regex user id
-     * @return - experiment id list
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response getExperimentIdByUser(String user) throws RegistryException;
-
-    /**
-     * Return experiments launched by the given user
-     * 
-     * @param user
-     * @return experiment object list each populated by current data of that experiment
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response getExperimentByUser(String user) throws RegistryException;
-
-    /**
-     * Return the pageNo set of experiments launched by the given user if grouped in to pages of size pageSize
-     * 
-     * @param user
-     * @param pageSize
-     * @param pageNo
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response getExperimentByUser(String user, int pageSize, int pageNo) throws RegistryException;
-
-    /**
-     * This will update the workflowStatus for given experimentID,workflowInstanceID combination.
-     * 
-     * @param workflowStatusNode
-     * @return
-     * @throws org.apache.airavata.registry.api.exception.RegistryException
-     */
-    public Response updateWorkflowNodeStatus(NodeExecutionStatus workflowStatusNode) throws RegistryException;
-
-    public Response updateWorkflowNodeStatus(String workflowInstanceId, String nodeId, String executionStatus)
-            throws RegistryException;
-
-    public Response updateWorkflowNodeStatus(String workflowInstanceId, String executionStatus)
-            throws RegistryException;
-
-    public Response getWorkflowNodeStatus(String workflowInstanceId, String nodeId) throws RegistryException;
-
-    public Response getWorkflowNodeStartTime(String workflowInstanceId, String nodeId) throws RegistryException;
-
-    public Response getWorkflowStartTime(String workflowInstanceId) throws RegistryException;
-
-    /**
-     * This will store the gram specific data in to repository, this can be called before submitting the workflow in to
-     * Grid
-     * 
-     * @param workflowNodeGramData
-     * @return
-     */
-    public Response updateWorkflowNodeGramData(WorkflowNodeGramData workflowNodeGramData) throws RegistryException;
-
-    public Response getWorkflowInstanceData(String workflowInstanceId) throws RegistryException;
-
-    public Response isWorkflowInstanceNodePresent(String workflowInstanceId, String nodeId) throws RegistryException;
-
-    public Response isWorkflowInstanceNodePresent(String workflowInstanceId, String nodeId, boolean createIfNotPresent)
-            throws RegistryException;
-
-    public Response getWorkflowInstanceNodeData(String workflowInstanceId, String nodeId) throws RegistryException;
-
-    public Response addWorkflowInstance(String experimentId, String workflowInstanceId, String templateName)
-            throws RegistryException;
-
-    public Response updateWorkflowNodeType(String workflowInstanceId, String nodeId, String nodeType)
-            throws RegistryException;
-
-    public Response addWorkflowInstanceNode(String workflowInstance, String nodeId) throws RegistryException;
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/PublishedWorkflowRegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/PublishedWorkflowRegistryService.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/PublishedWorkflowRegistryService.java
deleted file mode 100644
index 8056ca6..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/PublishedWorkflowRegistryService.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.registry.services;
-
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.exception.gateway.PublishedWorkflowAlreadyExistsException;
-import org.apache.airavata.registry.api.exception.gateway.PublishedWorkflowDoesNotExistsException;
-import org.apache.airavata.registry.api.exception.worker.UserWorkflowDoesNotExistsException;
-
-import javax.ws.rs.core.Response;
-
-public interface PublishedWorkflowRegistryService {
-    public Response isPublishedWorkflowExists(String workflowName) throws RegistryException;
-
-    public Response publishWorkflow(String workflowName, String publishWorkflowName)
-            throws PublishedWorkflowAlreadyExistsException, UserWorkflowDoesNotExistsException, RegistryException;
-
-    public Response publishWorkflow(String workflowName) throws PublishedWorkflowAlreadyExistsException,
-            UserWorkflowDoesNotExistsException, RegistryException;
-
-    public Response getPublishedWorkflowGraphXML(String workflowName) throws PublishedWorkflowDoesNotExistsException,
-            RegistryException;
-
-    public Response getPublishedWorkflowNames() throws RegistryException;
-
-    public Response getPublishedWorkflows() throws RegistryException;
-
-    public Response getPublishedWorkflowMetadata(String workflowName) throws RegistryException;
-
-    public Response removePublishedWorkflow(String workflowName) throws PublishedWorkflowDoesNotExistsException,
-            RegistryException;
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/RegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/RegistryService.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/RegistryService.java
deleted file mode 100644
index c2c48d1..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/RegistryService.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.services;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.apache.airavata.persistance.registry.jpa.ResourceType;
-import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
-import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
-import org.apache.airavata.persistance.registry.jpa.resources.Utils;
-import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
-import org.apache.airavata.registry.api.exception.RegistrySettingsException;
-import org.apache.airavata.registry.api.util.RegistrySettings;
-import org.apache.airavata.registry.services.utils.DatabaseCreator;
-import org.apache.airavata.registry.services.utils.JdbcStorage;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.engine.ServiceLifeCycle;
-import org.apache.derby.drda.NetworkServerControl;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class RegistryService implements ServiceLifeCycle {
-    private static final Logger logger = LoggerFactory.getLogger(RegistryService.class);
-
-    public static final String PERSISTANT_DATA = "Configuration";
-    public static final String REGISTRY_DEFAULT_GATEWAY_ID = "default.registry.gateway";
-    public static final String REGISTRY_DEFAULT_USER = "default.registry.user";
-    public static final String REGISTRY_DEFAULT_USER_PASSWORD = "default.registry.password";
-    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
-    public static final String REGISTRY_JDBC_DRIVER = "registry.jdbc.driver";
-    public static final String REGISTRY_JDBC_URL = "registry.jdbc.url";
-    public static final String REGISTRY_JDBC_USER = "registry.jdbc.user";
-    public static final String REGISTRY_JDBC_PASSWORD = "registry.jdbc.password";
-    private JdbcStorage db;
-    private NetworkServerControl server;
-
-    private static volatile boolean serverStarted = false;
-
-    @Override
-    public void startUp(ConfigurationContext configurationContext, AxisService axisService) {
-        //todo have to read these properties from some configuration
-        initializeDB();
-        serverStarted = true;
-    }
-
-    private void startDerbyInServerMode() {
-        try {
-            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
-            server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"),
-                    Utils.getPort(),
-                    Utils.getJDBCUser(), Utils.getJDBCPassword());
-            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
-            server.start(consoleWriter);
-        } catch (IOException e) {
-            logger.error("Unable to start Apache derby in the server mode! Check whether " +
-                    "specified port is available");
-        } catch (Exception e) {
-            logger.error("Unable to start Apache derby in the server mode! Check whether " +
-                    "specified port is available");
-        }
-
-    }
-
-    private void stopDerbyServer() {
-        try {
-            server.shutdown();
-            serverStarted = false;
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    private void initializeDB() {
-    	System.setProperty("registry.initialize.state", "0");
-        String jdbcUrl = null;
-        String jdbcDriver = null;
-        try{
-            jdbcDriver = RegistrySettings.getSetting(REGISTRY_JDBC_DRIVER);
-            jdbcUrl = RegistrySettings.getSetting(REGISTRY_JDBC_URL);
-            String jdbcUser = RegistrySettings.getSetting(REGISTRY_JDBC_USER);
-            String jdbcPassword = RegistrySettings.getSetting(REGISTRY_JDBC_PASSWORD);
-            jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
-        } catch (RegistrySettingsException e) {
-            logger.error("Unable to read properties" , e);
-        }
-
-        if (Utils.getDBType().equals("derby") && Utils.isDerbyStartEnabled()) {
-            startDerbyInServerMode();
-        }
-        db = new JdbcStorage(10, 50, jdbcUrl, jdbcDriver, true);
-
-        Connection conn = null;
-        try {
-            conn = db.connect();
-            if (!DatabaseCreator.isDatabaseStructureCreated(PERSISTANT_DATA, conn)) {
-                DatabaseCreator.createRegistryDatabase(conn);
-                logger.info("New Database created for Registry");
-            } else {
-                logger.info("Database already created for Registry!");
-            }
-            try{
-                GatewayResource gatewayResource = new GatewayResource();
-                gatewayResource.setGatewayName(RegistrySettings.getSetting(REGISTRY_DEFAULT_GATEWAY_ID));
-                gatewayResource.setOwner(RegistrySettings.getSetting(REGISTRY_DEFAULT_GATEWAY_ID));
-                gatewayResource.save();
-                UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER);
-                userResource.setUserName(RegistrySettings.getSetting(REGISTRY_DEFAULT_USER));
-                userResource.setPassword(RegistrySettings.getSetting(REGISTRY_DEFAULT_USER_PASSWORD));
-                userResource.save();
-                WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
-                workerResource.setUser(userResource.getUserName());
-                workerResource.save();
-            } catch (RegistrySettingsException e) {
-                logger.error("Unable to read properties", e);
-            }
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RuntimeException("Database failure");
-        } finally {
-            db.closeConnection(conn);
-            try {
-                if (!conn.getAutoCommit()) {
-                    conn.commit();
-                }
-                conn.close();
-            } catch (SQLException e) {
-                logger.error(e.getMessage(), e);
-                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-            }
-        }
-        System.setProperty("registry.initialize.state", "1");
-    }
-
-    public boolean isRegistryServiceStarted() {
-        return serverStarted;
-    }
-
-    @Override
-    public void shutDown(ConfigurationContext configurationContext, AxisService axisService) {
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/UserWorkflowRegistryService.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/UserWorkflowRegistryService.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/UserWorkflowRegistryService.java
deleted file mode 100644
index 938af72..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/UserWorkflowRegistryService.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.registry.services;
-
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.exception.worker.UserWorkflowAlreadyExistsException;
-import org.apache.airavata.registry.api.exception.worker.UserWorkflowDoesNotExistsException;
-
-import javax.ws.rs.core.Response;
-
-public interface UserWorkflowRegistryService {
-    public Response isWorkflowExists(String workflowName) throws RegistryException;
-
-    public Response addWorkflow(String workflowName, String workflowGraphXml)
-            throws UserWorkflowAlreadyExistsException, RegistryException;
-
-    public Response updateWorkflow(String workflowName, String workflowGraphXml)
-            throws UserWorkflowDoesNotExistsException, RegistryException;
-
-    public Response getWorkflowGraphXML(String workflowName) throws UserWorkflowDoesNotExistsException,
-            RegistryException;
-
-    public Response getWorkflows() throws RegistryException;
-
-    public Response getWorkflowMetadata(String workflowName) throws RegistryException;
-
-    public Response removeWorkflow(String workflowName) throws UserWorkflowDoesNotExistsException, RegistryException;
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/ConnectionPool.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/ConnectionPool.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/ConnectionPool.java
deleted file mode 100644
index b37575b..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/ConnectionPool.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.registry.services.utils;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.sql.DataSource;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Stack;
-import java.util.concurrent.Semaphore;
-
-
-/**
- * A class for preallocating, recycling, and managing JDBC connections.
- */
-public class ConnectionPool {
-    private static final Logger logger = LoggerFactory.getLogger(ConnectionPool.class);
-
-    private long MAX_IDLE_TIME = 5 * 60 * 1000; // 5 minutes
-
-    private String driver;
-    private String url;
-    private String username;
-    private String password;
-    private String jdbcUrl;
-
-    private int maxConnections;
-
-    private boolean autoCommit = true;
-    private boolean waitIfBusy;
-
-    private Semaphore needConnection = new Semaphore(0);
-    private boolean stop;
-
-    private Stack<Connection> availableConnections;
-    private Stack<Connection> busyConnections;
-
-    private HashMap<Connection, Long> lastAccessTimeRecord = new HashMap<Connection, Long>();
-
-    private String urlType = "";
-
-    private DataSource datasource;
-
-    private int transactionIsolation = Connection.TRANSACTION_NONE;
-
-    private Thread clenupThread;
-    private Thread producerThread;
-
-    public ConnectionPool(String driver, String url, String username, String password, int initialConnections,
-            int maxConnections, boolean waitIfBusy) throws SQLException {
-        this.driver = driver;
-        this.url = url;
-        this.username = username;
-        this.password = password;
-        this.urlType = "speratedURL";
-        initialize(initialConnections, maxConnections, waitIfBusy);
-    }
-
-    public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections,
-            boolean waitIfBusy, boolean autoCommit, int transactionIsolation) throws SQLException {
-        this.driver = driver;
-        this.jdbcUrl = jdbcUrl;
-        this.urlType = "simpleURL";
-        this.autoCommit = autoCommit;
-        this.transactionIsolation = transactionIsolation;
-        initialize(initialConnections, maxConnections, waitIfBusy);
-    }
-
-    public ConnectionPool(String driver, String jdbcUrl, int initialConnections, int maxConnections, boolean waitIfBusy)
-            throws SQLException {
-        this.driver = driver;
-        this.jdbcUrl = jdbcUrl;
-        this.urlType = "simpleURL";
-        initialize(initialConnections, maxConnections, waitIfBusy);
-    }
-
-    public ConnectionPool(DataSource dataSource, int initialConnections, int maxConnections, boolean waitIfBusy)
-            throws SQLException {
-        this.urlType = "dataSource";
-        this.datasource = dataSource;
-        initialize(initialConnections, maxConnections, waitIfBusy);
-    }
-
-    /**
-     * Check if this connection pool is auto commit or not
-     *
-     * @return
-     */
-    public boolean isAutoCommit() {
-        return this.autoCommit;
-    }
-
-    private void initialize(int initialConnections, int maxConnections, boolean waitIfBusy) throws SQLException {
-        this.maxConnections = maxConnections;
-        this.waitIfBusy = waitIfBusy;
-
-        int sizeOfConnections = (initialConnections > maxConnections) ? maxConnections : initialConnections;
-
-        availableConnections = new Stack<Connection>();
-        busyConnections = new Stack<Connection>();
-
-        for (int i = 0; i < sizeOfConnections; i++) {
-            Connection con = makeNewConnection();
-            setTimeStamp(con);
-            availableConnections.push(con);
-
-        }
-
-        producerThread = new Thread(new FillUpThread());
-        producerThread.start();
-
-        clenupThread = new Thread(new CleanUpThread());
-        clenupThread.start();
-    }
-
-    public synchronized Connection getConnection() throws SQLException {
-        if (!availableConnections.isEmpty()) {
-            Connection existingConnection = availableConnections.pop();
-
-            // If connection on available list is closed (e.g.,
-            // it timed out), then remove it from available list
-            // and race for a connection again.
-            if (existingConnection.isClosed()) {
-                lastAccessTimeRecord.remove(existingConnection);
-                // notifyAll for fairness
-                notifyAll();
-            } else {
-                busyConnections.push(existingConnection);
-                setTimeStamp(existingConnection);
-                return existingConnection;
-            }
-        } else if (!waitIfBusy && busyConnections.size() >= maxConnections) {
-            // You reached maxConnections limit and waitIfBusy flag is false.
-            // Throw SQLException in such a case.
-            throw new SQLException("Connection limit reached");
-        } else {
-
-            if (busyConnections.size() < maxConnections) {
-                // available connection is empty, but total number of connection
-                // doesn't reach maxConnection. Request for more connection
-                needConnection.release();
-            }
-
-            try {
-                // wait for free connection
-                wait();
-            } catch (InterruptedException ie) {
-            }
-        }
-        // always race for connection forever
-        return getConnection();
-    }
-
-    // This explicitly makes a new connection. Called in
-    // the foreground when initializing the ConnectionPool,
-    // and called in the background when running.
-    private Connection makeNewConnection() throws SQLException {
-        try {
-            // Load database driver if not already loaded
-            Class.forName(driver);
-            Connection connection;
-            // Establish network connection to database
-            if (urlType.equals("speratedURL")) {
-                connection = DriverManager.getConnection(url, username, password);
-            } else if (urlType.equals("simpleURL")) {
-                connection = DriverManager.getConnection(jdbcUrl);
-            } else { // if(urlType.equals("dataSource")){
-                connection = datasource.getConnection();
-            }
-            connection.setTransactionIsolation(this.transactionIsolation);
-            connection.setAutoCommit(this.autoCommit);
-            return connection;
-        } catch (ClassNotFoundException cnfe) {
-            // Simplify try/catch blocks of people using this by
-            // throwing only one exception type.
-            throw new SQLException("Can't find class for driver: " + driver);
-        }
-    }
-
-    private synchronized void fillUpConnection(Connection conn) {
-        setTimeStamp(conn);
-        availableConnections.push(conn);
-
-        // notify all since new connection is created
-        notifyAll();
-    }
-
-    private void setTimeStamp(Connection connection) {
-        lastAccessTimeRecord.put(connection, System.currentTimeMillis());
-    }
-
-    // The database connection cannot be left idle for too long, otherwise TCP
-    // connection will be broken.
-    /**
-     * From http://forums.mysql.com/read.php?39,28450,57460#msg-57460 Okay, then it looks like wait_timeout on the
-     * server is killing your connection (it is set to 8 hours of idle time by default). Either set that value higher on
-     * your server, or configure your connection pool to not hold connections idle that long (I prefer the latter). Most
-     * folks I know that run MySQL with a connection pool in high-load production environments only let connections sit
-     * idle for a matter of minutes, since it only takes a few milliseconds to open a connection, and the longer one
-     * sits idle the more chance it will go "bad" because of a network hiccup or the MySQL server being restarted.
-     *
-     * @throws SQLException
-     */
-    private boolean isConnectionStale(Connection connection) {
-        long currentTime = System.currentTimeMillis();
-        long lastAccess = lastAccessTimeRecord.get(connection);
-        if (currentTime - lastAccess > MAX_IDLE_TIME) {
-            return true;
-        } else
-            return false;
-    }
-
-    private synchronized void closeStaleConnections() {
-        // close idle connections
-        Iterator<Connection> iter = availableConnections.iterator();
-        while (iter.hasNext()) {
-            Connection existingConnection = iter.next();
-            if (isConnectionStale(existingConnection)) {
-                try {
-                    existingConnection.close();
-                    iter.remove();
-                } catch (SQLException sql) {
-                    logger.error(sql.getMessage(), sql);
-                }
-            }
-        }
-        // close busy connections that have been checked out for too long.
-        // This should not happen since this means program has bug for not
-        // releasing connections .
-        iter = busyConnections.iterator();
-        while (iter.hasNext()) {
-            Connection busyConnection = iter.next();
-            if (isConnectionStale(busyConnection)) {
-                try {
-                    busyConnection.close();
-                    iter.remove();
-                    logger.warn("****Connection has checked out too long. Forced release. Check the program for calling release connection [free(Connection) method]");
-                } catch (SQLException sql) {
-                    logger.error(sql.getMessage(), sql);
-                }
-            }
-        }
-    }
-
-    public synchronized void free(Connection connection) {
-        busyConnections.removeElement(connection);
-        availableConnections.addElement(connection);
-        // Wake up threads that are waiting for a connection
-        notifyAll();
-    }
-
-    /**
-     * Close all the connections. Use with caution: be sure no connections are in use before calling. Note that you are
-     * not <I>required</I> to call this when done with a ConnectionPool, since connections are guaranteed to be closed
-     * when garbage collected. But this method gives more control regarding when the connections are closed.
-     */
-    public synchronized void dispose() {
-        logger.info("Connection Pool Shutting down");
-
-        // stop clean up thread
-        this.stop = true;
-        this.clenupThread.interrupt();
-
-        // stop producer up thread
-        this.producerThread.interrupt();
-
-        // close all connection
-        closeConnections(availableConnections);
-        availableConnections = new Stack<Connection>();
-        closeConnections(busyConnections);
-        busyConnections = new Stack<Connection>();
-        lastAccessTimeRecord.clear();
-
-        logger.info("All connection is closed");
-
-        try {
-            this.clenupThread.join();
-            this.producerThread.join();
-        } catch (Exception e) {
-            logger.error("Cannot shutdown cleanup thread", e);
-        }
-
-        logger.info("Connection Pool Shutdown");
-    }
-
-    private void closeConnections(Stack<Connection> connections) {
-        while (!connections.isEmpty()) {
-            Connection connection = connections.pop();
-            try {
-                if (!connection.isClosed()) {
-                    connection.close();
-                }
-            } catch (SQLException sqle) {
-                // Ignore errors; garbage collect anyhow
-                logger.warn(sqle.getMessage());
-            }
-        }
-    }
-
-    public synchronized String toString() {
-        String info = "ConnectionPool(" + url + "," + username + ")" + ", available=" + availableConnections.size()
-                + ", busy=" + busyConnections.size() + ", max=" + maxConnections;
-        return (info);
-    }
-
-    class CleanUpThread implements Runnable {
-        public void run() {
-            while (!stop) {
-                try {
-                    Thread.sleep(MAX_IDLE_TIME);
-                    closeStaleConnections();
-                } catch (InterruptedException e) {
-                    logger.info("Clean up thread is interrupted to close");
-                }
-            }
-        }
-    }
-
-    class FillUpThread implements Runnable {
-        public void run() {
-            while (!stop) {
-                try {
-                    // block until get
-                    needConnection.acquire();
-
-                    Connection conn = makeNewConnection();
-                    fillUpConnection(conn);
-                } catch (SQLException e) {
-                    // cannot create connection (increase semaphore value back)
-                    needConnection.release();
-                    logger.error(e.getMessage(), e);
-                } catch (InterruptedException e) {
-                    logger.info("Fill up thread is interrupted to close");
-                    break;
-                }
-            }
-        }
-    }
-
-    public void shutdown(){
-        for (Connection c : availableConnections) {
-            try {
-                c.close();
-            } catch (SQLException e) {
-
-            }
-        }
-
-        for (Connection c : busyConnections) {
-            try {
-                c.close();
-            } catch (SQLException e) {
-                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-            }
-        }
-    }
-}


[38/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/PublishedWorkflowResourceClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/PublishedWorkflowResourceClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/PublishedWorkflowResourceClient.java
deleted file mode 100644
index b14a4dc..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/PublishedWorkflowResourceClient.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.registry.api.ResourceMetadata;
-import org.apache.airavata.rest.mappings.resourcemappings.PublishWorkflowNamesList;
-import org.apache.airavata.rest.mappings.resourcemappings.Workflow;
-import org.apache.airavata.rest.mappings.resourcemappings.WorkflowList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.utils.BasicAuthHeaderUtil;
-import org.apache.airavata.rest.utils.ClientConstant;
-import org.apache.airavata.rest.utils.CookieManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class PublishedWorkflowResourceClient {
-    private WebResource webResource;
-    private final static Logger logger = LoggerFactory.getLogger(PublishedWorkflowResourceClient.class);
-    private String userName;
-    private PasswordCallback callback;
-    private String baseURI;
-    private Cookie cookie;
-    private WebResource.Builder builder;
-    private String gateway;
-//    private CookieManager cookieManager = new CookieManager();
-
-    public PublishedWorkflowResourceClient(String userName,
-                                           String gateway,
-                                           String serviceURI,
-                                           PasswordCallback callback,
-                                           Cookie cookie) {
-        this.userName = userName;
-        this.callback = callback;
-        this.baseURI = serviceURI;
-        this.gateway = gateway;
-        this.cookie = cookie;
-    }
-
-    private URI getBaseURI() {
-        logger.debug("Creating Base URI");
-        return UriBuilder.fromUri(baseURI).build();
-    }
-
-    private WebResource getPublishedWFRegistryBaseResource() {
-        ClientConfig config = new DefaultClientConfig();
-        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
-                Boolean.TRUE);
-        Client client = Client.create(config);
-        WebResource baseWebResource = client.resource(getBaseURI());
-        webResource = baseWebResource.path(
-                ResourcePathConstants.PublishedWFConstants.REGISTRY_API_PUBLISHWFREGISTRY);
-        return webResource;
-    }
-
-    public boolean isPublishedWorkflowExists(String workflowName) {
-        webResource = getPublishedWFRegistryBaseResource().path(
-                ResourcePathConstants.PublishedWFConstants.PUBLISHWF_EXIST);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowName", workflowName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void publishWorkflow(String workflowName, String publishWorkflowName) {
-        webResource = getPublishedWFRegistryBaseResource().path(
-                ResourcePathConstants.PublishedWFConstants.PUBLISH_WORKFLOW);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowName", workflowName);
-        formParams.add("publishWorkflowName", publishWorkflowName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void publishWorkflow(String workflowName) {
-        webResource = getPublishedWFRegistryBaseResource().path(
-                ResourcePathConstants.PublishedWFConstants.PUBLISH_DEFAULT_WORKFLOW);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowName", workflowName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public String getPublishedWorkflowGraphXML(String workflowName) {
-        webResource = getPublishedWFRegistryBaseResource().path(
-                ResourcePathConstants.PublishedWFConstants.GET_PUBLISHWORKFLOWGRAPH);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowName", workflowName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_FORM_URLENCODED).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_FORM_URLENCODED).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        String wfGraph = response.getEntity(String.class);
-        return wfGraph;
-
-    }
-
-    public List<String> getPublishedWorkflowNames() {
-        webResource = getPublishedWFRegistryBaseResource().path(
-                ResourcePathConstants.PublishedWFConstants.GET_PUBLISHWORKFLOWNAMES);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return new ArrayList<String>();
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return new ArrayList<String>();
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        PublishWorkflowNamesList workflowNamesList =
-                response.getEntity(PublishWorkflowNamesList.class);
-        List<String> publishWorkflowNames = workflowNamesList.getPublishWorkflowNames();
-        return publishWorkflowNames;
-    }
-
-    public Map<String, String> getPublishedWorkflows() {
-        Map<String, String> publishWFmap = new HashMap<String, String>();
-        webResource = getPublishedWFRegistryBaseResource().path(
-                ResourcePathConstants.PublishedWFConstants.GET_PUBLISHWORKFLOWS);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return publishWFmap;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return publishWFmap;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        WorkflowList workflowList = response.getEntity(WorkflowList.class);
-        List<Workflow> workflows = workflowList.getWorkflowList();
-
-        for (Workflow workflow : workflows) {
-            publishWFmap.put(workflow.getWorkflowName(), workflow.getWorkflowGraph());
-        }
-
-        return publishWFmap;
-    }
-
-    public void removePublishedWorkflow(String workflowName) {
-        webResource = getPublishedWFRegistryBaseResource().path(
-                ResourcePathConstants.PublishedWFConstants.REMOVE_PUBLISHWORKFLOW);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowName", workflowName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public ResourceMetadata getPublishedWorkflowMetadata(String workflowName) {
-        //not implemented in Registry API
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
deleted file mode 100644
index 93d7301..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/RegistryClient.java
+++ /dev/null
@@ -1,1111 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import java.net.URI;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.ws.rs.core.NewCookie;
-
-import org.apache.airavata.common.utils.AiravataJobState;
-import org.apache.airavata.common.utils.AiravataJobState.State;
-import org.apache.airavata.common.utils.Version;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.registry.api.AiravataExperiment;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.registry.api.ExecutionErrors.Source;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.registry.api.ResourceMetadata;
-import org.apache.airavata.registry.api.WorkspaceProject;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.exception.UnimplementedRegistryOperationException;
-import org.apache.airavata.registry.api.exception.worker.ExperimentDoesNotExistsException;
-import org.apache.airavata.registry.api.workflow.ApplicationJob;
-import org.apache.airavata.registry.api.workflow.ApplicationJob.ApplicationJobStatus;
-import org.apache.airavata.registry.api.workflow.ApplicationJobExecutionError;
-import org.apache.airavata.registry.api.workflow.ApplicationJobStatusData;
-import org.apache.airavata.registry.api.workflow.ExecutionError;
-import org.apache.airavata.registry.api.workflow.ExperimentData;
-import org.apache.airavata.registry.api.workflow.ExperimentExecutionError;
-import org.apache.airavata.registry.api.workflow.NodeExecutionData;
-import org.apache.airavata.registry.api.workflow.NodeExecutionError;
-import org.apache.airavata.registry.api.workflow.NodeExecutionStatus;
-import org.apache.airavata.registry.api.workflow.WorkflowExecution;
-import org.apache.airavata.registry.api.workflow.WorkflowExecutionData;
-import org.apache.airavata.registry.api.workflow.WorkflowExecutionError;
-import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus;
-import org.apache.airavata.registry.api.workflow.WorkflowIOData;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeGramData;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeIOData;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeType;
-import org.apache.airavata.rest.utils.CookieManager;
-
-public class RegistryClient extends AiravataRegistry2 {
-
-    private PasswordCallback callback;
-    private URI connectionURI;
-    
-    private BasicRegistryResourceClient basicRegistryResourceClient;
-    private ConfigurationResourceClient configurationResourceClient;
-    private DescriptorResourceClient descriptorResourceClient;
-    private ExperimentResourceClient experimentResourceClient;
-    private ProjectResourceClient projectResourceClient;
-    private ProvenanceResourceClient provenanceResourceClient;
-    private PublishedWorkflowResourceClient publishedWorkflowResourceClient;
-    private UserWorkflowResourceClient userWorkflowResourceClient;
-    private CredentialStoreResourceClient credentialStoreResourceClient;
-//    private CookieManager cookieManager = new CookieManager();
-
-
-    public RegistryClient() {
-    }
-
-    public BasicRegistryResourceClient getBasicRegistryResourceClient() {
-        return basicRegistryResourceClient;
-    }
-
-    public ConfigurationResourceClient getConfigurationResourceClient() {
-        return configurationResourceClient;
-    }
-
-    public DescriptorResourceClient getDescriptorResourceClient() {
-        return descriptorResourceClient;
-    }
-
-    public ExperimentResourceClient getExperimentResourceClient() {
-        return experimentResourceClient;
-    }
-
-    public ProjectResourceClient getProjectResourceClient() {
-        return projectResourceClient;
-    }
-
-    public ProvenanceResourceClient getProvenanceResourceClient() {
-        return provenanceResourceClient;
-    }
-
-    public PublishedWorkflowResourceClient getPublishedWorkflowResourceClient() {
-        return publishedWorkflowResourceClient;
-    }
-
-    public UserWorkflowResourceClient getUserWorkflowResourceClient() {
-        return userWorkflowResourceClient;
-    }
-    
-    public CredentialStoreResourceClient getCredentialStoreResourceClient() {
-        return credentialStoreResourceClient;
-    }
-
-
-
-    @Override
-    protected void initialize() {
-        CookieManager.setCookie(new NewCookie("", ""));
-        String userName = getUser().getUserName();
-        callback = getCallback();
-        String serviceURI = getConnectionURI().toString();
-        basicRegistryResourceClient =
-                new BasicRegistryResourceClient(
-                        userName, getGateway().getGatewayName(), serviceURI, callback, CookieManager.getCookie());
-        configurationResourceClient =
-                new ConfigurationResourceClient(
-                        userName, getGateway().getGatewayName(),serviceURI,  callback, CookieManager.getCookie());
-        descriptorResourceClient =
-                new DescriptorResourceClient(
-                        userName, getGateway().getGatewayName(),serviceURI, callback, CookieManager.getCookie());
-        experimentResourceClient =
-                new ExperimentResourceClient(
-                        userName, getGateway().getGatewayName(),serviceURI, callback, CookieManager.getCookie());
-        projectResourceClient =
-                new ProjectResourceClient(
-                        userName, getGateway().getGatewayName(),serviceURI, callback, CookieManager.getCookie());
-        provenanceResourceClient =
-                new ProvenanceResourceClient(
-                        userName, getGateway().getGatewayName(),serviceURI, callback, CookieManager.getCookie());
-        publishedWorkflowResourceClient =
-                new PublishedWorkflowResourceClient(
-                        userName, getGateway().getGatewayName(),serviceURI, callback, CookieManager.getCookie());
-        userWorkflowResourceClient =
-                new UserWorkflowResourceClient(
-                        userName,getGateway().getGatewayName(),serviceURI,callback, CookieManager.getCookie());
-        credentialStoreResourceClient =
-                new CredentialStoreResourceClient(
-                        userName,getGateway().getGatewayName(),serviceURI,callback, CookieManager.getCookie());
-    }
-
-    public Object getConfiguration(String key) {
-       return getConfigurationResourceClient().getConfiguration(key);
-    }
-
-    public List<Object> getConfigurationList(String key) {
-        return getConfigurationResourceClient().getConfigurationList(key);
-    }
-
-    public void setConfiguration(String key, String value, Date expire) {
-        getConfigurationResourceClient().setConfiguration(key, value, expire);
-    }
-
-    public void addConfiguration(String key, String value, Date expire) {
-        getConfigurationResourceClient().addConfiguration(key, value, expire);
-    }
-
-    public void removeAllConfiguration(String key) {
-        getConfigurationResourceClient().removeAllConfiguration(key);
-    }
-
-    public void removeConfiguration(String key, String value) {
-        getConfigurationResourceClient().removeConfiguration(key, value);
-    }
-
-    public List<URI> getGFacURIs() {
-        return getConfigurationResourceClient().getGFacURIs();
-    }
-
-    public List<URI> getWorkflowInterpreterURIs() {
-        return getConfigurationResourceClient().getWorkflowInterpreterURIs();
-    }
-
-
-    public URI getEventingServiceURI() {
-        return getConfigurationResourceClient().getEventingURI();
-    }
-
-
-    public URI getMessageBoxURI() {
-        return getConfigurationResourceClient().getMsgBoxURI();
-    }
-
-
-    public void addGFacURI(URI uri) {
-        getConfigurationResourceClient().addGFacURI(uri);
-    }
-
-
-    public void addWorkflowInterpreterURI(URI uri) {
-        getConfigurationResourceClient().addWFInterpreterURI(uri);
-    }
-
-
-    public void setEventingURI(URI uri) {
-        getConfigurationResourceClient().setEventingURI(uri);
-    }
-
-
-    public void setMessageBoxURI(URI uri) {
-        getConfigurationResourceClient().setMessageBoxURI(uri);
-    }
-
-
-    public void addGFacURI(URI uri, Date expire) {
-        getConfigurationResourceClient().addGFacURIByDate(uri, expire);
-    }
-
-
-    public void addWorkflowInterpreterURI(URI uri, Date expire) {
-        getConfigurationResourceClient().addWorkflowInterpreterURI(uri, expire);
-    }
-
-
-    public void setEventingURI(URI uri, Date expire) {
-        getConfigurationResourceClient().setEventingURIByDate(uri, expire);
-    }
-
-
-    public void setMessageBoxURI(URI uri, Date expire) {
-        getConfigurationResourceClient().setMessageBoxURIByDate(uri, expire);
-    }
-
-
-    public void removeGFacURI(URI uri) {
-        getConfigurationResourceClient().removeGFacURI(uri);
-    }
-
-
-    public void removeAllGFacURI() {
-        getConfigurationResourceClient().removeAllGFacURI();
-    }
-
-
-    public void removeWorkflowInterpreterURI(URI uri) {
-        getConfigurationResourceClient().removeWorkflowInterpreterURI(uri);
-    }
-
-
-    public void removeAllWorkflowInterpreterURI() {
-        getConfigurationResourceClient().removeAllWorkflowInterpreterURI();
-    }
-
-
-    public void unsetEventingURI() {
-        getConfigurationResourceClient().unsetEventingURI();
-    }
-
-
-    public void unsetMessageBoxURI() {
-        getConfigurationResourceClient().unsetMessageBoxURI();
-    }
-
-
-    public boolean isHostDescriptorExists(String descriptorName) throws RegistryException {
-        return getDescriptorResourceClient().isHostDescriptorExists(descriptorName);
-    }
-
-
-    public void addHostDescriptor(HostDescription descriptor) throws RegistryException {
-        getDescriptorResourceClient().addHostDescriptor(descriptor);
-    }
-
-
-    public void updateHostDescriptor(HostDescription descriptor) throws RegistryException {
-        getDescriptorResourceClient().updateHostDescriptor(descriptor);
-    }
-
-
-    public HostDescription getHostDescriptor(String hostName) throws RegistryException {
-        return getDescriptorResourceClient().getHostDescriptor(hostName);
-    }
-
-
-    public void removeHostDescriptor(String hostName) throws RegistryException {
-        getDescriptorResourceClient().removeHostDescriptor(hostName);
-    }
-
-
-    public List<HostDescription> getHostDescriptors() throws RegistryException {
-        return getDescriptorResourceClient().getHostDescriptors();
-    }
-
-
-    public ResourceMetadata getHostDescriptorMetadata(String hostName) throws RegistryException {
-        return null;
-    }
-
-
-    public boolean isServiceDescriptorExists(String descriptorName) throws RegistryException {
-        return getDescriptorResourceClient().isServiceDescriptorExists(descriptorName);
-    }
-
-
-    public void addServiceDescriptor(ServiceDescription descriptor) throws RegistryException {
-       getDescriptorResourceClient().addServiceDescriptor(descriptor);
-    }
-
-
-    public void updateServiceDescriptor(ServiceDescription descriptor) throws RegistryException {
-        getDescriptorResourceClient().updateServiceDescriptor(descriptor);
-    }
-
-
-    public ServiceDescription getServiceDescriptor(String serviceName) throws RegistryException {
-        return getDescriptorResourceClient().getServiceDescriptor(serviceName);
-    }
-
-
-    public void removeServiceDescriptor(String serviceName) throws RegistryException {
-        getDescriptorResourceClient().removeServiceDescriptor(serviceName);
-    }
-
-
-    public List<ServiceDescription> getServiceDescriptors() throws RegistryException {
-        return getDescriptorResourceClient().getServiceDescriptors();
-    }
-
-
-    public ResourceMetadata getServiceDescriptorMetadata(String serviceName) throws RegistryException {
-        return null;
-    }
-
-
-    public boolean isApplicationDescriptorExists(String serviceName,
-                                                 String hostName,
-                                                 String descriptorName) throws RegistryException {
-        return getDescriptorResourceClient().isApplicationDescriptorExists(serviceName, hostName, descriptorName);
-    }
-
-
-    public void addApplicationDescriptor(ServiceDescription serviceDescription,
-                                         HostDescription hostDescriptor,
-                                         ApplicationDescription descriptor) throws RegistryException {
-        getDescriptorResourceClient().addApplicationDescriptor(serviceDescription, hostDescriptor, descriptor);
-    }
-
-
-    public void addApplicationDescriptor(String serviceName,
-                                         String hostName,
-                                         ApplicationDescription descriptor) throws RegistryException {
-        getDescriptorResourceClient().addApplicationDescriptor(serviceName, hostName, descriptor);
-    }
-
-
-    public void udpateApplicationDescriptor(ServiceDescription serviceDescription,
-                                            HostDescription hostDescriptor,
-                                            ApplicationDescription descriptor) throws RegistryException {
-        getDescriptorResourceClient().udpateApplicationDescriptor(serviceDescription, hostDescriptor, descriptor);
-    }
-
-
-    public void updateApplicationDescriptor(String serviceName,
-                                            String hostName,
-                                            ApplicationDescription descriptor) throws RegistryException {
-        getDescriptorResourceClient().updateApplicationDescriptor(serviceName, hostName, descriptor);
-    }
-
-
-    public ApplicationDescription getApplicationDescriptor(String serviceName,
-                                                                     String hostname,
-                                                                     String applicationName) throws RegistryException {
-        return getDescriptorResourceClient().getApplicationDescriptor(serviceName, hostname, applicationName);
-    }
-
-
-    public ApplicationDescription getApplicationDescriptors(String serviceName,
-                                                                      String hostname) throws RegistryException {
-        return getDescriptorResourceClient().getApplicationDescriptors(serviceName, hostname);
-    }
-
-
-    public Map<String, ApplicationDescription> getApplicationDescriptors(String serviceName) throws RegistryException {
-        return getDescriptorResourceClient().getApplicationDescriptors(serviceName);
-    }
-
-
-    public Map<String[], ApplicationDescription> getApplicationDescriptors() throws RegistryException {
-        return getDescriptorResourceClient().getApplicationDescriptors();
-    }
-
-
-    public void removeApplicationDescriptor(String serviceName,
-                                            String hostName,
-                                            String applicationName) throws RegistryException {
-        getDescriptorResourceClient().removeApplicationDescriptor(serviceName, hostName, applicationName);
-    }
-
-
-    public ResourceMetadata getApplicationDescriptorMetadata(String serviceName,
-                                                             String hostName,
-                                                             String applicationName) throws RegistryException {
-        return null;
-    }
-
-
-    public boolean isWorkspaceProjectExists(String projectName) throws RegistryException {
-        return getProjectResourceClient().isWorkspaceProjectExists(projectName);
-    }
-
-
-    public boolean isWorkspaceProjectExists(String projectName,
-                                            boolean createIfNotExists) throws RegistryException {
-        return getProjectResourceClient().isWorkspaceProjectExists(projectName, createIfNotExists);
-    }
-
-
-    public void addWorkspaceProject(WorkspaceProject project) throws RegistryException {
-        getProjectResourceClient().addWorkspaceProject(project);
-    }
-
-
-    public void updateWorkspaceProject(WorkspaceProject project) throws RegistryException {
-        getProjectResourceClient().updateWorkspaceProject(project);
-    }
-
-
-    public void deleteWorkspaceProject(String projectName) throws RegistryException {
-        getProjectResourceClient().deleteWorkspaceProject(projectName);
-    }
-
-
-    public WorkspaceProject getWorkspaceProject(String projectName) throws RegistryException {
-        return getProjectResourceClient().getWorkspaceProject(projectName);
-    }
-
-
-    public List<WorkspaceProject> getWorkspaceProjects() throws RegistryException {
-        return getProjectResourceClient().getWorkspaceProjects();
-    }
-
-
-    public void addExperiment(String projectName,
-                              AiravataExperiment experiment) throws RegistryException {
-        getExperimentResourceClient().addExperiment(projectName, experiment);
-    }
-
-
-    public void removeExperiment(String experimentId) throws ExperimentDoesNotExistsException {
-        getExperimentResourceClient().removeExperiment(experimentId);
-    }
-
-
-    public List<AiravataExperiment> getExperiments() throws RegistryException {
-        return getExperimentResourceClient().getExperiments();
-    }
-
-
-    public List<AiravataExperiment> getExperiments(String projectName) throws RegistryException {
-        return getExperimentResourceClient().getExperiments(projectName);
-    }
-
-
-    public List<AiravataExperiment> getExperiments(Date from, Date to) throws RegistryException {
-        return getExperimentResourceClient().getExperiments(from, to);
-    }
-
-
-    public List<AiravataExperiment> getExperiments(String projectName,
-                                                   Date from,
-                                                   Date to) throws RegistryException {
-        return getExperimentResourceClient().getExperiments(projectName, from, to);
-    }
-
-
-    public boolean isExperimentExists(String experimentId) throws RegistryException {
-        return getExperimentResourceClient().isExperimentExists(experimentId);
-    }
-
-
-    public boolean isExperimentExists(String experimentId,
-                                      boolean createIfNotPresent) throws RegistryException {
-        return getExperimentResourceClient().isExperimentExists(experimentId, createIfNotPresent);
-    }
-
-
-    public void updateExperimentExecutionUser(String experimentId,
-                                              String user) throws RegistryException {
-        getProvenanceResourceClient().updateExperimentExecutionUser(experimentId, user);
-    }
-
-
-    public String getExperimentExecutionUser(String experimentId) throws RegistryException {
-        return getProvenanceResourceClient().getExperimentExecutionUser(experimentId);
-    }
-
-
-    public boolean isExperimentNameExist(String experimentName) throws RegistryException {
-        return getProvenanceResourceClient().isExperimentNameExist(experimentName);
-    }
-
-
-    public String getExperimentName(String experimentId) throws RegistryException {
-        return getProvenanceResourceClient().getExperimentName(experimentId);
-    }
-
-
-    public void updateExperimentName(String experimentId,
-                                     String experimentName) throws RegistryException {
-        getProvenanceResourceClient().updateExperimentName(experimentId, experimentName);
-    }
-
-
-    public String getExperimentMetadata(String experimentId) throws RegistryException {
-        return getProvenanceResourceClient().getExperimentMetadata(experimentId);
-    }
-
-
-    public void updateExperimentMetadata(String experimentId,
-                                         String metadata) throws RegistryException {
-        getProvenanceResourceClient().updateExperimentMetadata(experimentId, metadata);
-    }
-
-
-    public String getWorkflowExecutionTemplateName(String workflowInstanceId) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowExecutionTemplateName(workflowInstanceId);
-    }
-
-
-    public void setWorkflowInstanceTemplateName(String workflowInstanceId,
-                                                String templateName) throws RegistryException {
-        getProvenanceResourceClient().setWorkflowInstanceTemplateName(workflowInstanceId, templateName);
-    }
-
-
-    public List<WorkflowExecution> getExperimentWorkflowInstances(String experimentId) throws RegistryException {
-        return getProvenanceResourceClient().getExperimentWorkflowInstances(experimentId);
-    }
-
-
-    public boolean isWorkflowInstanceExists(String instanceId) throws RegistryException {
-        return getProvenanceResourceClient().isWorkflowInstanceExists(instanceId);
-    }
-
-
-    public boolean isWorkflowInstanceExists(String instanceId,
-                                            boolean createIfNotPresent) throws RegistryException {
-        return getProvenanceResourceClient().isWorkflowInstanceExists(instanceId, createIfNotPresent);
-    }
-
-
-    public void updateWorkflowInstanceStatus(String instanceId,
-                                             WorkflowExecutionStatus.State status) throws RegistryException {
-        getProvenanceResourceClient().updateWorkflowInstanceStatus(instanceId, status);
-    }
-
-
-    public void updateWorkflowInstanceStatus(WorkflowExecutionStatus status) throws RegistryException {
-        getProvenanceResourceClient().updateWorkflowInstanceStatus(status);
-    }
-
-
-    public WorkflowExecutionStatus getWorkflowInstanceStatus(String instanceId) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowInstanceStatus(instanceId);
-    }
-
-
-    public void updateWorkflowNodeInput(WorkflowInstanceNode node, String data) throws RegistryException {
-        getProvenanceResourceClient().updateWorkflowNodeInput(node, data);
-    }
-
-
-    public void updateWorkflowNodeOutput(WorkflowInstanceNode node, String data) throws RegistryException {
-        getProvenanceResourceClient().updateWorkflowNodeOutput(node, data);
-    }
-
-
-    public List<WorkflowNodeIOData> searchWorkflowInstanceNodeInput(String experimentIdRegEx,
-                                                                    String workflowNameRegEx,
-                                                                    String nodeNameRegEx) throws RegistryException {
-        return getProvenanceResourceClient().searchWorkflowInstanceNodeInput(experimentIdRegEx, workflowNameRegEx, nodeNameRegEx);
-    }
-
-
-    public List<WorkflowNodeIOData> searchWorkflowInstanceNodeOutput(String experimentIdRegEx,
-                                                                     String workflowNameRegEx,
-                                                                     String nodeNameRegEx) throws RegistryException {
-        return getProvenanceResourceClient().searchWorkflowInstanceNodeOutput(experimentIdRegEx, workflowNameRegEx, nodeNameRegEx);
-    }
-
-
-    public List<WorkflowNodeIOData> getWorkflowInstanceNodeInput(String workflowInstanceId,
-                                                                 String nodeType) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowInstanceNodeInput(workflowInstanceId, nodeType);
-    }
-
-
-    public List<WorkflowNodeIOData> getWorkflowInstanceNodeOutput(String workflowInstanceId,
-                                                                  String nodeType) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowInstanceNodeOutput(workflowInstanceId, nodeType);
-    }
-
-
-    public void saveWorkflowExecutionOutput(String experimentId, String outputNodeName,
-                                            String output) throws RegistryException {
-        getProvenanceResourceClient().saveWorkflowExecutionOutput(experimentId, outputNodeName, output);
-    }
-
-
-    public void saveWorkflowExecutionOutput(String experimentId,
-                                            WorkflowIOData data) throws RegistryException {
-        getProvenanceResourceClient().saveWorkflowExecutionOutput(experimentId, data);
-    }
-
-
-    public WorkflowIOData getWorkflowExecutionOutput(String experimentId,
-                                                     String outputNodeName) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowExecutionOutput(experimentId, outputNodeName);
-    }
-
-
-    public List<WorkflowIOData> getWorkflowExecutionOutput(String experimentId) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowExecutionOutput(experimentId);
-    }
-
-
-    public String[] getWorkflowExecutionOutputNames(String exeperimentId) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowExecutionOutputNames(exeperimentId);
-    }
-
-
-    public ExperimentData getExperiment(String experimentId) throws RegistryException {
-        return getProvenanceResourceClient().getExperiment(experimentId);
-    }
-
-
-    public ExperimentData getExperimentMetaInformation(String experimentId) throws RegistryException {
-        return getProvenanceResourceClient().getExperimentMetaInformation(experimentId);
-    }
-
-
-    public List<ExperimentData> getAllExperimentMetaInformation(String user) throws RegistryException {
-        return getProvenanceResourceClient().getAllExperimentMetaInformation(user);
-    }
-
-
-    public List<ExperimentData> searchExperiments(String user,
-                                                  String experimentNameRegex) throws RegistryException {
-        return getProvenanceResourceClient().searchExperiments(user, experimentNameRegex);
-    }
-
-
-    public List<String> getExperimentIdByUser(String user) throws RegistryException {
-        return getProvenanceResourceClient().getExperimentIdByUser(user);
-    }
-
-
-    public List<ExperimentData> getExperimentByUser(String user) throws RegistryException {
-        return getProvenanceResourceClient().getExperimentByUser(user);
-    }
-    
-    public List<ExperimentData> getExperiments(HashMap<String,String> params) throws RegistryException {
-        return null;
-    }
-
-
-    public List<ExperimentData> getExperimentByUser(String user, int pageSize, int pageNo) throws RegistryException {
-        return getProvenanceResourceClient().getExperimentByUser(user, pageSize, pageNo);
-    }
-
-
-    public void updateWorkflowNodeStatus(NodeExecutionStatus workflowStatusNode) throws RegistryException {
-        getProvenanceResourceClient().updateWorkflowNodeStatus(workflowStatusNode);
-    }
-
-
-    public void updateWorkflowNodeStatus(String workflowInstanceId, String nodeId,
-                                         WorkflowExecutionStatus.State status) throws RegistryException {
-        getProvenanceResourceClient().updateWorkflowNodeStatus(workflowInstanceId, nodeId, status);
-    }
-
-
-    public void updateWorkflowNodeStatus(WorkflowInstanceNode workflowNode,
-                                         WorkflowExecutionStatus.State status) throws RegistryException {
-        getProvenanceResourceClient().updateWorkflowNodeStatus(workflowNode, status);
-    }
-
-
-    public NodeExecutionStatus getWorkflowNodeStatus(WorkflowInstanceNode workflowNode) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowNodeStatus(workflowNode);
-    }
-
-
-    public Date getWorkflowNodeStartTime(WorkflowInstanceNode workflowNode) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowNodeStartTime(workflowNode);
-    }
-
-
-    public Date getWorkflowStartTime(WorkflowExecution workflowInstance) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowStartTime(workflowInstance);
-    }
-
-
-    public void updateWorkflowNodeGramData(WorkflowNodeGramData workflowNodeGramData) throws RegistryException {
-        getProvenanceResourceClient().updateWorkflowNodeGramData(workflowNodeGramData);
-    }
-
-
-    public WorkflowExecutionData getWorkflowInstanceData(String workflowInstanceId) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowInstanceData(workflowInstanceId);
-    }
-
-
-    public boolean isWorkflowInstanceNodePresent(String workflowInstanceId,
-                                                 String nodeId) throws RegistryException {
-        return getProvenanceResourceClient().isWorkflowInstanceNodePresent(workflowInstanceId, nodeId);
-    }
-
-
-    public boolean isWorkflowInstanceNodePresent(String workflowInstanceId, String nodeId,
-                                                 boolean createIfNotPresent) throws RegistryException {
-        return getProvenanceResourceClient().isWorkflowInstanceNodePresent(workflowInstanceId, nodeId, createIfNotPresent);
-    }
-
-
-    public NodeExecutionData getWorkflowInstanceNodeData(String workflowInstanceId,
-                                                                String nodeId) throws RegistryException {
-        return getProvenanceResourceClient().getWorkflowInstanceNodeData(workflowInstanceId, nodeId);
-    }
-
-
-    public void addWorkflowInstance(String experimentId, String workflowInstanceId,
-                                    String templateName) throws RegistryException {
-        getProvenanceResourceClient().addWorkflowInstance(experimentId, workflowInstanceId, templateName);
-    }
-
-
-    public void updateWorkflowNodeType(WorkflowInstanceNode node,
-                                       WorkflowNodeType type) throws RegistryException {
-        getProvenanceResourceClient().updateWorkflowNodeType(node, type);
-    }
-
-
-    public void addWorkflowInstanceNode(String workflowInstance,
-                                        String nodeId) throws RegistryException {
-        getProvenanceResourceClient().addWorkflowInstanceNode(workflowInstance, nodeId);
-    }
-
-
-    public boolean isPublishedWorkflowExists(String workflowName) throws RegistryException {
-        return getPublishedWorkflowResourceClient().isPublishedWorkflowExists(workflowName);
-    }
-
-
-    public void publishWorkflow(String workflowName,
-                                String publishWorkflowName) throws RegistryException {
-        getPublishedWorkflowResourceClient().publishWorkflow(workflowName, publishWorkflowName);
-    }
-
-
-    public void publishWorkflow(String workflowName) throws RegistryException {
-        getPublishedWorkflowResourceClient().publishWorkflow(workflowName);
-    }
-
-
-    public String getPublishedWorkflowGraphXML(String workflowName) throws RegistryException {
-        return getPublishedWorkflowResourceClient().getPublishedWorkflowGraphXML(workflowName);
-    }
-
-
-    public List<String> getPublishedWorkflowNames() throws RegistryException {
-        return getPublishedWorkflowResourceClient().getPublishedWorkflowNames();
-    }
-
-
-    public Map<String, String> getPublishedWorkflows() throws RegistryException {
-        return getPublishedWorkflowResourceClient().getPublishedWorkflows();
-    }
-
-
-    public ResourceMetadata getPublishedWorkflowMetadata(String workflowName) throws RegistryException {
-        return getPublishedWorkflowResourceClient().getPublishedWorkflowMetadata(workflowName);
-    }
-
-
-    public void removePublishedWorkflow(String workflowName) throws RegistryException {
-        getUserWorkflowResourceClient().removeWorkflow(workflowName);
-    }
-
-
-    public boolean isWorkflowExists(String workflowName) throws RegistryException {
-        return getUserWorkflowResourceClient().isWorkflowExists(workflowName);
-    }
-
-
-    public void addWorkflow(String workflowName, String workflowGraphXml) throws RegistryException {
-        getUserWorkflowResourceClient().addWorkflow(workflowName, workflowGraphXml);
-    }
-
-
-    public void updateWorkflow(String workflowName, String workflowGraphXml) throws RegistryException {
-        getUserWorkflowResourceClient().updateWorkflow(workflowName, workflowGraphXml);
-    }
-
-
-    public String getWorkflowGraphXML(String workflowName) throws RegistryException {
-        return getUserWorkflowResourceClient().getWorkflowGraphXML(workflowName);
-    }
-
-
-    public Map<String, String> getWorkflows() throws RegistryException {
-        return getUserWorkflowResourceClient().getWorkflows();
-    }
-
-
-    public ResourceMetadata getWorkflowMetadata(String workflowName) throws RegistryException {
-        return getUserWorkflowResourceClient().getWorkflowMetadata(workflowName);
-    }
-
-
-    public void removeWorkflow(String workflowName) throws RegistryException {
-        getUserWorkflowResourceClient().removeWorkflow(workflowName);
-    }
-
-
-    public void setAiravataRegistry(AiravataRegistry2 registry) {
-    }
-
-
-    public void setAiravataUser(AiravataUser user) {
-        getBasicRegistryResourceClient().setUser(user);
-    }
-
-
-    public AiravataUser getAiravataUser() {
-        return getBasicRegistryResourceClient().getUser();
-    }
-
-
-    public boolean isActive() {
-        return false;
-    }
-
-
-    public Version getVersion() {
-        return getBasicRegistryResourceClient().getVersion();
-    }
-
-    public void setConnectionURI(URI connectionURI) {
-        this.connectionURI = connectionURI;
-    }
-
-    public URI getConnectionURI() {
-		return connectionURI;
-	}
-
-
-	public void setCallback(PasswordCallback callback) {
-		this.callback=callback;
-	}
-
-
-	public PasswordCallback getCallback() {
-		return callback;
-	}
-
-	@Override
-	public List<ExperimentExecutionError> getExperimentExecutionErrors(
-			String experimentId) throws RegistryException {
-		return provenanceResourceClient.getExperimentExecutionErrors(experimentId);
-	}
-
-	@Override
-	public List<WorkflowExecutionError> getWorkflowExecutionErrors(
-			String experimentId, String workflowInstanceId)
-			throws RegistryException {
-		return provenanceResourceClient.getWorkflowExecutionErrors(experimentId, workflowInstanceId);
-	}
-
-	@Override
-	public List<NodeExecutionError> getNodeExecutionErrors(String experimentId,
-			String workflowInstanceId, String nodeId) throws RegistryException {
-		return getProvenanceResourceClient().getNodeExecutionErrors(experimentId, workflowInstanceId, nodeId);
-	}
-
-	@Override
-	public List<ApplicationJobExecutionError> getApplicationJobErrors(String experimentId,
-			String workflowInstanceId, String nodeId, String gfacJobId)
-			throws RegistryException {
-		return getProvenanceResourceClient().getGFacJobErrors(experimentId, workflowInstanceId, nodeId, gfacJobId);
-	}
-
-	@Override
-	public List<ApplicationJobExecutionError> getApplicationJobErrors(String gfacJobId)
-			throws RegistryException {
-		return getProvenanceResourceClient().getGFacJobErrors(gfacJobId);
-	}
-
-	@Override
-	public List<ExecutionError> getExecutionErrors(String experimentId,
-			String workflowInstanceId, String nodeId, String gfacJobId,
-			Source... filterBy) throws RegistryException {
-		return getProvenanceResourceClient().getExecutionErrors(experimentId, workflowInstanceId, nodeId, gfacJobId, filterBy);
-	}
-
-	@Override
-	public int addExperimentError(ExperimentExecutionError error)
-			throws RegistryException {
-		return getProvenanceResourceClient().addExperimentError(error);
-	}
-
-	@Override
-	public int addWorkflowExecutionError(WorkflowExecutionError error)
-			throws RegistryException {
-		return getProvenanceResourceClient().addWorkflowExecutionError(error);
-	}
-
-	@Override
-	public int addNodeExecutionError(NodeExecutionError error)
-			throws RegistryException {
-		return getProvenanceResourceClient().addNodeExecutionError(error);
-	}
-
-	@Override
-	public int addApplicationJobExecutionError(ApplicationJobExecutionError error)
-			throws RegistryException {
-		return getProvenanceResourceClient().addGFacJobExecutionError(error);
-	}
-
-	@Override
-	public void addApplicationJob(ApplicationJob job) throws RegistryException {
-		getProvenanceResourceClient().addApplicationJob(job);
-		
-	}
-
-	@Override
-	public void updateApplicationJob(ApplicationJob job) throws RegistryException {
-        getProvenanceResourceClient().updateApplicationJob(job);
-		
-	}
-
-	@Override
-	public void updateApplicationJobStatus(String gfacJobId, ApplicationJobStatus status, Date statusUpdateTime)
-			throws RegistryException {
-        getProvenanceResourceClient().updateApplicationJobStatus(gfacJobId, status, statusUpdateTime);
-		
-	}
-
-	@Override
-	public void updateApplicationJobData(String gfacJobId, String jobdata)
-			throws RegistryException {
-        getProvenanceResourceClient().updateApplicationJobData(gfacJobId, jobdata);
-		
-	}
-
-	@Override
-	public void updateApplicationJobSubmittedTime(String gfacJobId, Date submitted)
-			throws RegistryException {
-        getProvenanceResourceClient().updateApplicationJobSubmittedTime(gfacJobId, submitted);
-		
-	}
-
-	@Override
-	public void updateApplicationJobStatusUpdateTime(String gfacJobId, Date completed)
-			throws RegistryException {
-        getProvenanceResourceClient().updateApplicationJobCompletedTime(gfacJobId, completed);
-		
-	}
-
-	@Override
-	public void updateApplicationJobMetadata(String gfacJobId, String metadata)
-			throws RegistryException {
-        getProvenanceResourceClient().updateApplicationJobMetadata(gfacJobId, metadata);
-		
-	}
-
-	@Override
-	public ApplicationJob getApplicationJob(String gfacJobId) throws RegistryException {
-		return getProvenanceResourceClient().getApplicationJob(gfacJobId);
-	}
-
-	@Override
-	public List<ApplicationJob> getApplicationJobsForDescriptors(String serviceDescriptionId,
-			String hostDescriptionId, String applicationDescriptionId)
-			throws RegistryException {
-		return getProvenanceResourceClient().getApplicationJobsForDescriptors(serviceDescriptionId, hostDescriptionId, applicationDescriptionId);
-	}
-
-	@Override
-	public List<ApplicationJob> getApplicationJobs(String experimentId,
-			String workflowExecutionId, String nodeId) throws RegistryException {
-		return getProvenanceResourceClient().getApplicationJobs(experimentId, workflowExecutionId, nodeId);
-	}
-
-	@Override
-	public boolean isApplicationJobExists(String gfacJobId) throws RegistryException {
-		return getProvenanceResourceClient().isApplicationJobExists(gfacJobId);
-	}
-
-	@Override
-	public List<ApplicationJobStatusData> getApplicationJobStatusHistory(
-			String jobId) throws RegistryException {
-		return getProvenanceResourceClient().getApplicationJobStatusHistory(jobId);
-	}
-
-	@Override
-	public List<AiravataUser> getUsers() throws RegistryException {
-        throw new UnimplementedRegistryOperationException();
-	}
-
-	@Override
-	public boolean isCredentialExist(String gatewayId, String tokenId)
-			throws RegistryException {
-		return getCredentialStoreResourceClient().isCredentialExist(gatewayId,tokenId);
-	}
-
-	@Override
-	public String getCredentialPublicKey(String gatewayId, String tokenId)
-			throws RegistryException {
-		return getCredentialStoreResourceClient().getCredentialPublicKey(gatewayId, tokenId);
-	}
-
-	@Override
-	public String createCredential(String gatewayId, String tokenId)
-			throws RegistryException {
-		return getCredentialStoreResourceClient().createCredential(gatewayId, tokenId);
-	}
-	
-	@Override
-	public String createCredential(String gatewayId, String tokenId, String username)
-			throws RegistryException {
-		return getCredentialStoreResourceClient().createCredential(gatewayId, tokenId, username);
-	}
-
-
-    //todo implement these methods properly
-
-
-    public boolean addGFACNode(String uri, int nodeID) throws RegistryException {
-        return false;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    public Map<String, Integer> getGFACNodeList() throws RegistryException {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
-    }
-
-	@Override
-	public boolean changeStatus(String experimentID, State state, String gfacEPR)
-			throws RegistryException {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	@Override
-	public AiravataJobState getState(String experimentID)
-			throws RegistryException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public List<String> getAllJobsWithState(AiravataJobState state)
-			throws RuntimeException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public List<String> getAllAcceptedJobs() throws RegistryException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-
-	@Override
-	public List<String> getAllHangedJobs() throws RegistryException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	@Override
-	public int getHangedJobCount() throws RegistryException {
-		// TODO Auto-generated method stub
-		return 0;
-	}
-
-	@Override
-	public boolean resetHangedJob(String experimentID) throws RegistryException {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-	@Override
-	public boolean changeStatus(String experimentID, State state)
-			throws RegistryException {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-    
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/UserWorkflowResourceClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/UserWorkflowResourceClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/UserWorkflowResourceClient.java
deleted file mode 100644
index 0abab52..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/UserWorkflowResourceClient.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.registry.api.ResourceMetadata;
-import org.apache.airavata.registry.api.exception.gateway.DescriptorAlreadyExistsException;
-import org.apache.airavata.registry.api.exception.worker.UserWorkflowAlreadyExistsException;
-import org.apache.airavata.rest.mappings.resourcemappings.Workflow;
-import org.apache.airavata.rest.mappings.resourcemappings.WorkflowList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.utils.BasicAuthHeaderUtil;
-import org.apache.airavata.rest.utils.ClientConstant;
-import org.apache.airavata.rest.utils.CookieManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class UserWorkflowResourceClient {
-    private WebResource webResource;
-    private final static Logger logger = LoggerFactory.getLogger(UserWorkflowResourceClient.class);
-    private String userName;
-    private PasswordCallback callback;
-    private String baseURI;
-    private Cookie cookie;
-    private WebResource.Builder builder;
-    private String gateway;
-//    private CookieManager cookieManager = new CookieManager();
-
-    public UserWorkflowResourceClient(String userName,
-                                      String gateway,
-                                      String serviceURI,
-                                      PasswordCallback callback,
-                                      Cookie cookie) {
-        this.userName = userName;
-        this.callback = callback;
-        this.baseURI = serviceURI;
-        this.gateway = gateway;
-        this.cookie = cookie;
-    }
-
-
-    private URI getBaseURI() {
-        logger.debug("Creating Base URI");
-        return UriBuilder.fromUri(baseURI).build();
-    }
-
-    private com.sun.jersey.api.client.WebResource getUserWFRegistryBaseResource() {
-        ClientConfig config = new DefaultClientConfig();
-        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
-                Boolean.TRUE);
-        Client client = Client.create(config);
-        WebResource baseWebResource = client.resource(getBaseURI());
-        webResource = baseWebResource.path(
-                ResourcePathConstants.UserWFConstants.REGISTRY_API_USERWFREGISTRY);
-        return webResource;
-    }
-
-    public boolean isWorkflowExists(String workflowName) {
-        webResource = getUserWFRegistryBaseResource().path(
-                ResourcePathConstants.UserWFConstants.WORKFLOW_EXIST);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowName", workflowName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).accept(
-                    MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addWorkflow(String workflowName, String workflowGraphXml) throws UserWorkflowAlreadyExistsException {
-        webResource = getUserWFRegistryBaseResource().path(
-                ResourcePathConstants.UserWFConstants.ADD_WORKFLOW);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowName", workflowName);
-        formParams.add("workflowGraphXml", workflowGraphXml);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.type(
-                MediaType.APPLICATION_FORM_URLENCODED).accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_BAD_REQUEST){
-                logger.debug("Workflow already exists...");
-                throw new UserWorkflowAlreadyExistsException(workflowName);
-            }
-            else if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_BAD_REQUEST){
-            logger.debug("Descriptor already exists...");
-            throw new UserWorkflowAlreadyExistsException(workflowName);
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateWorkflow(String workflowName, String workflowGraphXml) {
-        webResource = getUserWFRegistryBaseResource().path(
-                ResourcePathConstants.UserWFConstants.UPDATE_WORKFLOW);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowName", workflowName);
-        formParams.add("workflowGraphXml", workflowGraphXml);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(MediaType.TEXT_PLAIN).type(
-                MediaType.APPLICATION_FORM_URLENCODED).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).type(
-                    MediaType.APPLICATION_FORM_URLENCODED).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public String getWorkflowGraphXML(String workflowName) {
-        webResource = getUserWFRegistryBaseResource().path(
-                ResourcePathConstants.UserWFConstants.GET_WORKFLOWGRAPH);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowName", workflowName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, callback.getPassword(userName), cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_FORM_URLENCODED).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.APPLICATION_FORM_URLENCODED).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        String worlflowGraph = response.getEntity(String.class);
-        return worlflowGraph;
-    }
-
-    public Map<String, String> getWorkflows() {
-        Map<String, String> userWFMap = new HashMap<String, String>();
-        webResource = getUserWFRegistryBaseResource().path(
-                ResourcePathConstants.UserWFConstants.GET_WORKFLOWS);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return userWFMap;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return userWFMap;
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        WorkflowList workflowList = response.getEntity(WorkflowList.class);
-        List<Workflow> workflows = workflowList.getWorkflowList();
-
-        for (Workflow workflow : workflows) {
-            userWFMap.put(workflow.getWorkflowName(), workflow.getWorkflowGraph());
-        }
-
-        return userWFMap;
-    }
-
-    public void removeWorkflow(String workflowName) {
-        webResource = getUserWFRegistryBaseResource().path(
-                ResourcePathConstants.UserWFConstants.REMOVE_WORKFLOW);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowName", workflowName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public ResourceMetadata getWorkflowMetadata(String workflowName) {
-        //not implemented in the registry API
-        return null;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/BasicAuthHeaderUtil.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/BasicAuthHeaderUtil.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/BasicAuthHeaderUtil.java
deleted file mode 100644
index 7cc721e..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/BasicAuthHeaderUtil.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.utils;
-
-import com.sun.jersey.api.client.WebResource;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.commons.codec.binary.Base64;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MultivaluedMap;
-import java.io.UnsupportedEncodingException;
-
-public class BasicAuthHeaderUtil {
-
-    protected static Logger log = LoggerFactory.getLogger(BasicAuthHeaderUtil.class);
-
-
-    /**
-     * A method to use by clients in the case of Basic Access authentication.
-     * Creates Basic Auth header structure.
-     * Reference - http://en.wikipedia.org/wiki/Basic_access_authentication
-     * @param userName The user name.
-     * @param password Password as credentials.
-     * @return  Base64 encoded authorisation header.
-     */
-    public static String getBasicAuthHeader(String userName, String password) {
-
-        String credentials = userName + ":" + password;
-        String encodedString = null;
-        try {
-            encodedString = new String(Base64.encodeBase64(credentials.getBytes("UTF-8")));
-        } catch (UnsupportedEncodingException e) {
-            // TODO we need to do proper exception handling
-            log.error("Error encoding credentials. ", e);
-            throw new RuntimeException("Error encoding credentials. ", e);
-        }
-        return "Basic " + encodedString;
-    }
-
-    public static WebResource.Builder getBuilder(WebResource webResource,
-                                                 MultivaluedMap queryParams,
-                                                 String userName,
-                                                 String password,
-                                                 Cookie cookie,
-                                                 String gateway) {
-        if (queryParams != null){
-            webResource = webResource.queryParams(queryParams);
-        }
-        WebResource.Builder builder = webResource.header("Authorization",
-                BasicAuthHeaderUtil.getBasicAuthHeader(userName, password));
-        builder.header("gateway_id", gateway);
-        if (cookie != null){
-            builder.cookie(cookie);
-        }
-
-        return builder;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/ClientConstant.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/ClientConstant.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/ClientConstant.java
deleted file mode 100644
index 2017954..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/ClientConstant.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.utils;
-
-public class ClientConstant {
-
-    public static final int HTTP_OK = 200;
-    public static final int HTTP_UNAUTHORIZED = 401;
-    public static final int HTTP_BAD_REQUEST = 400;
-    public static final int HTTP_NO_CONTENT = 204;
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/CookieManager.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/CookieManager.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/CookieManager.java
deleted file mode 100644
index 6ad39c0..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/utils/CookieManager.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.utils;
-
-import javax.ws.rs.core.Cookie;
-
-public class CookieManager {
-    private static Cookie cookie;
-
-    public static Cookie getCookie() {
-        return cookie;
-    }
-
-
-    public static void setCookie(Cookie httpcookie) {
-        cookie = httpcookie;
-    }
-}


[67/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/BrowserAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/BrowserAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/BrowserAction.java
new file mode 100644
index 0000000..cf85809
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/BrowserAction.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.actions.registry.browser;
+
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class BrowserAction extends AbstractBrowserActionItem {
+    public static final String ID = "action.browser";
+
+    @Override
+    public String getID() {
+        return ID;
+    }
+
+    @Override
+    public String getDefaultCaption() {
+        return "Open in web browser...";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/CopyAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/CopyAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/CopyAction.java
new file mode 100644
index 0000000..8f8e024
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/CopyAction.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.actions.registry.browser;
+
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class CopyAction extends AbstractBrowserActionItem {
+    public static final String ID = "action.copy";
+
+    @Override
+    public String getID() {
+        return ID;
+    }
+
+    @Override
+    public String getDefaultCaption() {
+        return "Copy";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/DeleteAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/DeleteAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/DeleteAction.java
new file mode 100644
index 0000000..30b531a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/DeleteAction.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.actions.registry.browser;
+
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class DeleteAction extends AbstractBrowserActionItem {
+    public static final String ID = "action.delete";
+
+    public DeleteAction() {
+        setCaption(getDefaultCaption());
+    }
+
+    @Override
+    public String getID() {
+        return ID;
+    }
+
+    @Override
+    public String getDefaultCaption() {
+        return "Remove";
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/EditAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/EditAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/EditAction.java
new file mode 100644
index 0000000..1f007f4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/EditAction.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.actions.registry.browser;
+
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class EditAction extends AbstractBrowserActionItem {
+    public static final String ID = "action.edit";
+
+    @Override
+    public String getID() {
+        return ID;
+    }
+
+    @Override
+    public String getDefaultCaption() {
+        return "Edit";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ImportAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ImportAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ImportAction.java
new file mode 100644
index 0000000..f2ce0c1
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ImportAction.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.actions.registry.browser;
+
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class ImportAction extends AbstractBrowserActionItem {
+    public static final String ID = "action.import";
+
+    @Override
+    public String getID() {
+        return ID;
+    }
+
+    @Override
+    public String getDefaultCaption() {
+        return "Import";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/RefreshAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/RefreshAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/RefreshAction.java
new file mode 100644
index 0000000..cb95e4e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/RefreshAction.java
@@ -0,0 +1,43 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.actions.registry.browser;
+
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class RefreshAction extends AbstractBrowserActionItem {
+    public static String ID = "action.refresh";
+
+    public RefreshAction() {
+        setCaption(getDefaultCaption());
+    }
+
+    @Override
+    public String getID() {
+        return ID;
+    }
+
+    @Override
+    public String getDefaultCaption() {
+        return "Refresh";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ViewAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ViewAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ViewAction.java
new file mode 100644
index 0000000..c7fa0db
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/ViewAction.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.actions.registry.browser;
+
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class ViewAction extends AbstractBrowserActionItem {
+    public static final String ID = "action.view";
+
+    @Override
+    public String getID() {
+        return ID;
+    }
+
+    @Override
+    public String getDefaultCaption() {
+        return "View";
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/AboutWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/AboutWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/AboutWindow.java
new file mode 100644
index 0000000..75d9bbe
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/AboutWindow.java
@@ -0,0 +1,126 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs;
+
+import java.awt.event.ActionEvent;
+import java.net.URL;
+
+import javax.swing.AbstractAction;
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkEvent.EventType;
+import javax.swing.event.HyperlinkListener;
+
+import org.apache.airavata.common.utils.BrowserLauncher;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.XBayaVersion;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul5.XmlConstants;
+
+public class AboutWindow {
+
+    private static final Logger logger = LoggerFactory.getLogger(AboutWindow.class);
+
+    private XBayaEngine engine;
+
+    private XBayaDialog dialog;
+
+    /**
+     * Creates the AboutWindow.
+     * 
+     * @param engine
+     */
+    public AboutWindow(XBayaEngine engine) {
+        this.engine = engine;
+        init();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        this.dialog.show();
+    }
+
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    @SuppressWarnings("serial")
+	private void init() {
+        JPanel buttonPanel = new JPanel();
+        JButton okButton = new JButton("OK");
+        okButton.setDefaultCapable(true);
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+        buttonPanel.add(okButton);
+        String styles="<style type=\"text/css\">"+
+		        		"body {"+
+			        	"font-family:Arial, Helvetica, sans-serif"+
+			        	"}"+
+        				".centeredImage"+
+        				"{"+
+        				"	text-align:center;"+
+        				"	display:block;"+
+        				"}"+
+        				"</style>";
+        buttonPanel.setBorder(BorderFactory.createEtchedBorder());
+        String imgLogoTag="";//"<img src=\""+SwingUtil.getImageURL("airavata-2.png").toString()+"\" class=\".centeredImage\" /><br>";
+        String imgHeadingTag="<div style=\"width:100%;margin-right:10px;margin-left:10px;margin-top:5px;\" ><img src=\""+SwingUtil.getImageURL("airavata-title-text.png").toString()+"\" class=\".centeredImage\" /></div><br>";
+        String projectNameText = "";//"<h1>" + XBayaConstants.PROJECT_NAME + "</h1>";
+		String message = "<html>"+ styles +"<body align=\"center\">" + "<div style=\"background-color:white;width:100%;margin-bottom:0px;\">"+projectNameText + imgHeadingTag+ imgLogoTag +"</div><br><h2>" +XBayaConstants.APPLICATION_NAME + "</h2>" + "Version: "
+				+ XBayaVersion.VERSION + "<br>" + "<a href='" + XBayaConstants.WEB_URL.toString() + "'>" + XBayaConstants.WEB_URL.toString() + "</a>"
+				+ "<br>&nbsp</body></html>";
+        JEditorPane editorPane = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, message);
+        editorPane.setEditable(false);
+        editorPane.setBorder(BorderFactory.createEtchedBorder());
+        editorPane.setBackground(buttonPanel.getBackground());
+        editorPane.addHyperlinkListener(new HyperlinkListener() {
+            public void hyperlinkUpdate(HyperlinkEvent event) {
+                logger.debug("Event:" + event);
+                if (event.getEventType() == EventType.ACTIVATED) {
+                    URL url = event.getURL();
+                    try {
+                        BrowserLauncher.openURL(url.toString());
+                    } catch (Exception e) {
+                        AboutWindow.this.engine.getGUI().getErrorWindow().error(AboutWindow.this.dialog.getDialog(),
+                                e.getMessage(), e);
+                    }
+                }
+            }
+        });
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), XBayaConstants.PROJECT_NAME, editorPane, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+//        this.dialog.setCancelButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/ErrorWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/ErrorWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/ErrorWindow.java
new file mode 100644
index 0000000..2ffb642
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/ErrorWindow.java
@@ -0,0 +1,279 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ErrorWindow {
+
+    private static final String DEFAULT_ERROR_TITLE = "Error";
+
+    private static final String DEFAULT_WARNING_TITLE = "Warning";
+
+    private static final String DEFAULT_INFORMATION_TITLE = "Information";
+
+    private static final Logger logger = LoggerFactory.getLogger(ErrorWindow.class);
+
+    private Component defaultParent;
+
+    /**
+     * @param parent
+     */
+    public ErrorWindow(Component parent) {
+        this.defaultParent = parent;
+    }
+
+    /**
+     * @param message
+     */
+    public void error(String message) {
+        error(null, null, message, null);
+    }
+
+    /**
+     * @param message
+     * @param e
+     */
+    public void error(String message, Throwable e) {
+        error(null, null, message, e);
+    }
+
+    /**
+     * @param e
+     */
+    public void error(Throwable e) {
+        error(null, null, null, e);
+    }
+
+    /**
+     * @param parent
+     * @param message
+     */
+    public void error(Component parent, String message) {
+        error(parent, null, message, null);
+    }
+
+    /**
+     * @param parent
+     * @param message
+     * @param e
+     */
+    public void error(Component parent, String message, Throwable e) {
+        error(parent, null, message, e);
+    }
+
+    /**
+     * @param parent
+     * @param title
+     * @param message
+     */
+    public void error(Component parent, String title, String message) {
+        error(parent, title, message, null);
+    }
+
+    /**
+     * @param parent
+     * @param title
+     * @param message
+     * @param e
+     */
+    public void error(Component parent, String title, String message, Throwable e) {
+
+        logger.error(e==null? message:e.getMessage(), e);
+
+        // If the parent component is not specified, set the frame the one.
+        if (parent == null) {
+            parent = this.defaultParent;
+        }
+
+        // If the title is still null, set it to the default.
+        if (title == null) {
+            title = DEFAULT_ERROR_TITLE;
+        }
+
+        // If the message is still null, try to get it from the exception first,
+        // and set it to the default if it is still null.
+        if (message == null) {
+            if (e != null) {
+                message = messageSplitter(e.getMessage());
+            }
+        }
+        if (message == null) {
+            message = ErrorMessages.UNEXPECTED_ERROR;
+        }
+
+        showErrorDialog(parent, title, message, e);
+    }
+
+    /**
+     * Shows a warning dialog
+     * 
+     * @param message
+     */
+    public void warning(String message) {
+        warning(null, null, message);
+    }
+
+    /**
+     * Shows a warning dialog.
+     * 
+     * @param parent
+     * @param title
+     * @param message
+     */
+    public void warning(Component parent, String title, String message) {
+        if (parent == null) {
+            parent = this.defaultParent;
+        }
+        if (title == null) {
+            title = DEFAULT_WARNING_TITLE;
+        }
+        showWarningDialog(parent, title, message);
+    }
+
+    /**
+     * Shows a information dialog
+     * 
+     * @param message
+     */
+    public void info(String message) {
+        info(null, null, message);
+    }
+
+    /**
+     * Shows a information dialog.
+     * 
+     * @param parent
+     * @param title
+     * @param message
+     */
+    public void info(Component parent, String title, String message) {
+        if (parent == null) {
+            parent = this.defaultParent;
+        }
+        if (title == null) {
+            title = DEFAULT_INFORMATION_TITLE;
+        }
+        showInformationDialog(parent, title, message);
+    }
+
+    private void showErrorDialog(Component parent, String title, String message, Throwable e) {
+
+        String[] options = new String[] { "OK", "Detail" };
+        int result = JOptionPane.showOptionDialog(parent, message, title, JOptionPane.DEFAULT_OPTION,
+                JOptionPane.ERROR_MESSAGE, null, options, options[0]);
+
+        if (result == 1) {
+            // A user clicked "Detail".
+
+            // Gets the stack trace as a string
+            StringWriter stringWriter = new StringWriter();
+            PrintWriter printWriter = new PrintWriter(stringWriter);
+            if (e != null) {
+                e.printStackTrace(printWriter);
+            }
+            printWriter.close();
+            String stackTrace = stringWriter.toString();
+
+            JLabel messageLabel = new JLabel(messageSplitter(message));
+
+            XBayaTextArea textArea = new XBayaTextArea();
+            textArea.setEditable(false);
+            textArea.setSize(800, 600);
+            textArea.setText(stackTrace);
+
+            GridPanel mainPanel = new GridPanel();
+            mainPanel.add(messageLabel);
+            mainPanel.add(textArea);
+            mainPanel.layout(2, 1, 1, 0);
+
+            JButton okButton = new JButton("OK");
+            okButton.setDefaultCapable(true);
+
+            JPanel buttonPanel = new JPanel();
+            buttonPanel.add(okButton);
+
+            final XBayaDialog dialog = new XBayaDialog(SwingUtilities.getWindowAncestor(parent), title, mainPanel,
+                    buttonPanel);
+
+            okButton.addActionListener(new AbstractAction() {
+                public void actionPerformed(ActionEvent event) {
+                    dialog.hide();
+                }
+            });
+
+            dialog.setDefaultButton(okButton);
+            dialog.show();
+        }
+    }
+
+    private void showWarningDialog(Component parent, String title, String message) {
+        JOptionPane.showMessageDialog(parent, message, title, JOptionPane.WARNING_MESSAGE);
+    }
+
+    private void showInformationDialog(Component parent, String title, String message) {
+
+        JOptionPane.showMessageDialog(parent, message, title, JOptionPane.INFORMATION_MESSAGE);
+    }
+
+    private String messageSplitter(String message){
+        int interval = 150;
+        char[] sAr = message.toCharArray();
+        int i = 0;
+        StringBuffer buffer = new StringBuffer("");
+        if(sAr.length > interval){
+        do{
+            String subString = "";
+            if(i + interval > message.length()){
+             subString = message.substring(i,message.length());
+            }else{
+             subString = message.substring(i, i + interval);
+            }
+            buffer.append(subString);
+            if(!subString.contains("\n")){
+               buffer.append("\n");
+            }
+            i = i + interval;
+        }while(i < sAr.length);
+            return buffer.toString();
+        }else{
+            return message;
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/GlobusFileTransferWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/GlobusFileTransferWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/GlobusFileTransferWindow.java
new file mode 100644
index 0000000..21c4c95
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/GlobusFileTransferWindow.java
@@ -0,0 +1,258 @@
+///*
+//*
+//* Licensed to the Apache Software Foundation (ASF) under one
+//* or more contributor license agreements.  See the NOTICE file
+//* distributed with this work for additional information
+//* regarding copyright ownership.  The ASF licenses this file
+//* to you under the Apache License, Version 2.0 (the
+//* "License"); you may not use this file except in compliance
+//* with the License.  You may obtain a copy of the License at
+//*
+//*   http://www.apache.org/licenses/LICENSE-2.0
+//*
+//* Unless required by applicable law or agreed to in writing,
+//* software distributed under the License is distributed on an
+//* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+//* KIND, either express or implied.  See the License for the
+//* specific language governing permissions and limitations
+//* under the License.
+//*
+//*/
+//
+//package org.apache.airavata.xbaya.ui.dialogs;
+//
+//import org.apache.airavata.xbaya.XBayaEngine;
+//import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+//import org.apache.airavata.xbaya.ui.widgets.XBayaComboBox;
+//import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+//import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+//import org.apache.airavata.xbaya.util.GlobusOnlineUtils;
+//import org.apache.airavata.xbaya.util.TransferFile;
+//import org.globusonline.transfer.APIError;
+//import org.json.JSONException;
+//
+//import javax.swing.*;
+//import java.awt.event.ActionEvent;
+//import java.awt.event.ActionListener;
+//import java.io.IOException;
+//import java.security.GeneralSecurityException;
+//import java.util.ArrayList;
+//import java.util.List;
+//
+//
+//public class GlobusFileTransferWindow {
+//    private XBayaEngine engine;
+//
+//    private XBayaDialog dialog;
+//
+//    private XBayaTextField usernameTextField;
+//
+//    private JPasswordField pwdTextField;
+//
+//    private XBayaComboBox sourceEndpointTextField;
+//
+//    private XBayaTextField sourceFilePathTextField;
+//
+//    private XBayaComboBox destEndpointTextField;
+//
+//    private XBayaTextField destFilePathTextField;
+//
+//    private XBayaTextField transferLabelTextField;
+//
+//    private GlobusOnlineUtils globusOnlineUtils;
+//
+//
+//    private String goUserName;
+//    private String goPWD;
+//
+//    /**
+//     * @param engine XBaya workflow engine
+//     */
+//    public GlobusFileTransferWindow(XBayaEngine engine) {
+//        this.engine = engine;
+//        initGUI();
+//    }
+//
+//    /**
+//     * Displays the dialog.
+//     */
+//    public void show() {
+//        this.dialog.show();
+//    }
+//
+//    private void hide() {
+//        this.dialog.hide();
+//    }
+//
+//    private void ok() {
+//
+//        goUserName = this.usernameTextField.getText();
+//        goPWD  = new String(this.pwdTextField.getPassword());
+//
+//        String sourceEndpoint = this.sourceEndpointTextField.getText();
+//        String sourceFilePath = this.sourceFilePathTextField.getText();
+//        String destEndpoint = this.destEndpointTextField.getText();
+//        String destFilePath = this.destFilePathTextField.getText();
+//        String transferLabel = this.transferLabelTextField.getText();
+//
+//        if(globusOnlineUtils == null){
+//            globusOnlineUtils = new GlobusOnlineUtils(goUserName, goPWD);
+//        }
+//        TransferFile transferFile = globusOnlineUtils.getTransferFile(sourceEndpoint, destEndpoint, sourceFilePath, destFilePath, transferLabel);
+//        globusOnlineUtils.transferFiles(transferFile);
+//    }
+//
+//    private String[] getGOEndpointList(){
+//        if (getGoUserName() != null && getGoPWD() != null){
+//            globusOnlineUtils = new GlobusOnlineUtils(goUserName, goPWD);
+//        }
+//        List<String> epList = new ArrayList<String>();
+//        try {
+//            if (globusOnlineUtils != null){
+//                epList = globusOnlineUtils.getEPList();
+//            }
+//        } catch (IOException e) {
+//            e.printStackTrace();
+//        } catch (APIError apiError) {
+//            apiError.printStackTrace();
+//        } catch (GeneralSecurityException e) {
+//            e.printStackTrace();
+//        } catch (JSONException e) {
+//            e.printStackTrace();
+//        }
+//        return epList.toArray(new String[]{});
+//    }
+//
+//    /**
+//     * Initializes the GUI.
+//     */
+//    private void initGUI() {
+//        this.usernameTextField = new XBayaTextField();
+//        this.pwdTextField = new JPasswordField();
+//        JButton authenticateButton = new JButton("Authenticate");
+//
+//        XBayaLabel nameLabel = new XBayaLabel("GO Username", this.usernameTextField);
+//        XBayaLabel pwdLabel = new XBayaLabel("GO Password", this.pwdTextField);
+//        JLabel authLabel = new JLabel("");
+//
+//        GridPanel infoPanel = new GridPanel();
+//        GridPanel authButtonPanel = new GridPanel();
+//        GridPanel otherPanel = new GridPanel();
+//
+//        authButtonPanel.add(nameLabel.getSwingComponent());
+//        authButtonPanel.add(this.usernameTextField.getSwingComponent());
+//        authButtonPanel.add(pwdLabel.getSwingComponent());
+//        authButtonPanel.add(this.pwdTextField);
+//        authButtonPanel.add(authLabel);
+//        authButtonPanel.add(authenticateButton);
+//
+//        authButtonPanel.layout(3,2,GridPanel.WEIGHT_NONE, 1);
+//
+//        String[] goEndpointList = getGOEndpointList();
+//        DefaultComboBoxModel cmbModelJobType1 = new DefaultComboBoxModel(goEndpointList);
+//        sourceEndpointTextField = new XBayaComboBox(cmbModelJobType1);
+//        sourceEndpointTextField.setEditable(true);
+//
+//        sourceFilePathTextField = new XBayaTextField();
+//        DefaultComboBoxModel cmbModelJobType2 = new DefaultComboBoxModel(goEndpointList);
+//        destEndpointTextField = new XBayaComboBox(cmbModelJobType2);
+//        destEndpointTextField.setEditable(true);
+//        destFilePathTextField = new XBayaTextField();
+//        transferLabelTextField = new XBayaTextField();
+//
+//        XBayaLabel sourceEprLabel = new XBayaLabel("Source Endpoint", sourceEndpointTextField);
+//        XBayaLabel sourceFilePathLabel = new XBayaLabel("Source File Path", sourceFilePathTextField);
+//        XBayaLabel destEprLabel = new XBayaLabel("Destination Endpoint", destEndpointTextField);
+//        XBayaLabel destFilePathLabel = new XBayaLabel("Destination FIle path", destFilePathTextField);
+//        XBayaLabel labelTransferLabel = new XBayaLabel("Label This Transfer", destFilePathTextField);
+//
+//
+//        otherPanel.add(sourceEprLabel.getSwingComponent());
+//        otherPanel.add(sourceEndpointTextField.getSwingComponent());
+//        otherPanel.add(sourceFilePathLabel.getSwingComponent());
+//        otherPanel.add(sourceFilePathTextField.getSwingComponent());
+//        otherPanel.add(destEprLabel.getSwingComponent());
+//        otherPanel.add(destEndpointTextField.getSwingComponent());
+//        otherPanel.add(destFilePathLabel.getSwingComponent());
+//        otherPanel.add(destFilePathTextField.getSwingComponent());
+//        otherPanel.add(labelTransferLabel.getSwingComponent());
+//        otherPanel.add(transferLabelTextField.getSwingComponent());
+//
+//        otherPanel.layout(5, 2, GridPanel.WEIGHT_NONE, 1);
+//        infoPanel.add(authButtonPanel);
+//
+//        infoPanel.add(otherPanel);
+//        JPanel buttonPanel = new JPanel();
+//        infoPanel.add(buttonPanel);
+//
+//        infoPanel.layout(3, 1, GridPanel.WEIGHT_NONE, GridPanel.WEIGHT_NONE);
+//
+//        JButton okButton = new JButton("OK");
+//        okButton.addActionListener(new AbstractAction() {
+//            public void actionPerformed(ActionEvent e) {
+//                ok();
+//            }
+//        });
+//
+//        JButton cancelButton = new JButton("Cancel");
+//        cancelButton.addActionListener(new AbstractAction() {
+//            public void actionPerformed(ActionEvent e) {
+//                hide();
+//            }
+//        });
+//
+//        buttonPanel.add(okButton);
+//        buttonPanel.add(cancelButton);
+//
+//        usernameTextField.getSwingComponent().addActionListener(new ActionListener() {
+//            public void actionPerformed(ActionEvent event) {
+//                setGoUserName(usernameTextField.getText());
+//            }
+//        }
+//        );
+//
+//        pwdTextField.addActionListener(new ActionListener() {
+//            public void actionPerformed(ActionEvent event) {
+//                setGoPWD(new String(pwdTextField.getPassword()));
+//            }
+//        }
+//        );
+//
+//        authenticateButton.addActionListener(new ActionListener() {
+//
+//            @Override
+//            public void actionPerformed(ActionEvent actionEvent) {
+//                goUserName = usernameTextField.getText();
+//                goPWD = new String(pwdTextField.getPassword());
+//
+//                if (goUserName != null && goPWD != null){
+//                    globusOnlineUtils = new GlobusOnlineUtils(usernameTextField.getText(), new String(pwdTextField.getPassword()));
+//                    String[] goEndpointList = getGOEndpointList();
+//                    DefaultComboBoxModel comboBoxModel1 = new DefaultComboBoxModel(goEndpointList);
+//                    DefaultComboBoxModel comboBoxModel2 = new DefaultComboBoxModel(goEndpointList);
+//                    sourceEndpointTextField.setModel(comboBoxModel1);
+//                    destEndpointTextField.setModel(comboBoxModel2);
+//                }
+//            }
+//        });
+//
+//        this.dialog = new XBayaDialog(this.engine.getGUI(), "Globus file transfer", infoPanel, buttonPanel);
+//        this.dialog.setDefaultButton(okButton);
+//    }
+//
+//    public String getGoUserName() {
+//        return goUserName;
+//    }
+//
+//    public void setGoUserName(String goUserName) {
+//        this.goUserName = goUserName;
+//    }
+//
+//    public String getGoPWD() {
+//        return goPWD;
+//    }
+//
+//    public void setGoPWD(String goPWD) {
+//        this.goPWD = goPWD;
+//    }
+//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/TextWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/TextWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/TextWindow.java
new file mode 100644
index 0000000..400346e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/TextWindow.java
@@ -0,0 +1,139 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs;
+
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.ActionEvent;
+import java.net.URL;
+
+import javax.swing.AbstractAction;
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkEvent.EventType;
+import javax.swing.event.HyperlinkListener;
+
+import org.apache.airavata.common.utils.BrowserLauncher;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul5.XmlConstants;
+
+public class TextWindow {
+
+    private static final Logger logger = LoggerFactory.getLogger(TextWindow.class);
+
+    private XBayaEngine engine;
+
+    private XBayaDialog dialog;
+    
+    private String key;
+    private String value;
+    private String title;
+    
+    /**
+     * Creates the AboutWindow.
+     * 
+     * @param engine
+     */
+    public TextWindow(XBayaEngine engine, String key, String value, String title) {
+        this.engine = engine;
+        this.key=key;
+        this.value=value;
+        this.title=title;
+        init();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        this.dialog.show();
+    }
+
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    @SuppressWarnings("serial")
+	private void init() {
+        final JEditorPane editorPane = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, StringUtil.createHTMLUrlTaggedString(value));
+        editorPane.setEditable(false);
+        editorPane.setBackground(Color.WHITE);
+        editorPane.addHyperlinkListener(new HyperlinkListener() {
+            public void hyperlinkUpdate(HyperlinkEvent event) {
+                logger.debug("Event:" + event);
+                if (event.getEventType() == EventType.ACTIVATED) {
+                    URL url = event.getURL();
+                    try {
+                        BrowserLauncher.openURL(url.toString());
+                    } catch (Exception e) {
+                        TextWindow.this.engine.getGUI().getErrorWindow().error(TextWindow.this.dialog.getDialog(),
+                                e.getMessage(), e);
+                    }
+                }
+            }
+        });
+        JScrollPane pane = new JScrollPane(editorPane);
+        GridPanel gridPanel = new GridPanel();
+        XBayaTextField txtKey=new XBayaTextField(key);
+        txtKey.getTextField().setEditable(false);
+        gridPanel.add(txtKey);
+        gridPanel.add(pane);
+        gridPanel.getContentPanel().setBorder(BorderFactory.createEtchedBorder());
+        gridPanel.layout(2, 1, 1, 0);
+        
+        JPanel buttonPanel = new JPanel();
+        JButton okButton = new JButton("Close");
+        okButton.setDefaultCapable(true);
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+        JButton btnCopy = new JButton("Copy to clipboard");
+        btnCopy.addActionListener(new AbstractAction(){
+			@Override
+			public void actionPerformed(ActionEvent arg0) {
+				Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(value), null);
+			}
+        	
+        });
+        buttonPanel.add(btnCopy);
+        buttonPanel.add(okButton);
+        buttonPanel.setBorder(BorderFactory.createEtchedBorder());
+        
+        this.dialog = new XBayaDialog(this.engine.getGUI(), title, gridPanel, buttonPanel);
+        dialog.getDialog().setMinimumSize(new Dimension(400, 400));
+        this.dialog.setDefaultButton(okButton);
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java
new file mode 100644
index 0000000..b92c679
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/WaitDialog.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ComponentAdapter;
+import java.awt.event.ComponentEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.SwingConstants;
+import javax.swing.WindowConstants;
+
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WaitDialog {
+
+    private static final Logger logger = LoggerFactory.getLogger(WaitDialog.class);
+
+    private XBayaGUI xbayaGUI;
+
+    private Cancelable cancelable;
+
+    private String title;
+
+    private String message;
+
+    private XBayaDialog dialog;
+
+    private boolean done;
+
+    /**
+     * Constructs a WaitDialog.
+     * 
+     * @param cancelable
+     * @param title
+     * @param message
+     * @param engine
+     */
+    public WaitDialog(Cancelable cancelable, String title, String message, XBayaGUI xbayaGUI) {
+        this.cancelable = cancelable;
+        this.title = title;
+        this.message = message;
+        this.xbayaGUI = xbayaGUI;
+        this.done = true;
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        synchronized (this) {
+            // We cannot check if this.done is false because show() might be
+            // called more than once at the same time.
+            this.done = false;
+            // We cannot make the whole method synchronized because
+            // this.dialog.show() blocks.
+            if (this.dialog == null) {
+                initGUI();
+            }
+        }
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    public synchronized void hide() {
+        if (this.done) {
+            // The dialog is already hidden.
+            return;
+        }
+        while (this.dialog == null || !this.dialog.getDialog().isVisible()) {
+            try {
+                // Wait for at least one show is called. We have to rely on
+                // ComponentEvent because this.dialog.show() blocks.
+                wait();
+            } catch (InterruptedException e) {
+                logger.error(e.getMessage(), e);
+            }
+        }
+        this.done = true;
+        this.dialog.hide();
+    }
+
+    private void initGUI() {
+        JLabel label = new JLabel(this.message, SwingConstants.CENTER);
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                WaitDialog.this.dialog.hide();
+                WaitDialog.this.cancelable.cancel();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, this.title, label, buttonPanel);
+
+        this.dialog.getDialog().setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+        this.dialog.getDialog().setCursor(SwingUtil.WAIT_CURSOR);
+
+        this.dialog.getDialog().addComponentListener(new ComponentAdapter() {
+            @Override
+            public void componentShown(ComponentEvent e) {
+                shown();
+            }
+        });
+    }
+
+    private synchronized void shown() {
+        notifyAll();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/XBayaDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/XBayaDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/XBayaDialog.java
new file mode 100644
index 0000000..24a0cbb
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/XBayaDialog.java
@@ -0,0 +1,267 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs;
+
+import java.awt.Container;
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.Toolkit;
+import java.awt.Window;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.widgets.XBayaComponent;
+
+public class XBayaDialog {
+
+    private Window owner;
+
+    private String title;
+
+    private String description;
+
+    private JDialog dialog;
+
+    private JComponent mainPanel;
+
+    private JComponent buttonPanel;
+
+    /**
+     * Constructs an XBayaDialog.
+     * 
+     * @param engine
+     * @param title
+     * @param mainPanel
+     * @param buttonPanel
+     */
+    public XBayaDialog(XBayaGUI xbayaGUI, String title, XBayaComponent mainPanel, XBayaComponent buttonPanel) {
+        this(xbayaGUI.getFrame(), title, mainPanel.getSwingComponent(), buttonPanel.getSwingComponent());
+    }
+
+    /**
+     * Constructs an XBayaDialog.
+     * 
+     * @param engine
+     * @param title
+     * @param mainPanel
+     * @param buttonPanel
+     */
+    public XBayaDialog(XBayaGUI xbayaGUI, String title, XBayaComponent mainPanel, JComponent buttonPanel) {
+        this(xbayaGUI.getFrame(), title, mainPanel.getSwingComponent(), buttonPanel);
+    }
+
+    /**
+     * Constructs an XBayaDialog.
+     * 
+     * @param engine
+     * @param title
+     * @param description
+     * @param mainPanel
+     * @param buttonPanel
+     */
+    public XBayaDialog(XBayaGUI xbayaGUI, String title, String description, XBayaComponent mainPanel,
+            JComponent buttonPanel) {
+        this(xbayaGUI.getFrame(), title, description, mainPanel.getSwingComponent(), buttonPanel);
+    }
+
+    /**
+     * Constructs an XBayaDialog.
+     * 
+     * @param engine
+     * @param title
+     * @param mainPanel
+     * @param buttonPanel
+     */
+    public XBayaDialog(XBayaGUI xbayaGUI, String title, JComponent mainPanel, JComponent buttonPanel) {
+        this(xbayaGUI.getFrame(), title, mainPanel, buttonPanel);
+    }
+
+    /**
+     * Constructs an XBayaDialog.
+     * 
+     * @param owner
+     * @param title
+     * @param mainPanel
+     * @param buttonPanel
+     */
+    public XBayaDialog(Window owner, String title, XBayaComponent mainPanel, JComponent buttonPanel) {
+        this(owner, title, mainPanel.getSwingComponent(), buttonPanel);
+    }
+
+    /**
+     * Constructs an XBayaDialog.
+     * 
+     * @param owner
+     * @param title
+     * @param mainPanel
+     * @param buttonPanel
+     */
+    public XBayaDialog(Window owner, String title, JComponent mainPanel, JComponent buttonPanel) {
+        this(owner, title, null, mainPanel, buttonPanel);
+    }
+
+    /**
+     * Constructs an XBayaDialog.
+     * 
+     * @param owner
+     * @param title
+     * @param description
+     * @param mainPanel
+     * @param buttonPanel
+     */
+    public XBayaDialog(Window owner, String title, String description, JComponent mainPanel, JComponent buttonPanel) {
+        this.owner = owner;
+        this.title = title;
+        this.description = description;
+        this.mainPanel = mainPanel;
+        this.buttonPanel = buttonPanel;
+        init();
+    }
+
+    /**
+     * @return The dialog.
+     */
+    public JDialog getDialog() {
+        return this.dialog;
+    }
+
+    /**
+     * Determines whether this component should be visible when its parent is visible. Components are initially visible,
+     * with the exception of top level components such as <code>Frame</code> objects.
+     * 
+     * @return <code>true</code> if the component is visible, <code>false</code> otherwise
+     */
+    public boolean isVisible() {
+        return this.dialog.isVisible();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        this.dialog.pack();
+
+        // Adjust the size if it's bigger than the screen.
+        Dimension size = this.dialog.getSize();
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        final int inset = 100;
+        int width = size.width;
+        if (width > screenSize.width) {
+            width = screenSize.width - inset;
+        }
+        int height = size.height;
+        if (height > screenSize.height) {
+            height = screenSize.height - inset;
+        }
+        this.dialog.setSize(width, height);
+
+        this.dialog.setLocationRelativeTo(this.owner);
+        this.dialog.setVisible(true);
+    }
+
+    /**
+     * Just set dialog visible Do NOTHING to layout
+     */
+    public void simpeShow() {
+        this.dialog.setVisible(true);
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    public void hide() {
+        this.dialog.setVisible(false);
+    }
+
+    /**
+     * @param title
+     */
+    public void setTitle(String title) {
+        this.title = title;
+        this.dialog.setTitle(title);
+    }
+
+    /**
+     * @param button
+     */
+    public void setDefaultButton(JButton button) {
+        this.dialog.getRootPane().setDefaultButton(button);
+    }
+    
+    public void setCancelButton(final JButton button){
+    	this.dialog.getRootPane().addKeyListener(new KeyListener(){
+
+			@Override
+			public void keyPressed(KeyEvent event) {
+				if (event.getKeyCode()==27){
+					button.getAction().actionPerformed(null);
+				}
+			}
+
+			@Override
+			public void keyReleased(KeyEvent arg0) {
+			}
+
+			@Override
+			public void keyTyped(KeyEvent arg0) {
+			}
+    		
+    	});
+    }
+
+    private void init() {
+        if (this.owner instanceof Frame) {
+            this.dialog = new JDialog((Frame) this.owner);
+        } else if (this.owner instanceof Dialog) {
+            this.dialog = new JDialog((Dialog) this.owner);
+        } else {
+            // This should not happen.
+            throw new WorkflowRuntimeException("The owner component was neither Frame or Dialog.");
+        }
+        this.dialog.setTitle(this.title);
+        this.dialog.setModal(true);
+        this.dialog.setResizable(true);
+
+        Container contentPane = this.dialog.getContentPane();
+        int numRow = 0;
+        if (this.description != null && this.description.length() > 0) {
+            JLabel descriptionLabel = new JLabel("<html>" + this.description + "</html>");
+
+            contentPane.add(descriptionLabel);
+            numRow++;
+        }
+        contentPane.add(this.mainPanel);
+        numRow++;
+        contentPane.add(this.buttonPanel);
+        numRow++;
+        SwingUtil.layoutToGrid(contentPane, numRow, 1, numRow - 2, 0);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonEC2InvokerWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonEC2InvokerWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonEC2InvokerWindow.java
new file mode 100644
index 0000000..c9f3051
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonEC2InvokerWindow.java
@@ -0,0 +1,222 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.amazon;
+
+//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceCallbackHandler;
+//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceStub;
+//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceStub.JobStatusResponse;
+//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceStub.JobSubmissionReceipt;
+//import edu.indiana.extreme.amazonec2webservice.AmazonEC2WebserviceStub.JobSubmitOperation;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.axis2.AxisFault;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.rmi.RemoteException;
+
+public class AmazonEC2InvokerWindow {
+    private XBayaEngine engine;
+
+    private XBayaTextField accessKeyIDTextField;
+    private XBayaTextField secretAccessKeyTextField;
+    private XBayaTextField keyPairNameTextField;
+    private XBayaTextField numOfInstancesTextField;
+    private XBayaTextField jobFlowNameTextField;
+    private XBayaTextField logLocationOnS3TextField;
+    private XBayaTextField inputLocationOnS3TextField;
+    private XBayaTextField outputLocationOnS3TextField;
+    private XBayaTextField jarFilePathOnS3TextField;
+    private XBayaTextField mainClassNameTextField;
+    private XBayaDialog dialog;
+
+    /**
+     * Constructs a PegasusInvokerWindow.
+     */
+    public AmazonEC2InvokerWindow(XBayaEngine engine) {
+        this.engine = engine;
+        initGUI();
+    }
+
+    @SuppressWarnings("serial")
+	protected void initGUI() {
+
+        this.accessKeyIDTextField = new XBayaTextField();
+        XBayaLabel accessKeyIDLabel = new XBayaLabel("Access Key", this.accessKeyIDTextField);
+
+        this.secretAccessKeyTextField = new XBayaTextField();
+        XBayaLabel secretAccessKeyLabel = new XBayaLabel("Secret Access Key", this.secretAccessKeyTextField);
+
+        this.keyPairNameTextField = new XBayaTextField();
+        XBayaLabel keyPairNameLabel = new XBayaLabel("Key Pair Name", this.keyPairNameTextField);
+
+        this.numOfInstancesTextField = new XBayaTextField();
+        XBayaLabel numOfInstancesLabel = new XBayaLabel("Number of Instances", this.numOfInstancesTextField);
+
+        this.jobFlowNameTextField = new XBayaTextField();
+        XBayaLabel jobFlowNameLabel = new XBayaLabel("Job Flow Name", this.jobFlowNameTextField);
+
+        this.logLocationOnS3TextField = new XBayaTextField();
+        XBayaLabel logLocationOnS3Label = new XBayaLabel("Log Location(S3)", this.logLocationOnS3TextField);
+
+        this.inputLocationOnS3TextField = new XBayaTextField();
+        XBayaLabel inputLocationOnS3Label = new XBayaLabel("Input Location(S3)", this.inputLocationOnS3TextField);
+
+        this.outputLocationOnS3TextField = new XBayaTextField();
+        XBayaLabel outputLocationOnS3Label = new XBayaLabel("Output Location(S3)", this.outputLocationOnS3TextField);
+
+        this.jarFilePathOnS3TextField = new XBayaTextField();
+        XBayaLabel jarFilePathOnS3Label = new XBayaLabel("Jar File Location(S3)", this.jarFilePathOnS3TextField);
+
+        this.mainClassNameTextField = new XBayaTextField();
+        XBayaLabel mainClassNameLabel = new XBayaLabel("Main Class Name", this.mainClassNameTextField);
+
+        this.accessKeyIDTextField.setText("AKIAI3GNMQVYA5LSQNEQ");
+        this.secretAccessKeyTextField.setText("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");
+        this.keyPairNameTextField.setText("XbayaHadoopTest");
+        this.numOfInstancesTextField.setText("4");
+        this.jobFlowNameTextField.setText("Test-job-flow");
+        this.logLocationOnS3TextField.setText("s3n://xbaya-ec2-test/logs");
+        this.inputLocationOnS3TextField.setText("s3n://xbaya-ec2-test/input/");
+        this.outputLocationOnS3TextField.setText("s3n://xbaya-ec2-test/output/");
+        this.jarFilePathOnS3TextField.setText("s3n://xbaya-ec2-test/jars/Hadoopv400.jar");
+        this.mainClassNameTextField.setText("edu.indiana.extreme.HadoopRayTracer");
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(accessKeyIDLabel);
+        infoPanel.add(this.accessKeyIDTextField);
+        infoPanel.add(secretAccessKeyLabel);
+        infoPanel.add(this.secretAccessKeyTextField);
+        infoPanel.add(keyPairNameLabel);
+        infoPanel.add(this.keyPairNameTextField);
+        infoPanel.add(numOfInstancesLabel);
+        infoPanel.add(this.numOfInstancesTextField);
+        infoPanel.add(jobFlowNameLabel);
+        infoPanel.add(this.jobFlowNameTextField);
+        infoPanel.add(logLocationOnS3Label);
+        infoPanel.add(this.logLocationOnS3TextField);
+        infoPanel.add(inputLocationOnS3Label);
+        infoPanel.add(this.inputLocationOnS3TextField);
+        infoPanel.add(outputLocationOnS3Label);
+        infoPanel.add(this.outputLocationOnS3TextField);
+        infoPanel.add(jarFilePathOnS3Label);
+        infoPanel.add(this.jarFilePathOnS3TextField);
+        infoPanel.add(mainClassNameLabel);
+        infoPanel.add(this.mainClassNameTextField);
+
+        infoPanel.layout(10, 2, GridPanel.WEIGHT_NONE, 1);
+
+        GridPanel mainPanel = new GridPanel();
+        mainPanel.add(infoPanel);
+        mainPanel.layout(1, 1, 0, 0);
+
+        JButton invokeButton = new JButton("Invoke");
+        invokeButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                execute();
+            }
+
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(invokeButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Deploy Workflow", mainPanel, buttonPanel);
+    }
+
+    /**
+     * Deploy Work Flow to Amazon EC2
+     */
+    protected void execute() {
+//        try {
+//            AmazonEC2WebserviceStub stub = new AmazonEC2WebserviceStub();
+//            JobSubmitOperation jobInfo = new JobSubmitOperation();
+//            jobInfo.setAccessKeyID(this.accessKeyIDTextField.getText());
+//            jobInfo.setSecretAccessKey(this.secretAccessKeyTextField.getText());
+//            jobInfo.setKeyPairName(this.keyPairNameTextField.getText());
+//            jobInfo.setNumOfInstances(this.numOfInstancesTextField.getText());
+//            jobInfo.setJobFlowName(this.jobFlowNameTextField.getText());
+//            jobInfo.setLogLocationOnS3(this.logLocationOnS3TextField.getText());
+//            jobInfo.setInputLocationOnS3(this.inputLocationOnS3TextField.getText());
+//            jobInfo.setOutputLocationOnS3(this.outputLocationOnS3TextField.getText());
+//            jobInfo.setJarFilePathOnS3(this.jarFilePathOnS3TextField.getText());
+//            jobInfo.setMainClassName(this.mainClassNameTextField.getText());
+//            stub.startjobSubmitOperation(jobInfo, new MyHandler());
+//            this.hide();
+//        } catch (AxisFault e) {
+//            e.printStackTrace();
+//        } catch (RemoteException e) {
+//            e.printStackTrace();
+//        }
+    }
+
+    /**
+     * hide the dialog (when user clicked on cancel)
+     */
+    public void hide() {
+        this.dialog.hide();
+    }
+
+    /**
+     * show the dialog (when user clicked on invoke)
+     */
+    public void show() {
+        this.dialog.show();
+    }
+
+//    class MyHandler extends AmazonEC2WebserviceCallbackHandler {
+//
+//        @Override
+//        public void receiveResultjobSubmitOperation(JobSubmissionReceipt result) {
+//            JOptionPane.showMessageDialog(null, "Job Submitted, ID: " + result.getJobFlowID(), "",
+//                    JOptionPane.INFORMATION_MESSAGE);
+//        }
+//
+//        @Override
+//        public void receiveErrorjobSubmitOperation(java.lang.Exception e) {
+//            JOptionPane.showMessageDialog(null, "Job Submit Failed!", "", JOptionPane.ERROR_MESSAGE);
+//        }
+//
+//        @Override
+//        public void receiveResultjobStatus(JobStatusResponse result) {
+//            System.out.println("In call back, response is: " + result.getStatus());
+//        }
+//
+//        @Override
+//        public void receiveErrorjobStatus(java.lang.Exception e) {
+//            throw new WorkflowRuntimeException(e);
+//        }
+
+//    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java
new file mode 100644
index 0000000..1fd86a4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/AmazonS3UtilsWindow.java
@@ -0,0 +1,312 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.amazon;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.airavata.xbaya.ui.widgets.amazon.S3Tree;
+import org.jets3t.service.S3Service;
+import org.jets3t.service.S3ServiceException;
+import org.jets3t.service.impl.rest.httpclient.RestS3Service;
+import org.jets3t.service.security.AWSCredentials;
+
+import javax.swing.*;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+import java.awt.event.ActionEvent;
+import java.io.File;
+
+public class AmazonS3UtilsWindow {
+    private XBayaDialog dialog;
+
+    private static XBayaEngine xBayaEngine;
+
+    private static AmazonS3UtilsWindow window;
+
+    private XBayaTextField fileTextField;
+    private XBayaTextField uploadBucketTextField;
+    private XBayaTextField downloadBucketTextField;
+    private XBayaTextField keyTextField;
+    private XBayaTextField folderTextField;
+
+    private S3Tree s3Tree;
+
+    /**
+     * Constructs a AmazonS3UtilsWindow.
+     *
+     * @param engine XBayaEngine
+     */
+    private AmazonS3UtilsWindow(XBayaEngine engine) {
+        xBayaEngine = engine;
+        initGUI();
+    }
+
+    /**
+     * getErrorWindow
+     *
+     * @param engine XBayaEngine
+     */
+    public static AmazonS3UtilsWindow getInstance(XBayaEngine engine) {
+        if (window == null) {
+            window = new AmazonS3UtilsWindow(engine);
+        } else if (xBayaEngine != engine) {
+            window = new AmazonS3UtilsWindow(engine);
+        }
+        return window;
+    }
+
+    /**
+     * Get S3 Service
+     *
+     * @return S3Service
+     */
+    private S3Service getS3Service() {
+        S3Service s3Service = null;
+        try {
+            s3Service = new RestS3Service(new AWSCredentials(AmazonCredential.getInstance().getAwsAccessKeyId(),
+                    AmazonCredential.getInstance().getAwsSecretAccessKey()));
+        } catch (S3ServiceException s3ex) {
+            xBayaEngine.getGUI().getErrorWindow().error(s3ex);
+        }
+        return s3Service;
+    }
+
+    @SuppressWarnings("serial")
+    protected void initGUI() {
+
+        /* Upload Panel */
+        this.fileTextField = new XBayaTextField();
+        XBayaLabel fileLabel = new XBayaLabel("Upload File Path", this.fileTextField);
+
+        this.uploadBucketTextField = new XBayaTextField();
+        XBayaLabel uploadBucketLabel = new XBayaLabel("Bucket Name", this.uploadBucketTextField);
+
+        GridPanel uploadPanel = new GridPanel();
+        uploadPanel.getSwingComponent().setBorder(BorderFactory.createTitledBorder("Upload"));
+        uploadPanel.add(fileLabel);
+        uploadPanel.add(this.fileTextField);
+        uploadPanel.add(uploadBucketLabel);
+        uploadPanel.add(this.uploadBucketTextField);
+        uploadPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);
+
+        /* Download Panel */
+        if (AmazonCredential.getInstance().getAwsAccessKeyId().equals("AKIAI3GNMQVYA5LSQNEQ")) {
+            // Avoid to use default Aws Access Key
+            JOptionPane.showMessageDialog(AmazonS3UtilsWindow.this.dialog.getDialog(), "Aws Access Key not set!",
+                    "Error", JOptionPane.ERROR_MESSAGE);
+            return;
+        }
+        this.downloadBucketTextField = new XBayaTextField();
+        XBayaLabel downloadBucketLabel = new XBayaLabel("Bucket Name", this.downloadBucketTextField);
+
+        this.keyTextField = new XBayaTextField();
+        XBayaLabel keyLabel = new XBayaLabel("Key Name", this.keyTextField);
+
+        this.folderTextField = new XBayaTextField();
+        XBayaLabel folderLabel = new XBayaLabel("Download Location", this.folderTextField);
+
+        GridPanel downloadPanel = new GridPanel();
+        downloadPanel.getSwingComponent().setBorder(BorderFactory.createTitledBorder("Download"));
+        downloadPanel.add(downloadBucketLabel);
+        downloadPanel.add(this.downloadBucketTextField);
+        downloadPanel.add(keyLabel);
+        downloadPanel.add(this.keyTextField);
+        downloadPanel.add(folderLabel);
+        downloadPanel.add(this.folderTextField);
+        downloadPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
+
+        /* Button Panel */
+        JButton refreshButton = new JButton("Connect/Refresh");
+        refreshButton.addActionListener(new AbstractAction() {
+
+            private ChangeCredentialWindow credentialWindow;
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (AmazonCredential.getInstance().getAwsAccessKeyId().isEmpty()
+                        || AmazonCredential.getInstance().getAwsSecretAccessKey().isEmpty()) {
+                    JOptionPane.showMessageDialog(AmazonS3UtilsWindow.this.dialog.getDialog(),
+                            "Aws Access Key not set!", "Error", JOptionPane.ERROR_MESSAGE);
+
+                    if (this.credentialWindow == null) {
+                        this.credentialWindow = new ChangeCredentialWindow(AmazonS3UtilsWindow.this.dialog.getDialog());
+                    }
+                    try {
+                        this.credentialWindow.show();
+                    } catch (Exception e1) {
+                        xBayaEngine.getGUI().getErrorWindow().error(e1);
+                    }
+
+                    return;
+                }
+                AmazonS3UtilsWindow.this.s3Tree.clean();
+                BucketsLoader bucketsLoader = new BucketsLoader(xBayaEngine.getGUI(), window.dialog.getDialog());
+                bucketsLoader.load(getS3Service(), AmazonS3UtilsWindow.this.s3Tree);
+            }
+        });
+
+        JButton uploadButton = new JButton("Upload");
+        uploadButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if ((window.fileTextField.getText().length() != 0)
+                        && (window.uploadBucketTextField.getText().length() != 0)) {
+                    S3Uploader s3Uploader = new S3Uploader(xBayaEngine, window.dialog.getDialog());
+                    s3Uploader.upload(getS3Service(), AmazonS3UtilsWindow.this.s3Tree,
+                            window.uploadBucketTextField.getText(), window.fileTextField.getText());
+
+                    window.fileTextField.setText("");
+                    window.folderTextField.setText("");
+                } else {
+                    xBayaEngine.getGUI().getErrorWindow().error(window.dialog.getDialog(),
+                            "Please give input to every upload fields");
+                }
+            }
+        });
+
+        JButton downloadButton = new JButton("Download");
+        downloadButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if ((window.downloadBucketTextField.getText().length() != 0)
+                        && (window.keyTextField.getText().length() != 0)
+                        && (window.folderTextField.getText().length() != 0)) {
+                    S3Downloader s3Downloader = new S3Downloader(xBayaEngine, window.dialog.getDialog());
+                    s3Downloader.download(getS3Service(), window.downloadBucketTextField.getText(),
+                            window.keyTextField.getText(), window.folderTextField.getText());
+
+                    window.downloadBucketTextField.setText("");
+                    window.keyTextField.setText("");
+                    window.folderTextField.setText("");
+
+                } else {
+                    xBayaEngine.getGUI().getErrorWindow().error(window.dialog.getDialog(),
+                            "Please give input to every download fields");
+                }
+            }
+        });
+
+        JButton fileButton = new JButton("Choose File & Flolder");
+        fileButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                final JFileChooser fc = new JFileChooser();
+                fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
+                int returnVal = fc.showOpenDialog(AmazonS3UtilsWindow.this.dialog.getDialog());
+
+                if (returnVal == JFileChooser.APPROVE_OPTION) {
+                    String filePath = fc.getSelectedFile().getAbsolutePath();
+                    File file = fc.getSelectedFile();
+                    if (file.isFile()) {
+                        window.fileTextField.setText(filePath);
+                        window.folderTextField.setText("");
+                    } else if (file.isDirectory()) {
+                        window.folderTextField.setText(filePath);
+                        window.fileTextField.setText("");
+                    }
+                }
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(refreshButton);
+        buttonPanel.add(uploadButton);
+        buttonPanel.add(downloadButton);
+        buttonPanel.add(fileButton);
+        buttonPanel.add(cancelButton);
+
+        /* Main Panel */
+        GridPanel mainPanel = new GridPanel(true);
+        this.s3Tree = new S3Tree();
+        mainPanel.add(new JScrollPane(this.s3Tree));
+        mainPanel.add(uploadPanel);
+        mainPanel.add(downloadPanel);
+        mainPanel.layout(3, 1, 0, GridPanel.WEIGHT_EQUALLY);
+
+        this.s3Tree.addTreeSelectionListener(new TreeSelectionListener() {
+            @Override
+            public void valueChanged(TreeSelectionEvent e) {
+                DefaultMutableTreeNode node = AmazonS3UtilsWindow.this.s3Tree.getSelectedNode();
+
+                if (node == null)
+                    return;
+
+                Object nodeInfo = node.getUserObject();
+                String bucketName;
+                String downloadPanelBucketName = "";
+                if (node.isLeaf() && node.getParent() != null) { // Node is probably a key
+                    DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();
+                    bucketName = (String) parentNode.getUserObject();
+                    if (!bucketName.equals("S3 Contents")) { // Node is indeed a key
+                        downloadPanelBucketName = (String) parentNode.getUserObject();
+                        String currentNodeName = (String) node.getUserObject();
+                        int index = currentNodeName.lastIndexOf('/');
+                        index = index >= 0 ? index : 0;
+                        if (index > 0) {
+                            bucketName = bucketName + "/" + currentNodeName.substring(0, index);
+                        }
+                        String keyName = (String) nodeInfo;
+                        window.keyTextField.setText(keyName);
+                    } // Node is a bucket
+                    else {
+                        bucketName = (String) nodeInfo;
+                        window.keyTextField.setText("");
+                    }
+                } else { // Node is a bucket
+                    bucketName = (String) nodeInfo;
+                    window.keyTextField.setText("");
+                }
+
+                window.uploadBucketTextField.setText(bucketName);
+                window.downloadBucketTextField.setText(downloadPanelBucketName);
+            }
+        });
+
+        this.dialog = new XBayaDialog(xBayaEngine.getGUI(), "Amazon S3 Upload/Download Tool", mainPanel, buttonPanel);
+
+    }
+
+    public void hide() {
+        this.dialog.hide();
+    }
+
+    public void show() {
+        this.dialog.show();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java
new file mode 100644
index 0000000..32c373c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/BucketsLoader.java
@@ -0,0 +1,123 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.amazon;
+
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+import org.apache.airavata.xbaya.ui.widgets.amazon.S3Tree;
+import org.apache.airavata.xbaya.ui.widgets.amazon.S3TreeModel;
+import org.jets3t.service.S3Service;
+import org.jets3t.service.S3ServiceException;
+import org.jets3t.service.model.S3Bucket;
+import org.jets3t.service.model.S3Object;
+
+import javax.swing.*;
+import javax.swing.tree.DefaultMutableTreeNode;
+
+public class BucketsLoader implements Cancelable {
+    private XBayaGUI xbayaGUI;
+    private JDialog parent;
+
+    private boolean canceled;
+
+    private WaitDialog loadingDialog;
+
+    /**
+     * Constructs a BucketsLoader.
+     *
+     * @param xbayaGUI XBayaGUI
+     * @param parent JDialog
+     */
+    public BucketsLoader(XBayaGUI xbayaGUI, JDialog parent) {
+        this.xbayaGUI=xbayaGUI;
+        this.parent = parent;
+        this.loadingDialog = new WaitDialog(this, "Loading S3 Buckets.", "Loading S3 Buckets.\n"
+                + "Please wait for a moment.", this.xbayaGUI);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
+     */
+    @Override
+    public void cancel() {
+        this.canceled = true;
+    }
+
+    /**
+     * 
+     * @param s3 S3Service
+     * @param s3Tree S3Tree
+     */
+    public void load(final S3Service s3, final S3Tree s3Tree) {
+
+        new Thread(new Runnable() {
+
+            @Override
+            public void run() {
+                S3Bucket[] bucketArray;
+                try {
+                    bucketArray = s3.listAllBuckets();
+                    for (S3Bucket s3Bucket : bucketArray) {
+                        DefaultMutableTreeNode tempTreeNode = s3Tree.addObject((DefaultMutableTreeNode) null,
+                                s3Bucket.getName());
+
+                        if (BucketsLoader.this.canceled)
+                            return;
+
+                        S3Object[] s3ObjectArray = s3.listObjects(s3Bucket.getName());
+                        for (S3Object s3Object : s3ObjectArray) {
+                            String keyName = s3Object.getName();
+                            if (keyName.contains("$")) {
+                                keyName = keyName.substring(0, keyName.indexOf('_'));
+                            }
+                            s3Tree.addObject(tempTreeNode, keyName);
+                        }
+                    }
+
+                    s3Tree.refresh();
+
+                    if (bucketArray.length == 0) {
+                        JOptionPane.showMessageDialog(BucketsLoader.this.parent, "Connection Failed!", "Error",
+                                JOptionPane.ERROR_MESSAGE);
+                        return;
+                    }
+
+                    JOptionPane.showMessageDialog(BucketsLoader.this.parent, "Connection Successfully!", "Info",
+                            JOptionPane.INFORMATION_MESSAGE);
+
+                    // already connect
+                    S3TreeModel.getInstance().connect();
+
+                } catch (S3ServiceException ex) {
+                    BucketsLoader.this.xbayaGUI.getErrorWindow().error(BucketsLoader.this.parent,
+                            "Cannot List S3 buckets", ex);
+                } finally {
+                    BucketsLoader.this.loadingDialog.hide();
+                }
+            }
+        }).start();
+
+        this.loadingDialog.show();
+    }
+
+}
\ No newline at end of file


[37/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/pom.xml b/modules/rest/mappings/pom.xml
deleted file mode 100644
index fab0a21..0000000
--- a/modules/rest/mappings/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY ~ KIND, either express or implied. See the License for the specific 
-	language governing permissions and limitations under the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	<parent>
-		<groupId>org.apache.airavata</groupId>
-		<artifactId>rest</artifactId>
-		<version>0.12-SNAPSHOT</version>
-		<relativePath>../pom.xml</relativePath>
-	</parent>
-
-	<modelVersion>4.0.0</modelVersion>
-	<artifactId>airavata-rest-mappings</artifactId>
-	<packaging>jar</packaging>
-	<name>airavata-rest-mappings</name>
-	<build>
-		<finalName>airavata-rest-mappings</finalName>
-	</build>
-	<dependencies>
-
-		<!-- Airavata -->
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-gfac-schema-utils</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-registry-api</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-
-		<!-- Logging -->
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-simple</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>jcl-over-slf4j</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-log4j12</artifactId>
-		</dependency>
-        <dependency>
-            <groupId>javax.ws.rs</groupId>
-            <artifactId>jsr311-api</artifactId>
-            <version>1.1.1</version>
-        </dependency>
-
-	</dependencies>
-	<properties>
-		<org.slf4j.version>1.6.1</org.slf4j.version>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<javaagent />
-	</properties>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptor.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptor.java
deleted file mode 100644
index 9509382..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptor.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.HashMap;
-
-@XmlRootElement(name = "application")
-public class ApplicationDescriptor {
-    private String name;
-    private String hostdescName;
-//    private String serviceName;
-    private String executablePath;
-    private String workingDir;
-    private String jobType;
-    private String projectNumber;
-    private String projectDescription;
-    private String queueName;
-    private int maxWallTime;
-    private int cpuCount;
-    private int nodeCount;
-    private int processorsPerNode;
-    private int minMemory;
-    private int maxMemory;
-    private String applicationDescType;
-    private ServiceDescriptor serviceDescriptor;
-    private String inputDir;
-    private String outputDir;
-    private String stdIn;
-    private String stdOut;
-    private String stdError;
-    private String staticWorkigDir;
-    private HashMap<String, String> environmentVariables;
-    private String installedPath;
-    private String jobSubmitterCommand;
-
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public String getHostdescName() {
-        return hostdescName;
-    }
-
-    public void setHostdescName(String hostdescName) {
-        this.hostdescName = hostdescName;
-    }
-
-//    public String getServiceName() {
-//        return serviceName;
-//    }
-//
-//    public void setServiceName(String serviceName) {
-//        this.serviceName = serviceName;
-//    }
-
-    public String getExecutablePath() {
-        return executablePath;
-    }
-
-    public void setExecutablePath(String executablePath) {
-        this.executablePath = executablePath;
-    }
-
-    public String getWorkingDir() {
-        return workingDir;
-    }
-
-    public void setWorkingDir(String workingDir) {
-        this.workingDir = workingDir;
-    }
-
-    public String getJobType() {
-        return jobType;
-    }
-
-    public void setJobType(String jobType) {
-        this.jobType = jobType;
-    }
-
-    public String getProjectNumber() {
-        return projectNumber;
-    }
-
-    public void setProjectNumber(String projectNumber) {
-        this.projectNumber = projectNumber;
-    }
-
-    public String getQueueName() {
-        return queueName;
-    }
-
-    public void setQueueName(String queueName) {
-        this.queueName = queueName;
-    }
-
-    public int getMaxWallTime() {
-        return maxWallTime;
-    }
-
-    public void setMaxWallTime(int maxWallTime) {
-        this.maxWallTime = maxWallTime;
-    }
-
-    public int getCpuCount() {
-        return cpuCount;
-    }
-
-    public void setCpuCount(int cpuCount) {
-        this.cpuCount = cpuCount;
-    }
-
-    public int getNodeCount() {
-        return nodeCount;
-    }
-
-    public void setNodeCount(int nodeCount) {
-        this.nodeCount = nodeCount;
-    }
-
-    public int getProcessorsPerNode() {
-        return processorsPerNode;
-    }
-
-    public void setProcessorsPerNode(int processorsPerNode) {
-        this.processorsPerNode = processorsPerNode;
-    }
-
-    public int getMinMemory() {
-        return minMemory;
-    }
-
-    public void setMinMemory(int minMemory) {
-        this.minMemory = minMemory;
-    }
-
-    public int getMaxMemory() {
-        return maxMemory;
-    }
-
-    public void setMaxMemory(int maxMemory) {
-        this.maxMemory = maxMemory;
-    }
-
-    public String getApplicationDescType() {
-        return applicationDescType;
-    }
-
-    public void setApplicationDescType(String applicationDescType) {
-        this.applicationDescType = applicationDescType;
-    }
-
-    public ServiceDescriptor getServiceDescriptor() {
-        return serviceDescriptor;
-    }
-
-    public void setServiceDescriptor(ServiceDescriptor serviceDescriptor) {
-        this.serviceDescriptor = serviceDescriptor;
-    }
-
-    public String getProjectDescription() {
-        return projectDescription;
-    }
-
-    public void setProjectDescription(String projectDescription) {
-        this.projectDescription = projectDescription;
-    }
-
-    public String getInputDir() {
-        return inputDir;
-    }
-
-    public String getOutputDir() {
-        return outputDir;
-    }
-
-    public String getStdIn() {
-        return stdIn;
-    }
-
-    public String getStdOut() {
-        return stdOut;
-    }
-
-    public String getStdError() {
-        return stdError;
-    }
-
-    public HashMap<String, String> getEnvironmentVariables() {
-        return environmentVariables;
-    }
-
-    public void setInputDir(String inputDir) {
-        this.inputDir = inputDir;
-    }
-
-    public void setOutputDir(String outputDir) {
-        this.outputDir = outputDir;
-    }
-
-    public void setStdIn(String stdIn) {
-        this.stdIn = stdIn;
-    }
-
-    public void setStdOut(String stdOut) {
-        this.stdOut = stdOut;
-    }
-
-    public void setStdError(String stdError) {
-        this.stdError = stdError;
-    }
-
-    public void setEnvironmentVariables(HashMap<String, String> environmentVariables) {
-        this.environmentVariables = environmentVariables;
-    }
-
-    public String getStaticWorkigDir() {
-        return staticWorkigDir;
-    }
-
-    public void setStaticWorkigDir(String staticWorkigDir) {
-        this.staticWorkigDir = staticWorkigDir;
-    }
-
-    public String getInstalledPath() {
-        return installedPath;
-    }
-
-    public String getJobSubmitterCommand() {
-        return jobSubmitterCommand;
-    }
-
-    public void setInstalledPath(String installedPath) {
-        this.installedPath = installedPath;
-    }
-
-    public void setJobSubmitterCommand(String jobSubmitterCommand) {
-        this.jobSubmitterCommand = jobSubmitterCommand;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptorList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptorList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptorList.java
deleted file mode 100644
index 7d2156a..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationDescriptorList.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class ApplicationDescriptorList {
-    private ApplicationDescriptor[] applicationDescriptors = new ApplicationDescriptor[]{};
-
-    public ApplicationDescriptorList() {
-    }
-
-    public ApplicationDescriptor[] getApplicationDescriptors() {
-        return applicationDescriptors;
-    }
-
-    public void setApplicationDescriptors(ApplicationDescriptor[] applicationDescriptors) {
-        this.applicationDescriptors = applicationDescriptors;
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationStatusDataList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationStatusDataList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationStatusDataList.java
deleted file mode 100644
index f5dcc24..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ApplicationStatusDataList.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.workflow.ApplicationJob;
-import org.apache.airavata.registry.api.workflow.ApplicationJobStatusData;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ApplicationStatusDataList {
-    private List<ApplicationJobStatusData> applicationJobStatusDataList = new ArrayList<ApplicationJobStatusData>();
-
-    public List<ApplicationJobStatusData> getApplicationJobStatusDataList() {
-        return applicationJobStatusDataList;
-    }
-
-    public void setApplicationJobStatusDataList(List<ApplicationJobStatusData> applicationJobStatusDataList) {
-        this.applicationJobStatusDataList = applicationJobStatusDataList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ConfigurationList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ConfigurationList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ConfigurationList.java
deleted file mode 100644
index 7e3969f..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ConfigurationList.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class ConfigurationList {
-
-    private Object[] configValList = new Object[]{};
-
-    public Object[] getConfigValList() {
-        return configValList;
-    }
-
-    public void setConfigValList(Object[] configValList) {
-        this.configValList = configValList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/DescriptorNameList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/DescriptorNameList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/DescriptorNameList.java
deleted file mode 100644
index a405b5a..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/DescriptorNameList.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class DescriptorNameList {
-    private List<String> descriptorNames = new ArrayList<String>();
-
-    public DescriptorNameList() {
-    }
-
-    public List<String> getDescriptorNames() {
-        return descriptorNames;
-    }
-
-    public void setDescriptorNames(List<String> descriptorNames) {
-        this.descriptorNames = descriptorNames;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExecutionErrorsList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExecutionErrorsList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExecutionErrorsList.java
deleted file mode 100644
index 4dc4f58..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExecutionErrorsList.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.workflow.ExecutionError;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class ExecutionErrorsList {
-    private List<ExecutionError> executionErrors = new ArrayList<ExecutionError>();
-
-    public List<ExecutionError> getExecutionErrors() {
-        return executionErrors;
-    }
-
-    public void setExecutionErrors(List<ExecutionError> executionErrors) {
-        this.executionErrors = executionErrors;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentDataList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentDataList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentDataList.java
deleted file mode 100644
index 48a3ff2..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentDataList.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.impl.ExperimentDataImpl;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class ExperimentDataList {
-    private List<ExperimentDataImpl> experimentDataList = new ArrayList<ExperimentDataImpl>();
-
-    public ExperimentDataList() {
-    }
-
-    public List<ExperimentDataImpl> getExperimentDataList() {
-        return experimentDataList;
-    }
-
-    public void setExperimentDataList(List<ExperimentDataImpl> experimentDataList) {
-        this.experimentDataList = experimentDataList;
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentErrorsList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentErrorsList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentErrorsList.java
deleted file mode 100644
index 2611758..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentErrorsList.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.workflow.ExperimentExecutionError;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class ExperimentErrorsList {
-    private List<ExperimentExecutionError> experimentExecutionErrorList = new ArrayList<ExperimentExecutionError>();
-
-    public List<ExperimentExecutionError> getExperimentExecutionErrorList() {
-        return experimentExecutionErrorList;
-    }
-
-    public void setExperimentExecutionErrorList(List<ExperimentExecutionError> experimentExecutionErrorList) {
-        this.experimentExecutionErrorList = experimentExecutionErrorList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentIDList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentIDList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentIDList.java
deleted file mode 100644
index da1cfd8..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentIDList.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement(name = "experiments")
-public class ExperimentIDList {
-    List<String> experimentIDList = new ArrayList<String>();
-
-    public ExperimentIDList() {
-    }
-
-    public List<String> getExperimentIDList() {
-        return experimentIDList;
-    }
-
-    public void setExperimentIDList(List<String> experimentIDList) {
-        this.experimentIDList = experimentIDList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentList.java
deleted file mode 100644
index 9386fa4..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ExperimentList.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.AiravataExperiment;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class ExperimentList {
-    private AiravataExperiment[] experiments = new AiravataExperiment[]{};
-
-    public ExperimentList() {
-    }
-
-    public AiravataExperiment[] getExperiments() {
-        return experiments;
-    }
-
-    public void setExperiments(AiravataExperiment[] experiments) {
-        this.experiments = experiments;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/GFacErrorsList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/GFacErrorsList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/GFacErrorsList.java
deleted file mode 100644
index a7c7c8c..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/GFacErrorsList.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.workflow.ApplicationJobExecutionError;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class GFacErrorsList {
-    private List<ApplicationJobExecutionError> gFacJobExecutionErrorList = new ArrayList<ApplicationJobExecutionError>();
-
-    public List<ApplicationJobExecutionError> getgFacJobExecutionErrorList() {
-        return gFacJobExecutionErrorList;
-    }
-
-    public void setgFacJobExecutionErrorList(List<ApplicationJobExecutionError> gFacJobExecutionErrorList) {
-        this.gFacJobExecutionErrorList = gFacJobExecutionErrorList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/GFacJobList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/GFacJobList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/GFacJobList.java
deleted file mode 100644
index 1d073d9..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/GFacJobList.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.workflow.ApplicationJob;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class GFacJobList {
-    List<ApplicationJob> jobList = new ArrayList<ApplicationJob>();
-
-    public List<ApplicationJob> getJobList() {
-        return jobList;
-    }
-
-    public void setJobList(List<ApplicationJob> jobList) {
-        this.jobList = jobList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/HostDescriptionList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/HostDescriptionList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/HostDescriptionList.java
deleted file mode 100644
index dc35508..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/HostDescriptionList.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class HostDescriptionList {
-    private HostDescriptor[] hostDescriptions = new HostDescriptor[]{};
-
-    public HostDescriptor[] getHostDescriptions() {
-        return hostDescriptions;
-    }
-
-    public void setHostDescriptions(HostDescriptor[] hostDescriptions) {
-        this.hostDescriptions = hostDescriptions;
-    }
-
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/HostDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/HostDescriptor.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/HostDescriptor.java
deleted file mode 100644
index b6ef9a3..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/HostDescriptor.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "host")
-@XmlAccessorType(XmlAccessType.FIELD)
-public class HostDescriptor {
-
-    private String hostname;
-    private String hostAddress;
-
-    private List<String> hostType = new ArrayList<String>();
-    private List<String> gridFTPEndPoint = new ArrayList<String>();
-    private List<String> gateKeeperEndPoint = new ArrayList<String>();
-    private List<String> imageID = new ArrayList<String>();
-    private List<String> instanceID = new ArrayList<String>();
-    private boolean hpcResource = false;
-    
-    public String getHostname() {
-        return hostname;
-    }
-
-    public void setHostname(String hostname) {
-        this.hostname = hostname;
-    }
-
-    public String getHostAddress() {
-        return hostAddress;
-    }
-
-    public void setHostAddress(String hostAddress) {
-        this.hostAddress = hostAddress;
-    }
-
-    public List<String> getHostType() {
-        return hostType;
-    }
-
-    public void setHostType(List<String> hostType) {
-        this.hostType = hostType;
-    }
-
-    public List<String> getGridFTPEndPoint() {
-        return gridFTPEndPoint;
-    }
-
-    public void setGridFTPEndPoint(List<String> gridFTPEndPoint) {
-        this.gridFTPEndPoint = gridFTPEndPoint;
-    }
-
-    public List<String> getGateKeeperEndPoint() {
-        return gateKeeperEndPoint;
-    }
-
-    public void setGateKeeperEndPoint(List<String> globusGateKeeperEndPoint) {
-        this.gateKeeperEndPoint = globusGateKeeperEndPoint;
-    }
-
-    public List<String> getImageID() {
-        return imageID;
-    }
-
-    public void setImageID(List<String> imageID) {
-        this.imageID = imageID;
-    }
-
-    public List<String> getInstanceID() {
-        return instanceID;
-    }
-
-    public void setInstanceID(List<String> instanceID) {
-        this.instanceID = instanceID;
-    }
-
-	public boolean isHpcResource() {
-		return hpcResource;
-	}
-
-	public void setHpcResource(boolean hpcResource) {
-		this.hpcResource = hpcResource;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/NodeErrorsList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/NodeErrorsList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/NodeErrorsList.java
deleted file mode 100644
index 25163be..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/NodeErrorsList.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.workflow.NodeExecutionError;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class NodeErrorsList {
-    private List<NodeExecutionError> nodeExecutionErrorList = new ArrayList<NodeExecutionError>();
-
-    public List<NodeExecutionError> getNodeExecutionErrorList() {
-        return nodeExecutionErrorList;
-    }
-
-    public void setNodeExecutionErrorList(List<NodeExecutionError> nodeExecutionErrorList) {
-        this.nodeExecutionErrorList = nodeExecutionErrorList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/PublishWorkflowNamesList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/PublishWorkflowNamesList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/PublishWorkflowNamesList.java
deleted file mode 100644
index dfa55eb..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/PublishWorkflowNamesList.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class PublishWorkflowNamesList {
-    private List<String> publishWorkflowNames = new ArrayList<String>();
-
-    public PublishWorkflowNamesList() {
-    }
-
-    public List<String> getPublishWorkflowNames() {
-        return publishWorkflowNames;
-    }
-
-    public void setPublishWorkflowNames(List<String> publishWorkflowNames) {
-        this.publishWorkflowNames = publishWorkflowNames;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceDescriptionList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceDescriptionList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceDescriptionList.java
deleted file mode 100644
index 4b146d7..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceDescriptionList.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class ServiceDescriptionList {
-    private ServiceDescriptor[] serviceDescriptions = new ServiceDescriptor[]{};
-
-    public ServiceDescriptor[] getServiceDescriptions() {
-        return serviceDescriptions;
-    }
-
-    public void setServiceDescriptions(ServiceDescriptor[] serviceDescriptions) {
-        this.serviceDescriptions = serviceDescriptions;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceDescriptor.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceDescriptor.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceDescriptor.java
deleted file mode 100644
index e145c4e..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceDescriptor.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement(name = "service")
-public class ServiceDescriptor {
-
-    private String serviceName;
-    private String description;
-    private List<ServiceParameters> inputParams = new ArrayList<ServiceParameters>();
-    private List<ServiceParameters> outputParams = new ArrayList<ServiceParameters>();
-
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    public void setServiceName(String serviceName) {
-        this.serviceName = serviceName;
-    }
-
-    public List<ServiceParameters> getInputParams() {
-        return inputParams;
-    }
-
-    public void setInputParams(List<ServiceParameters> inputParams) {
-        this.inputParams = inputParams;
-    }
-
-    public List<ServiceParameters> getOutputParams() {
-        return outputParams;
-    }
-
-    public void setOutputParams(List<ServiceParameters> outputParams) {
-        this.outputParams = outputParams;
-    }
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceParameters.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceParameters.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceParameters.java
deleted file mode 100644
index de8ada7..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/ServiceParameters.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-
-@XmlRootElement
-public class ServiceParameters {
-
-    // whether string or other type
-	String type;
-	String name;
-
-    //whether it is input or output
-	String dataType;
-	String description;
-
-	public String getType() {
-		return type;
-	}
-	public void setType(String type) {
-		this.type = type;
-	}
-	public String getName() {
-		return name;
-	}
-	public void setName(String name) {
-		this.name = name;
-	}
-	public String getDataType() {
-		return dataType;
-	}
-	public void setDataType(String dataType) {
-		this.dataType = dataType;
-	}
-	public String getDescription() {
-		return description;
-	}
-	public void setDescription(String description) {
-		this.description = description;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/URLList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/URLList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/URLList.java
deleted file mode 100644
index 6f416d8..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/URLList.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class URLList {
-    private String[] uris = new String[]{};
-
-    public String[] getUris() {
-        return uris;
-    }
-
-    public void setUris(String[] uris) {
-        this.uris = uris;
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/UserList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/UserList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/UserList.java
deleted file mode 100644
index 5927743..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/UserList.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-import org.apache.airavata.registry.api.AiravataUser;
-
-@XmlRootElement
-public class UserList {
-    private List<AiravataUser> userList = new ArrayList<AiravataUser>();
-
-    public UserList() {
-    }
-
-    public List<AiravataUser> getUserList() {
-        return userList;
-    }
-
-    public void setUserList(List<AiravataUser> userList) {
-        this.userList = userList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/Workflow.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/Workflow.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/Workflow.java
deleted file mode 100644
index 29d38cf..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/Workflow.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class Workflow {
-    private String workflowName;
-    private String workflowGraph;
-
-    public Workflow() {
-    }
-
-    public String getWorkflowName() {
-        return workflowName;
-    }
-
-    public String getWorkflowGraph() {
-        return workflowGraph;
-    }
-
-    public void setWorkflowName(String workflowName) {
-        this.workflowName = workflowName;
-    }
-
-    public void setWorkflowGraph(String workflowGraph) {
-        this.workflowGraph = workflowGraph;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowErrorsList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowErrorsList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowErrorsList.java
deleted file mode 100644
index 2036ecd..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowErrorsList.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.workflow.WorkflowExecutionError;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class WorkflowErrorsList {
-    private List<WorkflowExecutionError> workflowExecutionErrorList = new ArrayList<WorkflowExecutionError>();
-
-    public List<WorkflowExecutionError> getWorkflowExecutionErrorList() {
-        return workflowExecutionErrorList;
-    }
-
-    public void setWorkflowExecutionErrorList(List<WorkflowExecutionError> workflowExecutionErrorList) {
-        this.workflowExecutionErrorList = workflowExecutionErrorList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowInstancesList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowInstancesList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowInstancesList.java
deleted file mode 100644
index 4051d8f..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowInstancesList.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import org.apache.airavata.registry.api.workflow.WorkflowExecution;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class WorkflowInstancesList {
-    WorkflowExecution[] workflowInstances = new WorkflowExecution[]{};
-
-    public WorkflowExecution[] getWorkflowInstances() {
-        return workflowInstances;
-    }
-
-    public void setWorkflowInstances(WorkflowExecution[] workflowInstances) {
-        this.workflowInstances = workflowInstances;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowList.java
deleted file mode 100644
index f0e9001..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowList.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-import javax.xml.bind.annotation.XmlRootElement;
-import java.util.ArrayList;
-import java.util.List;
-
-@XmlRootElement
-public class WorkflowList {
-    private List<Workflow> workflowList = new ArrayList<Workflow>();
-
-    public WorkflowList() {
-    }
-
-    public List<Workflow> getWorkflowList() {
-        return workflowList;
-    }
-
-    public void setWorkflowList(List<Workflow> workflowList) {
-        this.workflowList = workflowList;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowNodeIODataList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowNodeIODataList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowNodeIODataList.java
deleted file mode 100644
index b7df6eb..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkflowNodeIODataList.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-
-
-import org.apache.airavata.registry.api.workflow.WorkflowNodeIOData;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class WorkflowNodeIODataList {
-    WorkflowNodeIOData[] workflowNodeIOData = new WorkflowNodeIOData[]{};
-
-    public WorkflowNodeIOData[] getWorkflowNodeIOData() {
-        return workflowNodeIOData;
-    }
-
-    public void setWorkflowNodeIOData(WorkflowNodeIOData[] workflowNodeIOData) {
-        this.workflowNodeIOData = workflowNodeIOData;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkspaceProjectList.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkspaceProjectList.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkspaceProjectList.java
deleted file mode 100644
index 511ef8a..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/resourcemappings/WorkspaceProjectList.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.rest.mappings.resourcemappings;
-
-
-import org.apache.airavata.registry.api.WorkspaceProject;
-
-import javax.xml.bind.annotation.XmlRootElement;
-
-@XmlRootElement
-public class WorkspaceProjectList {
-    private WorkspaceProject[] workspaceProjects = new WorkspaceProject[]{};
-
-    public WorkspaceProjectList() {
-    }
-
-    public WorkspaceProject[] getWorkspaceProjects() {
-        return workspaceProjects;
-    }
-
-    public void setWorkspaceProjects(WorkspaceProject[] workspaceProjects) {
-        this.workspaceProjects = workspaceProjects;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ApplicationDescriptorTypes.java
----------------------------------------------------------------------
diff --git a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ApplicationDescriptorTypes.java b/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ApplicationDescriptorTypes.java
deleted file mode 100644
index 92b1725..0000000
--- a/modules/rest/mappings/src/main/java/org/apache/airavata/rest/mappings/utils/ApplicationDescriptorTypes.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.mappings.utils;
-
-public class ApplicationDescriptorTypes {
-    public static final String APP_DEP_DESC_TYPE = "Default";
-    public static final String HPC_APP_DEP_DESC_TYPE = "HPC";
-    public static final String HADOOP_APP_DEP_DESC_TYPE = "Hadoop";
-    public static final String EC2_APP_DEP_DESC_TYPE = "Amazon EC2";
-}


[58/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndDoWhileNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndDoWhileNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndDoWhileNodeGUI.java
new file mode 100644
index 0000000..56f0ff0
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndDoWhileNodeGUI.java
@@ -0,0 +1,178 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.system.EndDoWhileNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.EndDoWhileConfigurationDialog;
+import org.apache.airavata.xbaya.ui.graph.PortGUI;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+
+public class EndDoWhileNodeGUI extends ConfigurableNodeGUI {
+
+    private EndDoWhileConfigurationDialog configurationWindow;
+
+    private EndDoWhileNode node;
+
+    private Polygon polygon;
+
+    private GeneralPath generalPath;
+
+    /**
+     * @param node
+     */
+    public EndDoWhileNodeGUI(EndDoWhileNode node) {
+        super(node);
+        this.node = node;
+        this.polygon = new Polygon();
+        generalPath = new GeneralPath();
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     *
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.configurationWindow == null) {
+            this.configurationWindow = new EndDoWhileConfigurationDialog(this.node,
+            		xbayaGUI);
+        }
+        this.configurationWindow.show();
+    }
+
+    /**
+     * @see edu.indiana.extreme.xbaya.graph.gui.NodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+        calculatePositions();
+        setPortPositions();
+    }
+
+    /**
+     * @see edu.indiana.extreme.xbaya.graph.gui.NodeGUI#getBounds()
+     */
+    @Override
+    protected Rectangle getBounds() {
+        return this.polygon.getBounds();
+    }
+
+    @Override
+    protected boolean isIn(Point point) {
+        return this.polygon.contains(point);
+    }
+
+	protected GeneralPath getComponentShape() {
+		return generalPath;
+	}
+
+	protected String getComponentHeaderText() {
+		return node.getName();
+	}
+
+	protected GeneralPath getComponentHeaderShape() {
+		return DrawUtils.getRoundedShape(createHeader(getPosition()));
+	}
+
+	protected Color getComponentHeaderColor() {
+		return headColor;
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+	private Polygon createHeader(Point position) {
+		Polygon head = new Polygon();
+        head.addPoint(position.x, position.y);
+        head.addPoint(position.x, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y
+                + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y
+                + this.headHeight / 2);
+		return head;
+	}
+
+    /**
+     * @see edu.indiana.extreme.xbaya.graph.gui.NodeGUI#setPortPositions()
+     */
+    @Override
+    protected void setPortPositions() {
+        // inputs
+        List<? extends Port> inputPorts = this.node.getInputPorts();
+        for (int i = 0; i < inputPorts.size(); i++) {
+            Port port = inputPorts.get(i);
+            Point offset;
+            if (i < inputPorts.size() / 2) {
+                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight
+                        + PORT_INITIAL_GAP + PORT_GAP * i);
+            } else {
+                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight
+                        + PORT_INITIAL_GAP + PORT_GAP * (i + 1));
+            }
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // outputs
+        List<? extends Port> outputPorts = this.node.getOutputPorts();
+        for (int i = 0; i < outputPorts.size(); i++) {
+            Port port = outputPorts.get(i);
+            Point offset = new Point(this.getBounds().width
+                    - PortGUI.DATA_PORT_SIZE / 2, (int) (this.headHeight
+                    + PORT_INITIAL_GAP + PORT_GAP
+                    * (outputPorts.size() / 2.0 + i)));
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+
+
+    }
+
+    private void calculatePositions() {
+        this.polygon.reset();
+        Point position = getPosition();
+        this.polygon.addPoint(position.x, position.y);
+        this.polygon.addPoint(position.x, position.y + this.dimension.height
+                + this.headHeight / 2);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y
+                + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y
+                + this.headHeight / 2);
+        DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndForEachNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndForEachNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndForEachNodeGUI.java
new file mode 100644
index 0000000..a76c430
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndForEachNodeGUI.java
@@ -0,0 +1,148 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.EndForEachConfigurationDialog;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class EndForEachNodeGUI extends ConfigurableNodeGUI {
+
+    private EndForEachNode node;
+
+    private Polygon polygon;
+
+    private EndForEachConfigurationDialog configurationWindow;
+    private GeneralPath generalPath;
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.configurationWindow == null) {
+            this.configurationWindow = new EndForEachConfigurationDialog(this.node, xbayaGUI);
+        }
+        this.configurationWindow.show();
+    }
+
+    /**
+     * @param node
+     */
+    public EndForEachNodeGUI(EndForEachNode node) {
+        super(node);
+        this.node = node;
+        this.polygon = new Polygon(); // To avoid null check.
+        generalPath = new GeneralPath();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+        calculatePositions();
+        setPortPositions();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds()
+     */
+    @Override
+    protected Rectangle getBounds() {
+        return this.polygon.getBounds();
+    }
+
+    @Override
+    protected boolean isIn(Point point) {
+        return this.polygon.contains(point);
+    }
+
+	protected Color getCompnentHeaderColor() {
+		return headColor;
+	}
+
+	protected String getComponentHeaderText() {
+		return node.getName();
+	}
+
+	protected GeneralPath getComponentHeaderShape() {
+		return DrawUtils.getRoundedShape(createHeader(getPosition()));
+	}
+
+	protected GeneralPath getComponentShape() {
+		return generalPath;
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+	private Polygon createHeader(Point position) {
+		Polygon head = new Polygon();
+        head.addPoint(position.x, position.y);
+        head.addPoint(position.x, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+		return head;
+	}
+
+    private void calculatePositions() {
+        this.polygon = new Polygon();
+        Point position = getPosition();
+        this.polygon.addPoint(position.x, position.y);
+        this.polygon.addPoint(position.x, position.y + this.dimension.height + this.headHeight / 2);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+        DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#setPortPositions()
+     */
+    @Override
+    protected void setPortPositions() {
+        // TODO Auto-generated method stub
+        super.setPortPositions();
+
+        for (Port controlOutPort : this.node.getControlOutPorts()) {
+        	NodeController.getGUI(controlOutPort).setOffset(new Point(getBounds().width, getBounds().height - this.headHeight / 2));
+            break; // Has only one
+        }
+
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndifNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndifNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndifNodeGUI.java
new file mode 100644
index 0000000..9151897
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndifNodeGUI.java
@@ -0,0 +1,176 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.system.EndifNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.EndifConfigurationDialog;
+import org.apache.airavata.xbaya.ui.graph.PortGUI;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class EndifNodeGUI extends ConfigurableNodeGUI {
+
+    private EndifConfigurationDialog configurationWindow;
+
+    private EndifNode node;
+
+    private Polygon polygon;
+    
+    private GeneralPath generalPath;
+
+    /**
+     * @param node
+     */
+    public EndifNodeGUI(EndifNode node) {
+        super(node);
+        this.node = node;
+        this.polygon = new Polygon();
+        generalPath = new GeneralPath();
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.configurationWindow == null) {
+            this.configurationWindow = new EndifConfigurationDialog(this.node, xbayaGUI);
+        }
+        this.configurationWindow.show();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+        calculatePositions();
+        setPortPositions();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds()
+     */
+    @Override
+    protected Rectangle getBounds() {
+        return this.polygon.getBounds();
+    }
+
+    @Override
+    protected boolean isIn(Point point) {
+        return this.polygon.contains(point);
+    }
+
+	protected Color getComponentHeaderColor() {
+		return headColor;
+	}
+
+	protected String getComponentHeaderText() {
+		return this.node.getName();
+	}
+
+	protected GeneralPath getComponentHeaderShape() {
+		return DrawUtils.getRoundedShape(createHeader(getPosition()));
+	}
+
+	protected GeneralPath getComponentShape() {
+		return generalPath;
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+	private Polygon createHeader(Point position) {
+		Polygon head = new Polygon();
+        head.addPoint(position.x, position.y);
+        head.addPoint(position.x, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+		return head;
+	}
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#setPortPositions()
+     */
+    @Override
+    protected void setPortPositions() {
+        // inputs
+        List<? extends Port> inputPorts = this.node.getInputPorts();
+        for (int i = 0; i < inputPorts.size(); i++) {
+            Port port = inputPorts.get(i);
+            Point offset;
+            if (i < inputPorts.size() / 2) {
+                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
+            } else {
+                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * (i + 1));
+            }
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // outputs
+        List<? extends Port> outputPorts = this.node.getOutputPorts();
+        for (int i = 0; i < outputPorts.size(); i++) {
+            Port port = outputPorts.get(i);
+            Point offset = new Point(this.getBounds().width - PortGUI.DATA_PORT_SIZE / 2, (int) (this.headHeight
+                    + PORT_INITIAL_GAP + PORT_GAP * (outputPorts.size() / 2.0 + i)));
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // control-in
+        Port controlInPort = this.node.getControlInPort();
+        if (controlInPort != null) {
+        	NodeController.getGUI(controlInPort).setOffset(new Point(0, 0));
+        }
+
+        // control-out
+        for (Port controlOutPort : this.node.getControlOutPorts()) {
+        	NodeController.getGUI(controlOutPort).setOffset(new Point(getBounds().width, getBounds().height - this.headHeight / 2));
+            break; // Has only one
+        }
+
+    }
+
+    private void calculatePositions() {
+        this.polygon.reset();
+        Point position = getPosition();
+        this.polygon.addPoint(position.x, position.y);
+        this.polygon.addPoint(position.x, position.y + this.dimension.height + this.headHeight / 2);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+        DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ExitNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ExitNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ExitNodeGUI.java
new file mode 100644
index 0000000..66b2265
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ExitNodeGUI.java
@@ -0,0 +1,98 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.geom.Ellipse2D;
+
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.system.ExitNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.apache.airavata.xbaya.ui.graph.Paintable;
+
+public class ExitNodeGUI extends NodeGUI {
+
+    public final static Color c_LIGHTER = new Color(255, 255, 255);
+    public final static Color c_DARKER = new Color(251, 103, 87);
+
+    /**
+     * Constructs a BPELExitNodeGUI.
+     * 
+     * @param node
+     */
+    public ExitNodeGUI(ExitNode node) {
+        super(node);
+        node.setName(" Exit");
+    }
+
+    @Override
+    protected void paint(Graphics2D g2) {
+
+        Point position = this.node.getPosition();
+
+        Graphics2D g = (Graphics2D) g2.create();
+        GradientPaint gp = new GradientPaint(position.x, position.y, c_LIGHTER, (position.x + this.dimension.height),
+                (position.y + this.dimension.height), c_DARKER);
+        // Draws the body.
+
+        if (this.dragged) {
+            g.setColor(DRAGGED_BODY_COLOR);
+        } else {
+            g.setColor(this.bodyColor);
+        }
+        Ellipse2D.Double bodyShape = new Ellipse2D.Double(position.x + 2, position.y, this.dimension.height, this.dimension.height);
+        drawHeader(g, bodyShape, node.getName(), c_DARKER, false);
+//        g.setPaint(gp);
+//        g.fillOval(position.x + 2, position.y, this.dimension.height, this.dimension.height);
+//        g.setColor(Color.black);
+////        g.setStroke(new BasicStroke(1.2f));
+//        g.drawOval(position.x + 2, position.y, this.dimension.height, this.dimension.height);
+        // Text
+//        g.setColor(TEXT_COLOR);
+
+        // XXX it's debatable if we should show the ID or the name.
+//        String name = this.node.getName(); // + this.node.getID();
+//        g.drawString(name, position.x + TEXT_GAP_X, position.y + this.headHeight - TEXT_GAP_Y + 2);
+
+        // Edge
+        drawEdge(g, bodyShape.getBounds2D(),EDGE_COLOR.brighter());
+        drawEdge(g, bodyShape, EDGE_COLOR);
+        
+//        g.setColor(EDGE_COLOR);
+//        // Comment of dont want circle in rectangle
+//        g.drawRect(position.x, position.y, this.dimension.height + 2, this.dimension.height);
+
+        // Paint all ports
+        drawPorts(g, node);
+
+        // Paint extras
+        for (Paintable paintable : this.paintables) {
+            paintable.paint(g, this.node.getPosition());
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ForEachNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ForEachNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ForEachNodeGUI.java
new file mode 100644
index 0000000..2b98bfa
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ForEachNodeGUI.java
@@ -0,0 +1,155 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.impl.PortImpl;
+import org.apache.airavata.workflow.model.graph.system.ForEachNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.ForEachConfigurationDialog;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class ForEachNodeGUI extends ConfigurableNodeGUI {
+
+    private static final String CONFIG_AREA_STRING = "Config";
+
+    private ForEachNode node;
+
+    private ForEachConfigurationDialog configurationWindow;
+
+    private Polygon polygon;
+
+    private GeneralPath generalPath;
+
+    /**
+     * @param node
+     */
+    public ForEachNodeGUI(ForEachNode node) {
+        super(node);
+        this.node = node;
+        setConfigurationText(CONFIG_AREA_STRING);
+        this.polygon = new Polygon(); // To avoid null check.
+        generalPath = new GeneralPath();
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.configurationWindow == null) {
+            this.configurationWindow = new ForEachConfigurationDialog(this.node, xbayaGUI);
+        }
+        this.configurationWindow.show();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.system.ConfigurableNodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+        calculatePositions();
+        setPortPositions();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds()
+     */
+    @Override
+    protected Rectangle getBounds() {
+        return this.polygon.getBounds();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#isIn(java.awt.Point)
+     */
+    @Override
+    protected boolean isIn(Point point) {
+        return this.polygon.contains(point);
+    }
+
+	protected Color getComponentHeaderColor() {
+		return headColor;
+	}
+
+	protected String getComponentHeaderText() {
+		return node.getName();
+	}
+
+	protected GeneralPath getComponentHeaderShape() {
+		return DrawUtils.getRoundedShape(createHeader(getPosition()));
+	}
+
+	protected GeneralPath getComponentShape() {
+		return generalPath;
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+	private Polygon createHeader(Point position) {
+		Polygon head = new Polygon();
+        head.addPoint(position.x, position.y + this.headHeight / 2);
+        head.addPoint(position.x, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y);
+		return head;
+	}
+
+    private void calculatePositions() {
+        // XXX Avoid instantiating a new polygon each time.
+        this.polygon = new Polygon();
+        Point position = getPosition();
+        this.polygon.addPoint(position.x, position.y + this.headHeight / 2);
+        this.polygon.addPoint(position.x, position.y + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height + this.headHeight
+                - this.headHeight / 2);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y);
+        DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
+    }
+
+    /**
+     * Sets up the position of ports
+     */
+    @Override
+    protected void setPortPositions() {
+        super.setPortPositions();
+
+        PortImpl controlInPort = this.node.getControlInPort();
+        if (controlInPort != null) {
+            Point off = new Point(0, this.headHeight / 2);
+            NodeController.getGUI(controlInPort).setOffset(off);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/IfNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/IfNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/IfNodeGUI.java
new file mode 100644
index 0000000..f5a7f68
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/IfNodeGUI.java
@@ -0,0 +1,183 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.impl.PortImpl;
+import org.apache.airavata.workflow.model.graph.system.IfNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.IfConfigurationDialog;
+import org.apache.airavata.xbaya.ui.graph.PortGUI;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class IfNodeGUI extends ConfigurableNodeGUI {
+
+    private static final String CONFIG_AREA_STRING = "Config";
+
+    private IfNode node;
+
+    private IfConfigurationDialog configurationWindow;
+
+    private Polygon polygon;
+    
+    private GeneralPath generalPath;
+
+    /**
+     * @param node
+     */
+    public IfNodeGUI(IfNode node) {
+        super(node);
+        this.node = node;
+        setConfigurationText(CONFIG_AREA_STRING);
+        this.polygon = new Polygon();
+        generalPath = new GeneralPath();
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.configurationWindow == null) {
+            this.configurationWindow = new IfConfigurationDialog(this.node, xbayaGUI);
+        }
+        this.configurationWindow.show();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.system.ConfigurableNodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+        calculatePositions();
+        setPortPositions();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds()
+     */
+    @Override
+    protected Rectangle getBounds() {
+        return this.getComponentShape().getBounds();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#isIn(java.awt.Point)
+     */
+    @Override
+    protected boolean isIn(Point point) {
+        return this.polygon.contains(point);
+    }
+
+	protected Color getComponentHeaderColor() {
+		return this.headColor;
+	}
+
+	protected GeneralPath getComponentHeaderShape() {
+		return DrawUtils.getRoundedShape(createHeadNode(getPosition()));
+	}
+
+	protected String getComponentHeaderText() {
+		return this.node.getName();
+	}
+
+	protected GeneralPath getComponentShape() {
+		return generalPath;
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+	private Polygon createHeadNode(Point position) {
+		Polygon head = new Polygon();
+        head.addPoint(position.x, position.y + this.headHeight / 2);
+        head.addPoint(position.x, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+        head.addPoint(position.x + this.dimension.width / 2, position.y);
+		return head;
+	}
+
+    /**
+     * Sets up the position of ports
+     */
+    @Override
+    protected void setPortPositions() {
+        List<? extends Port> inputPorts = this.node.getInputPorts();
+        for (int i = 0; i < inputPorts.size(); i++) {
+            Port port = inputPorts.get(i);
+            Point offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        PortImpl controlInPort = this.node.getControlInPort();
+        if (controlInPort != null) {
+            Point offset = new Point(0, this.headHeight / 2);
+            NodeController.getGUI(controlInPort).setOffset(offset);
+        }
+
+        // There are two controlOutPorts.
+        List<? extends Port> controlOutPorts = this.node.getControlOutPorts();
+        Port controlOutPort1 = controlOutPorts.get(0);
+        Point offset = new Point(getBounds().width, +this.headHeight / 2);
+        PortGUI truePortGUI = NodeController.getGUI(controlOutPort1);
+        truePortGUI.setOffset(offset);
+        truePortGUI.setPortText("T");
+
+        Port controlOutPort2 = controlOutPorts.get(1);
+        offset = new Point(this.getBounds().width, getBounds().height - this.headHeight / 2);
+        PortGUI falsePortGUI = NodeController.getGUI(controlOutPort2);
+		falsePortGUI.setOffset(offset);
+		falsePortGUI.setPortText("F");
+		
+        // No outputs
+    }
+
+    private void calculatePositions() {
+        // Avoid instantiating a new polygon each time.
+        this.polygon.reset();
+        Point position = getPosition();
+        this.polygon.addPoint(position.x, position.y + this.headHeight / 2);
+        this.polygon.addPoint(position.x, position.y + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width / 2, position.y + this.dimension.height
+                + this.headHeight / 2);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+        this.polygon.addPoint(position.x + this.dimension.width / 2, position.y);
+        DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/InputNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/InputNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/InputNodeGUI.java
new file mode 100644
index 0000000..554964c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/InputNodeGUI.java
@@ -0,0 +1,81 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.InputConfigurationDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+
+public class InputNodeGUI extends ConfigurableNodeGUI {
+
+    private static final String CONFIG_AREA_STRING = "Config";
+
+    private static final Color HEAD_COLOR = new Color(153, 204, 255);
+
+    private InputNode inputNode;
+
+    private InputConfigurationDialog configurationWindow;
+
+    /**
+     * @param node
+     */
+    public InputNodeGUI(InputNode node) {
+        super(node);
+        this.inputNode = node;
+        setConfigurationText(CONFIG_AREA_STRING);
+        this.headColor = HEAD_COLOR;
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.inputNode.isConnected()) {
+            if (this.configurationWindow == null) {
+                this.configurationWindow = new InputConfigurationDialog(this.inputNode, xbayaGUI);
+            }
+            this.configurationWindow.show();
+
+        } else {
+        	xbayaGUI.getErrorWindow().info(ErrorMessages.INPUT_NOT_CONNECTED_WARNING);
+        }
+    }
+
+    public InputNode getInputNode() {
+        return this.inputNode;
+    }
+
+    protected void setSelectedFlag(boolean flag) {
+        this.selected = flag;
+        if (this.selected) {
+            this.headColor = SELECTED_HEAD_COLOR;
+        } else {
+            this.headColor = HEAD_COLOR;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/MemoNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/MemoNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/MemoNodeGUI.java
new file mode 100644
index 0000000..0fddcfd
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/MemoNodeGUI.java
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
+
+import javax.swing.JTextArea;
+import javax.swing.border.EmptyBorder;
+
+import org.apache.airavata.workflow.model.graph.system.MemoNode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.MemoConfigurationDialog;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class MemoNodeGUI extends NodeGUI {
+
+    private static final int BORDER_SIZE = 5;
+
+    private MemoNode node;
+
+    private JTextArea textArea;
+
+    private MemoConfigurationDialog window;
+
+    /**
+     * @param node
+     */
+    public MemoNodeGUI(MemoNode node) {
+        super(node);
+        this.node = node;
+
+        this.textArea = new JTextArea();
+        this.textArea.setBorder(new EmptyBorder(BORDER_SIZE, BORDER_SIZE, BORDER_SIZE, BORDER_SIZE));
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
+     *      org.apache.airavata.xbaya.XBayaEngine)
+     */
+    @Override
+    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+        if (event.getClickCount() >= 2) {
+            showWindow(engine);
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#isIn(java.awt.Point)
+     */
+    @Override
+    protected boolean isIn(Point point) {
+        Point position = this.node.getPosition();
+        Dimension preferredSize = this.textArea.getPreferredSize();
+        Rectangle area = new Rectangle(position, preferredSize);
+        return area.contains(point);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#paint(java.awt.Graphics2D)
+     */
+    @Override
+    protected void paint(Graphics2D g) {
+        Point position = this.node.getPosition();
+        this.textArea.setText(this.node.getMemo());
+        Dimension preferredSize = this.textArea.getPreferredSize();
+        Rectangle bounds = new Rectangle(position.x, position.y, preferredSize.width, preferredSize.height);
+        this.textArea.setBounds(bounds);
+        Graphics graphics = g.create(position.x, position.y, preferredSize.width, preferredSize.height);
+        this.textArea.paint(graphics);
+    }
+
+    /**
+     * @param engine
+     */
+    private void showWindow(XBayaEngine engine) {
+        if (this.window == null) {
+            this.window = new MemoConfigurationDialog(this.node, engine);
+        }
+        this.window.show();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/OutputNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/OutputNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/OutputNodeGUI.java
new file mode 100644
index 0000000..41a0d05
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/OutputNodeGUI.java
@@ -0,0 +1,91 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.net.URL;
+
+import org.apache.airavata.common.utils.BrowserLauncher;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.OutputConfigurationDialog;
+
+public class OutputNodeGUI extends ConfigurableNodeGUI {
+
+    private static final String CONFIG_AREA_STRING = "View";
+
+    private static final Color HEAD_COLOR = new Color(35, 107, 142);
+
+    private OutputNode outputNode;
+
+    private OutputConfigurationDialog configurationWindow;
+
+    /**
+     * @param node
+     */
+    public OutputNodeGUI(OutputNode node) {
+        super(node);
+        this.outputNode = node;
+        setConfigurationText(CONFIG_AREA_STRING);
+        this.headColor = HEAD_COLOR;
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+
+        if (this.node instanceof OutputNode) {
+
+            String description = ((OutputNode) this.node).getDescription();
+            if (null != description) {
+                // try to parse it to a URL and if yes try to open the browser
+                try {
+                    description = description.trim();
+                    URL url = new URL(description);
+                    // no exception -> valid url lets try to open it
+                    BrowserLauncher.openURL(url);
+                } catch (Exception e) {
+                    // do nothing since this is an optional attempt
+                }
+
+            }
+        }
+        if (this.configurationWindow == null) {
+            this.configurationWindow = new OutputConfigurationDialog(this.outputNode, xbayaGUI);
+        }
+        this.configurationWindow.show();
+
+    }
+
+    protected void setSelectedFlag(boolean flag) {
+        this.selected = flag;
+        if (this.selected) {
+            this.headColor = SELECTED_HEAD_COLOR;
+        } else {
+            this.headColor = HEAD_COLOR;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ReceiveNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ReceiveNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ReceiveNodeGUI.java
new file mode 100644
index 0000000..390a3d6
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ReceiveNodeGUI.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.system.ReceiveNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.ReceiveConfigurationDialog;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class ReceiveNodeGUI extends ConfigurableNodeGUI {
+
+    private ReceiveNode node;
+
+    private Polygon polygon;
+
+    private ReceiveConfigurationDialog configurationDialog;
+    
+    private GeneralPath generalPath;
+
+    /**
+     * @param node
+     */
+    public ReceiveNodeGUI(ReceiveNode node) {
+        super(node);
+        this.node = node;
+        this.polygon = new Polygon(); // To avoid null check.
+        generalPath = new GeneralPath();
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.configurationDialog == null) {
+            this.configurationDialog = new ReceiveConfigurationDialog(this.node, xbayaGUI);
+        }
+        this.configurationDialog.show();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+        calculatePositions();
+        setPortPositions();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds()
+     */
+    @Override
+    protected Rectangle getBounds() {
+        return this.polygon.getBounds();
+    }
+
+    @Override
+    protected boolean isIn(Point point) {
+        return this.polygon.contains(point);
+    }
+
+	protected Color getComponentHeaderColor() {
+		return headColor;
+	}
+
+	protected String getComponentHeaderText() {
+		return node.getName();
+	}
+
+	protected GeneralPath getComponentHeaderShape() {
+		return DrawUtils.getRoundedShape(createHeader(getPosition()));
+	}
+
+	protected GeneralPath getComponentShape() {
+		return generalPath;
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+	private Polygon createHeader(Point position) {
+		Polygon head = new Polygon();
+        head.addPoint(position.x, position.y);
+        head.addPoint(position.x, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+		return head;
+	}
+
+    private void calculatePositions() {
+        this.polygon = new Polygon();
+        Point position = getPosition();
+        this.polygon.addPoint(position.x, position.y);
+        this.polygon.addPoint(position.x, position.y + this.dimension.height + this.headHeight / 2);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+        DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#setPortPositions()
+     */
+    @Override
+    protected void setPortPositions() {
+        super.setPortPositions();
+
+        for (Port controlOutPort : this.node.getControlOutPorts()) {
+        	NodeController.getGUI(controlOutPort).setOffset(new Point(getBounds().width, getBounds().height - this.headHeight / 2));
+            break; // Has only one
+        }
+
+        Port port = this.node.getEPRPort();
+        NodeController.getGUI(port).setOffset(new Point(getBounds().width / 2, this.headHeight / 4));
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/S3InputNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/S3InputNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/S3InputNodeGUI.java
new file mode 100644
index 0000000..6b00f68
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/S3InputNodeGUI.java
@@ -0,0 +1,81 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+
+import org.apache.airavata.workflow.model.graph.system.S3InputNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.S3FileChooser;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+
+public class S3InputNodeGUI extends ConfigurableNodeGUI {
+
+    private static final String CONFIG_AREA_STRING = "Config";
+
+    private static final Color HEAD_COLOR = new Color(153, 204, 255);
+
+    private S3InputNode inputNode;
+
+    private S3FileChooser s3FileChooser;
+
+    /**
+     * @param node
+     */
+    public S3InputNodeGUI(S3InputNode node) {
+        super(node);
+        this.inputNode = node;
+        setConfigurationText(CONFIG_AREA_STRING);
+        this.headColor = HEAD_COLOR;
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+
+        if (!this.inputNode.isConnected()) {
+        	xbayaGUI.getErrorWindow().info(ErrorMessages.INPUT_NOT_CONNECTED_WARNING);
+        } else {
+            if (this.s3FileChooser == null) {
+                this.s3FileChooser = new S3FileChooser(xbayaGUI, this.inputNode);
+            }
+            this.s3FileChooser.show();
+        }
+    }
+
+    public S3InputNode getInputNode() {
+        return this.inputNode;
+    }
+
+    protected void setSelectedFlag(boolean flag) {
+        this.selected = flag;
+        if (this.selected) {
+            this.headColor = SELECTED_HEAD_COLOR;
+        } else {
+            this.headColor = HEAD_COLOR;
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/StreamSourceNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/StreamSourceNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/StreamSourceNodeGUI.java
new file mode 100644
index 0000000..d0b7c48
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/StreamSourceNodeGUI.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+
+import org.apache.airavata.workflow.model.graph.system.StreamSourceNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.StreamSourceConfigurationDialog;
+
+public class StreamSourceNodeGUI extends ConfigurableNodeGUI {
+
+    private static Color HEAD_COLOR = Color.BLUE;
+
+    private static final String CONFIG_AREA_STRING = "Config";
+
+    private StreamSourceNode inputNode;
+
+    private StreamSourceConfigurationDialog configurationWindow;
+
+    /**
+     * @param node
+     */
+    public StreamSourceNodeGUI(StreamSourceNode node) {
+        super(node);
+
+        this.inputNode = node;
+        setConfigurationText(CONFIG_AREA_STRING);
+        headColor = HEAD_COLOR;
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.configurationWindow == null) {
+            this.configurationWindow = new StreamSourceConfigurationDialog(this.inputNode, xbayaGUI);
+        }
+        this.configurationWindow.show();
+    }
+
+    protected void setSelectedFlag(boolean flag) {
+        this.selected = flag;
+        if (this.selected) {
+            this.headColor = SELECTED_HEAD_COLOR;
+        } else {
+            this.headColor = HEAD_COLOR;
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WSNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WSNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WSNodeGUI.java
new file mode 100644
index 0000000..0dbed32
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WSNodeGUI.java
@@ -0,0 +1,156 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.ws;
+
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
+
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.ws.ServiceInteractionWindow;
+import org.apache.airavata.xbaya.ui.dialogs.graph.ws.WSNodeWindow;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WSNodeGUI extends NodeGUI {
+
+    private final static Logger logger = LoggerFactory.getLogger(WSNodeGUI.class);
+
+    private WSNode node;
+
+    private WSNodeWindow window;
+
+    protected static final Color CONFIG_AREA_COLOR = new Color(220, 220, 220);
+
+    protected static final String DEFAULT_CONFIG_AREA_TEXT = "Interact";
+
+    protected static final int CONFIG_AREA_GAP_X = 20;
+
+    protected String configurationText = DEFAULT_CONFIG_AREA_TEXT;
+
+    protected Rectangle configurationArea;
+
+    private boolean interactiveMode;
+
+    /**
+     * Creates a WsNodeGui
+     * 
+     * @param node
+     */
+    public WSNodeGUI(WSNode node) {
+        super(node);
+        this.node = node;
+        this.configurationArea = new Rectangle();
+    }
+
+    private void showWindow(XBayaEngine engine) {
+        if (this.window == null) {
+            this.window = new WSNodeWindow(engine, this.node);
+        }
+        this.window.show();
+    }
+
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI, Monitor monitor) {
+        new ServiceInteractionWindow(xbayaGUI, this.node.getID(),monitor).show();
+
+    }
+
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+
+        Point position = this.node.getPosition();
+        FontMetrics fm = g.getFontMetrics();
+
+        if (this.interactiveMode && isInteractable()) {
+            this.configurationArea.height = fm.getHeight() + TEXT_GAP_Y * 2;
+            // it only need to say interact and the rest of the are should be
+            // available for double clicking
+            this.configurationArea.width = 50;
+            this.configurationArea.x = position.x + CONFIG_AREA_GAP_X;
+            this.configurationArea.y = position.y + this.headHeight
+                    + (this.dimension.height - this.headHeight - this.configurationArea.height) / 2;
+        } else {
+            this.configurationArea.height = 0;
+            this.configurationArea.width = 0;
+        }
+
+    }
+
+    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+        if (event.getClickCount() >= 2) {
+            showWindow(engine);
+        } else if (this.interactiveMode && (isInteractable()) && isInConfig(event.getPoint())) {
+            showConfigurationDialog(engine.getGUI(),engine.getMonitor());
+        }
+    }
+
+    private boolean isInteractable() {
+        return this.bodyColor == NodeState.EXECUTING.color || this.bodyColor == NodeState.FAILED.color
+                || this.bodyColor == NodeState.FINISHED.color;
+    }
+
+    /**
+     * Paints the config area
+     * 
+     * @param g
+     */
+    @Override
+    protected void paint(Graphics2D g) {
+        super.paint(g);
+        if (isInteractable()) {
+            paintConfiguration(g);
+        }
+    }
+
+    protected void paintConfiguration(Graphics2D g) {
+        g.setColor(CONFIG_AREA_COLOR);
+        g.fill(this.configurationArea);
+        g.setColor(TEXT_COLOR);
+        g.drawString(this.configurationText, this.configurationArea.x + TEXT_GAP_X, this.configurationArea.y
+                + this.configurationArea.height - TEXT_GAP_Y);
+    }
+
+    /**
+     * Checks if a user's click is to select the configuration
+     * 
+     * @param point
+     * @return true if the user's click is to select the node, false otherwise
+     */
+    @Override
+    protected boolean isInConfig(Point point) {
+        return this.configurationArea.contains(point);
+    }
+
+    public void setInteractiveMode(boolean mode) {
+        this.interactiveMode = mode;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WorkflowNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WorkflowNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WorkflowNodeGUI.java
new file mode 100644
index 0000000..08a628d
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/ws/WorkflowNodeGUI.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.ws;
+
+import java.awt.event.MouseEvent;
+
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.ws.WorkflowNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WorkflowNodeGUI extends NodeGUI {
+
+    private final static Logger logger = LoggerFactory.getLogger(WorkflowNodeGUI.class);
+
+    private WorkflowNode node;
+
+    /**
+     * Creates a WsNodeGui
+     * 
+     * @param node
+     */
+    public WorkflowNodeGUI(WorkflowNode node) {
+        super(node);
+        this.node = node;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
+     *      org.apache.airavata.xbaya.XBayaEngine)
+     */
+    @Override
+    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+        logger.debug(event.toString());
+        if (event.getClickCount() >= 2) {
+            openWorkflowTab(engine);
+        }
+    }
+
+    public void openWorkflowTab(XBayaEngine engine) {
+        try {
+            Workflow workflow = this.node.getComponent().getWorkflow();
+            engine.getGUI().selectOrCreateGraphCanvas(workflow);
+        } catch (GraphException e) {
+            engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+        } catch (ComponentException e) {
+            engine.getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/AmazonEC2MenuItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/AmazonEC2MenuItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/AmazonEC2MenuItem.java
new file mode 100644
index 0000000..1e4acfb
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/AmazonEC2MenuItem.java
@@ -0,0 +1,160 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.menues;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.amazon.AmazonEC2InvokerWindow;
+import org.apache.airavata.xbaya.ui.dialogs.amazon.AmazonS3UtilsWindow;
+import org.apache.airavata.xbaya.ui.dialogs.amazon.ChangeCredentialWindow;
+import org.apache.airavata.xbaya.ui.dialogs.amazon.EC2InstancesManagementWindow;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+
+public class AmazonEC2MenuItem {
+
+    private JMenu amazonEC2Menu;
+
+    private JMenuItem amazonAuthenticationItem;
+
+    private JMenuItem amazonEC2ToolItem;
+
+    private JMenuItem amazonS3ToolItem;
+
+    private JMenuItem configAndDeploy;
+
+    private XBayaEngine engine;
+
+    /**
+     * Constructs a AmazonEC2MenuItem.
+     *
+     * @param engine XBaya engine
+     */
+    public AmazonEC2MenuItem(XBayaEngine engine) {
+        this.engine = engine;
+
+        createAmazonEC2Menu();
+    }
+
+    /**
+     * create menu
+     */
+    private void createAmazonEC2Menu() {
+        createAmazonAuthenticationItem();
+        createAmazonEC2ToolItem();
+        createAmazonS3ToolItem();
+        createConfigAndRunItem();
+
+        this.amazonEC2Menu = new JMenu("Amazon");
+
+        this.amazonEC2Menu.add(this.amazonAuthenticationItem);
+        this.amazonEC2Menu.addSeparator();
+        this.amazonEC2Menu.add(this.amazonEC2ToolItem);
+//        this.amazonEC2Menu.add(this.amazonS3ToolItem);
+        this.amazonEC2Menu.addSeparator();
+//        this.amazonEC2Menu.add(this.configAndDeploy);
+    }
+
+    private void createAmazonAuthenticationItem() {
+        this.amazonAuthenticationItem = new JMenuItem("Security Credentials");
+        this.amazonAuthenticationItem.addActionListener(new AbstractAction() {
+            private ChangeCredentialWindow window;
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (this.window == null) {
+                    this.window = new ChangeCredentialWindow(AmazonEC2MenuItem.this.engine);
+                }
+                try {
+                    this.window.show();
+                } catch (Exception e1) {
+                    AmazonEC2MenuItem.this.engine.getGUI().getErrorWindow().error(e1);
+                }
+            }
+        });
+    }
+
+    private void createAmazonEC2ToolItem(){
+        this.amazonEC2ToolItem = new JMenuItem("EC2 Instances Management");
+        this.amazonEC2ToolItem.addActionListener(new AbstractAction() {
+            private EC2InstancesManagementWindow window;
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (this.window == null) {
+                    this.window = new EC2InstancesManagementWindow(AmazonEC2MenuItem.this.engine);
+                }
+                try {
+                    this.window.show();
+                } catch (Exception e1) {
+                    AmazonEC2MenuItem.this.engine.getGUI().getErrorWindow().error(e1);
+                }
+            }
+        });
+    }
+
+    private void createAmazonS3ToolItem() {
+        this.amazonS3ToolItem = new JMenuItem("S3 Upload/Download Tool");
+        this.amazonS3ToolItem.addActionListener(new AbstractAction() {
+            private AmazonS3UtilsWindow window;
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (this.window == null) {
+                    this.window = AmazonS3UtilsWindow.getInstance(AmazonEC2MenuItem.this.engine);
+                }
+                try {
+                    this.window.show();
+                } catch (Exception e1) {
+                    AmazonEC2MenuItem.this.engine.getGUI().getErrorWindow().error(e1);
+                }
+            }
+        });
+    }
+
+    private void createConfigAndRunItem() {
+        this.configAndDeploy = new JMenuItem("Config and Deploy Job Flow");
+        this.configAndDeploy.addActionListener(new AbstractAction() {
+            private AmazonEC2InvokerWindow window;
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (this.window == null) {
+                    this.window = new AmazonEC2InvokerWindow(AmazonEC2MenuItem.this.engine);
+                }
+                try {
+                    this.window.show();
+                } catch (Exception e1) {
+                    AmazonEC2MenuItem.this.engine.getGUI().getErrorWindow().error(e1);
+                }
+
+            }
+        });
+
+    }
+
+    public JMenu getMenu() {
+        return this.amazonEC2Menu;
+    }
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/EditMenuItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/EditMenuItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/EditMenuItem.java
new file mode 100644
index 0000000..05b6d90
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/EditMenuItem.java
@@ -0,0 +1,169 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.menues;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.DescriptorEditorDialog;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.DescriptorEditorDialog.DescriptorType;
+import org.apache.airavata.xbaya.ui.dialogs.workflow.ParameterPropertyWindow;
+import org.apache.airavata.xbaya.ui.dialogs.workflow.WorkflowPropertyWindow;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class EditMenuItem {
+
+    private XBayaEngine engine;
+
+    private JMenu editMenu;
+
+    private JMenuItem workflowDescriptionItem;
+
+    private JMenuItem parameterReorderingItem;
+
+	private JMenuItem editHostDescription;
+
+	private JMenuItem editServiceDescription;
+
+	private JMenuItem editApplicationDescription;
+
+    private static final Logger logger = LoggerFactory.getLogger(EditMenuItem.class);
+
+    /**
+     * Constructs a WorkflowMenu.
+     * 
+     * @param engine
+     */
+    public EditMenuItem(XBayaEngine engine) {
+        this.engine = engine;
+        createWorkflowMenu();
+    }
+
+    /**
+     * @return The workflow menu.
+     */
+    public JMenu getMenu() {
+        return this.editMenu;
+    }
+
+    /**
+     * Creates workflow menu.
+     */
+    private void createWorkflowMenu() {
+        this.workflowDescriptionItem = createWorkflowDescriptionItem();
+        this.parameterReorderingItem = createParameterReorderingItem();
+
+        editHostDescription = createEditHostDescription();
+        editServiceDescription = createEditServiceDescription();
+        editApplicationDescription = createEditApplicationDescription();
+
+        editMenu = new JMenu("Edit");
+        editMenu.setMnemonic(KeyEvent.VK_E);
+
+        editMenu.add(this.workflowDescriptionItem);
+        editMenu.add(this.parameterReorderingItem);
+        
+        editMenu.addSeparator();
+        
+        editMenu.add(editHostDescription);
+        editMenu.add(editServiceDescription);
+//        editMenu.add(editApplicationDescription);
+    }
+
+    private JMenuItem createWorkflowDescriptionItem() {
+        JMenuItem menuItem = new JMenuItem("Workflow Properties...");
+        menuItem.setMnemonic(KeyEvent.VK_W);
+        menuItem.addActionListener(new AbstractAction() {
+            private WorkflowPropertyWindow window;
+
+            public void actionPerformed(ActionEvent e) {
+                if (this.window == null) {
+                    this.window = engine.getGUI().getWorkflowPropertyWindow();
+                }
+                this.window.show();
+            }
+        });
+        return menuItem;
+    }
+
+    private JMenuItem createParameterReorderingItem() {
+        JMenuItem menuItem = new JMenuItem("Parameter Properties...");
+        menuItem.setMnemonic(KeyEvent.VK_P);
+        menuItem.addActionListener(new AbstractAction() {
+            private ParameterPropertyWindow window;
+
+            public void actionPerformed(ActionEvent e) {
+                if (this.window == null) {
+                    this.window = new ParameterPropertyWindow(EditMenuItem.this.engine);
+                }
+                this.window.show();
+            }
+        });
+        return menuItem;
+    }
+
+    private JMenuItem createEditHostDescription() {
+        JMenuItem menuItem = new JMenuItem("Hosts...");
+        menuItem.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+            	if (XBayaUtil.acquireJCRRegistry(engine)) {
+					DescriptorEditorDialog dialog = new DescriptorEditorDialog(engine,DescriptorType.HOST);
+					dialog.show();
+				}
+        	}
+        });
+        return menuItem;
+    }
+    
+    private JMenuItem createEditServiceDescription() {
+        JMenuItem menuItem = new JMenuItem("Applications...");
+        menuItem.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+            	if (XBayaUtil.acquireJCRRegistry(engine)) {
+					DescriptorEditorDialog dialog = new DescriptorEditorDialog(engine,DescriptorType.SERVICE);
+					dialog.show();
+				}
+            }
+        });
+        return menuItem;
+    }
+    
+    private JMenuItem createEditApplicationDescription() {
+        JMenuItem menuItem = new JMenuItem("Application Descriptions...");
+        menuItem.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+            	if (XBayaUtil.acquireJCRRegistry(engine)) {
+					DescriptorEditorDialog dialog = new DescriptorEditorDialog(engine,DescriptorType.APPLICATION);
+					dialog.show();
+				}
+        	}
+        });
+        return menuItem;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/MenuIcons.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/MenuIcons.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/MenuIcons.java
new file mode 100644
index 0000000..7b9ffe6
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/MenuIcons.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.menues;
+
+import javax.swing.ImageIcon;
+
+import org.apache.airavata.common.utils.SwingUtil;
+
+public class MenuIcons {
+	public static final ImageIcon OPEN_ICON = SwingUtil.createImageIcon("menu/open1.png");
+	public static final ImageIcon OPEN_DIR_ICON = SwingUtil.createImageIcon("menu/open_dir.png");
+    public static final ImageIcon SAVE_ICON = SwingUtil.createImageIcon("menu/save1.png");
+    public static final ImageIcon NEW_ICON = SwingUtil.createImageIcon("menu/new2.png");
+    
+    public static final ImageIcon RUN_ICON = SwingUtil.createImageIcon("menu/play4.png");
+    public static final ImageIcon STOP_ICON = SwingUtil.createImageIcon("menu/stop.png");
+    public static final ImageIcon MONITOR_PAUSE_ICON = SwingUtil.createImageIcon("menu/pause_monitor1.png");
+    public static final ImageIcon MONITOR_RESUME_ICON = SwingUtil.createImageIcon("menu/resume_monitoring1.png");;
+    public static final ImageIcon JCR_ICON = SwingUtil.createImageIcon("jcr-repo.png");;
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RegistryMenuItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RegistryMenuItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RegistryMenuItem.java
new file mode 100644
index 0000000..94f2888
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RegistryMenuItem.java
@@ -0,0 +1,118 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.menues;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
+import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.widgets.ToolbarButton;
+import org.apache.airavata.xbaya.ui.widgets.XBayaToolBar;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class RegistryMenuItem implements XBayaExecutionModeListener {
+
+	private static final String REGISTRY_ACTIONS = "registry_actions";
+
+    private XBayaEngine engine;
+
+    private JMenu registryMenu;
+
+    private JMenuItem jcrRegistryItem;
+
+    private static final Logger logger = LoggerFactory.getLogger(RegistryMenuItem.class);
+
+    private XBayaToolBar toolBar;
+
+	private ToolbarButton toolbarButtonJCR;
+    
+    /**
+     * Constructs a WorkflowMenu.
+     * 
+     * @param engine
+     */
+    public RegistryMenuItem(XBayaEngine engine, XBayaToolBar toolBar) {
+        this.engine = engine;
+        setToolBar(toolBar);
+        createWorkflowMenu();
+		engine.getConfiguration().registerExecutionModeChangeListener(this);
+    }
+
+    /**
+     * @return The workflow menu.
+     */
+    public JMenu getMenu() {
+        return this.registryMenu;
+    }
+
+    /**
+     * Creates workflow menu.
+     */
+    private void createWorkflowMenu() {
+        this.jcrRegistryItem = createJCRRegistryItem();
+
+        registryMenu = new JMenu("Registry");
+        registryMenu.setMnemonic(KeyEvent.VK_G);
+
+        registryMenu.add(this.jcrRegistryItem);
+        executionModeChanged(engine.getConfiguration());
+
+    }
+    
+    private JMenuItem createJCRRegistryItem() {
+        JMenuItem item = new JMenuItem("Setup Airavata Registry...",MenuIcons.JCR_ICON);
+        item.setMnemonic(KeyEvent.VK_J);
+        AbstractAction action = new AbstractAction() {
+
+            public void actionPerformed(ActionEvent e) {
+                XBayaEngine xbayaEngine = engine;
+                XBayaUtil.updateJCRRegistryInfo(xbayaEngine);
+            }
+
+        };
+		item.addActionListener(action);
+		toolbarButtonJCR = getToolBar().addToolbarButton(REGISTRY_ACTIONS, item.getText(), MenuIcons.JCR_ICON, item.getText(), action, 1);
+        return item;
+    }
+
+	public XBayaToolBar getToolBar() {
+		return toolBar;
+	}
+
+	public void setToolBar(XBayaToolBar toolBar) {
+		this.toolBar = toolBar;
+	}
+	
+	@Override
+	public void executionModeChanged(XBayaConfiguration config) {
+		toolbarButtonJCR.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);
+	}
+}
\ No newline at end of file


[77/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
new file mode 100644
index 0000000..5de91e4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
@@ -0,0 +1,387 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import java.io.IOException;
+import java.net.URI;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.registry.api.workflow.NodeExecutionError;
+import org.apache.airavata.workflow.model.graph.EPRPort;
+import org.apache.airavata.workflow.model.graph.Edge;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.ws.monitor.EventData;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.ws.monitor.MonitorUtil;
+import org.apache.airavata.ws.monitor.MonitorUtil.EventType;
+import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
+import org.apache.airavata.wsmg.client.MsgBrokerClientException;
+import org.apache.airavata.wsmg.client.NotificationHandler;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.airavata.wsmg.client.msgbox.MessagePuller;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.provenance.WorkflowNodeStatusUpdater;
+import org.apache.airavata.xbaya.provenance.WorkflowStatusUpdater;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+public class WorkflowInterpretorEventListener implements NotificationHandler, ConsumerNotificationHandler {
+
+    private Workflow workflow;
+    private boolean pullMode;
+    private WseMsgBrokerClient wseClient;
+    private URI brokerURL;
+    private String topic;
+    private URI messageBoxURL;
+    private String subscriptionID;
+    private MessagePuller messagePuller;
+    private WorkflowStatusUpdater workflowStatusUpdater;
+    private WorkflowNodeStatusUpdater workflowNodeStatusUpdater;
+    private WorkflowInterpreterConfiguration workflowInterpreterConfiguration;
+    private String lastSubscriptionId;
+
+    private static Logger logger = LoggerFactory.getLogger(WorkflowInterpretorEventListener.class);
+
+    public WorkflowInterpretorEventListener(Workflow workflow, XBayaConfiguration configuration) {
+        this.workflow = workflow;
+        this.brokerURL = configuration.getBrokerURL();
+        this.topic = configuration.getTopic();
+        this.pullMode = true;
+        this.messageBoxURL = configuration.getMessageBoxURL();
+        this.wseClient = new WseMsgBrokerClient();
+        this.wseClient.init(this.brokerURL.toString());
+        this.workflowInterpreterConfiguration = WorkflowInterpreter.getWorkflowInterpreterConfiguration();
+        this.workflowNodeStatusUpdater = new WorkflowNodeStatusUpdater(this.workflowInterpreterConfiguration.getAiravataAPI());
+        this.workflowStatusUpdater = new WorkflowStatusUpdater(this.workflowInterpreterConfiguration.getAiravataAPI());
+    }
+
+    public void start() throws MonitorException {
+
+        subscribe();
+    }
+
+    public void stop() throws MonitorException {
+        unsubscribe();
+    }
+
+    private synchronized void subscribe() throws MonitorException {
+        if (this.subscriptionID != null) {
+            throw new IllegalStateException();
+        }
+        try {
+            if (this.pullMode) {
+                EndpointReference messageBoxEPR = this.wseClient.createPullMsgBox(this.messageBoxURL.toString(),20000L);
+                this.subscriptionID = this.wseClient.subscribe(messageBoxEPR.getAddress(), this.topic, null);
+                this.messagePuller = this.wseClient.startPullingEventsFromMsgBox(messageBoxEPR, this, 1000L, 20000L);
+            } else {
+                String[] endpoints = this.wseClient.startConsumerService(2222, this);
+                this.subscriptionID = this.wseClient.subscribe(endpoints[0], this.topic, null);
+            }
+        } catch (IOException e) {
+            throw new MonitorException("Failed to subscribe.", e);
+        } catch (RuntimeException e) {
+            throw new MonitorException("Failed to subscribe.", e);
+        }
+    }
+
+    /**
+     * Unsubscribes from the notification.
+     * 
+     * @throws MonitorException
+     */
+    private synchronized void unsubscribe() throws MonitorException {
+        // This method needs to be synchronized along with subscribe() because
+        // unsubscribe() might be called while subscribe() is being executed.
+        if (this.subscriptionID == null) {
+            throw new IllegalStateException();
+        }
+        try {
+            if (this.pullMode) {
+                this.messagePuller.stopPulling();
+                try {
+                    Thread.sleep(100);
+                } catch (InterruptedException e) {
+                    throw new MonitorException("Error during stop message puller", e);
+                }
+//            } else {
+//                this.wseClient.unSubscribe(this.subscriptionID);
+            }
+            this.wseClient.unSubscribe(this.subscriptionID);
+
+        } catch (MsgBrokerClientException e) {
+            throw new MonitorException("Failed to unsubscribe.", e);
+        }
+
+    }
+
+    /**
+     * @see org.apache.airavata.wsmg.client.NotificationHandler#handleNotification(java.lang.String)
+     */
+    public void handleNotification(String message) {
+        try {
+            // String soapBody = WorkFlowUtils.getSoapBodyContent(message);
+            XmlElement event = XMLUtil.stringToXmlElement(message);
+            handleEvent(new EventData(event), true, this.workflow.getGraph());
+
+            // } catch (XMLStreamException e) {
+            // // Just log them because they can be unrelated messages sent to
+            // // this topic by accident.
+            // logger.warn("Could not parse received notification: " + message,
+            // e);
+            // }
+        } catch (RuntimeException e) {
+            logger.warn("Failed to process notification: " + message, e);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error occured during Exception saving to the Registry");
+        }
+    }
+
+    private void handleEvent(EventData event, boolean forward, Graph graph) throws AiravataAPIInvocationException {
+        EventType type = event.getType();
+        String nodeID = event.getNodeID();
+        Node node = graph.getNode(nodeID);
+
+        if (type == MonitorUtil.EventType.WORKFLOW_INVOKED) {
+            workflowStarted(graph, forward);
+            //todo ideally experimentID and workflowInstanceID has to be different
+            workflowStatusUpdater.saveWorkflowData(event.getExperimentID(), event.getExperimentID(),
+                    this.workflowInterpreterConfiguration.getWorkflow().getName());
+            workflowStatusUpdater.workflowStarted(event.getExperimentID());
+        } else if (type == MonitorUtil.EventType.WORKFLOW_TERMINATED) {
+            workflowFinished(graph, forward);
+            workflowStatusUpdater.workflowFinished(event.getExperimentID());
+            try {
+                this.unsubscribe();
+            } catch (MonitorException e) {
+                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+            }
+        } else if (type == EventType.INVOKING_SERVICE || type == EventType.SERVICE_INVOKED) {
+            if (node == null) {
+                if (nodeID!=null && !nodeID.equals("")) {
+					logger.warn("There is no node that has ID, " + nodeID);
+				}
+            } else {
+                nodeStarted(node, forward);
+                workflowNodeStatusUpdater.workflowNodeStarted(event.getExperimentID(), event.getNodeID()
+                        , event.getMessage(), event.getWorkflowID().toASCIIString());
+            }
+        } else if (type == MonitorUtil.EventType.RECEIVED_RESULT
+        // TODO this should be removed when GPEL sends all notification
+        // correctly.
+                || type == EventType.SENDING_RESULT) {
+            if (node == null) {
+            	if (nodeID!=null && !nodeID.equals("")) {
+					logger.warn("There is no node that has ID, " + nodeID);
+				}
+        	} else {
+                nodeFinished(node, forward);
+                workflowNodeStatusUpdater.workflowNodeFinished(event.getExperimentID(), event.getNodeID(), event.getMessage(),
+                        event.getWorkflowID().toASCIIString());
+            }
+        } else if (type == EventType.RECEIVED_FAULT
+                || type == EventType.SENDING_FAULT || type == EventType.SENDING_RESPONSE_FAILED) {
+            //Constructing NodeExecutionError with required data...
+            logger.error(event.getMessage());
+            NodeExecutionError nodeExecutionError = new NodeExecutionError();
+            nodeExecutionError.setExperimentId(event.getExperimentID());
+            nodeExecutionError.setNodeId(event.getNodeID());
+            nodeExecutionError.setWorkflowInstanceId(event.getExperimentID());
+            nodeExecutionError.setErrorMessage(event.getMessage());
+            nodeExecutionError.setErrorDescription(event.getMessage());
+            nodeExecutionError.setErrorTime(event.getTimestamp());
+            this.workflowInterpreterConfiguration.getAiravataAPI().getExecutionManager().addNodeExecutionError(nodeExecutionError);
+            if (node == null) {
+            	if (nodeID!=null && !nodeID.equals("")) {
+					logger.warn("There is no node that has ID, " + nodeID);
+				}
+            } else {
+                nodeFailed(node, forward);
+                workflowNodeStatusUpdater.workflowNodeFailed(event.getExperimentID(), event.getNodeID());
+            }
+            try {
+                this.unsubscribe();
+            } catch (MonitorException e) {
+                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+            }
+        } else if (type == MonitorUtil.EventType.RESOURCE_MAPPING) {
+            if (node == null) {
+            	if (nodeID!=null && !nodeID.equals("")) {
+					logger.warn("There is no node that has ID, " + nodeID);
+				}
+            } else {
+                // nodeResourceMapped(node, event.getEvent(), forward);
+                workflowNodeStatusUpdater.workflowNodeRunning(event.getExperimentID(), event.getNodeID());
+            }
+        } else if(type == MonitorUtil.EventType.LOG_INFO){
+            // This is not very gram specific, if these data is required in other provider they have to send
+            // the notification in info mode with ending these text, DONE,PENDING and ACTIVE
+            if(event.getMessage().endsWith("DONE")) {
+                workflowNodeStatusUpdater.workflowNodeStatusDone(event.getExperimentID(), event.getNodeID());
+            } else if(event.getMessage().endsWith("PENDING")){
+                workflowNodeStatusUpdater.workflowNodeStatusPending(event.getExperimentID(), event.getNodeID());
+            } else if(event.getMessage().endsWith("ACTIVE")){
+                workflowNodeStatusUpdater.workflowNodeStatusActive(event.getExperimentID(), event.getNodeID());
+            }
+        } else {
+            // Ignore the rest.
+        }
+    }
+
+    private void workflowStarted(Graph graph, boolean forward) {
+        for (InputNode node : GraphUtil.getInputNodes(graph)) {
+            if (forward) {
+                finishNode(node);
+            } else {
+                resetNode(node);
+            }
+        }
+    }
+
+    private void workflowFinished(Graph graph, boolean forward) {
+        for (OutputNode node : GraphUtil.getOutputNodes(graph)) {
+            if (forward) {
+                finishNode(node);
+                finishPredecessorNodes(node);
+            } else {
+                resetNode(node);
+            }
+        }
+    }
+
+    private LinkedList<InputNode> getInputNodes(WSGraph graph) {
+        List<NodeImpl> nodes = graph.getNodes();
+        LinkedList<InputNode> inputNodes = new LinkedList<InputNode>();
+        for (NodeImpl nodeImpl : nodes) {
+            if (nodeImpl instanceof InputNode) {
+                inputNodes.add((InputNode) nodeImpl);
+            }
+        }
+        return inputNodes;
+    }
+
+    private LinkedList<OutputNode> getOutputNodes(WSGraph graph) {
+        List<NodeImpl> nodes = graph.getNodes();
+        LinkedList<OutputNode> outputNodes = new LinkedList<OutputNode>();
+        for (NodeImpl nodeImpl : nodes) {
+            if (nodeImpl instanceof OutputNode) {
+                outputNodes.add((OutputNode) nodeImpl);
+            }
+        }
+        return outputNodes;
+    }
+
+    private void nodeStarted(Node node, boolean forward) {
+        if (forward) {
+            executeNode(node);
+            finishPredecessorNodes(node);
+        } else {
+            resetNode(node);
+        }
+    }
+
+    private void nodeFinished(Node node, boolean forward) {
+        if (forward) {
+            finishNode(node);
+            finishPredecessorNodes(node);
+        } else {
+            executeNode(node);
+        }
+    }
+
+    private void nodeFailed(Node node, boolean forward) {
+        if (forward) {
+            failNode(node);
+            finishPredecessorNodes(node);
+        } else {
+            executeNode(node);
+        }
+    }
+
+    private void executeNode(Node node) {
+        node.setState(NodeExecutionState.EXECUTING);
+    }
+
+    private void finishNode(Node node) {
+        node.setState(NodeExecutionState.FINISHED);
+    }
+
+    private void failNode(Node node) {
+        node.setState(NodeExecutionState.FAILED);
+    }
+
+    private void resetNode(Node node) {
+        node.setState(NodeExecutionState.WAITING);
+        NodeController.getGUI(node).resetTokens();
+    }
+
+    /**
+     * Make preceding nodes done. This helps the monitoring GUI when a user subscribes from the middle of the workflow
+     * execution.
+     * 
+     * @param node
+     */
+    private void finishPredecessorNodes(Node node) {
+        for (Port inputPort : node.getInputPorts()) {
+            for (Edge edge : inputPort.getEdges()) {
+                Port fromPort = edge.getFromPort();
+                if (!(fromPort instanceof EPRPort)) {
+                    Node fromNode = fromPort.getNode();
+                    finishNode(fromNode);
+                    finishPredecessorNodes(fromNode);
+                }
+            }
+        }
+        Port controlInPort = node.getControlInPort();
+        if (controlInPort != null) {
+            for (Node fromNode : controlInPort.getFromNodes()) {
+                finishNode(fromNode);
+                finishPredecessorNodes(fromNode);
+            }
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.wsmg.client.NotificationHandler#handleNotification(java.lang.String)
+     */
+    public void handleNotification(SOAPEnvelope message) {
+        String soapBody = message.getBody().toString();
+        this.handleNotification(soapBody);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorMessageReceiverInOut.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorMessageReceiverInOut.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorMessageReceiverInOut.java
new file mode 100644
index 0000000..b5623e9
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorMessageReceiverInOut.java
@@ -0,0 +1,262 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpretor;
+
+import org.apache.airavata.client.stub.interpretor.NameValue;
+import org.apache.airavata.client.stub.interpretor.WorkflowInterpretorStub;
+
+
+public class WorkflowInterpretorMessageReceiverInOut extends org.apache.axis2.receivers.AbstractInOutMessageReceiver{
+    public static final String MYPROXY_USER = "myproxy.user";
+    public static final String MYPROXY_PASS = "myproxy.password";
+     public void invokeBusinessLogic(org.apache.axis2.context.MessageContext msgContext, org.apache.axis2.context.MessageContext newMsgContext)
+        throws org.apache.axis2.AxisFault{
+
+        try {
+
+        // get the implementation class for the Web Service
+        Object obj = getTheImplementationObject(msgContext);
+
+        WorkflowInterpretorSkeleton skel = (WorkflowInterpretorSkeleton)obj;
+        //Out Envelop
+        org.apache.axiom.soap.SOAPEnvelope envelope = null;
+        //Find the axisOperation that has been set by the Dispatch phase.
+        org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation();
+        if (op == null) {
+        throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
+        }
+
+        java.lang.String methodName;
+        if((op.getName() != null) && ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName().getLocalPart())) != null)){
+
+
+
+            if("launchWorkflow".equals(methodName)){
+
+	                        WorkflowInterpretorStub.LaunchWorkflow wrappedParam =
+                                                             (WorkflowInterpretorStub.LaunchWorkflow)fromOM(
+                                    msgContext.getEnvelope().getBody().getFirstElement(),
+                                    WorkflowInterpretorStub.LaunchWorkflow.class,
+                                    getEnvelopeNamespaces(msgContext.getEnvelope()));
+
+
+                WorkflowInterpretorStub.LaunchWorkflowResponse launchWorkflowResponse = wrapLaunchWorkflowResponse_return(
+
+
+                        skel.launchWorkflow(
+
+                                getWorkflowAsString(wrappedParam)
+                                ,
+                                getTopic(wrappedParam)
+                                ,
+                                getInputs(wrappedParam)
+                        )
+
+                );
+
+                envelope = toEnvelope(getSOAPFactory(msgContext), launchWorkflowResponse, false);
+
+            } else {
+              throw new java.lang.RuntimeException("method not found");
+            }
+
+
+        newMsgContext.setEnvelope(envelope);
+        }
+        }
+        catch (java.lang.Exception e) {
+        throw org.apache.axis2.AxisFault.makeFault(e);
+        }
+        }
+
+        //
+            private  org.apache.axiom.om.OMElement  toOM(WorkflowInterpretorStub.LaunchWorkflow param, boolean optimizeContent)
+            throws org.apache.axis2.AxisFault {
+
+
+                        try{
+                             return param.getOMElement(WorkflowInterpretorStub.LaunchWorkflow.MY_QNAME,
+                                          org.apache.axiom.om.OMAbstractFactory.getOMFactory());
+                        } catch(org.apache.axis2.databinding.ADBException e){
+                            throw org.apache.axis2.AxisFault.makeFault(e);
+                        }
+
+
+            }
+
+            private  org.apache.axiom.om.OMElement  toOM(WorkflowInterpretorStub.LaunchWorkflowResponse param, boolean optimizeContent)
+            throws org.apache.axis2.AxisFault {
+
+
+                        try{
+                             return param.getOMElement(WorkflowInterpretorStub.LaunchWorkflowResponse.MY_QNAME,
+                                          org.apache.axiom.om.OMAbstractFactory.getOMFactory());
+                        } catch(org.apache.axis2.databinding.ADBException e){
+                            throw org.apache.axis2.AxisFault.makeFault(e);
+                        }
+
+
+            }
+
+                    private  org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, WorkflowInterpretorStub.LaunchWorkflowResponse param, boolean optimizeContent)
+                        throws org.apache.axis2.AxisFault{
+                      try{
+                          org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
+
+                                    emptyEnvelope.getBody().addChild(param.getOMElement(WorkflowInterpretorStub.LaunchWorkflowResponse.MY_QNAME,factory));
+
+
+                         return emptyEnvelope;
+                    } catch(org.apache.axis2.databinding.ADBException e){
+                        throw org.apache.axis2.AxisFault.makeFault(e);
+                    }
+                    }
+
+
+                        private java.lang.String getWorkflowAsString(
+                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
+
+                                return wrappedType.getWorkflowAsString();
+
+                        }
+
+
+                        private java.lang.String getTopic(
+                       WorkflowInterpretorStub.LaunchWorkflow wrappedType){
+
+                                return wrappedType.getTopic();
+
+                        }
+
+
+                        private java.lang.String getPassword(
+                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
+
+                                return wrappedType.getPassword();
+
+                        }
+
+
+                        private java.lang.String getUsername(
+                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
+
+                                return wrappedType.getUsername();
+
+                        }
+
+
+                        private NameValue[] getInputs(
+                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
+
+                                return wrappedType.getInputs();
+
+                        }
+
+
+                        private NameValue[] getConfigurations(
+                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
+
+                                return wrappedType.getConfigurations();
+
+                        }
+
+
+
+                        private WorkflowInterpretorStub.LaunchWorkflowResponse wrapLaunchWorkflowResponse_return(
+                        java.lang.String param){
+                            WorkflowInterpretorStub.LaunchWorkflowResponse wrappedElement = new WorkflowInterpretorStub.LaunchWorkflowResponse();
+
+                            wrappedElement.set_return(param);
+
+                            return wrappedElement;
+                        }
+
+                         private WorkflowInterpretorStub.LaunchWorkflowResponse wraplaunchWorkflow(){
+                                WorkflowInterpretorStub.LaunchWorkflowResponse wrappedElement = new WorkflowInterpretorStub.LaunchWorkflowResponse();
+                                return wrappedElement;
+                         }
+
+
+
+        /**
+        *  get the default envelope
+        */
+        private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){
+        return factory.getDefaultEnvelope();
+        }
+
+
+        private  java.lang.Object fromOM(
+        org.apache.axiom.om.OMElement param,
+        java.lang.Class type,
+        java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
+
+        try {
+
+                if (WorkflowInterpretorStub.LaunchWorkflow.class.equals(type)){
+
+                           return WorkflowInterpretorStub.LaunchWorkflow.Factory.parse(param.getXMLStreamReaderWithoutCaching());
+
+
+                }
+
+                if (WorkflowInterpretorStub.LaunchWorkflowResponse.class.equals(type)){
+
+                           return WorkflowInterpretorStub.LaunchWorkflowResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching());
+
+
+                }
+
+        } catch (java.lang.Exception e) {
+        throw org.apache.axis2.AxisFault.makeFault(e);
+        }
+           return null;
+        }
+
+
+
+
+
+        /**
+        *  A utility method that copies the namepaces from the SOAPEnvelope
+        */
+        private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){
+        java.util.Map returnMap = new java.util.HashMap();
+        java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces();
+        while (namespaceIterator.hasNext()) {
+        org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next();
+        returnMap.put(ns.getPrefix(),ns.getNamespaceURI());
+        }
+        return returnMap;
+        }
+
+        private org.apache.axis2.AxisFault createAxisFault(java.lang.Exception e) {
+        org.apache.axis2.AxisFault f;
+        Throwable cause = e.getCause();
+        if (cause != null) {
+            f = new org.apache.axis2.AxisFault(e.getMessage(), cause);
+        } else {
+            f = new org.apache.axis2.AxisFault(e.getMessage());
+        }
+
+        return f;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
new file mode 100644
index 0000000..5f9420c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
@@ -0,0 +1,572 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException;
+import org.apache.airavata.client.stub.interpretor.NameValue;
+import org.apache.airavata.client.tools.PeriodicExecutorThread;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.ServiceUtils;
+import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.schemas.gfac.GlobusHostType;
+import org.apache.airavata.schemas.gfac.GsisshHostType;
+import org.apache.airavata.schemas.gfac.SSHHostType;
+import org.apache.airavata.schemas.wec.ContextHeaderDocument;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.ode.ODEClient;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.concurrent.PredicatedTaskRunner;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.ServiceLifeCycle;
+import org.apache.xmlbeans.XmlException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.*;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+/**
+ * WorkflowInterpretorSkeleton java skeleton for the axisService
+ */
+public class WorkflowInterpretorSkeleton implements ServiceLifeCycle {
+    private static final Logger log = LoggerFactory.getLogger(WorkflowInterpretorSkeleton.class);
+
+//	public static final String PROXYSERVER = "myproxy.url";
+	public static final String MSGBOX = "msgbox";
+	public static final String GFAC = "gfac";
+	public static final String BROKER = "broker";
+    public static final String MYPROXY_USER = "myproxy.user";
+    public static final String MYPROXY_PASS = "myproxy.pass";
+    public static final String MYPROXY_SERVER = "myproxy.server";
+    public static final String MYPROXY_LIFETIME = "myproxy.life";
+    public static final String TRUSTED_CERT_LOCATION = "trusted.cert.location";
+
+    public static boolean provenance = false;
+    public static final String PROVENANCE = "provenance";
+    public static  String systemUserName = "";
+    public static  String systemUserPW = "";
+    public static boolean runInThread = false;
+    public static final String RUN_IN_THREAD = "runInThread";
+    public static  Boolean gfacEmbeddedMode = true;
+    private static PredicatedTaskRunner runner = null;
+//    public static  JCRComponentRegistry jcrComponentRegistry = null;
+    private static AiravataAPI airavataAPI=null;
+    public static int provenanceWriterThreadPoolSize = 1;
+    public static final String PROVENANCE_WRITER_THREAD_POOL_SIZE = "provenanceWriterThreadPoolSize";
+    public static final int JCR_AVAIALABILITY_WAIT_INTERVAL = 1000 * 10;
+    public static final String GFAC_EMBEDDED = "gfac.embedded";
+    public static  ConfigurationContext configurationContext;
+    public static final String SERVICE_NAME="WorkflowInterpretor";
+    public static boolean notInterrupted = true;
+    public Map<String, WorkflowInterpreterConfiguration> workflowConfigurations=new HashMap<String, WorkflowInterpreterConfiguration>();
+    private WorkflowInterpreterInteractor interactor;
+    private String gateway;
+
+	protected static final String SERVICE_URL = "interpreter_service_url";
+
+	protected static final String JCR_REG = "jcr_registry";
+
+	protected WIServiceThread thread;
+
+    private AiravataAPI getAiravataAPI(){
+        if (airavataAPI==null) {
+			try {
+				systemUserName = ServerSettings.getSystemUser();
+				systemUserPW = ServerSettings.getSystemUserPassword();
+				gateway = ServerSettings.getSystemUserGateway();
+				airavataAPI = AiravataAPIFactory.getAPI(gateway, systemUserName);
+			} catch (ApplicationSettingsException e) {
+				log.error("Unable to read the properties file", e);
+			} catch (AiravataAPIInvocationException e) {
+				log.error("Unable to create Airavata API", e);
+			}
+		}
+		return airavataAPI;
+    }
+
+    private WorkflowInterpreterInteractor getInteractor(){
+    	if (interactor==null){
+        	interactor=new SSWorkflowInterpreterInteractorImpl();
+    	}
+    	return interactor;
+    }
+
+    public void startUp(final ConfigurationContext configctx, AxisService service) {
+    	AiravataUtils.setExecutionAsServer();
+    	new Thread(){
+			@Override
+    		public void run() {
+    			try {
+					Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
+				} catch (InterruptedException e1) {
+					e1.printStackTrace();
+				}
+		        try {
+                    // Airavata deployer have to configure these properties,but if user send them alone the incoming message
+                    // We are overwriting those values only for that particular request
+		            configctx.setProperty(MYPROXY_PASS, ServerSettings.getSetting(MYPROXY_PASS));
+		            configctx.setProperty(MYPROXY_USER, ServerSettings.getSetting(MYPROXY_USER));
+		            configctx.setProperty(MYPROXY_LIFETIME,ServerSettings.getSetting(MYPROXY_LIFETIME));
+                    configctx.setProperty(TRUSTED_CERT_LOCATION,ServerSettings.getSetting(TRUSTED_CERT_LOCATION));
+                    configctx.setProperty(MYPROXY_SERVER,ServerSettings.getSetting(MYPROXY_SERVER));
+		            provenanceWriterThreadPoolSize = Integer.parseInt((String) ServerSettings.getSetting(PROVENANCE_WRITER_THREAD_POOL_SIZE));
+		            if("true".equals(ServerSettings.getSetting(PROVENANCE))){
+		                provenance = true;
+		                runner = new PredicatedTaskRunner(provenanceWriterThreadPoolSize);
+		                try {
+                            List<HostDescription> hostList = getDefinedHostDescriptions();
+                            for(HostDescription host:hostList){
+                                // This will avoid the changes user is doing to one of the predefined Hosts during a restart of the system
+                                AiravataAPI registry = getAiravataAPI();
+								if(!registry.getApplicationManager().isHostDescriptorExists(host.getType().getHostName())){
+                                    log.debug("Saving the predefined Host: " + host.getType().getHostName());
+                                    registry.getApplicationManager().addHostDescription(host);
+                                }
+                            }
+		                } catch (DescriptorAlreadyExistsException e) {
+                            e.printStackTrace();
+                        } catch (AiravataAPIInvocationException e) {
+		                    e.printStackTrace();
+
+                        }
+                    }else{
+		                provenance = false;
+		            }
+		            if("true".equals(ServerSettings.getSetting(RUN_IN_THREAD))){
+		                runInThread = true;
+		            }else{
+		                runInThread = false;
+		            }
+
+                     if("true".equals(ServerSettings.getSetting(GFAC_EMBEDDED))){
+		                gfacEmbeddedMode = true;
+		            }else{
+		                gfacEmbeddedMode = false;
+		            }
+
+                     //save the interpreter service url in context
+                    String localAddress = ServiceUtils.generateServiceURLFromConfigurationContext(configctx,SERVICE_NAME);
+ 					configctx.setProperty(SERVICE_URL,new URI(localAddress));
+ 					configctx.setProperty(JCR_REG,getAiravataAPI());
+ 					/*
+					 * Heart beat message to registry
+					 */
+					thread = new WIServiceThread(getAiravataAPI(), configctx);
+					thread.start();
+                } catch (IOException e) {
+                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                } catch (URISyntaxException e) {
+                    e.printStackTrace();
+                } catch (ApplicationSettingsException e) {
+                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                }
+                WorkflowInterpretorSkeleton.configurationContext = configctx;
+    		}
+    	}.start();
+
+    }
+
+    public void suspendWorkflow(String experimentId)throws Exception{
+    	if (workflowConfigurations.containsKey(experimentId)){
+    		if (getInteractor().isExecutionPaused(workflowConfigurations.get(experimentId))){
+    			throw new Exception("Experiment '"+experimentId+"' is already paused!!!");
+    		}else{
+    			log.info("Suspending workflow execution "+experimentId+"...");
+    			getInteractor().pauseExecution(workflowConfigurations.get(experimentId));
+    		}
+    	}else{
+    		throw new Exception("Invalid Experiment id: Experiment "+experimentId+" not running");
+    	}
+    }
+
+    public void resumeWorkflow(String experimentId)throws Exception{
+    	if (workflowConfigurations.containsKey(experimentId)){
+    		if (getInteractor().isExecutionPaused(workflowConfigurations.get(experimentId)) || workflowConfigurations.get(experimentId).getWorkflow().getExecutionState()==WorkflowExecutionState.STOPPED){
+    			log.info("Resuming workflow execution "+experimentId+"...");
+    			getInteractor().resumeExecution(workflowConfigurations.get(experimentId));
+
+    		}else{
+    			throw new Exception("Experiment '"+experimentId+"' is not suspended!!!");
+    		}
+    	}else{
+    		//TODO chk to see if the experiment is present in registry if so reload it and resume execution else error
+    		throw new Exception("Invalid Experiment id: Experiment "+experimentId+" not running");
+    	}
+    }
+
+    public void haltWorkflow(String experimentId)throws Exception{
+    	if (workflowConfigurations.containsKey(experimentId)){
+			log.info("Terminating workflow execution "+experimentId+"...");
+			getInteractor().terminateExecution(workflowConfigurations.get(experimentId));
+    	}else{
+    		throw new Exception("Invalid Experiment id: Experiment "+experimentId+" not running");
+    	}
+    }
+
+    /**
+     * @param workflowAsString
+     * @param topic
+     * @param inputs
+     * @return
+     * @throws XMLStreamException
+     */
+	public java.lang.String launchWorkflow(java.lang.String workflowAsString, java.lang.String topic, NameValue[] inputs) throws XMLStreamException {
+        OMElement workflowContext = getWorkflowContextHeader();
+        if(workflowContext == null){
+            workflowContext = AXIOMUtil.stringToOM("<wor:context-header xmlns:wor=\"http://airavata.apache.org/schemas/wec/2012/05\">\n" +
+                "    <wor:soa-service-eprs>\n" +
+                "        <wor:gfac-url></wor:gfac-url>\n" +
+                "        <wor:registry-url></wor:registry-url>\n" +
+                "    </wor:soa-service-eprs>\n" +
+                "    <wor:workflow-monitoring-context>\n" +
+                "        <wor:experiment-id></wor:experiment-id>\n" +
+                "        <wor:workflow-instance-id xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\" />\n" +
+                "        <wor:event-publish-epr></wor:event-publish-epr>\n" +
+                "        <wor:msg-box-epr></wor:msg-box-epr>\n" +
+                "    </wor:workflow-monitoring-context>\n" +
+                "    <wor:workflow-scheduling-context />\n" +
+                "    <wor:security-context />\n" +
+                "</wor:context-header>");
+        }
+        Map<String, String> configuration = new HashMap<String, String>();
+        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = parseContextHeader(workflowContext, configuration);
+        String user = workflowContextHeaderBuilder.getSubmissionUser();
+
+        String s = null;
+        try {
+             s = setupAndLaunch(workflowAsString, topic, ServerSettings.getSystemUserGateway(),
+                    user,inputs, configuration, runInThread, workflowContextHeaderBuilder);
+        } catch (AiravataAPIInvocationException e) {
+            log.error(e.getMessage());
+        } catch (ApplicationSettingsException e) {
+            log.error(e.getMessage());
+        }
+        return s;
+    }
+
+    private OMElement getWorkflowContextHeader() {
+        MessageContext currentMessageContext = MessageContext.getCurrentMessageContext();
+        SOAPHeader header = currentMessageContext.getEnvelope().getHeader();
+        Iterator<?> childrenWithName = header.getChildrenWithName(new QName("http://airavata.apache.org/schemas/wec/2012/05", "context-header"));
+        if (childrenWithName.hasNext()) {
+            return (OMElement) childrenWithName.next();
+        } else {
+            return null;
+        }
+    }
+
+    private WorkflowContextHeaderBuilder parseContextHeader(OMElement workflowContext, Map<String, String> configuration) throws XMLStreamException {
+        ContextHeaderDocument parse = null;
+        try {
+            parse = ContextHeaderDocument.Factory.parse(workflowContext.toStringWithConsume());
+            String msgBox = parse.getContextHeader().getWorkflowMonitoringContext().getMsgBoxEpr();
+            if(msgBox == null || "".equals(msgBox)){
+                msgBox = getAiravataAPI().getAiravataManager().getMessageBoxServiceURL().toASCIIString();
+            }
+            String msgBroker = parse.getContextHeader().getWorkflowMonitoringContext().getEventPublishEpr();
+            if(msgBroker == null || "".equals(msgBroker)){
+                msgBroker = getAiravataAPI().getAiravataManager().getEventingServiceURL().toASCIIString();
+            }
+            String gfac =  parse.getContextHeader().getSoaServiceEprs().getGfacUrl();
+//            if(gfac == null || "".equals(gfac)){
+//                gfac = getAiravataAPI().getAiravataManager().getGFaCURLs().get(0).toString();
+//            }
+            configuration.put(BROKER, msgBroker);
+            configuration.put(GFAC, gfac);
+            configuration.put(MSGBOX, msgBox);
+        } catch (XmlException e) {
+            log.error(e.getMessage());
+        } catch (AiravataAPIInvocationException e) {
+            log.error(e.getMessage());
+        }
+    	String submissionUser = workflowContext.getAttributeValue(new QName(workflowContext.getNamespace().getNamespaceURI(), "submissionUser"));
+        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = new WorkflowContextHeaderBuilder(parse.getContextHeader());
+        workflowContextHeaderBuilder.setSubmissionUser(submissionUser);
+		return workflowContextHeaderBuilder;
+    }
+
+    public String setupAndLaunch(String workflowAsString, String experimentId, String gatewayId, String username,
+            Map<String,String> inputs,boolean inNewThread,WorkflowContextHeaderBuilder builder) throws AiravataAPIInvocationException{
+    	List<NameValue> inputData=new ArrayList<NameValue>();
+    	for (String inputName : inputs.keySet()) {
+			NameValue input = new NameValue();
+			input.setName(inputName);
+			input.setValue(inputs.get(inputName));
+			inputData.add(input);
+		}
+    	Map<String, String> configuration = new HashMap<String, String>();
+    	configuration.put(BROKER, getAiravataAPI().getAiravataManager().getEventingServiceURL().toASCIIString());
+        configuration.put(MSGBOX, getAiravataAPI().getAiravataManager().getMessageBoxServiceURL().toASCIIString());
+
+    	return setupAndLaunch(workflowAsString, experimentId, gatewayId, username, inputData.toArray(new NameValue[]{}), configuration, inNewThread, builder);
+    }
+
+    private String setupAndLaunch(String workflowAsString, String topic, String gatewayId, String username,
+                                  NameValue[] inputs,Map<String,String>configurations,boolean inNewThread,
+                                  WorkflowContextHeaderBuilder builder) throws AiravataAPIInvocationException{
+        log.debug("Launch is called for topic:"+topic);
+
+        Workflow workflow = null;
+        try {
+            workflow = new Workflow(workflowAsString);
+            log.debug("Workflow Object created");
+        } catch (GraphException e1) {
+            e1.printStackTrace();
+        } catch (ComponentException e1) {
+            e1.printStackTrace();
+        }
+        log.debug("Setting Input values");
+        List<InputNode> inputNodes = new ODEClient().getInputNodes(workflow);
+        for (InputNode inputNode : inputNodes) {
+            for (NameValue input : inputs) {
+                if (inputNode.getID().equals(input.getName())) {
+                    inputNode.setDefaultValue(input.getValue());
+                    break;
+                }
+            }
+            if (inputNode.getDefaultValue() == null) {
+                throw new WorkflowRuntimeException("Could not find a input value for component with name :" + inputNode.getName());
+            }
+
+        }
+        log.debug("Input all set");
+
+        XBayaConfiguration conf = null;
+        try {
+            conf = getConfiguration(configurations);
+            conf.setTopic(topic);
+            conf.setRunWithCrossProduct(true);
+        } catch (URISyntaxException e1) {
+            throw new WorkflowRuntimeException(e1);
+        }
+        WorkflowInterpretorEventListener listener = null;
+        WorkflowInterpreter interpreter = null;
+        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(gatewayId, username);
+        WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, topic, conf.getMessageBoxURL(), conf.getBrokerURL(), airavataAPI, conf, null, null);
+        workflowInterpreterConfiguration.setGfacEmbeddedMode(gfacEmbeddedMode);
+        workflowInterpreterConfiguration.setActOnProvenance(provenance);
+
+        if (builder.getSecurityContext().getAmazonWebservices() != null) {
+            workflowInterpreterConfiguration.setAwsSecretKey(builder.getSecurityContext().getAmazonWebservices().getSecretAccessKey());
+            workflowInterpreterConfiguration.setAwsAccessKey(builder.getSecurityContext().getAmazonWebservices().getAccessKeyId());
+        }
+        // WorkflowInterpreter object should create prior creation of Listener, because listener needs the threadlocal variable
+        interpreter = new WorkflowInterpreter(workflowInterpreterConfiguration, getInteractor());
+        listener = new WorkflowInterpretorEventListener(workflow, conf);
+        try {
+            log.debug("start listener set");
+            listener.start();
+        } catch (MonitorException e1) {
+            e1.printStackTrace();
+        }
+
+        WorkflowContextHeaderBuilder.setCurrentContextHeader(builder.getContextHeader());
+
+        final WorkflowInterpretorEventListener finalListener = listener;
+        conf.setAiravataAPI(getAiravataAPI());
+
+        final WorkflowInterpreter finalInterpreter = interpreter;
+//        interpreter.setActOnProvenance(provenance);
+        interpreter.setProvenanceWriter(runner);
+        final String experimentId = topic;
+        log.debug("Created the interpreter");
+        if(inNewThread){
+            runInThread(finalInterpreter,finalListener,experimentId,builder);
+        }else{
+            executeWorkflow(finalInterpreter, finalListener, experimentId);
+        }
+        log.info("Experiment launched :" + topic);
+        return topic;
+    }
+
+    private void runInThread(final WorkflowInterpreter interpreter,final WorkflowInterpretorEventListener listener,final String experimentId,final WorkflowContextHeaderBuilder builder) {
+        new Thread(new Runnable() {
+
+            public void run() {
+                WorkflowContextHeaderBuilder.setCurrentContextHeader(builder.getContextHeader());
+                executeWorkflow(interpreter, listener, experimentId);
+            }
+        }).start();
+    }
+
+    private void executeWorkflow(WorkflowInterpreter interpreter, WorkflowInterpretorEventListener listener,String experimentId) {
+        try {
+        	workflowConfigurations.put(experimentId,interpreter.getConfig());
+            interpreter.scheduleDynamically();
+            log.debug("Interpreter invoked...");
+        } catch (Exception e) {
+            throw new WorkflowRuntimeException(e);
+        } finally {
+        	if (workflowConfigurations.containsKey(experimentId)){
+        		workflowConfigurations.remove(experimentId);
+        	}
+            /*
+             * stop listener no matter what happens
+             */
+//            try {
+//                if(listener != null)
+//                listener.stop();
+//            } catch (MonitorException e) {
+//                e.printStackTrace();
+//            }
+        }
+    }
+
+    public  XBayaConfiguration getConfiguration(Map<String,String> vals) throws URISyntaxException {
+		XBayaConfiguration configuration = new XBayaConfiguration();
+		configuration.setBrokerURL(new URI(findValue(vals, BROKER, XBayaConstants.DEFAULT_BROKER_URL.toString())));
+		configuration.setGFacURL(new URI(findValue(vals, GFAC, XBayaConstants.DEFAULT_GFAC_URL.toString())));
+		configuration.setMessageBoxURL(new URI(findValue(vals, MSGBOX, XBayaConstants.DEFAULT_MESSAGE_BOX_URL.toString())));
+		configuration.setMyProxyLifetime(XBayaConstants.DEFAULT_MYPROXY_LIFTTIME);
+		configuration.setMyProxyPort(XBayaConstants.DEFAULT_MYPROXY_PORT);
+        //This null check will fix some test failures
+        if (WorkflowInterpretorSkeleton.configurationContext != null) {
+            configuration.setMyProxyServer(findValue(vals, MYPROXY_SERVER, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(MYPROXY_SERVER)));
+            configuration.setMyProxyPassphrase(findValue(vals, MYPROXY_PASS, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(MYPROXY_PASS)));
+            configuration.setMyProxyUsername(findValue(vals, MYPROXY_USER, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(MYPROXY_USER)));
+            configuration.setTrustedCertLocation(findValue(vals, TRUSTED_CERT_LOCATION, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(TRUSTED_CERT_LOCATION)));
+            configuration.setTrustedCertLocation(findValue(vals, MYPROXY_LIFETIME, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(MYPROXY_LIFETIME)));
+        }
+		return configuration;
+	}
+
+	private String findValue(Map<String,String> vals, String key, String defaultVal) {
+		if(vals.get(key) != null) {
+            return vals.get(key);
+        }
+		return defaultVal;
+	}
+
+    public void shutDown(ConfigurationContext configctx, AxisService service) {
+        URI gfacURL = (URI) configctx.getProperty(SERVICE_URL);
+        if (getAiravataAPI() != null && thread != null) {
+            AiravataAPI registry = getAiravataAPI();
+            try {
+                registry.getAiravataManager().removeWorkflowInterpreterURI(gfacURL);
+            } catch (AiravataAPIInvocationException e) {
+                e.printStackTrace();
+            }
+            thread.interrupt();
+            try {
+                thread.join();
+            } catch (InterruptedException e) {
+                log.warn("GFacURL update thread is interrupted");
+            }
+        }
+        if (runner != null) {
+            runner.shutDown();
+        }
+
+        notInterrupted = false;
+    }
+
+    private List<HostDescription> getDefinedHostDescriptions() {
+        URL url = this.getClass().getClassLoader().getResource("host.xml");
+        ArrayList<HostDescription> hostDescriptions = new ArrayList<HostDescription>();
+        XMLStreamReader reader = null;
+        try {
+            if (url != null) {
+                reader = XMLInputFactory.newInstance().createXMLStreamReader(url.openStream());
+            } else {
+                throw new RuntimeException("Error retrieving host.xml file. Should reside in " +
+                        "$SERVER_HOME/webapps/axis2/WEB-INF/classes/host.xml");
+            }
+        } catch (XMLStreamException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        } catch (IOException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+        StAXOMBuilder builder = new StAXOMBuilder(reader);
+        OMElement documentElement = builder.getDocumentElement();
+        Iterator<?> server = documentElement.getChildrenWithName(new QName("server"));
+        while (server.hasNext()) {
+            HostDescription hostDescription = new HostDescription();
+            OMElement next = (OMElement) server.next();
+            if (next.getFirstChildWithName(new QName("gram.endpoint")) != null &&
+                    "globus".equals(next.getFirstChildWithName(new QName("type")).getText())) {
+                hostDescription.getType().changeType(GlobusHostType.type);
+                ((GlobusHostType) hostDescription.getType()).addGlobusGateKeeperEndPoint(next.getFirstChildWithName(new QName("gram.endpoint")).getText());
+                ((GlobusHostType) hostDescription.getType()).addGridFTPEndPoint(next.getFirstChildWithName(new QName("gridftp.endpoint")).getText());
+            } else if("ssh".equals(next.getFirstChildWithName(new QName("type")).getText())) {
+                hostDescription.getType().changeType(SSHHostType.type);
+                if(next.getFirstChildWithName(new QName("hpc.resource")) != null){
+                    if("true".equals(next.getFirstChildWithName(new QName("gram.endpoint")))){
+                        ((SSHHostType) hostDescription.getType()).setHpcResource(true);
+                    }
+                }
+                ((SSHHostType) hostDescription.getType()).setHpcResource(false);
+            } else if("gsissh".equals(next.getFirstChildWithName(new QName("type")).getText())) {
+                hostDescription.getType().changeType(GsisshHostType.type);
+            }
+            (hostDescription.getType()).setHostName(next.getFirstChildWithName(new QName("name")).getText());
+            (hostDescription.getType()).setHostAddress(next.getFirstChildWithName(new QName("host")).getText());
+            hostDescriptions.add(hostDescription);
+        }
+        return hostDescriptions;
+    }
+
+    public static final int URL_UPDATE_INTERVAL = 1000 * 60 * 60 * 3;
+
+    class WIServiceThread extends PeriodicExecutorThread {
+        private ConfigurationContext context = null;
+
+        WIServiceThread(AiravataAPI registry, ConfigurationContext context) {
+            super(registry);
+            this.context = context;
+        }
+
+        @Override
+        protected void updateRegistry(AiravataAPI registry) throws Exception {
+            URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
+            registry.getAiravataManager().addWorkflowInterpreterURI(localAddress);
+            log.debug("Updated Workflow Interpreter service URL in to Repository");
+
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java
new file mode 100644
index 0000000..defd8c2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java
@@ -0,0 +1,118 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.invoker;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.wsdl.WsdlDefinitions;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
+import xsul.xwsif_runtime_async_http.XsulSoapHttpWsaResponsesCorrelator;
+
+public class AsynchronousInvoker extends SimpleInvoker {
+
+    private static final Logger logger = LoggerFactory.getLogger(AsynchronousInvoker.class);
+
+    private String messageBoxURL;
+
+    /**
+     * Constructs an AsynchronousInvoker.
+     * 
+     * @param definitions
+     */
+    public AsynchronousInvoker(WsdlDefinitions definitions) {
+        this(definitions, null);
+    }
+
+    /**
+     * Constructs an AsynchronousInvoker.
+     * 
+     * @param definitions
+     * @param messageBoxURL
+     */
+    public AsynchronousInvoker(WsdlDefinitions definitions, String messageBoxURL) {
+        super(definitions);
+        this.messageBoxURL = messageBoxURL;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.SimpleInvoker#setup()
+     */
+    @Override
+    public void setup() throws WorkflowException {
+        super.setup();
+        /* Set the output message to null to set teh output from async Listener */
+        WSIFAsyncResponsesCorrelator correlator;
+        if (this.messageBoxURL == null || this.messageBoxURL.length() == 0) {
+            correlator = new XsulSoapHttpWsaResponsesCorrelator();
+            String serverLoc = ((XsulSoapHttpWsaResponsesCorrelator) correlator).getServerLocation();
+            logger.debug("using async correlator at " + serverLoc);
+        } else {
+            correlator = new MsgBoxWsaResponsesCorrelator(this.messageBoxURL,this);
+            logger.debug("using message box at " + this.messageBoxURL);
+        }
+        this.client.useAsyncMessaging(correlator);
+    }
+
+     public boolean invoke() throws WorkflowException {
+         final WSIFOperation  operation = this.getOperation();
+         final WSIFMessage inputMessage = this.getInputMessage();
+         this.setOutputMessage(null);
+        try {
+              new Thread() {
+                @Override
+                public void run() {
+                    try {
+                        operation.executeInputOnlyOperation(inputMessage);
+                    } catch (Exception e) {
+                        // Ignore the error.
+                        logger.error("Error invoking GFac Service",e);
+                    }
+                }
+            }.start();
+
+            while(this.getOutputMessage() == null){
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e) {
+                    logger.error("Error Waiting for the response from backend");
+                }
+            }
+            // Gfac operation failed, so xbaya side throws this exception
+            if("ErrorResponse".equals(XMLUtil.stringToXmlElement3(this.getOutputMessage().toString()).getName())){
+                // Here we do not throw an exception, because if we throw an exception Interpreter will catch it and do the unsubscription,
+                // which is not needed because if there's an gfac side error gfac will send a failure and unsubscription will be done in monitoring
+                // so if we send an exception we are attempting to do two unsubscriptions which will cause a one unsubscription to fail.
+                return false;
+            }
+
+            return true;
+        } catch (RuntimeException e) {
+            String message = "Error in invoking a service.";
+            throw new WorkflowException(message, e);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java
new file mode 100644
index 0000000..5020ef4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java
@@ -0,0 +1,167 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.invoker;
+
+import java.lang.reflect.Method;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+
+import xsul.wsif.WSIFMessage;
+import xsul.xwsif_runtime.WSIFClient;
+
+public class DynamicInvoker implements Invoker {
+
+    private URL jarUrl;
+
+    private String className;
+
+    private String operationName;
+
+    private Object[] inputs;
+
+    private Object result;
+
+    /**
+     * Constructs a DynamicInvoker.
+     * 
+     * @param className
+     * @param jarUrl
+     * @param operationName
+     */
+    public DynamicInvoker(String className, URL jarUrl, String operationName, Object[] inputs) {
+        this.className = className;
+        this.jarUrl = jarUrl;
+        this.operationName = operationName;
+        this.inputs = inputs;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#getOutput(java.lang.String)
+     */
+    public Object getOutput(String name) throws WorkflowException {
+        waitToFinish();
+        return result;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#invoke()
+     */
+    public boolean invoke() throws WorkflowException {
+        try {
+            Class<?> targetClass = Class.forName(this.className);
+            Object obj = targetClass.newInstance();
+
+            Method[] methods = targetClass.getDeclaredMethods();
+            Method targetMethod = null;
+            for (Method method : methods) {
+                if (this.operationName.equals(method.getName())) {
+                    targetMethod = method;
+                    break;
+                }
+            }
+            if (targetMethod == null) {
+                throw new WorkflowException("Could not find the method using reflection: " + this.operationName);
+            }
+
+            targetMethod.setAccessible(true);
+            this.result = targetMethod.invoke(obj, inputs);
+
+        } catch (Exception e) {
+            throw new WorkflowException(e);
+        }
+        return true;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setInput(java.lang.String, java.lang.Object)
+     */
+    public void setInput(String name, Object value) throws WorkflowException {
+
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setOperation(java.lang.String)
+     */
+    public void setOperation(String operationName) throws WorkflowException {
+        this.operationName = operationName;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setup()
+     */
+    public void setup() throws WorkflowException {
+        Class[] parameters = new Class[] { URL.class };
+        URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader();
+        Class sysclass = URLClassLoader.class;
+
+        try {
+            Method method = sysclass.getDeclaredMethod("addURL", parameters);
+            method.setAccessible(true);
+            method.invoke(sysloader, new Object[] { this.jarUrl });
+        } catch (Throwable t) {
+            t.printStackTrace();
+            throw new WorkflowException("Error, could not add URL to system classloader");
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#waitToFinish()
+     */
+    public void waitToFinish() throws WorkflowException {
+        while (this.result == null) {
+            try {
+                Thread.sleep(200);
+            } catch (InterruptedException e) {
+                // TODO Auto-generated catch block
+                e.printStackTrace();
+            }
+        }
+
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#getOutputs()
+     */
+    public WSIFMessage getOutputs() throws WorkflowException {
+        waitToFinish();
+        return (WSIFMessage) this.result;
+
+    }
+
+    @Override
+    public WSIFClient getClient() {
+        return null;
+    }
+
+    @Override
+    public WSIFMessage getInputs() throws WorkflowException {
+        return null;
+    }
+
+    @Override
+    public WSIFMessage getFault() throws WorkflowException {
+        return null;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java
new file mode 100644
index 0000000..cc7fc2c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java
@@ -0,0 +1,86 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.invoker;
+
+import java.io.File;
+import java.net.URI;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.xbaya.invoker.factory.InvokerFactory;
+
+import xsul.wsdl.WsdlDefinitions;
+import xsul.wsdl.WsdlResolver;
+
+public class DynamicServiceCreator {
+
+    private String dynamicFactoryWSDLLocation;
+
+    private static String classStr = "package org.apache.airavata.xbaya;" +
+
+    "public class DefaultClassName{" +
+
+    "public int operationName(String[] stringArray0){" +
+
+    "return 8;" + "}" + "}";
+
+    /**
+     * Constructs a DynamicServiceCreator.
+     * 
+     * @param dynamicFactoryWSDLLocation
+     */
+    public DynamicServiceCreator(String dynamicFactoryWSDLLocation) {
+        this.dynamicFactoryWSDLLocation = dynamicFactoryWSDLLocation;
+    }
+
+    public void createService(String code) throws WorkflowException {
+        try {
+            WsdlDefinitions definitions = null;
+            if (this.dynamicFactoryWSDLLocation != null && !this.dynamicFactoryWSDLLocation.equals("")) {
+                definitions = WsdlResolver.getInstance().loadWsdl(new File(".").toURI(),
+                        new URI(this.dynamicFactoryWSDLLocation));
+            }
+
+            // Create Invoker
+            // FIXME: Should pass the right leadcontext header for last argument
+            Invoker invoker = InvokerFactory.createInvoker(new QName("http://extreme.indiana.edu",
+                    "ServiceCreatorPortType"), definitions, null, null, null);
+
+            invoker.setup();
+
+            invoker.setOperation("deployServiceFromClass");
+            invoker.setInput("classAsString", code);
+            invoker.invoke();
+            invoker.getOutput("return");
+        } catch (Exception e) {
+            throw new WorkflowException(e);
+        }
+
+    }
+
+    public static void main(String[] args) throws WorkflowException {
+        DynamicServiceCreator c = new DynamicServiceCreator("http://127.0.0.1:8080/axis2/services/ServiceCreator?wsdl");
+        c.createService(classStr);
+    }
+
+}
\ No newline at end of file


[19/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/pom.xml
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/pom.xml b/modules/xbaya-gui/pom.xml
deleted file mode 100644
index b62feff..0000000
--- a/modules/xbaya-gui/pom.xml
+++ /dev/null
@@ -1,322 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata</artifactId>
-        <version>0.12-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-xbaya-gui</artifactId>
-    <packaging>jar</packaging>
-    <name>Airavata XBaya</name>
-    <url>http://airavata.apache.org/</url>
-
-    <build>
-        <plugins>
-            <plugin>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>restore-persistence</id>
-                        <phase>prepare-package</phase>
-                        <configuration>
-                            <tasks>
-                                <copy file="${project.build.outputDirectory}/services.xml" tofile="${project.build.outputDirectory}/META-INF/services.xml" />
-                                <copy file="src/main/resources/WorkflowInterpretor.wsdl" tofile="${project.build.outputDirectory}/META-INF/service.wsdl" />
-                            </tasks>
-                        </configuration>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-dependency-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <id>copy-dependencies</id>
-                        <phase>process-resources</phase>
-                        <goals>
-                            <goal>copy-dependencies</goal>
-                        </goals>
-                        <configuration>
-                            <outputDirectory>${basedir}/target/jnlp/lib</outputDirectory>
-                            <overWriteReleases>false</overWriteReleases>
-                            <overWriteSnapshots>true</overWriteSnapshots>
-                            <excludeTransitive>false</excludeTransitive>
-                        </configuration>
-                    </execution>
-                    <!--execution>
-                        <id>unpack-dependencies</id>
-                        <phase>compile</phase>
-                        <goals>
-                            <goal>unpack</goal>
-                        </goals>
-                        <configuration>
-                            <artifactItems>
-                                <artifactItem>
-                                    <groupId>org.apache.airavata</groupId>
-                                    <artifactId>apache-airavata-samples</artifactId>
-                                    <type>zip</type>
-                                    <outputDirectory>${project.build.directory}/samples</outputDirectory>
-                                </artifactItem>
-	                        </artifactItems>
-                        </configuration>
-                    </execution-->
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-    <dependencies>
-        <!--dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>apache-airavata-samples</artifactId>
-            <version>${project.version}</version>
-	    <type>zip</type>
-	    <optional>true</optional>
-        </dependency-->
-
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>xpp3</artifactId>
-            <version>${xpp3.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>xpp5</artifactId>
-            <version>${xpp5.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>xsul</artifactId>
-            <version>${xsul.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>gpel-client</artifactId>
-            <version>${gpel.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>atomixmiser</artifactId>
-            <version>${atomixmiser.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-httpclient</groupId>
-            <artifactId>commons-httpclient</artifactId>
-            <version>3.1</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-            <version>1.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.python</groupId>
-            <artifactId>jython</artifactId>
-            <version>${jython.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.xmlbeans</groupId>
-            <artifactId>xmlbeans</artifactId>
-            <version>${xmlbeans.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-adb</artifactId>
-            <version>${axis2.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-kernel</artifactId>
-            <version>${axis2.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-api</artifactId>
-            <version>1.2.8</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-impl</artifactId>
-            <version>1.2.8</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-dom</artifactId>
-            <version>1.2.8</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.schema</groupId>
-            <artifactId>XmlSchema</artifactId>
-            <version>1.4.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.neethi</groupId>
-            <artifactId>neethi</artifactId>
-            <version>2.0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-transport-local</artifactId>
-            <version>${axis2.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-transport-http</artifactId>
-            <version>${axis2.version}</version>
-        </dependency>
-
-        <!-- AMAZON STUFFS -->
-        <dependency>
-            <groupId>com.amazonaws</groupId>
-            <artifactId>aws-java-sdk</artifactId>
-            <version>1.3.20</version>
-        </dependency>
-        <dependency>
-            <groupId>net.java.dev.jets3t</groupId>
-            <artifactId>jets3t</artifactId>
-            <version>0.8.0</version>
-        </dependency>
-
-        <!-- AIRAVATA modules -->
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-model-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-model-component</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-message-monitor</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-client-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-message-broker</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-common-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-tracking</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-jpa-registry</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-registry-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!-- JCR Support -->
-        <!-- TODO need clean up -->
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-gfac-schema-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-gfac-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-gfac-ec2</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>javax.jcr</groupId>
-            <artifactId>jcr</artifactId>
-            <version>${jcr.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-execution-context</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <!--dependency> <groupId>org.apache.airavata</groupId> <artifactId>airavata-jpa-registry</artifactId> <version>${project.version}</version> 
-            </dependency -->
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbyclient</artifactId>
-            <version>${derby.version}</version>
-        </dependency>
-        <!--<dependency>-->
-            <!--<groupId>org.globusonline</groupId>-->
-            <!--<artifactId>transfer-api-client-java</artifactId>-->
-            <!--<version>0.10.8</version>-->
-        <!--</dependency>-->
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpclient</artifactId>
-            <version>4.3</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpcore</artifactId>
-            <version>4.3</version>
-        </dependency>
-	<dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-client-configuration</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-	<dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-server-configuration</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
deleted file mode 100644
index 6f4d2db..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class XBaya {
-
-    private static final Logger logger = LoggerFactory.getLogger(XBaya.class);
-
-    private XBayaConfiguration config;
-
-    private XBayaEngine engine;
-
-    public static int preservice = 0;
-
-    /**
-     * Constructs an XBayaEngine.
-     * 
-     * @param args
-     */
-    public XBaya(String[] args) {
-        parseArguments(args);
-        try {
-            this.engine = new XBayaEngine(this.config);
-
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            try {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            } catch (Throwable t) {
-                // Cannot do anything
-                e.printStackTrace();
-            }
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            try {
-                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            } catch (Throwable t) {
-                // Cannot do anything
-                System.out.println(e);
-
-            }
-        }
-    }
-
-    /**
-     * Returns the XBayaEngine.
-     * 
-     * @return The XBayaEngine
-     */
-    public XBayaEngine getEngine() {
-        return this.engine;
-    }
-
-    private void printUsage() {
-        System.err.println("Usage: java " + XBaya.class.getName() + " [-help]" + "[-config file]" + " [-title title]"
-                + " [-workflow workflow]" + " [-enableLocalRegistry]" + " [-localRegistry dir]"
-                + " [-gpelEngineURL url]" + " [-templateID templateID]" + " [-instanceID instanceID]"
-                + " [-gfacURL url]" + " [-dscURL url" + " [-startMonitor {true,false}]" + " [-brokerURL url]"
-                + " [-topic topic]" + " [-pullMode {true,false}]" + " [-myProxyServer host]" + " [-karmaURL url]"
-                + " [-karmaWorkflowInstanceID]" + " [-myProxyPort port]" + " [-myProxyUsername username]"
-                + " [-myProxyLifetime sec]" + " [-loadMyProxy {true,false}]" + " [-messageBoxURL url]"
-                + " [-width width]" + " [-height height]" + " [-exitOnClose false/true]" + "[-enableProvenance false/true]"
-                + "[-enableProvenanceSmartRun false/true]" + "[-runWithCrossProduct true/false]"+"[-mode ide/monitor]" + "[--x x-coordinates of left top corner] " +
-                "+ [--y y-coordinate of left top corner]");
-    }
-
-    private void parseArguments(String[] args) {
-        try {
-            this.config = new XBayaConfiguration();
-
-            int index = 0;
-            while (index < args.length) {
-                String arg = args[index];
-                String possibleValue = "";
-                if ((index + 1) < args.length) {
-                    possibleValue = args[index + 1];
-                }
-                logger.debug("arg: " + arg + " " + possibleValue);
-                if ("-help".equalsIgnoreCase(arg)) {
-                    printUsage();
-                    System.exit(0);
-                } else if ("-config".equalsIgnoreCase(arg)) {
-                    index++;
-                    String configPath = args[index];
-                    try {
-                        this.config.loadConfiguration(configPath);
-                    } catch (RuntimeException e) {
-                        String message = "Error while reading config file, " + configPath;
-                        logger.warn(message, e);
-                        this.config.addError(new WorkflowException(message, e));
-                    }
-                } else if ("-title".equalsIgnoreCase(arg)) {
-                    index++;
-                    this.config.setTitle(args[index]);
-                } else if ("-workflow".equalsIgnoreCase(arg)) {
-                    index++;
-                    this.config.setWorkflow(args[index]);
-                } else if ("-gfacURL".equalsIgnoreCase(arg)) {
-                    index++;
-                    String url = args[index];
-                    try {
-                        this.config.setGFacURL(parseURL(url));
-                    } catch (URISyntaxException e) {
-                        String message = "The GFac URL is in wrong format: " + url;
-                        logger.warn(message, e);
-                        this.config.addError(new WorkflowException(message, e));
-                    }
-                } else if ("-dscURL".equalsIgnoreCase(arg)) {
-                    index++;
-                    String url = args[index];
-                    try {
-                        this.config.setDSCURL(parseURL(url));
-                    } catch (URISyntaxException e) {
-                        String message = "The DSC URL is in wrong format: " + url;
-                        logger.warn(message, e);
-                        this.config.addError(new WorkflowException(message, e));
-                    }
-                } else if ("-startMonitor".equalsIgnoreCase(arg)) {
-                    this.config.setStartMonitor(true);
-                } else if ("-brokerURL".equalsIgnoreCase(arg)) {
-                    index++;
-                    String brokerURL = args[index];
-                    try {
-                        this.config.setBrokerURL(parseURL(brokerURL));
-                    } catch (URISyntaxException e) {
-                        String message = "The broker URL is in wrong format: " + brokerURL;
-                        logger.warn(message, e);
-                        this.config.addError(new WorkflowException(message, e));
-                    }
-                } else if ("-odeEngine".equalsIgnoreCase(arg)) {
-                    index++;
-                    this.config.setOdeURL(args[index]);
-
-                } else if ("-templateID".equalsIgnoreCase(arg)) {
-                    index++;
-                    this.config.setWorkflow(args[index]);
-
-                } else if ("-topic".equalsIgnoreCase(arg)) {
-
-                    index++;
-                    this.config.setTopic(args[index]);
-                } else if ("-pullMode".equalsIgnoreCase(arg)) {
-                    if (index < args.length - 1) {
-                        String nextArg = args[index + 1];
-                        if (nextArg.startsWith("-")) {
-                            this.config.setPullMode(true);
-                        } else if ("true".equalsIgnoreCase(nextArg)) {
-                            index++;
-                            this.config.setPullMode(true);
-                        } else if ("false".equalsIgnoreCase(nextArg)) {
-                            index++;
-                            this.config.setPullMode(false);
-                        } else {
-                            String message = "-pullMode has to be either true or false, not " + nextArg;
-                            logger.warn(message);
-                            this.config.addError(new WorkflowException(message));
-                        }
-                    } else {
-                        // This is the last arg
-                        this.config.setPullMode(true);
-                    }
-                } else if ("-messageBoxURL".equalsIgnoreCase(arg) || "-msgBoxURL".equalsIgnoreCase(arg)) {
-                    index++;
-                    String messageBoxURL = args[index];
-                    try {
-                        this.config.setMessageBoxURL(parseURL(messageBoxURL));
-                    } catch (URISyntaxException e) {
-                        String message = "The message box URL is in wrong format: " + messageBoxURL;
-                        logger.warn(message, e);
-                        this.config.addError(new WorkflowException(message, e));
-                    }
-                } else if ("-registryURL".equalsIgnoreCase(arg)) {
-                    index++;
-                    String registryURL = args[index];
-                    try {
-                        this.config.setRegistryURL(parseURL(registryURL));
-                        // we need to give preference when a user set registry url from the
-                        // command line
-                        this.config.setRegURLSetByCMD(true);
-                    } catch (URISyntaxException e) {
-                        String message = "The message box URL is in wrong format: " + registryURL;
-                        logger.warn(message, e);
-                        this.config.addError(new WorkflowException(message, e));
-                    }
-                    } else if ("-registryUserName".equalsIgnoreCase(arg)) {
-
-                    index++;
-                    this.config.setRegigstryUserName(args[index]);
-                } else if ("-registryPassphrase".equalsIgnoreCase(arg)) {
-
-                    index++;
-                    this.config.setRegistryPassphrase(args[index]);
-                } else if ("-width".equalsIgnoreCase(arg)) {
-                    index++;
-                    String width = args[index];
-                    try {
-                        this.config.setWidth(Integer.parseInt(width));
-                    } catch (NumberFormatException e) {
-                        String message = "The width must be an integer: " + width;
-                        logger.warn(message, e);
-                        this.config.addError(new WorkflowException(message, e));
-                    }
-                } else if ("-height".equalsIgnoreCase(arg)) {
-                    index++;
-                    String height = args[index];
-                    try {
-                        this.config.setHeight(Integer.parseInt(height));
-                    } catch (NumberFormatException e) {
-                        String message = "The height must be an integer: " + height;
-                        logger.warn(message, e);
-                        this.config.addError(new WorkflowException(message, e));
-                    }
-                } else if ("-exitOnClose".equalsIgnoreCase(arg)) {
-                    index++;
-                    String exit = args[index];
-                    if ("false".equalsIgnoreCase(exit)) {
-                        this.config.setCloseOnExit(false);
-                    }
-                }  else if ("-enableProvenance".equalsIgnoreCase(arg)) {
-                    index++;
-                    String exit = args[index];
-                    if ("true".equalsIgnoreCase(exit)) {
-                        this.config.setCollectProvenance(true);
-                    }
-                }  else if ("-enableProvenanceSmartRun".equalsIgnoreCase(arg)) {
-                    index++;
-                    String exit = args[index];
-                    if ("true".equalsIgnoreCase(exit)) {
-                        this.config.setProvenanceSmartRun(true);
-                    }
-                }  else if ("-runWithCrossProduct".equalsIgnoreCase(arg)) {
-                    index++;
-                    String exit = args[index];
-                    if ("false".equalsIgnoreCase(exit)) {
-                        this.config.setRunWithCrossProduct(false);
-                    }
-                }  else if ("-mode".equalsIgnoreCase(arg)) {
-                	index++;
-                	String modeValue = args[index].toUpperCase();
-                	this.config.setXbayaExecutionMode(XBayaExecutionMode.valueOf(modeValue));
-                } else if ("-x".equalsIgnoreCase(arg)) {
-                    index++;
-                    this.config.setX(Integer.parseInt(args[index]));
-                } else if ("-y".equalsIgnoreCase(arg)) {
-                    index++;
-                    this.config.setY(Integer.parseInt(args[index]));
-                } else {
-                    String message = "Unknown option: " + arg;
-                    logger.error(message);
-                    this.config.addError(new WorkflowException(message));
-                }
-                this.config.setAiravataAPI(this.config.getAiravataAPI());
-                index++;
-            }
-        } catch (ArrayIndexOutOfBoundsException e) {
-            String message = "Argument is missing after " + args[args.length - 1];
-            logger.error(message, e);
-            this.config.addError(new WorkflowException(message));
-        } catch (Throwable e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unknown error while parsing the arguments";
-            this.config.addError(new WorkflowException(message, e));
-        }
-        
-    }
-
-    private URI parseURL(String urlString) throws URISyntaxException {
-        if (urlString.trim().length() == 0) {
-            // This makes it possible to not use some of our default services.
-            return null;
-        } else if ("null".equalsIgnoreCase(urlString)) {
-            // This is a workaround that JNLP doesn't take empty string as an
-            // argument.
-            return null;
-        } else {
-            return new URI(urlString).parseServerAuthority();
-        }
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        new XBaya(args);
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
deleted file mode 100644
index 4aae6b4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
+++ /dev/null
@@ -1,974 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya;
-
-import java.io.File;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Observable;
-import java.util.Observer;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.gfac.ec2.AmazonSecurityContext;
-import org.apache.airavata.schemas.wec.ContextHeaderDocument;
-import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
-import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.lead.LeadDeploymentConfig;
-
-public class XBayaConfiguration extends Observable implements Observer {
-
-    private static final Logger logger = LoggerFactory.getLogger(XBayaConfiguration.class);
-
-    private String title = XBayaConstants.APPLICATION_NAME;
-
-    private String workflow = null;
-
-    private String ogceWorkflow = null;
-
-    private List<String> localRegistris = new ArrayList<String>();
-
-    // GPEL Engine related
-
-    private URI gpelEngineURL = XBayaConstants.DEFAULT_GPEL_ENGINE_URL;
-
-    private URI gpelTemplateID = null;
-
-    private URI gpelInstanceID = null;
-
-    private AiravataAPI airavataAPI = null;
-    // ODE
-    private String odeURL = XBayaConstants.DEFAULT_ODE_URL;
-
-    // WorkflowInterpreter
-    private URI workflowInterpreterURL = XBayaConstants.DEFAULT_WORKFLOW_INTERPRETER_URL;
-
-    // Proxy Service
-
-    private URI proxyURI = XBayaConstants.DEFAULT_PROXY_URI;
-
-    private URI gfacURL = XBayaConstants.DEFAULT_GFAC_URL;
-
-    private URI registryURL = XBayaConstants.REGISTRY_URL;
-
-    private String regigstryUserName = XBayaConstants.REGISTRY_USERNAME;
-
-    private String registryPassphrase = XBayaConstants.REGISTRY_PASSPHRASE;
-
-    private String defaultGateway = XBayaConstants.DEFAULT_GATEWAY;
-
-    private URI dscURL = XBayaConstants.DEFAULT_DSC_URL;
-
-    // Monitor related
-
-    private boolean startMonitor = false;
-
-    private URI brokerURL = XBayaConstants.DEFAULT_BROKER_URL;
-
-    private String topic = null;
-
-    private boolean pullMode = true;
-
-    private URI messageBoxURL = XBayaConstants.DEFAULT_MESSAGE_BOX_URL;
-
-    // Kerma
-
-    private URI karmaURL = null;
-
-    private URI karmaWorkflowInstanceID = null;
-
-    // MyProxy
-
-    private String myProxyServer = XBayaConstants.DEFAULT_MYPROXY_SERVER;
-
-    private int myProxyPort = XBayaConstants.DEFAULT_MYPROXY_PORT;
-
-    private int myProxyLifetime = XBayaConstants.DEFAULT_MYPROXY_LIFTTIME;
-
-    private String myProxyUsername = null;
-
-    private String myProxyPassphrase = null;
-
-    private boolean loadMyProxy = false;
-
-    private boolean loadRunJythonWorkflow = false;
-
-    // Size
-
-    private int width;
-
-    private int height;
-
-    private int x = 50;
-
-    private int y= 50;
-
-    // Errors
-
-    private List<Throwable> errors;
-
-    private boolean closeOnExit = true;
-
-    private boolean collectProvenance = false;
-
-    private boolean provenanceSmartRun = false;
-
-    private boolean runWithCrossProduct = true;
-
-    private String trustedCertLocation = "";
-
-    private JCRComponentRegistry jcrComponentRegistry=null;
-
-    private XBayaExecutionMode xbayaExecutionMode=XBayaExecutionMode.IDE;
-    
-    private List<XBayaExecutionModeListener> xbayaExecutionModeChangeListners=new ArrayList<XBayaExecutionModeListener>();
-
-    private boolean regURLSetByCMD = false;
-
-    private AmazonSecurityContext amazonSecurityContext = null;
-
-    private ContextHeaderDocument.ContextHeader contextHeader;
-
-    public enum XBayaExecutionMode{
-    	IDE,
-    	MONITOR
-    }
-    /**
-     * Constructs an XwfConfiguration.
-     */
-    public XBayaConfiguration() {
-        this.errors = new ArrayList<Throwable>();
-
-        // Read from system properties first.
-        String systemConfig = System.getProperty("xbaya.config");
-        try {
-            if (systemConfig != null) {
-                loadConfiguration(systemConfig);
-            }
-        } catch (RuntimeException e) {
-            String message = "Error while reading a configuration file, " + systemConfig;
-            logger.warn(message, e);
-        }
-    }
-
-    /**
-     * @param configFilePath
-     */
-    public void loadConfiguration(String configFilePath) {
-        File configFile = new File(configFilePath);
-        URI uri = configFile.toURI();
-        loadConfiguration(uri);
-    }
-
-    private void loadConfiguration(URI uri) {
-        LeadDeploymentConfig config = LeadDeploymentConfig.loadConfig(null, uri);
-        URI gpel = config.getGpelUrl();
-        if (gpel != null) {
-            this.gpelEngineURL = config.getGpelUrl();
-        }
-        URI gfac = config.getGfacUrl();
-        if (gfac != null) {
-            this.gfacURL = gfac;
-        }
-        URI dsc = config.getDscUrl();
-        if (dsc != null) {
-            this.dscURL = dsc;
-        }
-        URI broker = config.getBrokerUrl();
-        if (broker != null) {
-            this.brokerURL = broker;
-        }
-        URI msgBox = config.getMsgBoxUrl();
-        if (msgBox != null) {
-            this.messageBoxURL = msgBox;
-        }
-    }
-
-    /**
-     * Returns the title.
-     * 
-     * @return The title
-     */
-    public String getTitle() {
-        return this.title;
-    }
-
-    /**
-     * Sets title.
-     * 
-     * @param title
-     *            The title to set.
-     */
-    public void setTitle(String title) {
-        this.title = title;
-    }
-
-    /**
-     * Returns the defaultWorkflow.
-     * 
-     * @return The defaultWorkflow
-     */
-    public String getWorkflow() {
-        return this.workflow;
-    }
-
-    /**
-     * Sets defaultWorkflow.
-     * 
-     * @param defaultWorkflow
-     *            The defaultWorkflow to set.
-     */
-    public void setWorkflow(String defaultWorkflow) {
-        this.workflow = defaultWorkflow;
-    }
-
-    /**
-     * Sets ogceWorkflow.
-     * 
-     * @param ogceWorkflow
-     *            The ogceWorkflow to set.
-     */
-    public void setOGCEWorkflow(String ogceWorkflow) {
-        this.ogceWorkflow = ogceWorkflow;
-    }
-
-    /**
-     * Returns the ogceWorkflow.
-     * 
-     * @return The ogceWorkflow
-     */
-    public String getOGCEWorkflow() {
-        return this.ogceWorkflow;
-    }
-
-    /**
-     * Enable the system default local registry.
-     */
-    public void enableLocalRegistry() {
-        addLocalRegistry(XBayaPathConstants.WSDL_DIRECTORY);
-    }
-
-    /**
-     * @param path
-     *            The path of local registry.
-     */
-    public void addLocalRegistry(String path) {
-        this.localRegistris.add(path);
-    }
-
-    /**
-     * @return The list of pathes of local registries.
-     */
-    public List<String> getLocalRegistry() {
-        return this.localRegistris;
-    }
-
-    /**
-     * Returns the gpelEngineUrl.
-     * 
-     * @return The gpelEngineUrl
-     */
-    public URI getGPELEngineURL() {
-        return this.gpelEngineURL;
-    }
-
-    /**
-     * Sets gpelEngineUrl.
-     * 
-     * @param gpelEngineURL
-     *            The gpelEngineUrl to set.
-     */
-    public void setGPELEngineURL(URI gpelEngineURL) {
-        this.gpelEngineURL = gpelEngineURL;
-    }
-
-    /**
-     * @param templateID
-     */
-    public void setGPELTemplateID(URI templateID) {
-        this.gpelTemplateID = templateID;
-    }
-
-    /**
-     * @return The GPEL template ID.
-     */
-    public URI getGPELTemplateID() {
-        return this.gpelTemplateID;
-    }
-
-    /**
-     * Returns the gpelInstanceID.
-     * 
-     * @return The gpelInstanceID
-     */
-    public URI getGPELInstanceID() {
-        return this.gpelInstanceID;
-    }
-
-    /**
-     * Sets gpelInstanceID.
-     * 
-     * @param gpelInstanceID
-     *            The gpelInstanceID to set.
-     */
-    public void setGPELInstanceID(URI gpelInstanceID) {
-        this.gpelInstanceID = gpelInstanceID;
-    }
-
-    /**
-     * Get the AmazonSecurityContext needed for cloud job submission.
-     * @return AmazonSecurityContext
-     */
-    public AmazonSecurityContext getAmazonSecurityContext() {
-        return amazonSecurityContext;
-    }
-
-    /**
-     * Set the AmazonSecurityContext needed for cloud job submission.
-     * @param amazonSecurityContext amazon security context.
-     */
-    public void setAmazonSecurityContext(AmazonSecurityContext amazonSecurityContext) {
-        this.amazonSecurityContext = amazonSecurityContext;
-    }
-
-    /**
-     * @return The GFac URL
-     */
-    public URI getGFacURL() {
-        return this.gfacURL;
-    }
-
-    /**
-     * @param gfacURL
-     */
-    public void setGFacURL(URI gfacURL) {
-        this.gfacURL = gfacURL;
-    }
-
-    /**
-     * @return The DSC URL
-     */
-    public URI getDSCURL() {
-        return this.dscURL;
-    }
-
-    /**
-     * @param dscURL
-     */
-    public void setDSCURL(URI dscURL) {
-        this.dscURL = dscURL;
-    }
-
-    /**
-     * Returns the topic.
-     * 
-     * @return The topic
-     */
-    public String getTopic() {
-        return this.topic;
-    }
-
-    /**
-     * Sets topic.
-     * 
-     * @param topic
-     *            The topic to set.
-     */
-    public void setTopic(String topic) {
-        this.topic = topic;
-    }
-
-    /**
-     * Returns the messageBoxUrl.
-     * 
-     * @return The messageBoxUrl
-     */
-    public URI getMessageBoxURL() {
-        return this.messageBoxURL;
-    }
-
-    /**
-     * Sets messageBoxUrl.
-     * 
-     * @param messageBoxURL
-     *            The messageBoxUrl to set.
-     */
-    public void setMessageBoxURL(URI messageBoxURL) {
-        this.messageBoxURL = messageBoxURL;
-    }
-
-    /**
-     * Returns the pullMode.
-     * 
-     * @return The pullMode
-     */
-    public boolean isPullMode() {
-        return this.pullMode;
-    }
-
-    /**
-     * Sets pullMode.
-     * 
-     * @param pullMode
-     *            The pullMode to set.
-     */
-    public void setPullMode(boolean pullMode) {
-        this.pullMode = pullMode;
-    }
-
-    /**
-     * Returns the brokerLocation.
-     * 
-     * @return The brokerLocation
-     */
-    public URI getBrokerURL() {
-        return this.brokerURL;
-    }
-
-    /**
-     * Sets brokerLocation.
-     * 
-     * @param brokerURL
-     *            The brokerLocation to set.
-     */
-    public void setBrokerURL(URI brokerURL) {
-        this.brokerURL = brokerURL;
-    }
-
-    /**
-     * Returns the startMonitor.
-     * 
-     * @return The startMonitor
-     */
-    public boolean isStartMonitor() {
-        return this.startMonitor;
-    }
-
-    /**
-     * Sets startMonitor.
-     * 
-     * @param startMonitor
-     *            The startMonitor to set.
-     */
-    public void setStartMonitor(boolean startMonitor) {
-        this.startMonitor = startMonitor;
-    }
-
-    /**
-     * Returns the kermaURI.
-     * 
-     * @return The kermaURI
-     */
-    public URI getKarmaURL() {
-        return this.karmaURL;
-    }
-
-    /**
-     * Sets kermaURI.
-     * 
-     * @param kermaURI
-     *            The kermaURI to set.
-     */
-    public void setKarmaURL(URI kermaURI) {
-        this.karmaURL = kermaURI;
-    }
-
-    /**
-     * Returns the kermaWorkflowInstanceID.
-     * 
-     * @return The kermaWorkflowInstanceID
-     */
-    public URI getKarmaWorkflowInstanceID() {
-        return this.karmaWorkflowInstanceID;
-    }
-
-    /**
-     * Sets kermaWorkflowInstanceID.
-     * 
-     * @param karmaWorkflowInstanceID
-     *            The kermaWorkflowInstanceID to set.
-     */
-    public void setKarmaWorkflowInstanceID(URI karmaWorkflowInstanceID) {
-        this.karmaWorkflowInstanceID = karmaWorkflowInstanceID;
-    }
-
-    /**
-     * Returns the myProxyServer.
-     * 
-     * @return The myProxyServer
-     */
-    public String getMyProxyServer() {
-        return this.myProxyServer;
-    }
-
-    /**
-     * Sets myProxyServer.
-     * 
-     * @param myProxyServer
-     *            The myProxyServer to set.
-     */
-    public void setMyProxyServer(String myProxyServer) {
-        this.myProxyServer = myProxyServer;
-    }
-
-    /**
-     * Returns the myProxyPort.
-     * 
-     * @return The myProxyPort
-     */
-    public int getMyProxyPort() {
-        return this.myProxyPort;
-    }
-
-    /**
-     * Sets myProxyPort.
-     * 
-     * @param myProxyPort
-     *            The myProxyPort to set.
-     */
-    public void setMyProxyPort(int myProxyPort) {
-        this.myProxyPort = myProxyPort;
-    }
-
-    /**
-     * Returns the myProxyLifetime.
-     * 
-     * @return The myProxyLifetime
-     */
-    public int getMyProxyLifetime() {
-        return this.myProxyLifetime;
-    }
-
-    /**
-     * Sets myProxyLifetime.
-     * 
-     * @param myProxyLifetime
-     *            The myProxyLifetime to set.
-     */
-    public void setMyProxyLifetime(int myProxyLifetime) {
-        this.myProxyLifetime = myProxyLifetime;
-    }
-
-    /**
-     * Returns the myProxyUsername.
-     * 
-     * @return The myProxyUsername
-     */
-    public String getMyProxyUsername() {
-        return this.myProxyUsername;
-    }
-
-    /**
-     * Sets myProxyUsername.
-     * 
-     * @param myProxyUsername
-     *            The myProxyUsername to set.
-     */
-    public void setMyProxyUsername(String myProxyUsername) {
-        this.myProxyUsername = myProxyUsername;
-    }
-
-    /**
-     * Returns the odeURL.
-     * 
-     * @return The odeURL
-     */
-    public String getOdeURL() {
-        return this.odeURL;
-    }
-
-    /**
-     * Sets odeURL.
-     * 
-     * @param odeURL
-     *            The odeURL to set.
-     */
-    public void setOdeURL(String odeURL) {
-        this.odeURL = odeURL;
-    }
-
-    /**
-     * Returns the workflowInterpreterURL.
-     * 
-     * @return The workflowInterpreterURL
-     */
-    public URI getWorkflowInterpreterURL() {
-        return this.workflowInterpreterURL;
-    }
-
-    /**
-     * Sets workflowInterpreterURL.
-     * 
-     * @param workflowInterpreterURL
-     *            The workflowInterpreterURL to set.
-     */
-    public void setWorkflowInterpreterURL(URI workflowInterpreterURL) {
-        this.workflowInterpreterURL = workflowInterpreterURL;
-    }
-
-    /**
-     * Sets proxyURI.
-     * 
-     * @param proxyURI
-     *            The proxyURI to set.
-     */
-    public void setProxyURI(URI proxyURI) {
-        this.proxyURI = proxyURI;
-    }
-
-    /**
-     * Returns the myProxyPassphrase.
-     * 
-     * @return The myProxyPassphrase
-     */
-    public String getMyProxyPassphrase() {
-        return this.myProxyPassphrase;
-    }
-
-    /**
-     * Sets myProxyPassphrase.
-     * 
-     * @param myProxyPassphrase
-     *            The myProxyPassphrase to set.
-     */
-    public void setMyProxyPassphrase(String myProxyPassphrase) {
-        this.myProxyPassphrase = myProxyPassphrase;
-    }
-
-    /**
-     * Returns the loadMyProxy.
-     * 
-     * @return The loadMyProxy
-     */
-    public boolean isLoadMyProxy() {
-        return this.loadMyProxy;
-    }
-
-    /**
-     * Sets loadMyProxy.
-     * 
-     * @param loadMyProxy
-     *            The loadMyProxy to set.
-     */
-    public void setLoadMyProxy(boolean loadMyProxy) {
-        this.loadMyProxy = loadMyProxy;
-    }
-
-    /**
-     * Returns the loadRunJythonWorkflow.
-     * 
-     * @return The loadRunJythonWorkflow
-     */
-    public boolean isLoadRunJythonWorkflow() {
-        return this.loadRunJythonWorkflow;
-    }
-
-    /**
-     * Sets loadRunJythonWorkflow.
-     * 
-     * @param loadRunJythonWorkflow
-     *            The loadRunJythonWorkflow to set.
-     */
-    public void setLoadRunJythonWorkflow(boolean loadRunJythonWorkflow) {
-        this.loadRunJythonWorkflow = loadRunJythonWorkflow;
-    }
-
-    /**
-     * Returns the height.
-     * 
-     * @return The height
-     */
-    public int getHeight() {
-        return this.height;
-    }
-
-    /**
-     * Sets height.
-     * 
-     * @param height
-     *            The height to set.
-     */
-    public void setHeight(int height) {
-        this.height = height;
-    }
-
-    /**
-     * Returns the width.
-     * 
-     * @return The width
-     */
-    public int getWidth() {
-        return this.width;
-    }
-
-    /**
-     * Sets width.
-     * 
-     * @param width
-     *            The width to set.
-     */
-    public void setWidth(int width) {
-        this.width = width;
-    }
-
-    /**
-     * Add an error.
-     * 
-     * @param e
-     */
-    public void addError(Throwable e) {
-        this.errors.add(e);
-    }
-
-    /**
-     * Returns errors.
-     * 
-     * @return Errors.
-     */
-    public Iterable<Throwable> getErrors() {
-        return this.errors;
-    }
-
-    /**
-     * @return
-     */
-    public String getODEURL() {
-        // TODO Auto-generated method stub
-        return this.odeURL;
-    }
-
-    //
-
-    /**
-     * Returns current proxy URI
-     * 
-     * @return
-     */
-    public URI getProxyURI() {
-        return this.proxyURI;
-    }
-
-    /**
-     * @param b
-     */
-    public void setCloseOnExit(boolean b) {
-        this.closeOnExit = b;
-    }
-
-    /**
-     * @return
-     */
-    public boolean isCloseOnExit() {
-        return this.closeOnExit;
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        if (this.airavataAPI != null && this.airavataAPI instanceof Observable) {
-            ((Observable) this.airavataAPI).deleteObserver(this);
-        }
-        this.airavataAPI = airavataAPI;
-        if (airavataAPI != null && airavataAPI instanceof Observable) {
-            ((Observable) airavataAPI).addObserver(this);
-        }
-        if (getJcrComponentRegistry()==null){
-        	setJcrComponentRegistry(new JCRComponentRegistry(airavataAPI));
-        }else{
-        	getJcrComponentRegistry().setAiravataAPI(airavataAPI);
-        }
-        triggerObservers(getJcrComponentRegistry());
-    }
-
-    public URI getRegistryURL() {
-        return registryURL;
-    }
-
-    public void setRegistryURL(URI registryURL) {
-        this.registryURL = registryURL;
-    }
-
-    public void setRegigstryUserName(String regigstryUserName) {
-        this.regigstryUserName = regigstryUserName;
-    }
-
-    public void setRegistryPassphrase(String registryPassphrase) {
-        this.registryPassphrase = registryPassphrase;
-    }
-
-    public String getRegistryUserName() {
-        return regigstryUserName;
-    }
-
-    public String getRegistryPassphrase() {
-        return registryPassphrase;
-    }
-
-    protected void triggerObservers(Object o) {
-        setChanged();
-        notifyObservers(o);
-    }
-
-    public void update(Observable observable, Object o) {
-        triggerObservers(observable);
-    }
-
-    public boolean isCollectProvenance() {
-        return collectProvenance;
-    }
-
-    public boolean isProvenanceSmartRun() {
-        return provenanceSmartRun;
-    }
-
-    public void setCollectProvenance(boolean collectProvenance) {
-        this.collectProvenance = collectProvenance;
-    }
-
-    public void setProvenanceSmartRun(boolean provenanceSmartRun) {
-        this.provenanceSmartRun = provenanceSmartRun;
-    }
-
-    public void setRunWithCrossProduct(boolean runWithCrossProduct) {
-        this.runWithCrossProduct = runWithCrossProduct;
-    }
-
-    public boolean isRunWithCrossProduct() {
-        return runWithCrossProduct;
-    }
-
-    public String getTrustedCertLocation() {
-        return trustedCertLocation;
-    }
-
-    public void setTrustedCertLocation(String trustedCertLocation) {
-        this.trustedCertLocation = trustedCertLocation;
-    }
-
-	public XBayaExecutionMode getXbayaExecutionMode() {
-		return xbayaExecutionMode;
-	}
-
-	public void setXbayaExecutionMode(XBayaExecutionMode xbayaExecutionMode) {
-		boolean modeChanged=(this.xbayaExecutionMode != xbayaExecutionMode);
-		this.xbayaExecutionMode = xbayaExecutionMode;
-		if (modeChanged) {
-			for (XBayaExecutionModeListener listner : xbayaExecutionModeChangeListners) {
-				try {
-					listner.executionModeChanged(this);
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-			}
-		}
-	}
-	
-	public void registerExecutionModeChangeListener(XBayaExecutionModeListener listner){
-		xbayaExecutionModeChangeListners.add(listner);
-	}
-	
-	public void unregisterExecutionModeChangeListener(XBayaExecutionModeListener listner){
-		if (xbayaExecutionModeChangeListners.contains(listner)) {
-			xbayaExecutionModeChangeListners.remove(listner);
-		}
-	}
-
-    public int getX() {
-        return x;
-    }
-
-    public void setX(int x) {
-        this.x = x;
-    }
-
-    public int getY() {
-        return y;
-    }
-
-    public void setY(int y) {
-        this.y = y;
-    }
-
-//    public AiravataAPI getAiravataAPI() {
-//        return airavataAPI;
-//    }
-//
-//    public void setAiravataAPI(AiravataAPI airavataAPI) {
-//        this.airavataAPI = airavataAPI;
-//    }
-
-    public String getDefaultGateway() {
-        return defaultGateway;
-    }
-
-    public void setDefaultGateway(String defaultGateway) {
-        this.defaultGateway = defaultGateway;
-    }
-
-	public JCRComponentRegistry getJcrComponentRegistry() {
-		return jcrComponentRegistry;
-	}
-
-	public void setJcrComponentRegistry(JCRComponentRegistry jcrComponentRegistry) {
-		this.jcrComponentRegistry = jcrComponentRegistry;
-	}
-
-    public boolean isRegURLSetByCMD() {
-        return regURLSetByCMD;
-    }
-
-    public void setRegURLSetByCMD(boolean regURLSetByCMD) {
-        this.regURLSetByCMD = regURLSetByCMD;
-    }
-
-    //    public AiravataAPI setAiravataAPI() {
-//        try{
-//            URI baseUri = new URI(ResourcePathConstants.BASE_URL);
-//            PasswordCallbackImpl passwordCallback = new PasswordCallbackImpl(getRegistryUserName(), getRegistryPassphrase());
-//            airavataAPI = AiravataClientUtils.getAPI(baseUri,
-//                    getRegistryUserName(), passwordCallback);
-//        } catch (RepositoryException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        } catch (MalformedURLException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        } catch (RegistryException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        } catch (URISyntaxException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        }
-//        return airavataAPI;
-//    }
-
-    public ContextHeaderDocument.ContextHeader getContextHeader() {
-        return contextHeader;
-    }
-
-    public void setContextHeader(ContextHeaderDocument.ContextHeader contextHeader) {
-        this.contextHeader = contextHeader;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java
deleted file mode 100644
index d754450..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya;
-
-import java.net.URI;
-
-public class XBayaConstants {
-
-    /**
-     * XBaya
-     */
-    public static final String APPLICATION_SHORT_NAME = "XBaya";
-
-    /**
-     * The name of the project
-     */
-    public static final String PROJECT_NAME = "Apache Airavata";
-    
-    /**
-     * The name of the application
-     */
-    public static final String APPLICATION_NAME = "XBaya Dashboard";
-
-    /**
-     * The URL of the web page of the application
-     */
-    public static final URI WEB_URL = URI.create("http://airavata.apache.org/");
-
-    // Default values
-
-    /**
-     * Default URL of the GPEL Engine
-     */
-    public static final URI DEFAULT_GPEL_ENGINE_URL = URI.create("https://tyr13.cs.indiana.edu:7443/gpel/");
-
-    /**
-     * DEFAULT_GFAC_URL
-     */
-    public static final URI DEFAULT_GFAC_URL = URI.create("http://localhost:8080/axis2/services/GFacService");
-
-    /**
-     * DEFAULT_TOPIC
-     */
-    public static final String DEFAULT_TOPIC = "xbaya-topic";
-
-    /**
-     * Default notification broker URL.
-     */
-    public static final URI DEFAULT_BROKER_URL = URI.create("http://localhost:8080/axis2/services/EventingService");
-
-    /**
-     * Default message box URL.
-     */
-    public static final URI DEFAULT_MESSAGE_BOX_URL = URI.create("http://localhost:8080/axis2/services/MsgBoxService");
-
-    /**
-     * DEFAULT_DSC_URL
-     */
-    public static final URI DEFAULT_DSC_URL = URI.create("https://silktree.cs.indiana.edu:52520/");
-
-    /**
-     * DEFAULT_MYPROXY_SERVER
-     */
-    public static final String DEFAULT_MYPROXY_SERVER = "myproxy.teragrid.org";
-
-    /**
-     * DEFAULT_MYPROXY_PORT
-     */
-    public static final int DEFAULT_MYPROXY_PORT = 7512;
-
-    /**
-     * DEFAULT_MYPROXY_LIFTTIME
-     */
-    public static final int DEFAULT_MYPROXY_LIFTTIME = 3600;
-
-    /**
-     * DEFAULT_WEB_REGISTRY
-     */
-    public static final URI DEFAULT_WEB_REGISTRY = URI.create("http://www.extreme.indiana.edu/xgws/wsdl/");
-
-    // File suffixes
-
-    /**
-     * File suffix for XML
-     */
-    public static final String XML_SUFFIX = ".xml";
-
-    /**
-     * File suffix for WSDL
-     */
-    public static final String WSDL_SUFFIX = ".wsdl";
-
-    /**
-     * File suffix for WSDL
-     */
-    public static final String WSDL_SUFFIX2 = "-wsdl.xml";
-
-    /**
-     * Suffix of a graph file
-     */
-    public static final String GRAPH_FILE_SUFFIX = ".xgr";
-
-    /**
-     * Suffix of a workflow file
-     */
-    public static final String WORKFLOW_FILE_SUFFIX = ".xwf";
-
-    /**
-     * File suffix for Jython scripts
-     */
-    public static final String JYTHON_SCRIPT_SUFFIX = ".py";
-
-    /**
-     * File suffix for BPEL
-     */
-    public static final String BPEL_SUFFIX = ".bpel";
-
-    /**
-     * File suffix for SCUFL
-     */
-    public static final String SCUFL_SCRIPT_SUFFIX = ".xml";
-
-    /**
-     * File suffix for PNG
-     */
-    public static final String PNG_SUFFIX = ".png";
-
-    /**
-     * Format name for png image
-     */
-    public static final String PNG_FORMAT_NAME = "PNG";
-
-    /**
-     * ODE URL
-     */
-    public static final String DEFAULT_ODE_URL = "https://pagodatree.cs.indiana.edu:17443";
-
-    /**
-     * WorkflowInterpreter URL
-     */
-    public static final URI DEFAULT_WORKFLOW_INTERPRETER_URL = URI
-            .create("http://localhost:8080/axis2/services/WorkflowInterpretor?wsdl");
-
-    /**
-     * 
-     * PROXY URL
-     */
-
-    public static final URI DEFAULT_PROXY_URI = URI
-            .create("http://silktree.cs.indiana.edu:18080/axis2/services/WEPSService?wsdl");
-
-    /**
-     * WORKFLOW Namespace
-     */
-    public static final String LEAD_NS = "http://extreme.indiana.edu/lead/workflow";
-
-    /**
-     * OGCE WORKFLOW Namespace
-     */
-    public static final String OGCE_WORKFLOW_NS = "http://workflow.ogce.org/";
-
-    public static final String STREAM_SERVER = "http://pagodatree.cs.indiana.edu:8081/axis2/services/StreamService?wsdl";
-
-    public static final String STATIC_LABEL = "STATIC";
-    public static final URI REGISTRY_URL = URI.create("http://localhost:8080/airavata-registry/api");
-    public static final String DEFAULT_GATEWAY = "default";
-    public static final String REGISTRY_USERNAME = "admin";
-    public static final String REGISTRY_PASSPHRASE = "admin";
-    public static final String REGISTRY_TYPE_HOST_DESC = "HostDesc";
-    public static final String REGISTRY_TYPE_APPLICATION_DESC = "ApplicationDesc";
-    public static final String REGISTRY_TYPE_SERVICE_DESC = "ServiceDesc";
-    public static final String REGISTRY_TYPE_WORKFLOW = "workflow";
-    public static final String HTTP_SCHEMAS_AIRAVATA_APACHE_ORG_GFAC_TYPE = "http://airavata.apache.org/schemas/gfac/2012/12";
-
-    public static final String XBAYA_REGISTRY_USER = "xbaya.registry.user";
-    public static final String XBAYA_REGISTRY_URL = "xbaya.registry.url";
-    public static final String XBAYA_DEFAULT_GATEWAY = "xbaya.default.gateway";
-
-    /**
-     * XRegistry Resource Types for OGCE Resource
-     */
-    public static enum XR_Resource_Types {
-        Project, Experiment, WorkflowTemplate, WorkflowInstance, WorkflowInput, WorkflowOutput
-    };
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
deleted file mode 100644
index 1973172..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya;
-
-import java.net.URI;
-import java.util.List;
-
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.AiravataManager;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.component.amazon.AmazonComponentRegistry;
-import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
-import org.apache.airavata.workflow.model.component.system.SystemComponentRegistry;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.ws.monitor.Monitor;
-import org.apache.airavata.ws.monitor.MonitorConfiguration;
-import org.apache.airavata.xbaya.component.registry.ComponentController;
-import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
-import org.apache.airavata.xbaya.registry.PasswordCallbackImpl;
-import org.apache.airavata.xbaya.ui.XBayaGUI;
-import org.apache.airavata.xbaya.ui.monitor.MonitorStarter;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelector;
-import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
-import org.apache.airavata.xbaya.workflow.WorkflowClient;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class XBayaEngine {
-
-    private static final Logger logger = LoggerFactory.getLogger(XBayaEngine.class);
-
-    private XBayaConfiguration configuration;
-
-    private XBayaGUI gui;
-
-    private WorkflowClient workflowClient;
-
-    private Monitor monitor;
-
-    private boolean exitOnClose = true;
-
-    private ComponentTreeNode systemComponentTree;
-
-    private SystemComponentRegistry componentRegistry;
-
-    private WorkflowInterpreter workflowInterpreter;
-
-    private AiravataAPI airavataAPI;
-    
-    private ComponentSelector componentTreeViewer; 
-
-    /**
-     * Constructs a ApplicationClient.
-     *
-     * @param configuration
-     */
-    public XBayaEngine(XBayaConfiguration configuration) {
-        this.configuration = configuration;
-
-        // Creates some essential objects.
-
-        MonitorConfiguration monitorConfiguration = new MonitorConfiguration(configuration.getBrokerURL(),
-                configuration.getTopic(), configuration.isPullMode(), configuration.getMessageBoxURL());
-        this.monitor = new Monitor(monitorConfiguration);
-
-        if (configuration.getAiravataAPI() == null && airavataAPI == null) {
-            try {
-                airavataAPI =  AiravataAPIFactory.getAPI(configuration.getRegistryURL(),
-                        configuration.getDefaultGateway(), configuration.getRegistryUserName(),
-                        new PasswordCallbackImpl(configuration.getRegistryUserName(), configuration.getRegistryPassphrase()));
-                configuration.setAiravataAPI(airavataAPI);
-            } catch (AiravataAPIInvocationException e) {
-                logger.error("Unable to instantiate airavata api instance", e);
-            }
-
-        }
-
-        // MyProxy
-        // this.myProxyClient = new MyProxyClient(this.configuration.getMyProxyServer(),
-        // this.configuration.getMyProxyPort(), this.configuration.getMyProxyUsername(),
-        // this.configuration.getMyProxyPassphrase(), this.configuration.getMyProxyLifetime());
-        //
-        // // These have to be before the GUI setup.
-        // this.workflowClient = WorkflowEngineManager.getWorkflowClient();
-        // this.workflowClient.setXBayaEngine(this);
-
-
-        // Set up the GUI.
-        updateXBayaConfigurationServiceURLs();
-        XBayaEngine.this.gui = new XBayaGUI(XBayaEngine.this);
-
-        // Arguments errors.
-        for (Throwable e : this.configuration.getErrors()) {
-            getGUI().getErrorWindow().error(e.getMessage(), e);
-        }
-
-        // Initialization after the GUI setup.
-        initAfterGUI();
-    }
-
-    /**
-     * Returns the configuration.
-     *
-     * @return The configuration
-     */
-    public XBayaConfiguration getConfiguration() {
-        return this.configuration;
-    }
-
-    /**
-     * Returns the XwfGui. The XwfGui is either XwfAppletGui in case of the applet, or XwfApplicationGui in case of the
-     * application.
-     *
-     * @return the XwfGui
-     */
-    public XBayaGUI getGUI() {
-        return this.gui;
-    }
-
-    /**
-     * Returns the Workflow Client.
-     *
-     * @return the Workflow Client
-     */
-    public WorkflowClient getWorkflowClient() {
-        return this.workflowClient;
-    }
-
-
-    /**
-     * Returns the monitor.
-     *
-     * @return The monitor
-     */
-    public Monitor getMonitor() {
-        return this.monitor;
-    }
-
-    /**
-     * Disposes on exit.
-     *
-     * @throws WorkflowException
-     */
-    public void dispose() throws WorkflowException {
-        this.monitor.stop();
-    }
-
-    /**
-     * Initialization process. This method is called after the GUI is initialized.
-     */
-    private void initAfterGUI() {
-
-        initRegistry();
-
-        initMonitor();
-
-    }
-
-    /**
-     * Initializes registris.
-     */
-    private void initRegistry() {
-
-        componentTreeViewer = this.gui.getComponentSelector();
-        try {
-            this.componentRegistry = new SystemComponentRegistry();
-            // This does not take time, so we can do it in the same thread.
-            this.systemComponentTree = ComponentController.getComponentTree(this.componentRegistry);
-            componentTreeViewer.addComponentTree(0, this.systemComponentTree);
-
-            componentTreeViewer.addComponentTree(1, ComponentController.getComponentTree(new AmazonComponentRegistry()));
-
-        } catch (RuntimeException e) {
-            // This should not happen
-            e.printStackTrace();
-            getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-        } catch (ComponentRegistryException e) {
-        	e.printStackTrace();
-            getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-		}
-
-        List<String> localRegistryPaths = this.configuration.getLocalRegistry();
-        for (String path : localRegistryPaths) {
-            try {
-                LocalComponentRegistry registry = new LocalComponentRegistry(path);
-                // XXX This might take time, so it's better to move to another
-                // thread.
-                ComponentTreeNode componentTree = ComponentController.getComponentTree(registry);
-                componentTreeViewer.addComponentTree(componentTree);
-            } catch (ComponentRegistryException e) {
-                getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
-            } catch (RuntimeException e) {
-                getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            }
-        }
-    }
-
-    /**
-     * Initializes monitor.
-     */
-    private void initMonitor() {
-        try {
-            if (this.configuration.isStartMonitor()) {
-                MonitorStarter starter = new MonitorStarter(this);
-                starter.start();
-            }
-        } catch (RuntimeException e) {
-            getGUI().getErrorWindow().error(ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
-        } catch (Error e) {
-            getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-        }
-    }
-
-    public void resetWorkflowInterpreter() {
-		this.workflowInterpreter = null;
-	}
-    
-    
-	public WorkflowInterpreter getWorkflowInterpreter() {
-		return workflowInterpreter;
-	}
-
-	public void registerWorkflowInterpreter(WorkflowInterpreter workflowInterpreter) {
-		if (getWorkflowInterpreter()!=null){
-			throw new WorkflowRuntimeException("Critical Error!!! Workflow interpretter already running. Cleanup first");
-		}
-		this.workflowInterpreter = workflowInterpreter;
-	}
-
-	
-	public void updateXBayaConfigurationServiceURLs() {
-		try {
-			if (this.getConfiguration().getAiravataAPI()!=null){
-                airavataAPI = getConfiguration().getAiravataAPI();
-                AiravataManager airavataManager = airavataAPI.getAiravataManager();
-//                AiravataRegistry2 registry=this.getConfiguration().getJcrComponentRegistry().getRegistry();
-	        	URI eventingServiceURL = airavataManager.getEventingServiceURL();
-				if (eventingServiceURL!=null) {
-					this.getConfiguration().setBrokerURL(eventingServiceURL);
-					this.getMonitor()
-							.getConfiguration()
-							.setBrokerURL(eventingServiceURL);
-				}
-				URI messageBoxServiceURL = airavataManager.getMessageBoxServiceURL();
-				if (messageBoxServiceURL!=null) {
-					this.getConfiguration()
-					.setMessageBoxURL(messageBoxServiceURL);
-					this.getMonitor()
-							.getConfiguration()
-							.setMessageBoxURL(messageBoxServiceURL);
-				}
-				List<URI> interpreterServiceURLList = airavataManager.getWorkflowInterpreterServiceURLs();
-				if (interpreterServiceURLList.size()>0) {
-					this.getConfiguration()
-							.setWorkflowInterpreterURL(interpreterServiceURLList.get(0));
-				}
-//				List<URI> gfacURLList = airavataManager.getGFaCURLs();
-//				if (gfacURLList.size()>0) {
-//					this.getConfiguration().setGFacURL(gfacURLList.get(0));
-//				}
-			}
-        } catch (Exception e) {
-			e.printStackTrace();
-		}
-	}
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-    
-    public void reloadRegistry(){
-    	componentTreeViewer.refresh();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
deleted file mode 100644
index 5e34672..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya;
-
-import org.apache.airavata.common.utils.Version;
-
-public class XBayaVersion {
-
-    /**
-     * Version number
-     */
-    public final static Version VERSION = new Version("Airavata XBaya", 0, 11,
-			null, null, null);;
-
-    /**
-     * Prints the version
-     * 
-     * @param args
-     */
-    public static void main(String[] args) {
-        System.out.println(VERSION);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentController.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentController.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentController.java
deleted file mode 100644
index adeaa92..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentController.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.component.registry;
-
-import java.util.List;
-
-import org.apache.airavata.workflow.model.component.ComponentReference;
-import org.apache.airavata.workflow.model.component.ComponentRegistry;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
-
-public class ComponentController {
-
-	public static ComponentTreeNode getComponentTree(ComponentRegistry registry) throws ComponentRegistryException {
-		ComponentTreeNode tree = new ComponentTreeNode(registry);
-		addComponentReferencesToTree(tree, registry.getComponentReferenceList());
-		return tree;
-	}
-
-	private static void addComponentReferencesToTree(ComponentTreeNode tree,
-			List<ComponentReference> componentReferenceList) {
-		for (ComponentReference componentReference : componentReferenceList) {
-			ComponentTreeNode componentTreeNode = new ComponentTreeNode(componentReference);
-			if (componentReference.isParentComponent()){
-				addComponentReferencesToTree(componentTreeNode, componentReference.getChildComponentReferences());
-			}
-			tree.add(componentTreeNode);
-		}
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
deleted file mode 100644
index b0f44e9..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.component.registry;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Observable;
-import java.util.Observer;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.workflow.model.component.ComponentRegistry;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
-import org.apache.airavata.xbaya.ui.utils.Cancelable;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ComponentRegistryLoader implements Cancelable, Observer {
-
-    private static final Logger logger = LoggerFactory.getLogger(ComponentRegistryLoader.class);
-
-    private XBayaEngine engine;
-
-    private Thread loadThread;
-
-    private boolean canceled;
-
-    private WaitDialog loadingDialog;
-    
-    private ComponentTreeNode componentTree;
-
-    private Observable observableRegistry;
-    
-    private Map<String,ComponentTreeNode> componentTreeNodesMap;
-    
-    private static Map<String, ComponentRegistryLoader> loaders;
-    
-    /**
-     * Constructs a WorkflowLoader.
-     * 
-     * @param engine
-     */
-    private ComponentRegistryLoader(XBayaEngine engine) {
-        this.setEngine(engine);
-
-        this.loadingDialog = new WaitDialog(this, "Loading a Component List.", "Loading a Component List. "
-                + "Please wait for a moment.", this.getEngine().getGUI());
-        getEngine().getConfiguration().addObserver(this);
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
-     */
-    public void cancel() {
-        this.canceled = true;
-        this.loadThread.interrupt();
-    }
-
-    /**
-     * Loads the workflow.
-     * 
-     * @param registry
-     * 
-     */
-    public void load(final ComponentRegistry registry) {
-        this.canceled = false;
-        
-        this.loadThread = new Thread() {
-            @Override
-            public void run() {
-                runInThread(registry);
-            }
-        };
-        this.loadThread.start();
-        
-        if (!getComponentTreeNodesMap().containsKey(registry.getName())) {
-			// This has to be the last because it blocks when the dialog is modal.
-			this.loadingDialog.show();
-		}
-    }
-
-    /**
-     * @param registry
-     */
-    /**
-     * TODO : this method triggered twice when connecting to the registy. We need to find
-     *  why it is happening
-     */
-    private synchronized void runInThread(ComponentRegistry registry) {
-        try {
-            this.getEngine().getGUI().getComponentSelector().removeComponentRegistry(registry.getName());
-//            if (getComponentTreeNodesMap().containsKey(registry.getName())){
-//        		this.getEngine().getGUI().getComponentSelector().removeComponentTree(getComponentTreeNodesMap().get(registry.getName()));
-//        		getComponentTreeNodesMap().remove(registry.getName());
-//        	}
-            componentTree = ComponentController.getComponentTree(registry);
-            if (this.canceled) {
-                return;
-            }
-            this.getEngine().getGUI().getComponentSelector().addComponentTree(componentTree);
-//            getComponentTreeNodesMap().put(registry.getName(),componentTree);
-            this.loadingDialog.hide();
-        } catch (ComponentRegistryException e) {
-            if (this.canceled) {
-                logger.error(e.getMessage(), e);
-            } else {
-                this.getEngine().getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
-                this.loadingDialog.hide();
-            }
-        } catch (RuntimeException e) {
-            if (this.canceled) {
-                logger.error(e.getMessage(), e);
-            } else {
-                this.getEngine().getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
-                this.loadingDialog.hide();
-            }
-        } catch (Error e) {
-            this.getEngine().getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
-            this.loadingDialog.hide();
-        }
-    }
-
-	@Override
-	public void update(Observable observable, Object o) {
-		if ((observable instanceof XBayaConfiguration) && (o instanceof ComponentRegistry)){
-			ComponentRegistry componentRegistry=(ComponentRegistry)o;
-			if (observableRegistry!=null){
-				observableRegistry.deleteObserver(this);
-			}
-			if (componentRegistry instanceof JCRComponentRegistry){
-				AiravataAPI registry = ((JCRComponentRegistry)componentRegistry).getAiravataAPI();
-				if (registry!=null && registry instanceof Observable){
-					(observableRegistry=(Observable)registry).addObserver(this);
-				}
-			}
-			load(componentRegistry);
-		}else if (observable instanceof AiravataAPI){
-			load(getEngine().getConfiguration().getJcrComponentRegistry());
-		}
-	}
-	
-	public XBayaEngine getEngine() {
-		return engine;
-	}
-
-	public void setEngine(XBayaEngine engine) {
-		this.engine = engine;
-	}
-
-	public Map<String,ComponentTreeNode> getComponentTreeNodesMap() {
-		if (componentTreeNodesMap==null){
-			componentTreeNodesMap=new HashMap<String, ComponentTreeNode>();
-		}
-		return componentTreeNodesMap;
-	}
-
-	protected static Map<String, ComponentRegistryLoader> getLoaders() {
-		if (loaders==null){
-			loaders=new HashMap<String, ComponentRegistryLoader>();
-		}
-		return loaders;
-	}
-
-	public static ComponentRegistryLoader getLoader(XBayaEngine engine, String id){
-		if (!getLoaders().containsKey(id)){
-			getLoaders().put(id, new ComponentRegistryLoader(engine));
-		}
-		return getLoaders().get(id);
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedExecutable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedExecutable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedExecutable.java
deleted file mode 100644
index 6a06c19..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedExecutable.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.xbaya.concurrent;
-
-/**
- * Intended for jobs that are runnable; Way of determining
- * whether a given job is ready to be executed
- *
- * @author Chathura Herath
- */
-public interface PredicatedExecutable extends Runnable{
-
-	public boolean isReady();
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedTaskRunner.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedTaskRunner.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedTaskRunner.java
deleted file mode 100644
index 1bed1f4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedTaskRunner.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.xbaya.concurrent;
-
-import java.util.concurrent.ConcurrentLinkedQueue;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * Used to run jobs that need to be started after a predicate is
- *
- * @author Chathura Herath
- */
-public class PredicatedTaskRunner {
-
-	protected volatile ConcurrentLinkedQueue<PredicatedExecutable> jobQueue = new ConcurrentLinkedQueue<PredicatedExecutable>();
-
-	protected ExecutorService threadPool;
-
-	protected volatile boolean stop = false;
-
-	public PredicatedTaskRunner(int numberOfThreads) {
-		this.threadPool = Executors.newFixedThreadPool(numberOfThreads);
-		addIdleTask();
-		startCheckThread();
-
-	}
-
-	private void addIdleTask() {
-		PredicatedExecutable sleepTask = new PredicatedExecutable() {
-
-			@Override
-			public void run() {
-				synchronized (jobQueue) {
-					if (jobQueue.size() == 1) {
-						try {
-							jobQueue.wait();
-						} catch (InterruptedException e) {
-							Thread.currentThread().interrupt();
-						}
-					} else if (allTasksAreWaiting(jobQueue)) {
-						try {
-							Thread.sleep(50);
-						} catch (InterruptedException e) {
-							Thread.currentThread().interrupt();
-						}
-					}
-				}
-
-			}
-
-			private boolean allTasksAreWaiting(
-					ConcurrentLinkedQueue<PredicatedExecutable> jobQueue) {
-				for (PredicatedExecutable predicatedExecutable : jobQueue) {
-					if (predicatedExecutable.isReady()) {
-						return false;
-					}
-				}
-				return true;
-
-			}
-
-			@Override
-			public boolean isReady() {
-				// TODO Auto-generated method stub
-				return true;
-			}
-		};
-
-		this.jobQueue.add(sleepTask);
-	}
-
-	private void startCheckThread() {
-		new Thread(new Runnable() {
-
-			@Override
-			public void run() {
-
-				while (!stop) {
-					try {
-
-
-						synchronized (jobQueue) {
-							while(jobQueue.size() == 0 || allTasksAreWaiting(jobQueue)){
-								jobQueue.wait(50);
-							}
-						}
-
-						PredicatedExecutable job = jobQueue.remove();
-						if (job.isReady()) {
-							// remove from front and execute and you are done
-							threadPool.execute(job);
-						} else {
-							// add to end if not ready to run
-							jobQueue.add(job);
-						}
-
-
-
-					} catch (Throwable e) {
-						// we go on no matter what
-						e.printStackTrace();
-					}
-				}
-
-			}
-		}).start();
-	}
-
-	private  boolean allTasksAreWaiting(
-			ConcurrentLinkedQueue<PredicatedExecutable> jobQueue) {
-		for (PredicatedExecutable predicatedExecutable : jobQueue) {
-			if (predicatedExecutable.isReady()) {
-				return false;
-			}
-		}
-		return true;
-
-	}
-
-	public void scedule(PredicatedExecutable job) {
-
-		synchronized (jobQueue) {
-			this.jobQueue.add(job);
-			this.jobQueue.notifyAll();
-		}
-
-	}
-
-	public void shutDown() {
-		this.threadPool.shutdown();
-		this.stop = true;
-	}
-
-}


[87/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceSkeleton.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceSkeleton.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceSkeleton.java
new file mode 100644
index 0000000..a2eb271
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceSkeleton.java
@@ -0,0 +1,186 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox;
+
+import java.io.StringReader;
+import java.sql.SQLException;
+import java.util.List;
+
+import org.apache.airavata.wsmg.commons.MsgBoxQNameConstants;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.msgbox.Storage.MsgBoxStorage;
+import org.apache.airavata.wsmg.msgbox.util.ConfigKeys;
+import org.apache.airavata.wsmg.msgbox.util.MsgBoxCommonConstants;
+import org.apache.airavata.wsmg.msgbox.util.MsgBoxUtils;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.service.Lifecycle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import sun.beans.editors.LongEditor;
+
+/**
+ * Service class for MsgBoxService this get called by MsgBoxServiceMessageReceiverInOut with ProcessingContext
+ */
+public class MsgBoxServiceSkeleton implements Lifecycle {
+
+    private static final Logger logger = LoggerFactory.getLogger(MsgBoxServiceSkeleton.class);
+    private static final String TRUE = Boolean.toString(true);
+    private static final String FALSE = Boolean.toString(false);
+    private static OMFactory factory = OMAbstractFactory.getOMFactory();
+    private MsgBoxStorage storage;
+    private Thread deletingThread;
+    private boolean stop;
+
+    public void init(ServiceContext context) throws AxisFault {
+        this.storage = (MsgBoxStorage) context.getConfigurationContext().getProperty(
+                MsgBoxCommonConstants.MSGBOX_STORAGE);
+        logger.debug("Starting cleanup thread for Message Box...");
+        deletingThread = new Thread(new DeleteOldMessageRunnable(context.getConfigurationContext().getProperty(ConfigKeys.MSG_PRESV_INTERVAL)));
+        deletingThread.start();
+    }
+
+    public void destroy(ServiceContext context) {
+        this.storage = null;
+
+        // stop Deleting thread
+        this.stop = true;
+        this.deletingThread.interrupt();
+
+        try {
+            deletingThread.join();
+        } catch (Exception e) {
+            logger.error("Cannot shutdown cleanup thread", e);
+        }
+    }
+
+    public OMElement createMsgBox() throws Exception {
+        try {
+            String createdMsgBoxId = storage.createMsgBox();
+
+            logger.debug("MsgBox created:" + createdMsgBoxId);
+
+            /*
+             * Output response
+             */
+            OMElement dd = factory.createOMElement(MsgBoxQNameConstants.CREATE_MSGBOX_RESP_QNAME);
+            OMElement url = factory.createOMElement(MsgBoxQNameConstants.MSG_BOXID_QNAME);
+            url.setText(createdMsgBoxId);
+            dd.addChild(url);
+            return dd;
+        } catch (Exception e) {
+            logger.error("Error creating the message box", e);
+            AxisFault f = new AxisFault("Error creating the message box", "6000", e);
+            throw f;
+        }
+
+    }
+
+    public OMElement storeMessages(String msgBoxAddr, String messageID, String soapAction, OMElement message)
+            throws Exception {
+        OMElement resp = factory.createOMElement(MsgBoxQNameConstants.STOREMSG_RESP_QNAME);
+        OMElement status = factory.createOMElement(MsgBoxQNameConstants.MSGBOX_STATUS_QNAME);
+        try {
+            storage.putMessageIntoMsgBox(msgBoxAddr, messageID, soapAction, message);
+
+            logger.debug("Put Message to MsgBox:" + msgBoxAddr + " with messageID:" + messageID);
+
+            status.setText(TRUE);
+        } catch (SQLException e) {
+            logger.error("Error while storing message: " + message + " in msgbx: " + msgBoxAddr, e);
+            status.setText(FALSE);
+
+            // FIXME: Should we throw exception?? or client will read false
+            // status
+        }
+        resp.addChild(status);
+        resp.declareNamespace(NameSpaceConstants.MSG_BOX);
+        return resp;
+    }
+
+    public OMElement takeMessages(String msgBoxAddr) throws Exception {
+        try {
+            OMElement respEl = factory.createOMElement(MsgBoxQNameConstants.TAKE_MSGBOX_RESP_QNAME);
+            OMElement messageSet = factory.createOMElement(MsgBoxQNameConstants.MSGBOX_MESSAGE_QNAME);
+
+            List<String> list = storage.takeMessagesFromMsgBox(msgBoxAddr);
+            if (list != null && list.size() != 0) {
+                for (String string : list) {
+                    messageSet.addChild(MsgBoxUtils.reader2OMElement(new StringReader(string)));
+                }
+                logger.debug("Take all messages from MsgBox:" + msgBoxAddr);
+            } else {
+                logger.debug("  no messages..  ");
+            }
+            respEl.addChild(messageSet);
+            respEl.declareNamespace(NameSpaceConstants.MSG_BOX);
+            return respEl;
+        } catch (Exception e) {
+            logger.error("Error taking mesages of message box: " + msgBoxAddr, e);
+            throw e;
+        }
+    }
+
+    public OMElement destroyMsgBox(String msgBoxAddr) throws Exception {
+        OMElement respEl = factory.createOMElement(MsgBoxQNameConstants.DESTROY_MSGBOX_RESP_QNAME);
+        OMElement statusEl = factory.createOMElement(MsgBoxQNameConstants.MSGBOX_STATUS_QNAME);
+        String addr = msgBoxAddr;
+        try {
+            storage.destroyMsgBox(addr);
+            logger.debug("Destry MsgBox:" + msgBoxAddr);
+            statusEl.setText(TRUE);
+        } catch (Exception e) {
+            logger.warn("Error while delete msgbx: " + msgBoxAddr, e);
+            statusEl.setText(FALSE);
+
+            // FIXME: Should we throw exception?? or client will read false
+            // status
+        }
+        respEl.addChild(statusEl);
+        return respEl;
+    }
+
+    class DeleteOldMessageRunnable implements Runnable {
+        long longInterval = 60 * 60 * 1000;
+        DeleteOldMessageRunnable(Object inveral){
+          longInterval = (Long)inveral;
+        }
+        public void run() {
+            while (!stop) {
+                try {
+                        // try to remove old message
+                    if (storage != null) {
+                        storage.removeAncientMessages();
+                    }
+                    Thread.sleep(longInterval);
+                } catch (Exception e) {
+                    logger.warn("Msgbox cleanup thread is interrupted to close");
+                }
+            }
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/MsgBoxStorage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/MsgBoxStorage.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/MsgBoxStorage.java
new file mode 100644
index 0000000..e095e3c
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/MsgBoxStorage.java
@@ -0,0 +1,59 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox.Storage;
+
+import java.util.List;
+
+import org.apache.axiom.om.OMElement;
+
+/**
+ * Message Box storage backend. This has implemented in two ways in-memory and database.
+ */
+public interface MsgBoxStorage {
+    public String createMsgBox() throws Exception;
+
+    public void destroyMsgBox(String key) throws Exception;
+
+    /**
+     * IMPORTANT::: List retrieved from this method is sorted by time in ascending order i.e the newest message will
+     * appear as the last item in the list.
+     * 
+     * @param key
+     * @return
+     * @throws Exception
+     */
+    public List<String> takeMessagesFromMsgBox(String key) throws Exception;
+
+    public void putMessageIntoMsgBox(String msgBoxID, String messageID, String soapAction, OMElement message)
+            throws Exception;
+
+    /**
+     * The ancientness is defined in the db.config file.
+     */
+    public void removeAncientMessages() throws Exception;
+
+    /**
+     * Clean up method
+     */
+    public void dispose();
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/DatabaseStorageImpl.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/DatabaseStorageImpl.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/DatabaseStorageImpl.java
new file mode 100644
index 0000000..2cec984
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/DatabaseStorageImpl.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox.Storage.dbpool;
+
+import java.io.IOException;
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.sql.SQLNonTransientConnectionException;
+import java.util.List;
+import java.util.UUID;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.airavata.wsmg.commons.storage.DatabaseCreator;
+import org.apache.airavata.wsmg.commons.storage.JdbcStorage;
+import org.apache.airavata.wsmg.msgbox.Storage.MsgBoxStorage;
+import org.apache.axiom.om.OMElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Database message Storage Implementation, if airavata-server.properties configured to use database this will set as the storage
+ * for MsgBoxSerivceSkeleton
+ */
+public class DatabaseStorageImpl implements MsgBoxStorage {
+
+    private static final Logger logger = LoggerFactory.getLogger(DatabaseStorageImpl.class);
+
+    private static final String TABLE_NAME_TO_CHECK = "msgbox";
+
+    private JdbcStorage db;
+
+    public DatabaseStorageImpl(String jdbcUrl, String jdbcDriver, long timeOfOldMessage) {
+        db = new JdbcStorage(10, 50, jdbcUrl, jdbcDriver, true);
+
+        Connection conn = null;
+        try {
+
+            /*
+             * Check database
+             */
+            conn = db.connect();
+            if (!DatabaseCreator.isDatabaseStructureCreated(TABLE_NAME_TO_CHECK, conn)) {
+                DatabaseCreator.createMsgBoxDatabase(conn);
+                logger.info("New Database created for Message Box");
+            } else {
+                logger.debug("Database already created for Message Box!");
+            }
+
+            MessageBoxDB.initialize(db, timeOfOldMessage);
+
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure");
+        } finally {
+            db.closeConnection(conn);
+        }
+    }
+
+    public String createMsgBox() throws SQLException, IOException {
+        String uuid = UUID.randomUUID().toString();
+        MessageBoxDB.getInstance().createMsgBx(uuid);
+        return uuid;
+    }
+
+    public void destroyMsgBox(String key) throws Exception {
+        try {
+            MessageBoxDB.getInstance().deleteMessageBox(key);
+        } catch (SQLException e) {
+            throw new Exception("Could not destroy the message box with key " + key, e);
+        }
+    }
+
+    public List<String> takeMessagesFromMsgBox(String key) throws Exception {
+        List<String> list = null;
+
+        try {
+            list = MessageBoxDB.getInstance().removeAllMessagesforClient(key);
+
+        }catch(SQLNonTransientConnectionException e){
+            logger.warn("Database connection is interrupted");
+        } catch (SQLException e) {
+            throw new Exception("Error reading the message with the key " + key, e);
+        } catch (IOException e) {
+            throw new Exception("Error reading the message with the key " + key, e);
+        }
+
+        return list;
+    }
+
+    public void putMessageIntoMsgBox(String msgBoxID, String messageID, String soapAction, OMElement message)
+            throws SQLException, IOException, XMLStreamException {
+        MessageBoxDB.getInstance().addMessage(msgBoxID, messageID, soapAction, message);
+    }
+
+    public void removeAncientMessages() throws Exception {
+        MessageBoxDB.getInstance().removeAncientMessages();
+    }
+
+    public void dispose() {
+        if (db != null) {
+            db.closeAllConnections();
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/MessageBoxDB.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/MessageBoxDB.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/MessageBoxDB.java
new file mode 100644
index 0000000..9cf15c8
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/dbpool/MessageBoxDB.java
@@ -0,0 +1,265 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox.Storage.dbpool;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.sql.*;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.airavata.wsmg.commons.storage.JdbcStorage;
+import org.apache.axiom.om.OMElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This is the core class which used by DatabaseStorageImpl to perform all the service operations, DatabaseStorageImpl
+ * class simply use this class in its operation methods to perform the actual functionality.
+ */
+public class MessageBoxDB {
+
+    private static final String MSGBOXES_TABLENAME = "msgBoxes";
+    private static final String    MSGBOX_TABLENAME = "msgbox";
+
+    private static final String    MSGBOX_TABLE_ID = "MSGBOXID";
+
+    private static final Logger logger = LoggerFactory.getLogger(MessageBoxDB.class);
+
+    private static Set<String> msgBoxids;
+
+    public static final String SELECT_ALL_FROM_MSGBOXES = "SELECT * FROM " + MSGBOXES_TABLENAME;
+
+    public static final String SQL_CREATE_MSGBOXES_STATEMENT = "INSERT INTO " + MSGBOXES_TABLENAME
+            + " (msgboxid) VALUES (?)";
+
+    public static final String SQL_DELETE_MSGBOXES_STATEMENT = "DELETE FROM " + MSGBOXES_TABLENAME
+            + " WHERE msgboxid = ?";
+
+    public static final String SQL_STORE_MESSAGE_STATEMENT = "INSERT INTO " + MSGBOX_TABLENAME
+            + " (content, msgboxid, messageid,soapaction) VALUES (?,?,?,?)";
+
+    public static final String SQL_SELECT_MSGBOX_STATEMENT = "SELECT * FROM " + MSGBOX_TABLENAME
+            + " WHERE msgboxid = ? ORDER BY time";
+
+    public static final String SQL_DELETE_MSGBOX_STATEMENT = "DELETE FROM " + MSGBOX_TABLENAME + " WHERE msgboxid = ?";
+
+    public static final String SQL_DELETE_ANCIENT_STATEMENT = "DELETE FROM " + MSGBOX_TABLENAME
+            + " WHERE {fn TIMESTAMPDIFF(SQL_TSI_SECOND, time, CURRENT_TIMESTAMP) }*1000000 > ?";
+
+    private JdbcStorage db;
+
+    private static MessageBoxDB instance;
+
+    private long time;
+
+    private MessageBoxDB(JdbcStorage db, long time) {
+        this.db = db;
+        this.time = time;
+    }
+
+    public static synchronized MessageBoxDB initialize(JdbcStorage db, long time) throws SQLException {
+        if (instance == null) {
+            instance = new MessageBoxDB(db, time);
+            setMsgBoxidList(db);
+        }
+        return instance;
+    }
+
+    public static MessageBoxDB getInstance() {
+        if (instance == null) {
+            throw new RuntimeException("Please initialize this object first using initialize(JdbcStorage, long)");
+        }
+        return instance;
+    }
+
+    public synchronized void createMsgBx(String messageBoxId) throws SQLException, IOException {
+        if (!msgBoxids.contains(messageBoxId)) {
+
+            Connection connection = null;
+            try {
+                logger.debug(MSGBOXES_TABLENAME + ":" + messageBoxId);
+
+                connection = db.connect();
+                PreparedStatement statement = connection.prepareStatement(SQL_CREATE_MSGBOXES_STATEMENT);
+                statement.setString(1, messageBoxId);
+                db.executeUpdateAndClose(statement);
+                db.commitAndFree(connection);
+
+                msgBoxids.add(messageBoxId);
+
+            } catch (SQLException sql) {
+                db.rollbackAndFree(connection);
+                throw sql;
+            }
+        } else {
+            throw new IOException("The message box ID requested already exists");
+        }
+    }
+
+    public synchronized void addMessage(String msgBoxID, String messageID, String soapAction, OMElement message)
+            throws SQLException, IOException, XMLStreamException {
+        if (msgBoxids.contains(msgBoxID)) {
+
+            Connection connection = null;
+            try {
+                connection = db.connect();
+                PreparedStatement stmt = connection.prepareStatement(SQL_STORE_MESSAGE_STATEMENT);
+                ByteArrayOutputStream output = new ByteArrayOutputStream();
+                ObjectOutputStream out = new ObjectOutputStream(output);
+                out.writeObject(message.toStringWithConsume());
+                byte[] buffer = output.toByteArray();
+                ByteArrayInputStream in = new ByteArrayInputStream(buffer);
+                stmt.setBinaryStream(1, in, buffer.length);
+                stmt.setString(2, msgBoxID);
+                stmt.setString(3, messageID);
+                stmt.setString(4, soapAction);
+
+                db.executeUpdateAndClose(stmt);
+                db.commitAndFree(connection);
+
+            } catch (SQLException sql) {
+                db.rollbackAndFree(connection);
+                throw sql;
+            }
+        } else {
+            throw new IOException("Currently a messagebox is not available with given message box id :" + msgBoxID + message.toStringWithConsume());
+        }
+    }
+
+    public synchronized void deleteMessageBox(String msgBoxId) throws SQLException {
+
+        if (msgBoxids.contains(msgBoxId)) {
+
+            Connection connection = null;
+            try {
+                connection = db.connect();
+                PreparedStatement statement = connection.prepareStatement(SQL_DELETE_MSGBOXES_STATEMENT);
+                statement.setString(1, msgBoxId);
+                db.executeUpdateAndClose(statement);
+                statement = connection.prepareStatement(SQL_DELETE_MSGBOX_STATEMENT);
+                statement.setString(1, msgBoxId);
+                db.executeUpdateAndClose(statement);
+
+                // commit
+                db.commitAndFree(connection);
+
+                // remove from set
+                msgBoxids.remove(msgBoxId);
+
+            } catch (SQLException sql) {
+                db.rollbackAndFree(connection);
+                throw sql;
+            }
+        }
+    }
+
+    public synchronized List<String> removeAllMessagesforClient(String msgBoxId) throws SQLException, IOException,
+            ClassNotFoundException, XMLStreamException {
+        ArrayList<String> list = new ArrayList<String>();
+        if (msgBoxids.contains(msgBoxId)) {
+
+            Connection connection = null;
+            PreparedStatement stmt = null;
+            PreparedStatement stmt2 = null;
+            try {
+                connection = db.connect();
+                stmt = connection.prepareStatement(SQL_SELECT_MSGBOX_STATEMENT);
+                stmt.setString(1, msgBoxId);
+                ResultSet resultSet = stmt.executeQuery();
+                while (resultSet.next()) {
+                    InputStream in = resultSet.getAsciiStream("content");
+                    ObjectInputStream s = new ObjectInputStream(in);
+                    String xmlString = (String) s.readObject();
+                    logger.debug(xmlString);
+                    list.add(xmlString);
+                }
+
+                /*
+                 * Delete all retrieved messages
+                 */
+                stmt2 = connection.prepareStatement(SQL_DELETE_MSGBOX_STATEMENT);
+                stmt2.setString(1, msgBoxId);
+                stmt2.executeUpdate();
+
+                // commit
+                db.commit(connection);
+            } catch(SQLNonTransientConnectionException e){
+                logger.warn("Database connection is interrupted");
+            } catch (SQLException sql) {
+                db.rollback(connection);
+                throw sql;
+            } finally {
+
+                /*
+                 * If there is error during query, close everything and throw error
+                 */
+                db.quietlyClose(connection, stmt, stmt2);
+            }
+        }
+        return list;
+    }
+
+    public synchronized void removeAncientMessages() {
+        Connection connection = null;
+        try {
+            connection = db.connect();
+            PreparedStatement stmt = connection.prepareStatement(SQL_DELETE_ANCIENT_STATEMENT);
+            stmt.setLong(1, this.time);
+            db.executeUpdateAndCloseWithPrintLogMessages(stmt, false);
+            db.commitAndFree(connection);
+        } catch (SQLException sql) {
+            db.rollbackAndFree(connection);
+            logger.error("Caught exception while removing old entries from msgbox db table", sql);
+        }
+    }
+
+    private static void setMsgBoxidList(JdbcStorage db) throws SQLException {
+        msgBoxids = new HashSet<String>();
+
+        Connection connection = null;
+        PreparedStatement stmt = null;
+        try {
+            connection = db.connect();
+            stmt = connection.prepareStatement(SELECT_ALL_FROM_MSGBOXES);
+            ResultSet resultSet = stmt.executeQuery();
+            while (resultSet.next()) {
+                msgBoxids.add(resultSet.getString("msgboxid"));
+            }
+            db.commit(connection);
+        } catch (SQLException e) {
+            db.rollback(connection);
+            throw e;
+        } finally {
+            db.quietlyClose(connection, stmt);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/memory/InMemoryImpl.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/memory/InMemoryImpl.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/memory/InMemoryImpl.java
new file mode 100644
index 0000000..7406ce4
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/Storage/memory/InMemoryImpl.java
@@ -0,0 +1,133 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox.Storage.memory;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.airavata.wsmg.msgbox.Storage.MsgBoxStorage;
+import org.apache.axiom.om.OMElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This is the in memory storage implementation for MsgBoxService, this will be initialized if airavata-server.properties is
+ * configured not to use database implementation.
+ */
+public class InMemoryImpl implements MsgBoxStorage {
+    private static final Logger logger = LoggerFactory.getLogger(InMemoryImpl.class);
+
+    private HashMap<String, List<Content>> map = new HashMap<String, List<Content>>();
+
+    private long time;
+
+    public InMemoryImpl(long time) {
+        this.time = time;
+    }
+
+    public String createMsgBox() throws Exception {
+        synchronized (map) {
+            String clientid = UUID.randomUUID().toString();
+            if (map.containsKey(clientid))
+                throw new Exception("Message Box is existed with key:" + clientid);
+            map.put(clientid, new ArrayList<Content>());
+            return clientid;
+        }
+    }
+
+    public void destroyMsgBox(String key) throws Exception {
+        synchronized (map) {
+            map.remove(key);
+        }
+    }
+
+    public List<String> takeMessagesFromMsgBox(String key) throws Exception {
+        synchronized (map) {
+            List<Content> x = map.get(key);
+            ArrayList<String> result = new ArrayList<String>(x.size());
+            for (Content content : x) {
+                result.add(content.getContent());
+            }
+            map.put(key, new ArrayList<Content>());
+            return result;
+        }
+    }
+
+    public void putMessageIntoMsgBox(String msgBoxID, String messageID, String soapAction, OMElement message)
+            throws Exception {
+        synchronized (map) {
+            if (!map.containsKey(msgBoxID)) {
+                throw new IllegalArgumentException("no message box with key " + msgBoxID + " to store the msg");
+            }
+            List<Content> list = map.get(msgBoxID);
+            list.add(new Content(message.toStringWithConsume(), System.currentTimeMillis()));
+            logger.debug("Message Stored in list with key " + msgBoxID);
+        }
+    }
+
+    public void removeAncientMessages() {
+        /*
+         * O(n^2) algorithms. Better performance can be achieved with more Cache.
+         */
+        synchronized (map) {
+            long currentTime = System.currentTimeMillis();
+            Iterator<List<Content>> it = map.values().iterator();
+            while (it.hasNext()) {
+                Iterator<Content> itToRemove = it.next().iterator();
+                while (itToRemove.hasNext()) {
+                    Content content = itToRemove.next();
+                    if (currentTime - this.time > content.getTime()) {
+                        itToRemove.remove();
+                    }
+                }
+            }
+        }
+    }
+
+    public void dispose() {
+        synchronized (map) {
+            map.clear();
+        }
+    }
+
+    class Content {
+        private String content;
+        private long time;
+
+        public Content(String content, long time) {
+            this.content = content;
+            this.time = time;
+        }
+
+        public String getContent() {
+            return content;
+        }
+
+        public long getTime() {
+            return time;
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/StoreMessageHandler.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/StoreMessageHandler.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/StoreMessageHandler.java
new file mode 100644
index 0000000..51a60ae
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/StoreMessageHandler.java
@@ -0,0 +1,123 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox;
+
+import java.util.List;
+
+import org.apache.airavata.wsmg.commons.MsgBoxQNameConstants;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.AddressingFaultsHelper;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.dispatchers.AddressingBasedDispatcher;
+import org.apache.axis2.engine.Phase;
+import org.apache.axis2.util.JavaUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This Dispatcher is used to validate the incoming message, this is set to Handler list in MsgBoxServiceLifeCycle.
+ */
+public class StoreMessageHandler extends AddressingBasedDispatcher {
+    private static final Logger logger = LoggerFactory.getLogger(StoreMessageHandler.class);
+    private static final String WSMG_MSGSTORE_SOAP_ACTION = MsgBoxQNameConstants.STOREMSG_QNAME.getNamespaceURI()
+            + MsgBoxQNameConstants.STOREMSG_QNAME.getLocalPart();
+    private static final String ADDRESSING_VALIDATE_ACTION = "addressing.validateAction";
+
+    private Phase addressingPhase;
+    private AxisOperation messageBoxOperation;
+
+    public org.apache.axis2.engine.Handler.InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
+
+        InvocationResponse response = InvocationResponse.CONTINUE;
+        if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null) {
+
+            boolean validateAction = JavaUtils.isTrue(msgContext.getProperty(ADDRESSING_VALIDATE_ACTION), true);
+            msgContext.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(false));
+
+            response = super.invoke(msgContext);
+
+            if (isForMessageBoxService(msgContext))
+                validateMsgBoxStoreOperation(msgContext);
+            if (validateAction)
+                checkAction(msgContext);
+            msgContext.setProperty(ADDRESSING_VALIDATE_ACTION, Boolean.valueOf(validateAction));
+
+        }
+        return response;
+    }
+
+    private void validateMsgBoxStoreOperation(MessageContext msgContext) {
+        if (msgContext.getAxisOperation() == null) {
+            AxisService service = msgContext.getAxisService();
+            AxisOperation storeMsgOperation = getMessageBoxOperation(service);
+
+            msgContext.setAxisOperation(storeMsgOperation);
+        }
+    }
+
+    private boolean isForMessageBoxService(MessageContext msgContext) {
+        return msgContext.getAxisService() != null && msgContext.getAxisService().getName().equals("MsgBoxService");
+    }
+
+    private AxisOperation getMessageBoxOperation(AxisService msgBoxService) {
+        if (messageBoxOperation == null)
+            messageBoxOperation = msgBoxService.getOperationBySOAPAction(WSMG_MSGSTORE_SOAP_ACTION);
+        return messageBoxOperation;
+    }
+
+    private void checkAction(MessageContext msgContext) throws AxisFault {
+
+        Phase addPhase = getAddressingPhase(msgContext);
+
+        if (addPhase == null) {
+            logger.error("unable to locate addressing phase object");
+        }
+        if (msgContext != null) {
+            if (msgContext.getCurrentPhaseIndex() + 1 == addPhase.getHandlerCount()) {
+                if (msgContext.getAxisService() == null || msgContext.getAxisOperation() == null)
+                    AddressingFaultsHelper.triggerActionNotSupportedFault(msgContext, msgContext.getWSAAction());
+            }
+        }
+    }
+
+    private Phase getAddressingPhase(MessageContext context) {
+
+        if (addressingPhase == null) {
+
+            List<Phase> inFlowPhases = context.getConfigurationContext().getAxisConfiguration().getPhasesInfo()
+                    .getINPhases();
+
+            for (Phase p : inFlowPhases) {
+                if (p.getName().equalsIgnoreCase("Addressing")) {
+                    addressingPhase = p;
+                }
+            }
+
+        }
+
+        return addressingPhase;
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/ConfigKeys.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/ConfigKeys.java
new file mode 100644
index 0000000..7069f40
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/ConfigKeys.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox.util;
+
+public class ConfigKeys {
+//    public static final String CONFIG_FILE_NAME = "airavata-server.properties";
+    public static final String MSG_PRESV_DAYS = "messagePreservationDays";
+    public static final String MSG_PRESV_HRS = "messagePreservationHours";
+    public static final String MSG_PRESV_MINS = "messagePreservationMinutes";
+    public static final String MSG_BOX_JDBC_DRIVER = "msgBox.jdbc.driver";
+    public static final String MSG_BOX_JDBC_URL = "msgBox.jdbc.url";
+    public static final String USE_DATABASE_STORAGE = "msgBox.usedatabase";
+    public static final String MSG_PRESV_INTERVAL_DAYS = "messagePreservationIntervalDays";
+    public static final String MSG_PRESV_INTERVAL_HRS = "messagePreservationIntervalHours";
+    public static final String MSG_PRESV_INTERVAL_MINS = "messagePreservationIntervalMinutes";
+    public static final String MSG_PRESV_INTERVAL = "messagePreservationInterval";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxCommonConstants.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxCommonConstants.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxCommonConstants.java
new file mode 100644
index 0000000..cd63b83
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxCommonConstants.java
@@ -0,0 +1,26 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox.util;
+
+public class MsgBoxCommonConstants {
+    public static final String MSGBOX_STORAGE = "msgbox.storage";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxOperations.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxOperations.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxOperations.java
new file mode 100644
index 0000000..6e74c2e
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxOperations.java
@@ -0,0 +1,53 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox.util;
+
+public enum MsgBoxOperations {
+    STORE_MSGS("storeMessages"), DESTROY_MSGBOX("destroyMsgBox"), TAKE_MSGS("takeMessages"), CREATE_MSGBOX(
+            "createMsgBox");
+
+    private final String name;
+
+    private MsgBoxOperations(String n) {
+        name = n;
+    }
+
+    public String toString() {
+        return name;
+    }
+
+    public boolean equals(String s) {
+        return name.equals(s);
+    }
+
+    public static MsgBoxOperations valueFrom(String s) {
+        for (MsgBoxOperations status : MsgBoxOperations.values()) {
+            if (status.toString().equalsIgnoreCase(s)) {
+                return status;
+            }
+
+        }
+
+        throw new RuntimeException("invalid WsEventingOperation:- " + s);
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxUtils.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxUtils.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxUtils.java
new file mode 100644
index 0000000..8b523a0
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/util/MsgBoxUtils.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox.util;
+
+import java.io.Reader;
+
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
+
+public class MsgBoxUtils {
+
+    public static SOAPEnvelope reader2SOAPEnvilope(Reader reader) throws XMLStreamException {
+        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+        XMLStreamReader inflow = inputFactory.createXMLStreamReader(reader);
+
+        StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(inflow);
+        SOAPEnvelope omEnvelope = builder.getSOAPEnvelope();
+        return omEnvelope;
+    }
+
+    public static OMElement reader2OMElement(Reader reader) throws XMLStreamException {
+        XMLInputFactory inputFactory = XMLInputFactory.newInstance();
+        XMLStreamReader inflow = inputFactory.createXMLStreamReader(reader);
+
+        StAXOMBuilder builder = new StAXOMBuilder(inflow);
+        OMElement omElement = builder.getDocumentElement();
+        return omElement;
+    }
+
+    public static String formatMessageBoxUrl(String msgBoxServiceUrl, String msgboxId) {
+        return msgBoxServiceUrl.endsWith("/") ? msgBoxServiceUrl + "clientid/" + msgboxId : msgBoxServiceUrl
+                + "/clientid/" + msgboxId;
+    }
+
+    public static String formatURLString(String url) {
+
+        if (url == null) {
+            throw new IllegalArgumentException("url can't be null");
+        }
+
+        if (url.indexOf("//") < 0) {
+            url = "http://" + url; // use default http
+        }
+        return url;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-derby.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-derby.sql b/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-derby.sql
new file mode 100644
index 0000000..d1ff141
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-derby.sql
@@ -0,0 +1,41 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+CREATE TABLE MSGBOXES (
+  MSGBOXID VARCHAR(100) NOT NULL DEFAULT '',
+  PRIMARY KEY  (MSGBOXID)
+); 
+
+CREATE TABLE MSGBOX (
+  ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
+  CONTENT BLOB,
+  MSGBOXID VARCHAR(100) NOT NULL DEFAULT '',
+  MESSAGEID VARCHAR(100) DEFAULT '',
+  SOAPACTION VARCHAR(100) DEFAULT '',
+  TIME TIMESTAMP ,
+  PRIMARY KEY  (ID))
+;
+
+CREATE TRIGGER MESSAGE_TIME
+  AFTER INSERT ON MSGBOX
+  REFERENCING NEW AS NEW
+  FOR EACH ROW MODE DB2SQL
+    UPDATE MSGBOX SET TIME = CURRENT_TIMESTAMP WHERE ID = NEW.ID;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-mysql.sql b/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-mysql.sql
new file mode 100755
index 0000000..a2f730b
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/resources/database_scripts/msgBox-mysql.sql
@@ -0,0 +1,42 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+CREATE DATABASE IF NOT EXISTS wsmg;
+
+DROP TABLE IF EXISTS msgBoxes;
+
+CREATE TABLE `msgBoxes` (
+  `msgboxid` varchar(100) NOT NULL default '',
+  PRIMARY KEY  (`msgboxid`)
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+DROP TABLE IF EXISTS msgbox;
+
+CREATE TABLE `msgbox` (
+  `id` int(11) NOT NULL auto_increment,
+  `content` longblob NOT NULL,
+  `msgboxid` varchar(100) NOT NULL default '""',
+  `messageid` varchar(100) default '""',
+  `soapaction` varchar(100) default '""',
+  `time` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
+  PRIMARY KEY  (`id`),
+  KEY `MSGBOXID` (`msgboxid`)
+) ENGINE=MyISAM AUTO_INCREMENT=7665 DEFAULT CHARSET=latin1;

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/resources/services.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/resources/services.xml b/modules/ws-messenger/messagebox/src/main/resources/services.xml
new file mode 100644
index 0000000..18dc22e
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/resources/services.xml
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+   http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+
+-->
+<serviceGroup>
+    <service name="MsgBoxService" scope="application" class="org.apache.airavata.wsmg.msgbox.MsgBoxServiceLifeCycle">
+        <messageReceivers>
+            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.airavata.wsmg.msgbox.MsgBoxServiceMessageReceiverInOut" />
+        </messageReceivers>
+        <parameter name="ServiceClass">org.apache.airavata.wsmg.msgbox.MsgBoxServiceSkeleton
+        </parameter>
+        <parameter name="useOriginalwsdl">false</parameter>
+        <parameter name="modifyUserWSDLPortAddress">true</parameter>
+        <operation name="storeMessages" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://org.apache.airavata/ws-messenger/msgbox/2011/">
+            <actionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/storeMessages
+            </actionMapping>
+            <outputActionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/storeMessagesResponse
+            </outputActionMapping>
+        </operation>
+        <operation name="destroyMsgBox" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://org.apache.airavata/ws-messenger/msgbox/2011/">
+            <actionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/destroyMsgBox
+            </actionMapping>
+            <outputActionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/destroyMsgBoxResponse
+            </outputActionMapping>
+        </operation>
+        <operation name="takeMessages" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://org.apache.airavata/ws-messenger/msgbox/2011/">
+            <actionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/takeMessages
+            </actionMapping>
+            <outputActionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/takeMessagesResponse
+            </outputActionMapping>
+        </operation>
+        <operation name="createMsgBox" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://org.apache.airavata/ws-messenger/msgbox/2011/">
+            <actionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/createMsgBox
+            </actionMapping>
+            <outputActionMapping>http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/createMsgBoxResponse
+            </outputActionMapping>
+        </operation>
+    </service>
+
+</serviceGroup>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/InMemoryMessageBoxServer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/InMemoryMessageBoxServer.java b/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/InMemoryMessageBoxServer.java
new file mode 100644
index 0000000..0ba8d43
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/InMemoryMessageBoxServer.java
@@ -0,0 +1,157 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.InOutAxisOperation;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+
+public class InMemoryMessageBoxServer {
+    private static int count = 0;
+
+    private static SimpleHTTPServer receiver;
+
+    public static int TESTING_PORT = 7630;
+
+    public static final String FAILURE_MESSAGE = "Intentional Failure";
+
+    public static synchronized void deployService(AxisService service) throws AxisFault {
+        receiver.getConfigurationContext().getAxisConfiguration().addService(service);
+    }
+
+    public static synchronized void unDeployService(QName service) throws AxisFault {
+        receiver.getConfigurationContext().getAxisConfiguration().removeService(service.getLocalPart());
+    }
+
+    public static synchronized void start(String repository, String axis2xml) throws Exception {
+        if (count == 0) {
+            ConfigurationContext er = getNewConfigurationContext(repository, axis2xml);
+            TESTING_PORT = getAvailablePort();
+            receiver = new SimpleHTTPServer(er, TESTING_PORT);
+
+            try {
+                receiver.start();
+                System.out.print("Server started on port " + TESTING_PORT + ".....");
+            } catch (Exception e) {
+                throw AxisFault.makeFault(e);
+            }
+
+            try {
+                Thread.sleep(2000);
+            } catch (InterruptedException e1) {
+                throw new AxisFault("Thread interuptted", e1);
+            }
+            startMessageBox();
+        }
+        count++;
+    }
+
+    public static void startMessageBox() throws Exception {
+
+        /*
+         * Imitate service.xml
+         */
+        AxisService axisService = new AxisService("MsgBoxService");
+        axisService.setServiceLifeCycle(new MsgBoxServiceLifeCycle());
+        axisService.addParameter("ServiceClass", "org.apache.airavata.wsmg.msgbox.MsgBoxServiceSkeleton");
+        createOperation(axisService, "storeMessages", new MsgBoxServiceMessageReceiverInOut(),
+                "http://org.apache.airavata/ws-messenger/msgbox/2011/storeMessages",
+                "http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/storeMessagesResponse");
+        createOperation(axisService, "destroyMsgBox", new MsgBoxServiceMessageReceiverInOut(),
+                "http://org.apache.airavata/ws-messenger/msgbox/2011/destroyMsgBox",
+                "http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/destroyMsgBoxResponse");
+        createOperation(axisService, "takeMessages", new MsgBoxServiceMessageReceiverInOut(),
+                "http://org.apache.airavata/ws-messenger/msgbox/2011/takeMessages",
+                "http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/takeMessagesResponse");
+        createOperation(axisService, "createMsgBox", new MsgBoxServiceMessageReceiverInOut(),
+                "http://org.apache.airavata/ws-messenger/msgbox/2011/createMsgBox",
+                "http://org.apache.airavata/ws-messenger/msgbox/2011/MsgBoxPT/createMsgBoxResponse");
+
+        InMemoryMessageBoxServer.deployService(axisService);
+
+        new MsgBoxServiceLifeCycle().startUp(InMemoryMessageBoxServer.getConfigurationContext(), axisService);
+
+    }
+
+    public static void createOperation(AxisService axisService, String name, MessageReceiver messageReceiver,
+            String inputAction, String outputAction) {
+        InOutAxisOperation operation1 = new InOutAxisOperation(new QName(name));
+        operation1.setMessageReceiver(messageReceiver);
+        operation1.setOutputAction(outputAction);
+        axisService.addOperation(operation1);
+        if (inputAction != null) {
+            axisService.mapActionToOperation(inputAction, operation1);
+        }
+    }
+
+    public static ConfigurationContext getNewConfigurationContext(String repository, String axis2xml) throws Exception {
+        return ConfigurationContextFactory.createConfigurationContextFromFileSystem(repository, axis2xml);
+    }
+
+    public static synchronized void stop() throws AxisFault {
+        if (count == 1) {
+            receiver.stop();
+            while (receiver.isRunning()) {
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e1) {
+                    // nothing to do here
+                }
+            }
+            count = 0;
+            // tp.doStop();
+            System.out.print("Server stopped .....");
+        } else {
+            count--;
+        }
+        receiver.getConfigurationContext().terminate();
+    }
+
+    public static ConfigurationContext getConfigurationContext() {
+        return receiver.getConfigurationContext();
+    }
+
+    public static String prefixBaseDirectory(String path) {
+        return path;
+    }
+
+      public static int getAvailablePort(){
+        ServerSocket serverSocket = null;
+        try {
+             serverSocket = new ServerSocket(0);
+             serverSocket.close();
+        } catch (IOException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+        return serverSocket.getLocalPort();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MessageBoxStressTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MessageBoxStressTest.java b/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MessageBoxStressTest.java
new file mode 100644
index 0000000..715b90c
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MessageBoxStressTest.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox;
+
+import java.io.StringReader;
+import java.util.Iterator;
+import java.util.UUID;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.wsmg.msgbox.client.MsgBoxClient;
+import org.apache.airavata.wsmg.msgbox.util.MsgBoxUtils;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.ServiceClient;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class MessageBoxStressTest extends TestCase {
+    private int port = InMemoryMessageBoxServer.TESTING_PORT;
+    private long timeout = 5000L;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        InMemoryMessageBoxServer.start(null, null);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public void testMessageBox() throws Exception {
+
+        MsgBoxClient user = new MsgBoxClient();
+        port = InMemoryMessageBoxServer.TESTING_PORT;
+        // test publish with Epr
+        EndpointReference msgBoxEpr = user.createMessageBox("http://localhost:" + port
+                + "/axis2/services/MsgBoxService", timeout);
+
+        System.out.println(msgBoxEpr.toString());
+        user.storeMessage(msgBoxEpr, timeout,
+                MsgBoxUtils.reader2OMElement(new StringReader("<test>A simple test message</test>")));
+
+        Iterator<OMElement> iterator = user.takeMessagesFromMsgBox(msgBoxEpr, timeout);
+        int i = 0;
+        if (iterator != null)
+            while (iterator.hasNext()) {
+                i++;
+                System.out.println("Retrieved message :" + i);
+                System.out.println(iterator.next().toStringWithConsume());
+            }
+
+
+        // test invocations with id encoded in the Url
+//        port = InMemoryMessageBoxServer.getAvailablePort();
+//        user = new MsgBoxClient();
+//        msgBoxEpr = user.createMessageBox("http://localhost:" + port + "/axis2/services/MsgBoxService", timeout);
+        String msgBoxId = UUID.randomUUID().toString();
+        String address = msgBoxEpr.getAddress();
+        int biginIndex = address.indexOf("clientid");
+        if (biginIndex != -1) {
+            msgBoxId = address.substring(biginIndex + "clientid".length() + 1);
+        }
+        System.out.println("MSGBOX ID:" + msgBoxId);
+
+        String mesgboxUrl = "http://localhost:" + port + "/axis2/services/MsgBoxService/clientid/" + msgBoxId;
+
+        OMElement request = OMAbstractFactory.getOMFactory().createOMElement(new QName("foo"));
+        request.setText("bar");
+        ServiceClient client = null;
+
+        try {
+            client = new ServiceClient();
+            System.out.println(mesgboxUrl);
+            client.getOptions().setTo(new EndpointReference(mesgboxUrl));
+            OMElement response = client.sendReceive(request);
+        } finally {
+            client.cleanupTransport();
+        }
+
+        iterator = user.takeMessagesFromMsgBox(new EndpointReference(mesgboxUrl), timeout);
+        assertTrue(iterator.hasNext());
+        while (iterator.hasNext()) {
+            i++;
+            System.out.println("Retrieved message :" + i);
+            System.out.println(iterator.next().toStringWithConsume());
+        }
+        assertFalse(iterator.hasNext());
+
+        System.out.println("Delete message box response :  " + user.deleteMsgBox(msgBoxEpr, timeout));
+        System.out.println("All tests Done");
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MsgBoxTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MsgBoxTest.java b/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MsgBoxTest.java
new file mode 100644
index 0000000..b3a3f4c
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/test/java/org/apache/airavata/wsmg/msgbox/MsgBoxTest.java
@@ -0,0 +1,103 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox;
+
+import java.io.StringReader;
+import java.util.Iterator;
+import java.util.Random;
+
+import junit.framework.TestCase;
+
+import org.apache.airavata.wsmg.msgbox.client.MsgBoxClient;
+import org.apache.airavata.wsmg.msgbox.util.MsgBoxUtils;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.addressing.EndpointReference;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class MsgBoxTest extends TestCase {
+
+    private int port = InMemoryMessageBoxServer.TESTING_PORT;
+    private long timeout = 5000L;
+
+    @BeforeClass
+    public static void setUpBeforeClass() throws Exception {
+
+    }
+
+    @AfterClass
+    public static void tearDownAfterClass() throws Exception {
+    }
+
+    @Before
+    public void setUp() throws Exception {
+        InMemoryMessageBoxServer.start(null, null);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+    }
+
+    @Test
+    public void testMessageBox() throws Exception {
+
+        MsgBoxClient user = new MsgBoxClient();
+        StringBuilder builder = new StringBuilder();
+        port = InMemoryMessageBoxServer.TESTING_PORT;
+        EndpointReference msgBoxEpr = user.createMessageBox("http://localhost:" + port
+                + "/axis2/services/MsgBoxService", timeout);
+
+        for (int i = 0; i < 10; i++) {
+
+            builder.delete(0, builder.capacity());
+            Random x = new Random();
+            for (int j = 0; j < x.nextInt(50); j++) {
+                builder.append("123456789");
+            }
+
+            String msg = String.format("<msg><seq>%d</seq><fill>%s</fill></msg>", i, builder.toString());
+
+            user.storeMessage(msgBoxEpr, timeout, MsgBoxUtils.reader2OMElement(new StringReader(msg)));
+
+            Thread.sleep(200L);
+        }
+
+        Iterator<OMElement> iterator = null;
+
+        try {
+            iterator = user.takeMessagesFromMsgBox(msgBoxEpr, timeout);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        if (iterator != null)
+            while (iterator.hasNext()) {
+                System.out.println(iterator.next().toStringWithConsume());
+            }
+
+        System.out.println("Delete message box response :  " + user.deleteMsgBox(msgBoxEpr, 5000L));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/pom.xml b/modules/ws-messenger/messagebroker/pom.xml
new file mode 100644
index 0000000..df779a1
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/pom.xml
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
+    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+    the License. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>airavata-ws-messenger</artifactId>
+        <version>0.12-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>airavata-message-broker</artifactId>
+    <name>Airavata Message Broker</name>
+    <url>http://airavata.apache.org/</url>
+    <packaging>jar</packaging>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <version>${antrun.version}</version>
+                <executions>
+                    <execution>
+                        <id>restore-persistence</id>
+                        <phase>prepare-package</phase>
+                        <configuration>
+                            <tasks>
+                                <copy file="${project.build.outputDirectory}/services.xml" tofile="${project.build.outputDirectory}/META-INF/services.xml" />
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-messenger-commons</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-client-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-common-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-messenger-client</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>yfilter</artifactId>
+            <version>${yfilter.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>wsdl4j</groupId>
+            <artifactId>wsdl4j</artifactId>
+            <version>1.5.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-http</artifactId>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-local</artifactId>
+        </dependency>
+
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <!-- Test -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+	    <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-server-configuration</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <properties>
+        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+    </properties>
+</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AbstractBrokerMsgReceiver.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AbstractBrokerMsgReceiver.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AbstractBrokerMsgReceiver.java
new file mode 100644
index 0000000..9277dcc
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AbstractBrokerMsgReceiver.java
@@ -0,0 +1,105 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker;
+
+import java.util.List;
+
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.engine.AxisEngine;
+import org.apache.axis2.receivers.AbstractMessageReceiver;
+import org.apache.axis2.util.MessageContextBuilder;
+
+public abstract class AbstractBrokerMsgReceiver extends AbstractMessageReceiver {
+
+    protected abstract MessageContext process(MessageContext inMsgContext, String operationName) throws AxisFault;
+
+    @Override
+    protected void invokeBusinessLogic(MessageContext inMsgContext) throws AxisFault {
+
+        String operationName = getOperationName(inMsgContext);
+        MessageContext outMsgContext = process(inMsgContext, operationName);
+
+        if (outMsgContext != null) {
+            outMsgContext.setTo(null);
+            super.replicateState(inMsgContext);
+            AxisEngine.send(outMsgContext);
+
+        }
+
+    }
+
+    protected String getOperationName(MessageContext inMsg) throws AxisFault {
+
+        org.apache.axis2.description.AxisOperation op = inMsg.getOperationContext().getAxisOperation();
+        if (op == null) {
+            throw new AxisFault(
+                    "Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
+        }
+
+        java.lang.String operationName = null;
+        if ((op.getName() == null)
+                || ((operationName = org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName().getLocalPart())) == null)) {
+            throw new AxisFault("invalid operation found");
+        }
+
+        return operationName;
+    }
+
+    protected MessageContext createOutputMessageContext(MessageContext inMsg, ProcessingContext processingContext)
+            throws AxisFault {
+
+        MessageContext outMsgContext = MessageContextBuilder.createOutMessageContext(inMsg);
+        outMsgContext.getOperationContext().addMessageContext(outMsgContext);
+
+        SOAPEnvelope outputEnvelope = getSOAPFactory(inMsg).getDefaultEnvelope();
+
+        if (processingContext.getRespMessage() != null) {
+
+            outputEnvelope.getBody().addChild(processingContext.getRespMessage());
+
+            if (processingContext.getResponseMsgNamespaces() != null) {
+                declareResponseMsgNamespace(outputEnvelope, processingContext.getResponseMsgNamespaces());
+            }
+        }
+
+        outMsgContext.setEnvelope(outputEnvelope);
+        return outMsgContext;
+    }
+
+    private void declareResponseMsgNamespace(SOAPEnvelope outputEnvelope, List<OMNamespace> namespaces) {
+
+        if (!namespaces.contains(NameSpaceConstants.WSA_NS)) {
+            namespaces.add(NameSpaceConstants.WSA_NS);// declare WSA by default
+        }
+
+        for (OMNamespace ns : namespaces) {
+            outputEnvelope.declareNamespace(ns);
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AdditionalMessageContent.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AdditionalMessageContent.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AdditionalMessageContent.java
new file mode 100644
index 0000000..acf8f0f
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/AdditionalMessageContent.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker;
+
+import java.io.Serializable;
+
+public class AdditionalMessageContent implements Serializable {
+    /**
+	 * 
+	 */
+    private static final long serialVersionUID = -5163025283681463108L;
+
+    String action;
+
+    String messageID;
+
+    String topicElement;
+
+    String producerReference;
+    String trackId;
+
+    /**
+     * @param action
+     * @param messageID
+     */
+    public AdditionalMessageContent(String action, String messageID) {
+        super();
+        // TODO Auto-generated constructor stub
+        this.action = action;
+        this.messageID = messageID;
+    }
+
+    /**
+     * @return Returns the action.
+     */
+    public String getAction() {
+        return action;
+    }
+
+    /**
+     * @param action
+     *            The action to set.
+     */
+    public void setAction(String action) {
+        this.action = action;
+    }
+
+    /**
+     * @return Returns the messageID.
+     */
+    public String getMessageID() {
+        return messageID;
+    }
+
+    /**
+     * @param messageID
+     *            The messageID to set.
+     */
+    public void setMessageID(String messageID) {
+        this.messageID = messageID;
+    }
+
+    /**
+     * @return Returns the producerReference.
+     */
+    public String getProducerReference() {
+        return producerReference;
+    }
+
+    /**
+     * @param producerReference
+     *            The producerReference to set.
+     */
+    public void setProducerReference(String producerReference) {
+        this.producerReference = producerReference;
+    }
+
+    /**
+     * @return Returns the topicElement.
+     */
+    public String getTopicElement() {
+        return topicElement;
+    }
+
+    /**
+     * @param topicElement
+     *            The topicElement to set.
+     */
+    public void setTopicElement(String topicElement) {
+        this.topicElement = topicElement;
+    }
+
+    /**
+     * @return Returns the trackId.
+     */
+    public String getTrackId() {
+        return trackId;
+    }
+
+    /**
+     * @param trackId
+     *            The trackId to set.
+     */
+    public void setTrackId(String trackId) {
+        this.trackId = trackId;
+    }
+
+    public String toString() {
+        return String.format("msgId = %s, trackId = %s, topic = %s", messageID, trackId, topicElement);
+    }
+
+}


[08/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java
deleted file mode 100644
index 1dca11e..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GFacServiceCreaterTestCase.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.utils.IOUtil;
-import org.apache.airavata.common.utils.WSDLUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.invoker.GenericInvoker;
-import org.apache.airavata.xbaya.invoker.Invoker;
-import org.apache.airavata.xbaya.jython.lib.GFacServiceCreator;
-import org.apache.airavata.xbaya.jython.lib.NotificationSender;
-import org.apache.airavata.xbaya.jython.script.JythonScript;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class GFacServiceCreaterTestCase extends XBayaTestCase {
-
-    private static final String TEST_SERVICE_QNAME = "{http://www.extreme.indiana.edu/lead}TestCMD_Simple";
-
-    private static final String TEST_AWSDL = XBayaPathConstants.WSDL_DIRECTORY + File.separator
-            + WorkflowCreator.GFAC_TEST_AWSDL;
-
-    private static final Logger logger = LoggerFactory.getLogger(GFacServiceCreaterTestCase.class);
-
-    /**
-     * @throws WorkflowException
-     */
-    public void testCreate() throws WorkflowException {
-        URI gFacURL = this.configuration.getGFacURL();
-        URI gFacWSDLURL = WSDLUtil.appendWSDLQuary(gFacURL);
-        GFacServiceCreator creator = new GFacServiceCreator(gFacWSDLURL);
-        creator.createService(TEST_SERVICE_QNAME);
-        creator.shutdownService();
-    }
-
-    /**
-     * @throws WorkflowException
-     */
-    public void testService() throws WorkflowException {
-        NotificationSender notifier = new NotificationSender(this.configuration.getBrokerURL(), "test-topic2");
-        Invoker invoker = new GenericInvoker(QName.valueOf(TEST_SERVICE_QNAME), TEST_AWSDL, "test-node", null,
-                this.configuration.getGFacURL().toString(), notifier);
-        invoker.setup();
-        invoker.setOperation("Run");
-        invoker.setInput("inparam1", "test");
-        invoker.invoke();
-        Object output = invoker.getOutput("outparam1");
-        logger.info("output: " + output);
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws IOException
-     * @throws GraphException
-     * @throws InterruptedException
-     * @throws ComponentRegistryException
-     */
-    public void testWorkflow() throws ComponentException, IOException, GraphException, InterruptedException,
-            ComponentRegistryException {
-        WorkflowCreator creator = new WorkflowCreator();
-        Workflow workflow = creator.createGFacWorkflow();
-
-        File workflowFile = new File("tmp/gfac-test.xwf");
-        XMLUtil.saveXML(workflow.toXML(), workflowFile);
-
-        JythonScript script = new JythonScript(workflow, this.configuration);
-        script.create();
-        String jythonString = script.getJythonString();
-        String filename = "tmp/gfac-test.py";
-        IOUtil.writeToFile(jythonString, filename);
-
-        // String[] argv = new String[] { filename, "-TestCMD_Simple_wsdl",
-        // GFAC_TEST_WSDL };
-        // jython.main(argv);
-
-        String[] commands = new String[] { "./jython.sh", filename, "-TestCMD_Simple_wsdl", TEST_AWSDL };
-        Process process = Runtime.getRuntime().exec(commands);
-        int exitValue = process.waitFor();
-        logger.info("Exit value: " + exitValue);
-        InputStream inputStream = process.getInputStream();
-        String output = IOUtil.readToString(inputStream);
-        logger.info("output: " + output);
-        InputStream errorStream = process.getErrorStream();
-        String error = IOUtil.readToString(errorStream);
-        logger.info("error: " + error);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GraphTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GraphTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GraphTestCase.java
deleted file mode 100644
index e35dacf..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/GraphTestCase.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.graph.Graph;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-
-public class GraphTestCase extends TestCase {
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public void testRemoveNode() throws ComponentException, GraphException, ComponentRegistryException {
-        WorkflowCreator creator = new WorkflowCreator();
-        Workflow workflow = creator.createSimpleMathWorkflow();
-        Graph graph = workflow.getGraph();
-
-        Node node = graph.getNode("Adder_add");
-        assertNotNull(node);
-        int originalSize = graph.getPorts().size();
-        int portNum = node.getAllPorts().size();
-        graph.removeNode(node);
-
-        assertEquals(originalSize - portNum, graph.getPorts().size());
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MetadataTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MetadataTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MetadataTestCase.java
deleted file mode 100644
index 2ab432f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MetadataTestCase.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.awt.Point;
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.Component;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
-import org.apache.airavata.workflow.model.component.system.InputComponent;
-import org.apache.airavata.workflow.model.component.system.OutputComponent;
-import org.apache.airavata.workflow.model.component.ws.WSComponentPort;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.system.OutputNode;
-import org.apache.airavata.workflow.model.graph.ws.WSGraph;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
-
-public class MetadataTestCase extends TestCase {
-
-    private static final String WSDL_DIRECTORY = "/u/sshirasu/codes/appservices/gfac2/wsdls";
-
-    private static final String WRF_STATIC_PREPROCESSOR_WSDL = "WrfStaticPreprocessor.wsdl";
-
-    private static final String TERRAIN_PREPROCESSOR_WSDL = "TerrainPreprocessor.wsdl";
-
-    private static final String ADAS_INTERPOLATOR_WSDL = "ADASInterpolator.wsdl";
-
-    private static final String LATERAL_BOUNDARY_INTERPOLATOR_WSDL = "LateralBoundaryInterpolator.wsdl";
-
-    private static final String ARPS2WRF_INTERPOLATOR_WSDL = "ARPS2WRFInterpolator.wsdl";
-
-    private static final String WRF_FORECASTING_MODEL_WSDL = "WRFForecastingModel.wsdl";
-
-    private static final Logger logger = LoggerFactory.getLogger(MetadataTestCase.class);
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testWorkflow() throws ComponentException, GraphException, IOException, ComponentRegistryException {
-        Workflow workflow = createWorkflow();
-
-        File workflowFile = new File("tmp/ADASInitializedWRFForecast.xwf");
-        XMLUtil.saveXML(workflow.toXML(), workflowFile);
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testPreInvoke() throws ComponentException, GraphException, IOException, ComponentRegistryException {
-        Workflow workflow = createWorkflow();
-        workflow.createScript();
-
-        File workflowWSDLFile = new File("tmp/ADASInitializedWRFForecast-wsdl.xml");
-        XMLUtil.saveXML(workflow.getWorkflowWSDL().xml(), workflowWSDLFile);
-        File bpelFile = new File("tmp/ADASInitializedWRFForecast-bpel.xml");
-        XMLUtil.saveXML(workflow.getGpelProcess().xml(), bpelFile);
-
-        // Get the metadata for input.
-        XmlElement inputAppinfo = workflow.getInputMetadata();
-
-        // Get the input information
-        List<WSComponentPort> inputs = workflow.getInputs();
-
-        for (WSComponentPort input : inputs) {
-            // Show the information of each input.
-
-            // Name
-            String name = input.getName();
-            logger.info("name: " + name);
-
-            // Type
-            QName type = input.getType();
-            logger.info("type: " + type);
-
-            // Metadata as XML
-            XmlElement appinfo = input.getAppinfo();
-            logger.info("appinfo: " + XMLUtil.xmlElementToString(appinfo));
-
-            if (appinfo != null) {
-                // Parse the simple case.
-                for (XmlElement element : appinfo.requiredElementContent()) {
-                    String tag = element.getName();
-                    String value = element.requiredText();
-                    logger.info(tag + " = " + value);
-                }
-            }
-
-            // Set a value to each input.
-            input.setValue("200");
-        }
-    }
-
-    private Workflow createWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
-
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("ADASInitializedWRFForecast");
-        workflow.setDescription("");
-
-        WSGraph graph = workflow.getGraph();
-
-        LocalComponentRegistry componentRegistry = new LocalComponentRegistry(WSDL_DIRECTORY);
-
-        // WRF_STATIC_PREPROCESSOR_WSDL
-        Component wrfPreComp = componentRegistry.getComponent(WRF_STATIC_PREPROCESSOR_WSDL);
-        Node wrfPreNode = workflow.addNode(wrfPreComp);
-        wrfPreNode.setPosition(new Point(313, 0));
-
-        // TERRAIN_PREPROCESSOR_WSDL
-        Component terrainPreComp = componentRegistry.getComponent(TERRAIN_PREPROCESSOR_WSDL);
-        Node terrainPreNode = workflow.addNode(terrainPreComp);
-        terrainPreNode.setPosition(new Point(59, 289));
-
-        // ADAS_INTERPOLATOR_WSDL
-        Component adasIntComp = componentRegistry.getComponent(ADAS_INTERPOLATOR_WSDL);
-        Node adasIntNode = workflow.addNode(adasIntComp);
-        adasIntNode.setPosition(new Point(373, 235));
-
-        // LATERAL_BOUNDARY_INTERPOLATOR_WSDL
-        Component lateralIntComp = componentRegistry.getComponent(LATERAL_BOUNDARY_INTERPOLATOR_WSDL);
-        Node lateralIntNode = workflow.addNode(lateralIntComp);
-        lateralIntNode.setPosition(new Point(371, 369));
-
-        // ARPS2WRF_INTERPOLATOR_WSDL
-        Component arp2wrfComp = componentRegistry.getComponent(ARPS2WRF_INTERPOLATOR_WSDL);
-        Node arp2wrfNode = workflow.addNode(arp2wrfComp);
-        arp2wrfNode.setPosition(new Point(607, 104));
-
-        // WRF_FORECASTING_MODEL_WSDL
-        Component wrfComp = componentRegistry.getComponent(WRF_FORECASTING_MODEL_WSDL);
-        Node wrfNode = workflow.addNode(wrfComp);
-        wrfNode.setPosition(new Point(781, 14));
-
-        // Parameters
-        Component inputComponent = new InputComponent();
-        Component outputComponent = new OutputComponent();
-
-        // Input parameter node
-        InputNode confInput = (InputNode) workflow.addNode(inputComponent);
-        confInput.setPosition(new Point(0, 100));
-
-        // Input parameter node
-        InputNode adasInput = (InputNode) workflow.addNode(inputComponent);
-        adasInput.setPosition(new Point(286, 145));
-
-        // Input parameter node
-        InputNode namInput = (InputNode) workflow.addNode(inputComponent);
-        namInput.setPosition(new Point(179, 438));
-
-        // Output parameter
-        OutputNode outParamNode = (OutputNode) workflow.addNode(outputComponent);
-        outParamNode.setPosition(new Point(863, 169));
-
-        // Connect ports
-        graph.addEdge(confInput.getOutputPort(0), wrfPreNode.getInputPort(0));
-        graph.addEdge(confInput.getOutputPort(0), arp2wrfNode.getInputPort(0));
-        graph.addEdge(confInput.getOutputPort(0), adasIntNode.getInputPort(1));
-        graph.addEdge(confInput.getOutputPort(0), lateralIntNode.getInputPort(1));
-        graph.addEdge(confInput.getOutputPort(0), terrainPreNode.getInputPort(0));
-        graph.addEdge(terrainPreNode.getOutputPort(0), adasIntNode.getInputPort(2));
-        graph.addEdge(terrainPreNode.getOutputPort(0), lateralIntNode.getInputPort(0));
-        graph.addEdge(adasInput.getOutputPort(0), adasIntNode.getInputPort(0));
-        graph.addEdge(namInput.getOutputPort(0), lateralIntNode.getInputPort(2));
-        graph.addEdge(wrfPreNode.getOutputPort(0), arp2wrfNode.getInputPort(1));
-        graph.addEdge(adasIntNode.getOutputPort(0), arp2wrfNode.getInputPort(2));
-        graph.addEdge(lateralIntNode.getOutputPort(0), arp2wrfNode.getInputPort(3));
-        graph.addEdge(arp2wrfNode.getOutputPort(0), wrfNode.getInputPort(0));
-        graph.addEdge(wrfNode.getOutputPort(0), outParamNode.getInputPort(0));
-
-        // Add metadata
-        String inputMetadata = "<appinfo "
-                + "xmlns:lsm=\"http://www.extreme.indiana.edu/namespaces/2006/lead-service-metadata\">"
-                + "<lsm:constraints>" + "<lsm:constraint type=\"temporalSync\">"
-                + "<lsm:elementref name=\"ADASDataFiles\" />" + "<lsm:elementref name=\"NAMDataFiles\" />"
-                + "</lsm:constraint>" + "</lsm:constraints>" + "</appinfo>";
-        graph.setInputMetadata(XMLUtil.stringToXmlElement(inputMetadata));
-
-        return workflow;
-
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MonitorTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MonitorTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MonitorTestCase.java
deleted file mode 100644
index 1962104..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/MonitorTestCase.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Properties;
-
-import org.apache.airavata.workflow.tracking.Notifier;
-import org.apache.airavata.workflow.tracking.NotifierFactory;
-import org.apache.airavata.workflow.tracking.common.InvocationEntity;
-import org.apache.airavata.workflow.tracking.common.WorkflowTrackingContext;
-import org.apache.airavata.workflow.tracking.impl.state.DataObjImpl;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.axis2.addressing.EndpointReference;
-
-public class MonitorTestCase extends XBayaTestCase {
-
-    private final static URI WORKFLOW_INSTANCE_ID = URI
-            .create("tag:gpel.leadproject.org,2006:6B9/GFacTestWorkflow1/instance1");
-
-    /**
-     */
-    public void test() {
-        EndpointReference brokerEPR = WseMsgBrokerClient.createEndpointReference(this.configuration.getBrokerURL()
-                .toString(), this.configuration.getTopic());
-
-        Notifier notifier = NotifierFactory.createNotifier();
-
-        WorkflowTrackingContext context = notifier.createTrackingContext(new Properties(), brokerEPR.toString(),
-                URI.create("workflowID"), URI.create("serviceID"), "workflowNodeID", new Integer(1));
-        notifier.publishURL(context, "title", "http://www.google.com", "descriptionAndAnnotation");
-
-        notifier.workflowInitialized(context, WORKFLOW_INSTANCE_ID);
-
-        DataObjImpl dataObj = new DataObjImpl(URI.create("test"), new ArrayList<URI>());
-        notifier.dataConsumed(context, dataObj, "description");
-    }
-
-    /**
-     * 
-     */
-    public void testScalability() {
-        for (int i = 0; i < 100; i++) {
-            test();
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/ResourceNotifierTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/ResourceNotifierTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/ResourceNotifierTestCase.java
deleted file mode 100644
index 00dbcb5..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/ResourceNotifierTestCase.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.apache.airavata.workflow.tracking.Notifier;
-import org.apache.airavata.workflow.tracking.NotifierFactory;
-import org.apache.airavata.workflow.tracking.common.WorkflowTrackingContext;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-
-import org.apache.axis2.addressing.EndpointReference;
-
-public class ResourceNotifierTestCase extends XBayaTestCase {
-
-    /**
-     * 
-     */
-    public void test() {
-        EndpointReference brokerEPR = WseMsgBrokerClient.createEndpointReference(this.configuration.getBrokerURL()
-                .toString(), this.configuration.getTopic());
-        Notifier notifier = NotifierFactory.createNotifier();
-
-        URI initiatorWorkflowID = URI.create("Workflow");
-        URI initiatorServiceID = URI.create("Adder_add");
-        String initiatorWorkflowNodeID1 = "Adder_add";
-        Integer workflowTimeStep = new Integer(0);
-        WorkflowTrackingContext context = notifier.createTrackingContext(new Properties(), brokerEPR.toString(),
-                initiatorWorkflowID, initiatorServiceID, initiatorWorkflowNodeID1, workflowTimeStep);
-        notifier.resourceMapping(context, "resource1.example.com", 1, null);
-        notifier.resourceMapping(context, "resource2.example.com", 2);
-        notifier.resourceMapping(context, "resource3.example.com", 3);
-
-        String initiatorWorkflowNodeID2 = "Adder_add_2";
-        context = notifier.createTrackingContext(new Properties(), brokerEPR.toString(), initiatorWorkflowID,
-                initiatorServiceID, initiatorWorkflowNodeID2, workflowTimeStep);
-        notifier.resourceMapping(context, "resource.example.com", 0);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/StringUtilTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/StringUtilTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/StringUtilTestCase.java
deleted file mode 100644
index 0ece074..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/StringUtilTestCase.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.common.utils.StringUtil;
-
-public class StringUtilTestCase extends TestCase {
-
-    /**
-     * 
-     */
-    public void testIncrementName() {
-        String name1 = "test";
-        String name2 = StringUtil.incrementName(name1);
-        assertEquals(name2, "test_2");
-        String name3 = StringUtil.incrementName(name2);
-        assertEquals(name3, "test_3");
-
-        String name9 = "test_9";
-        String name10 = StringUtil.incrementName(name9);
-        assertEquals(name10, "test_10");
-        String name11 = StringUtil.incrementName(name10);
-        assertEquals(name11, "test_11");
-
-        String nameA = "test_a";
-        String nameA2 = StringUtil.incrementName(nameA);
-        assertEquals(nameA2, "test_a_2");
-
-        String name = "test_";
-        String name_2 = StringUtil.incrementName(name);
-        assertEquals(name_2, "test__2");
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLTestCase.java
deleted file mode 100644
index 4476474..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLTestCase.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.jython.script.JythonScript;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-import org.apache.airavata.common.utils.IOUtil;
-
-public class WSDLTestCase extends XBayaTestCase {
-
-    // private static final Logger logger = LoggerFactory.getLogger();
-
-    private WorkflowCreator graphCreater;
-
-    /*
-     * @see TestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        File tmpDir = new File("tmp");
-        tmpDir.mkdir();
-
-        this.graphCreater = new WorkflowCreator();
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testSimpleMath() throws ComponentException, GraphException, IOException, ComponentRegistryException {
-
-        Workflow workflow = this.graphCreater.createSimpleMathWorkflow();
-
-        File workflowFile = new File("tmp/simple-math.xwf");
-        XMLUtil.saveXML(workflow.toXML(), workflowFile);
-
-        // Creates a Jython script
-        File jythonFile = new File("tmp/simple-math.py");
-        JythonScript script = new JythonScript(workflow, this.configuration);
-        script.create();
-        IOUtil.writeToFile(script.getJythonString(), jythonFile);
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testComplexMath() throws ComponentException, GraphException, IOException, ComponentRegistryException {
-        Workflow workflow = this.graphCreater.createComplexMathWorkflow();
-        File graphFile = new File("tmp/complex-math.xwf");
-        XMLUtil.saveXML(workflow.toXML(), graphFile);
-
-        // Creates a Jython script
-        File jythonFile = new File("tmp/complex-math.py");
-        JythonScript script = new JythonScript(workflow, this.configuration);
-        script.create();
-        IOUtil.writeToFile(script.getJythonString(), jythonFile);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java
deleted file mode 100644
index 9386734..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSDLUtilTestCase.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.net.URI;
-
-import org.apache.airavata.common.utils.WSDLUtil;
-
-public class WSDLUtilTestCase extends XBayaTestCase {
-
-    /**
-     *
-     */
-    public void testAppendWSDLQuary() {
-        URI uri0 = URI.create("http://localhost:8080");
-        URI wsdlURI0 = WSDLUtil.appendWSDLQuary(uri0);
-        assertEquals("http://localhost:8080/?wsdl", wsdlURI0.toString());
-
-        URI uri1 = URI.create("http://localhost:8080/");
-        URI wsdlURI1 = WSDLUtil.appendWSDLQuary(uri1);
-        assertEquals("http://localhost:8080/?wsdl", wsdlURI1.toString());
-
-        URI uri2 = URI.create("http://localhost:8080/service");
-        URI wsdlURI2 = WSDLUtil.appendWSDLQuary(uri2);
-        assertEquals("http://localhost:8080/service?wsdl", wsdlURI2.toString());
-
-        URI uri3 = URI.create("http://localhost:8080/?wsdl");
-        URI wsdlURI3 = WSDLUtil.appendWSDLQuary(uri3);
-        assertEquals("http://localhost:8080/?wsdl", wsdlURI3.toString());
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSIFTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSIFTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSIFTestCase.java
deleted file mode 100644
index 4b43502..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WSIFTestCase.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import junit.framework.TestSuite;
-
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WSIFTestCase extends XBayaTestCase {
-
-    private static final Logger logger = LoggerFactory.getLogger(WSIFTestCase.class);
-
-    private ComponentTreeNode resouceCatalogComponentTree;
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(new TestSuite(WSIFTestCase.class));
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.test.XBayaTestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        this.resouceCatalogComponentTree = null;
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java
deleted file mode 100644
index 89839db..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WaitDialogTestCase.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
-import org.apache.airavata.xbaya.ui.utils.Cancelable;
-
-public class WaitDialogTestCase extends XBayaTestCase {
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        // Prevent to connect to GPEL engine every time.
-        this.configuration.setGPELEngineURL(null);
-
-        this.configuration.setHeight(200);
-        this.configuration.setWidth(200);
-    }
-
-    /**
-     * @throws InterruptedException
-     * 
-     */
-    public void testShowHide() throws InterruptedException {
-        XBayaEngine engine = new XBayaEngine(this.configuration);
-        Cancelable cancelable = new Cancelable() {
-            public void cancel() {
-                // Nothing
-            }
-        };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
-        Thread showThread = new Thread() {
-            @Override
-            public void run() {
-                dialog.show();
-            }
-
-        };
-        showThread.start();
-
-        Thread.sleep(1000);
-
-        dialog.hide();
-
-        showThread.join();
-    }
-
-    /**
-     * @throws InterruptedException
-     * 
-     */
-    public void testShowShowHide() throws InterruptedException {
-        XBayaEngine engine = new XBayaEngine(this.configuration);
-        Cancelable cancelable = new Cancelable() {
-            public void cancel() {
-                // Nothing
-            }
-        };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
-        Thread showThread1 = new Thread() {
-            @Override
-            public void run() {
-                dialog.show();
-            }
-
-        };
-
-        Thread showThread2 = new Thread() {
-            @Override
-            public void run() {
-                dialog.show();
-            }
-
-        };
-
-        Thread hideThread1 = new Thread() {
-            @Override
-            public void run() {
-                dialog.hide();
-            }
-
-        };
-
-        showThread1.start();
-        showThread2.start();
-
-        Thread.sleep(1000);
-
-        hideThread1.start();
-
-        showThread1.join();
-        showThread2.join();
-        hideThread1.join();
-    }
-
-    /**
-     * @throws InterruptedException
-     * 
-     */
-    public void testShowHideShowHide() throws InterruptedException {
-        XBayaEngine engine = new XBayaEngine(this.configuration);
-        Cancelable cancelable = new Cancelable() {
-            public void cancel() {
-                // Nothing
-            }
-        };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
-        Thread showThread1 = new Thread() {
-            @Override
-            public void run() {
-                dialog.show();
-            }
-
-        };
-
-        Thread showThread2 = new Thread() {
-            @Override
-            public void run() {
-                dialog.show();
-            }
-
-        };
-
-        Thread hideThread1 = new Thread() {
-            @Override
-            public void run() {
-                dialog.hide();
-            }
-
-        };
-
-        Thread hideThread2 = new Thread() {
-            @Override
-            public void run() {
-                dialog.hide();
-            }
-
-        };
-
-        showThread1.start();
-
-        Thread.sleep(1000);
-
-        hideThread1.start();
-
-        Thread.sleep(1000);
-        showThread2.start();
-
-        Thread.sleep(1000);
-        hideThread2.start();
-
-        showThread1.join();
-        showThread2.join();
-        hideThread1.join();
-        hideThread2.join();
-    }
-
-    /**
-     * @throws InterruptedException
-     */
-    public void testShowHideHide() throws InterruptedException {
-        XBayaEngine engine = new XBayaEngine(this.configuration);
-        Cancelable cancelable = new Cancelable() {
-            public void cancel() {
-                // Nothing
-            }
-        };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
-        Thread showThread1 = new Thread() {
-            @Override
-            public void run() {
-                dialog.show();
-            }
-
-        };
-
-        Thread hideThread1 = new Thread() {
-            @Override
-            public void run() {
-                dialog.hide();
-            }
-
-        };
-
-        Thread hideThread2 = new Thread() {
-            @Override
-            public void run() {
-                dialog.hide();
-            }
-
-        };
-
-        showThread1.start();
-
-        Thread.sleep(1000);
-
-        hideThread1.start();
-        hideThread2.start();
-
-        showThread1.join();
-        hideThread1.join();
-        hideThread2.join();
-    }
-
-    /**
-     * @throws InterruptedException
-     */
-    public void testShowShowHideHide() throws InterruptedException {
-        XBayaEngine engine = new XBayaEngine(this.configuration);
-        Cancelable cancelable = new Cancelable() {
-            public void cancel() {
-                // Nothing
-            }
-        };
-        final WaitDialog dialog = new WaitDialog(cancelable, "title", "message", engine.getGUI());
-        Thread showThread1 = new Thread() {
-            @Override
-            public void run() {
-                dialog.show();
-            }
-
-        };
-
-        Thread showThread2 = new Thread() {
-            @Override
-            public void run() {
-                dialog.show();
-            }
-
-        };
-
-        Thread hideThread1 = new Thread() {
-            @Override
-            public void run() {
-                dialog.hide();
-            }
-
-        };
-
-        Thread hideThread2 = new Thread() {
-            @Override
-            public void run() {
-                dialog.hide();
-            }
-
-        };
-
-        showThread1.start();
-        showThread2.start();
-
-        Thread.sleep(1000);
-
-        hideThread1.start();
-        hideThread2.start();
-
-        showThread1.join();
-        showThread2.join();
-        hideThread1.join();
-        hideThread2.join();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WebComponentRegistryClientTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WebComponentRegistryClientTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WebComponentRegistryClientTestCase.java
deleted file mode 100644
index 8db2612..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WebComponentRegistryClientTestCase.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.awt.Point;
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.airavata.common.utils.IOUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.Component;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.system.InputComponent;
-import org.apache.airavata.workflow.model.component.system.OutputComponent;
-import org.apache.airavata.workflow.model.component.web.WebComponentRegistry;
-import org.apache.airavata.workflow.model.graph.Graph;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.system.OutputNode;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.jython.script.JythonScript;
-import org.xmlpull.infoset.XmlElement;
-
-public class WebComponentRegistryClientTestCase extends XBayaTestCase {
-
-    /**
-     * MATH_ADDER_WSDL
-     */
-    private static final String MATH_ADDER_WSDL = "adder-wsdl.xml";
-
-    /**
-     * MATH_MULTIPLIER_WSDL
-     */
-    private static final String MATH_MULTIPLIER_WSDL = "multiplier-wsdl.xml";
-
-    private Component inputComponent;
-
-    private Component outputComponent;
-
-    private WebComponentRegistry componentRegistry;
-
-    private File temporaryDirectory;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        this.temporaryDirectory = new File("tmp");
-        this.temporaryDirectory.mkdir();
-
-        this.componentRegistry = new WebComponentRegistry(XBayaConstants.DEFAULT_WEB_REGISTRY.toURL());
-        this.componentRegistry.getComponentReferenceList(); // To read components
-        this.inputComponent = new InputComponent();
-        this.outputComponent = new OutputComponent();
-    }
-
-    /**
-     * @throws GraphException
-     * @throws ComponentException
-     * @throws IOException
-     */
-    public void testComplexMath() throws GraphException, ComponentException, IOException {
-
-        Workflow workflow = createComplexMathWorkflow();
-        File workflowFile = new File(this.temporaryDirectory, "web-complex-math.xwf");
-        XMLUtil.saveXML(workflow.toXML(), workflowFile);
-
-        // Load the same graph again from the file, saves it, and compare them.
-        XmlElement workflowElement = XMLUtil.loadXML(workflowFile);
-        Workflow workflow2 = new Workflow(workflowElement);
-        File workflowFile2 = new File(this.temporaryDirectory, "web-complex-math-2.xwf");
-        XMLUtil.saveXML(workflow2.toXML(), workflowFile2);
-
-        String workflowFileString = IOUtil.readFileToString(workflowFile);
-        String workflowFile2String = IOUtil.readFileToString(workflowFile2);
-        assertEquals(workflowFileString, workflowFile2String);
-
-        // Create a Jython script
-        File jythonFile = new File(this.temporaryDirectory, "web-complex-math.py");
-        JythonScript script = new JythonScript(workflow, this.configuration);
-        script.create();
-        IOUtil.writeToFile(script.getJythonString(), jythonFile);
-    }
-
-    /**
-     * @return The graph
-     * @throws GraphException
-     */
-    private Workflow createComplexMathWorkflow() throws GraphException {
-
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("Complex math workflow");
-        workflow.setDescription("Complex math workflow");
-
-        Graph graph = workflow.getGraph();
-
-        // Adder nodes
-        Component adderComp = this.componentRegistry.getComponents(MATH_ADDER_WSDL).get(0);
-
-        Node adderNode1 = workflow.addNode(adderComp);
-        adderNode1.setPosition(new Point(170, 50));
-
-        Node adderNode2 = workflow.addNode(adderComp);
-        adderNode2.setPosition(new Point(170, 210));
-
-        // Multiplier node
-        Component multiComp = this.componentRegistry.getComponents(MATH_MULTIPLIER_WSDL).get(0);
-
-        Node multiNode = workflow.addNode(multiComp);
-        multiNode.setPosition(new Point(320, 130));
-
-        // Parameter node 1
-        InputNode paramNode1 = (InputNode) workflow.addNode(this.inputComponent);
-        paramNode1.setPosition(new Point(20, 30));
-        String paramValue1 = "2";
-        paramNode1.setDefaultValue(paramValue1);
-
-        // Parameter node 2
-        InputNode paramNode2 = (InputNode) workflow.addNode(this.inputComponent);
-        paramNode2.setPosition(new Point(20, 100));
-        String paramValue2 = "3";
-        paramNode2.setDefaultValue(paramValue2);
-
-        // Parameter node 3
-        InputNode paramNode3 = (InputNode) workflow.addNode(this.inputComponent);
-        paramNode3.setPosition(new Point(20, 170));
-        String paramValue3 = "4";
-        paramNode3.setDefaultValue(paramValue3);
-
-        // Parameter node 4
-        InputNode paramNode4 = (InputNode) workflow.addNode(this.inputComponent);
-        paramNode4.setPosition(new Point(20, 240));
-        String paramValue4 = "5";
-        paramNode4.setDefaultValue(paramValue4);
-
-        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
-        outParamNode.setPosition(new Point(370, 240));
-
-        // Connect ports
-        graph.addEdge(paramNode1.getOutputPort(0), adderNode1.getInputPort(0));
-        graph.addEdge(paramNode2.getOutputPort(0), adderNode1.getInputPort(1));
-        graph.addEdge(paramNode3.getOutputPort(0), adderNode2.getInputPort(0));
-        graph.addEdge(paramNode4.getOutputPort(0), adderNode2.getInputPort(1));
-        graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
-        graph.addEdge(adderNode2.getOutputPort(0), multiNode.getInputPort(1));
-        graph.addEdge(multiNode.getOutputPort(0), outParamNode.getInputPort(0));
-
-        return workflow;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
deleted file mode 100644
index 737ebcf..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowModificationTestCase.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.awt.Point;
-import java.io.File;
-import java.io.IOException;
-import java.net.URI;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.airavata.common.exception.UtilsException;
-import org.apache.airavata.common.utils.WSDLUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.Component;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
-import org.apache.airavata.workflow.model.component.system.OutputComponent;
-import org.apache.airavata.workflow.model.gpel.DSCUtil;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
-import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
-import org.apache.airavata.workflow.model.graph.ws.WSGraph;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.workflow.tracking.client.Callback;
-import org.apache.airavata.workflow.tracking.client.NotificationType;
-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.workflow.tracking.impl.NotifierImpl;
-import org.apache.airavata.workflow.tracking.impl.publish.LoopbackPublisher;
-import org.apache.airavata.workflow.tracking.impl.publish.NotificationPublisher;
-import org.apache.airavata.ws.monitor.Monitor;
-import org.apache.airavata.ws.monitor.MonitorConfiguration;
-import org.apache.airavata.ws.monitor.EventDataRepository;
-import org.apache.airavata.ws.monitor.MonitorException;
-import org.apache.airavata.ws.monitor.event.Event;
-import org.apache.airavata.ws.monitor.event.Event.Type;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.modifier.WorkflowModifier;
-import org.apache.airavata.xbaya.test.service.adder.Adder;
-import org.apache.airavata.xbaya.test.service.multiplier.Multiplier;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
-import org.apache.xmlbeans.XmlObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.view.XmlValidationException;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.soap11_util.Soap11Util;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.wsif.WSIFService;
-import xsul.wsif.WSIFServiceFactory;
-import xsul.xbeans_util.XBeansUtil;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-import xsul5.wsdl.WsdlDefinitions;
-import xsul5.wsdl.WsdlResolver;
-
-public class WorkflowModificationTestCase extends XBayaTestCase {
-
-    private static final Logger logger = LoggerFactory.getLogger(WorkflowModificationTestCase.class);
-
-    private boolean gui = false;
-
-    private XBayaEngine engine;
-
-    private GraphCanvas graphCanvas;
-
-    /**
-     * @see org.apache.airavata.xbaya.test.XBayaTestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        String guiProperty = System.getProperty("xbaya.gui.test");
-        this.gui = Boolean.parseBoolean(guiProperty);
-    }
-
-    /**
-     * @throws IOException
-     * @throws ComponentRegistryException
-     * @throws GraphException
-     * @throws ComponentException
-     * @throws MonitorException
-     */
-    public void test() throws IOException, ComponentException, GraphException, ComponentRegistryException,
-            MonitorException {
-
-        WorkflowCreator creator = new WorkflowCreator();
-        Workflow workflow = creator.createComplexMathWorkflow();
-        workflow.createScript();
-
-        Monitor monitor;
-        if (this.gui) {
-            this.engine = new XBayaEngine(this.configuration);
-            this.graphCanvas = this.engine.getGUI().getGraphCanvas();
-            this.graphCanvas.setWorkflow(workflow);
-            monitor = this.engine.getMonitor();
-            this.engine.getGUI().eventReceived(new Event(Type.MONITOR_STARTED));
-            repaintAndWait(2);
-        } else {
-            MonitorConfiguration monitorConfiguration = new MonitorConfiguration(this.configuration.getBrokerURL(),
-                    this.configuration.getTopic(), this.configuration.isPullMode(),
-                    this.configuration.getMessageBoxURL());
-            monitor = new Monitor(monitorConfiguration);
-        }
-
-        EventDataRepository eventData = monitor.getEventDataRepository();
-        MonitorCallback callback = new MonitorCallback(eventData);
-        LoopbackPublisher publisher = new LoopbackPublisher(callback, this.configuration.getTopic());
-        MonitorNotifier notifier = new MonitorNotifier(publisher);
-
-        executeToMiddle(workflow, notifier);
-
-        modifyWorkflow(workflow);
-
-        File modifiedWorkflowFile = new File(this.temporalDirectory, "complex-math-modified.xwf");
-        XMLUtil.saveXML(workflow.toXML(), modifiedWorkflowFile);
-
-        // Create a diff workflow
-        WorkflowModifier modifier = new WorkflowModifier(workflow, eventData);
-        Workflow diffWorkflow = modifier.createDifference();
-
-        if (this.gui) {
-            GraphCanvas canvas = this.engine.getGUI().newGraphCanvas(true);
-            canvas.setWorkflow(diffWorkflow);
-            repaintAndWait(5);
-        }
-
-        File diffWorkflowFile = new File(this.temporalDirectory, "complex-math-diff.xwf");
-        XMLUtil.saveXML(diffWorkflow.toXML(), diffWorkflowFile);
-
-    }
-
-    private void executeToMiddle(Workflow workflow, MonitorNotifier notifier) throws XmlValidationException,
-            ComponentException {
-        WSGraph graph = workflow.getGraph();
-
-        String adder1ID = "Adder_add";
-        String adder2ID = "Adder_add_2";
-
-        NodeImpl a = graph.getNode("a");
-        NodeImpl b = graph.getNode("b");
-        NodeImpl c = graph.getNode("c");
-        NodeImpl d = graph.getNode("d");
-        NodeImpl adder = graph.getNode(adder1ID);
-        NodeImpl adder2 = graph.getNode(adder2ID);
-
-        WsdlDefinitions workflowWSDL = workflow.getWorkflowWSDL();
-        DSCUtil.convertToCWSDL(workflowWSDL, URI.create("http://example.com"));
-        HashMap<String, String> inputMap = new HashMap<String, String>();
-        inputMap.put("a", "2");
-        inputMap.put("b", "3");
-        inputMap.put("c", "4");
-        inputMap.put("d", "5");
-
-        try {
-            sendNotification(workflowWSDL, null, WSDLUtil.getFirstOperation(workflowWSDL).getName(), inputMap, null,
-                    notifier);
-        } catch (UtilsException e) {
-            e.printStackTrace();
-        }
-
-        WsdlDefinitions adderWSDL = WsdlResolver.getInstance().loadWsdl(
-                new File(XBayaPathConstants.WSDL_DIRECTORY + File.separator + Adder.WSDL_PATH).toURI());
-
-        HashMap<String, String> inputMap1 = new HashMap<String, String>();
-        inputMap1.put("x", "2");
-        inputMap1.put("y", "3");
-        HashMap<String, String> outputMap1 = new HashMap<String, String>();
-        outputMap1.put("z", "5");
-        sendNotification(adderWSDL, adder1ID, "add", inputMap1, outputMap1, notifier);
-        // These are needed because without GUI, the nodes' color won't be
-        // changed.
-        a.setState(NodeExecutionState.FINISHED);
-        b.setState(NodeExecutionState.FINISHED);
-        adder.setState(NodeExecutionState.FINISHED);
-        repaintAndWait(3);
-
-        HashMap<String, String> inputMap2 = new HashMap<String, String>();
-        inputMap2.put("x", "4");
-        inputMap2.put("y", "5");
-        HashMap<String, String> outputMap2 = new HashMap<String, String>();
-        outputMap2.put("z", "9");
-        sendNotification(adderWSDL, adder2ID, "add", inputMap2, outputMap2, notifier);
-
-        c.setState(NodeExecutionState.FINISHED);
-        d.setState(NodeExecutionState.FINISHED);
-        adder2.setState(NodeExecutionState.FINISHED);
-        repaintAndWait(3);
-    }
-
-    private void modifyWorkflow(Workflow workflow) throws ComponentException, ComponentRegistryException,
-            GraphException {
-        WSGraph graph = workflow.getGraph();
-
-        OutputComponent outputComponent = new OutputComponent();
-        LocalComponentRegistry registry = new LocalComponentRegistry(XBayaPathConstants.WSDL_DIRECTORY);
-        Component adderComponent = registry.getComponent(Adder.WSDL_PATH);
-        Component multiplierComponent = registry.getComponent(Multiplier.WSDL_PATH);
-
-        NodeImpl c = graph.getNode("c");
-        NodeImpl d = graph.getNode("d");
-        NodeImpl adder = graph.getNode("Adder_add");
-        NodeImpl adder2 = graph.getNode("Adder_add_2");
-        NodeImpl multiplier = graph.getNode("Multiplier_multiply");
-
-        // Remove Adder_2 and replace with Multiplier_2.
-        graph.removeNode(adder2);
-        repaintAndWait(1);
-
-        Node multiplier2 = workflow.addNode(multiplierComponent);
-        multiplier2.setPosition(new Point(170, 210));
-        repaintAndWait(1);
-
-        graph.addEdge(c.getOutputPort(0), multiplier2.getInputPort(0));
-        repaintAndWait(1);
-
-        graph.addEdge(d.getOutputPort(0), multiplier2.getInputPort(1));
-        repaintAndWait(1);
-
-        graph.addEdge(multiplier2.getOutputPort(0), multiplier.getInputPort(1));
-        repaintAndWait(1);
-
-        // Add one more adder and an output.
-        Node adder3 = workflow.addNode(adderComponent);
-        adder3.setPosition(new Point(320, 300));
-        repaintAndWait(1);
-
-        graph.addEdge(adder.getOutputPort(0), adder3.getInputPort(0));
-        repaintAndWait(1);
-
-        graph.addEdge(multiplier2.getOutputPort(0), adder3.getInputPort(1));
-        repaintAndWait(1);
-
-        Node output2 = workflow.addNode(outputComponent);
-        output2.setPosition(new Point(500, 300));
-        repaintAndWait(1);
-
-        graph.addEdge(adder3.getOutputPort(0), output2.getInputPort(0));
-        repaintAndWait(1);
-    }
-
-    private void sendNotification(WsdlDefinitions definitions, String nodeID, String operationName,
-            Map<String, String> inputMap, Map<String, String> outputMap, MonitorNotifier notifier) {
-
-        WSIFServiceFactory factory = WSIFServiceFactory.newInstance();
-        WSIFService service = factory.getService(WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(definitions));
-        WSIFClient client = WSIFRuntime.getDefault().newClientFor(service, null);
-        WSIFPort port = client.getPort();
-        WSIFOperation operation = port.createOperation(operationName);
-        WSIFMessage inputMessage = operation.createInputMessage();
-
-        for (String key : inputMap.keySet()) {
-            String value = inputMap.get(key);
-            inputMessage.setObjectPart(key, value);
-        }
-
-        URI myWorkflowID = null;
-        URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
-        String myNodeID = null;
-        Integer myTimestep = null;
-        InvocationEntity myEntity = notifier.createEntity(myWorkflowID, myServiceID, myNodeID, myTimestep);
-
-        URI serviceWorkflowID = null;
-        URI serviceServiceID = URI.create("ServiceID");
-        String serviceNodeID = nodeID;
-        Integer serviceTimestep = null;
-        InvocationEntity serviceEntity = notifier.createEntity(serviceWorkflowID, serviceServiceID, serviceNodeID,
-                serviceTimestep);
-        WorkflowTrackingContext workflowContext = notifier.createTrackingContext(new Properties(), this.configuration
-                .getBrokerURL().toASCIIString(), myWorkflowID, myServiceID, myNodeID, myTimestep);
-
-        XmlElement inputBody = (XmlElement) ((XmlElement) inputMessage).getParent();
-        XmlObject inputBodyObject = XBeansUtil.xmlElementToXmlObject(inputBody);
-
-        InvocationContext context = notifier.invokingService(workflowContext, serviceEntity, null, inputBodyObject);
-
-        if (outputMap != null) {
-            WSIFMessage outputMessage = operation.createOutputMessage();
-            Soap11Util.getInstance().wrapBodyContent((XmlElement) outputMessage);
-            for (String key : outputMap.keySet()) {
-                String value = outputMap.get(key);
-                outputMessage.setObjectPart(key, value);
-            }
-            XmlElement outputBody = (XmlElement) ((XmlElement) outputMessage).getParent();
-            XmlObject outputBodyObject = XBeansUtil.xmlElementToXmlObject(outputBody);
-
-            notifier.receivedResult(workflowContext, context, null, outputBodyObject);
-        }
-    }
-
-    private void repaintAndWait(int second) {
-        if (this.gui) {
-            this.graphCanvas.repaint();
-            try {
-                Thread.sleep(second * 1000);
-            } catch (InterruptedException e) {
-                logger.error(e.getMessage(), e);
-            }
-        }
-    }
-
-    private class MonitorNotifier extends NotifierImpl {
-
-        /**
-         * Constructs a MonitorNotifier.
-         * 
-         * @param publisher
-         */
-        public MonitorNotifier(NotificationPublisher publisher) {
-            super();
-        }
-    }
-
-    private class MonitorCallback implements Callback {
-
-        private EventDataRepository eventData;
-
-        /**
-         * Constructs a MonitorCallback.
-         * 
-         * @param eventData
-         */
-        public MonitorCallback(EventDataRepository eventData) {
-            this.eventData = eventData;
-        }
-
-        /**
-         * 
-         * @param topic
-         *            the topic to which this message was sent. This can also be retrieved from the messageObj XMlObject
-         *            directly after typecasting.
-         * @param type
-         * @param message
-         */
-        public void deliverMessage(String topic, NotificationType type, XmlObject message) {
-
-            XmlElement event = XBeansUtil.xmlObjectToXmlElement(message);
-            this.eventData.addEvent(XMLUtil.xmlElement3ToXmlElement5(event));
-        }
-
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowTestCase.java
deleted file mode 100644
index 8eb5092..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/WorkflowTestCase.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.graph.Graph;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.util.GraphUtil;
-import org.apache.airavata.workflow.model.graph.ws.WSNode;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
-
-public class WorkflowTestCase extends XBayaTestCase {
-
-    private static Logger logger = LoggerFactory.getLogger(WorkflowTestCase.class);
-
-    private WorkflowCreator workflowCreator;
-
-    /*
-     * @see TestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        this.workflowCreator = new WorkflowCreator();
-    }
-
-    /**
-     * @throws IOException
-     * @throws GraphException
-     * @throws ComponentException
-     */
-    public void testParse() throws IOException, GraphException, ComponentException {
-
-        File file = new File(XBayaPathConstants.WORKFLOW_DIRECTORY, "complex-math.xwf");
-        XmlElement workflowXML = XMLUtil.loadXML(file);
-
-        // Parse the workflow
-        Workflow workflow = new Workflow(workflowXML);
-
-        // Take out the graph of the workflow.
-        Graph graph = workflow.getGraph();
-
-        // Extract inputs of the workflow.
-        Collection<InputNode> inputNodes = GraphUtil.getInputNodes(graph);
-
-        for (InputNode inputNode : inputNodes) {
-
-            // Name of the input.
-            String inputName = inputNode.getName();
-            logger.info("inputName: " + inputName);
-
-            // Get next nodes.
-            Collection<Node> nextNodes = GraphUtil.getNextNodes(inputNode);
-
-            for (Node nextNode : nextNodes) {
-
-                String name = nextNode.getName();
-                logger.info("name: " + name);
-            }
-        }
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testSaveAndLoad() throws ComponentException, GraphException, IOException, ComponentRegistryException {
-
-        Workflow workflow = this.workflowCreator.createComplexMathWorkflow();
-
-        XmlElement workflowElement = workflow.toXML();
-        File file = new File(this.temporalDirectory, "complex-math.xwf");
-        XMLUtil.saveXML(workflowElement, file);
-
-        XmlElement loadedWorkflowElement = XMLUtil.loadXML(file);
-        Workflow loadedWorkflow = new Workflow(loadedWorkflowElement);
-
-        Graph loadedGraph = loadedWorkflow.getGraph();
-        Collection<WSNode> loadedWSNodes = GraphUtil.getWSNodes(loadedGraph);
-        assertTrue(loadedWSNodes.size() != 0);
-
-        for (WSNode loadedWSNode : loadedWSNodes) {
-            assertNotNull(loadedWSNode.getComponent());
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java
deleted file mode 100644
index 728151a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaSecurityTestCase.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.net.URI;
-
-import junit.framework.TestSuite;
-
-import org.apache.airavata.common.utils.WSDLUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.wsdl.WsdlResolver;
-
-public class XBayaSecurityTestCase extends XBayaTestCase {
-
-    private static final Logger logger = LoggerFactory.getLogger(XBayaSecurityTestCase.class);
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(new TestSuite(XBayaSecurityTestCase.class));
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.test.XBayaTestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        // Security related XSUL is configured in super.setUp();
-        super.setUp();
-    }
-
-    /**
-     *
-     */
-    public void testWSDL() {
-        URI gFacURL = this.configuration.getGFacURL();
-        URI gFacWSDLURL = WSDLUtil.appendWSDLQuary(gFacURL);
-        gFacWSDLURL = URI.create("https://tyr12.cs.indiana.edu:22443/data_catalog?wsdl"); // FAIL
-        gFacWSDLURL = URI.create("https://tyr12.cs.indiana.edu:9443/wcs?wsdl"); // FAIL
-        gFacWSDLURL = URI.create("https://tyr13.cs.indiana.edu:7443/gpel/"); // OK
-
-        logger.info("accessing " + gFacWSDLURL);
-        WsdlResolver.getInstance().loadWsdl(gFacWSDLURL);
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaTestCase.java
deleted file mode 100644
index 8114543..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XBayaTestCase.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.io.File;
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.slf4j.Logger;
-
-public abstract class XBayaTestCase extends TestCase {
-
-
-    protected XBayaConfiguration configuration;
-
-    protected File temporalDirectory;
-
-    /**
-     * @see junit.framework.TestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-
-        this.configuration = new XBayaConfiguration();
-
-        // tmp directory
-        this.temporalDirectory = new File("tmp/");
-        this.temporalDirectory.mkdir();
-
-        // topic
-        if (this.configuration.getTopic() == null) {
-            this.configuration.setTopic("xbaya-test");
-        }
-
-        // Overwrite some default setting.
-        String gpelURLString = System.getProperty("gpel.url");
-        if (gpelURLString != null) {
-            this.configuration.setGPELEngineURL(URI.create(gpelURLString));
-        }
-        String dscURLString = System.getProperty("dsc.url");
-        if (dscURLString != null) {
-            this.configuration.setDSCURL(URI.create(dscURLString));
-        }
-
-        String myProxyUsername = System.getProperty("myproxy.username");
-        if (myProxyUsername != null) {
-            this.configuration.setMyProxyUsername(myProxyUsername);
-        }
-        String myProxyPassphrase = System.getProperty("myproxy.passphrase");
-        if (myProxyPassphrase != null) {
-            this.configuration.setMyProxyPassphrase(myProxyPassphrase);
-        }
-
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XppTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XppTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XppTestCase.java
deleted file mode 100644
index 38df89f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/XppTestCase.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.io.IOException;
-import java.io.StringWriter;
-
-import junit.framework.TestCase;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.XmlPullParserException;
-import org.xmlpull.v1.XmlPullParserFactory;
-import org.xmlpull.v1.XmlSerializer;
-
-public class XppTestCase extends TestCase {
-
-    private static final Logger logger = LoggerFactory.getLogger(XppTestCase.class);
-
-    /*
-     * @see TestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-    }
-
-    /**
-     * @throws XmlPullParserException
-     * @throws IllegalArgumentException
-     * @throws IllegalStateException
-     * @throws IOException
-     */
-    public void testEscape() throws XmlPullParserException, IllegalArgumentException, IllegalStateException,
-            IOException {
-
-        String testString = "<tag>&lt;test/><[CDATA[<tag2/>]]></tag>";
-
-        logger.info("before:");
-        logger.info(testString);
-
-        XmlPullParserFactory xppFactory = XmlPullParserFactory.newInstance();
-        XmlSerializer xmlSerializer = xppFactory.newSerializer();
-        StringWriter stringwriter = new StringWriter();
-        xmlSerializer.setOutput(stringwriter);
-        xmlSerializer.text(testString);
-        String afterString = stringwriter.toString();
-
-        logger.info("after:");
-        logger.info(afterString);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonClassLoaderTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonClassLoaderTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonClassLoaderTestCase.java
deleted file mode 100644
index d50c9dc..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonClassLoaderTestCase.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.jython;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.xbaya.jython.runner.JythonClassLoader;
-import org.python.util.jython;
-
-public class JythonClassLoaderTestCase extends TestCase {
-
-    /**
-     * @throws ClassNotFoundException
-     */
-    public void testLoadClass() throws ClassNotFoundException {
-        JythonClassLoader loader = new JythonClassLoader(this.getClass().getClassLoader());
-
-        Class<?> newJythonClass = loader.loadClass(jython.class.getName(), true);
-        assertNotSame(jython.class, newJythonClass);
-
-        Class<?> newStringClass = loader.loadClass(String.class.getName(), true);
-        assertEquals(String.class, newStringClass);
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonLibraryTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonLibraryTest.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonLibraryTest.java
deleted file mode 100644
index 773edfc..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonLibraryTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.jython;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.invoker.GenericInvoker;
-import org.apache.airavata.xbaya.invoker.Invoker;
-import org.apache.airavata.xbaya.jython.lib.NotificationSender;
-import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
-import org.apache.airavata.xbaya.test.service.adder.AdderService;
-import org.apache.airavata.xbaya.test.service.multiplier.MultiplierService;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JythonLibraryTest extends TestCase {
-
-    private static final Logger logger = LoggerFactory.getLogger(JythonLibraryTest.class);
-
-    /**
-     * @throws WorkflowException
-     */
-    @SuppressWarnings("boxing")
-    public void testSimpleMath() throws WorkflowException {
-
-        AdderService service = new AdderService();
-        service.run();
-        String adderWSDLLoc = service.getServiceWsdlLocation();
-
-        WorkflowNotifiable notifier = new NotificationSender(XBayaConstants.DEFAULT_BROKER_URL.toString(), "test-topic");
-
-        Invoker invoker = new GenericInvoker(null, adderWSDLLoc, "adder", null, null, notifier);
-        invoker.setup();
-        invoker.setOperation("add");
-        invoker.setInput("x", 2);
-        invoker.setInput("y", 3);
-        invoker.invoke();
-
-        Object output = invoker.getOutput("z");
-        logger.info("z = " + output);
-
-        service.shutdownServer();
-    }
-
-    /**
-     * @throws WorkflowException
-     */
-    @SuppressWarnings("boxing")
-    public void testComplexMath() throws WorkflowException {
-
-        AdderService adder = new AdderService();
-        adder.run();
-        String adderWSDLLoc = adder.getServiceWsdlLocation();
-
-        MultiplierService multiplier = new MultiplierService();
-        multiplier.run();
-        String multiplierWSDLLoc = multiplier.getServiceWsdlLocation();
-
-        WorkflowNotifiable notifier = new NotificationSender(XBayaConstants.DEFAULT_BROKER_URL.toString(), "test-topic");
-
-        Invoker adderInvoker1 = new GenericInvoker(null, adderWSDLLoc, "adder", null, null, notifier);
-        adderInvoker1.setup();
-        adderInvoker1.setOperation("add");
-        adderInvoker1.setInput("x", 2);
-        adderInvoker1.setInput("y", 3);
-        adderInvoker1.invoke();
-
-        Object output1 = adderInvoker1.getOutput("z");
-        logger.info("output1 = " + output1);
-
-        Invoker adderInvoker2 = new GenericInvoker(null, adderWSDLLoc, "adder", null, null, notifier);
-        adderInvoker2.setup();
-        adderInvoker2.setOperation("add");
-        adderInvoker2.setInput("x", 4);
-        adderInvoker2.setInput("y", 5);
-        adderInvoker2.invoke();
-
-        Object output2 = adderInvoker2.getOutput("z");
-        logger.info("output2 = " + output2);
-
-        Invoker multiplierInvoker = new GenericInvoker(null, multiplierWSDLLoc, "multiplier", null, null, notifier);
-        multiplierInvoker.setup();
-        multiplierInvoker.setOperation("multiply");
-        multiplierInvoker.setInput("x", output1);
-        multiplierInvoker.setInput("y", output2);
-        multiplierInvoker.invoke();
-
-        Object output3 = multiplierInvoker.getOutput("z");
-        logger.info("output3 = " + output3);
-
-        adder.shutdownServer();
-        multiplier.shutdownServer();
-    }
-}
\ No newline at end of file


[39/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
deleted file mode 100644
index d26e155..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProvenanceResourceClient.java
+++ /dev/null
@@ -1,2854 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import java.net.URI;
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-
-import org.apache.airavata.registry.api.ExecutionErrors;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.registry.api.impl.ExperimentDataImpl;
-import org.apache.airavata.registry.api.impl.WorkflowExecutionDataImpl;
-import org.apache.airavata.registry.api.workflow.*;
-import org.apache.airavata.rest.mappings.resourcemappings.*;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.utils.BasicAuthHeaderUtil;
-import org.apache.airavata.rest.utils.ClientConstant;
-import org.apache.airavata.rest.utils.CookieManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-
-public class ProvenanceResourceClient {
-    private WebResource webResource;
-    private final static Logger logger = LoggerFactory.getLogger(ProvenanceResourceClient.class);
-    private String userName;
-    private PasswordCallback callback;
-    private String baseURI;
-    private Cookie cookie;
-    private WebResource.Builder builder;
-    private String gateway;
-//    private CookieManager CookieManager = new CookieManager();
-
-    public ProvenanceResourceClient(String userName,
-                                    String gateway,
-                                    String serviceURL,
-                                    PasswordCallback callback,
-                                    Cookie cookie) {
-        this.userName = userName;
-        this.callback = callback;
-        this.baseURI = serviceURL;
-        this.gateway = gateway;
-        this.cookie = cookie;
-    }
-
-    private URI getBaseURI() {
-        logger.debug("Creating Base URI");
-        return UriBuilder.fromUri(baseURI).build();
-    }
-
-    private WebResource getProvenanceRegistryBaseResource() {
-        ClientConfig config = new DefaultClientConfig();
-        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
-                Boolean.TRUE);
-        Client client = Client.create(config);
-        WebResource baseWebResource = client.resource(getBaseURI());
-        webResource = baseWebResource.path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.REGISTRY_API_PROVENANCEREGISTRY);
-        return webResource;
-    }
-
-    public void updateExperimentExecutionUser(String experimentId, String user) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_EXPERIMENT_EXECUTIONUSER);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("experimentId", experimentId);
-        formParams.add("user", user);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public String getExperimentExecutionUser(String experimentId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_EXECUTIONUSER);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentId", experimentId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        String executionUser = response.getEntity(String.class);
-        return executionUser;
-    }
-
-    public boolean isExperimentNameExist(String experimentName) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.EXPERIMENTNAME_EXISTS);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentName", experimentName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public String getExperimentName(String experimentId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_NAME);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentId", experimentId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        String experimentName = response.getEntity(String.class);
-        return experimentName;
-    }
-
-    public void updateExperimentName(String experimentId, String experimentName) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_EXPERIMENTNAME);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("experimentId", experimentId);
-        formParams.add("experimentName", experimentName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public String getExperimentMetadata(String experimentId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENTMETADATA);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentId", experimentId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        String experimentMetadata = response.getEntity(String.class);
-        return experimentMetadata;
-    }
-
-    public void updateExperimentMetadata(String experimentId, String metadata) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_EXPERIMENTMETADATA);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("experimentId", experimentId);
-        formParams.add("metadata", metadata);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public String getWorkflowExecutionTemplateName(String workflowInstanceId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWTEMPLATENAME);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowInstanceId", workflowInstanceId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        String workflowTemplateName = response.getEntity(String.class);
-        return workflowTemplateName;
-    }
-
-    public void setWorkflowInstanceTemplateName(String workflowInstanceId, String templateName) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCETEMPLATENAME);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowInstanceId", workflowInstanceId);
-        formParams.add("templateName", templateName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public List<WorkflowExecution> getExperimentWorkflowInstances(String experimentId) {
-        List<WorkflowExecution> workflowInstanceList = new ArrayList<WorkflowExecution>();
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENTWORKFLOWINSTANCES);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentId", experimentId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return workflowInstanceList;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return workflowInstanceList;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        WorkflowInstancesList workflowInstancesList = response.getEntity(WorkflowInstancesList.class);
-        WorkflowExecution[] workflowInstances = workflowInstancesList.getWorkflowInstances();
-
-        for (WorkflowExecution workflowInstance : workflowInstances) {
-            workflowInstanceList.add(workflowInstance);
-        }
-
-        return workflowInstanceList;
-    }
-
-    public boolean isWorkflowInstanceExists(String instanceId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_EXIST_CHECK);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("instanceId", instanceId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-
-        int status = response.getStatus();
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public boolean isWorkflowInstanceExists(String instanceId, boolean createIfNotPresent) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_EXIST_CREATE);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("instanceId", instanceId);
-        formParams.add("createIfNotPresent", String.valueOf(createIfNotPresent));
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateWorkflowInstanceStatus(String instanceId, WorkflowExecutionStatus.State executionStatus) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCESTATUS_INSTANCEID);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("instanceId", instanceId);
-        formParams.add("executionStatus", executionStatus.name());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateWorkflowInstanceStatus(WorkflowExecutionStatus workflowInstanceStatus) {
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String statusUpdateDate = dateFormat.format(workflowInstanceStatus.getStatusUpdateTime());
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCESTATUS);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowInstanceId",
-                workflowInstanceStatus.getWorkflowInstance().getWorkflowExecutionId());
-        formParams.add("executionStatus",
-                workflowInstanceStatus.getExecutionStatus().name());
-        formParams.add("statusUpdateTime",
-                statusUpdateDate);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public WorkflowExecutionStatus getWorkflowInstanceStatus(String instanceId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWINSTANCESTATUS);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("instanceId", instanceId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        WorkflowExecutionStatus workflowInstanceStatus = response.getEntity(WorkflowExecutionStatus.class);
-        return workflowInstanceStatus;
-    }
-
-    public void updateWorkflowNodeInput(WorkflowInstanceNode node, String data) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODEINPUT);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("nodeID", node.getNodeId());
-        formParams.add("workflowInstanceId", node.getWorkflowInstance().getWorkflowExecutionId());
-        formParams.add("data", data);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateWorkflowNodeOutput(WorkflowInstanceNode node, String data) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODEOUTPUT);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("nodeID", node.getNodeId());
-        formParams.add("workflowInstanceId", node.getWorkflowInstance().getWorkflowExecutionId());
-        formParams.add("data", data);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public ExperimentData getExperiment(String experimentId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentId", experimentId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentData experimentData = response.getEntity(ExperimentDataImpl.class);
-        return experimentData;
-    }
-
-    public ExperimentData getExperimentMetaInformation(String experimentId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_METAINFORMATION);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentId", experimentId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentData experimentData = response.getEntity(ExperimentData.class);
-        return experimentData;
-    }
-
-    public List<ExperimentData> getAllExperimentMetaInformation(String user) {
-        List<ExperimentData> experimentDatas = new ArrayList<ExperimentData>();
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_ALL_EXPERIMENT_METAINFORMATION);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("user", user);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return experimentDatas;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return experimentDatas;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentDataList experimentDataList = response.getEntity(ExperimentDataList.class);
-        List<ExperimentDataImpl> dataList = experimentDataList.getExperimentDataList();
-
-        for (ExperimentDataImpl experimentData : dataList) {
-            experimentDatas.add(experimentData);
-        }
-        return experimentDatas;
-    }
-
-    public List<ExperimentData> searchExperiments(String user, String experimentNameRegex) {
-        List<ExperimentData> experimentDatas = new ArrayList<ExperimentData>();
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.SEARCH_EXPERIMENTS);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("user", user);
-        queryParams.add("experimentNameRegex", experimentNameRegex);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return experimentDatas;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return experimentDatas;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentDataList experimentDataList = response.getEntity(ExperimentDataList.class);
-        List<ExperimentDataImpl> dataList = experimentDataList.getExperimentDataList();
-
-        for (ExperimentDataImpl experimentData : dataList) {
-            experimentDatas.add(experimentData);
-        }
-        return experimentDatas;
-    }
-
-    public List<String> getExperimentIdByUser(String user) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_ID_USER);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("username", user);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return new ArrayList<String>();
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return new ArrayList<String>();
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentIDList experimentIDList = response.getEntity(ExperimentIDList.class);
-        List<String> experimentIDs = experimentIDList.getExperimentIDList();
-        return experimentIDs;
-    }
-
-    public List<ExperimentData> getExperimentByUser(String user) {
-        List<ExperimentData> experimentDatas = new ArrayList<ExperimentData>();
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_USER);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("username", user);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return experimentDatas;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return experimentDatas;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ExperimentDataList experimentDataList = response.getEntity(ExperimentDataList.class);
-        List<ExperimentDataImpl> dataList = experimentDataList.getExperimentDataList();
-
-        for (ExperimentDataImpl experimentData : dataList) {
-            experimentDatas.add(experimentData);
-        }
-        return experimentDatas;
-    }
-
-    public void updateWorkflowNodeStatus(NodeExecutionStatus workflowStatusNode) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODE_STATUS);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowInstanceId",
-                workflowStatusNode.getWorkflowInstanceNode().getWorkflowInstance().getWorkflowExecutionId());
-        formParams.add("nodeId",
-                workflowStatusNode.getWorkflowInstanceNode().getNodeId());
-        formParams.add("executionStatus",
-                workflowStatusNode.getExecutionStatus().name());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateWorkflowNodeStatus(String workflowInstanceId,
-                                         String nodeId,
-                                         WorkflowExecutionStatus.State executionStatus) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODE_STATUS);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowInstanceId", workflowInstanceId);
-        formParams.add("nodeId", nodeId);
-        formParams.add("executionStatus", executionStatus.name());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateWorkflowNodeStatus(WorkflowInstanceNode workflowNode,
-                                         WorkflowExecutionStatus.State executionStatus) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODE_STATUS);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowInstanceId",
-                workflowNode.getWorkflowInstance().getWorkflowExecutionId());
-        formParams.add("nodeId", workflowNode.getNodeId());
-        formParams.add("executionStatus", executionStatus.name());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public NodeExecutionStatus getWorkflowNodeStatus(WorkflowInstanceNode workflowNode) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWNODE_STATUS);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowInstanceId", workflowNode.getWorkflowInstance().getWorkflowExecutionId());
-        queryParams.add("nodeId", workflowNode.getNodeId());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        NodeExecutionStatus workflowInstanceNodeStatus =
-                response.getEntity(NodeExecutionStatus.class);
-        return workflowInstanceNodeStatus;
-    }
-
-    public Date getWorkflowNodeStartTime(WorkflowInstanceNode workflowNode) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWNODE_STARTTIME);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowInstanceId", workflowNode.getWorkflowInstance().getWorkflowExecutionId());
-        queryParams.add("nodeId", workflowNode.getNodeId());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        String wfNodeStartTime = response.getEntity(String.class);
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        try {
-            Date formattedDate = dateFormat.parse(wfNodeStartTime);
-            return formattedDate;
-        } catch (ParseException e) {
-            logger.error("Error in date format...", e);
-            return null;
-        }
-    }
-
-    public Date getWorkflowStartTime(WorkflowExecution workflowInstance) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOW_STARTTIME);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowInstanceId", workflowInstance.getWorkflowExecutionId());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        String wfStartTime = response.getEntity(String.class);
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        try {
-            Date formattedDate = dateFormat.parse(wfStartTime);
-            return formattedDate;
-        } catch (ParseException e) {
-            logger.error("Error in date format...", e);
-            return null;
-        }
-    }
-
-    public void updateWorkflowNodeGramData(WorkflowNodeGramData workflowNodeGramData) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODE_GRAMDATA);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).type(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, workflowNodeGramData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).type(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, workflowNodeGramData);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public WorkflowExecutionData getWorkflowInstanceData(String workflowInstanceId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWINSTANCEDATA);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowInstanceId", workflowInstanceId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        WorkflowExecutionDataImpl workflowInstanceData = response.getEntity(WorkflowExecutionDataImpl.class);
-        return workflowInstanceData;
-    }
-
-    public boolean isWorkflowInstanceNodePresent(String workflowInstanceId, String nodeId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_NODE_EXIST);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowInstanceId", workflowInstanceId);
-        queryParams.add("nodeId", nodeId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public boolean isWorkflowInstanceNodePresent(String workflowInstanceId,
-                                                 String nodeId,
-                                                 boolean createIfNotPresent) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_NODE_EXIST_CREATE);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowInstanceId", workflowInstanceId);
-        formParams.add("nodeId", nodeId);
-        formParams.add("createIfNotPresent", String.valueOf(createIfNotPresent));
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public NodeExecutionData getWorkflowInstanceNodeData(String workflowInstanceId,
-                                                         String nodeId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_NODE_DATA);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("workflowInstanceId", workflowInstanceId);
-        queryParams.add("nodeId", nodeId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        NodeExecutionData workflowInstanceNodeData =
-                response.getEntity(NodeExecutionData.class);
-        return workflowInstanceNodeData;
-    }
-
-    public void addWorkflowInstance(String experimentId,
-                                    String workflowInstanceId,
-                                    String templateName) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOWINSTANCE);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("experimentId", experimentId);
-        formParams.add("workflowInstanceId", workflowInstanceId);
-        formParams.add("templateName", templateName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK && status != ClientConstant.HTTP_UNAUTHORIZED) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateWorkflowNodeType(WorkflowInstanceNode node,
-                                       WorkflowNodeType type) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODETYPE);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowInstanceId", node.getWorkflowInstance().getWorkflowExecutionId());
-        formParams.add("nodeId", node.getNodeId());
-        formParams.add("nodeType", type.getNodeType().name());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addWorkflowInstanceNode(String workflowInstance,
-                                        String nodeId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOWINSTANCENODE);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("workflowInstanceId", workflowInstance);
-        formParams.add("nodeId", nodeId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public List<ExperimentExecutionError> getExperimentExecutionErrors(String experimentId) {
-        webResource = getProvenanceRegistryBaseResource().path(
-                ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_ERRORS);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("experimentId", experimentId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-    

<TRUNCATED>

[22/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/commons/TestCommonRoutines.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/commons/TestCommonRoutines.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/commons/TestCommonRoutines.java
deleted file mode 100644
index 098dd49..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/commons/TestCommonRoutines.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.commons;
-
-import java.util.Date;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.wsmg.commons.CommonRoutines;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestCommonRoutines extends TestCase {
-
-    /**
-     * @throws java.lang.Exception
-     */
-    @Before
-    public void setUp() throws Exception {
-    }
-
-    /**
-     * @throws java.lang.Exception
-     */
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    /**
-     * Test method for {@link org.apache.airavata.wsmg.commons.CommonRoutines#getXsdDateTime(java.util.Date)}.
-     */
-    @Test
-    public void testGetXsdDateTime() {
-        assertNotNull(CommonRoutines.getXsdDateTime(new Date()));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestAddtionalWseXpathAndTopicScenarios.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestAddtionalWseXpathAndTopicScenarios.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestAddtionalWseXpathAndTopicScenarios.java
deleted file mode 100644
index 6f1ecbb..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestAddtionalWseXpathAndTopicScenarios.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.matching.XPath;
-
-import java.net.URL;
-import java.util.Properties;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import javax.xml.stream.XMLStreamException;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.util.ConfigKeys;
-import org.apache.airavata.wsmg.util.TestUtilServer;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestAddtionalWseXpathAndTopicScenarios extends TestCase {
-
-    static Properties configs = new Properties();
-
-    class NotificationReciever implements ConsumerNotificationHandler {
-
-        private BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
-
-        private String id;
-
-        public NotificationReciever(String id) {
-            this.id = id;
-        }
-
-        public void handleNotification(SOAPEnvelope msgEnvelope) {
-            queue.add(msgEnvelope);
-            System.out.println(String.format("[reciever id: %s] %s", id, msgEnvelope));
-        }
-
-        public BlockingQueue<SOAPEnvelope> getMsgQueue() {
-            return queue;
-        }
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        URL configURL = ClassLoader.getSystemResource(ConfigKeys.CONFIG_FILE_NAME);
-        configs.load(configURL.openStream());
-
-        TestUtilServer.start(null, null);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    @Test
-    public final void testXpathAndTopicOnlyRoundTrip() {
-
-        try {
-
-            String topic = "RoundTripTestXpathAndTopicWse";
-
-            String xpathExpression = "/c/b/a[text()=1]";
-
-            String msgFormat = "<c><b><a>%d</a></b></c>";
-
-            long value = 1;
-            String matchingMsg = String.format(msgFormat, value);
-            String unmatchingMsg = String.format(msgFormat, value + 1);
-
-            int consumerPort = TestUtilServer.getAvailablePort();
-
-            String brokerEpr = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
-
-            WseMsgBrokerClient topicOnlyReceiverApi = new WseMsgBrokerClient();
-            topicOnlyReceiverApi.init(brokerEpr);
-            NotificationReciever topicOnlyMsgReceiver = new NotificationReciever("Topic Only");
-            String[] topicConsumerEPRs = topicOnlyReceiverApi.startConsumerService(consumerPort, topicOnlyMsgReceiver);
-            assertTrue("invalid consumer eprs returned", topicConsumerEPRs.length > 0);
-            String topicOnlySubId = topicOnlyReceiverApi.subscribe(topicConsumerEPRs[0], topic, null);
-            System.out.println("Topic only subscription ID: " + topicOnlySubId);
-
-            WseMsgBrokerClient xpathAndTopicReceiverApi = new WseMsgBrokerClient();
-            xpathAndTopicReceiverApi.init(brokerEpr);
-            NotificationReciever topicAndXpathMsgReceiver = new NotificationReciever("Topic And Xpath");
-            String[] topicAndXpathConsumerEPRs = xpathAndTopicReceiverApi.startConsumerService(consumerPort + 1,
-                    topicAndXpathMsgReceiver);
-            assertTrue("invalid consumer eprs returned", topicAndXpathConsumerEPRs.length > 0);
-            String topicAndXpathSubId = xpathAndTopicReceiverApi.subscribe(topicAndXpathConsumerEPRs[0], topic,
-                    xpathExpression);
-            System.out.println("Xpath and Topic subscription ID: " + topicAndXpathSubId);
-
-            WseMsgBrokerClient senderApi = new WseMsgBrokerClient();
-            senderApi.init(brokerEpr);
-
-            try {
-
-                senderApi.publish(topic, AXIOMUtil.stringToOM(matchingMsg));
-                senderApi.publish(topic, AXIOMUtil.stringToOM(unmatchingMsg));
-
-                Thread.sleep(5000);
-
-                assertTrue("topic only reciever should get all messages" + topicOnlyMsgReceiver.getMsgQueue().size(),
-                        topicOnlyMsgReceiver.getMsgQueue().size() == 2);
-
-                assertTrue("xpath and topic reciever should only get one message"
-                        + topicAndXpathMsgReceiver.getMsgQueue().size(),
-                        topicAndXpathMsgReceiver.getMsgQueue().size() == 1);
-            } catch (XMLStreamException x) {
-                fail("Error while creating OMElement");
-            } catch (InterruptedException e) {
-                fail("interrupted while waiting for message");
-            }
-
-            topicOnlyReceiverApi.unSubscribe(topicOnlySubId);
-            topicOnlyReceiverApi.shutdownConsumerService();
-
-            xpathAndTopicReceiverApi.unSubscribe(topicAndXpathSubId);
-            xpathAndTopicReceiverApi.shutdownConsumerService();
-
-        } catch (AxisFault e) {
-            e.printStackTrace();
-            fail("unexpected exception occured");
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathAndTopicSubscription.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathAndTopicSubscription.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathAndTopicSubscription.java
deleted file mode 100644
index 024b5d3..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathAndTopicSubscription.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.matching.XPath;
-
-import java.net.URL;
-import java.util.Properties;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import javax.xml.stream.XMLStreamException;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.util.ConfigKeys;
-import org.apache.airavata.wsmg.util.TestUtilServer;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestWseXpathAndTopicSubscription extends TestCase implements ConsumerNotificationHandler {
-
-    static Properties configs = new Properties();
-
-    BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
-
-    public void handleNotification(SOAPEnvelope msgEnvelope) {
-
-        queue.add(msgEnvelope);
-        System.out.println(msgEnvelope);
-    }
-
-    BlockingQueue<SOAPEnvelope> getMsgQueue() {
-        return queue;
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        URL configURL = ClassLoader.getSystemResource(ConfigKeys.CONFIG_FILE_NAME);
-        configs.load(configURL.openStream());
-
-        TestUtilServer.start(null, null);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    @Test
-    public final void testXpathOnlyRoundTrip() {
-
-        try {
-
-            String validMsgFormat = "<c><b><a> %d </a></b></c>";
-            String invalidMsgFormat = "<a><b><c> %d </c></b></a>";
-
-            long value = System.currentTimeMillis();
-            String validMsg = String.format(validMsgFormat, value);
-            String invalidMsg = String.format(invalidMsgFormat, value);
-
-            int consumerPort = TestUtilServer.getAvailablePort();
-
-            String brokerEPR = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
-            WseMsgBrokerClient msgBrokerClient = new WseMsgBrokerClient();
-            msgBrokerClient.init(brokerEPR);
-
-            String[] consumerEPRs = msgBrokerClient.startConsumerService(consumerPort, this);
-
-            assertTrue(consumerEPRs.length > 0);
-
-            String xpathExpression = "/c/b/a";
-
-            String subscriptionID = msgBrokerClient.subscribe(consumerEPRs[0], null, xpathExpression);
-
-            try {
-                msgBrokerClient.publish(null, AXIOMUtil.stringToOM(validMsg));
-                msgBrokerClient.publish(null, AXIOMUtil.stringToOM(invalidMsg));
-
-                SOAPEnvelope env = getMsgQueue().take();
-
-                assertNotNull(env.getBody());
-                assertNotNull(env.getBody().getChildrenWithLocalName("c"));
-
-                OMElement element = (OMElement) env.getBody().getChildrenWithLocalName("c").next();
-
-                String text = element.toStringWithConsume();
-
-                assertTrue("round trip of message failed" + " - due to invalid messege content",
-                        text.indexOf(new Long(value).toString()) > 0);
-
-                Thread.sleep(5000);
-
-                assertTrue("unexpected msg recieved", getMsgQueue().isEmpty());
-
-            } catch (InterruptedException e) {
-                fail("interrupted while waiting for message");
-            } catch (XMLStreamException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-                fail("invalid xml recieved: " + e.getMessage());
-            }
-
-            msgBrokerClient.unSubscribe(subscriptionID);
-            msgBrokerClient.shutdownConsumerService();
-
-        } catch (AxisFault e) {
-            e.printStackTrace();
-            fail("unexpected exception occured");
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathSubscription.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathSubscription.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathSubscription.java
deleted file mode 100644
index 097e6b7..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/TestWseXpathSubscription.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.matching.XPath;
-
-import java.net.URL;
-import java.util.Properties;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import javax.xml.stream.XMLStreamException;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.util.ConfigKeys;
-import org.apache.airavata.wsmg.util.TestUtilServer;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class TestWseXpathSubscription extends TestCase implements ConsumerNotificationHandler {
-
-    static Properties configs = new Properties();
-
-    BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
-
-    public void handleNotification(SOAPEnvelope msgEnvelope) {
-
-        queue.add(msgEnvelope);
-        System.out.println(msgEnvelope);
-    }
-
-    BlockingQueue<SOAPEnvelope> getMsgQueue() {
-        return queue;
-    }
-
-    @Before
-    public void setUp() throws Exception {
-        URL configURL = ClassLoader.getSystemResource(ConfigKeys.CONFIG_FILE_NAME);
-        configs.load(configURL.openStream());
-
-        TestUtilServer.start(null, null);
-    }
-
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    @Test
-    public final void testSimpleXpathTopicRoundTrip() {
-
-        try {
-
-            String validMsgFormat = "<c><b><a> %d </a></b></c>";
-            String invalidMsgFormat = "<a><b><c> %d </c></b></a>";
-
-            long value = System.currentTimeMillis();
-            String validMsg = String.format(validMsgFormat, value);
-            String invalidMsg = String.format(invalidMsgFormat, value);
-
-            int consumerPort = TestUtilServer.getAvailablePort();
-
-            String brokerEPR = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
-
-            WseMsgBrokerClient wseMsgBrokerClient = new WseMsgBrokerClient();
-            wseMsgBrokerClient.init(brokerEPR);
-
-            String[] consumerEPRs = wseMsgBrokerClient.startConsumerService(consumerPort, this);
-
-            assertTrue(consumerEPRs.length > 0);
-
-            String xpathExpression = "/c/b/a";
-            String topicExpression = "XpathAndTopicTestWse";
-
-            String subscriptionID = wseMsgBrokerClient.subscribe(consumerEPRs[0], topicExpression, xpathExpression);
-
-            try {
-
-                wseMsgBrokerClient.publish(topicExpression, AXIOMUtil.stringToOM(validMsg));
-                wseMsgBrokerClient.publish(topicExpression, AXIOMUtil.stringToOM(invalidMsg));
-
-                SOAPEnvelope env = getMsgQueue().take();
-
-                assertNotNull(env.getBody());
-                assertNotNull(env.getBody().getChildrenWithLocalName("c"));
-
-                OMElement element = (OMElement) env.getBody().getChildrenWithLocalName("c").next();
-
-                String text = element.toStringWithConsume();
-
-                assertTrue("round trip of message failed" + " - due to invalid messege content",
-                        text.indexOf(new Long(value).toString()) > 0);
-
-                Thread.sleep(5000);
-
-                assertTrue("unexpected msg recieved", getMsgQueue().isEmpty());
-
-            } catch (InterruptedException e) {
-                fail("interrupted while waiting for message");
-            } catch (XMLStreamException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-                fail("invalid xml recieved: " + e.getMessage());
-            }
-
-            wseMsgBrokerClient.unSubscribe(subscriptionID);
-            wseMsgBrokerClient.shutdownConsumerService();
-
-        } catch (AxisFault e) {
-            e.printStackTrace();
-            fail("unexpected exception occured");
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/performance/XppXPath.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/performance/XppXPath.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/performance/XppXPath.java
deleted file mode 100644
index da95a00..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/matching/XPath/performance/XppXPath.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.matching.XPath.performance;
-
-import java.io.BufferedReader;
-import java.io.ByteArrayInputStream;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.FactoryConfigurationError;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import edu.berkeley.cs.db.yfilterplus.queryparser.QueryParser;
-import edu.berkeley.cs.db.yfilterplus.queryparser.XPQueryParser;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
-import org.apache.axiom.soap.SOAPEnvelope;
-
-public class XppXPath {
-
-    private Vector xPathExpressions = new Vector();
-    protected BufferedReader m_in = null;
-    private static final boolean DEBUG = false;
-    long total = 0;
-
-    public int[] getMatchedLinks(String message) {
-
-        return null;
-    }
-
-    public Vector checkQueries(String query) {
-        Vector result = new Vector();
-        Set xPathExpressionsSet = new HashSet(xPathExpressions);
-
-        int size = xPathExpressions.size();
-
-        for (int i = 0; i < size; i++) {
-
-            boolean match = query.equals(xPathExpressions.get(i));
-
-            // long start=System.nanoTime();
-            if (match) {
-
-                result.add(new Integer(i));
-
-            }
-            // long end=System.nanoTime();
-            // total+=(end-start);
-        }
-
-        // System.out.println("Total="+total);
-        return result;
-    }
-
-    public boolean checkQueriesVectorToSet(Set queries) {
-        // Vector result=new Vector();
-        Set xPathExpressionsSet = new HashSet(xPathExpressions);
-
-        int size = xPathExpressions.size();
-        Iterator iter = queries.iterator();
-        int counter = 0;
-        while (iter.hasNext()) {
-            Object query = iter.next();
-            for (int i = 0; i < size; i++) {
-
-                boolean match = query.equals(xPathExpressions.get(i));
-
-                // long start=System.nanoTime();
-                if (match) {
-
-                    return true;
-
-                }
-                // long end=System.nanoTime();
-                // total+=(end-start);
-            }
-            counter++;
-            // System.out.println("counter="+counter);
-        }
-        // System.out.println("Total="+total);
-        return false;
-    }
-
-    public boolean checkQueriesBySet(Set queries) {
-        Set xPathExpressionsSet = new HashSet(xPathExpressions);
-        Iterator iter = queries.iterator();
-        int counter = 0;
-        while (iter.hasNext()) {
-            if (xPathExpressionsSet.contains(iter.next())) {
-                // System.out.println("counter="+counter);
-                return true;
-            }
-            counter++;
-        }
-        return false;
-    }
-
-    public void addXPathExpressions(String xPathExpression) {
-        xPathExpressions.add(xPathExpression);
-    }
-
-    public void readQueriesFromFile(String queryFile) {
-        int noQueries = Integer.MAX_VALUE;
-        int qNum = 0;
-        // QueryParser qp = new XFQueryParser(queryFile);
-        QueryParser qp = new XPQueryParser(queryFile);
-        // Query query;
-        String queryString;
-        while (qNum < noQueries && ((queryString = qp.readNextQueryString()) != null)) {
-            if (DEBUG)
-                System.out.println(queryString);
-            addXPathExpressions(queryString);
-            qNum++;
-        }
-    }
-
-    public String getARandomQuery() {
-        int index = (int) (xPathExpressions.size() * (Math.random()));
-        return (String) xPathExpressions.get(index);
-    }
-
-    // From http://www.rgagnon.com/javadetails/java-0052.html
-    public static String readFile(String filename) throws IOException {
-        String lineSep = System.getProperty("line.separator");
-        BufferedReader br = new BufferedReader(new FileReader(filename));
-        String nextLine = "";
-        StringBuffer sb = new StringBuffer();
-        while ((nextLine = br.readLine()) != null) {
-            sb.append(nextLine);
-            //
-            // note:
-            // BufferedReader strips the EOL character.
-            //
-            sb.append(lineSep);
-        }
-        return sb.toString();
-    }
-
-    /**
-     * @param args
-     * @throws IOException
-     * @throws FactoryConfigurationError
-     * @throws XMLStreamException
-     */
-    public static void main(String[] args) throws IOException, XMLStreamException, FactoryConfigurationError {
-        String queryFile = "C:\\YiFile\\yfilter-1.0\\yfilter-1.0\\queries2.txt";
-        XppXPath xppXPath = new XppXPath();
-        xppXPath.readQueriesFromFile(queryFile);
-        long total = 0;
-        final int round = 100;
-        String message = readFile("c:\\YiFile\\testdata\\soap2.txt");
-
-        int messageStartPoint = message.indexOf('<');
-        String xpathList = message.substring(0, messageStartPoint);
-        System.out.println("XpathList=" + xpathList);
-        System.out.println("*****************************************");
-        long start0 = System.nanoTime();
-        StringTokenizer parser0 = new StringTokenizer(xpathList, ";");
-        Set xpathTokens = new HashSet();
-        while (parser0.hasMoreTokens()) {
-            xpathTokens.add(parser0.nextToken());
-        }
-        long end0 = System.nanoTime();
-        long total0 = (end0 - start0);
-        // for(int i=0;i<xpathTokens.size();i++){
-        // System.out.println((String)xpathTokens.get(i));
-        // }
-        System.out.println("Avg Time to token=" + (total0));
-        System.out.println("Total token=" + xpathTokens.size());
-        boolean result = false;
-        for (int i = 0; i < round; i++) {
-            String randomQuery = xppXPath.getARandomQuery();
-            // xpathTokens.add(randomQuery);
-            // Vector result=null;
-
-            long start = System.nanoTime();
-            // result=xppXPath.checkQueries(randomQuery);
-            result = xppXPath.checkQueriesBySet(xpathTokens);
-            // result=xppXPath.checkQueriesVectorToSet(xpathTokens);
-            long end = System.nanoTime();
-            total += (end - start);
-        }
-        System.out.println("Match result=" + result);
-        System.out.println("Avg Time for Checking=" + (total / round));
-
-        // XSUL
-        // long start=System.nanoTime();
-        // XmlElement messageEl = builder.parseFragmentFromReader(new
-        // StringReader(
-        // message));
-        // XmlElement messageIdEl= messageEl.element(null,
-        // "Header").element(null,"MessageID");
-        // String messageId=messageIdEl.requiredTextContent();
-        // System.out.println("MessageId="+messageId);
-        // long end=System.nanoTime();
-        // total=(end-start);
-        // System.out.println("Avg Time="+(total));
-
-        // AXIOM
-        // long start=System.nanoTime();
-        // create the parser
-        // XMLStreamReader parser =
-        // XMLInputFactory.newInstance().createXMLStreamReader(new
-        // FileReader("c:\\YiFile\\testdata\\soap_only.txt"));
-        // create the builder
-        String message1 = readFile("c:\\YiFile\\testdata\\soap_only.txt");
-        long start = System.nanoTime();
-        XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(
-                new ByteArrayInputStream(message1.getBytes()));
-
-        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                OMAbstractFactory.getSOAP11Factory(), parser);
-        // get the root element (in this case the envelope)
-
-        SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
-
-        // // create the parser
-        // XMLStreamReader parser =
-        // XMLInputFactory.newInstance().createXMLStreamReader(new
-        // FileReader("c:\\YiFile\\testdata\\soap.txt"));
-        // // create the builder
-        // OMXMLParserWrapper builder =
-        // OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMAbstractFactory.getOMFactory(),parser);
-        // // get the root element (in this case the envelope)
-        // SOAPEnvelope envelope = (SOAPEnvelope)builder.getDocumentElement();
-        //
-        //
-        String messageIDString = envelope.getHeader().getFirstChildWithName(new QName(null, "MessageID")).getText();
-        long end = System.nanoTime();
-        total = (end - start);
-        System.out.println("Avg Time for Axiom=" + (total));
-        // OMElement headerEl=envelope.getHeader().getFirstChildWithName(new
-        // QName("http://schemas.xmlsoap.org/soap/envelope/", "Header"));
-        envelope.getHeader().getFirstChildWithName(new QName(null, "MessageID")).serialize(System.out);
-        System.out.println();
-        //
-        // headerEl.getFirstChildWithName(new QName(null, "MessageID"));
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/NotificationManager.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/NotificationManager.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/NotificationManager.java
deleted file mode 100644
index c168a5f..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/NotificationManager.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.performance_evaluator.rtt;
-
-import java.util.LinkedList;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.apache.airavata.wsmg.client.*;
-import org.apache.axiom.soap.SOAPEnvelope;
-
-public class NotificationManager implements ConsumerNotificationHandler {
-
-    private MessageBrokerClient client = null;
-    private String[] eprs = null;
-    private String brokerLocation = null;
-    private String protocol = null;
-    private int consumerServerPort = 0;
-    private LinkedList<String> subscriptionIds;
-    private int numberOfTopicSubscribed = 0;
-    private int numMultiThreadSupportPerSub = 0;
-    private int multipleThreadSupportIndex = 1;
-
-    public NotificationManager(String brokerLocationIn, int consumerServerPortIn, String protocolIn,
-            int numMultiThreadSupportPerSub) throws MsgBrokerClientException {
-
-        this.brokerLocation = brokerLocationIn;
-        this.consumerServerPort = consumerServerPortIn;
-        this.protocol = protocolIn;
-        this.numMultiThreadSupportPerSub = numMultiThreadSupportPerSub;
-
-        if (client == null) {
-            if (protocol.equalsIgnoreCase("wse")) {
-                WsntMsgBrokerClient wseClient = new WsntMsgBrokerClient();
-                wseClient.init(this.brokerLocation);
-                wseClient.setTimeoutInMilliSeconds(200000000);
-                eprs = wseClient.startConsumerService(consumerServerPort, this);
-                client = wseClient;
-            } else {
-                WsntMsgBrokerClient wsntClient = new WsntMsgBrokerClient();
-                wsntClient.init(this.brokerLocation);
-                wsntClient.setTimeoutInMilliSeconds(200000000);
-                eprs = wsntClient.startConsumerService(consumerServerPort, this);
-                client = wsntClient;
-            }
-        }
-
-        subscriptionIds = new LinkedList<String>();
-
-    }
-
-    public Subscription createTopicSubscription(String topic) throws Exception {
-
-        if (multipleThreadSupportIndex > numMultiThreadSupportPerSub) {
-            multipleThreadSupportIndex = 1;
-        }
-
-        String subscriptionId = client
-                .subscribe(brokerLocation, eprs[0] + "user" + multipleThreadSupportIndex++, topic);
-        subscriptionIds.add(subscriptionId);
-        Subscription subscription = new Subscription(client, subscriptionId, topic, this, brokerLocation, protocol);
-        return subscription;
-    }
-
-    public Subscription createXpathSubscription(String topicExpression, String xpathExpression) throws Exception {
-        if (multipleThreadSupportIndex > numMultiThreadSupportPerSub) {
-            multipleThreadSupportIndex = 1;
-        }
-
-        String subscriptionId = client.subscribe(eprs[0] + "user" + multipleThreadSupportIndex++, topicExpression,
-                xpathExpression);
-        subscriptionIds.add(subscriptionId);
-        Subscription subscription = new Subscription(client, subscriptionId, topicExpression, xpathExpression, this,
-                brokerLocation, protocol);
-        return subscription;
-    }
-
-    public void cleanup() throws MsgBrokerClientException {
-
-        WseMsgBrokerClient wseClient = null;
-        WsntMsgBrokerClient wsntClient = null;
-
-        if ("wse".equalsIgnoreCase(this.protocol)) {
-            wseClient = (WseMsgBrokerClient) client;
-        } else {
-            wsntClient = (WsntMsgBrokerClient) client;
-        }
-
-        if (subscriptionIds != null) {
-            if (wseClient != null) {
-                while (!subscriptionIds.isEmpty()) {
-                    String subId = subscriptionIds.remove();
-                    wseClient.unSubscribe(subId);
-                }
-            } else {
-                while (!subscriptionIds.isEmpty()) {
-                    String subId = subscriptionIds.remove();
-                    wsntClient.unSubscribe(subId);
-                }
-
-            }
-        }
-
-        if (client != null) {
-            client.shutdownConsumerService();
-        }
-    }
-
-    private BlockingQueue<StatContainer> queue = new LinkedBlockingQueue<StatContainer>();
-    private int numMsgsReceived = 0;
-
-    public void handleNotification(SOAPEnvelope msgEnvelope) {
-        queue.add(new StatContainer(msgEnvelope));
-        numMsgsReceived += 1;
-    }
-
-    public BlockingQueue<StatContainer> getQueue() {
-        return queue;
-    }
-
-    public int getNumberOfMsgsReceived() {
-        return numMsgsReceived;
-    }
-
-    public synchronized void incNoTopicsSubscribed() {
-        numberOfTopicSubscribed++;
-    }
-
-    public synchronized int getNoTopicsSubscribed() {
-        return numberOfTopicSubscribed;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PerformanceTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PerformanceTest.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PerformanceTest.java
deleted file mode 100644
index 4e90ec0..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PerformanceTest.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.performance_evaluator.rtt;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Writer;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.CountDownLatch;
-
-import org.apache.airavata.wsmg.performance_evaluator.rtt.util.ConfigKeys;
-import org.apache.airavata.wsmg.performance_evaluator.rtt.util.LoadMsgPayload;
-import org.apache.airavata.wsmg.performance_evaluator.rtt.util.LoadXpath;
-
-class Stat {
-    String name;
-    Object value;
-
-    public Stat(String k, Object v) {
-        name = k;
-        value = v;
-    }
-
-}
-
-public class PerformanceTest {
-
-    public static int NOTIFICATIONS_PUBLISHED_PER_TOPIC = 0;
-    static String payload = null;
-    static LinkedList<String> xpathList = null;
-    public static long totalRoundTripTime = 0;
-    private static long avgRountTripTime = 0;
-    public static BufferedWriter out = null;
-    public static Properties configurations = null;
-    public static long avgPublishRTTime = 0l;
-    private static long totalPublishRTT = 0l;
-    private static int notifPerTopic = 0;
-    private static int noTopicsPublished = 0;
-    private static String protocol = "";
-    private static int payLoadMultiplier = 1;
-    private static int consumerPort = 3345;
-    private static long testExpirationTime = 0l;
-    private static int numberOfSubscriber = 0;
-    private static int numMultiThreadsSupportPerSub = 0;
-    private static String topicPrefix = "";
-
-    public static void main(String[] args) throws Exception {
-        loadConfigurationsFromFile();
-        testPerformance();
-    }
-
-    public static void testPerformance() throws Exception {
-
-        setConfigurationValues();
-        File outfile = new File("performance.log");
-        CountDownLatch publiserhStartSignal = new CountDownLatch(1);
-        CountDownLatch publisherDoneSignal = new CountDownLatch(noTopicsPublished);
-        NotificationManager notifManagerArray[] = new NotificationManager[numberOfSubscriber];
-        StatCalculatorThread statCalcThread[] = new StatCalculatorThread[numberOfSubscriber];
-        setPayload(payLoadMultiplier);
-
-        for (int j = 0; j < numberOfSubscriber; j++) {
-            notifManagerArray[j] = new NotificationManager(configurations.getProperty(ConfigKeys.BROKER_URL),
-                    consumerPort + j, protocol, numMultiThreadsSupportPerSub);
-
-        }
-
-        // thread to calculate stats for notification manager
-        // set the subscriptions depending on the topic or xpath based
-        int arrayIndex = 0;
-        int totalReceivers = 0;
-        createSubscriberArray(noTopicsPublished, numberOfSubscriber, notifManagerArray, arrayIndex);
-        System.out.println("subscribing to topics completed, creating publisher threads");
-
-        // start publishers
-        PublisherThread[] publisher = new PublisherThread[noTopicsPublished];
-        createPublishers(noTopicsPublished, protocol, publiserhStartSignal, publisherDoneSignal, publisher);
-        System.out.println("sending signal to start publishing...");
-        long publisherStartTime = System.currentTimeMillis();
-        long startTime = System.currentTimeMillis();
-        publiserhStartSignal.countDown(); // let all threads proceed
-
-        for (int j = 0; j < numberOfSubscriber; j++) {
-            statCalcThread[j] = new StatCalculatorThread(notifManagerArray[j], testExpirationTime);
-            statCalcThread[j].start();
-        }
-
-        publisherDoneSignal.await(); // wait for all to finish
-
-        for (int j = 0; j < noTopicsPublished; j++) {
-            totalPublishRTT += publisher[j].getAvgPubTime();
-        }
-
-        avgPublishRTTime = totalPublishRTT / noTopicsPublished;
-        long publishersRunningTime = System.currentTimeMillis() - publisherStartTime;
-        System.out.println("finished publishing messgaes.");
-
-        for (StatCalculatorThread stats : statCalcThread) {
-            stats.join();
-        }
-
-        long stopTime = 0l;
-        long totNumberOfMessagesReceived = 0;
-
-        for (StatCalculatorThread stats : statCalcThread) {
-            stopTime = stopTime < stats.getLastMsgReceivedTime() ? stats.getLastMsgReceivedTime() : stopTime;
-            totalRoundTripTime += stats.getTotalTime();
-            totNumberOfMessagesReceived += stats.getNumberOfMsgReceived();
-        }
-
-        for (NotificationManager notifMngr : notifManagerArray) {
-            totalReceivers += notifMngr.getNoTopicsSubscribed();
-        }
-
-        avgRountTripTime = totalRoundTripTime / totNumberOfMessagesReceived;
-        long executionTime = stopTime - startTime;
-        double throughtput = (totNumberOfMessagesReceived * 1000) / (executionTime);
-
-        List<Stat> statistics = new ArrayList<Stat>();
-
-        statistics.add(new Stat("Payload size (bytes)", payload.getBytes("US-ASCII").length));
-        statistics.add(new Stat("Protocol", protocol));
-        statistics.add(new Stat("# total expected Msgs", totalReceivers * notifPerTopic));
-        statistics.add(new Stat("# total msgs received", totNumberOfMessagesReceived));
-        setStatList(notifPerTopic, noTopicsPublished, publishersRunningTime, executionTime, throughtput, statistics);
-        printStatistics(statistics, outfile);
-
-        for (NotificationManager notifMngr : notifManagerArray) {
-            notifMngr.cleanup();
-        }
-
-        System.out.println("end of test");
-        System.exit(0);
-    }
-
-    private static void setConfigurationValues() {
-        notifPerTopic = Integer.parseInt(configurations.getProperty(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC));
-        noTopicsPublished = Integer.parseInt(configurations.getProperty(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED));
-        protocol = configurations.getProperty(ConfigKeys.PROTOCOL);
-        payLoadMultiplier = Integer.parseInt(configurations.getProperty(ConfigKeys.PAYLOAD_MULTIPLYER));
-        consumerPort = Integer.parseInt(configurations.getProperty(ConfigKeys.CONSUMER_PORT));
-        testExpirationTime = Math.max(20000,
-                Long.parseLong(configurations.getProperty(ConfigKeys.PERFORMANCE_TEST_TIMEOUT, "20000")));
-        numberOfSubscriber = Integer.parseInt(configurations.getProperty(ConfigKeys.NUMBER_OF_SUBSCRIBERS));
-        numMultiThreadsSupportPerSub = Integer.parseInt(configurations.getProperty(ConfigKeys.MULTI_THREAD_PER_SUB));
-        topicPrefix = "topic" + configurations.getProperty(ConfigKeys.TOPIC_SIMPLE);
-        NOTIFICATIONS_PUBLISHED_PER_TOPIC = notifPerTopic;
-    }
-
-    private static void setStatList(int notifPerTopic, int noTopicsPublished, long publishersRunningTime,
-            long executionTime, double throughtput, List<Stat> statistics) {
-
-        statistics.add(new Stat("# topics published", noTopicsPublished));
-        statistics.add(new Stat("Total RTT (millis)", totalRoundTripTime));
-        statistics.add(new Stat("Average RTT (millis)", avgRountTripTime));
-        statistics.add(new Stat("Total published to receive time (millis)", executionTime));
-        statistics.add(new Stat("Throughput (messages per second)", throughtput));
-        statistics.add(new Stat("Total publish RTT (millis)", totalPublishRTT));
-        statistics.add(new Stat("Average publish RTT (millis)", avgPublishRTTime));
-        statistics.add(new Stat("publisher duration (millis)", publishersRunningTime));
-        statistics.add(new Stat("Publisher throughput (messages per second)", noTopicsPublished * notifPerTopic * 1000
-                / publishersRunningTime));
-    }
-
-    private static void setPayload(int payLoadMultiplier) {
-        String tempPayload = "";
-        try {
-            tempPayload = LoadMsgPayload.getInstance().getMessage("payload.txt");
-        } catch (FileNotFoundException e2) {
-            e2.printStackTrace();
-        } catch (IOException e) {
-            e.printStackTrace();
-        }
-
-        for (int i = 1; i <= payLoadMultiplier; i++) {
-            payload += tempPayload;
-        }
-    }
-
-    private static void createPublishers(int noTopicsPublished, String protocol, CountDownLatch publiserhStartSignal,
-            CountDownLatch publisherDoneSignal, PublisherThread[] publisher) {
-        int threadId = 0;
-        for (int j = 0; j < noTopicsPublished; j++) {
-            threadId++;
-            publisher[j] = new PublisherThread(protocol, configurations.getProperty(ConfigKeys.BROKER_URL), topicPrefix
-                    + j, payload, publiserhStartSignal, publisherDoneSignal, threadId);
-            publisher[j].start();
-        }
-    }
-
-    private static void createSubscriberArray(int noTopicsPublished, int numberOfSubscriber,
-            NotificationManager[] notifManagerArray, int arrayIndex) throws Exception, IOException {
-        if ("false".equalsIgnoreCase(configurations.getProperty(ConfigKeys.IS_XPATH_ENABLED))) {
-            if (numberOfSubscriber <= noTopicsPublished) {
-                for (int i = 0; i < noTopicsPublished; ++i) {
-                    notifManagerArray[arrayIndex].createTopicSubscription(topicPrefix + i);
-                    notifManagerArray[arrayIndex++].incNoTopicsSubscribed();
-                    if (arrayIndex >= numberOfSubscriber) {
-                        arrayIndex = 0;
-                    }
-                }
-            } else {
-                int topicIndex = 0;
-                for (int i = 0; i < numberOfSubscriber; ++i) {
-                    notifManagerArray[i].createTopicSubscription(topicPrefix + topicIndex++);
-                    notifManagerArray[i].incNoTopicsSubscribed();
-                    if (topicIndex >= noTopicsPublished) {
-                        topicIndex = 0;
-                    }
-                }
-            }
-        } else {
-            xpathList = LoadXpath.getInstace().getXpathList("xpath.list");
-            if (numberOfSubscriber <= noTopicsPublished) {
-                Iterator<String> ite = xpathList.iterator();
-                for (int i = 0; i < noTopicsPublished; ++i) {
-                    if (!ite.hasNext())
-                        ite = xpathList.iterator();
-
-                    notifManagerArray[arrayIndex].createXpathSubscription(topicPrefix + i, ite.next());
-                    notifManagerArray[arrayIndex++].incNoTopicsSubscribed();
-                    if (arrayIndex >= numberOfSubscriber) {
-                        arrayIndex = 0;
-                    }
-                }
-            } else {
-                int topicIndex = 0;
-                for (int i = 0; i < numberOfSubscriber; ++i) {
-                    notifManagerArray[i].incNoTopicsSubscribed();
-                    if (topicIndex >= noTopicsPublished) {
-                        topicIndex = 0;
-                    }
-                }
-            }
-        }
-    }
-
-    private static Properties getDefaults() {
-        Properties defaults = new Properties();
-        defaults.setProperty(ConfigKeys.BROKER_URL, "http://localhost:8080/axis2/services/EventingService");
-        defaults.setProperty(ConfigKeys.TOPIC_SIMPLE, "simpleSampleTopic");
-        defaults.setProperty(ConfigKeys.CONSUMER_PORT, "6666");
-        defaults.setProperty(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC, "5");
-        defaults.setProperty(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED, "5");
-        defaults.setProperty(ConfigKeys.IS_XPATH_ENABLED, "false");
-        defaults.setProperty(ConfigKeys.XPATH, "/c/b/a");
-        defaults.setProperty(ConfigKeys.PAYLOAD_MULTIPLYER, "1");
-        defaults.setProperty(ConfigKeys.PROTOCOL, "wse");
-        defaults.setProperty(ConfigKeys.PUBLISH_TIME_INTERVAL, "10000");
-        defaults.setProperty(ConfigKeys.PERFORMANCE_TEST_TIMEOUT, "5000000");
-        defaults.setProperty(ConfigKeys.NUMBER_OF_SUBSCRIBERS, "1");
-        defaults.setProperty(ConfigKeys.MULTI_THREAD_PER_SUB, "50");
-        return defaults;
-    }
-
-    private static void printStatistics(List<Stat> stats, File aFile) throws IOException {
-        int maxLen = 0;
-        Writer output = new BufferedWriter(new FileWriter(aFile, true));
-
-        for (Stat stat : stats) {
-            maxLen = Math.max(maxLen, stat.name.length());
-        }
-
-        char[] fillchars = null;
-
-        for (Stat stat : stats) {
-            fillchars = new char[maxLen - stat.name.length() + 1];
-            Arrays.fill(fillchars, ' ');
-            String formattedStr = String.format("%s%s : %s", stat.name, new String(fillchars), stat.value.toString());
-            output.write(formattedStr + "\n");
-            System.out.println(formattedStr);
-        }
-
-        fillchars = new char[maxLen];
-        Arrays.fill(fillchars, '-');
-        String fillingString = new String(fillchars);
-        output.write(fillingString + "\n");
-        System.out.println(fillingString);
-        output.close();
-    }
-
-    public static void loadConfigurationsFromFile() {
-        configurations = new Properties(getDefaults());
-
-        try {
-            URL url = ClassLoader.getSystemResource(ConfigKeys.CONFIG_FILE_NAME);
-            if (url == null) {
-                throw new IOException("configuration file not found");
-            }
-            configurations.load(url.openStream());
-        } catch (IOException ioe) {
-            System.out.println("unable to load configuration file, default settings will be used");
-        }
-    }
-
-    // Not used, If required to run as a test case call it from main
-    public static void loadConfigurationsFromSystemEnv() {
-
-        configurations = new Properties(getDefaults());
-
-        Properties envConfigs = System.getProperties();
-        String brokerUrl = envConfigs.getProperty(ConfigKeys.BROKER_URL, null);
-        String consumerUrl = envConfigs.getProperty(ConfigKeys.CONSUMER_EPR, null);
-        String consumerPort = envConfigs.getProperty(ConfigKeys.CONSUMER_PORT, null);
-        String isXpathEnabled = envConfigs.getProperty(ConfigKeys.IS_XPATH_ENABLED, null);
-        String notifPerTopic = envConfigs.getProperty(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC, null);
-        String subsPerTopic = envConfigs.getProperty(ConfigKeys.NUMBER_OF_SUBS_PERTOPIC, null);
-        String noTopicsPublished = envConfigs.getProperty(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED, null);
-        String payLoadMultiplier = envConfigs.getProperty(ConfigKeys.PAYLOAD_MULTIPLYER, null);
-        String protocol = envConfigs.getProperty(ConfigKeys.PROTOCOL, null);
-        String topicSimple = envConfigs.getProperty(ConfigKeys.TOPIC_SIMPLE, null);
-        String topicXpath = envConfigs.getProperty(ConfigKeys.XPATH, null);
-
-        if (brokerUrl == null) {
-            System.err.println(ConfigKeys.BROKER_URL + " not given");
-            System.exit(1);
-        }
-        if (consumerUrl == null) {
-            System.err.println(ConfigKeys.CONSUMER_EPR + " not given");
-            System.exit(1);
-        }
-        if (consumerPort == null) {
-            System.err.println(ConfigKeys.CONSUMER_PORT + " not given");
-            System.exit(1);
-        }
-        if (isXpathEnabled == null) {
-            System.err.println(ConfigKeys.IS_XPATH_ENABLED + " not given");
-            System.exit(1);
-        }
-        if (notifPerTopic == null) {
-            System.err.println(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC + " not given");
-            System.exit(1);
-        }
-        if (subsPerTopic == null) {
-            System.err.println(ConfigKeys.NUMBER_OF_SUBS_PERTOPIC + " not given");
-            System.exit(1);
-        }
-        if (noTopicsPublished == null) {
-            System.err.println(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED + " not given");
-            System.exit(1);
-        }
-        if (payLoadMultiplier == null) {
-            System.err.println(ConfigKeys.PAYLOAD_MULTIPLYER + " not given");
-            System.exit(1);
-        }
-        if (protocol == null) {
-            System.err.println(ConfigKeys.PROTOCOL + " not given");
-            System.exit(1);
-        }
-        if (topicSimple == null) {
-            System.err.println(ConfigKeys.TOPIC_SIMPLE + " not given");
-            System.exit(1);
-        }
-        if (topicXpath == null) {
-            System.err.println(ConfigKeys.XPATH + " not given");
-            System.exit(1);
-        }
-
-        configurations.put(ConfigKeys.BROKER_URL, brokerUrl);
-        configurations.put(ConfigKeys.CONSUMER_EPR, consumerUrl);
-        configurations.put(ConfigKeys.CONSUMER_PORT, consumerPort);
-        configurations.put(ConfigKeys.IS_XPATH_ENABLED, isXpathEnabled);
-        configurations.put(ConfigKeys.NOTIFICATIONS_PUBLISHED_PER_TOPIC, notifPerTopic);
-        configurations.put(ConfigKeys.NUMBER_OF_SUBS_PERTOPIC, subsPerTopic);
-        configurations.put(ConfigKeys.NUMBER_OF_TOPICS_PUBLISHED, noTopicsPublished);
-        configurations.put(ConfigKeys.PAYLOAD_MULTIPLYER, payLoadMultiplier);
-        configurations.put(ConfigKeys.PROTOCOL, protocol);
-        configurations.put(ConfigKeys.TOPIC_SIMPLE, topicSimple);
-        configurations.put(ConfigKeys.XPATH, topicXpath);
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PublisherThread.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PublisherThread.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PublisherThread.java
deleted file mode 100644
index 4f1215b..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/PublisherThread.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.performance_evaluator.rtt;
-
-import java.util.concurrent.CountDownLatch;
-
-import org.apache.airavata.wsmg.client.*;
-
-public class PublisherThread extends Thread {
-    private String brokerURL;
-    private String topic;
-    private final CountDownLatch startSignal;
-    private final CountDownLatch doneSignal;
-    private long totPublishTime = 0l;
-    long avgPublishTime = 0l;
-
-    private String payload = "";
-    String msg = "";
-    private MessageBrokerClient client = null;
-    int trackId = 0;
-    int threadId = 0;
-
-    public PublisherThread(String protocolIn, String brokerURLIn, String topicIn, String payloadIn,
-            CountDownLatch startSignalIn, CountDownLatch doneSignalIn, int threadIdIn) {
-        this.payload = payloadIn;
-        this.brokerURL = brokerURLIn;
-        this.topic = topicIn;
-        this.startSignal = startSignalIn;
-        this.doneSignal = doneSignalIn;
-        this.threadId = threadIdIn;
-        if ("wse".equalsIgnoreCase(protocolIn)) {
-
-            WseMsgBrokerClient wseMsgBrokerClient = new WseMsgBrokerClient();
-            wseMsgBrokerClient.setTimeoutInMilliSeconds(0);
-            wseMsgBrokerClient.init(brokerURL);
-            client = wseMsgBrokerClient;
-
-        } else {
-
-            WsntMsgBrokerClient wsntMsgBrokerClient = new WsntMsgBrokerClient();
-            wsntMsgBrokerClient.setTimeoutInMilliSeconds(0);
-            wsntMsgBrokerClient.init(brokerURL);
-            client = wsntMsgBrokerClient;
-        }
-
-    }
-
-    public void run() {
-
-        try {
-            trackId = 1;
-            startSignal.await();
-            System.out.println("Publishing started for topic :" + this.topic);
-            for (int i = 0; i < PerformanceTest.NOTIFICATIONS_PUBLISHED_PER_TOPIC; i++) {
-                msg = "<perf:performancetest xmlns:perf=\"http://lead.extreme.indiana.edu/namespaces/performance\"><perf:time>"
-                        + System.currentTimeMillis()
-                        + "</perf:time><perf:trackInfo><perf:threadId>"
-                        + threadId
-                        + "</perf:threadId><perf:trackId>"
-                        + trackId
-                        + "</perf:trackId></perf:trackInfo>"
-                        + "<perf:payload>" + payload + "</perf:payload></perf:performancetest>";
-                long publishStartTime = System.currentTimeMillis();
-                client.publish(topic, msg);
-                totPublishTime += System.currentTimeMillis() - publishStartTime;
-                trackId++;
-            }
-
-            avgPublishTime = totPublishTime / PerformanceTest.NOTIFICATIONS_PUBLISHED_PER_TOPIC;
-            System.out.println("Publishing ended for topic :" + this.topic);
-            doneSignal.countDown();
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    synchronized long getAvgPubTime() {
-        return this.avgPublishTime;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatCalculatorThread.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatCalculatorThread.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatCalculatorThread.java
deleted file mode 100644
index 541d80b..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatCalculatorThread.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.performance_evaluator.rtt;
-
-import java.util.concurrent.TimeUnit;
-
-public class StatCalculatorThread extends Thread {
-
-    private NotificationManager notifManager = null;
-    private long lastMsgReceivedTime = 0l;
-    private long timeTot = 0;
-    private long avgTime = 0;
-    private int numberOfMssgsReceived = 0; // to avoid concurrency
-    private long timeOutMillis;
-    private int expectedNoMessages = 0;
-
-    public StatCalculatorThread(NotificationManager notificationManager, long timeOutInMillis) throws Exception {
-        this.timeOutMillis = timeOutInMillis;
-        this.notifManager = notificationManager;
-        expectedNoMessages = PerformanceTest.NOTIFICATIONS_PUBLISHED_PER_TOPIC
-                * notificationManager.getNoTopicsSubscribed();
-    }
-
-    @Override
-    public void run() {
-        do {
-
-            StatContainer container = null;
-            try {
-                container = notifManager.getQueue().poll(timeOutMillis, TimeUnit.MILLISECONDS);
-
-                if (container != null) {
-                    timeTot += container.getRondTripTime();
-                    lastMsgReceivedTime = container.getMessageReceivedTime();
-                    numberOfMssgsReceived++;
-                    // ******un-comment in order to log trakId and message
-                    // related other information*****
-                    // if (logger.isInfoEnabled()) {
-                    // trackInfo = env
-                    // .getBody()
-                    // .getFirstElement()
-                    // .getFirstChildWithName(
-                    // new QName(
-                    // "http://lead.extreme.indiana.edu/namespaces/performance",
-                    // "trackInfo")).toStringWithConsume();
-                    // logger.info(trackInfo + "   Send time :" + time
-                    // + "  Received time :" + System.currentTimeMillis());
-                    // }
-                } else {
-                    System.out.println("stat calculator thread was interrupted");
-                    break;
-                }
-            } catch (InterruptedException e1) {
-                e1.printStackTrace();
-                break;
-            }
-
-        } while (expectedNoMessages > numberOfMssgsReceived);
-
-        if (numberOfMssgsReceived > 0) {
-            avgTime = timeTot / numberOfMssgsReceived;
-        } else {
-            System.out.println("no messages received");
-        }
-
-        System.out.println("end of stat calculator");
-    }
-
-    synchronized long getTotalTime() {
-        return timeTot;
-    }
-
-    synchronized long getAverageTime() {
-        return avgTime;
-    }
-
-    synchronized long getNumberOfMsgReceived() {
-        return numberOfMssgsReceived;
-    }
-
-    synchronized public long getLastMsgReceivedTime() {
-        return lastMsgReceivedTime;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatContainer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatContainer.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatContainer.java
deleted file mode 100644
index 31b9c85..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/StatContainer.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.performance_evaluator.rtt;
-
-import org.apache.axiom.soap.SOAPEnvelope;
-
-public class StatContainer {
-    private SOAPEnvelope msgEnvelope = null;
-    private long rtt = 0l;
-    private long receivedTime = 0l;
-
-    public StatContainer(SOAPEnvelope msgEnvelope) {
-        this.msgEnvelope = msgEnvelope;
-        this.receivedTime = System.currentTimeMillis();
-        this.rtt = this.receivedTime
-                - Long.parseLong(msgEnvelope.getBody().getFirstElement().getFirstElement().getText());
-    }
-
-    public long getRondTripTime() {
-        return this.rtt;
-    }
-
-    public SOAPEnvelope getMsgEnvelope() {
-        return msgEnvelope;
-    }
-
-    public long getMessageReceivedTime() {
-        return this.receivedTime;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/Subscription.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/Subscription.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/Subscription.java
deleted file mode 100644
index d8df04f..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/Subscription.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.performance_evaluator.rtt;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.MessageBrokerClient;
-import org.apache.axis2.addressing.EndpointReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class Subscription {
-
-    private String subscriptionID;
-
-    private String topic;
-    private final static Logger logger = LoggerFactory.getLogger(Subscription.class);
-    private ConsumerNotificationHandler handler;
-    private MessageBrokerClient client;
-    private EndpointReference messageBoxEPR;
-    private String xpath;
-    private String brokerURL;
-
-    private String protocol;
-
-    public Subscription(MessageBrokerClient clientIn, String subscriptionID, String topic,
-            ConsumerNotificationHandler callback, String brokerURL, String protocolIn) {
-        super();
-        this.subscriptionID = subscriptionID;
-        this.topic = topic;
-        this.handler = callback;
-        this.brokerURL = brokerURL;
-        this.client = clientIn;
-        this.protocol = protocolIn;
-    }
-
-    public Subscription(MessageBrokerClient clientIn, String subscriptionID, String topic, String xpath,
-            ConsumerNotificationHandler callback, String brokerURL, String protocolIn) {
-        super();
-        this.client = clientIn;
-        this.subscriptionID = subscriptionID;
-        this.topic = topic;
-        this.handler = callback;
-        this.brokerURL = brokerURL;
-        this.xpath = xpath;
-        this.protocol = protocolIn;
-    }
-
-    public ConsumerNotificationHandler getCallback() {
-        return handler;
-    }
-
-    public String getTopic() {
-        return topic;
-    }
-
-    // public void destroy() throws RemoteException {
-    // client.shutdownConsumerService();
-    // }
-
-    public EndpointReference getMessageBoxEPR() {
-        return messageBoxEPR;
-    }
-
-    public void setMessageBoxEpr(EndpointReference messageBoxEPR) {
-        this.messageBoxEPR = messageBoxEPR;
-    }
-
-    public String getSubscriptionID() {
-        return subscriptionID;
-    }
-
-    public void setSubscriptionID(String subscriptionID) {
-        this.subscriptionID = subscriptionID;
-    }
-
-    public String getBrokerURL() {
-        return brokerURL;
-    }
-
-    public void setBrokerURL(String brokerURL) {
-        this.brokerURL = brokerURL;
-    }
-
-    // public String getConsumerEPR() throws UnknownHostException {
-    // cli
-    // }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/ConfigKeys.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/ConfigKeys.java
deleted file mode 100644
index 6463f31..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/ConfigKeys.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.performance_evaluator.rtt.util;
-
-public interface ConfigKeys {
-    String CONFIG_FILE_NAME = "configurations.properties";
-    String BROKER_URL = "broker.eventing.service.epr";
-    String CONSUMER_EPR = "consumer.location";
-    String CONSUMER_PORT = "consumer.port";
-    String TOPIC_SIMPLE = "topic.simple";
-    String TOPIC_XPATH = "topic.xpath";
-    String PUBLISH_TIME_INTERVAL = "publish.time.interval";
-    String IS_XPATH_ENABLED = "is.xpath.enabled";
-    String XPATH = "topic.xpath";
-    String PAYLOAD_MULTIPLYER = "payload.multiplyer";
-    String PROTOCOL = "protocol.used";
-    String NUMBER_OF_SUBS_PERTOPIC = "num.subscribers.per.topic";
-    String NOTIFICATIONS_PUBLISHED_PER_TOPIC = "notifications.per.topic";
-    String NUMBER_OF_TOPICS_PUBLISHED = "number.of.topics";
-    String SCHEDULER_REPEAT_PERIOD = "stat.timeout.monitor.scheduler.period";
-    String PERFORMANCE_TEST_TIMEOUT = "performance.test.timeout.period.millis";
-    String NUMBER_OF_SUBSCRIBERS = "number.of.subscriber.servers";
-    String MULTI_THREAD_PER_SUB = "num.muti.thread.per.sub";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadMsgPayload.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadMsgPayload.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadMsgPayload.java
deleted file mode 100644
index 8ed4cb6..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadMsgPayload.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.performance_evaluator.rtt.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-
-public class LoadMsgPayload {
-
-    private static LoadMsgPayload msg = null;
-
-    public static LoadMsgPayload getInstance() {
-        if (msg == null)
-            msg = new LoadMsgPayload();
-        return msg;
-    }
-
-    public String getMessage(String fileName) throws IOException {
-        URL url = ClassLoader.getSystemResource(fileName);
-        if (url != null)
-            return convertStreamToString(url.openStream());
-        else
-            return "";
-    }
-
-    private String convertStreamToString(InputStream is) throws IOException {
-        if (is != null) {
-            StringBuilder sb = new StringBuilder();
-            String line;
-
-            try {
-                BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-                while ((line = reader.readLine()) != null) {
-                    sb.append(line).append("\n");
-                }
-            } finally {
-                is.close();
-            }
-            return sb.toString();
-        } else {
-            return "";
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadXpath.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadXpath.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadXpath.java
deleted file mode 100644
index 1a1a5fa..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/performance_evaluator/rtt/util/LoadXpath.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.performance_evaluator.rtt.util;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.net.URL;
-import java.util.LinkedList;
-
-public class LoadXpath {
-    private static LoadXpath xpath = null;
-    LinkedList<String> xpathList = null;
-
-    public static LoadXpath getInstace() {
-        if (xpath == null)
-            xpath = new LoadXpath();
-        return xpath;
-    }
-
-    public LinkedList<String> getXpathList(String fileName) throws IOException {
-        URL url = ClassLoader.getSystemResource(fileName);
-        if (url != null && xpathList == null)
-            return convertStreamToString(url.openStream());
-        return xpathList;
-    }
-
-    private LinkedList<String> convertStreamToString(InputStream is) throws IOException {
-        if (is != null) {
-            xpathList = new LinkedList<String>();
-            String line;
-
-            try {
-                BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
-                while ((line = reader.readLine()) != null) {
-                    xpathList.add(line);
-                }
-            } finally {
-                is.close();
-            }
-            return xpathList;
-        } else {
-            return null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java
deleted file mode 100644
index e0162e7..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/BrokerUtilTest.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.util;
-
-import javax.xml.namespace.QName;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axis2.AxisFault;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-public class BrokerUtilTest extends TestCase {
-
-    /**
-     * @throws java.lang.Exception
-     */
-    @Before
-    public void setUp() throws Exception {
-    }
-
-    /**
-     * @throws java.lang.Exception
-     */
-    @After
-    public void tearDown() throws Exception {
-    }
-
-    /**
-     * Test method for
-     * {@link org.apache.airavata.wsmg.util.BrokerUtil#sameStringValue(java.lang.String, java.lang.String)} .
-     */
-    @Test
-    public void testSameStringValue() {
-
-        assertTrue(BrokerUtil.sameStringValue(null, null));
-        assertTrue(BrokerUtil.sameStringValue("test", "test"));
-
-        assertFalse(BrokerUtil.sameStringValue("one", "two"));
-        assertFalse(BrokerUtil.sameStringValue(null, "test"));
-        assertFalse(BrokerUtil.sameStringValue("test", null));
-
-    }
-
-    /**
-     * Test method for {@link org.apache.airavata.wsmg.util.BrokerUtil#getTopicLocalString(java.lang.String)}.
-     */
-    @Test
-    public void testGetTopicLocalString() {
-
-        assertEquals("localstring", (BrokerUtil.getTopicLocalString("prefix:localstring")));
-
-        assertEquals("localstring", BrokerUtil.getTopicLocalString("localstring"));
-
-    }
-
-    /**
-     * Test method for {@link org.apache.airavata.wsmg.util.BrokerUtil#getXPathString(org.apache.axiom.om.OMElement)}.
-     */
-    @Test
-    public void testGetXPathString() {
-
-        OMFactory factory = OMAbstractFactory.getOMFactory();
-
-        try {
-
-            BrokerUtil.getXPathString(null);
-            fail("method should validate invalid arguments");
-        } catch (IllegalArgumentException e) {
-
-        } catch (AxisFault e) {
-            fail("invalid exception thrown");
-        }
-
-        try {
-
-            QName invalidQName = new QName("invalidURI", "invalidLocalName");
-
-            OMElement xpathEl = factory.createOMElement(invalidQName);
-
-            BrokerUtil.getXPathString(xpathEl);
-
-            fail("method should validate arguments");
-
-        } catch (AxisFault fault) {
-
-        }
-
-        try {
-
-            String xpathExpression = "testXpathExpression";
-            String dialect = "unknownXpathDialect";
-
-            OMNamespace ns = factory.createOMNamespace("unit_test", "jnt");
-
-            OMElement xpathEl = factory.createOMElement("TestXpath", ns);
-            xpathEl.addAttribute("Dialect", dialect, null);
-
-            xpathEl.setText(xpathExpression);
-
-            BrokerUtil.getXPathString(xpathEl);
-
-            fail("method should reject unknown dialect");
-        } catch (AxisFault e) {
-
-        }
-
-        try {
-
-            String xpathExpression = "textXpathExpression";
-            String dialect = WsmgCommonConstants.XPATH_DIALECT;
-
-            OMNamespace ns = factory.createOMNamespace("unit_test", "jnt");
-
-            OMElement xpathEl = factory.createOMElement("TestXpath", ns);
-            xpathEl.addAttribute("Dialect", dialect, null);
-
-            xpathEl.setText(xpathExpression);
-            assertEquals(xpathExpression, BrokerUtil.getXPathString(xpathEl));
-
-        } catch (AxisFault e) {
-            fail("unable to extract xpath query: " + e.toString());
-        }
-
-    }
-
-    /**
-     * Test method for {@link org.apache.airavata.wsmg.util.BrokerUtil#getTopicFromRequestPath(java.lang.String)}.
-     */
-    @Test
-    public void testGetTopicFromRequestPath() {
-
-        assertNull(BrokerUtil.getTopicFromRequestPath(null));
-        assertNull(BrokerUtil.getTopicFromRequestPath(""));
-        assertNull(BrokerUtil.getTopicFromRequestPath("/"));
-        assertNull(BrokerUtil.getTopicFromRequestPath("/subscribe/url/"));
-        assertNull(BrokerUtil.getTopicFromRequestPath("/subscribe/url/topic/"));
-
-        assertEquals(BrokerUtil.getTopicFromRequestPath("/requestpath/topic/xyz"), "xyz");
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/ConfigKeys.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/ConfigKeys.java
deleted file mode 100644
index 0624442..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/ConfigKeys.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.util;
-
-public interface ConfigKeys {
-
-    String CONFIG_FILE_NAME = "unit_tests.properties";
-
-    String CONSUMER_EPR = "consumer.location";
-    String CONSUMER_PORT = "consumer.port";
-    String TOPIC_SIMPLE = "topic.simple";
-    String TOPIC_XPATH = "topic.xpath";
-    String AXIS2_REPO = "axis2.repo";
-
-}


[62/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/DifferedInputConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/DifferedInputConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/DifferedInputConfigurationDialog.java
new file mode 100644
index 0000000..8b075c4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/DifferedInputConfigurationDialog.java
@@ -0,0 +1,263 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.WSConstants;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.system.DifferedInputNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.lead.LEADTypes;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.graph.system.DifferedInputNodeGUI;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextComponent;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.xmlpull.infoset.XmlElement;
+
+public class DifferedInputConfigurationDialog {
+    private XBayaGUI xbayaGUI;
+
+    private DifferedInputNode node;
+
+    private XBayaDialog dialog;
+
+    private GridPanel gridPanel;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextArea descriptionTextArea;
+
+    private XBayaLabel valueLabel;
+
+    private XBayaTextField valueTextField;
+
+    private XBayaTextArea valueTextArea;
+
+    private XBayaTextArea metadataTextArea;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public DifferedInputConfigurationDialog(DifferedInputNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        QName type = this.node.getParameterType();
+        XBayaTextComponent textComponent;
+        boolean knownType = LEADTypes.isKnownType(type);
+        if (knownType) {
+            textComponent = this.valueTextField;
+            this.valueLabel.setText("Default value");
+        } else {
+            textComponent = this.valueTextArea;
+            this.valueLabel.setText("Default value (in XML)");
+        }
+        this.valueLabel.setLabelFor(textComponent);
+        final int index = 5;
+        this.gridPanel.remove(index);
+        this.gridPanel.add(textComponent, index);
+        if (knownType) {
+            this.gridPanel.layout(new double[] { 0, 1.0 / 2, 0, 1.0 / 2 },
+                    new double[] { 0, 1 });
+        } else {
+            this.gridPanel.layout(
+                    new double[] { 0, 1.0 / 3, 1.0 / 3, 1.0 / 3 },
+                    new double[] { 0, 1 });
+        }
+
+        // String name = this.node.getConfiguredName();
+        // if (name == null) {
+        // name = this.node.getName();
+        // }
+        String name = this.node.getID(); // Show ID.
+        this.nameTextField.setText(name);
+
+        this.descriptionTextArea.setText(this.node.getDescription());
+        Object value = this.node.getDefaultValue();
+        String valueString;
+        if (value == null) {
+            valueString = "";
+        } else if (value instanceof XmlElement) {
+            valueString = XMLUtil.xmlElementToString((XmlElement) value);
+        } else {
+            valueString = value.toString();
+        }
+        textComponent.setText(valueString);
+        XmlElement metadata = this.node.getMetadata();
+        String metadataText;
+        if (metadata == null) {
+            metadataText = WSConstants.EMPTY_APPINFO;
+        } else {
+            metadataText = XMLUtil.xmlElementToString(metadata);
+        }
+        this.metadataTextArea.setText(metadataText);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+    	
+        this.dialog.hide();
+        ((DifferedInputNodeGUI)NodeController.getGUI(this.node)).closingDisplay();
+    }
+
+    private void setInput() {
+        QName type = this.node.getParameterType();
+        XBayaTextComponent textComponent;
+        if (LEADTypes.isKnownType(type)) {
+            textComponent = this.valueTextField;
+        } else {
+            textComponent = this.valueTextArea;
+        }
+
+        String name = this.nameTextField.getText();
+        String description = this.descriptionTextArea.getText();
+        String valueString = textComponent.getText();
+        String metadataText = this.metadataTextArea.getText();
+
+        if (name.length() == 0) {
+            String warning = "The name cannot be empty.";
+            this.xbayaGUI.getErrorWindow().error(warning);
+            return;
+        }
+        Object value = null;
+        if (valueString.length() > 0) {
+            if (LEADTypes.isKnownType(type)) {
+                if (!this.node.isInputValid(valueString)) {
+                    String warning = "The defalut value is not valid for "
+                            + this.node.getParameterType() + ".";
+                    this.xbayaGUI.getErrorWindow().error(warning);
+                }
+                value = valueString;
+            } else {
+                try {
+                    value = XMLUtil.stringToXmlElement(valueString);
+                } catch (RuntimeException e) {
+                    String warning = "The XML for the default value is not valid.";
+                    this.xbayaGUI.getErrorWindow().error(warning, e);
+                }
+            }
+        }
+        XmlElement metadata;
+        if (metadataText.length() == 0) {
+            metadata = null;
+        } else {
+            try {
+                metadata = XMLUtil.stringToXmlElement(metadataText);
+            } catch (RuntimeException e) {
+                String warning = "The metadata is ill-formed.";
+                this.xbayaGUI.getErrorWindow().error(warning, e);
+                return;
+            }
+        }
+
+        this.node.setConfigured(true);
+        this.node.setConfiguredName(name);
+        this.node.setDescription(description);
+        this.node.setDefaultValue(value);
+        this.node.setMetadata(metadata);
+        this.node.setState(NodeExecutionState.FINISHED);
+        
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.descriptionTextArea = new XBayaTextArea();
+        XBayaLabel descriptionLabel = new XBayaLabel("Description",
+                this.descriptionTextArea);
+
+        this.valueTextField = new XBayaTextField(); // for string
+        this.valueTextArea = new XBayaTextArea(); // for XML
+        // temporaly set text field.
+        this.valueLabel = new XBayaLabel("", this.valueTextField);
+
+        this.metadataTextArea = new XBayaTextArea();
+        XBayaLabel metadataLabel = new XBayaLabel("Metadata",
+                this.metadataTextArea);
+
+        this.gridPanel = new GridPanel();
+        this.gridPanel.add(nameLabel);
+        this.gridPanel.add(this.nameTextField);
+        this.gridPanel.add(descriptionLabel);
+        this.gridPanel.add(this.descriptionTextArea);
+        this.gridPanel.add(this.valueLabel);
+        this.gridPanel.add(this.valueTextField);
+        this.gridPanel.add(metadataLabel);
+        this.gridPanel.add(this.metadataTextArea);
+        this.gridPanel.layout(4, 2, 3, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            @Override
+			public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            @Override
+			public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI,
+                "Input Parameter Configuration", this.gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/DoWhileConfigrationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/DoWhileConfigrationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/DoWhileConfigrationDialog.java
new file mode 100644
index 0000000..7093445
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/DoWhileConfigrationDialog.java
@@ -0,0 +1,189 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+
+public class DoWhileConfigrationDialog {
+
+	private XBayaGUI xbayaGUI;
+
+	private DoWhileNode node;
+
+	private XBayaDialog dialog;
+
+	private XBayaTextField nameTextField;
+
+	private XBayaTextField idTextField;
+
+	private JSpinner numPorts;
+
+	private XBayaTextField xpathTextField;
+
+	/**
+	 * Constructs an InputConfigurationWindow.
+	 *
+	 * @param node
+	 * @param engine
+	 */
+	public DoWhileConfigrationDialog(DoWhileNode node, XBayaGUI xbayaGUI) {
+		this.xbayaGUI = xbayaGUI;
+		this.node = node;
+		initGui();
+	}
+
+	/**
+	 * Shows the dialog.
+	 */
+	@SuppressWarnings("boxing")
+	public void show() {
+		String name = this.node.getName();
+		this.nameTextField.setText(name);
+		this.idTextField.setText(this.node.getID());
+		int number = this.node.getInputPorts().size();
+		this.numPorts.setValue(number);
+		String xpath = this.node.getXpath();
+		this.xpathTextField.setText(xpath);
+
+		this.dialog.show();
+	}
+
+	/**
+	 * Hides the dialog.
+	 */
+	private void hide() {
+		this.dialog.hide();
+	}
+
+	private void setInput() {
+		String xpathString = this.xpathTextField.getText();
+
+		Integer value = (Integer) this.numPorts.getValue();
+		int number = value.intValue();
+		int current = this.node.getInputPorts().size();
+		try {
+			if (number < 2){
+				this.xbayaGUI.getErrorWindow().error("Number of inputs can't be less than 2");
+			}
+			if (number > current) {
+				// Add ports
+				for (int i = 0; i < number - current; i++) {
+					this.node.addInputPort();
+					this.node.addOutputPort();
+				}
+			} else if (number >= 2 && number < current) {
+				for (int i = 0; i < current - number; i++) {
+					this.node.removeInputPort();
+					this.node.removeOutputPort();
+				}
+			} else {
+				// Do nothing.
+			}
+		} catch (GraphException e) {
+			this.xbayaGUI.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+		}
+
+		if (xpathString.length() == 0) {
+			String warning = "XPath cannot be empty.";
+//			this.engine.getErrorWindow().error(warning);
+			return;
+		}
+
+		this.node.setXpath(xpathString);
+
+		hide();
+		this.xbayaGUI.getGraphCanvas().repaint();
+	}
+
+	/**
+	 * Initializes the GUI.
+	 */
+	private void initGui() {
+		this.nameTextField = new XBayaTextField();
+		this.nameTextField.setEditable(false);
+		XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+		this.idTextField = new XBayaTextField();
+		this.idTextField.setEditable(false);
+		XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+		SpinnerNumberModel model = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1);
+		this.numPorts = new JSpinner(model);
+		XBayaLabel numPortLabel = new XBayaLabel("Number of Inputs", this.numPorts);
+
+		this.xpathTextField = new XBayaTextField();
+		XBayaLabel xpathLabel = new XBayaLabel("XPath", this.xpathTextField);
+
+		GridPanel gridPanel = new GridPanel();
+		gridPanel.add(nameLabel);
+		gridPanel.add(this.nameTextField);
+		gridPanel.add(idLabel);
+		gridPanel.add(this.idTextField);
+		gridPanel.add(numPortLabel);
+		gridPanel.add(this.numPorts);
+		gridPanel.add(xpathLabel);
+		gridPanel.add(this.xpathTextField);
+		gridPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);
+
+		JButton okButton = new JButton("OK");
+		okButton.addActionListener(new AbstractAction() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				setInput();
+			}
+		});
+
+		JButton cancelButton = new JButton("Cancel");
+		cancelButton.addActionListener(new AbstractAction() {
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				hide();
+			}
+		});
+
+		JPanel buttonPanel = new JPanel();
+		buttonPanel.add(okButton);
+		buttonPanel.add(cancelButton);
+
+		this.dialog = new XBayaDialog(xbayaGUI, "While Configuration", gridPanel, buttonPanel);
+		this.dialog.setDefaultButton(okButton);
+	}
+
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndBlockConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndBlockConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndBlockConfigurationDialog.java
new file mode 100644
index 0000000..b246569
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndBlockConfigurationDialog.java
@@ -0,0 +1,163 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.system.EndBlockNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class EndBlockConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private EndBlockNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextField idTextField;
+
+    private JSpinner numPorts;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public EndBlockConfigurationDialog(EndBlockNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    @SuppressWarnings("boxing")
+    public void show() {
+        String name = this.node.getName();
+        this.nameTextField.setText(name);
+        this.idTextField.setText(this.node.getID());
+        int number = this.node.getOutputPorts().size();
+        this.numPorts.setValue(number);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        Integer value = (Integer) this.numPorts.getValue();
+        int number = value.intValue();
+        int current = this.node.getOutputPorts().size();
+        try {
+            if (number > current) {
+                // Add ports
+                for (int i = 0; i < number - current; i++) {
+                    this.node.addOutputPort();
+                    this.node.addInputPort();
+                    this.node.addInputPort();
+                }
+            } else if (number < current) {
+                for (int i = 0; i < current - number; i++) {
+                    this.node.removeOutputPort();
+                    this.node.removeInputPort();
+                    this.node.removeInputPort();
+                }
+            } else {
+                // Do nothing.
+            }
+        } catch (GraphException e) {
+            this.xbayaGUI.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        }
+
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        this.nameTextField.setEditable(false);
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.idTextField = new XBayaTextField();
+        this.idTextField.setEditable(false);
+        XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+        SpinnerNumberModel model = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1);
+        this.numPorts = new JSpinner(model);
+        XBayaLabel numPortLabel = new XBayaLabel("Number of Parameters", this.numPorts);
+
+        GridPanel gridPanel = new GridPanel();
+        gridPanel.add(nameLabel);
+        gridPanel.add(this.nameTextField);
+        gridPanel.add(idLabel);
+        gridPanel.add(this.idTextField);
+        gridPanel.add(numPortLabel);
+        gridPanel.add(this.numPorts);
+        gridPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Endif Configuration", gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndDoWhileConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndDoWhileConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndDoWhileConfigurationDialog.java
new file mode 100644
index 0000000..4002fca
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndDoWhileConfigurationDialog.java
@@ -0,0 +1,172 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.system.EndDoWhileNode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class EndDoWhileConfigurationDialog {
+
+	    private XBayaGUI xbayaGUI;
+
+	    private EndDoWhileNode node;
+
+	    private XBayaDialog dialog;
+
+	    private XBayaTextField nameTextField;
+
+	    private XBayaTextField idTextField;
+
+	    private JSpinner numPorts;
+
+	    /**
+	     * Constructs an InputConfigurationWindow.
+	     *
+	     * @param node
+	     * @param engine
+	     */
+	    public EndDoWhileConfigurationDialog(EndDoWhileNode node,  XBayaGUI xbayaGUI) {
+	        this.xbayaGUI = xbayaGUI;
+	        this.node = node;
+	        initGui();
+	    }
+
+	    /**
+	     * Shows the dialog.
+	     */
+	    @SuppressWarnings("boxing")
+	    public void show() {
+	        String name = this.node.getName();
+	        this.nameTextField.setText(name);
+	        this.idTextField.setText(this.node.getID());
+
+	        int number = this.node.getOutputPorts().size();
+	        this.numPorts.setValue(number);
+
+	        this.dialog.show();
+	    }
+
+	    /**
+	     * Hides the dialog.
+	     */
+	    private void hide() {
+	        this.dialog.hide();
+	    }
+
+	    private void setInput() {
+	        Integer value = (Integer) this.numPorts.getValue();
+	        int number = value.intValue();
+	        int current = this.node.getOutputPorts().size();
+	        try {
+	            if (number > current) {
+	                // Add ports
+	                for (int i = 0; i < number - current; i++) {
+	                    this.node.addOutputPort();
+	                    this.node.addInputPort();
+	                }
+	            } else if (number < current) {
+	                for (int i = 0; i < current - number; i++) {
+	                    this.node.removeOutputPort();
+	                    this.node.removeInputPort();
+	                }
+	            } else {
+	                // Do nothing.
+	            }
+	        } catch (GraphException e) {
+	            this.xbayaGUI.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR,
+	                    e);
+	        }
+	        hide();
+	        this.xbayaGUI.getGraphCanvas().repaint();
+	    }
+
+	    /**
+	     * Initializes the GUI.
+	     */
+	    private void initGui() {
+	        this.nameTextField = new XBayaTextField();
+	        this.nameTextField.setEditable(false);
+	        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+	        this.idTextField = new XBayaTextField();
+	        this.idTextField.setEditable(false);
+	        XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+
+	        SpinnerNumberModel model = new SpinnerNumberModel(1, 1,
+	                Integer.MAX_VALUE, 1);
+	        this.numPorts = new JSpinner(model);
+	        XBayaLabel numPortLabel = new XBayaLabel("Number of Parameters",
+	                this.numPorts);
+
+	        GridPanel gridPanel = new GridPanel();
+	        gridPanel.add(nameLabel);
+	        gridPanel.add(this.nameTextField);
+	        gridPanel.add(idLabel);
+	        gridPanel.add(this.idTextField);
+	        gridPanel.add(numPortLabel);
+	        gridPanel.add(this.numPorts);
+	        gridPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
+
+	        JButton okButton = new JButton("OK");
+	        okButton.addActionListener(new AbstractAction() {
+	            @Override
+				public void actionPerformed(ActionEvent e) {
+	                setInput();
+	            }
+	        });
+
+	        JButton cancelButton = new JButton("Cancel");
+	        cancelButton.addActionListener(new AbstractAction() {
+	            @Override
+				public void actionPerformed(ActionEvent e) {
+	                hide();
+	            }
+	        });
+
+	        JPanel buttonPanel = new JPanel();
+	        buttonPanel.add(okButton);
+	        buttonPanel.add(cancelButton);
+
+	        this.dialog = new XBayaDialog(xbayaGUI, "EndDoWhile Configuration",gridPanel, buttonPanel);
+	        this.dialog.setDefaultButton(okButton);
+	    }
+
+}
+
+
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndForEachConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndForEachConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndForEachConfigurationDialog.java
new file mode 100644
index 0000000..03ded0b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndForEachConfigurationDialog.java
@@ -0,0 +1,161 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class EndForEachConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private EndForEachNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextField idTextField;
+
+    private JSpinner numPorts;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public EndForEachConfigurationDialog(EndForEachNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    @SuppressWarnings("boxing")
+    public void show() {
+        String name = this.node.getName();
+        this.nameTextField.setText(name);
+        this.idTextField.setText(this.node.getID());
+        int number = this.node.getInputPorts().size();
+        this.numPorts.setValue(number);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        Integer value = (Integer) this.numPorts.getValue();
+        int number = value.intValue();
+        int current = this.node.getOutputPorts().size();
+        try {
+            if (number > current) {
+                // Add ports
+                for (int i = 0; i < number - current; i++) {
+                    this.node.addInputPort();
+                    this.node.addOutputPort();
+                }
+            } else if (number < current) {
+                for (int i = 0; i < current - number; i++) {
+                    this.node.removeInputPort();
+                    this.node.removeOutputPort();
+                }
+            } else {
+                // Do nothing.
+            }
+        } catch (GraphException e) {
+            this.xbayaGUI.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        }
+
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        this.nameTextField.setEditable(false);
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.idTextField = new XBayaTextField();
+        this.idTextField.setEditable(false);
+        XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+        SpinnerNumberModel model = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1);
+        this.numPorts = new JSpinner(model);
+        XBayaLabel numPortLabel = new XBayaLabel("Number of Parameters", this.numPorts);
+
+        GridPanel gridPanel = new GridPanel();
+        gridPanel.add(nameLabel);
+        gridPanel.add(this.nameTextField);
+        gridPanel.add(idLabel);
+        gridPanel.add(this.idTextField);
+        gridPanel.add(numPortLabel);
+        gridPanel.add(this.numPorts);
+        gridPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "EndForEach Configuration", gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndifConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndifConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndifConfigurationDialog.java
new file mode 100644
index 0000000..db075ee
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/EndifConfigurationDialog.java
@@ -0,0 +1,163 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.system.EndifNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class EndifConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private EndifNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextField idTextField;
+
+    private JSpinner numPorts;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public EndifConfigurationDialog(EndifNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    @SuppressWarnings("boxing")
+    public void show() {
+        String name = this.node.getName();
+        this.nameTextField.setText(name);
+        this.idTextField.setText(this.node.getID());
+        int number = this.node.getOutputPorts().size();
+        this.numPorts.setValue(number);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        Integer value = (Integer) this.numPorts.getValue();
+        int number = value.intValue();
+        int current = this.node.getOutputPorts().size();
+        try {
+            if (number > current) {
+                // Add ports
+                for (int i = 0; i < number - current; i++) {
+                    this.node.addOutputPort();
+                    this.node.addInputPort();
+                    this.node.addInputPort();
+                }
+            } else if (number < current) {
+                for (int i = 0; i < current - number; i++) {
+                    this.node.removeOutputPort();
+                    this.node.removeInputPort();
+                    this.node.removeInputPort();
+                }
+            } else {
+                // Do nothing.
+            }
+        } catch (GraphException e) {
+            this.xbayaGUI.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        }
+
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        this.nameTextField.setEditable(false);
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.idTextField = new XBayaTextField();
+        this.idTextField.setEditable(false);
+        XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+        SpinnerNumberModel model = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1);
+        this.numPorts = new JSpinner(model);
+        XBayaLabel numPortLabel = new XBayaLabel("Number of Parameters", this.numPorts);
+
+        GridPanel gridPanel = new GridPanel();
+        gridPanel.add(nameLabel);
+        gridPanel.add(this.nameTextField);
+        gridPanel.add(idLabel);
+        gridPanel.add(this.idTextField);
+        gridPanel.add(numPortLabel);
+        gridPanel.add(this.numPorts);
+        gridPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Endif Configuration", gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ForEachConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ForEachConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ForEachConfigurationDialog.java
new file mode 100644
index 0000000..a2c699a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ForEachConfigurationDialog.java
@@ -0,0 +1,161 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.system.ForEachNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class ForEachConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private ForEachNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextField idTextField;
+
+    private JSpinner numPorts;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public ForEachConfigurationDialog(ForEachNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    @SuppressWarnings("boxing")
+    public void show() {
+        String name = this.node.getName();
+        this.nameTextField.setText(name);
+        this.idTextField.setText(this.node.getID());
+        int number = this.node.getInputPorts().size();
+        this.numPorts.setValue(number);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        Integer value = (Integer) this.numPorts.getValue();
+        int number = value.intValue();
+        int current = this.node.getOutputPorts().size();
+        try {
+            if (number > current) {
+                // Add ports
+                for (int i = 0; i < number - current; i++) {
+                    this.node.addInputPort();
+                    this.node.addOutputPort();
+                }
+            } else if (number < current) {
+                for (int i = 0; i < current - number; i++) {
+                    this.node.removeInputPort();
+                    this.node.removeOutputPort();
+                }
+            } else {
+                // Do nothing.
+            }
+        } catch (GraphException e) {
+            this.xbayaGUI.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        }
+
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        this.nameTextField.setEditable(false);
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.idTextField = new XBayaTextField();
+        this.idTextField.setEditable(false);
+        XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+        SpinnerNumberModel model = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1);
+        this.numPorts = new JSpinner(model);
+        XBayaLabel numPortLabel = new XBayaLabel("Number of Parameters", this.numPorts);
+
+        GridPanel gridPanel = new GridPanel();
+        gridPanel.add(nameLabel);
+        gridPanel.add(this.nameTextField);
+        gridPanel.add(idLabel);
+        gridPanel.add(this.idTextField);
+        gridPanel.add(numPortLabel);
+        gridPanel.add(this.numPorts);
+        gridPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "ForEach Configuration", gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/IfConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/IfConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/IfConfigurationDialog.java
new file mode 100644
index 0000000..2de7a12
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/IfConfigurationDialog.java
@@ -0,0 +1,190 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.system.IfNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class IfConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private IfNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextField idTextField;
+
+    private JSpinner numPorts;
+
+    private XBayaTextField xpathTextField;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public IfConfigurationDialog(IfNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI = xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    @SuppressWarnings("boxing")
+    public void show() {
+        String name = this.node.getName();
+        this.nameTextField.setText(name);
+        this.idTextField.setText(this.node.getID());
+        int number = this.node.getInputPorts().size();
+        this.numPorts.setValue(number);
+        String xpath = this.node.getXPath();
+        this.xpathTextField.setText(xpath);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        String xpathString = this.xpathTextField.getText();
+
+        Integer value = (Integer) this.numPorts.getValue();
+        int number = value.intValue();
+        int current = this.node.getInputPorts().size();
+        try {
+            if (number > current) {
+                // Add ports
+                for (int i = 0; i < number - current; i++) {
+                    this.node.addInputPort();
+                }
+            } else if (number < current) {
+                for (int i = 0; i < current - number; i++) {
+                    this.node.removeInputPort();
+                }
+            } else {
+                // Do nothing.
+            }
+        } catch (GraphException e) {
+            this.xbayaGUI.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        }
+
+        if (xpathString.length() == 0) {
+            String warning = "XPath cannot be empty.";
+            this.xbayaGUI.getErrorWindow().error(warning);
+            return;
+        }
+        // Check if it's a valid XPath.
+        // We need to replace $1, $2 to something neutral and evaluate it as
+        // XPath.
+
+        // XPath xpath;
+        // try {
+        // xpath = new XisXPath(xpathString);
+        // } catch (RuntimeException e) {
+        // String warning = "XPath is in wrong format.";
+        // this.xbayaGUI.getErrorWindow().error(warning, e);
+        // return;
+        // }
+        this.node.setXPath(xpathString);
+
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        this.nameTextField.setEditable(false);
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.idTextField = new XBayaTextField();
+        this.idTextField.setEditable(false);
+        XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+        SpinnerNumberModel model = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1);
+        this.numPorts = new JSpinner(model);
+        XBayaLabel numPortLabel = new XBayaLabel("Number of Inputs", this.numPorts);
+
+        this.xpathTextField = new XBayaTextField();
+        XBayaLabel xpathLabel = new XBayaLabel("XPath", this.xpathTextField);
+
+        GridPanel gridPanel = new GridPanel();
+        gridPanel.add(nameLabel);
+        gridPanel.add(this.nameTextField);
+        gridPanel.add(idLabel);
+        gridPanel.add(this.idTextField);
+        gridPanel.add(numPortLabel);
+        gridPanel.add(this.numPorts);
+        gridPanel.add(xpathLabel);
+        gridPanel.add(this.xpathTextField);
+        gridPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "If Configuration", gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/InputConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/InputConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/InputConfigurationDialog.java
new file mode 100644
index 0000000..03130be
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/InputConfigurationDialog.java
@@ -0,0 +1,261 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.WSConstants;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.xbaya.lead.LEADTypes;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextComponent;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.xmlpull.infoset.XmlElement;
+
+public class InputConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private InputNode node;
+
+    private XBayaDialog dialog;
+
+    private GridPanel gridPanel;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextArea descriptionTextArea;
+
+    private XBayaLabel valueLabel;
+
+    private XBayaTextField valueTextField;
+
+    private XBayaTextArea valueTextArea;
+
+    private XBayaTextArea metadataTextArea;
+
+    private XBayaTextField visibilityTextField;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public InputConfigurationDialog(InputNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        QName type = this.node.getParameterType();
+        XBayaTextComponent textComponent;
+        boolean knownType = LEADTypes.isKnownType(type);
+        if (knownType) {
+            textComponent = this.valueTextField;
+            this.valueLabel.setText("Default value");
+        } else {
+            textComponent = this.valueTextArea;
+            this.valueLabel.setText("Default value (in XML)");
+        }
+        this.valueLabel.setLabelFor(textComponent);
+        final int index = 7;
+        this.gridPanel.remove(index);
+        this.gridPanel.add(textComponent, index);
+        if (knownType) {
+            this.gridPanel.layout(new double[] { 0, 1.0 / 2,0, 0, 1.0 / 2 }, new double[] { 0, 1 });
+        } else {
+            this.gridPanel.layout(new double[] { 0, 1.0 / 3,0, 1.0 / 3, 1.0 / 3 }, new double[] { 0, 1 });
+        }
+
+        String name = this.node.getID(); // Show ID.
+        this.nameTextField.setText(name);
+
+        String visibility = Boolean.toString(this.node.isVisibility());
+        this.visibilityTextField.setText(visibility);
+
+        this.descriptionTextArea.setText(this.node.getDescription());
+        Object value = this.node.getDefaultValue();
+        String valueString;
+        if (value == null) {
+            valueString = "";
+        } else if (value instanceof XmlElement) {
+            valueString = XMLUtil.xmlElementToString((XmlElement) value);
+        } else {
+            valueString = value.toString();
+        }
+        if (knownType) {
+            this.valueTextField.setText(valueString);
+        } else {
+            this.valueTextArea.setText(valueString);
+        }
+        textComponent.setText(valueString);
+        XmlElement metadata = this.node.getMetadata();
+        String metadataText;
+        if (metadata == null) {
+            metadataText = WSConstants.EMPTY_APPINFO;
+        } else {
+            metadataText = XMLUtil.xmlElementToString(metadata);
+        }
+        this.metadataTextArea.setText(metadataText);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        QName type = this.node.getParameterType();
+        XBayaTextComponent textComponent;
+        if (LEADTypes.isKnownType(type)) {
+            textComponent = this.valueTextField;
+        } else {
+            textComponent = this.valueTextArea;
+        }
+
+        String name = this.nameTextField.getText();
+        String description = this.descriptionTextArea.getText();
+        String valueString = textComponent.getText();
+        String metadataText = this.metadataTextArea.getText();
+        String visibilityText = this.visibilityTextField.getText();
+
+        if (name.length() == 0) {
+            String warning = "The name cannot be empty.";
+            this.xbayaGUI.getErrorWindow().error(warning);
+            return;
+        }
+        Object value = null;
+        if (valueString.length() > 0) {
+            if (LEADTypes.isKnownType(type)) {
+                if (!this.node.isInputValid(valueString)) {
+                    String warning = "The defalut value is not valid for " + this.node.getParameterType() + ".";
+                    this.xbayaGUI.getErrorWindow().error(warning);
+                }
+                value = valueString;
+            } else {
+                try {
+                    value = XMLUtil.stringToXmlElement(valueString);
+                } catch (RuntimeException e) {
+                    String warning = "The XML for the default value is not valid.";
+                    this.xbayaGUI.getErrorWindow().error(warning, e);
+                }
+            }
+        }
+        XmlElement metadata;
+        if (metadataText.length() == 0) {
+            metadata = null;
+        } else {
+            try {
+                metadata = XMLUtil.stringToXmlElement(metadataText);
+            } catch (RuntimeException e) {
+                String warning = "The metadata is ill-formed.";
+                this.xbayaGUI.getErrorWindow().error(warning, e);
+                return;
+            }
+        }
+
+        this.node.setConfigured(true);
+        this.node.setConfiguredName(name);
+        this.node.setDescription(description);
+        this.node.setDefaultValue(value);
+        this.node.setMetadata(metadata);
+        this.node.setVisibility(Boolean.parseBoolean(visibilityText));
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.descriptionTextArea = new XBayaTextArea();
+        XBayaLabel descriptionLabel = new XBayaLabel("Description", this.descriptionTextArea);
+
+        this.valueTextField = new XBayaTextField(); // for string
+        this.valueTextArea = new XBayaTextArea(); // for XML
+        // temporaly set text field.
+        this.valueLabel = new XBayaLabel("", this.valueTextField);
+
+        this.metadataTextArea = new XBayaTextArea();
+        XBayaLabel metadataLabel = new XBayaLabel("Metadata", this.metadataTextArea);
+
+        this.visibilityTextField = new XBayaTextField();
+        XBayaLabel visibilityLabel = new XBayaLabel("Visibility", this.visibilityTextField);
+
+        this.gridPanel = new GridPanel();
+        this.gridPanel.add(nameLabel);
+        this.gridPanel.add(this.nameTextField);
+        this.gridPanel.add(visibilityLabel);
+        this.gridPanel.add(this.visibilityTextField);
+        this.gridPanel.add(descriptionLabel);
+        this.gridPanel.add(this.descriptionTextArea);
+        this.gridPanel.add(this.valueLabel);
+        this.gridPanel.add(this.valueTextField);
+        this.gridPanel.add(metadataLabel);
+        this.gridPanel.add(this.metadataTextArea);
+        this.gridPanel.layout(5, 2, 3, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Input Parameter Configuration", this.gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/MemoConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/MemoConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/MemoConfigurationDialog.java
new file mode 100644
index 0000000..651492e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/MemoConfigurationDialog.java
@@ -0,0 +1,115 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.apache.airavata.workflow.model.graph.system.MemoNode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+
+public class MemoConfigurationDialog {
+
+    private XBayaEngine engine;
+
+    private MemoNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextArea memoTextArea;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public MemoConfigurationDialog(MemoNode node, XBayaEngine engine) {
+        this.engine = engine;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        this.memoTextArea.setText(this.node.getMemo());
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        String memo = this.memoTextArea.getText();
+        this.node.setMemo(memo);
+        hide();
+        this.engine.getGUI().getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.memoTextArea = new XBayaTextArea();
+        XBayaLabel memoLabel = new XBayaLabel("Memo", this.memoTextArea);
+
+        GridPanel gridPanel = new GridPanel();
+        gridPanel.add(memoLabel);
+        gridPanel.add(this.memoTextArea);
+        gridPanel.layout(1, 2, 0, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Memo", gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/OutputConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/OutputConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/OutputConfigurationDialog.java
new file mode 100644
index 0000000..a3c063e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/OutputConfigurationDialog.java
@@ -0,0 +1,172 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.apache.airavata.common.utils.WSConstants;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.xmlpull.infoset.XmlElement;
+
+public class OutputConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private OutputNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextArea descriptionTextArea;
+
+    private XBayaTextArea metadataTextArea;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public OutputConfigurationDialog(OutputNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+
+        String name = this.node.getConfiguredName();
+        if (name == null) {
+            name = this.node.getName();
+        }
+        this.nameTextField.setText(name);
+        this.descriptionTextArea.setText(this.node.getDescription());
+        XmlElement metadata = this.node.getMetadata();
+        String metadataText;
+        if (metadata == null) {
+            metadataText = WSConstants.EMPTY_APPINFO;
+        } else {
+            metadataText = XMLUtil.xmlElementToString(metadata);
+        }
+        this.metadataTextArea.setText(metadataText);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        String name = this.nameTextField.getText();
+        String description = this.descriptionTextArea.getText();
+        String metadataText = this.metadataTextArea.getText();
+
+        if (name.length() == 0) {
+            String warning = "The name cannot be empty.";
+            this.xbayaGUI.getErrorWindow().error(warning);
+            return;
+        }
+
+        XmlElement metadata;
+        if (metadataText.length() == 0) {
+            metadata = null;
+        } else {
+            try {
+                metadata = XMLUtil.stringToXmlElement(metadataText);
+            } catch (RuntimeException e) {
+                String warning = "The metadata is ill-formed.";
+                this.xbayaGUI.getErrorWindow().error(warning, e);
+                return;
+            }
+        }
+
+        this.node.setConfigured(true);
+        this.node.setConfiguredName(name);
+        this.node.setDescription(description);
+        this.node.setMetadata(metadata);
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.descriptionTextArea = new XBayaTextArea();
+        XBayaLabel descriptionLabel = new XBayaLabel("Description", this.descriptionTextArea);
+
+        this.metadataTextArea = new XBayaTextArea();
+        XBayaLabel metadataLabel = new XBayaLabel("Metadata", this.metadataTextArea);
+
+        GridPanel mainPanel = new GridPanel();
+        mainPanel.add(nameLabel);
+        mainPanel.add(this.nameTextField);
+        mainPanel.add(descriptionLabel);
+        mainPanel.add(this.descriptionTextArea);
+        mainPanel.add(metadataLabel);
+        mainPanel.add(this.metadataTextArea);
+        mainPanel.layout(3, 2, 2, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Input Parameter Configuration", mainPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ReceiveConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ReceiveConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ReceiveConfigurationDialog.java
new file mode 100644
index 0000000..66fc055
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/ReceiveConfigurationDialog.java
@@ -0,0 +1,161 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.system.ReceiveNode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class ReceiveConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private ReceiveNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextField idTextField;
+
+    private JSpinner numPorts;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public ReceiveConfigurationDialog(ReceiveNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    @SuppressWarnings("boxing")
+    public void show() {
+        String name = this.node.getName();
+        this.nameTextField.setText(name);
+        this.idTextField.setText(this.node.getID());
+        int number = this.node.getOutputPorts().size();
+        this.numPorts.setValue(number);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        Integer value = (Integer) this.numPorts.getValue();
+        int number = value.intValue();
+        int current = this.node.getOutputPorts().size();
+        try {
+            if (number > current) {
+                // Add ports
+                for (int i = 0; i < number - current; i++) {
+                    this.node.addOutputPort();
+                }
+            } else if (number < current) {
+                for (int i = 0; i < current - number; i++) {
+                    this.node.removeOutputPort();
+                }
+            } else {
+                // Do nothing.
+            }
+        } catch (GraphException e) {
+            this.xbayaGUI.getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        }
+
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        this.nameTextField.setEditable(false);
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.idTextField = new XBayaTextField();
+        this.idTextField.setEditable(false);
+        XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+        SpinnerNumberModel model = new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1);
+        this.numPorts = new JSpinner(model);
+        XBayaLabel numPortLabel = new XBayaLabel("Number of Parameters", this.numPorts);
+
+        GridPanel gridPanel = new GridPanel();
+        gridPanel.add(nameLabel);
+        gridPanel.add(this.nameTextField);
+        gridPanel.add(idLabel);
+        gridPanel.add(this.idTextField);
+        gridPanel.add(numPortLabel);
+        gridPanel.add(this.numPorts);
+        gridPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Receive Configuration", gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/S3FileChooser.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/S3FileChooser.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/S3FileChooser.java
new file mode 100644
index 0000000..2f23b0e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/S3FileChooser.java
@@ -0,0 +1,193 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.event.TreeSelectionEvent;
+import javax.swing.event.TreeSelectionListener;
+import javax.swing.tree.DefaultMutableTreeNode;
+
+import org.apache.airavata.workflow.model.graph.system.S3InputNode;
+import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.dialogs.amazon.BucketsLoader;
+import org.apache.airavata.xbaya.ui.dialogs.amazon.ChangeCredentialWindow;
+import org.apache.airavata.xbaya.ui.widgets.amazon.S3Tree;
+import org.jets3t.service.S3Service;
+import org.jets3t.service.S3ServiceException;
+import org.jets3t.service.impl.rest.httpclient.RestS3Service;
+import org.jets3t.service.security.AWSCredentials;
+
+public class S3FileChooser implements TreeSelectionListener {
+
+    private XBayaDialog dialog;
+    private XBayaGUI xbayaGUI;
+    protected S3InputNode inputNode;
+    private String chosenFile;
+
+    private S3Tree s3Tree;
+
+    /**
+     * 
+     * Constructs a S3FileChooser.
+     * 
+     * @param engine
+     * @param inputNode
+     */
+    public S3FileChooser(XBayaGUI xbayaGUI, S3InputNode inputNode) {
+        this.xbayaGUI=xbayaGUI;
+        this.inputNode = inputNode;
+        initGUI();
+    }
+
+    private void initGUI() {
+
+        /*
+         * ScrollPane for S3 Tree
+         */
+        // add tree listener to this
+        this.s3Tree = new S3Tree();
+        this.s3Tree.addTreeSelectionListener(this);
+
+        JScrollPane scrollPane = new JScrollPane(this.s3Tree);
+
+        /*
+         * Button Panel
+         */
+        JButton refreshButton = new JButton("Connect/Refresh");
+        refreshButton.addActionListener(new AbstractAction() {
+
+            private ChangeCredentialWindow credentialWindow;
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (AmazonCredential.getInstance().getAwsAccessKeyId().isEmpty()
+                        || AmazonCredential.getInstance().getAwsSecretAccessKey().isEmpty()) {
+                    S3FileChooser.this.xbayaGUI.getErrorWindow().warning(S3FileChooser.this.dialog.getDialog(), "Error",
+                            "Aws Access Key not set!");
+
+                    if (this.credentialWindow == null) {
+                        this.credentialWindow = new ChangeCredentialWindow(S3FileChooser.this.dialog.getDialog());
+                    }
+                    try {
+                        this.credentialWindow.show();
+                    } catch (Exception e1) {
+                        S3FileChooser.this.xbayaGUI.getErrorWindow().error(e1);
+                    }
+
+                    return;
+                }
+                S3FileChooser.this.s3Tree.clean();
+
+                try {
+
+                    // create S3Service
+                    S3Service s3Service = new RestS3Service(new AWSCredentials(AmazonCredential.getInstance()
+                            .getAwsAccessKeyId(), AmazonCredential.getInstance().getAwsSecretAccessKey()));
+
+                    BucketsLoader bucketsLoader = new BucketsLoader(S3FileChooser.this.xbayaGUI,
+                            S3FileChooser.this.dialog.getDialog());
+                    bucketsLoader.load(s3Service, S3FileChooser.this.s3Tree);
+
+                } catch (S3ServiceException s3ex) {
+                    S3FileChooser.this.xbayaGUI.getErrorWindow().error(s3ex);
+                }
+            }
+        });
+
+        JButton okButton = new JButton("Ok");
+        okButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (S3FileChooser.this.chosenFile != null) {
+                    S3FileChooser.this.inputNode.setDefaultValue(new String(S3FileChooser.this.chosenFile));
+                }
+                hide();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(refreshButton);
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Amazon S3 Input Chooser", scrollPane, buttonPanel);
+    }
+
+    /**
+	 * 
+	 */
+    public void hide() {
+        this.dialog.hide();
+    }
+
+    /**
+	 * 
+	 */
+    public void show() {
+        this.dialog.show();
+    }
+
+    /**
+     * 
+     * @see javax.swing.event.TreeSelectionListener#valueChanged(javax.swing.event.TreeSelectionEvent)
+     */
+    @Override
+    public void valueChanged(TreeSelectionEvent e) {
+        DefaultMutableTreeNode node = s3Tree.getSelectedNode();
+
+        if (node == null) {
+            this.chosenFile = null;
+            return;
+        }
+
+        Object nodeInfo = node.getUserObject();
+        String bucketName = "";
+        if (node.isLeaf()) {
+            DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode) node.getParent();
+            bucketName = (String) parentNode.getUserObject();
+            String keyName = (String) nodeInfo;
+            this.chosenFile = "s3n://" + bucketName + "/" + keyName;
+
+        } else {
+            bucketName = (String) nodeInfo;
+            this.chosenFile = "s3n://" + bucketName;
+        }
+
+    }
+}
\ No newline at end of file


[15/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
deleted file mode 100644
index 5de91e4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorEventListener.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import java.io.IOException;
-import java.net.URI;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.registry.api.workflow.NodeExecutionError;
-import org.apache.airavata.workflow.model.graph.EPRPort;
-import org.apache.airavata.workflow.model.graph.Edge;
-import org.apache.airavata.workflow.model.graph.Graph;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
-import org.apache.airavata.workflow.model.graph.Port;
-import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.system.OutputNode;
-import org.apache.airavata.workflow.model.graph.util.GraphUtil;
-import org.apache.airavata.workflow.model.graph.ws.WSGraph;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.ws.monitor.EventData;
-import org.apache.airavata.ws.monitor.MonitorException;
-import org.apache.airavata.ws.monitor.MonitorUtil;
-import org.apache.airavata.ws.monitor.MonitorUtil.EventType;
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.NotificationHandler;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.client.msgbox.MessagePuller;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.graph.controller.NodeController;
-import org.apache.airavata.xbaya.provenance.WorkflowNodeStatusUpdater;
-import org.apache.airavata.xbaya.provenance.WorkflowStatusUpdater;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
-
-public class WorkflowInterpretorEventListener implements NotificationHandler, ConsumerNotificationHandler {
-
-    private Workflow workflow;
-    private boolean pullMode;
-    private WseMsgBrokerClient wseClient;
-    private URI brokerURL;
-    private String topic;
-    private URI messageBoxURL;
-    private String subscriptionID;
-    private MessagePuller messagePuller;
-    private WorkflowStatusUpdater workflowStatusUpdater;
-    private WorkflowNodeStatusUpdater workflowNodeStatusUpdater;
-    private WorkflowInterpreterConfiguration workflowInterpreterConfiguration;
-    private String lastSubscriptionId;
-
-    private static Logger logger = LoggerFactory.getLogger(WorkflowInterpretorEventListener.class);
-
-    public WorkflowInterpretorEventListener(Workflow workflow, XBayaConfiguration configuration) {
-        this.workflow = workflow;
-        this.brokerURL = configuration.getBrokerURL();
-        this.topic = configuration.getTopic();
-        this.pullMode = true;
-        this.messageBoxURL = configuration.getMessageBoxURL();
-        this.wseClient = new WseMsgBrokerClient();
-        this.wseClient.init(this.brokerURL.toString());
-        this.workflowInterpreterConfiguration = WorkflowInterpreter.getWorkflowInterpreterConfiguration();
-        this.workflowNodeStatusUpdater = new WorkflowNodeStatusUpdater(this.workflowInterpreterConfiguration.getAiravataAPI());
-        this.workflowStatusUpdater = new WorkflowStatusUpdater(this.workflowInterpreterConfiguration.getAiravataAPI());
-    }
-
-    public void start() throws MonitorException {
-
-        subscribe();
-    }
-
-    public void stop() throws MonitorException {
-        unsubscribe();
-    }
-
-    private synchronized void subscribe() throws MonitorException {
-        if (this.subscriptionID != null) {
-            throw new IllegalStateException();
-        }
-        try {
-            if (this.pullMode) {
-                EndpointReference messageBoxEPR = this.wseClient.createPullMsgBox(this.messageBoxURL.toString(),20000L);
-                this.subscriptionID = this.wseClient.subscribe(messageBoxEPR.getAddress(), this.topic, null);
-                this.messagePuller = this.wseClient.startPullingEventsFromMsgBox(messageBoxEPR, this, 1000L, 20000L);
-            } else {
-                String[] endpoints = this.wseClient.startConsumerService(2222, this);
-                this.subscriptionID = this.wseClient.subscribe(endpoints[0], this.topic, null);
-            }
-        } catch (IOException e) {
-            throw new MonitorException("Failed to subscribe.", e);
-        } catch (RuntimeException e) {
-            throw new MonitorException("Failed to subscribe.", e);
-        }
-    }
-
-    /**
-     * Unsubscribes from the notification.
-     * 
-     * @throws MonitorException
-     */
-    private synchronized void unsubscribe() throws MonitorException {
-        // This method needs to be synchronized along with subscribe() because
-        // unsubscribe() might be called while subscribe() is being executed.
-        if (this.subscriptionID == null) {
-            throw new IllegalStateException();
-        }
-        try {
-            if (this.pullMode) {
-                this.messagePuller.stopPulling();
-                try {
-                    Thread.sleep(100);
-                } catch (InterruptedException e) {
-                    throw new MonitorException("Error during stop message puller", e);
-                }
-//            } else {
-//                this.wseClient.unSubscribe(this.subscriptionID);
-            }
-            this.wseClient.unSubscribe(this.subscriptionID);
-
-        } catch (MsgBrokerClientException e) {
-            throw new MonitorException("Failed to unsubscribe.", e);
-        }
-
-    }
-
-    /**
-     * @see org.apache.airavata.wsmg.client.NotificationHandler#handleNotification(java.lang.String)
-     */
-    public void handleNotification(String message) {
-        try {
-            // String soapBody = WorkFlowUtils.getSoapBodyContent(message);
-            XmlElement event = XMLUtil.stringToXmlElement(message);
-            handleEvent(new EventData(event), true, this.workflow.getGraph());
-
-            // } catch (XMLStreamException e) {
-            // // Just log them because they can be unrelated messages sent to
-            // // this topic by accident.
-            // logger.warn("Could not parse received notification: " + message,
-            // e);
-            // }
-        } catch (RuntimeException e) {
-            logger.warn("Failed to process notification: " + message, e);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error occured during Exception saving to the Registry");
-        }
-    }
-
-    private void handleEvent(EventData event, boolean forward, Graph graph) throws AiravataAPIInvocationException {
-        EventType type = event.getType();
-        String nodeID = event.getNodeID();
-        Node node = graph.getNode(nodeID);
-
-        if (type == MonitorUtil.EventType.WORKFLOW_INVOKED) {
-            workflowStarted(graph, forward);
-            //todo ideally experimentID and workflowInstanceID has to be different
-            workflowStatusUpdater.saveWorkflowData(event.getExperimentID(), event.getExperimentID(),
-                    this.workflowInterpreterConfiguration.getWorkflow().getName());
-            workflowStatusUpdater.workflowStarted(event.getExperimentID());
-        } else if (type == MonitorUtil.EventType.WORKFLOW_TERMINATED) {
-            workflowFinished(graph, forward);
-            workflowStatusUpdater.workflowFinished(event.getExperimentID());
-            try {
-                this.unsubscribe();
-            } catch (MonitorException e) {
-                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-            }
-        } else if (type == EventType.INVOKING_SERVICE || type == EventType.SERVICE_INVOKED) {
-            if (node == null) {
-                if (nodeID!=null && !nodeID.equals("")) {
-					logger.warn("There is no node that has ID, " + nodeID);
-				}
-            } else {
-                nodeStarted(node, forward);
-                workflowNodeStatusUpdater.workflowNodeStarted(event.getExperimentID(), event.getNodeID()
-                        , event.getMessage(), event.getWorkflowID().toASCIIString());
-            }
-        } else if (type == MonitorUtil.EventType.RECEIVED_RESULT
-        // TODO this should be removed when GPEL sends all notification
-        // correctly.
-                || type == EventType.SENDING_RESULT) {
-            if (node == null) {
-            	if (nodeID!=null && !nodeID.equals("")) {
-					logger.warn("There is no node that has ID, " + nodeID);
-				}
-        	} else {
-                nodeFinished(node, forward);
-                workflowNodeStatusUpdater.workflowNodeFinished(event.getExperimentID(), event.getNodeID(), event.getMessage(),
-                        event.getWorkflowID().toASCIIString());
-            }
-        } else if (type == EventType.RECEIVED_FAULT
-                || type == EventType.SENDING_FAULT || type == EventType.SENDING_RESPONSE_FAILED) {
-            //Constructing NodeExecutionError with required data...
-            logger.error(event.getMessage());
-            NodeExecutionError nodeExecutionError = new NodeExecutionError();
-            nodeExecutionError.setExperimentId(event.getExperimentID());
-            nodeExecutionError.setNodeId(event.getNodeID());
-            nodeExecutionError.setWorkflowInstanceId(event.getExperimentID());
-            nodeExecutionError.setErrorMessage(event.getMessage());
-            nodeExecutionError.setErrorDescription(event.getMessage());
-            nodeExecutionError.setErrorTime(event.getTimestamp());
-            this.workflowInterpreterConfiguration.getAiravataAPI().getExecutionManager().addNodeExecutionError(nodeExecutionError);
-            if (node == null) {
-            	if (nodeID!=null && !nodeID.equals("")) {
-					logger.warn("There is no node that has ID, " + nodeID);
-				}
-            } else {
-                nodeFailed(node, forward);
-                workflowNodeStatusUpdater.workflowNodeFailed(event.getExperimentID(), event.getNodeID());
-            }
-            try {
-                this.unsubscribe();
-            } catch (MonitorException e) {
-                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-            }
-        } else if (type == MonitorUtil.EventType.RESOURCE_MAPPING) {
-            if (node == null) {
-            	if (nodeID!=null && !nodeID.equals("")) {
-					logger.warn("There is no node that has ID, " + nodeID);
-				}
-            } else {
-                // nodeResourceMapped(node, event.getEvent(), forward);
-                workflowNodeStatusUpdater.workflowNodeRunning(event.getExperimentID(), event.getNodeID());
-            }
-        } else if(type == MonitorUtil.EventType.LOG_INFO){
-            // This is not very gram specific, if these data is required in other provider they have to send
-            // the notification in info mode with ending these text, DONE,PENDING and ACTIVE
-            if(event.getMessage().endsWith("DONE")) {
-                workflowNodeStatusUpdater.workflowNodeStatusDone(event.getExperimentID(), event.getNodeID());
-            } else if(event.getMessage().endsWith("PENDING")){
-                workflowNodeStatusUpdater.workflowNodeStatusPending(event.getExperimentID(), event.getNodeID());
-            } else if(event.getMessage().endsWith("ACTIVE")){
-                workflowNodeStatusUpdater.workflowNodeStatusActive(event.getExperimentID(), event.getNodeID());
-            }
-        } else {
-            // Ignore the rest.
-        }
-    }
-
-    private void workflowStarted(Graph graph, boolean forward) {
-        for (InputNode node : GraphUtil.getInputNodes(graph)) {
-            if (forward) {
-                finishNode(node);
-            } else {
-                resetNode(node);
-            }
-        }
-    }
-
-    private void workflowFinished(Graph graph, boolean forward) {
-        for (OutputNode node : GraphUtil.getOutputNodes(graph)) {
-            if (forward) {
-                finishNode(node);
-                finishPredecessorNodes(node);
-            } else {
-                resetNode(node);
-            }
-        }
-    }
-
-    private LinkedList<InputNode> getInputNodes(WSGraph graph) {
-        List<NodeImpl> nodes = graph.getNodes();
-        LinkedList<InputNode> inputNodes = new LinkedList<InputNode>();
-        for (NodeImpl nodeImpl : nodes) {
-            if (nodeImpl instanceof InputNode) {
-                inputNodes.add((InputNode) nodeImpl);
-            }
-        }
-        return inputNodes;
-    }
-
-    private LinkedList<OutputNode> getOutputNodes(WSGraph graph) {
-        List<NodeImpl> nodes = graph.getNodes();
-        LinkedList<OutputNode> outputNodes = new LinkedList<OutputNode>();
-        for (NodeImpl nodeImpl : nodes) {
-            if (nodeImpl instanceof OutputNode) {
-                outputNodes.add((OutputNode) nodeImpl);
-            }
-        }
-        return outputNodes;
-    }
-
-    private void nodeStarted(Node node, boolean forward) {
-        if (forward) {
-            executeNode(node);
-            finishPredecessorNodes(node);
-        } else {
-            resetNode(node);
-        }
-    }
-
-    private void nodeFinished(Node node, boolean forward) {
-        if (forward) {
-            finishNode(node);
-            finishPredecessorNodes(node);
-        } else {
-            executeNode(node);
-        }
-    }
-
-    private void nodeFailed(Node node, boolean forward) {
-        if (forward) {
-            failNode(node);
-            finishPredecessorNodes(node);
-        } else {
-            executeNode(node);
-        }
-    }
-
-    private void executeNode(Node node) {
-        node.setState(NodeExecutionState.EXECUTING);
-    }
-
-    private void finishNode(Node node) {
-        node.setState(NodeExecutionState.FINISHED);
-    }
-
-    private void failNode(Node node) {
-        node.setState(NodeExecutionState.FAILED);
-    }
-
-    private void resetNode(Node node) {
-        node.setState(NodeExecutionState.WAITING);
-        NodeController.getGUI(node).resetTokens();
-    }
-
-    /**
-     * Make preceding nodes done. This helps the monitoring GUI when a user subscribes from the middle of the workflow
-     * execution.
-     * 
-     * @param node
-     */
-    private void finishPredecessorNodes(Node node) {
-        for (Port inputPort : node.getInputPorts()) {
-            for (Edge edge : inputPort.getEdges()) {
-                Port fromPort = edge.getFromPort();
-                if (!(fromPort instanceof EPRPort)) {
-                    Node fromNode = fromPort.getNode();
-                    finishNode(fromNode);
-                    finishPredecessorNodes(fromNode);
-                }
-            }
-        }
-        Port controlInPort = node.getControlInPort();
-        if (controlInPort != null) {
-            for (Node fromNode : controlInPort.getFromNodes()) {
-                finishNode(fromNode);
-                finishPredecessorNodes(fromNode);
-            }
-        }
-    }
-
-    /**
-     * @see org.apache.airavata.wsmg.client.NotificationHandler#handleNotification(java.lang.String)
-     */
-    public void handleNotification(SOAPEnvelope message) {
-        String soapBody = message.getBody().toString();
-        this.handleNotification(soapBody);
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorMessageReceiverInOut.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorMessageReceiverInOut.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorMessageReceiverInOut.java
deleted file mode 100644
index b5623e9..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorMessageReceiverInOut.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.xbaya.interpretor;
-
-import org.apache.airavata.client.stub.interpretor.NameValue;
-import org.apache.airavata.client.stub.interpretor.WorkflowInterpretorStub;
-
-
-public class WorkflowInterpretorMessageReceiverInOut extends org.apache.axis2.receivers.AbstractInOutMessageReceiver{
-    public static final String MYPROXY_USER = "myproxy.user";
-    public static final String MYPROXY_PASS = "myproxy.password";
-     public void invokeBusinessLogic(org.apache.axis2.context.MessageContext msgContext, org.apache.axis2.context.MessageContext newMsgContext)
-        throws org.apache.axis2.AxisFault{
-
-        try {
-
-        // get the implementation class for the Web Service
-        Object obj = getTheImplementationObject(msgContext);
-
-        WorkflowInterpretorSkeleton skel = (WorkflowInterpretorSkeleton)obj;
-        //Out Envelop
-        org.apache.axiom.soap.SOAPEnvelope envelope = null;
-        //Find the axisOperation that has been set by the Dispatch phase.
-        org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation();
-        if (op == null) {
-        throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
-        }
-
-        java.lang.String methodName;
-        if((op.getName() != null) && ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJava(op.getName().getLocalPart())) != null)){
-
-
-
-            if("launchWorkflow".equals(methodName)){
-
-	                        WorkflowInterpretorStub.LaunchWorkflow wrappedParam =
-                                                             (WorkflowInterpretorStub.LaunchWorkflow)fromOM(
-                                    msgContext.getEnvelope().getBody().getFirstElement(),
-                                    WorkflowInterpretorStub.LaunchWorkflow.class,
-                                    getEnvelopeNamespaces(msgContext.getEnvelope()));
-
-
-                WorkflowInterpretorStub.LaunchWorkflowResponse launchWorkflowResponse = wrapLaunchWorkflowResponse_return(
-
-
-                        skel.launchWorkflow(
-
-                                getWorkflowAsString(wrappedParam)
-                                ,
-                                getTopic(wrappedParam)
-                                ,
-                                getInputs(wrappedParam)
-                        )
-
-                );
-
-                envelope = toEnvelope(getSOAPFactory(msgContext), launchWorkflowResponse, false);
-
-            } else {
-              throw new java.lang.RuntimeException("method not found");
-            }
-
-
-        newMsgContext.setEnvelope(envelope);
-        }
-        }
-        catch (java.lang.Exception e) {
-        throw org.apache.axis2.AxisFault.makeFault(e);
-        }
-        }
-
-        //
-            private  org.apache.axiom.om.OMElement  toOM(WorkflowInterpretorStub.LaunchWorkflow param, boolean optimizeContent)
-            throws org.apache.axis2.AxisFault {
-
-
-                        try{
-                             return param.getOMElement(WorkflowInterpretorStub.LaunchWorkflow.MY_QNAME,
-                                          org.apache.axiom.om.OMAbstractFactory.getOMFactory());
-                        } catch(org.apache.axis2.databinding.ADBException e){
-                            throw org.apache.axis2.AxisFault.makeFault(e);
-                        }
-
-
-            }
-
-            private  org.apache.axiom.om.OMElement  toOM(WorkflowInterpretorStub.LaunchWorkflowResponse param, boolean optimizeContent)
-            throws org.apache.axis2.AxisFault {
-
-
-                        try{
-                             return param.getOMElement(WorkflowInterpretorStub.LaunchWorkflowResponse.MY_QNAME,
-                                          org.apache.axiom.om.OMAbstractFactory.getOMFactory());
-                        } catch(org.apache.axis2.databinding.ADBException e){
-                            throw org.apache.axis2.AxisFault.makeFault(e);
-                        }
-
-
-            }
-
-                    private  org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, WorkflowInterpretorStub.LaunchWorkflowResponse param, boolean optimizeContent)
-                        throws org.apache.axis2.AxisFault{
-                      try{
-                          org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope();
-
-                                    emptyEnvelope.getBody().addChild(param.getOMElement(WorkflowInterpretorStub.LaunchWorkflowResponse.MY_QNAME,factory));
-
-
-                         return emptyEnvelope;
-                    } catch(org.apache.axis2.databinding.ADBException e){
-                        throw org.apache.axis2.AxisFault.makeFault(e);
-                    }
-                    }
-
-
-                        private java.lang.String getWorkflowAsString(
-                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
-
-                                return wrappedType.getWorkflowAsString();
-
-                        }
-
-
-                        private java.lang.String getTopic(
-                       WorkflowInterpretorStub.LaunchWorkflow wrappedType){
-
-                                return wrappedType.getTopic();
-
-                        }
-
-
-                        private java.lang.String getPassword(
-                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
-
-                                return wrappedType.getPassword();
-
-                        }
-
-
-                        private java.lang.String getUsername(
-                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
-
-                                return wrappedType.getUsername();
-
-                        }
-
-
-                        private NameValue[] getInputs(
-                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
-
-                                return wrappedType.getInputs();
-
-                        }
-
-
-                        private NameValue[] getConfigurations(
-                        WorkflowInterpretorStub.LaunchWorkflow wrappedType){
-
-                                return wrappedType.getConfigurations();
-
-                        }
-
-
-
-                        private WorkflowInterpretorStub.LaunchWorkflowResponse wrapLaunchWorkflowResponse_return(
-                        java.lang.String param){
-                            WorkflowInterpretorStub.LaunchWorkflowResponse wrappedElement = new WorkflowInterpretorStub.LaunchWorkflowResponse();
-
-                            wrappedElement.set_return(param);
-
-                            return wrappedElement;
-                        }
-
-                         private WorkflowInterpretorStub.LaunchWorkflowResponse wraplaunchWorkflow(){
-                                WorkflowInterpretorStub.LaunchWorkflowResponse wrappedElement = new WorkflowInterpretorStub.LaunchWorkflowResponse();
-                                return wrappedElement;
-                         }
-
-
-
-        /**
-        *  get the default envelope
-        */
-        private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){
-        return factory.getDefaultEnvelope();
-        }
-
-
-        private  java.lang.Object fromOM(
-        org.apache.axiom.om.OMElement param,
-        java.lang.Class type,
-        java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{
-
-        try {
-
-                if (WorkflowInterpretorStub.LaunchWorkflow.class.equals(type)){
-
-                           return WorkflowInterpretorStub.LaunchWorkflow.Factory.parse(param.getXMLStreamReaderWithoutCaching());
-
-
-                }
-
-                if (WorkflowInterpretorStub.LaunchWorkflowResponse.class.equals(type)){
-
-                           return WorkflowInterpretorStub.LaunchWorkflowResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching());
-
-
-                }
-
-        } catch (java.lang.Exception e) {
-        throw org.apache.axis2.AxisFault.makeFault(e);
-        }
-           return null;
-        }
-
-
-
-
-
-        /**
-        *  A utility method that copies the namepaces from the SOAPEnvelope
-        */
-        private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){
-        java.util.Map returnMap = new java.util.HashMap();
-        java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces();
-        while (namespaceIterator.hasNext()) {
-        org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next();
-        returnMap.put(ns.getPrefix(),ns.getNamespaceURI());
-        }
-        return returnMap;
-        }
-
-        private org.apache.axis2.AxisFault createAxisFault(java.lang.Exception e) {
-        org.apache.axis2.AxisFault f;
-        Throwable cause = e.getCause();
-        if (cause != null) {
-            f = new org.apache.axis2.AxisFault(e.getMessage(), cause);
-        } else {
-            f = new org.apache.axis2.AxisFault(e.getMessage());
-        }
-
-        return f;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
deleted file mode 100644
index 5f9420c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpretorSkeleton.java
+++ /dev/null
@@ -1,572 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException;
-import org.apache.airavata.client.stub.interpretor.NameValue;
-import org.apache.airavata.client.tools.PeriodicExecutorThread;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.common.utils.ServiceUtils;
-import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.schemas.gfac.GlobusHostType;
-import org.apache.airavata.schemas.gfac.GsisshHostType;
-import org.apache.airavata.schemas.gfac.SSHHostType;
-import org.apache.airavata.schemas.wec.ContextHeaderDocument;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.ode.ODEClient;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
-import org.apache.airavata.ws.monitor.MonitorException;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.concurrent.PredicatedTaskRunner;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.engine.ServiceLifeCycle;
-import org.apache.xmlbeans.XmlException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.*;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-/**
- * WorkflowInterpretorSkeleton java skeleton for the axisService
- */
-public class WorkflowInterpretorSkeleton implements ServiceLifeCycle {
-    private static final Logger log = LoggerFactory.getLogger(WorkflowInterpretorSkeleton.class);
-
-//	public static final String PROXYSERVER = "myproxy.url";
-	public static final String MSGBOX = "msgbox";
-	public static final String GFAC = "gfac";
-	public static final String BROKER = "broker";
-    public static final String MYPROXY_USER = "myproxy.user";
-    public static final String MYPROXY_PASS = "myproxy.pass";
-    public static final String MYPROXY_SERVER = "myproxy.server";
-    public static final String MYPROXY_LIFETIME = "myproxy.life";
-    public static final String TRUSTED_CERT_LOCATION = "trusted.cert.location";
-
-    public static boolean provenance = false;
-    public static final String PROVENANCE = "provenance";
-    public static  String systemUserName = "";
-    public static  String systemUserPW = "";
-    public static boolean runInThread = false;
-    public static final String RUN_IN_THREAD = "runInThread";
-    public static  Boolean gfacEmbeddedMode = true;
-    private static PredicatedTaskRunner runner = null;
-//    public static  JCRComponentRegistry jcrComponentRegistry = null;
-    private static AiravataAPI airavataAPI=null;
-    public static int provenanceWriterThreadPoolSize = 1;
-    public static final String PROVENANCE_WRITER_THREAD_POOL_SIZE = "provenanceWriterThreadPoolSize";
-    public static final int JCR_AVAIALABILITY_WAIT_INTERVAL = 1000 * 10;
-    public static final String GFAC_EMBEDDED = "gfac.embedded";
-    public static  ConfigurationContext configurationContext;
-    public static final String SERVICE_NAME="WorkflowInterpretor";
-    public static boolean notInterrupted = true;
-    public Map<String, WorkflowInterpreterConfiguration> workflowConfigurations=new HashMap<String, WorkflowInterpreterConfiguration>();
-    private WorkflowInterpreterInteractor interactor;
-    private String gateway;
-
-	protected static final String SERVICE_URL = "interpreter_service_url";
-
-	protected static final String JCR_REG = "jcr_registry";
-
-	protected WIServiceThread thread;
-
-    private AiravataAPI getAiravataAPI(){
-        if (airavataAPI==null) {
-			try {
-				systemUserName = ServerSettings.getSystemUser();
-				systemUserPW = ServerSettings.getSystemUserPassword();
-				gateway = ServerSettings.getSystemUserGateway();
-				airavataAPI = AiravataAPIFactory.getAPI(gateway, systemUserName);
-			} catch (ApplicationSettingsException e) {
-				log.error("Unable to read the properties file", e);
-			} catch (AiravataAPIInvocationException e) {
-				log.error("Unable to create Airavata API", e);
-			}
-		}
-		return airavataAPI;
-    }
-
-    private WorkflowInterpreterInteractor getInteractor(){
-    	if (interactor==null){
-        	interactor=new SSWorkflowInterpreterInteractorImpl();
-    	}
-    	return interactor;
-    }
-
-    public void startUp(final ConfigurationContext configctx, AxisService service) {
-    	AiravataUtils.setExecutionAsServer();
-    	new Thread(){
-			@Override
-    		public void run() {
-    			try {
-					Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
-				} catch (InterruptedException e1) {
-					e1.printStackTrace();
-				}
-		        try {
-                    // Airavata deployer have to configure these properties,but if user send them alone the incoming message
-                    // We are overwriting those values only for that particular request
-		            configctx.setProperty(MYPROXY_PASS, ServerSettings.getSetting(MYPROXY_PASS));
-		            configctx.setProperty(MYPROXY_USER, ServerSettings.getSetting(MYPROXY_USER));
-		            configctx.setProperty(MYPROXY_LIFETIME,ServerSettings.getSetting(MYPROXY_LIFETIME));
-                    configctx.setProperty(TRUSTED_CERT_LOCATION,ServerSettings.getSetting(TRUSTED_CERT_LOCATION));
-                    configctx.setProperty(MYPROXY_SERVER,ServerSettings.getSetting(MYPROXY_SERVER));
-		            provenanceWriterThreadPoolSize = Integer.parseInt((String) ServerSettings.getSetting(PROVENANCE_WRITER_THREAD_POOL_SIZE));
-		            if("true".equals(ServerSettings.getSetting(PROVENANCE))){
-		                provenance = true;
-		                runner = new PredicatedTaskRunner(provenanceWriterThreadPoolSize);
-		                try {
-                            List<HostDescription> hostList = getDefinedHostDescriptions();
-                            for(HostDescription host:hostList){
-                                // This will avoid the changes user is doing to one of the predefined Hosts during a restart of the system
-                                AiravataAPI registry = getAiravataAPI();
-								if(!registry.getApplicationManager().isHostDescriptorExists(host.getType().getHostName())){
-                                    log.debug("Saving the predefined Host: " + host.getType().getHostName());
-                                    registry.getApplicationManager().addHostDescription(host);
-                                }
-                            }
-		                } catch (DescriptorAlreadyExistsException e) {
-                            e.printStackTrace();
-                        } catch (AiravataAPIInvocationException e) {
-		                    e.printStackTrace();
-
-                        }
-                    }else{
-		                provenance = false;
-		            }
-		            if("true".equals(ServerSettings.getSetting(RUN_IN_THREAD))){
-		                runInThread = true;
-		            }else{
-		                runInThread = false;
-		            }
-
-                     if("true".equals(ServerSettings.getSetting(GFAC_EMBEDDED))){
-		                gfacEmbeddedMode = true;
-		            }else{
-		                gfacEmbeddedMode = false;
-		            }
-
-                     //save the interpreter service url in context
-                    String localAddress = ServiceUtils.generateServiceURLFromConfigurationContext(configctx,SERVICE_NAME);
- 					configctx.setProperty(SERVICE_URL,new URI(localAddress));
- 					configctx.setProperty(JCR_REG,getAiravataAPI());
- 					/*
-					 * Heart beat message to registry
-					 */
-					thread = new WIServiceThread(getAiravataAPI(), configctx);
-					thread.start();
-                } catch (IOException e) {
-                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                } catch (URISyntaxException e) {
-                    e.printStackTrace();
-                } catch (ApplicationSettingsException e) {
-                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                }
-                WorkflowInterpretorSkeleton.configurationContext = configctx;
-    		}
-    	}.start();
-
-    }
-
-    public void suspendWorkflow(String experimentId)throws Exception{
-    	if (workflowConfigurations.containsKey(experimentId)){
-    		if (getInteractor().isExecutionPaused(workflowConfigurations.get(experimentId))){
-    			throw new Exception("Experiment '"+experimentId+"' is already paused!!!");
-    		}else{
-    			log.info("Suspending workflow execution "+experimentId+"...");
-    			getInteractor().pauseExecution(workflowConfigurations.get(experimentId));
-    		}
-    	}else{
-    		throw new Exception("Invalid Experiment id: Experiment "+experimentId+" not running");
-    	}
-    }
-
-    public void resumeWorkflow(String experimentId)throws Exception{
-    	if (workflowConfigurations.containsKey(experimentId)){
-    		if (getInteractor().isExecutionPaused(workflowConfigurations.get(experimentId)) || workflowConfigurations.get(experimentId).getWorkflow().getExecutionState()==WorkflowExecutionState.STOPPED){
-    			log.info("Resuming workflow execution "+experimentId+"...");
-    			getInteractor().resumeExecution(workflowConfigurations.get(experimentId));
-
-    		}else{
-    			throw new Exception("Experiment '"+experimentId+"' is not suspended!!!");
-    		}
-    	}else{
-    		//TODO chk to see if the experiment is present in registry if so reload it and resume execution else error
-    		throw new Exception("Invalid Experiment id: Experiment "+experimentId+" not running");
-    	}
-    }
-
-    public void haltWorkflow(String experimentId)throws Exception{
-    	if (workflowConfigurations.containsKey(experimentId)){
-			log.info("Terminating workflow execution "+experimentId+"...");
-			getInteractor().terminateExecution(workflowConfigurations.get(experimentId));
-    	}else{
-    		throw new Exception("Invalid Experiment id: Experiment "+experimentId+" not running");
-    	}
-    }
-
-    /**
-     * @param workflowAsString
-     * @param topic
-     * @param inputs
-     * @return
-     * @throws XMLStreamException
-     */
-	public java.lang.String launchWorkflow(java.lang.String workflowAsString, java.lang.String topic, NameValue[] inputs) throws XMLStreamException {
-        OMElement workflowContext = getWorkflowContextHeader();
-        if(workflowContext == null){
-            workflowContext = AXIOMUtil.stringToOM("<wor:context-header xmlns:wor=\"http://airavata.apache.org/schemas/wec/2012/05\">\n" +
-                "    <wor:soa-service-eprs>\n" +
-                "        <wor:gfac-url></wor:gfac-url>\n" +
-                "        <wor:registry-url></wor:registry-url>\n" +
-                "    </wor:soa-service-eprs>\n" +
-                "    <wor:workflow-monitoring-context>\n" +
-                "        <wor:experiment-id></wor:experiment-id>\n" +
-                "        <wor:workflow-instance-id xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:nil=\"true\" />\n" +
-                "        <wor:event-publish-epr></wor:event-publish-epr>\n" +
-                "        <wor:msg-box-epr></wor:msg-box-epr>\n" +
-                "    </wor:workflow-monitoring-context>\n" +
-                "    <wor:workflow-scheduling-context />\n" +
-                "    <wor:security-context />\n" +
-                "</wor:context-header>");
-        }
-        Map<String, String> configuration = new HashMap<String, String>();
-        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = parseContextHeader(workflowContext, configuration);
-        String user = workflowContextHeaderBuilder.getSubmissionUser();
-
-        String s = null;
-        try {
-             s = setupAndLaunch(workflowAsString, topic, ServerSettings.getSystemUserGateway(),
-                    user,inputs, configuration, runInThread, workflowContextHeaderBuilder);
-        } catch (AiravataAPIInvocationException e) {
-            log.error(e.getMessage());
-        } catch (ApplicationSettingsException e) {
-            log.error(e.getMessage());
-        }
-        return s;
-    }
-
-    private OMElement getWorkflowContextHeader() {
-        MessageContext currentMessageContext = MessageContext.getCurrentMessageContext();
-        SOAPHeader header = currentMessageContext.getEnvelope().getHeader();
-        Iterator<?> childrenWithName = header.getChildrenWithName(new QName("http://airavata.apache.org/schemas/wec/2012/05", "context-header"));
-        if (childrenWithName.hasNext()) {
-            return (OMElement) childrenWithName.next();
-        } else {
-            return null;
-        }
-    }
-
-    private WorkflowContextHeaderBuilder parseContextHeader(OMElement workflowContext, Map<String, String> configuration) throws XMLStreamException {
-        ContextHeaderDocument parse = null;
-        try {
-            parse = ContextHeaderDocument.Factory.parse(workflowContext.toStringWithConsume());
-            String msgBox = parse.getContextHeader().getWorkflowMonitoringContext().getMsgBoxEpr();
-            if(msgBox == null || "".equals(msgBox)){
-                msgBox = getAiravataAPI().getAiravataManager().getMessageBoxServiceURL().toASCIIString();
-            }
-            String msgBroker = parse.getContextHeader().getWorkflowMonitoringContext().getEventPublishEpr();
-            if(msgBroker == null || "".equals(msgBroker)){
-                msgBroker = getAiravataAPI().getAiravataManager().getEventingServiceURL().toASCIIString();
-            }
-            String gfac =  parse.getContextHeader().getSoaServiceEprs().getGfacUrl();
-//            if(gfac == null || "".equals(gfac)){
-//                gfac = getAiravataAPI().getAiravataManager().getGFaCURLs().get(0).toString();
-//            }
-            configuration.put(BROKER, msgBroker);
-            configuration.put(GFAC, gfac);
-            configuration.put(MSGBOX, msgBox);
-        } catch (XmlException e) {
-            log.error(e.getMessage());
-        } catch (AiravataAPIInvocationException e) {
-            log.error(e.getMessage());
-        }
-    	String submissionUser = workflowContext.getAttributeValue(new QName(workflowContext.getNamespace().getNamespaceURI(), "submissionUser"));
-        WorkflowContextHeaderBuilder workflowContextHeaderBuilder = new WorkflowContextHeaderBuilder(parse.getContextHeader());
-        workflowContextHeaderBuilder.setSubmissionUser(submissionUser);
-		return workflowContextHeaderBuilder;
-    }
-
-    public String setupAndLaunch(String workflowAsString, String experimentId, String gatewayId, String username,
-            Map<String,String> inputs,boolean inNewThread,WorkflowContextHeaderBuilder builder) throws AiravataAPIInvocationException{
-    	List<NameValue> inputData=new ArrayList<NameValue>();
-    	for (String inputName : inputs.keySet()) {
-			NameValue input = new NameValue();
-			input.setName(inputName);
-			input.setValue(inputs.get(inputName));
-			inputData.add(input);
-		}
-    	Map<String, String> configuration = new HashMap<String, String>();
-    	configuration.put(BROKER, getAiravataAPI().getAiravataManager().getEventingServiceURL().toASCIIString());
-        configuration.put(MSGBOX, getAiravataAPI().getAiravataManager().getMessageBoxServiceURL().toASCIIString());
-
-    	return setupAndLaunch(workflowAsString, experimentId, gatewayId, username, inputData.toArray(new NameValue[]{}), configuration, inNewThread, builder);
-    }
-
-    private String setupAndLaunch(String workflowAsString, String topic, String gatewayId, String username,
-                                  NameValue[] inputs,Map<String,String>configurations,boolean inNewThread,
-                                  WorkflowContextHeaderBuilder builder) throws AiravataAPIInvocationException{
-        log.debug("Launch is called for topic:"+topic);
-
-        Workflow workflow = null;
-        try {
-            workflow = new Workflow(workflowAsString);
-            log.debug("Workflow Object created");
-        } catch (GraphException e1) {
-            e1.printStackTrace();
-        } catch (ComponentException e1) {
-            e1.printStackTrace();
-        }
-        log.debug("Setting Input values");
-        List<InputNode> inputNodes = new ODEClient().getInputNodes(workflow);
-        for (InputNode inputNode : inputNodes) {
-            for (NameValue input : inputs) {
-                if (inputNode.getID().equals(input.getName())) {
-                    inputNode.setDefaultValue(input.getValue());
-                    break;
-                }
-            }
-            if (inputNode.getDefaultValue() == null) {
-                throw new WorkflowRuntimeException("Could not find a input value for component with name :" + inputNode.getName());
-            }
-
-        }
-        log.debug("Input all set");
-
-        XBayaConfiguration conf = null;
-        try {
-            conf = getConfiguration(configurations);
-            conf.setTopic(topic);
-            conf.setRunWithCrossProduct(true);
-        } catch (URISyntaxException e1) {
-            throw new WorkflowRuntimeException(e1);
-        }
-        WorkflowInterpretorEventListener listener = null;
-        WorkflowInterpreter interpreter = null;
-        AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(gatewayId, username);
-        WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, topic, conf.getMessageBoxURL(), conf.getBrokerURL(), airavataAPI, conf, null, null);
-        workflowInterpreterConfiguration.setGfacEmbeddedMode(gfacEmbeddedMode);
-        workflowInterpreterConfiguration.setActOnProvenance(provenance);
-
-        if (builder.getSecurityContext().getAmazonWebservices() != null) {
-            workflowInterpreterConfiguration.setAwsSecretKey(builder.getSecurityContext().getAmazonWebservices().getSecretAccessKey());
-            workflowInterpreterConfiguration.setAwsAccessKey(builder.getSecurityContext().getAmazonWebservices().getAccessKeyId());
-        }
-        // WorkflowInterpreter object should create prior creation of Listener, because listener needs the threadlocal variable
-        interpreter = new WorkflowInterpreter(workflowInterpreterConfiguration, getInteractor());
-        listener = new WorkflowInterpretorEventListener(workflow, conf);
-        try {
-            log.debug("start listener set");
-            listener.start();
-        } catch (MonitorException e1) {
-            e1.printStackTrace();
-        }
-
-        WorkflowContextHeaderBuilder.setCurrentContextHeader(builder.getContextHeader());
-
-        final WorkflowInterpretorEventListener finalListener = listener;
-        conf.setAiravataAPI(getAiravataAPI());
-
-        final WorkflowInterpreter finalInterpreter = interpreter;
-//        interpreter.setActOnProvenance(provenance);
-        interpreter.setProvenanceWriter(runner);
-        final String experimentId = topic;
-        log.debug("Created the interpreter");
-        if(inNewThread){
-            runInThread(finalInterpreter,finalListener,experimentId,builder);
-        }else{
-            executeWorkflow(finalInterpreter, finalListener, experimentId);
-        }
-        log.info("Experiment launched :" + topic);
-        return topic;
-    }
-
-    private void runInThread(final WorkflowInterpreter interpreter,final WorkflowInterpretorEventListener listener,final String experimentId,final WorkflowContextHeaderBuilder builder) {
-        new Thread(new Runnable() {
-
-            public void run() {
-                WorkflowContextHeaderBuilder.setCurrentContextHeader(builder.getContextHeader());
-                executeWorkflow(interpreter, listener, experimentId);
-            }
-        }).start();
-    }
-
-    private void executeWorkflow(WorkflowInterpreter interpreter, WorkflowInterpretorEventListener listener,String experimentId) {
-        try {
-        	workflowConfigurations.put(experimentId,interpreter.getConfig());
-            interpreter.scheduleDynamically();
-            log.debug("Interpreter invoked...");
-        } catch (Exception e) {
-            throw new WorkflowRuntimeException(e);
-        } finally {
-        	if (workflowConfigurations.containsKey(experimentId)){
-        		workflowConfigurations.remove(experimentId);
-        	}
-            /*
-             * stop listener no matter what happens
-             */
-//            try {
-//                if(listener != null)
-//                listener.stop();
-//            } catch (MonitorException e) {
-//                e.printStackTrace();
-//            }
-        }
-    }
-
-    public  XBayaConfiguration getConfiguration(Map<String,String> vals) throws URISyntaxException {
-		XBayaConfiguration configuration = new XBayaConfiguration();
-		configuration.setBrokerURL(new URI(findValue(vals, BROKER, XBayaConstants.DEFAULT_BROKER_URL.toString())));
-		configuration.setGFacURL(new URI(findValue(vals, GFAC, XBayaConstants.DEFAULT_GFAC_URL.toString())));
-		configuration.setMessageBoxURL(new URI(findValue(vals, MSGBOX, XBayaConstants.DEFAULT_MESSAGE_BOX_URL.toString())));
-		configuration.setMyProxyLifetime(XBayaConstants.DEFAULT_MYPROXY_LIFTTIME);
-		configuration.setMyProxyPort(XBayaConstants.DEFAULT_MYPROXY_PORT);
-        //This null check will fix some test failures
-        if (WorkflowInterpretorSkeleton.configurationContext != null) {
-            configuration.setMyProxyServer(findValue(vals, MYPROXY_SERVER, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(MYPROXY_SERVER)));
-            configuration.setMyProxyPassphrase(findValue(vals, MYPROXY_PASS, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(MYPROXY_PASS)));
-            configuration.setMyProxyUsername(findValue(vals, MYPROXY_USER, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(MYPROXY_USER)));
-            configuration.setTrustedCertLocation(findValue(vals, TRUSTED_CERT_LOCATION, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(TRUSTED_CERT_LOCATION)));
-            configuration.setTrustedCertLocation(findValue(vals, MYPROXY_LIFETIME, (String) WorkflowInterpretorSkeleton.configurationContext.getProperty(MYPROXY_LIFETIME)));
-        }
-		return configuration;
-	}
-
-	private String findValue(Map<String,String> vals, String key, String defaultVal) {
-		if(vals.get(key) != null) {
-            return vals.get(key);
-        }
-		return defaultVal;
-	}
-
-    public void shutDown(ConfigurationContext configctx, AxisService service) {
-        URI gfacURL = (URI) configctx.getProperty(SERVICE_URL);
-        if (getAiravataAPI() != null && thread != null) {
-            AiravataAPI registry = getAiravataAPI();
-            try {
-                registry.getAiravataManager().removeWorkflowInterpreterURI(gfacURL);
-            } catch (AiravataAPIInvocationException e) {
-                e.printStackTrace();
-            }
-            thread.interrupt();
-            try {
-                thread.join();
-            } catch (InterruptedException e) {
-                log.warn("GFacURL update thread is interrupted");
-            }
-        }
-        if (runner != null) {
-            runner.shutDown();
-        }
-
-        notInterrupted = false;
-    }
-
-    private List<HostDescription> getDefinedHostDescriptions() {
-        URL url = this.getClass().getClassLoader().getResource("host.xml");
-        ArrayList<HostDescription> hostDescriptions = new ArrayList<HostDescription>();
-        XMLStreamReader reader = null;
-        try {
-            if (url != null) {
-                reader = XMLInputFactory.newInstance().createXMLStreamReader(url.openStream());
-            } else {
-                throw new RuntimeException("Error retrieving host.xml file. Should reside in " +
-                        "$SERVER_HOME/webapps/axis2/WEB-INF/classes/host.xml");
-            }
-        } catch (XMLStreamException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        } catch (IOException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        }
-        StAXOMBuilder builder = new StAXOMBuilder(reader);
-        OMElement documentElement = builder.getDocumentElement();
-        Iterator<?> server = documentElement.getChildrenWithName(new QName("server"));
-        while (server.hasNext()) {
-            HostDescription hostDescription = new HostDescription();
-            OMElement next = (OMElement) server.next();
-            if (next.getFirstChildWithName(new QName("gram.endpoint")) != null &&
-                    "globus".equals(next.getFirstChildWithName(new QName("type")).getText())) {
-                hostDescription.getType().changeType(GlobusHostType.type);
-                ((GlobusHostType) hostDescription.getType()).addGlobusGateKeeperEndPoint(next.getFirstChildWithName(new QName("gram.endpoint")).getText());
-                ((GlobusHostType) hostDescription.getType()).addGridFTPEndPoint(next.getFirstChildWithName(new QName("gridftp.endpoint")).getText());
-            } else if("ssh".equals(next.getFirstChildWithName(new QName("type")).getText())) {
-                hostDescription.getType().changeType(SSHHostType.type);
-                if(next.getFirstChildWithName(new QName("hpc.resource")) != null){
-                    if("true".equals(next.getFirstChildWithName(new QName("gram.endpoint")))){
-                        ((SSHHostType) hostDescription.getType()).setHpcResource(true);
-                    }
-                }
-                ((SSHHostType) hostDescription.getType()).setHpcResource(false);
-            } else if("gsissh".equals(next.getFirstChildWithName(new QName("type")).getText())) {
-                hostDescription.getType().changeType(GsisshHostType.type);
-            }
-            (hostDescription.getType()).setHostName(next.getFirstChildWithName(new QName("name")).getText());
-            (hostDescription.getType()).setHostAddress(next.getFirstChildWithName(new QName("host")).getText());
-            hostDescriptions.add(hostDescription);
-        }
-        return hostDescriptions;
-    }
-
-    public static final int URL_UPDATE_INTERVAL = 1000 * 60 * 60 * 3;
-
-    class WIServiceThread extends PeriodicExecutorThread {
-        private ConfigurationContext context = null;
-
-        WIServiceThread(AiravataAPI registry, ConfigurationContext context) {
-            super(registry);
-            this.context = context;
-        }
-
-        @Override
-        protected void updateRegistry(AiravataAPI registry) throws Exception {
-            URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
-            registry.getAiravataManager().addWorkflowInterpreterURI(localAddress);
-            log.debug("Updated Workflow Interpreter service URL in to Repository");
-
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java
deleted file mode 100644
index defd8c2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/AsynchronousInvoker.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
-import xsul.xwsif_runtime_async_http.XsulSoapHttpWsaResponsesCorrelator;
-
-public class AsynchronousInvoker extends SimpleInvoker {
-
-    private static final Logger logger = LoggerFactory.getLogger(AsynchronousInvoker.class);
-
-    private String messageBoxURL;
-
-    /**
-     * Constructs an AsynchronousInvoker.
-     * 
-     * @param definitions
-     */
-    public AsynchronousInvoker(WsdlDefinitions definitions) {
-        this(definitions, null);
-    }
-
-    /**
-     * Constructs an AsynchronousInvoker.
-     * 
-     * @param definitions
-     * @param messageBoxURL
-     */
-    public AsynchronousInvoker(WsdlDefinitions definitions, String messageBoxURL) {
-        super(definitions);
-        this.messageBoxURL = messageBoxURL;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.SimpleInvoker#setup()
-     */
-    @Override
-    public void setup() throws WorkflowException {
-        super.setup();
-        /* Set the output message to null to set teh output from async Listener */
-        WSIFAsyncResponsesCorrelator correlator;
-        if (this.messageBoxURL == null || this.messageBoxURL.length() == 0) {
-            correlator = new XsulSoapHttpWsaResponsesCorrelator();
-            String serverLoc = ((XsulSoapHttpWsaResponsesCorrelator) correlator).getServerLocation();
-            logger.debug("using async correlator at " + serverLoc);
-        } else {
-            correlator = new MsgBoxWsaResponsesCorrelator(this.messageBoxURL,this);
-            logger.debug("using message box at " + this.messageBoxURL);
-        }
-        this.client.useAsyncMessaging(correlator);
-    }
-
-     public boolean invoke() throws WorkflowException {
-         final WSIFOperation  operation = this.getOperation();
-         final WSIFMessage inputMessage = this.getInputMessage();
-         this.setOutputMessage(null);
-        try {
-              new Thread() {
-                @Override
-                public void run() {
-                    try {
-                        operation.executeInputOnlyOperation(inputMessage);
-                    } catch (Exception e) {
-                        // Ignore the error.
-                        logger.error("Error invoking GFac Service",e);
-                    }
-                }
-            }.start();
-
-            while(this.getOutputMessage() == null){
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e) {
-                    logger.error("Error Waiting for the response from backend");
-                }
-            }
-            // Gfac operation failed, so xbaya side throws this exception
-            if("ErrorResponse".equals(XMLUtil.stringToXmlElement3(this.getOutputMessage().toString()).getName())){
-                // Here we do not throw an exception, because if we throw an exception Interpreter will catch it and do the unsubscription,
-                // which is not needed because if there's an gfac side error gfac will send a failure and unsubscription will be done in monitoring
-                // so if we send an exception we are attempting to do two unsubscriptions which will cause a one unsubscription to fail.
-                return false;
-            }
-
-            return true;
-        } catch (RuntimeException e) {
-            String message = "Error in invoking a service.";
-            throw new WorkflowException(message, e);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java
deleted file mode 100644
index 5020ef4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicInvoker.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import java.lang.reflect.Method;
-import java.net.URL;
-import java.net.URLClassLoader;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-
-import xsul.wsif.WSIFMessage;
-import xsul.xwsif_runtime.WSIFClient;
-
-public class DynamicInvoker implements Invoker {
-
-    private URL jarUrl;
-
-    private String className;
-
-    private String operationName;
-
-    private Object[] inputs;
-
-    private Object result;
-
-    /**
-     * Constructs a DynamicInvoker.
-     * 
-     * @param className
-     * @param jarUrl
-     * @param operationName
-     */
-    public DynamicInvoker(String className, URL jarUrl, String operationName, Object[] inputs) {
-        this.className = className;
-        this.jarUrl = jarUrl;
-        this.operationName = operationName;
-        this.inputs = inputs;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#getOutput(java.lang.String)
-     */
-    public Object getOutput(String name) throws WorkflowException {
-        waitToFinish();
-        return result;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#invoke()
-     */
-    public boolean invoke() throws WorkflowException {
-        try {
-            Class<?> targetClass = Class.forName(this.className);
-            Object obj = targetClass.newInstance();
-
-            Method[] methods = targetClass.getDeclaredMethods();
-            Method targetMethod = null;
-            for (Method method : methods) {
-                if (this.operationName.equals(method.getName())) {
-                    targetMethod = method;
-                    break;
-                }
-            }
-            if (targetMethod == null) {
-                throw new WorkflowException("Could not find the method using reflection: " + this.operationName);
-            }
-
-            targetMethod.setAccessible(true);
-            this.result = targetMethod.invoke(obj, inputs);
-
-        } catch (Exception e) {
-            throw new WorkflowException(e);
-        }
-        return true;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setInput(java.lang.String, java.lang.Object)
-     */
-    public void setInput(String name, Object value) throws WorkflowException {
-
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setOperation(java.lang.String)
-     */
-    public void setOperation(String operationName) throws WorkflowException {
-        this.operationName = operationName;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#setup()
-     */
-    public void setup() throws WorkflowException {
-        Class[] parameters = new Class[] { URL.class };
-        URLClassLoader sysloader = (URLClassLoader) ClassLoader.getSystemClassLoader();
-        Class sysclass = URLClassLoader.class;
-
-        try {
-            Method method = sysclass.getDeclaredMethod("addURL", parameters);
-            method.setAccessible(true);
-            method.invoke(sysloader, new Object[] { this.jarUrl });
-        } catch (Throwable t) {
-            t.printStackTrace();
-            throw new WorkflowException("Error, could not add URL to system classloader");
-        }
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#waitToFinish()
-     */
-    public void waitToFinish() throws WorkflowException {
-        while (this.result == null) {
-            try {
-                Thread.sleep(200);
-            } catch (InterruptedException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-        }
-
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#getOutputs()
-     */
-    public WSIFMessage getOutputs() throws WorkflowException {
-        waitToFinish();
-        return (WSIFMessage) this.result;
-
-    }
-
-    @Override
-    public WSIFClient getClient() {
-        return null;
-    }
-
-    @Override
-    public WSIFMessage getInputs() throws WorkflowException {
-        return null;
-    }
-
-    @Override
-    public WSIFMessage getFault() throws WorkflowException {
-        return null;
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java
deleted file mode 100644
index cc7fc2c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/DynamicServiceCreator.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import java.io.File;
-import java.net.URI;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.invoker.factory.InvokerFactory;
-
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsdl.WsdlResolver;
-
-public class DynamicServiceCreator {
-
-    private String dynamicFactoryWSDLLocation;
-
-    private static String classStr = "package org.apache.airavata.xbaya;" +
-
-    "public class DefaultClassName{" +
-
-    "public int operationName(String[] stringArray0){" +
-
-    "return 8;" + "}" + "}";
-
-    /**
-     * Constructs a DynamicServiceCreator.
-     * 
-     * @param dynamicFactoryWSDLLocation
-     */
-    public DynamicServiceCreator(String dynamicFactoryWSDLLocation) {
-        this.dynamicFactoryWSDLLocation = dynamicFactoryWSDLLocation;
-    }
-
-    public void createService(String code) throws WorkflowException {
-        try {
-            WsdlDefinitions definitions = null;
-            if (this.dynamicFactoryWSDLLocation != null && !this.dynamicFactoryWSDLLocation.equals("")) {
-                definitions = WsdlResolver.getInstance().loadWsdl(new File(".").toURI(),
-                        new URI(this.dynamicFactoryWSDLLocation));
-            }
-
-            // Create Invoker
-            // FIXME: Should pass the right leadcontext header for last argument
-            Invoker invoker = InvokerFactory.createInvoker(new QName("http://extreme.indiana.edu",
-                    "ServiceCreatorPortType"), definitions, null, null, null);
-
-            invoker.setup();
-
-            invoker.setOperation("deployServiceFromClass");
-            invoker.setInput("classAsString", code);
-            invoker.invoke();
-            invoker.getOutput("return");
-        } catch (Exception e) {
-            throw new WorkflowException(e);
-        }
-
-    }
-
-    public static void main(String[] args) throws WorkflowException {
-        DynamicServiceCreator c = new DynamicServiceCreator("http://127.0.0.1:8080/axis2/services/ServiceCreator?wsdl");
-        c.createService(classStr);
-    }
-
-}
\ No newline at end of file


[78/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
new file mode 100644
index 0000000..bc3d23f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
@@ -0,0 +1,1508 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.UUID;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import javax.xml.namespace.QName;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.utils.Pair;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
+import org.apache.airavata.gfac.ec2.AmazonSecurityContext;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus.State;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
+import org.apache.airavata.registry.api.workflow.WorkflowNodeType;
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.amazon.InstanceComponent;
+import org.apache.airavata.workflow.model.component.amazon.TerminateInstanceComponent;
+import org.apache.airavata.workflow.model.component.dynamic.DynamicComponent;
+import org.apache.airavata.workflow.model.component.system.ConstantComponent;
+import org.apache.airavata.workflow.model.component.system.DifferedInputComponent;
+import org.apache.airavata.workflow.model.component.system.DoWhileComponent;
+import org.apache.airavata.workflow.model.component.system.EndDoWhileComponent;
+import org.apache.airavata.workflow.model.component.system.EndForEachComponent;
+import org.apache.airavata.workflow.model.component.system.EndifComponent;
+import org.apache.airavata.workflow.model.component.system.ForEachComponent;
+import org.apache.airavata.workflow.model.component.system.IfComponent;
+import org.apache.airavata.workflow.model.component.system.InputComponent;
+import org.apache.airavata.workflow.model.component.system.MemoComponent;
+import org.apache.airavata.workflow.model.component.system.OutputComponent;
+import org.apache.airavata.workflow.model.component.system.S3InputComponent;
+import org.apache.airavata.workflow.model.component.system.SubWorkflowComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponentPort;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.ControlPort;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
+import org.apache.airavata.workflow.model.graph.dynamic.BasicTypeMapping;
+import org.apache.airavata.workflow.model.graph.dynamic.DynamicNode;
+import org.apache.airavata.workflow.model.graph.impl.EdgeImpl;
+import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
+import org.apache.airavata.workflow.model.graph.subworkflow.SubWorkflowNode;
+import org.apache.airavata.workflow.model.graph.system.ConstantNode;
+import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
+import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
+import org.apache.airavata.workflow.model.graph.system.EndifNode;
+import org.apache.airavata.workflow.model.graph.system.ForEachNode;
+import org.apache.airavata.workflow.model.graph.system.IfNode;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.graph.ws.WSPort;
+import org.apache.airavata.workflow.model.ode.ODEClient;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.xbaya.concurrent.PredicatedTaskRunner;
+import org.apache.airavata.xbaya.invoker.DynamicInvoker;
+import org.apache.airavata.xbaya.invoker.EmbeddedGFacInvoker;
+import org.apache.airavata.xbaya.invoker.GenericInvoker;
+import org.apache.airavata.xbaya.invoker.Invoker;
+import org.apache.airavata.xbaya.invoker.WorkflowInputUtil;
+import org.apache.airavata.xbaya.provenance.ProvenanceReader;
+import org.apache.airavata.xbaya.provenance.ProvenanceWrite;
+import org.apache.airavata.xbaya.util.AmazonUtil;
+import org.apache.airavata.xbaya.util.InterpreterUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+import xsul.lead.LeadResourceMapping;
+import xsul5.XmlConstants;
+
+public class WorkflowInterpreter {
+    private static final Logger log = LoggerFactory.getLogger(WorkflowInterpreter.class);
+
+	public static final String WORKFLOW_STARTED = "Workflow Running";
+	public static final String WORKFLOW_FINISHED = "Workflow Finished";
+
+	private WorkflowInterpreterConfiguration config;
+
+	private Map<Node, Invoker> invokerMap = new HashMap<Node, Invoker>();
+
+	private LeadResourceMapping resourceMapping;
+
+	private PredicatedTaskRunner provenanceWriter;
+
+	private WorkflowInterpreterInteractor interactor;
+
+
+    public static ThreadLocal<WorkflowInterpreterConfiguration> workflowInterpreterConfigurationThreadLocal =
+            new ThreadLocal<WorkflowInterpreterConfiguration>();
+
+    /**
+     *
+     * @param config
+     * @param interactor
+     */
+	public WorkflowInterpreter(WorkflowInterpreterConfiguration config, WorkflowInterpreterInteractor interactor) {
+		this.setConfig(config);
+		config.validateNotifier();
+		this.interactor = interactor;
+		if (config.isActOnProvenance()==null) {
+			config.setActOnProvenance(config.getConfiguration()
+					.isCollectProvenance());
+		}
+		config.setSubWorkflow(false);
+        setWorkflowInterpreterConfigurationThreadLocal(config);
+	}
+
+	public WorkflowInterpreterInteractor getInteractor(){
+		return this.interactor;
+	}
+	public void setResourceMapping(LeadResourceMapping resourceMapping) {
+		this.resourceMapping = resourceMapping;
+	}
+
+	private void notifyViaInteractor(WorkflowExecutionMessage messageType, Object data) {
+		interactor.notify(messageType, config, data);
+	}
+
+	private Object getInputViaInteractor(WorkflowExecutionMessage messageType, Object data) throws Exception {
+		return interactor.retrieveData(messageType, config, data);
+	}
+
+	/**
+	 * @throws WorkflowException
+	 */
+	public void scheduleDynamically() throws WorkflowException {
+		try {
+			if (!this.config.isSubWorkflow() && this.getWorkflow().getExecutionState() != WorkflowExecutionState.NONE) {
+				throw new WorkFlowInterpreterException("XBaya is already running a workflow");
+			}
+
+			this.getWorkflow().setExecutionState(WorkflowExecutionState.RUNNING);
+			ArrayList<Node> inputNodes = this.getInputNodesDynamically();
+			Object[] values = new Object[inputNodes.size()];
+			String[] keywords = new String[inputNodes.size()];
+			for (int i = 0; i < inputNodes.size(); ++i) {
+				Node node = inputNodes.get(i);
+				node.setState(NodeExecutionState.FINISHED);
+				notifyViaInteractor(WorkflowExecutionMessage.NODE_STATE_CHANGED, null);
+				keywords[i] = ((InputNode) node).getName();
+				values[i] = ((InputNode) node).getDefaultValue();
+                //Saving workflow input Node data before running the workflow
+                WorkflowNodeType workflowNodeType = new WorkflowNodeType();
+                workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.INPUTNODE);
+                WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(new WorkflowExecution(getConfig().getTopic(),
+                        getConfig().getTopic()), node.getID());
+                this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowInstanceNodeInput(workflowInstanceNode, keywords[i] + "=" + (String) values[i]);
+                this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowNodeType(workflowInstanceNode, workflowNodeType);
+			}
+			this.config.getNotifier().workflowStarted(values, keywords);
+			this.config.getConfiguration().setContextHeader(WorkflowContextHeaderBuilder.getCurrentContextHeader());
+
+			while (this.getWorkflow().getExecutionState() != WorkflowExecutionState.STOPPED) {
+                ArrayList<Node> readyNodes = this.getReadyNodesDynamically();
+                ArrayList<Thread> threadList = new ArrayList<Thread>();
+                if (getRemainNodesDynamically() == 0) {
+                    notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED, WorkflowExecutionState.STOPPED);
+                }
+                // ok we have paused sleep
+                if (this.getWorkflow().getExecutionState() == WorkflowExecutionState.PAUSED) {
+                	log.info("Workflow execution "+config.getTopic()+" is paused.");
+	                while (this.getWorkflow().getExecutionState() == WorkflowExecutionState.PAUSED) {
+	                    try {
+	                        Thread.sleep(400);
+	                    } catch (InterruptedException e) {
+	                        e.printStackTrace();
+	                    }
+	                }
+	                if (this.getWorkflow().getExecutionState() == WorkflowExecutionState.STOPPED) {
+	                	continue;
+	                }
+	                log.info("Workflow execution "+config.getTopic()+" is resumed.");
+                }
+                // get task list and execute them
+				for (final Node node : readyNodes) {
+					if (node.isBreak()) {
+						this.notifyPause();
+						break;
+					}
+					if (this.getWorkflow().getExecutionState() == WorkflowExecutionState.PAUSED
+							|| this.getWorkflow().getExecutionState() == WorkflowExecutionState.STOPPED) {
+						break;
+					}
+
+                    // Since this is an independent node execution we can run these nodes in separate threads.
+                    Thread th = new Thread() {
+                        public synchronized void run() {
+                            try {
+                                executeDynamically(node);
+                            } catch (WorkflowException e) {
+                                log.error("Error execution workflow Node : " + node.getID());
+                                return;
+                            }
+                        }
+                    };
+                    threadList.add(th);
+                    th.start();
+					if (this.getWorkflow().getExecutionState() == WorkflowExecutionState.STEP) {
+						this.getWorkflow().setExecutionState(WorkflowExecutionState.PAUSED);
+						break;
+					}
+				}
+                //This thread waits until parallel nodes get finished to send the outputs dynamically.
+               for(Thread th:threadList){
+                   try {
+                       th.join();
+                   } catch (InterruptedException e) {
+                       e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                   }
+               }
+                // Above statement set the nodeCount back to 0.
+
+				// TODO commented this for foreach, fix this.
+				sendOutputsDynamically();
+				// Dry run sleep a lil bit to release load
+				if (readyNodes.size() == 0) {
+					// when there are no ready nodes and no running nodes
+					// and there are failed nodes then workflow is stuck because
+					// of failure
+					// so we should pause the execution
+					if (InterpreterUtil.getRunningNodeCountDynamically(this.getGraph()) == 0
+							/**&& InterpreterUtil.getFailedNodeCountDynamically(this.getGraph()) != 0**/) {
+                        //Since airavata only support workflow interpreter server mode we do not want to keep thread in sleep mode
+                        // continuously, so we make the workflow stop when there's nothing to do.
+						this.getWorkflow().setExecutionState(WorkflowExecutionState.STOPPED);
+					}
+
+					try {
+						Thread.sleep(400);
+					} catch (InterruptedException e) {
+						log.error("Workflow Excecution is interrupted !");
+                        return;
+					}
+				}
+			}
+
+			if (InterpreterUtil.getFailedNodeCountDynamically(this.getGraph()) == 0) {
+				if (this.config.isActOnProvenance()) {
+
+                    try {
+                        this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowInstanceStatus(
+                                this.config.getTopic(), this.config.getTopic(), State.FINISHED);
+                    } catch (Exception e) {
+                        throw new WorkflowException(e);
+                    }
+
+					// System.out.println(this.config.getConfiguration().getJcrComponentRegistry().getRegistry().getWorkflowStatus(this.topic));
+				}
+			} else {
+				if (this.config.isActOnProvenance()) {
+					try {
+						this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().
+                                setWorkflowInstanceStatus(this.config.getTopic(),this.config.getTopic(), State.FAILED);
+					} catch (AiravataAPIInvocationException e) {
+						throw new WorkflowException(e);
+					}
+				}
+			}
+
+            this.config.getNotifier().workflowTerminated();
+
+            UUID uuid = UUID.randomUUID();
+			notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_TASK_START, new WorkflowInterpreterInteractor.TaskNotification("Stop Workflow",
+					"Cleaning up resources for Workflow", uuid.toString()));
+			// Send Notification for output values
+			finish();
+			// Sleep to provide for notification delay
+			try {
+				Thread.sleep(1000);
+			} catch (InterruptedException e) {
+				e.printStackTrace();
+			}
+			notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_TASK_END, new WorkflowInterpreterInteractor.TaskNotification("Stop Workflow",
+					"Cleaning up resources for Workflow", uuid.toString()));
+
+		} catch (RuntimeException e) {
+			// we reset all the state
+			cleanup();
+            this.config.getNotifier().workflowFailed(e.getMessage());
+        	raiseException(e);
+		} catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }finally{
+        	cleanup();
+			if (config.getNotifier() != null) {
+				this.config.getNotifier().cleanup();
+			}
+			this.getWorkflow().setExecutionState(WorkflowExecutionState.NONE);
+	    }
+    }
+
+	/**
+	 * @param node
+	 * @return
+	 * @throws WorkflowException
+	 * @throws java.io.IOException
+	 */
+	private boolean readProvenance(Node node) {
+
+		try {
+			List<DataPort> inputPorts = node.getInputPorts();
+			Pair<String, String>[] inputs = new Pair[inputPorts.size()];
+			for (int i = 0; i < inputPorts.size(); ++i) {
+				String inputTagname = inputPorts.get(i).getName();
+				// cordinate return
+				if(node instanceof DoWhileNode){
+					inputs[i] = new Pair<String, String>(inputTagname, "<" + inputTagname + ">"
+							+ InterpreterUtil.findInputFromPort(inputPorts.get(i), this.invokerMap).toString() + "</" + inputTagname + ">");
+				break;
+				}else{
+				inputs[i] = new Pair<String, String>(inputTagname, "<" + inputTagname + ">"
+						+ InterpreterUtil.findInputFromPort(inputPorts.get(i), this.invokerMap).toString() + "</" + inputTagname + ">");
+				}
+			}
+
+			String output = ((String) new ProvenanceReader(node, this.config.getTopic(), this.config.getAiravataAPI()).read());
+			if (output != null) {
+				XmlElement result = XMLUtil.stringToXmlElement(output);
+				SystemComponentInvoker invoker = new SystemComponentInvoker();
+				List<DataPort> outPorts = node.getOutputPorts();
+				for (DataPort dataPort : outPorts) {
+
+					Iterable itr = result.children();
+					for (Object outputElem : itr) {
+						if (outputElem instanceof XmlElement) {
+							if (((XmlElement) outputElem).getName().equals(dataPort.getName())) {
+								invoker.addOutput(dataPort.getName(), ((XmlElement) outputElem).children().iterator().next());
+							}
+						}
+					}
+				}
+
+				this.invokerMap.put(node, invoker);
+				node.setState(NodeExecutionState.FINISHED);
+				return true;
+			} else {
+//				writeProvenanceLater(node);
+			}
+		} catch (Exception e) {
+			throw new WorkflowRuntimeException(e);
+		}
+		return false;
+
+	}
+
+	/**
+	 * @param node
+	 * @throws WorkflowException
+	 */
+	private void writeProvenanceLater(Node node) throws WorkflowException {
+
+		if (node instanceof ForEachNode) {
+			node = InterpreterUtil.findEndForEachFor((ForEachNode) node);
+		}
+		if (this.provenanceWriter == null) {
+			this.provenanceWriter = new PredicatedTaskRunner(1);
+		}
+		this.provenanceWriter.scedule(new ProvenanceWrite(node, this.getWorkflow().getName(), invokerMap, this.config.getTopic(), this.getConfig()
+				.getConfiguration().getAiravataAPI()));
+	}
+
+	/**
+	 * @param e
+	 */
+	public void raiseException(Throwable e) {
+		notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_ERROR, e);
+	}
+
+	/**
+     *
+     */
+	private void notifyPause() {
+		if (this.getWorkflow().getExecutionState() != WorkflowExecutionState.RUNNING && this.getWorkflow().getExecutionState() != WorkflowExecutionState.STEP) {
+			throw new WorkflowRuntimeException("Cannot pause when not running");
+		}
+		notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED, WorkflowExecutionState.PAUSED);
+	}
+
+	/**
+	 * @throws MonitorException
+	 */
+	public void cleanup() throws MonitorException {
+		this.getWorkflow().setExecutionState(WorkflowExecutionState.STOPPED);
+		notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_CLEANUP, null);
+	}
+
+	private void sendOutputsDynamically() throws WorkflowException, AiravataAPIInvocationException {
+		ArrayList<Node> outputNodes = getReadyOutputNodesDynamically();
+		if (outputNodes.size() != 0) {
+            LinkedList<Object> outputValues = new LinkedList<Object>();
+			LinkedList<String> outputKeywords = new LinkedList<String>();
+			for (Node node : outputNodes) {
+				// Change it to processing state so we will not pic it up in the
+				// next run
+				// even if the next run runs before the notification arrives
+
+				node.setState(NodeExecutionState.EXECUTING);
+				// OutputNode node = (OutputNode) outputNode;
+				List<DataPort> inputPorts = node.getInputPorts();
+
+				for (DataPort dataPort : inputPorts) {
+					Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
+					if (null == val) {
+						throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
+					}
+					// This is ok because the outputnodes always got only one
+					// input
+					if (val instanceof org.xmlpull.v1.builder.XmlElement) {
+						((OutputNode) node).setDescription(XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
+					} else {
+						((OutputNode) node).setDescription(val.toString());
+					}
+                    // Saving output Node data in to database
+                    WorkflowNodeType workflowNodeType = new WorkflowNodeType();
+                    workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.OUTPUTNODE);
+                    WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(new WorkflowExecution(config.getTopic(), config.getTopic()), node.getID());
+                    String portname = node.getName();
+                    String portValue = ((OutputNode) node).getDescription();
+                    this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowInstanceNodeOutput(workflowInstanceNode, portname + "=" + portValue);
+                    this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowNodeType(workflowInstanceNode, workflowNodeType);
+
+					if (this.config.isActOnProvenance()) {
+						try {
+							if (val instanceof String) {
+								this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager()
+										.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
+							} else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
+								this.getConfig()
+										.getConfiguration()
+										.getAiravataAPI().getProvenanceManager()
+										.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
+												XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
+							}
+                            outputValues.add(val);
+                            outputKeywords.add(dataPort.getID());
+						} catch (AiravataAPIInvocationException e) {
+							e.printStackTrace(); // To change body of catch
+													// statement use File |
+													// Settings | File
+													// Templates.
+						}
+					}
+					node.setState(NodeExecutionState.FINISHED);
+				}
+			}
+
+		}
+	}
+
+	private void finish() throws WorkflowException {
+		ArrayList<Node> outoutNodes = new ArrayList<Node>();
+		List<NodeImpl> nodes = this.getGraph().getNodes();
+		for (Node node : nodes) {
+			if (node instanceof OutputNode) {
+				if (node.getInputPort(0).getFromNode().getState()== NodeExecutionState.FINISHED) {
+					outoutNodes.add(node);
+				} else {
+					// The workflow is incomplete so return without sending
+					// workflowFinished
+					return;
+				}
+			}
+		}
+		LinkedList<Object> outputValues = new LinkedList<Object>();
+		LinkedList<String> outputKeywords = new LinkedList<String>();
+		for (Node outputNode : outoutNodes) {
+			OutputNode node = (OutputNode) outputNode;
+			List<DataPort> inputPorts = node.getInputPorts();
+			for (DataPort dataPort : inputPorts) {
+				Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
+				;
+
+				if (null == val) {
+					throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
+				}
+				// Some node not yet updated
+				if (node.getState().equals(NodeExecutionState.FINISHED)) {
+					if (this.config.isActOnProvenance()) {
+						try {
+							if (val instanceof String) {
+                                /**
+                                 TODO :  saveWorkflowExecutionOutput() is not implemented in Registry
+                                  API or Airavata API at the moment
+                                  **/
+								this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager()
+										.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
+							} else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
+								this.getConfig()
+										.getConfiguration()
+										.getAiravataAPI().getProvenanceManager()
+										.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
+												XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
+							}
+
+						} catch (AiravataAPIInvocationException e) {
+							e.printStackTrace(); // To change body of catch
+													// statement use File |
+													// Settings | File
+													// Templates.
+						}
+					}
+					if (val instanceof XmlElement) {
+						((OutputNode) node).setDescription(XMLUtil.xmlElementToString((XmlElement) val));
+					} else {
+						((OutputNode) node).setDescription(val.toString());
+					}
+                    outputValues.add(val);
+                    outputKeywords.add(dataPort.getID());
+					node.setState(NodeExecutionState.FINISHED);
+				}
+			}
+
+		}
+		this.config.getNotifier().sendingPartialResults(outputValues.toArray(), outputKeywords.toArray(new String[outputKeywords.size()]));
+	}
+
+	private void executeDynamically(final Node node) throws WorkflowException {
+		node.setState(NodeExecutionState.EXECUTING);
+		Component component = node.getComponent();
+		if (component instanceof SubWorkflowComponent) {
+			handleSubWorkComponent(node);
+		} else if (component instanceof WSComponent) {
+			handleWSComponent(node);
+		} else if (component instanceof DynamicComponent) {
+			handleDynamicComponent(node);
+		} else if (component instanceof ForEachComponent) {
+			handleForEach(node);
+		} else if (component instanceof IfComponent) {
+			handleIf(node);
+		} else if (component instanceof EndifComponent) {
+			handleEndIf(node);
+		} else if (component instanceof DoWhileComponent) {
+			handleDoWhile(node);
+		}else if (component instanceof EndDoWhileComponent) {
+		// Component is handled in DoWhileHandler after eval condition
+		}
+		else if (component instanceof InstanceComponent) {
+			handleAmazonInstance(node);
+		} else if (component instanceof TerminateInstanceComponent) {
+			handleAmazonTerminateInstance(node);
+		} else {
+            throw new WorkFlowInterpreterException("Encountered Node that cannot be executed:" + node);
+		}
+	}
+
+	private void handleAmazonTerminateInstance(final Node node)
+			throws WorkflowException {
+		Object inputVal = InterpreterUtil.findInputFromPort(node.getInputPort(0), this.invokerMap);
+		String instanceId = inputVal.toString();
+		/*
+		 * Terminate instance
+		 */
+		AmazonUtil.terminateInstances(instanceId);
+
+		// set color to done
+		node.setState(NodeExecutionState.FINISHED);
+	}
+
+	private void handleAmazonInstance(final Node node) {
+		if (config.getAwsAccessKey().isEmpty() || config.getAwsSecretKey().isEmpty()) {
+			throw new WorkFlowInterpreterException("Please set Amazon Credential before using EC2 Instance Component");
+		}
+		for (ControlPort ports : node.getControlOutPorts()) {
+			ports.setConditionMet(true);
+		}
+	}
+
+	private void handleDoWhile(final Node node) {
+		// Executor thread is shutdown inside as thread gets killed when you
+		// shutdown
+		ExecutorService threadExecutor = Executors.newSingleThreadExecutor();
+		DoWhileHandler doWhileHandler = new DoWhileHandler((DoWhileNode) node, this.invokerMap, getWaitingNodesDynamically(),
+				getFinishedNodesDynamically(), this, threadExecutor);
+		threadExecutor.submit(doWhileHandler);
+	}
+
+	private void handleSubWorkComponent(Node node) throws WorkflowException {
+		notifyViaInteractor(WorkflowExecutionMessage.OPEN_SUBWORKFLOW, node);
+		// setting the inputs
+		Workflow subWorkflow = ((SubWorkflowNode) node).getWorkflow();
+		ArrayList<Node> subWorkflowInputNodes = getInputNodes(subWorkflow);
+
+		List<DataPort> inputPorts = node.getInputPorts();
+		for (DataPort port : inputPorts) {
+			Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
+			if (null == inputVal) {
+				throw new WorkFlowInterpreterException("Unable to find inputs for the subworkflow node node:" + node.getID());
+			}
+
+			for (Iterator<Node> iterator = subWorkflowInputNodes.iterator(); iterator.hasNext();) {
+				InputNode inputNode = (InputNode) iterator.next();
+				if (inputNode.getName().equals(port.getName())) {
+					inputNode.setDefaultValue(inputVal);
+				}
+			}
+		}
+		for (Iterator<Node> iterator = subWorkflowInputNodes.iterator(); iterator.hasNext();) {
+			InputNode inputNode = (InputNode) iterator.next();
+			if (inputNode.getDefaultValue() == null) {
+				throw new WorkFlowInterpreterException("Input not set for  :" + inputNode.getID());
+			}
+
+		}
+
+		try {
+			WorkflowInterpreter subworkflowInterpreter = (WorkflowInterpreter) getInputViaInteractor(
+					WorkflowExecutionMessage.INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW, subWorkflow);
+			subworkflowInterpreter.scheduleDynamically();
+		} catch (Exception e) {
+			throw new WorkflowException(e);
+		}
+	}
+
+	protected void handleWSComponent(Node node) throws WorkflowException {
+		WSComponent wsComponent = ((WSComponent) node.getComponent());
+		QName portTypeQName = wsComponent.getPortTypeQName();
+        Invoker invoker = this.invokerMap.get(node);
+
+        // We do this because invokers cannot be cached because the puretls expires
+        if (invoker != null) {
+            this.invokerMap.remove(invoker);
+        }
+
+        final WSNode wsNode = (WSNode) node;
+        String wsdlLocation = InterpreterUtil.getEPR(wsNode);
+        final String gfacURLString = this.getConfig().getConfiguration().getGFacURL().toString();
+        if (null == wsdlLocation) {
+
+            /* If there is a instance control component connects to this
+             * component send information in soap header */
+            for (Node n : wsNode.getControlInPort().getFromNodes()) {
+                if (n instanceof InstanceNode) {
+                    AmazonSecurityContext amazonSecurityContext;
+                    final String awsAccessKeyId = config.getAwsAccessKey();
+                    final String awsSecretKey = config.getAwsSecretKey();
+                    final String username = ((InstanceNode) n).getUsername();
+
+                    if (((InstanceNode) n).isStartNewInstance()) {
+                        final String amiId = ((InstanceNode) n).getIdAsValue();
+                        final String instanceType = ((InstanceNode) n).getInstanceType();
+
+                        amazonSecurityContext =
+                                new AmazonSecurityContext(username, awsAccessKeyId, awsSecretKey, amiId, instanceType);
+                    } else {
+                        final String instanceId = ((InstanceNode) n).getIdAsValue();
+                        amazonSecurityContext =
+                                new AmazonSecurityContext(username, awsAccessKeyId, awsSecretKey, instanceId);
+                    }
+
+                    this.config.getConfiguration().setAmazonSecurityContext(amazonSecurityContext);
+                }
+            }
+
+            if ((this.config.isGfacEmbeddedMode()) || (config.getAwsAccessKey() != null)) {
+                invoker = new EmbeddedGFacInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode.getComponent().getWSDL()), node.getID(),
+                        this.config.getMessageBoxURL().toASCIIString(), this.config.getMessageBrokerURL().toASCIIString(), this.config.getNotifier(),
+                        this.config.getTopic(), this.config.getAiravataAPI(), portTypeQName.getLocalPart(), this.config.getConfiguration());
+            } else {
+                invoker = new GenericInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode.getComponent().getWSDL()), node.getID(),
+                        this.config.getMessageBoxURL().toASCIIString(), gfacURLString, this.config.getNotifier());
+            }
+
+        } else {
+			if (wsdlLocation.endsWith("/")) {
+				wsdlLocation = wsdlLocation.substring(0, wsdlLocation.length() - 1);
+			}
+			if (!wsdlLocation.endsWith("?wsdl")) {
+				wsdlLocation += "?wsdl";
+			}
+			invoker = new GenericInvoker(portTypeQName, wsdlLocation, node.getID(), this.getConfig().getConfiguration().getMessageBoxURL().toString(),
+					gfacURLString, this.config.getNotifier());
+		}
+		invoker.setup();
+		this.invokerMap.put(node, invoker);
+		invoker.setOperation(wsComponent.getOperationName());
+
+		// find inputs
+		List<DataPort> inputPorts = node.getInputPorts();
+		ODEClient odeClient = new ODEClient();
+		for (DataPort port : inputPorts) {
+			Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
+
+			/*
+			 * Need to override inputValue if it is odeClient
+			 */
+			if (port.getFromNode() instanceof InputNode) {
+				inputVal = WorkflowInputUtil.parseValue((WSComponentPort) port.getComponentPort(), (String) inputVal);
+			}
+
+			if (null == inputVal) {
+				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + node.getID());
+			}
+			if (port.getFromNode() instanceof EndForEachNode) {
+				inputVal = WorkflowInputUtil.parseValue((WSComponentPort) port.getComponentPort(), (String) inputVal);
+				// org.xmlpull.v1.builder.XmlElement inputElem = XMLUtil
+				// .stringToXmlElement3("<" + port.getName() + ">"
+				// + inputVal.toString() + "</" + port.getName()
+				// + ">");
+				// inputVal = inputElem;
+			}
+			invoker.setInput(port.getName(), inputVal);
+		}
+		invoker.invoke();
+	}
+
+	private void handleDynamicComponent(Node node) throws WorkflowException {
+		DynamicComponent dynamicComponent = (DynamicComponent) node.getComponent();
+		String className = dynamicComponent.getClassName();
+		String operationName = dynamicComponent.getOperationName();
+		URL implJarLocation = dynamicComponent.getImplJarLocation();
+		DynamicNode dynamicNode = (DynamicNode) node;
+		LinkedList<Object> inputs = new LinkedList<Object>();
+		List<DataPort> inputPorts = dynamicNode.getInputPorts();
+		for (DataPort dataPort : inputPorts) {
+			Object inputVal = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
+
+			/*
+			 * Set type after get input value, and override inputValue if output
+			 * type is array
+			 */
+			Node fromNode = dataPort.getFromNode();
+			QName type = null;
+			if (fromNode instanceof InputNode) {
+				type = BasicTypeMapping.STRING_QNAME;
+			} else if (fromNode instanceof ConstantNode) {
+				type = ((ConstantNode) fromNode).getType();
+			} else if ((dataPort.getFromPort() instanceof WSPort)
+					&& BasicTypeMapping.isArrayType(((WSPort) dataPort.getFromPort()).getComponentPort().getElement())) {
+				Invoker fromInvoker = this.invokerMap.get(fromNode);
+				inputVal = BasicTypeMapping.getOutputArray(XmlConstants.BUILDER.parseFragmentFromString(fromInvoker.getOutputs().toString()), dataPort
+						.getFromPort().getName(), BasicTypeMapping.getSimpleTypeIndex(((DataPort) dataPort.getFromPort()).getType()));
+				type = ((DataPort) dataPort.getFromPort()).getType();
+			} else {
+				type = ((DataPort) dataPort.getFromPort()).getType();
+			}
+
+			if (null == inputVal) {
+				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + node.getID());
+			}
+			inputs.add(BasicTypeMapping.getObjectOfType(type, inputVal));
+
+		}
+
+		DynamicInvoker dynamicInvoker = new DynamicInvoker(className, implJarLocation, operationName, inputs.toArray());
+		this.invokerMap.put(node, dynamicInvoker);
+		dynamicInvoker.setup();
+		dynamicInvoker.invoke();
+		node.setState(NodeExecutionState.FINISHED);
+	}
+
+	private void handleForEach(Node node) throws WorkflowException {
+		final ForEachNode forEachNode = (ForEachNode) node;
+		EndForEachNode endForEachNode = null;
+		Collection<Node> repeatNodes = node.getOutputPort(0).getToNodes();
+		// we will support only one for now
+		if (repeatNodes.size() != 1) {
+			throw new WorkFlowInterpreterException("Only one node allowed inside foreach");
+		}
+		Iterator<Node> iterator = repeatNodes.iterator();
+		if (iterator.hasNext()) {
+
+			Node middleNode = iterator.next();
+
+			// forEachNode should point to a WSNode and should have only one
+			// output
+			if ((!(middleNode instanceof WSNode)) && (!(middleNode instanceof SubWorkflowNode))) {
+				throw new WorkFlowInterpreterException("Encountered Node inside foreach that is not a WSNode" + middleNode);
+			} else if (middleNode instanceof SubWorkflowNode) {
+				/* Get the EndforEach Node of the Subworkflow */
+				Iterator<Node> subWorkflowOut = middleNode.getOutputPort(0).getToNodes().iterator();
+				while (subWorkflowOut.hasNext()) {
+					Node node2 = subWorkflowOut.next();
+					if (node2 instanceof EndForEachNode) {
+						endForEachNode = (EndForEachNode) node2;
+					}
+				}
+
+				final LinkedList<String> listOfValues = new LinkedList<String>();
+				InterpreterUtil.getInputsForForEachNode(forEachNode, listOfValues, this.invokerMap);
+				final Integer[] inputNumbers = InterpreterUtil.getNumberOfInputsForForEachNode(forEachNode, this.invokerMap);
+				Workflow workflow1 = ((SubWorkflowNode) middleNode).getWorkflow();
+				List<NodeImpl> nodes = workflow1.getGraph().getNodes();
+				List<Node> wsNodes = new ArrayList<Node>();
+				/* Take the List of WSNodes in the subworkflow */
+				for (NodeImpl subWorkflowNode : nodes) {
+					if (subWorkflowNode instanceof WSNode) {
+						wsNodes.add(subWorkflowNode);
+					}
+				}
+
+				for (int i = 0; i < wsNodes.size(); i++) {
+					final WSNode node1 = (WSNode) wsNodes.get(i);
+					SystemComponentInvoker systemInvoker = null;
+					List<DataPort> outputPorts1 = node1.getOutputPorts();
+					List<Node> endForEachNodes = new ArrayList<Node>();
+					for (DataPort port : outputPorts1) {
+						Iterator<Node> endForEachNodeItr1 = port.getToNodes().iterator();
+						while (endForEachNodeItr1.hasNext()) {
+							Node node2 = endForEachNodeItr1.next();
+							if (node2 instanceof EndForEachNode) {
+								endForEachNodes.add(node2);
+							} else if (node2 instanceof OutputNode) {
+								// intentionally left noop
+							} else {
+								throw new WorkFlowInterpreterException("Found More than one node inside foreach");
+							}
+
+						}
+					}
+					final List<Node> finalEndForEachNodes = endForEachNodes;
+
+					Iterator<Node> endForEachNodeItr1 = node1.getOutputPort(0).getToNodes().iterator();
+					while (endForEachNodeItr1.hasNext()) {
+						Node node2 = endForEachNodeItr1.next();
+						// Start reading input came for foreach node
+						int parallelRuns = listOfValues.size() * node1.getOutputPorts().size();
+						if (listOfValues.size() > 0) {
+							forEachNode.setState(NodeExecutionState.EXECUTING);
+							node1.setState(NodeExecutionState.EXECUTING);
+							List<DataPort> outputPorts = node1.getOutputPorts();
+							final AtomicInteger counter = new AtomicInteger();
+							for (Node endFor : endForEachNodes) {
+								systemInvoker = new SystemComponentInvoker();
+								this.invokerMap.put(endFor, systemInvoker);
+							}
+							final Map<Node, Invoker> finalMap = this.invokerMap;
+							new Thread() {
+								@Override
+								public void run() {
+									try {
+										runInThread(listOfValues, forEachNode, node1, finalEndForEachNodes, finalMap, counter, inputNumbers);
+									} catch (WorkflowException e) {
+
+										WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
+									}
+								}
+
+							}.start();
+
+							while (counter.intValue() < parallelRuns) {
+								try {
+									Thread.sleep(100);
+								} catch (InterruptedException e) {
+									Thread.currentThread().interrupt();
+								}
+
+							}
+							if (!(node2 instanceof OutputNode)) {
+								listOfValues.removeAll(listOfValues);
+								String output = (String) systemInvoker.getOutput(node1.getOutputPort(0).getName());
+								XmlElement xmlElement = XMLUtil.stringToXmlElement("<result>" + output + "</result>");
+								Iterator iterator1 = xmlElement.children().iterator();
+								while (iterator1.hasNext()) {
+									Object next1 = iterator1.next();
+									if (next1 instanceof XmlElement) {
+										listOfValues.add((String) ((XmlElement) next1).children().iterator().next());
+									}
+								}
+							}
+						}
+					}
+				}
+				// we have finished execution so end foreach is finished
+				// todo this has to be done in a separate thread
+				endForEachNode.setState(NodeExecutionState.FINISHED);
+				middleNode.setState(NodeExecutionState.FINISHED);
+				node.setState(NodeExecutionState.FINISHED);
+
+			} else {
+
+				// First node after foreach should end with EndForEachNode
+				List<DataPort> outputPorts1 = middleNode.getOutputPorts();
+				List<Node> endForEachNodes = new ArrayList<Node>();
+				for (DataPort port : outputPorts1) {
+					Iterator<Node> endForEachNodeItr1 = port.getToNodes().iterator();
+					while (endForEachNodeItr1.hasNext()) {
+						Node node2 = endForEachNodeItr1.next();
+						if (node2 instanceof EndForEachNode) {
+							endForEachNodes.add(node2);
+						} else if (node2 instanceof OutputNode) {
+							// intentionally left noop
+						} else {
+							throw new WorkFlowInterpreterException("Found More than one node inside foreach");
+						}
+
+					}
+				}
+				final List<Node> finalEndForEachNodes = endForEachNodes;
+				final Node foreachWSNode = middleNode;
+				final LinkedList<String> listOfValues = new LinkedList<String>();
+
+				// Start reading input came for foreach node
+				InterpreterUtil.getInputsForForEachNode(forEachNode, listOfValues, this.invokerMap);
+				final Integer[] inputNumbers = InterpreterUtil.getNumberOfInputsForForEachNode(forEachNode, this.invokerMap);
+
+				int parallelRuns = createInputValues(listOfValues, inputNumbers).size() * outputPorts1.size();
+				if (listOfValues.size() > 0) {
+
+					forEachNode.setState(NodeExecutionState.EXECUTING);
+					foreachWSNode.setState(NodeExecutionState.EXECUTING);
+					List<DataPort> outputPorts = middleNode.getOutputPorts();
+					final AtomicInteger counter = new AtomicInteger();
+					for (Node endFor : endForEachNodes) {
+						final SystemComponentInvoker systemInvoker = new SystemComponentInvoker();
+						this.invokerMap.put(endFor, systemInvoker);
+					}
+					final Map<Node, Invoker> finalInvokerMap = this.invokerMap;
+
+					new Thread() {
+						@Override
+						public void run() {
+							try {
+								runInThread(listOfValues, forEachNode, foreachWSNode, finalEndForEachNodes, finalInvokerMap, counter, inputNumbers);
+							} catch (WorkflowException e) {
+								WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
+							}
+						}
+
+					}.start();
+					while (counter.intValue() < parallelRuns) {
+						try {
+							Thread.sleep(100);
+						} catch (InterruptedException e) {
+							Thread.currentThread().interrupt();
+						}
+
+					}
+					// we have finished execution so end foreach is finished
+					// todo this has to be done in a separate thread
+					middleNode.setState(NodeExecutionState.FINISHED);
+					for (Node endForEach : endForEachNodes) {
+						endForEach.setState(NodeExecutionState.FINISHED);
+					}
+				} else {
+					throw new WorkFlowInterpreterException("No array values found for foreach");
+				}
+
+			}
+		}
+	}
+
+	private void handleIf(Node node) throws WorkflowException {
+		IfNode ifNode = (IfNode) node;
+
+		/*
+		 * Get all input to check condition
+		 */
+		String booleanExpression = ifNode.getXPath();
+		if (booleanExpression == null) {
+			throw new WorkFlowInterpreterException("XPath for if cannot be null");
+		}
+
+		List<DataPort> inputPorts = node.getInputPorts();
+		int i = 0;
+		for (DataPort port : inputPorts) {
+			Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
+
+			if (null == inputVal) {
+				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + node.getID());
+			}
+
+			booleanExpression = booleanExpression.replaceAll("\\$" + i, "'" + inputVal + "'");
+		}
+
+		// Now the XPath expression
+		try {
+			XPathFactory xpathFact = XPathFactory.newInstance();
+			XPath xpath = xpathFact.newXPath();
+			Boolean result = (Boolean) xpath.evaluate(booleanExpression, booleanExpression, XPathConstants.BOOLEAN);
+
+			/*
+			 * Set control port to make execution flow continue according to
+			 * condition
+			 */
+			for (ControlPort controlPort : node.getControlOutPorts()) {
+				if (controlPort.getName().equals(IfComponent.TRUE_PORT_NAME)) {
+					controlPort.setConditionMet(result.booleanValue());
+				} else if (controlPort.getName().equals(IfComponent.FALSE_PORT_NAME)) {
+					controlPort.setConditionMet(!result.booleanValue());
+				}
+			}
+
+			node.setState(NodeExecutionState.FINISHED);
+
+		} catch (XPathExpressionException e) {
+			throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
+		}
+	}
+
+	private void handleEndIf(Node node) throws WorkflowException {
+		EndifNode endIfNode = (EndifNode) node;
+		SystemComponentInvoker invoker = new SystemComponentInvoker();
+
+		List<DataPort> ports = endIfNode.getOutputPorts();
+		for (int outputPortIndex = 0, inputPortIndex = 0; outputPortIndex < ports.size(); outputPortIndex++, inputPortIndex = inputPortIndex + 2) {
+
+			Object inputVal = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex), this.invokerMap);
+
+			Object inputVal2 = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex + 1), this.invokerMap);
+
+			if ((inputVal == null && inputVal2 == null) || (inputVal != null && inputVal2 != null)) {
+				throw new WorkFlowInterpreterException("EndIf gets wrong input number" + "Port:" + inputPortIndex + " and " + (inputPortIndex + 1));
+			}
+
+			Object value = inputVal != null ? inputVal : inputVal2;
+			invoker.addOutput(endIfNode.getOutputPort(outputPortIndex).getID(), value);
+		}
+
+		this.invokerMap.put(node, invoker);
+
+		node.setState(NodeExecutionState.FINISHED);
+	}
+
+	private Invoker createInvokerForEachSingleWSNode(Node foreachWSNode, String gfacURLString, WSComponent wsComponent) throws WorkflowException {
+		Invoker invoker;
+		String wsdlLocation = InterpreterUtil.getEPR((WSNode) foreachWSNode);
+		QName portTypeQName = wsComponent.getPortTypeQName();
+		if (null == wsdlLocation) {
+            // WorkflowInterpreter is no longer using gfac in service mode. we only support embedded mode.
+//			if (gfacURLString.startsWith("https")) {
+//				LeadContextHeader leadCtxHeader = null;
+//				try {
+//					leadCtxHeader = XBayaUtil.buildLeadContextHeader(this.getWorkflow(), this.getConfig().getConfiguration(), new MonitorConfiguration(this
+//							.getConfig().getConfiguration().getBrokerURL(), this.config.getTopic(), true, this.getConfig().getConfiguration()
+//							.getMessageBoxURL()), foreachWSNode.getID(), null);
+//				} catch (URISyntaxException e) {
+//					throw new WorkflowException(e);
+//				}
+//				invoker = new WorkflowInvokerWrapperForGFacInvoker(portTypeQName, gfacURLString, this.getConfig().getConfiguration().getMessageBoxURL()
+//						.toString(), leadCtxHeader, this.config.getNotifier().createServiceNotificationSender(foreachWSNode.getID()));
+//			} else {
+                if (this.config.isGfacEmbeddedMode()) {
+					invoker = new EmbeddedGFacInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(((WSNode)foreachWSNode).getComponent().getWSDL()), foreachWSNode.getID(),
+							this.config.getMessageBoxURL().toASCIIString(), this.config.getMessageBrokerURL().toASCIIString(), this.config.getNotifier(),
+							this.config.getTopic(), this.config.getAiravataAPI(), portTypeQName.getLocalPart(), this.config.getConfiguration());
+				} else {
+					invoker = new GenericInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(((WSNode)foreachWSNode).getComponent().getWSDL()), foreachWSNode.getID(),
+							this.config.getMessageBoxURL().toASCIIString(), gfacURLString, this.config.getNotifier());
+				}
+//			}
+
+		} else {
+			if (wsdlLocation.endsWith("/")) {
+				wsdlLocation = wsdlLocation.substring(0, wsdlLocation.length() - 1);
+			}
+			if (!wsdlLocation.endsWith("?wsdl")) {
+				wsdlLocation += "?wsdl";
+			}
+			invoker = new GenericInvoker(portTypeQName, wsdlLocation, foreachWSNode.getID(), this.getConfig().getConfiguration().getMessageBoxURL().toString(),
+					gfacURLString, this.config.getNotifier());
+		}
+		return invoker;
+	}
+
+	private void runInThread(final LinkedList<String> listOfValues, ForEachNode forEachNode, final Node middleNode, List<Node> endForEachNodes,
+			Map<Node, Invoker> tempInvoker, AtomicInteger counter, final Integer[] inputNumber) throws WorkflowException {
+
+		final LinkedList<Invoker> invokerList = new LinkedList<Invoker>();
+
+		if (inputNumber.length > 1) {
+			List<String> inputValues = createInputValues(listOfValues, inputNumber);
+			for (final Iterator<String> iterator = inputValues.iterator(); iterator.hasNext();) {
+				final String gfacURLString = this.getConfig().getConfiguration().getGFacURL().toString();
+				final String input = iterator.next();
+				WSComponent wsComponent = (WSComponent) middleNode.getComponent();
+				final Invoker invoker2 = createInvokerForEachSingleWSNode(middleNode, gfacURLString, wsComponent);
+				invokerList.add(invoker2);
+
+				new Thread() {
+					@Override
+					public void run() {
+						try {
+							getInvoker(middleNode, invoker2);
+							invokeGFacService(listOfValues, middleNode, inputNumber, input, invoker2);
+
+						} catch (WorkflowException e) {
+							WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
+						}
+					}
+
+				}.start();
+
+				try {
+					Thread.sleep(3000);
+				} catch (InterruptedException e) {
+					WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
+				}
+			}
+		} else {
+			Invoker invoker = null;
+			for (Iterator<String> iterator = listOfValues.iterator(); iterator.hasNext();) {
+				String input = iterator.next();
+				final String gfacURLString = this.getConfig().getConfiguration().getGFacURL().toString();
+				WSComponent wsComponent = (WSComponent) middleNode.getComponent();
+				invoker = createInvokerForEachSingleWSNode(middleNode, gfacURLString, wsComponent);
+				invokerList.add(invoker);
+				getInvoker(middleNode, invoker);
+
+				// find inputs
+				List<DataPort> inputPorts = middleNode.getInputPorts();
+				for (DataPort port : inputPorts) {
+					Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
+
+					/*
+					 * Handle ForEachNode
+					 */
+					Node fromNode = port.getFromNode();
+					// if (fromNode instanceof ForEachNode) {
+					inputVal = WorkflowInputUtil.parseValue((WSComponentPort) port.getComponentPort(), input);
+					// }
+
+					if (null == inputVal) {
+						throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + middleNode.getID());
+					}
+					invoker.setInput(port.getName(), inputVal);
+				}
+				invoker.invoke();
+			}
+		}
+
+		// String arrayElementName = foreachWSNode.getOperationName() +
+		// "ArrayResponse";
+		// String outputStr = "<" + arrayElementName + ">";
+		// invokerMap size and endForEachNodes size can be difference
+		// because we can create endForEachNode with n number of input/output
+		// ports so always have to use
+		// middleNode.getOutputPorts when iterate
+		String[] outputStr = new String[middleNode.getOutputPorts().size()];
+		int i = 0;
+		for (DataPort port : middleNode.getOutputPorts()) {
+			String outputString = "";
+			for (Iterator<Invoker> iterator = invokerList.iterator(); iterator.hasNext();) {
+				Invoker workflowInvoker = iterator.next();
+
+				// /
+				Object output = workflowInvoker.getOutput(port.getName());
+				if (output instanceof org.xmlpull.v1.builder.XmlElement) {
+					org.xmlpull.v1.builder.XmlElement element = (org.xmlpull.v1.builder.XmlElement) ((org.xmlpull.v1.builder.XmlElement) output).children()
+							.next();
+					outputString += "\n" + XMLUtil.xmlElementToString(element);
+				} else {
+					outputString += "\n<value>" + output + "</value>";
+				}
+				counter.incrementAndGet();
+			}
+			outputStr[i] = outputString;
+			System.out.println(outputStr[i]);
+			i++;
+		}
+		i = 0;
+		// outputStr += "\n</" + arrayElementName + ">";
+		int outputPortIndex = 0;
+		for (DataPort port : middleNode.getOutputPorts()) {
+			for (Node endForEachNode : endForEachNodes) {
+				if (tempInvoker.get(endForEachNode) != null) {
+					if (!(endForEachNode instanceof OutputNode)) {
+						((SystemComponentInvoker) tempInvoker.get(endForEachNode)).addOutput(port.getName(), outputStr[i]);
+					}
+				}
+				outputPortIndex++;
+			}
+			i++;
+		}
+		forEachNode.setState(NodeExecutionState.FINISHED);
+	}
+
+	private void invokeGFacService(LinkedList<String> listOfValues, Node middleNode, Integer[] inputNumber, String input, Invoker invoker)
+			throws WorkflowException {
+
+		// find inputs
+		List<DataPort> inputPorts = middleNode.getInputPorts();
+		String[] inputArray = null;
+		if (inputNumber.length == 1) {
+			inputArray = listOfValues.toArray(new String[listOfValues.size()]);
+		} else {
+			inputArray = StringUtil.getElementsFromString(input);
+		}
+		int index = 0;
+		for (DataPort port : inputPorts) {
+			Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
+			/*
+			 * Handle ForEachNode
+			 */
+			Node fromNode = port.getFromNode();
+			if (fromNode instanceof ForEachNode) {
+				inputVal = inputArray[index++];
+			}
+
+			if (null == inputVal) {
+				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + middleNode.getID());
+			}
+			invoker.setInput(port.getName(), inputVal);
+		}
+		invoker.invoke();
+
+	}
+
+	private Invoker getInvoker(Node middleNode, Invoker invoker) throws WorkflowException {
+		if (middleNode instanceof WSNode) {
+			WSComponent wsComponent = (WSComponent) middleNode.getComponent();
+			invoker.setup();
+			invoker.setOperation(wsComponent.getOperationName());
+		} else if (middleNode instanceof SubWorkflowNode) {
+			// ((SubWorkflowNode) middleNode).getWorkflow();
+			// this.config.getConfiguration();
+			// TODO : Need to create a invoker!
+			// new WorkflowInterpreter()
+		} else {
+			throw new WorkflowRuntimeException("Only Web services and subworkflows are supported for For-Each : Found : " + middleNode);
+		}
+		return invoker;
+	}
+
+	private List<String> createInputValues(LinkedList<String> listOfValues, Integer[] inputNumbers) throws WorkflowException {
+		List<String> inputValues = null;
+		try {
+			inputValues = new ArrayList<String>();
+			if (inputNumbers.length == 1) {
+				return listOfValues;
+			}
+			if (this.config.isRunWithCrossProduct()) {
+				for (int i = 0; i < inputNumbers[0]; i++) {
+					for (int j = 0; j < inputNumbers[1]; j++) {
+						inputValues.add(listOfValues.get(i) + StringUtil.DELIMETER + listOfValues.get(inputNumbers[0] + j));
+					}
+				}
+
+			} else {
+				List<String[]> inputList = new ArrayList<String[]>();
+				int startIndex = 0;
+				for (int input = 0; input < inputNumbers.length; input++) {
+					String[] inputArray = new String[inputNumbers[input]];
+					for (int travers = 0; travers < inputNumbers[input]; travers++) {
+						inputArray[travers] = listOfValues.get(startIndex++);
+					}
+					inputList.add(inputArray);
+				}
+				int inputSize = 1;
+				for (String[] inputArrays : inputList) {
+					if (inputArrays.length != 1) {
+						inputSize = inputArrays.length;
+					}
+				}
+				List<String[]> finalInputList = new ArrayList<String[]>();
+				for (String[] inputArrays : inputList) {
+					if (inputArrays.length == 1) {
+						String[] fullArray = new String[inputSize];
+						for (int i = 0; i < fullArray.length; i++) {
+							fullArray[i] = inputArrays[0];
+						}
+						finalInputList.add(fullArray);
+					} else {
+						finalInputList.add(inputArrays);
+					}
+				}
+				for (int i = 0; i < inputSize; i++) {
+					String inputValue = "";
+					for (String[] array : finalInputList) {
+						inputValue = inputValue + StringUtil.DELIMETER + StringUtil.quoteString(array[i]);
+					}
+					inputValue = inputValue.replaceFirst(StringUtil.DELIMETER , "");
+					inputValues.add(inputValue);
+				}
+
+			}
+		} catch (ArrayIndexOutOfBoundsException e) {
+			throw new WorkflowException("Wrong number of Inputs to For EachNode");
+		}
+		return inputValues;
+	}
+
+	private ArrayList<Node> getReadyOutputNodesDynamically() {
+		ArrayList<Node> list = new ArrayList<Node>();
+		List<NodeImpl> nodes = this.getGraph().getNodes();
+		for (Node node : nodes) {
+			if (node instanceof OutputNode && node.getState()==NodeExecutionState.WAITING
+					&& node.getInputPort(0).getFromNode().getState()== NodeExecutionState.FINISHED) {
+
+				list.add(node);
+			}
+		}
+		return list;
+	}
+
+	private int getRemainNodesDynamically() {
+		return InterpreterUtil.getWaitingNodeCountDynamically(this.getGraph()) + InterpreterUtil.getRunningNodeCountDynamically(this.getGraph());
+	}
+
+	private ArrayList<Node> getInputNodesDynamically() {
+		return getInputNodes(this.getWorkflow());
+	}
+
+	private ArrayList<Node> getInputNodes(Workflow wf) {
+		ArrayList<Node> list = new ArrayList<Node>();
+		List<NodeImpl> nodes = wf.getGraph().getNodes();
+		for (Node node : nodes) {
+			String name = node.getComponent().getName();
+			if (InputComponent.NAME.equals(name) || ConstantComponent.NAME.equals(name) || S3InputComponent.NAME.equals(name)) {
+				list.add(node);
+			}
+		}
+		return list;
+	}
+
+	private ArrayList<Node> getReadyNodesDynamically() {
+		ArrayList<Node> list = new ArrayList<Node>();
+		ArrayList<Node> waiting = InterpreterUtil.getWaitingNodesDynamically(this.getGraph());
+		ArrayList<Node> finishedNodes = InterpreterUtil.getFinishedNodesDynamically(this.getGraph());
+		for (Node node : waiting) {
+			Component component = node.getComponent();
+			if (component instanceof WSComponent
+					|| component instanceof DynamicComponent
+					|| component instanceof SubWorkflowComponent
+					|| component instanceof ForEachComponent
+					|| component instanceof EndForEachComponent
+					|| component instanceof IfComponent
+					|| component instanceof InstanceComponent) {
+
+				/*
+				 * Check for control ports from other node
+				 */
+				ControlPort control = node.getControlInPort();
+				boolean controlDone = true;
+				if (control != null) {
+					for (EdgeImpl edge : control.getEdges()) {
+						controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode())
+						// amazon component use condition met to check
+						// whether the control port is done
+						// FIXME I changed the "||" to a "&&" in the following since thats the only this
+						// that makes sense and if anyone found a scenario it should be otherwise pls fix
+								|| ((ControlPort) edge.getFromPort()).isConditionMet());
+					}
+				}
+
+				/*
+				 * Check for input ports
+				 */
+				List<DataPort> inputPorts = node.getInputPorts();
+				boolean inputsDone = true;
+				for (DataPort dataPort : inputPorts) {
+					inputsDone = inputsDone && finishedNodes.contains(dataPort.getFromNode());
+				}
+				if (inputsDone && controlDone) {
+					list.add(node);
+				}
+			} else if (component instanceof EndifComponent) {
+				/*
+				 * EndIfComponent can run if number of input equals to number of
+				 * output that it expects
+				 */
+				int expectedOutput = node.getOutputPorts().size();
+				int actualInput = 0;
+				List<DataPort> inputPorts = node.getInputPorts();
+				for (DataPort dataPort : inputPorts) {
+					if (finishedNodes.contains(dataPort.getFromNode()))
+						actualInput++;
+				}
+
+				if (expectedOutput == actualInput) {
+					list.add(node);
+				}
+			} else if (component instanceof TerminateInstanceComponent) {
+				/*
+				 * All node connected to controlIn port must be done
+				 */
+				ControlPort control = node.getControlInPort();
+				boolean controlDone = true;
+				if (control != null) {
+					for (EdgeImpl edge : control.getEdges()) {
+						controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
+					}
+				}
+
+				/*
+				 * Check for input ports
+				 */
+				List<DataPort> inputPorts = node.getInputPorts();
+				boolean inputsDone = true;
+				for (DataPort dataPort : inputPorts) {
+					inputsDone = inputsDone && finishedNodes.contains(dataPort.getFromNode());
+				}
+				if (inputsDone && controlDone) {
+					list.add(node);
+				}
+
+			} else if (InputComponent.NAME.equals(component.getName())
+					|| DifferedInputComponent.NAME.equals(component.getName())
+					|| S3InputComponent.NAME.equals(component.getName())
+					|| OutputComponent.NAME.equals(component.getName())
+					|| MemoComponent.NAME.equals(component.getName())
+					|| component instanceof EndDoWhileComponent) {
+				// no op
+			} else if (component instanceof DoWhileComponent) {
+				ControlPort control = node.getControlInPort();
+				boolean controlDone = true;
+				if (control != null) {
+					for (EdgeImpl edge : control.getEdges()) {
+						controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
+					}
+				}
+
+				if (controlDone) {
+					list.add(node);
+				}
+			} else {
+				throw new WorkFlowInterpreterException("Component Not handled :" + component.getName());
+			}
+		}
+
+		notifyViaInteractor(WorkflowExecutionMessage.HANDLE_DEPENDENT_NODES_DIFFERED_INPUTS, this.getGraph());
+
+		return list;
+
+	}
+
+	public Workflow getWorkflow() {
+		return this.config.getWorkflow();
+	}
+
+	public void setProvenanceWriter(PredicatedTaskRunner provenanceWriter) {
+		this.provenanceWriter = provenanceWriter;
+	}
+
+	public WorkflowInterpreterConfiguration getConfig() {
+		return config;
+	}
+
+	public void setConfig(WorkflowInterpreterConfiguration config) {
+		this.config = config;
+	}
+
+	private WSGraph getGraph() {
+		return this.getWorkflow().getGraph();
+	}
+
+	private ArrayList<Node> getFinishedNodesDynamically() {
+		return this.getNodesWithState(NodeExecutionState.FINISHED);
+	}
+
+	private ArrayList<Node> getWaitingNodesDynamically() {
+		return this.getNodesWithState(NodeExecutionState.WAITING);
+	}
+
+	private ArrayList<Node> getNodesWithState(NodeExecutionState state) {
+		ArrayList<Node> list = new ArrayList<Node>();
+		List<NodeImpl> nodes = getGraph().getNodes();
+		for (Node node : nodes) {
+			if (state==node.getState()) {
+				list.add(node);
+			}
+		}
+		return list;
+	}
+
+    public static void setWorkflowInterpreterConfigurationThreadLocal(WorkflowInterpreterConfiguration workflowInterpreterConfiguration) {
+        WorkflowInterpreter.workflowInterpreterConfigurationThreadLocal.set(workflowInterpreterConfiguration);
+    }
+
+    public static WorkflowInterpreterConfiguration getWorkflowInterpreterConfiguration() {
+        return workflowInterpreterConfigurationThreadLocal.get();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java
new file mode 100644
index 0000000..e21c18c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java
@@ -0,0 +1,233 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.jython.lib.NotificationSender;
+import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+
+import java.net.URI;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class WorkflowInterpreterConfiguration {
+//	public static final int GUI_MODE = 1;
+//	public static final int SERVER_MODE = 2;
+//	
+	private URI messageBoxURL;
+	private URI messageBrokerURL;
+	private AiravataAPI registry;
+	private XBayaConfiguration configuration;
+	private XBayaGUI gui;
+	private Monitor monitor;
+	private boolean offline=false;
+	private boolean runWithCrossProduct=false;
+	private Workflow workflow;
+	private WorkflowNotifiable notifier;
+	private String topic;
+    private boolean gfacEmbeddedMode = false;
+	private Boolean actOnProvenance = null;
+	private boolean subWorkflow;
+	private boolean testMode=false;
+    private AiravataAPI airavataAPI;
+    private String awsAccessKey;
+    private String awsSecretKey;
+
+	public WorkflowInterpreterConfiguration(Workflow workflow,
+                                            String topic,
+                                            URI messageBoxURL,
+                                            URI messageBrokerURL,
+                                            AiravataAPI registry,
+                                            XBayaConfiguration configuration,
+                                            XBayaGUI gui,Monitor monitor) {
+		this(workflow, topic, messageBoxURL,messageBrokerURL,registry,configuration,gui,monitor, true);
+	}
+	
+    public WorkflowInterpreterConfiguration(Workflow workflow,
+                                            String topic,
+                                            URI messageBoxURL,
+                                            URI messageBrokerURL,
+                                            AiravataAPI airavataAPI,
+                                            XBayaConfiguration configuration,
+                                            XBayaGUI gui,
+                                            Monitor monitor,
+                                            boolean offline) {
+        this.messageBoxURL = messageBoxURL;
+        this.messageBrokerURL = messageBrokerURL;
+        this.airavataAPI = airavataAPI;
+        this.configuration = configuration;
+        this.gui = gui;
+        this.monitor = monitor;
+        this.offline = offline;
+        this.workflow = workflow;
+        this.topic = topic;
+    }
+	
+	public URI getMessageBoxURL() {
+		return messageBoxURL;
+	}
+	public void setMessageBoxURL(URI messageBoxURL) {
+		this.messageBoxURL = messageBoxURL;
+	}
+	public URI getMessageBrokerURL() {
+		return messageBrokerURL;
+	}
+	public void setMessageBrokerURL(URI messageBrokerURL) {
+		this.messageBrokerURL = messageBrokerURL;
+	}
+	public AiravataAPI getRegistry() {
+		return registry;
+	}
+	public void setRegistry(AiravataAPI registry) {
+		this.registry = registry;
+	}
+	public XBayaConfiguration getConfiguration() {
+		return configuration;
+	}
+	public void setConfiguration(XBayaConfiguration configuration) {
+		this.configuration = configuration;
+	}
+	public XBayaGUI getGUI() {
+		return gui;
+	}
+	public void setGUI(XBayaGUI gui) {
+		this.gui = gui;
+	}
+	public Monitor getMonitor() {
+		return monitor;
+	}
+	public void setMonitor(Monitor monitor) {
+		this.monitor = monitor;
+	}
+
+	public boolean isOffline() {
+		return offline;
+	}
+
+	public void setOffline(boolean offline) {
+		this.offline = offline;
+	}
+
+	public boolean isRunWithCrossProduct() {
+		return runWithCrossProduct;
+	}
+
+	public void setRunWithCrossProduct(boolean runWithCrossProduct) {
+		this.runWithCrossProduct = runWithCrossProduct;
+	}
+
+	public Workflow getWorkflow() {
+		return workflow;
+	}
+
+	public void setWorkflow(Workflow workflow) {
+		this.workflow = workflow;
+	}
+
+	public WorkflowNotifiable getNotifier() {
+		if (notifier==null){
+			notifier=new NotificationSender(getMessageBrokerURL(), getTopic());
+		}
+		return notifier;
+	}
+
+	public void validateNotifier(){
+		getNotifier();
+	}
+	
+	public String getTopic() {
+		return topic;
+	}
+
+	public void setTopic(String topic) {
+		this.topic = topic;
+	}
+
+//	public int getMode() {
+//		return getMonitor()==null? SERVER_MODE:GUI_MODE;
+//	}
+
+	public boolean isGfacEmbeddedMode() {
+		return gfacEmbeddedMode;
+	}
+
+	public void setGfacEmbeddedMode(boolean gfacEmbeddedMode) {
+		this.gfacEmbeddedMode = gfacEmbeddedMode;
+	}
+
+	public Boolean isActOnProvenance() {
+		return actOnProvenance;
+	}
+
+	public void setActOnProvenance(Boolean actOnProvenance) {
+		this.actOnProvenance = actOnProvenance;
+	}
+
+	public boolean isSubWorkflow() {
+		return subWorkflow;
+	}
+
+	public void setSubWorkflow(boolean subWorkflow) {
+		this.subWorkflow = subWorkflow;
+	}
+	
+	public void setNotifier(WorkflowNotifiable notifier) {
+		this.notifier = notifier;
+		setTestMode(notifier instanceof StandaloneNotificationSender);
+	}
+
+	public boolean isTestMode() {
+		return testMode;
+	}
+
+	private void setTestMode(boolean testMode) {
+		this.testMode = testMode;
+	}
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public String getAwsAccessKey() {
+        return awsAccessKey;
+    }
+
+    public void setAwsAccessKey(String awsAccessKey) {
+        this.awsAccessKey = awsAccessKey;
+    }
+
+    public String getAwsSecretKey() {
+        return awsSecretKey;
+    }
+
+    public void setAwsSecretKey(String awsSecretKey) {
+        this.awsSecretKey = awsSecretKey;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
new file mode 100644
index 0000000..df39ef8
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
@@ -0,0 +1,94 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+
+public interface WorkflowInterpreterInteractor {
+	public boolean notify(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data);
+	public Object retrieveData(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data) throws Exception;
+	public void pauseExecution(WorkflowInterpreterConfiguration config);
+	public void resumeExecution(WorkflowInterpreterConfiguration config);
+	public void terminateExecution(WorkflowInterpreterConfiguration config);
+	
+	public boolean isExecutionPaused(WorkflowInterpreterConfiguration config);
+	public boolean isExecutionTerminated(WorkflowInterpreterConfiguration config);
+	
+	public static class TaskNotification{
+		String messageTitle;
+		String message;
+		String messageId;
+		public TaskNotification(String messageTitle, String message, String messageId) {
+			this.messageTitle=messageTitle;
+			this.message=message;
+			this.messageId=messageId;
+		}
+	}
+	
+//	public static class WorkflowExecutionData{
+//		Workflow workflow;
+//		String topic;
+//		WorkflowInterpreter currentInterpreter;
+//		public WorkflowExecutionData(Workflow workflow,String topic, WorkflowInterpreter currentInterpreter) {
+//			this.workflow=workflow;
+//			this.topic=topic;
+//			this.currentInterpreter=currentInterpreter;
+//		}
+//	}
+//	
+//	public static class WSNodeData{
+//		WSNode wsNode;
+//		WorkflowInterpreter currentInterpreter;
+//		public WSNodeData(WSNode wsNode, WorkflowInterpreter currentInterpreter) {
+//			this.wsNode=wsNode;
+//			this.currentInterpreter=currentInterpreter;
+//		}
+//	}
+//	
+//	public static class GFacInvokerData{
+//		QName portTypeQName;
+//		WsdlDefinitions wsdl;
+//		String nodeID;
+//		String messageBoxURL;
+//        String gfacURL;
+//        WorkflowNotifiable notifier;
+//        String topic;
+//        AiravataRegistry2 registry;
+//        String serviceName;
+//        XBayaConfiguration config;
+//        boolean embeddedMode;
+//        
+//        public GFacInvokerData(boolean embeddedMode, QName portTypeQName, WsdlDefinitions wsdl, String nodeID, String messageBoxURL,
+//                String gfacURL, WorkflowNotifiable notifier,String topic,AiravataRegistry2 registry,String serviceName,XBayaConfiguration config) {
+//        	this.embeddedMode=embeddedMode;
+//        	this.portTypeQName = portTypeQName;
+//        	this.wsdl = wsdl;
+//        	this.nodeID = nodeID;
+//        	this.messageBoxURL = messageBoxURL;
+//        	this.gfacURL = gfacURL;
+//        	this.notifier = notifier;
+//        	this.topic = topic;
+//        	this.registry = registry;
+//        	this.serviceName = serviceName;
+//        	this.config = config;
+//		}
+//	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInvoker.java
new file mode 100644
index 0000000..2e08ec9
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInvoker.java
@@ -0,0 +1,66 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+public class WorkflowInterpreterInvoker {
+    // implements HeaderConstants {
+    //
+    // public void invoke(Workflow workflow, String serverURL, String userName, String password, String topic)
+    // throws AxisFault, RemoteException, ComponentException {
+    //
+    // String workflowAsString = workflow.toXMLText();
+    // NameValue[] configurations = new NameValue[6];
+    // configurations[0] = new NameValue();
+    // configurations[0].setName(HEADER_ELEMENT_GFAC);
+    // configurations[0].setValue(XBayaConstants.DEFAULT_GFAC_URL.toString());
+    // configurations[1] = new NameValue();
+    // configurations[1].setName(HEADER_ELEMENT_REGISTRY);
+    // configurations[2] = new NameValue();
+    // configurations[2].setName(HEADER_ELEMENT_PROXYSERVER);
+    // configurations[2].setValue(XBayaConstants.DEFAULT_MYPROXY_SERVER);
+    //
+    // configurations[3] = new NameValue();
+    // configurations[3].setName(HEADER_ELEMENT_MSGBOX);
+    // configurations[3].setValue(XBayaConstants.DEFAULT_MESSAGE_BOX_URL.toString());
+    //
+    // configurations[4] = new NameValue();
+    // configurations[4].setName(HEADER_ELEMENT_DSC);
+    // configurations[4].setValue(XBayaConstants.DEFAULT_DSC_URL.toString());
+    //
+    // configurations[5] = new NameValue();
+    // configurations[5].setName(HEADER_ELEMENT_BROKER);
+    // configurations[5].setValue(XBayaConstants.DEFAULT_BROKER_URL.toString());
+    //
+    // LinkedList<NameValue> nameValPairsList = new LinkedList<NameValue>();
+    // List<InputNode> wfInputs = new ODEClient().getInputNodes(workflow);
+    // for (InputNode node : wfInputs) {
+    // NameValue nameValue = new NameValue();
+    // nameValue.setName(node.getName());
+    // nameValue.setValue(node.getDefaultValue().toString());
+    // }
+    //
+    // new WorkflowInterpretorStub(serverURL).launchWorkflow(workflowAsString, topic, password, userName,
+    // nameValPairsList.toArray(new NameValue[0]), configurations);
+    //
+    // }
+
+}
\ No newline at end of file


[14/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
deleted file mode 100644
index 267b838..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
+++ /dev/null
@@ -1,686 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) und= nuer one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.xbaya.invoker;
-
-import java.io.File;
-import java.io.StringReader;
-import java.net.URL;
-import java.util.*;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
-import org.apache.airavata.commons.gfac.type.ActualParameter;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.credential.store.store.CredentialReaderFactory;
-import org.apache.airavata.gfac.Constants;
-import org.apache.airavata.gfac.GFacConfiguration;
-import org.apache.airavata.gfac.RequestData;
-import org.apache.airavata.gfac.context.ApplicationContext;
-import org.apache.airavata.gfac.context.JobExecutionContext;
-import org.apache.airavata.gfac.context.MessageContext;
-import org.apache.airavata.gfac.context.security.GSISecurityContext;
-import org.apache.airavata.gfac.context.security.SSHSecurityContext;
-import org.apache.airavata.gfac.cpi.GFacImpl;
-import org.apache.airavata.gfac.ec2.AmazonSecurityContext;
-import org.apache.airavata.gfac.scheduler.HostScheduler;
-import org.apache.airavata.gfac.utils.GFacUtils;
-import org.apache.airavata.gsi.ssh.api.Cluster;
-import org.apache.airavata.gsi.ssh.api.SSHApiException;
-import org.apache.airavata.gsi.ssh.api.ServerInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
-import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.impl.PBSCluster;
-import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;
-import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
-import org.apache.airavata.gsi.ssh.util.CommonUtils;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.schemas.gfac.*;
-import org.apache.airavata.schemas.wec.ContextHeaderDocument;
-import org.apache.airavata.schemas.wec.SecurityContextDocument;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
-import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.impl.WSIFMessageElement;
-import xsul.xwsif_runtime.WSIFClient;
-
-public class EmbeddedGFacInvoker implements Invoker {
-
-    private static final Logger logger = LoggerFactory.getLogger(EmbeddedGFacInvoker.class);
-
-    private String nodeID;
-
-    private QName portTypeQName;
-
-    private String wsdlLocation;
-
-    private String serviceInformation;
-
-    private String messageBoxURL;
-
-    private String gfacURL;
-
-    private Invoker invoker;
-
-    private XBayaConfiguration configuration;
-
-
-    private Boolean result;
-
-    private ServiceNotifiable notifier;
-
-//    private AiravataRegistry2 registry;
-
-    private String topic;
-
-    private String serviceName;
-
-    private AiravataAPI airavataAPI;
-    /**
-     * used for notification
-     */
-    private List<Object> inputValues = new ArrayList<Object>();
-
-    /**
-     * used for notification
-     */
-    private List<String> inputNames = new ArrayList<String>();
-
-    boolean failerSent;
-
-    private WsdlDefinitions wsdlDefinitionObject;
-
-    private Object outPut;
-
-    Map<String, Object> actualParameters = new LinkedHashMap<String, Object>();
-
-    /**
-     * Creates an InvokerWithNotification.
-     *
-     * @param portTypeQName
-     * @param wsdlLocation  The URL of WSDL of the service to invoke
-     * @param nodeID        The ID of the service
-     * @param notifier      The notification sender
-     */
-    public EmbeddedGFacInvoker(QName portTypeQName, String wsdlLocation, String nodeID, WorkflowNotifiable notifier) {
-        this(portTypeQName, wsdlLocation, nodeID, null, notifier);
-    }
-
-    /**
-     * Creates an InvokerWithNotification.
-     *
-     * @param portTypeQName
-     * @param wsdlLocation  The URL of WSDL of the service to invoke
-     * @param nodeID        The ID of the service
-     * @param gfacURL       The URL of GFac service.
-     * @param notifier      The notification sender
-     */
-    public EmbeddedGFacInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String gfacURL,
-                               WorkflowNotifiable notifier) {
-        this(portTypeQName, wsdlLocation, nodeID, null, gfacURL, notifier);
-    }
-
-    /**
-     * Creates an InvokerWithNotification.
-     *
-     * @param portTypeQName
-     * @param wsdlLocation  The URL of WSDL of the service to invoke
-     * @param nodeID        The ID of the service
-     * @param messageBoxURL
-     * @param gfacURL       The URL of GFac service.
-     * @param notifier      The notification sender
-     */
-    public EmbeddedGFacInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String messageBoxURL,
-                               String gfacURL, WorkflowNotifiable notifier) {
-        this.nodeID = nodeID;
-        this.portTypeQName = portTypeQName;
-        this.wsdlLocation = wsdlLocation;
-        this.serviceInformation = wsdlLocation;
-        this.messageBoxURL = messageBoxURL;
-        this.gfacURL = gfacURL;
-        this.notifier = notifier.createServiceNotificationSender(nodeID);
-
-        this.failerSent = false;
-    }
-
-    /**
-     * @param portTypeQName
-     * @param wsdl
-     * @param nodeID
-     * @param messageBoxURL
-     * @param gfacURL
-     * @param notifier
-     */
-    public EmbeddedGFacInvoker(QName portTypeQName,
-                               WsdlDefinitions wsdl,
-                               String nodeID,
-                               String messageBoxURL,
-                               String gfacURL,
-                               WorkflowNotifiable notifier,
-                               String topic,
-                               AiravataAPI airavataAPI,
-                               String serviceName,
-                               XBayaConfiguration config) {
-        final String wsdlStr = xsul.XmlConstants.BUILDER.serializeToString(wsdl);
-        this.nodeID = nodeID;
-        this.portTypeQName = portTypeQName;
-        this.wsdlDefinitionObject = wsdl;
-        this.messageBoxURL = messageBoxURL;
-        this.serviceInformation = wsdlStr;
-        this.gfacURL = gfacURL;
-        this.notifier = notifier.createServiceNotificationSender(nodeID);
-        this.airavataAPI = airavataAPI;
-        this.topic = topic;
-        this.serviceName = serviceName;
-        this.failerSent = false;
-        this.configuration = config;
-    }
-
-    /**
-     * @throws WorkflowException
-     */
-    public void setup() throws WorkflowException {
-        this.notifier.setServiceID(this.nodeID);
-    }
-
-    private void setup(WsdlDefinitions definitions) throws WorkflowException {
-    }
-
-    /**
-     * @param operationName The name of the operation
-     * @throws WorkflowException
-     */
-    public void setOperation(String operationName) throws WorkflowException {
-    }
-
-    /**
-     * @param name  The name of the input parameter
-     * @param value The value of the input parameter
-     * @throws WorkflowException
-     */
-    public void setInput(String name, Object value) throws WorkflowException {
-        try {
-            if (value instanceof XmlElement) {
-                logger.debug("value: " + XMLUtil.xmlElementToString((XmlElement) value));
-            }
-            this.inputNames.add(name);
-            this.inputValues.add(value);
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error in setting an input. name: " + name + " value: " + value;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Exception e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        }
-    }
-
-    /**
-     * @return
-     * @throws WorkflowException
-     */
-    public synchronized boolean invoke() throws WorkflowException {
-        try {
-            ContextHeaderDocument.ContextHeader contextHeader =
-                    WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID, this.configuration.getContextHeader());
-            String hostName = null;
-            HostDescription registeredHost;
-            if (contextHeader != null) {
-                if (contextHeader.getWorkflowSchedulingContext() != null &&
-                        contextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray().length > 0 &&
-                        contextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray(0).getHostName() != null) {
-                    hostName = contextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray(0).getHostName();
-                }
-            }
-            //todo This is the basic scheduling, have to do proper scheduling implementation by implementing HostScheduler interface
-            ServiceDescription serviceDescription = airavataAPI.getApplicationManager().getServiceDescription(serviceName);
-            if (hostName == null) {
-                List<HostDescription> registeredHosts = new ArrayList<HostDescription>();
-                Map<String, ApplicationDescription> applicationDescriptors = airavataAPI.getApplicationManager().getApplicationDescriptors(serviceName);
-                for (String hostDescName : applicationDescriptors.keySet()) {
-                    registeredHosts.add(airavataAPI.getApplicationManager().getHostDescription(hostDescName));
-                }
-                Class<? extends HostScheduler> aClass = Class.forName(ServerSettings.getHostScheduler()).asSubclass(HostScheduler.class);
-                HostScheduler hostScheduler = aClass.newInstance();
-                registeredHost = hostScheduler.schedule(registeredHosts);
-            } else {
-                // if user specify a host, no matter what we pick that host for all the nodes, todo: allow users to specify node specific host
-                registeredHost = airavataAPI.getApplicationManager().getHostDescription(hostName);
-            }
-            ApplicationDescription applicationDescription =
-                    airavataAPI.getApplicationManager().getApplicationDescription(serviceName, registeredHost.getType().getHostName());
-
-            // When we run getInParameters we set the actualParameter object, this has to be fixed
-            URL resource = EmbeddedGFacInvoker.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
-            OMElement inputMessage = getInParameters();
-            Object wsifMessageElement = new WSIFMessageElement(XMLUtil.stringToXmlElement3(inputMessage.toStringWithConsume()));
-            this.notifier.invokingService(new WSIFMessageElement((XmlElement) wsifMessageElement));
-            Properties configurationProperties = ServerSettings.getProperties();
-            GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), airavataAPI, configurationProperties);
-
-            JobExecutionContext jobExecutionContext = new JobExecutionContext(gFacConfiguration, serviceName);
-            //Here we get only the contextheader information sent specific for this node
-            //Add security context
-
-            //FIXME - We no longer using job execution context
-//            jobExecutionContext.setContextHeader(WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID, configuration.getContextHeader()));
-
-
-            jobExecutionContext.setProperty(Constants.PROP_WORKFLOW_NODE_ID, this.nodeID);
-            jobExecutionContext.setProperty(Constants.PROP_TOPIC, this.configuration.getTopic());
-            jobExecutionContext.setProperty(Constants.PROP_BROKER_URL, this.configuration.getBrokerURL().toASCIIString());
-            jobExecutionContext.setProperty(Constants.PROP_WORKFLOW_INSTANCE_ID, this.configuration.getTopic());
-
-
-            ApplicationContext applicationContext = new ApplicationContext();
-            applicationContext.setApplicationDeploymentDescription(applicationDescription);
-            applicationContext.setHostDescription(registeredHost);
-            applicationContext.setServiceDescription(serviceDescription);
-
-            jobExecutionContext.setApplicationContext(applicationContext);
-
-            jobExecutionContext.setOutMessageContext(getOutParameters(serviceDescription));
-            jobExecutionContext.setInMessageContext(new MessageContext(actualParameters));
-
-            addSecurityContext(registeredHost, configurationProperties, jobExecutionContext,
-                    configuration.getContextHeader());
-            GFacImpl gfacAPI1 = new GFacImpl();
-            gfacAPI1.submitJob(jobExecutionContext);
-
-            OMFactory fac = OMAbstractFactory.getOMFactory();
-            OMNamespace omNs = fac.createOMNamespace("http://ws.apache.org/axis2/xsd", "ns1");
-            OMElement outputElement = fac.createOMElement("invokeResponse", omNs);
-            MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
-            Set<String> paramNames = outMessageContext.getParameters().keySet();
-            for (String paramName : paramNames) {
-                /*
-                * Process Output
-                */
-                String outputString = ((ActualParameter) outMessageContext.getParameter(paramName)).toXML().replaceAll("GFacParameter", paramName);
-                XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(outputString));
-                StAXOMBuilder builder = new StAXOMBuilder(reader);
-                outputElement.addChild(builder.getDocumentElement());
-            }
-            // Send notification
-            logger.debug("outputMessage: " + outputElement.toString());
-            outPut = new WSIFMessageElement(XMLUtil.stringToXmlElement3(outputElement.toStringWithConsume()));
-            this.result = true;
-            EmbeddedGFacInvoker.this.notifier.serviceFinished(new WSIFMessageElement((XmlElement) outPut));
-            //todo check whether ActualParameter values are set or not, if they are null have to through an error or handle this in gfac level.
-//             {
-//                // An implementation of WSIFMessage,
-//                // WSIFMessageElement, implements toString(), which
-//                // serialize the message XML.
-//                EmbeddedGFacInvoker.this.notifier.receivedFault(new WSIFMessageElement(XMLUtil.stringToXmlElement3("<Message>Invocation Failed</Message>")));
-//                EmbeddedGFacInvoker.this.failerSent = true;
-//            }
-
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error in invoking a service: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Exception e) {
-            this.notifier.invocationFailed(e.getMessage(), e);
-            throw new WorkflowException(e.getMessage(), e);
-        }
-        return true;
-    }
-
-    private SecurityContextDocument.SecurityContext.CredentialManagementService getCredentialManagementService(
-            ContextHeaderDocument.ContextHeader contextHeader) {
-
-        if (contextHeader != null) {
-
-            SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
-                    = contextHeader.getSecurityContext().getCredentialManagementService();
-
-            if (credentialManagementService != null) {
-                // Make sure token id and portal user id is properly populated
-                if (credentialManagementService.getTokenId() != null &&
-                        credentialManagementService.getPortalUser() != null) {
-
-                    return credentialManagementService;
-                } else {
-                    return null;
-                }
-            } else {
-                return null;
-            }
-        }
-
-        return null;
-    }
-
-    private void addSecurityContext(HostDescription registeredHost, Properties configurationProperties,
-                                    JobExecutionContext jobExecutionContext, ContextHeaderDocument.ContextHeader contextHeader) throws WorkflowException {
-        RequestData requestData;
-            /* todo fix the credential store and uncomment following code block
-            SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
-                    = getCredentialManagementService(contextHeader);
-
-            GSISecurityContext context;
-
-
-            if (credentialManagementService != null) {
-                String gatewayId = credentialManagementService.getGatewayId();
-                String tokenId
-                        = credentialManagementService.getTokenId();
-                String portalUser = credentialManagementService.getPortalUser();
-
-                requestData = new RequestData(tokenId, portalUser, gatewayId);
-            } else {
-                requestData = new RequestData("default");
-            }
-
-            try {
-                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
-            } catch (Exception e) {
-                throw new WorkflowException("An error occurred while creating GSI security context", e);
-            }
-            if (registeredHost.getType() instanceof GsisshHostType) {
-                GSIAuthenticationInfo authenticationInfo
-                        = new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
-                        requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
-                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());
-
-                Cluster pbsCluster = null;
-                try {
-                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
-                            (((HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath()));
-                } catch (SSHApiException e) {
-                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                }
-
-                context.setPbsCluster(pbsCluster);
-            }
-            */
-            requestData = new RequestData("default");
-            GSISecurityContext context;
-            try {
-                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
-            } catch (Exception e) {
-                throw new WorkflowException("An error occurred while creating GSI security context", e);
-            }
-
-            if (registeredHost.getType() instanceof GsisshHostType) {
-                GSIAuthenticationInfo authenticationInfo
-                        = new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
-                        requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
-                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());
-
-                Cluster pbsCluster = null;
-                try {
-                    String installedParentPath = ((HpcApplicationDeploymentType)
-                            jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
-                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
-                            (CommonUtils.getPBSJobManager(installedParentPath)));
-                } catch (SSHApiException e) {
-                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                }
-
-                context.setPbsCluster(pbsCluster);
-            }
-
-            jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
-        //Adding Amanzon Keys
-            if (this.configuration.getAmazonSecurityContext() != null) {
-                jobExecutionContext.addSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT,
-                        this.configuration.getAmazonSecurityContext());
-         }
-      //Adding SSH security
-            String sshUserName = configurationProperties.getProperty(Constants.SSH_USER_NAME);
-            String sshPrivateKey = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY);
-            String sshPrivateKeyPass = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS);
-            String sshPassword = configurationProperties.getProperty(Constants.SSH_PASSWORD);
-            String sshPublicKey = configurationProperties.getProperty(Constants.SSH_PUBLIC_KEY);
-            SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
-            if (((SSHHostType) registeredHost.getType()).getHpcResource()) {
-                AuthenticationInfo authenticationInfo = null;
-                // we give higher preference to the password over keypair ssh authentication
-                if (sshPassword != null) {
-                    authenticationInfo = new DefaultPasswordAuthenticationInfo(sshPassword);
-                } else {
-                    authenticationInfo = new DefaultPublicKeyFileAuthentication(sshPublicKey, sshPrivateKey, sshPrivateKeyPass);
-                }
-                ServerInfo serverInfo = new ServerInfo(sshUserName, registeredHost.getType().getHostAddress());
-
-                Cluster pbsCluster = null;
-                try {
-                    String installedParentPath = ((HpcApplicationDeploymentType)
-                            jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
-                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
-                            (CommonUtils.getPBSJobManager(installedParentPath)));
-                } catch (SSHApiException e) {
-                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                }
-                sshSecurityContext.setPbsCluster(pbsCluster);
-                sshSecurityContext.setUsername(sshUserName);
-            } else {
-                sshSecurityContext = new SSHSecurityContext();
-                sshSecurityContext.setUsername(sshUserName);
-                sshSecurityContext.setPrivateKeyLoc(sshPrivateKey);
-                sshSecurityContext.setKeyPass(sshPrivateKeyPass);
-            }
-            jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, sshSecurityContext);
-    }
-
-    /**
-     * @throws WorkflowException
-     */
-    @SuppressWarnings("boxing")
-    public synchronized void waitToFinish() throws WorkflowException {
-        try {
-            while (this.result == null) {
-                // The job is not submitted yet.
-                try {
-                    wait();
-                } catch (InterruptedException e) {
-                    logger.error(e.getMessage(), e);
-                }
-            }
-            // Wait for the job to finish.
-            Boolean success = this.result;
-            if (success == false) {
-                WSIFMessage faultMessage = this.invoker.getFault();
-                String message = "Error in a service: ";
-                // An implementation of WSIFMessage,
-                // WSIFMessageElement, implements toString(), which
-                // serialize the message XML.
-                message += faultMessage.toString();
-                throw new WorkflowException(message);
-            }
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error while waiting for a service to finish: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     * @param name The name of the output parameter
-     * @return
-     * @throws WorkflowException
-     */
-    public Object getOutput(String name) throws WorkflowException {
-        try {
-            waitToFinish();
-            if (outPut instanceof XmlElement) {
-                Iterator children = ((XmlElement) outPut).children();
-                while (children.hasNext()) {
-                    Object next = children.next();
-                    if (((XmlElement) next).getName().equals(name)) {
-                        return ((XmlElement) ((XmlElement) next).children().next()).children().next();
-                    }
-                }
-            } else {
-                return outPut;
-            }
-        } catch (WorkflowException e) {
-            logger.error(e.getMessage(), e);
-            // An appropriate message has been set in the exception.
-            if (!this.failerSent) {
-                this.notifier.invocationFailed(e.getMessage(), e);
-            }
-            throw e;
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error while waiting for a output: " + name;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-        throw new WorkflowException("Output could not be found");
-    }
-
-    /**
-     * @return
-     * @throws WorkflowException
-     */
-    public WSIFMessage getOutputs() throws WorkflowException {
-        return this.invoker.getOutputs();
-    }
-
-    public WSIFClient getClient() {
-        return null;
-    }
-
-    public WSIFMessage getInputs() throws WorkflowException {
-        return null;
-    }
-
-    public WSIFMessage getFault() throws WorkflowException {
-        return null;
-    }
-
-    private OMElement getInParameters() throws AiravataAPIInvocationException, RegistryException, XMLStreamException {
-        OMFactory omFactory = OMAbstractFactory.getOMFactory();
-        OMElement invoke_inputParams = omFactory.createOMElement(new QName("invoke_InputParams"));
-        ServiceDescription serviceDescription = airavataAPI.getApplicationManager().getServiceDescription(this.serviceName);
-        if (serviceDescription == null) {
-            throw new RegistryException(new Exception("Service Description not found in registry."));
-        }
-        ServiceDescriptionType serviceDescriptionType = serviceDescription.getType();
-        for (String inputName : this.inputNames) {
-            OMElement omElement = omFactory.createOMElement(new QName(inputName));
-            int index = this.inputNames.indexOf(inputName);
-            Object value = this.inputValues.get(index);
-            InputParameterType parameter = serviceDescriptionType.getInputParametersArray(index);
-            if (value instanceof XmlElement) {
-                omElement.setText((String) ((XmlElement) ((XmlElement) ((XmlElement) value).children().next()).children().next()).children().next());
-                XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(XMLUtil.xmlElementToString((XmlElement) value)));
-                StAXOMBuilder builder = new StAXOMBuilder(reader);
-                OMElement input = builder.getDocumentElement();
-//                actualParameters.put(parameter.getParameterName(), GFacUtils.getInputActualParameter(parameter, input));
-            } else if (value instanceof String) {
-                omElement.setText((String) value);
-//                actualParameters.put(parameter.getParameterName(), GFacUtils.getInputActualParameter(parameter, AXIOMUtil.stringToOM("<value>" + value + "</value>")));
-            }
-            invoke_inputParams.addChild(omElement);
-        }
-        return invoke_inputParams;
-    }
-
-    private MessageContext getOutParameters(ServiceDescription serviceDescription) {
-        MessageContext outContext = new MessageContext();
-        for (OutputParameterType parameter : serviceDescription.getType().getOutputParametersArray()) {
-            ActualParameter actualParameter = new ActualParameter();
-            if ("String".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(StringParameterType.type);
-            } else if ("Double".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(DoubleParameterType.type);
-            } else if ("Integer".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(IntegerParameterType.type);
-            } else if ("Float".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(FloatParameterType.type);
-            } else if ("Boolean".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(BooleanParameterType.type);
-            } else if ("File".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(FileParameterType.type);
-            } else if ("URI".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(URIParameterType.type);
-            } else if ("StringArray".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(StringArrayType.type);
-            } else if ("DoubleArray".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(DoubleArrayType.type);
-            } else if ("IntegerArray".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(IntegerArrayType.type);
-            } else if ("FloatArray".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(FloatArrayType.type);
-            } else if ("BooleanArray".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(BooleanArrayType.type);
-            } else if ("FileArray".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(FileArrayType.type);
-            } else if ("URIArray".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(URIArrayType.type);
-            } else if ("StdOut".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(StdOutParameterType.type);
-            } else if ("StdErr".equals(parameter.getParameterType().getName())) {
-                actualParameter.getType().changeType(StdErrParameterType.type);
-            }
-            outContext.addParameter(parameter.getParameterName(), actualParameter);
-        }
-        return outContext;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java
deleted file mode 100644
index 10edbd9..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import java.net.URI;
-import java.util.UUID;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.invoker.factory.InvokerFactory;
-import org.apache.airavata.xbaya.lead.NotificationHandler;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsdl.WsdlResolver;
-import xsul.wsif.WSIFMessage;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xwsif_runtime.WSIFClient;
-
-public class GFacInvoker implements Invoker {
-
-    private final static Logger logger = LoggerFactory.getLogger(GFacInvoker.class);
-
-    private String gfacURL;
-
-    private String messageBoxURL;
-
-    private QName portTypeQName;
-
-    private Invoker invoker;
-
-    private LeadContextHeader leadContext;
-
-    private WorkflowContextHeaderBuilder builder;
-
-    /**
-     * Constructs a GFacInvoker.
-     * 
-     * @param portTypeQName
-     * @param gfacURL
-     * @param messageBoxURL
-     * @param context
-     */
-    public GFacInvoker(QName portTypeQName, String gfacURL, String messageBoxURL, LeadContextHeader context) {
-        this.portTypeQName = portTypeQName;
-        this.gfacURL = gfacURL;
-        this.messageBoxURL = messageBoxURL;
-        this.leadContext = context;
-    }
-
-    public GFacInvoker(QName portTypeQName, String gfacURL, String messageBoxURL, WorkflowContextHeaderBuilder context) {
-        this.portTypeQName = portTypeQName;
-        this.gfacURL = gfacURL;
-        this.messageBoxURL = messageBoxURL;
-        this.builder = context;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#setup()
-     */
-    public void setup() throws WorkflowException {
-
-        if (this.gfacURL == null) {
-            String message = "The location of the Generic Factory is not specified.";
-            throw new WorkflowException(message);
-        }
-
-        if (this.portTypeQName == null) {
-            String message = "Error in finding the service name";
-            throw new WorkflowException(message);
-        }
-
-        try {
-
-            URI uri = new URI(this.gfacURL);
-
-            /*
-             * Substring to remove GfacService
-             */
-            String gfacPath = uri.getPath();
-            if (gfacPath != null && gfacPath.contains("/")) {
-                gfacPath = gfacPath.substring(0, gfacPath.lastIndexOf('/') + 1) + portTypeQName.getLocalPart();
-            }
-            URI getWsdlURI = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), gfacPath
-                    + "/getWSDL", uri.getQuery(), uri.getFragment());
-
-            logger.debug("getWSDL service:" + getWsdlURI.toString());
-
-            WsdlDefinitions concreteWSDL = WsdlResolver.getInstance().loadWsdl(getWsdlURI);
-
-            this.invoker = InvokerFactory.createInvoker(this.portTypeQName, concreteWSDL, null, this.messageBoxURL,
-                    null, true);
-            this.invoker.setup();
-        } catch (WorkflowException xe) {
-            throw xe;
-        } catch (Exception e) {
-            throw new WorkflowException(e.getMessage(), e);
-        }
-
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getClient()
-     */
-    public WSIFClient getClient() {
-        return this.invoker.getClient();
-    }
-
-    /**
-     * @throws WorkflowException
-     * @see org.apache.airavata.xbaya.invoker.Invoker#setOperation(java.lang.String)
-     */
-    public void setOperation(String operationName) throws WorkflowException {
-        this.invoker.setOperation(operationName);
-    }
-
-    /**
-     * @throws WorkflowException
-     * @see org.apache.airavata.xbaya.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
-     */
-    public void setInput(String name, Object value) throws WorkflowException {
-        this.invoker.setInput(name, value);
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getInputs()
-     */
-    public WSIFMessage getInputs() throws WorkflowException {
-        return this.invoker.getInputs();
-    }
-
-    /**
-     * @throws WorkflowException
-     * @see org.apache.airavata.xbaya.invoker.Invoker#invoke()
-     */
-    public boolean invoke() throws WorkflowException {
-
-        WSIFClient client = invoker.getClient();
-        // FIXME: Temporary fix
-        // if (this.leadContext == null) {
-        // LeadContextHeader lh = new LeadContextHeader(UUID.randomUUID().toString(), "XBaya-User");
-        // this.leadContext = lh;
-        // }
-        // StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-lead-header", this.leadContext);
-        // client.addHandler(handler);
-
-        // This handler has to be end to get the entire soap message.
-        NotificationHandler notificationHandler = new NotificationHandler(this.builder);
-        client.addHandler(notificationHandler);
-        return this.invoker.invoke();
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutputs()
-     */
-    public WSIFMessage getOutputs() throws WorkflowException {
-        return this.invoker.getOutputs();
-    }
-
-    /**
-     * @throws WorkflowException
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutput(java.lang.String)
-     */
-    public Object getOutput(String name) throws WorkflowException {
-        return this.invoker.getOutput(name);
-    }
-
-    /**
-     * @throws WorkflowException
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getFault()
-     */
-    public WSIFMessage getFault() throws WorkflowException {
-        return this.invoker.getFault();
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GenericInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GenericInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GenericInvoker.java
deleted file mode 100644
index e59c150..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GenericInvoker.java
+++ /dev/null
@@ -1,529 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.schemas.wec.ContextHeaderDocument;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.xbaya.invoker.factory.InvokerFactory;
-import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
-import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsdl.WsdlException;
-import xsul.wsdl.WsdlResolver;
-import xsul.wsif.WSIFMessage;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xwsif_runtime.WSIFClient;
-
-public class GenericInvoker implements Invoker {
-
-    private static final Logger logger = LoggerFactory.getLogger(GenericInvoker.class);
-
-    private String nodeID;
-
-    private QName portTypeQName;
-
-    private String wsdlLocation;
-
-    private String serviceInformation;
-
-    private String messageBoxURL;
-
-    private String gfacURL;
-
-    private Invoker invoker;
-
-    private Future<Boolean> result;
-
-    private ServiceNotifiable notifier;
-
-    private ContextHeaderDocument.ContextHeader contextHeader;
-
-    private String topic;
-
-    /**
-     * used for notification
-     */
-    private List<Object> inputValues = new ArrayList<Object>();
-
-    /**
-     * used for notification
-     */
-    private List<String> inputNames = new ArrayList<String>();
-
-    boolean failerSent;
-
-    private WsdlDefinitions wsdlDefinitionObject;
-
-    /**
-     * Creates an InvokerWithNotification.
-     * 
-     * @param portTypeQName
-     * 
-     * @param wsdlLocation
-     *            The URL of WSDL of the service to invoke
-     * @param nodeID
-     *            The ID of the service
-     * @param notifier
-     *            The notification sender
-     */
-    public GenericInvoker(QName portTypeQName, String wsdlLocation, String nodeID, WorkflowNotifiable notifier) {
-        this(portTypeQName, wsdlLocation, nodeID, null, notifier);
-    }
-
-    /**
-     * Creates an InvokerWithNotification.
-     * 
-     * @param portTypeQName
-     * 
-     * @param wsdlLocation
-     *            The URL of WSDL of the service to invoke
-     * @param nodeID
-     *            The ID of the service
-     * @param gfacURL
-     *            The URL of GFac service.
-     * @param notifier
-     *            The notification sender
-     */
-    public GenericInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String gfacURL,
-            WorkflowNotifiable notifier) {
-        this(portTypeQName, wsdlLocation, nodeID, null, gfacURL, notifier);
-    }
-
-    /**
-     * Creates an InvokerWithNotification.
-     * 
-     * @param portTypeQName
-     * 
-     * @param wsdlLocation
-     *            The URL of WSDL of the service to invoke
-     * @param nodeID
-     *            The ID of the service
-     * @param messageBoxURL
-     * @param gfacURL
-     *            The URL of GFac service.
-     * @param notifier
-     *            The notification sender
-     */
-    public GenericInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String messageBoxURL,
-            String gfacURL, WorkflowNotifiable notifier) {
-        this.nodeID = nodeID;
-        this.portTypeQName = portTypeQName;
-        this.wsdlLocation = wsdlLocation;
-        this.serviceInformation = wsdlLocation;
-        this.messageBoxURL = messageBoxURL;
-        this.gfacURL = gfacURL;
-        this.notifier = notifier.createServiceNotificationSender(nodeID);
-        this.failerSent = false;
-        this.contextHeader = WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID,WorkflowContextHeaderBuilder.getCurrentContextHeader());
-        this.topic = notifier.getTopic();
-    }
-
-    /**
-     *
-     * @param portTypeQName
-     * @param wsdl
-     * @param nodeID
-     * @param messageBoxURL
-     * @param gfacURL
-     * @param notifier
-     */
-    public GenericInvoker(QName portTypeQName, WsdlDefinitions wsdl, String nodeID, String messageBoxURL,
-            String gfacURL, WorkflowNotifiable notifier) {
-        final String wsdlStr = xsul.XmlConstants.BUILDER.serializeToString(wsdl);
-        this.nodeID = nodeID;
-        this.portTypeQName = portTypeQName;
-        this.wsdlDefinitionObject = wsdl;
-        this.messageBoxURL = messageBoxURL;
-        this.serviceInformation = wsdlStr;
-        this.gfacURL = gfacURL;
-        this.notifier = notifier.createServiceNotificationSender(nodeID);
-        this.failerSent = false;
-        this.contextHeader = WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID,WorkflowContextHeaderBuilder.getCurrentContextHeader());
-        this.topic = notifier.getTopic();
-    }
-
-    /**
-     *
-     * @throws WorkflowException
-     */
-    public void setup() throws WorkflowException {
-        try {
-            WsdlDefinitions definitions = null;
-            if (this.wsdlLocation != null && !this.wsdlLocation.equals("")) {
-                WsdlResolver resolver = WsdlResolver.getInstance();
-                definitions = resolver.loadWsdl(new File(".").toURI(), new URI(this.wsdlLocation));
-            } else {
-                definitions = this.wsdlDefinitionObject;
-            }
-
-            setup(definitions);
-
-        } catch (WorkflowException e) {
-            logger.error(e.getMessage(), e);
-            // An appropriate message has been set in the exception.
-            this.notifier.invocationFailed(e.getMessage(), e);
-            throw e;
-        } catch (URISyntaxException e) {
-            logger.error(e.getMessage(), e);
-            String message = "The location of the WSDL has to be a valid URL or file path: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (WsdlException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error in processing the WSDL: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error in processing the WSDL: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    private void setup(WsdlDefinitions definitions) throws WorkflowException {
-
-        // Set LEAD context header.
-        WorkflowContextHeaderBuilder builder;
-        if(contextHeader == null){
-            builder = new WorkflowContextHeaderBuilder(this.notifier.getEventSink()
-                .getAddress(), this.gfacURL, null, this.topic,
-                "xbaya-experiment", this.messageBoxURL);
-        }else{
-             builder = new WorkflowContextHeaderBuilder(contextHeader);
-        }
-        if(builder.getWorkflowMonitoringContext() == null){
-            builder.addWorkflowMonitoringContext(this.notifier.getEventSink().getAddress(),
-                    this.topic,this.nodeID,this.messageBoxURL);
-        } else {
-            builder.getWorkflowMonitoringContext().setWorkflowInstanceId(this.notifier.getWorkflowID().toASCIIString());
-        }
-        builder.getWorkflowMonitoringContext().setWorkflowNodeId(this.nodeID);
-        builder.getWorkflowMonitoringContext().setServiceInstanceId(this.nodeID);
-        builder.getWorkflowMonitoringContext().setWorkflowTimeStep(1);
-        builder.setUserIdentifier("xbaya-user");
-        //todo write a UI component to collect this information and pass it through Header
-//        builder.setGridMyProxyRepository("myproxy.nersc.gov","$user","$passwd",14000);
-        StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-workflowcontext-header", builder.getXml());
-        // Create Invoker
-        this.invoker = InvokerFactory.createInvoker(this.portTypeQName, definitions, this.gfacURL, this.messageBoxURL,
-                builder, true);
-        this.invoker.setup();
-
-        WSIFClient client = this.invoker.getClient();
-        client.addHandler(handler);
-
-        WsdlResolver resolver = WsdlResolver.getInstance();
-        // Get the concrete WSDL from invoker.setup() and set it to the
-        // notifier.
-
-        this.notifier.setServiceID(this.nodeID);
-        // if (this.wsdlLocation != null) {
-        // this.notifier.setServiceID(this.nodeID);
-        // } else {
-        // String name = this.portTypeQName.getLocalPart();
-        // this.notifier.setServiceID(name);
-        // }
-    }
-
-    /**
-     *
-     * @param operationName
-     *            The name of the operation
-     * @throws WorkflowException
-     */
-    public void setOperation(String operationName) throws WorkflowException {
-        try {
-            this.invoker.setOperation(operationName);
-        } catch (WorkflowException e) {
-            logger.error(e.getMessage(), e);
-            // An appropriate message has been set in the exception.
-            this.notifier.invocationFailed(e.getMessage(), e);
-            throw e;
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "The WSDL does not conform to the invoking service: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     *
-     * @param name
-     *            The name of the input parameter
-     * @param value
-     *            The value of the input parameter
-     * @throws WorkflowException
-     */
-    public void setInput(String name, Object value) throws WorkflowException {
-        try {
-            if (value instanceof XmlElement) {
-                logger.debug("value: " + XMLUtil.xmlElementToString((XmlElement) value));
-            }
-            this.inputNames.add(name);
-            this.inputValues.add(value);
-            this.invoker.setInput(name, value);
-        } catch (WorkflowException e) {
-            logger.error(e.getMessage(), e);
-            // An appropriate message has been set in the exception.
-            this.notifier.invocationFailed(e.getMessage(), e);
-            throw e;
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error in setting an input. name: " + name + " value: " + value;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     *
-     * @return
-     * @throws WorkflowException
-     */
-    public synchronized boolean invoke() throws WorkflowException {
-        try {
-            WSIFMessage inputMessage = this.invoker.getInputs();
-            logger.debug("inputMessage: " + XMLUtil.xmlElementToString((XmlElement) inputMessage));
-            this.notifier.invokingService(inputMessage);
-
-            ExecutorService executor = Executors.newSingleThreadExecutor();
-            this.result = executor.submit(new Callable<Boolean>() {
-                @SuppressWarnings("boxing")
-                public Boolean call() {
-                    try {
-                        boolean success = GenericInvoker.this.invoker.invoke();
-                        if (success) {
-                            // Send notification
-                            WSIFMessage outputMessage = GenericInvoker.this.invoker.getOutputs();
-                            // An implementation of WSIFMessage,
-                            // WSIFMessageElement, implements toString(), which
-                            // serialize the message XML.
-                            logger.debug("outputMessage: " + outputMessage);
-                            GenericInvoker.this.notifier.serviceFinished(outputMessage);
-                        } else {
-                            //if error occurse gfac-axis2 write the error in to output not to the fault
-                            WSIFMessage faultMessage = GenericInvoker.this.invoker.getOutputs();
-                            // An implementation of WSIFMessage,
-                            // WSIFMessageElement, implements toString(), which
-                            // serialize the message XML.
-                            logger.debug("received fault: " + faultMessage);
-                            GenericInvoker.this.notifier.receivedFault(faultMessage);
-                            GenericInvoker.this.failerSent = true;
-                        }
-                        return success;
-                    } catch (WorkflowException e) {
-                        logger.error(e.getMessage(), e);
-                        // An appropriate message has been set in the exception.
-                        GenericInvoker.this.notifier.invocationFailed(e.getMessage(), e);
-                        GenericInvoker.this.failerSent = true;
-                        throw new WorkflowRuntimeException(e);
-                    } catch (RuntimeException e) {
-                        logger.error(e.getMessage(), e);
-                        String message = "Error in invoking a service: " + GenericInvoker.this.serviceInformation;
-                        GenericInvoker.this.notifier.invocationFailed(message, e);
-                        GenericInvoker.this.failerSent = true;
-                        throw e;
-                    }
-                }
-            });
-
-            // Kill the thread inside of executor. This is necessary for Jython
-            // script to finish.
-            executor.shutdown();
-
-            // Let other threads know that job has been submitted.
-            notifyAll();
-
-            // Check if the invocation itself fails. This happens immediately.
-            try {
-                this.result.get(100, TimeUnit.MILLISECONDS);
-            } catch (InterruptedException e) {
-                logger.error(e.getMessage(), e);
-            } catch (TimeoutException e) {
-                // The job is probably running fine.
-                // The normal case.
-                return true;
-            } catch (ExecutionException e) {
-                // The service-failed notification should have been sent
-                // already.
-                logger.error(e.getMessage(), e);
-                String message = "Error in invoking a service: " + this.serviceInformation;
-                throw new WorkflowException(message, e);
-            }
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error in invoking a service: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-        return true;
-    }
-
-    /**
-     *
-     * @throws WorkflowException
-     */
-    @SuppressWarnings("boxing")
-    public synchronized void waitToFinish() throws WorkflowException {
-        try {
-            while (this.result == null) {
-                // The job is not submitted yet.
-                try {
-                    wait();
-                } catch (InterruptedException e) {
-                    logger.error(e.getMessage(), e);
-                }
-            }
-            // Wait for the job to finish.
-            Boolean success = this.result.get();
-            if (success == false) {
-                WSIFMessage faultMessage = this.invoker.getFault();
-                String message = "Error in a service: ";
-                // An implementation of WSIFMessage,
-                // WSIFMessageElement, implements toString(), which
-                // serialize the message XML.
-                message += faultMessage.toString();
-                throw new WorkflowException(message);
-            }
-        } catch (InterruptedException e) {
-            logger.error(e.getMessage(), e);
-        } catch (ExecutionException e) {
-            // The service-failed notification should have been sent already.
-            logger.error(e.getMessage(), e);
-            String message = "Error in invoking a service: " + this.serviceInformation;
-            throw new WorkflowException(message, e);
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error while waiting for a service to finish: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     *
-     * @param name
-     *            The name of the output parameter
-     * @return
-     * @throws WorkflowException
-     */
-    public Object getOutput(String name) throws WorkflowException {
-        try {
-            waitToFinish();
-            Object output = this.invoker.getOutput(name);
-            if (output instanceof XmlElement) {
-                logger.debug("output: " + XMLUtil.xmlElementToString((XmlElement) output));
-            }
-            return output;
-        } catch (WorkflowException e) {
-            logger.error(e.getMessage(), e);
-            // An appropriate message has been set in the exception.
-            if (!this.failerSent) {
-                this.notifier.invocationFailed(e.getMessage(), e);
-            }
-            throw e;
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error while waiting for a output: " + name;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     *
-     * @return
-     * @throws WorkflowException
-     */
-    public WSIFMessage getOutputs() throws WorkflowException {
-        return this.invoker.getOutputs();
-    }
-
-    @Override
-    public WSIFClient getClient() {
-        return null;
-    }
-
-    @Override
-    public WSIFMessage getInputs() throws WorkflowException {
-        return null;
-    }
-
-    @Override
-    public WSIFMessage getFault() throws WorkflowException {
-        return null;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/Invoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/Invoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/Invoker.java
deleted file mode 100644
index 4580587..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/Invoker.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-
-import xsul.wsif.WSIFMessage;
-import xsul.xwsif_runtime.WSIFClient;
-
-public interface Invoker {
-
-    /**
-     * Sets up the service.
-     * 
-     * @throws WorkflowException
-     */
-    public void setup() throws WorkflowException;
-
-    /**
-     * @return The WSIFClient.
-     */
-    public WSIFClient getClient();
-
-    /**
-     * Sets the operation name to invoke.
-     * 
-     * @param operationName
-     *            The name of the operation
-     * @throws WorkflowException
-     */
-    public void setOperation(String operationName) throws WorkflowException;
-
-    /**
-     * Sets an input parameter
-     * 
-     * @param name
-     *            The name of the input parameter
-     * @param value
-     *            The value of the input parameter
-     * @throws WorkflowException
-     */
-    public void setInput(String name, Object value) throws WorkflowException;
-
-    /**
-     * Returns the all input parameters
-     * 
-     * @return The input parameters
-     * @throws WorkflowException
-     */
-    public WSIFMessage getInputs() throws WorkflowException;
-
-    /**
-     * Invokes the service.
-     * 
-     * @return true if the invocation succeeds; fase otherwise
-     * @throws WorkflowException
-     */
-    public boolean invoke() throws WorkflowException;
-
-    /**
-     * Returns the all output parameters
-     * 
-     * @return The output parameters
-     * @throws WorkflowException
-     */
-    public WSIFMessage getOutputs() throws WorkflowException;
-
-    /**
-     * Returns the output of a specified name.
-     * 
-     * @param name
-     *            The name of the output parameter
-     * @return The value of the output
-     * @throws WorkflowException
-     */
-    public Object getOutput(String name) throws WorkflowException;
-
-    /**
-     * Returns the fault message.
-     * 
-     * @return The fault message
-     * @throws WorkflowException
-     */
-    public WSIFMessage getFault() throws WorkflowException;
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/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
deleted file mode 100644
index 5fee29f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-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;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlDocument;
-import org.xmlpull.v1.builder.XmlElement;
-import org.xmlpull.v1.builder.XmlInfosetBuilder;
-import xsul.MLogger;
-import xsul.XmlConstants;
-import xsul.XsulException;
-import xsul.processor.DynamicInfosetProcessorException;
-import xsul.ws_addressing.WsaEndpointReference;
-import xsul.ws_addressing.WsaMessageInformationHeaders;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.impl.WSIFMessageElement;
-import xsul.xwsif_runtime_async.WSIFAsyncResponseListener;
-import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
-import xsul.xwsif_runtime_async.WSIFAsyncWsaResponsesCorrelatorBase;
-
-import javax.xml.stream.XMLStreamException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.rmi.RemoteException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-public class MsgBoxWsaResponsesCorrelator extends WSIFAsyncWsaResponsesCorrelatorBase
-    implements WSIFAsyncResponsesCorrelator, Runnable
-{
-    private static final Logger logger = LoggerFactory.getLogger(MsgBoxWsaResponsesCorrelator.class);
-    private final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
-
-    private String msgBoxServiceLoc;
-    private MsgBoxClient msgBoxClient;
-    EndpointReference msgBoxAddr;
-    private Thread messageBoxDonwloader;
-
-    private AsynchronousInvoker invoker;
-
-    public MsgBoxWsaResponsesCorrelator(String msgBoxServiceLoc,AsynchronousInvoker output)
-        throws DynamicInfosetProcessorException
-    {
-        this.invoker = output;
-        this.msgBoxServiceLoc = msgBoxServiceLoc;
-        msgBoxClient = new MsgBoxClient();
-        try {
-            msgBoxAddr = msgBoxClient.createMessageBox(msgBoxServiceLoc,5000L);
-            try {
-                setReplyTo(new WsaEndpointReference(new URI(msgBoxAddr.getAddress())));
-            } catch (URISyntaxException e) {
-            	logger.error(e.getLocalizedMessage(),e);  //To change body of catch statement use File | Settings | File Templates.
-            }
-            messageBoxDonwloader = new Thread(this, Thread.currentThread().getName()+"-async-msgbox-correlator");
-            messageBoxDonwloader.setDaemon(true);
-            messageBoxDonwloader.start();
-        } catch (RemoteException e) {
-        	logger.error(e.getLocalizedMessage(),e);  //To change body of catch statement use File | Settings | File Templates.
-        }
-    }
-
-//    public void setMsgBoxAddr(WsaEndpointReference msgBoxAddr) {
-//      this.msgBoxAddr = msgBoxAddr;
-//    }
-
-
-
-    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;
-            }
-        }
-    }
-
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java
deleted file mode 100644
index 54cb7f4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import java.util.Iterator;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.wsif.WSIFService;
-import xsul.wsif.WSIFServiceFactory;
-import xsul.wsif.spi.WSIFProviderManager;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-
-public class SimpleInvoker implements Invoker {
-
-    private static final Logger log = LoggerFactory.getLogger(GenericInvoker.class);
-
-    protected WSIFClient client;
-
-    private WsdlDefinitions definitions;
-
-    private WSIFOperation operation;
-
-    private WSIFMessage inputMessage;
-
-    private volatile WSIFMessage outputMessage;
-
-    private WSIFMessage faultMessage;
-
-    private boolean lock = false;
-
-    static {
-        WSIFProviderManager.getInstance().addProvider(new xsul.wsif_xsul_soap_http.Provider());
-    }
-
-    /**
-     * Constructs a SimpleInvoker.
-     *
-     * @param definitions
-     */
-    public SimpleInvoker(WsdlDefinitions definitions) {
-        this.definitions = definitions;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#setup()
-     */
-    public void setup() throws WorkflowException {
-        try {
-            WSIFService service = WSIFServiceFactory.newInstance().getService(this.definitions);
-            WSIFPort port = service.getPort();
-            this.client = WSIFRuntime.getDefault().newClientFor(port);
-            this.client.setAsyncResponseTimeoutInMs(999999999);
-        } catch (RuntimeException e) {
-            String message = "The WSDL is in the wrong format";
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getClient()
-     */
-    public WSIFClient getClient() {
-        return this.client;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#setOperation(java.lang.String)
-     */
-    public void setOperation(String operationName) throws WorkflowException {
-        try {
-            WSIFPort port = this.client.getPort();
-            this.operation = port.createOperation(operationName);
-            this.inputMessage = this.operation.createInputMessage();
-            this.outputMessage = this.operation.createOutputMessage();
-            this.faultMessage = this.operation.createFaultMessage();
-        } catch (RuntimeException e) {
-            String message = "The WSDL does not conform to the invoking service.";
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
-     */
-    public void setInput(String name, Object value) throws WorkflowException {
-        try {
-            if (value instanceof XmlElement) {
-                // If the value is a complex type, change the name of the
-                // element to the correct one.
-                XmlElement valueElement = (XmlElement) value;
-                valueElement.setName(name);
-            } else if (value instanceof String) {
-                    if(XMLUtil.isXML((String)value)){
-                     XmlElement valueElement = XMLUtil.stringToXmlElement3((String) value);
-                     valueElement.setName(name);
-                        value = valueElement;
-                }
-                // Simple case.
-            } else {
-                // convert int, doule to string.
-                value = "" + value;
-            }
-            this.inputMessage.setObjectPart(name, value);
-        } catch (RuntimeException e) {
-            String message = "Error in setting an input. name: " + name + " value: " + value;
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getInputs()
-     */
-    public WSIFMessage getInputs() {
-        return this.inputMessage;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#invoke()
-     */
-    public boolean invoke() throws WorkflowException {
-        try {
-            boolean success = this.operation.executeRequestResponseOperation(this.inputMessage, this.outputMessage,
-                    this.faultMessage);
-            while(this.outputMessage == null){
-
-            }
-            return success;
-        } catch (RuntimeException e) {
-            String message = "Error in invoking a service.";
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutputs()
-     */
-    public WSIFMessage getOutputs() {
-         if (lock) {
-            try {
-                wait();
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-        }
-        return this.outputMessage;
-    }
-
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutput(java.lang.String)
-     */
-    public Object getOutput(String name) throws WorkflowException {
-        try {
-            // This code doesn't work when the output is a complex type.
-            // Object output = this.outputMessage.getObjectPart(name);
-            // return output;
-
-            XmlElement outputElement = (XmlElement) this.outputMessage;
-            XmlElement valueElement = outputElement.element(null, name);
-            Iterator childIt = valueElement.children();
-            int numberOfChildren = 0;
-            while (childIt.hasNext()) {
-                childIt.next();
-                numberOfChildren++;
-            }
-            if (numberOfChildren == 1) {
-                Object child = valueElement.children().next();
-                if (child instanceof String) {
-                    // Value is a simple type. Return the string.
-                    String value = (String) child;
-                    return value;
-                }
-                if (child instanceof XmlElement) {
-                	log.debug("output: " + XMLUtil.xmlElementToString((XmlElement) child));
-                	Object child1 = ((XmlElement) child).children().next();
-                	if (child1 instanceof String) {
-                        // Value is a simple type. Return the string.
-                        String value = (String) child1;
-                        return value;
-                    }
-                }
-            }
-            // Value is a complex type. Return the whole XmlElement so that we
-            // can set it to the next service as it is.
-            return valueElement;
-        } catch (RuntimeException e) {
-            String message = "Error in getting output. name: " + name;
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getFault()
-     */
-    public WSIFMessage getFault() {
-        return this.faultMessage;
-    }
-
-    public WsdlDefinitions getDefinitions() {
-        return definitions;
-    }
-
-    public WSIFOperation getOperation() {
-        return operation;
-    }
-
-    public WSIFMessage getInputMessage() {
-        return inputMessage;
-    }
-
-    public synchronized WSIFMessage getOutputMessage() {
-        return outputMessage;
-    }
-
-    public WSIFMessage getFaultMessage() {
-        return faultMessage;
-    }
-
-    public synchronized void setOutputMessage(WSIFMessage outputMessage) {
-        log.debug("Setting output message");
-        this.outputMessage = outputMessage;
-    }
-
-    public void setLock(boolean lock) {
-        this.lock = lock;
-    }
-
-    public boolean isLock() {
-        return lock;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInputUtil.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInputUtil.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInputUtil.java
deleted file mode 100644
index 2d892f0..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInputUtil.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.xbaya.invoker;
-
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.ws.WSComponentPort;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.lead.LEADTypes;
-
-import javax.xml.namespace.QName;
-
-public class WorkflowInputUtil {
-
-    public static String createInputForGFacService(WSComponentPort port,String input){
-        String paramType = port.getType().getLocalPart();
-        StringBuffer inputString = new StringBuffer("<");
-        if("StringParameterType".equals(paramType) || "URIParameterType".equals(paramType) ||
-                "DoubleParameterType".equals(paramType) || "IntegerParameterType".equals(paramType)
-                || "FloatParameterType".equals(paramType)|| "BooleanParameterType".equals(paramType)
-                || "FileParameterType".equals(paramType)){
-            inputString.append(port.getName()).append(">").
-                    append(getValueElement(input)).append("</").append(port.getName()).append(">");
-        }else if(paramType.endsWith("ArrayType")){
-            inputString.append(port.getName()).append(">");
-            String[] valueList = StringUtil.getElementsFromString(input);
-            for(String inputValue:valueList){
-                inputString.append(getValueElement(inputValue));
-            }
-            inputString.append(getValueElement(port.getName()));
-        }
-        inputString.append(">");
-        return inputString.toString();
-    }
-
-    private static String getValueElement(String value){
-       return "<value>" + value + "</value>";
-    }
-    public static Object parseValue(WSComponentPort input, String valueString) {
-        String name = input.getName();
-        if (false) {
-            // Some user wants to pass empty strings, so this check is disabled.
-            if (valueString.length() == 0) {
-                throw new WorkflowRuntimeException("Input parameter, " + name + ", cannot be empty");
-            }
-        }
-        QName type = input.getType();
-        Object value;
-        if (LEADTypes.isKnownType(type)) {
-            // TODO check the type.
-            value = valueString;
-        } else {
-            try {
-                if(XBayaConstants.HTTP_SCHEMAS_AIRAVATA_APACHE_ORG_GFAC_TYPE.equals(input.getType().getNamespaceURI())){
-                    value = XMLUtil.stringToXmlElement3(WorkflowInputUtil.createInputForGFacService(input, valueString));
-                }else {
-                    throw new WorkflowRuntimeException("Input parameter, " + name + ", Unkown Type");
-                }
-            } catch (RuntimeException e) {
-                throw new WorkflowRuntimeException("Input parameter, " + name + ", is not valid XML", e);
-            }
-        }
-        return value;
-    }
-}


[68/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoClient.java
new file mode 100644
index 0000000..bc31eea
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoClient.java
@@ -0,0 +1,116 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.echo;
+
+import java.net.URI;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xwsif_runtime.WSIFClient;
+import xsul.xwsif_runtime.WSIFRuntime;
+import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
+
+public class EchoClient {
+
+    private final static Logger logger = LoggerFactory.getLogger(EchoClient.class);
+
+    private EchoService service;
+
+    /**
+     * 
+     */
+    public void run() {
+        String wsdlLoc = startServer();
+        runClient(wsdlLoc);
+        shutdownServer();
+    }
+
+    private String startServer() {
+        this.service = new EchoService(0);
+        this.service.run();
+        return this.service.getServiceWsdlLocation();
+    }
+
+    private void shutdownServer() {
+        this.service.shutdownServer();
+    }
+
+    private void runClient(String wsdlLoc) {
+        logger.info("Starting " + EchoClient.class.getName());
+        logger.info("Invoking operation echoString using WSDL from " + wsdlLoc);
+
+        WSIFAsyncResponsesCorrelator correlator;
+        correlator = null;
+
+        // pass some headers
+        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
+        helper.setXBayaConfiguration(new XBayaConfiguration());
+        LeadContextHeader leadContext = helper.getLeadContextHeader();
+        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
+        leadContext.setNodeId("decoder1");
+        leadContext.setTimeStep("5");
+        leadContext.setServiceId("decoder-instance-10");
+
+        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
+                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
+                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
+        // seconds
+
+        WSIFPort port = wclient.getPort();
+        WSIFOperation operation = port.createOperation("echo");
+        WSIFMessage inputMessage = operation.createInputMessage();
+        WSIFMessage outputMessage = operation.createOutputMessage();
+        WSIFMessage faultMessage = operation.createFaultMessage();
+
+        inputMessage.setObjectPart("input", "test");
+
+        logger.info("Using WSIF to send message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
+        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
+
+        XmlElement result;
+        if (success) {
+            result = (XmlElement) outputMessage;
+        } else {
+            result = (XmlElement) faultMessage;
+        }
+        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
+
+        logger.info("Finished");
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        (new EchoClient()).run();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoImpl.java
new file mode 100644
index 0000000..e0a0243
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoImpl.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.echo;
+
+import java.util.Random;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+import org.xmlpull.v1.builder.XmlNamespace;
+
+import xsul.XmlConstants;
+
+public class EchoImpl implements Echo {
+
+    private final static Logger logger = LoggerFactory.getLogger(EchoImpl.class);
+
+    /**
+     * @see org.apache.airavata.xbaya.test.service.echo.Echo#echo(org.xmlpull.v1.builder.XmlElement)
+     */
+    public XmlElement echo(XmlElement inputElement) {
+        logger.info(XMLUtil.xmlElementToString(inputElement));
+
+        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
+
+        XmlElement input = inputElement.requiredElement(null, "input");
+
+        Random random = new Random();
+        int msec = random.nextInt(5000);
+        logger.info("Sleep for " + msec + " msec");
+        try {
+            Thread.sleep(msec);
+        } catch (InterruptedException e) {
+            logger.error(e.getMessage(), e);
+        }
+
+        XmlElement output = input;
+        output.setParent(null);
+        output.setName("output");
+
+        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("echotypens",
+                "http://www.extreme.indiana.edu/math/echo/xsd/");
+        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "EchoOutput");
+        outputElement.addElement(output);
+
+        if (notifier != null) {
+            notifier.sendingResult(outputElement);
+        }
+        logger.info(XMLUtil.xmlElementToString(outputElement));
+        return outputElement;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoService.java
new file mode 100644
index 0000000..c3c58a8
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoService.java
@@ -0,0 +1,113 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.echo;
+
+import java.io.File;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.test.service.Service;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsdl.WsdlDefinitions;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xservo.XService;
+import xsul.xservo_soap.XSoapDocLiteralService;
+import xsul.xservo_soap_http.HttpBasedServices;
+
+public class EchoService implements Service {
+
+    private final static Logger logger = LoggerFactory.getLogger(EchoService.class);
+
+    private HttpBasedServices httpServices;
+
+    private XService xservice;
+
+    private int port;
+
+    /**
+     * Constructs an EchoService.
+     * 
+     * @param port
+     */
+    public EchoService(int port) {
+        this.port = port;
+    }
+
+    /**
+     * Runs the service.
+     */
+    public void run() {
+        this.httpServices = new HttpBasedServices(this.port);
+        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(Echo.SERVICE_NAME,
+                Service.MATH_DIRECTORY_NAME + File.separator + Echo.WSDL_PATH, new EchoImpl()));
+        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
+        this.xservice.startService();
+    }
+
+    /**
+     * Returns the location of the WSDL of the service.
+     * 
+     * @return The location of the WSDL of the service.
+     */
+    public String getServiceWsdlLocation() {
+        return this.httpServices.getServer().getLocation() + "/" + Echo.SERVICE_NAME + "?wsdl";
+    }
+
+    /**
+     * Returns the WSDL of the service.
+     * 
+     * @return The WSDL of the service.
+     */
+    public WsdlDefinitions getWsdl() {
+        return this.xservice.getWsdl();
+    }
+
+    /**
+     * Shutdowns the service.
+     */
+    public void shutdownServer() {
+        this.httpServices.getServer().shutdownServer();
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        try {
+            int port = 0;
+            if (args.length == 2) {
+                if ("-port".equalsIgnoreCase(args[0])) {
+                    port = Integer.parseInt(args[1]);
+                }
+            }
+            EchoService service = new EchoService(port);
+            service.run();
+            WsdlDefinitions wsdl = service.getWsdl();
+            File wsdlFile = new File(SAMPLE_WSDL_DIRECTORY, Echo.WSDL_NAME);
+            XMLUtil.saveXML(wsdl, wsdlFile);
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/Multiplier.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/Multiplier.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/Multiplier.java
new file mode 100644
index 0000000..c1cde5c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/Multiplier.java
@@ -0,0 +1,54 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.multiplier;
+
+import java.io.File;
+
+import org.apache.airavata.xbaya.test.service.Service;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.xwsif_runtime.XmlElementBasedStub;
+
+public interface Multiplier extends XmlElementBasedStub {
+
+    /**
+     * SERVICE_NAME
+     */
+    public final static String SERVICE_NAME = "MultiplierService";
+
+    /**
+     * WSDL_NAME
+     */
+    public final static String WSDL_NAME = "multiplier.wsdl";
+
+    /**
+     * WSDL_PATH
+     */
+    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
+
+    /**
+     * @param input
+     *            the input message
+     * @return the output message
+     */
+    public XmlElement multiply(XmlElement input);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierImpl.java
new file mode 100644
index 0000000..6b53c0a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierImpl.java
@@ -0,0 +1,80 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.multiplier;
+
+import java.util.Random;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+import org.xmlpull.v1.builder.XmlNamespace;
+
+import xsul.XmlConstants;
+
+public class MultiplierImpl implements Multiplier {
+
+    private final static Logger logger = LoggerFactory.getLogger(MultiplierImpl.class);
+
+    /**
+     * @see org.apache.airavata.xbaya.test.service.multiplier.Multiplier#multiply(org.xmlpull.v1.builder.XmlElement)
+     */
+    public XmlElement multiply(XmlElement inputElement) {
+        logger.info(XMLUtil.xmlElementToString(inputElement));
+
+        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
+
+        XmlElement xElement = inputElement.requiredElement(null, "x");
+        XmlElement yElement = inputElement.requiredElement(null, "y");
+        String xString = xElement.requiredTextContent();
+        String yString = yElement.requiredTextContent();
+
+        int x = Integer.parseInt(xString);
+        int y = Integer.parseInt(yString);
+
+        Random random = new Random();
+        int msec = random.nextInt(10000);
+        logger.info("Sleep for " + msec + " msec");
+        try {
+            Thread.sleep(msec);
+        } catch (InterruptedException e) {
+            logger.error(e.getMessage(), e);
+        }
+
+        int z = x * y;
+
+        String zString = "" + z;
+
+        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("multipliertypens",
+                "http://www.extreme.indiana.edu/math/multiplier/xsd/");
+        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "MultiplyOutput");
+        XmlElement zElement = outputElement.addElement("z");
+        zElement.addChild(zString);
+
+        if (notifier != null) {
+            notifier.sendingResult(outputElement);
+        }
+        logger.info(XMLUtil.xmlElementToString(outputElement));
+        return outputElement;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierService.java
new file mode 100644
index 0000000..e4d910b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierService.java
@@ -0,0 +1,132 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.service.multiplier;
+
+import java.io.File;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsdl.WsdlDefinitions;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xservo.XService;
+import xsul.xservo_soap.XSoapDocLiteralService;
+import xsul.xservo_soap_http.HttpBasedServices;
+
+public class MultiplierService {
+
+    private final static String SERVICE_NAME = "MultiplierService";
+
+    private final static String BASE_WSDL_LOCATION = "wsdls/math/multiplier-wsdl.xml";
+
+    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/multiplier-wsdl.xml";
+
+    private final static Logger logger = LoggerFactory.getLogger(MultiplierService.class);
+
+    private HttpBasedServices httpServices;
+
+    private XService xservice;
+
+    private int port;
+
+    /**
+     * Constructs a MultiplierService.
+     * 
+     */
+    public MultiplierService() {
+        this(0);
+    }
+
+    /**
+     * Constructs a MultiplierService.
+     * 
+     * @param port
+     */
+    public MultiplierService(int port) {
+        this.port = port;
+    }
+
+    /**
+     * Runs the service.
+     */
+    public void run() {
+        this.httpServices = new HttpBasedServices(this.port);
+        logger.info("Server started on " + this.httpServices.getServerPort());
+
+        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
+        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
+                new MultiplierImpl()));
+        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
+        this.xservice.startService();
+        logger.info("Service started");
+        logger.info("Service WSDL available at " + getServiceWsdlLocation());
+    }
+
+    /**
+     * Returns the location of the WSDL.
+     * 
+     * @return The location of the WSDL
+     */
+    public String getServiceWsdlLocation() {
+        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
+    }
+
+    /**
+     * Returns the WSDL of the service.
+     * 
+     * @return The WSDL of the service.
+     */
+    public WsdlDefinitions getWsdl() {
+        return this.xservice.getWsdl();
+    }
+
+    /**
+     * Shutdowns the service.
+     */
+    public void shutdownServer() {
+        this.httpServices.getServer().shutdownServer();
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        try {
+            int port = 0;
+            if (args.length == 2) {
+                if ("-port".equalsIgnoreCase(args[0])) {
+                    port = Integer.parseInt(args[1]);
+                }
+            }
+            MultiplierService service = new MultiplierService(port);
+            service.run();
+            WsdlDefinitions wsdl = service.getWsdl();
+            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
+            XMLUtil.saveXML(wsdl, wsdlFile);
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/util/WorkflowCreator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/util/WorkflowCreator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/util/WorkflowCreator.java
new file mode 100644
index 0000000..708788a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/util/WorkflowCreator.java
@@ -0,0 +1,741 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.test.util;
+
+import java.awt.Point;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
+import org.apache.airavata.workflow.model.component.system.ConstantComponent;
+import org.apache.airavata.workflow.model.component.system.DoWhileComponent;
+import org.apache.airavata.workflow.model.component.system.EndDoWhileComponent;
+import org.apache.airavata.workflow.model.component.system.EndForEachComponent;
+import org.apache.airavata.workflow.model.component.system.EndifComponent;
+import org.apache.airavata.workflow.model.component.system.ForEachComponent;
+import org.apache.airavata.workflow.model.component.system.IfComponent;
+import org.apache.airavata.workflow.model.component.system.InputComponent;
+import org.apache.airavata.workflow.model.component.system.OutputComponent;
+import org.apache.airavata.workflow.model.component.system.ReceiveComponent;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.system.ConstantNode;
+import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
+import org.apache.airavata.workflow.model.graph.system.IfNode;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.system.ReceiveNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.test.service.adder.Adder;
+import org.apache.airavata.xbaya.test.service.approver.Approver;
+import org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdder;
+import org.apache.airavata.xbaya.test.service.arraygen.ArrayGenerator;
+import org.apache.airavata.xbaya.test.service.echo.Echo;
+import org.apache.airavata.xbaya.test.service.multiplier.Multiplier;
+
+public class WorkflowCreator {
+
+    /**
+     * GFAC_TEST_AWSDL
+     */
+    public static final String GFAC_TEST_AWSDL = "TestCMD_Example1_AWSDL.xml";
+
+    private Component inputComponent;
+
+    private Component outputComponent;
+
+    private LocalComponentRegistry componentRegistry;
+
+    private ConstantComponent constantComponent;
+
+    private ForEachComponent splitComponent;
+
+    private EndForEachComponent mergeComponent;
+
+    private IfComponent ifComponent;
+
+    private EndifComponent endifComponent;
+
+    private ReceiveComponent receiveComponent;
+
+    private DoWhileComponent doWhileComponent;
+
+    private EndDoWhileComponent endDoWhileComponent;
+
+    /**
+     * Constructs a WorkflowCreator.
+     */
+    public WorkflowCreator() {
+        this.componentRegistry = new LocalComponentRegistry(XBayaPathConstants.WSDL_DIRECTORY);
+        this.inputComponent = new InputComponent();
+        this.outputComponent = new OutputComponent();
+        this.constantComponent = new ConstantComponent();
+        this.splitComponent = new ForEachComponent();
+        this.mergeComponent = new EndForEachComponent();
+        this.ifComponent = new IfComponent();
+        this.endifComponent = new EndifComponent();
+        this.receiveComponent = new ReceiveComponent();
+        this.doWhileComponent = new DoWhileComponent();
+        this.endDoWhileComponent = new EndDoWhileComponent();
+    }
+
+    /**
+     * @return The graph
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createSimpleMathWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("Simple math workflow");
+        workflow.setDescription("Simple math workflow");
+
+        Graph graph = workflow.getGraph();
+
+        // Adder node
+        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
+        Node adderNode = workflow.addNode(adderComp);
+        adderNode.setPosition(new Point(250, 100));
+
+        // Input parameter node 1
+        InputNode paramNode1 = (InputNode) workflow.addNode(this.inputComponent);
+        paramNode1.setPosition(new Point(50, 50));
+
+        // Input parameter node 2
+        InputNode paramNode2 = (InputNode) workflow.addNode(this.inputComponent);
+        paramNode2.setPosition(new Point(50, 120));
+
+        // Output parameter
+        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
+        outParamNode.setPosition(new Point(300, 220));
+
+        // Connect ports
+        graph.addEdge(paramNode1.getOutputPort(0), adderNode.getInputPort(0));
+        graph.addEdge(paramNode2.getOutputPort(0), adderNode.getInputPort(1));
+        graph.addEdge(adderNode.getOutputPort(0), outParamNode.getInputPort(0));
+
+        // Set the default values
+        // This needs to be after connection.
+        String paramValue1 = "2";
+        paramNode1.setDefaultValue(paramValue1);
+        String paramValue2 = "3";
+        paramNode2.setDefaultValue(paramValue2);
+        return workflow;
+    }
+
+    /**
+     * @return The graph
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createMathWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("Math workflow");
+        workflow.setDescription("A workflow that calculates (a + b) * c.");
+
+        Graph graph = workflow.getGraph();
+
+        // Adder node
+        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
+
+        Node adderNode1 = workflow.addNode(adderComp);
+        adderNode1.setPosition(new Point(170, 50));
+
+        // Multiplier node
+        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);
+
+        Node multiNode = workflow.addNode(multiComp);
+        multiNode.setPosition(new Point(320, 130));
+
+        // Input node 1
+        InputNode inputNode1 = (InputNode) workflow.addNode(this.inputComponent);
+        inputNode1.setPosition(new Point(20, 30));
+
+        // Input node 2
+        InputNode inputNode2 = (InputNode) workflow.addNode(this.inputComponent);
+        inputNode2.setPosition(new Point(20, 100));
+
+        // Input node 3
+        InputNode inputNode3 = (InputNode) workflow.addNode(this.inputComponent);
+        inputNode3.setPosition(new Point(20, 170));
+
+        // Output
+        OutputNode outputNode = (OutputNode) workflow.addNode(this.outputComponent);
+        outputNode.setPosition(new Point(500, 130));
+
+        // Connect ports
+        graph.addEdge(inputNode1.getOutputPort(0), adderNode1.getInputPort(0));
+        graph.addEdge(inputNode2.getOutputPort(0), adderNode1.getInputPort(1));
+        graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
+        graph.addEdge(inputNode3.getOutputPort(0), multiNode.getInputPort(1));
+        graph.addEdge(multiNode.getOutputPort(0), outputNode.getInputPort(0));
+
+        // Set the default values
+        // This needs to be after connection.
+        inputNode1.setConfiguredName("a");
+        inputNode2.setConfiguredName("b");
+        inputNode3.setConfiguredName("c");
+        inputNode1.setConfigured(true);
+        inputNode2.setConfigured(true);
+        inputNode3.setConfigured(true);
+        inputNode1.setDefaultValue("2");
+        inputNode2.setDefaultValue("3");
+        inputNode3.setDefaultValue("4");
+        outputNode.setConfiguredName("z");
+        outputNode.setConfigured(true);
+
+        return workflow;
+    }
+
+    /**
+     * @return The graph
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createComplexMathWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("Complex math workflow");
+        workflow.setDescription("Complex math workflow");
+
+        Graph graph = workflow.getGraph();
+
+        // Adder nodes
+        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
+
+        Node adderNode1 = workflow.addNode(adderComp);
+        adderNode1.setPosition(new Point(170, 50));
+
+        Node adderNode2 = workflow.addNode(adderComp);
+        adderNode2.setPosition(new Point(170, 210));
+
+        // Multiplier node
+        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);
+
+        Node multiNode = workflow.addNode(multiComp);
+        multiNode.setPosition(new Point(320, 130));
+
+        // Input node 1
+        InputNode inputNode1 = (InputNode) workflow.addNode(this.inputComponent);
+        inputNode1.setPosition(new Point(20, 30));
+
+        // Input node 2
+        InputNode inputNode2 = (InputNode) workflow.addNode(this.inputComponent);
+        inputNode2.setPosition(new Point(20, 100));
+
+        // Input node 3
+        InputNode inputNode3 = (InputNode) workflow.addNode(this.inputComponent);
+        inputNode3.setPosition(new Point(20, 170));
+
+        // Input node 4
+        InputNode inputNode4 = (InputNode) workflow.addNode(this.inputComponent);
+        inputNode4.setPosition(new Point(20, 240));
+
+        // Output
+        OutputNode outputNode = (OutputNode) workflow.addNode(this.outputComponent);
+        outputNode.setPosition(new Point(500, 130));
+
+        // Connect ports
+        graph.addEdge(inputNode1.getOutputPort(0), adderNode1.getInputPort(0));
+        graph.addEdge(inputNode2.getOutputPort(0), adderNode1.getInputPort(1));
+        graph.addEdge(inputNode3.getOutputPort(0), adderNode2.getInputPort(0));
+        graph.addEdge(inputNode4.getOutputPort(0), adderNode2.getInputPort(1));
+        graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
+        graph.addEdge(adderNode2.getOutputPort(0), multiNode.getInputPort(1));
+        graph.addEdge(multiNode.getOutputPort(0), outputNode.getInputPort(0));
+
+        // Set the default values
+        // This needs to be after connection.
+        inputNode1.setConfiguredName("a");
+        inputNode2.setConfiguredName("b");
+        inputNode3.setConfiguredName("c");
+        inputNode4.setConfiguredName("d");
+        inputNode1.setDescription("This is the first input.");
+        inputNode2.setDescription("This is the second input.");
+        inputNode3.setDescription("This is the third input.");
+        inputNode4.setDescription("This is the fourth input.");
+        inputNode1.setConfigured(true);
+        inputNode2.setConfigured(true);
+        inputNode3.setConfigured(true);
+        inputNode4.setConfigured(true);
+        inputNode1.setDefaultValue("2");
+        inputNode2.setDefaultValue("3");
+        inputNode3.setDefaultValue("4");
+        inputNode4.setDefaultValue("5");
+        outputNode.setConfiguredName("z");
+        outputNode.setConfigured(true);
+
+        return workflow;
+    }
+
+    /**
+     * @return The graph
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createMathWithConstWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
+
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("Math with const");
+        workflow.setDescription("Math with const");
+
+        Graph graph = workflow.getGraph();
+
+        // Adder node
+        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
+        Node adderNode = workflow.addNode(adderComp);
+        adderNode.setPosition(new Point(250, 100));
+
+        // Input parameter node
+        InputNode inputNode = (InputNode) workflow.addNode(this.inputComponent);
+        inputNode.setPosition(new Point(50, 50));
+
+        // Constant node
+        ConstantNode constantNode = (ConstantNode) workflow.addNode(this.constantComponent);
+        constantNode.setPosition(new Point(50, 120));
+
+        // Output parameter
+        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
+        outParamNode.setPosition(new Point(300, 220));
+
+        // Connect ports
+        graph.addEdge(inputNode.getOutputPort(0), adderNode.getInputPort(0));
+        graph.addEdge(constantNode.getOutputPort(0), adderNode.getInputPort(1));
+        graph.addEdge(adderNode.getOutputPort(0), outParamNode.getInputPort(0));
+
+        // Set the default value of an input and the constant.
+        // This needs to be after connection.
+        String paramValue1 = "2";
+        inputNode.setDefaultValue(paramValue1);
+        String paramValue2 = "3";
+        constantNode.setValue(paramValue2);
+        return workflow;
+    }
+
+    /**
+     * @return The workflow
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createArrayWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("Array test");
+        workflow.setDescription("A workflow that tests arrays");
+
+        Graph graph = workflow.getGraph();
+
+        // n
+        InputNode inputN = (InputNode) workflow.addNode(this.inputComponent);
+        inputN.setPosition(new Point(0, 80));
+
+        // Array generator
+        Component arrayGeneratorComponent = this.componentRegistry.getComponent(ArrayGenerator.WSDL_PATH);
+        Node arrayGenerator = workflow.addNode(arrayGeneratorComponent);
+        arrayGenerator.setPosition(new Point(150, 80));
+
+        // Array adder
+        Component arrayAdderComponent = this.componentRegistry.getComponent(ArrayAdder.WSDL_PATH);
+        Node arrayAdder = workflow.addNode(arrayAdderComponent);
+        arrayAdder.setPosition(new Point(400, 80));
+
+        // Output
+        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
+        output.setConfiguredName("output");
+        output.setPosition(new Point(550, 80));
+
+        // Connect ports
+        graph.addEdge(inputN.getOutputPort(0), arrayGenerator.getInputPort(0));
+        graph.addEdge(arrayGenerator.getOutputPort(0), arrayAdder.getInputPort(0));
+        graph.addEdge(arrayAdder.getOutputPort(0), output.getInputPort(0));
+
+        // Set the default values
+        // This needs to be after connection.
+        String n = "5";
+        inputN.setDefaultValue(n);
+
+        return workflow;
+    }
+
+    /**
+     * @return The workflow
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createForEachWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("ForEach test");
+        workflow.setDescription("Workflow that tests if");
+
+        Graph graph = workflow.getGraph();
+
+        // x
+        InputNode inputX = (InputNode) workflow.addNode(this.inputComponent);
+        inputX.setPosition(new Point(0, 0));
+
+        // n
+        InputNode inputN = (InputNode) workflow.addNode(this.inputComponent);
+        inputN.setPosition(new Point(0, 80));
+
+        // Array generator
+        Component arrayGeneratorComponent = this.componentRegistry.getComponent(ArrayGenerator.WSDL_PATH);
+        Node arrayGenerator = workflow.addNode(arrayGeneratorComponent);
+        arrayGenerator.setPosition(new Point(120, 80));
+
+        // Split
+        Node split = workflow.addNode(this.splitComponent);
+        split.setPosition(new Point(310, 80));
+
+        // Adder
+        Component adderComponent = this.componentRegistry.getComponent(Adder.WSDL_PATH);
+        Node adder = workflow.addNode(adderComponent);
+        adder.setPosition(new Point(440, 40));
+
+        // Merge
+        Node merge = workflow.addNode(this.mergeComponent);
+        merge.setPosition(new Point(580, 40));
+
+        // Output
+        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
+        output.setConfiguredName("output");
+        output.setPosition(new Point(720, 40));
+
+        // Connect ports
+        graph.addEdge(inputX.getOutputPort(0), adder.getInputPort(0));
+        graph.addEdge(inputN.getOutputPort(0), arrayGenerator.getInputPort(0));
+        graph.addEdge(arrayGenerator.getOutputPort(0), split.getInputPort(0));
+        graph.addEdge(split.getOutputPort(0), adder.getInputPort(1));
+        graph.addEdge(adder.getOutputPort(0), merge.getInputPort(0));
+        graph.addEdge(merge.getOutputPort(0), output.getInputPort(0));
+
+        // Set the default values
+        // This needs to be after connection.
+        String x = "2";
+        inputX.setDefaultValue(x);
+        String n = "3";
+        inputN.setDefaultValue(n);
+
+        return workflow;
+    }
+
+    /**
+     * @return The workflow
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     * @throws ComponentException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createIfWorkflow() throws GraphException, ComponentException, ComponentRegistryException {
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("If test");
+        workflow.setDescription("Workflow that tests if");
+
+        Graph graph = workflow.getGraph();
+
+        // x
+        InputNode x = (InputNode) workflow.addNode(this.inputComponent);
+        x.setPosition(new Point(10, 10));
+
+        // y
+        InputNode y = (InputNode) workflow.addNode(this.inputComponent);
+        y.setPosition(new Point(10, 90));
+
+        // const0
+        ConstantNode const0 = (ConstantNode) workflow.addNode(this.constantComponent);
+        const0.setPosition(new Point(20, 180));
+
+        // if
+        IfNode ifNode = (IfNode) workflow.addNode(this.ifComponent);
+        ifNode.setPosition(new Point(170, 180));
+
+        // Adder nodes
+        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
+
+        Node adder = workflow.addNode(adderComp);
+        adder.setPosition(new Point(400, 10));
+
+        // Multiplier node
+        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);
+
+        Node multiplier = workflow.addNode(multiComp);
+        multiplier.setPosition(new Point(400, 90));
+
+        // endif
+        Node endif = workflow.addNode(this.endifComponent);
+        endif.setPosition(new Point(550, 40));
+
+        // Output
+        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
+        output.setConfiguredName("output");
+        output.setPosition(new Point(700, 40));
+
+        // Connect ports
+        graph.addEdge(x.getOutputPort(0), adder.getInputPort(0));
+        graph.addEdge(x.getOutputPort(0), multiplier.getInputPort(0));
+        graph.addEdge(y.getOutputPort(0), adder.getInputPort(1));
+        graph.addEdge(y.getOutputPort(0), multiplier.getInputPort(1));
+        graph.addEdge(const0.getOutputPort(0), ifNode.getInputPort(0));
+        graph.addEdge(ifNode.getControlOutPorts().get(0), adder.getControlInPort());
+        graph.addEdge(ifNode.getControlOutPorts().get(1), multiplier.getControlInPort());
+        graph.addEdge(adder.getOutputPort(0), endif.getInputPort(0));
+        graph.addEdge(multiplier.getOutputPort(0), endif.getInputPort(1));
+        graph.addEdge(endif.getOutputPort(0), output.getInputPort(0));
+
+        // Set the default values
+        // This needs to be after connection.
+        x.setDefaultValue("2");
+        y.setDefaultValue("3");
+        const0.setValue("adder");
+        ifNode.setXPath("$0 = 'adder'");
+
+        return workflow;
+    }
+
+    /**
+     * @return The workflow
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     * @throws ComponentException
+     */
+    public Workflow createReceiveWorkflow() throws GraphException, ComponentException, ComponentRegistryException {
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("Receive test");
+        workflow.setDescription("Workflow that tests receive");
+
+        Graph graph = workflow.getGraph();
+
+        // Adder nodes
+        Component echoComponent = this.componentRegistry.getComponent(Echo.WSDL_PATH);
+
+        Node echo = workflow.addNode(echoComponent);
+        echo.setPosition(new Point(40, 40));
+
+        // receive
+        ReceiveNode receive = (ReceiveNode) workflow.addNode(this.receiveComponent);
+        receive.setPosition(new Point(200, 200));
+
+        // Output
+        OutputNode output1 = (OutputNode) workflow.addNode(this.outputComponent);
+        output1.setPosition(new Point(350, 40));
+
+        OutputNode output2 = (OutputNode) workflow.addNode(this.outputComponent);
+        output2.setPosition(new Point(350, 200));
+
+        // Connect ports
+        graph.addEdge(receive.getEPRPort(), echo.getInputPort(0));
+        graph.addEdge(echo.getOutputPort(0), output1.getInputPort(0));
+        graph.addEdge(receive.getOutputPort(0), output2.getInputPort(0));
+        graph.addEdge(echo.getControlOutPorts().get(0), receive.getControlInPort());
+
+        // Confugure
+        output1.setConfiguredName("output1");
+        output1.setConfigured(true);
+        output2.setConfiguredName("output2");
+        output2.setConfigured(true);
+
+        return workflow;
+
+    }
+
+    /**
+     * @return The graph
+     * @throws ComponentException
+     * @throws GraphException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createGFacWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
+
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("GFac test workflow");
+        workflow.setDescription("GFac test workflow");
+
+        Graph graph = workflow.getGraph();
+
+        // Adder node
+        Component gfacComp = this.componentRegistry.getComponent(GFAC_TEST_AWSDL);
+        Node gfacNode = workflow.addNode(gfacComp);
+        gfacNode.setPosition(new Point(250, 100));
+
+        // Input parameter node 1
+        InputNode paramNode1 = (InputNode) workflow.addNode(this.inputComponent);
+        paramNode1.setPosition(new Point(50, 50));
+        String paramValue1 = "300";
+        paramNode1.setDefaultValue(paramValue1);
+
+        // Output parameter
+        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
+        outParamNode.setPosition(new Point(300, 220));
+
+        // Connect ports
+        graph.addEdge(paramNode1.getOutputPort(0), gfacNode.getInputPort(0));
+        graph.addEdge(gfacNode.getOutputPort(0), outParamNode.getInputPort(0));
+
+        return workflow;
+    }
+
+    /**
+     * @return The workflow created.
+     * @throws GraphException
+     * @throws ComponentException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createLoanWorkflow() throws GraphException, ComponentException, ComponentRegistryException {
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("Loan Approval");
+        workflow.setDescription("Loan Approval");
+
+        Graph graph = workflow.getGraph();
+
+        // amount
+        InputNode amount = (InputNode) workflow.addNode(this.inputComponent);
+        amount.setPosition(new Point(10, 10));
+
+        // if
+        IfNode ifNode = (IfNode) workflow.addNode(this.ifComponent);
+        ifNode.setPosition(new Point(200, 100));
+
+        // Approver nodes
+        Component approverComponent = this.componentRegistry.getComponent(Approver.WSDL_PATH);
+
+        Node approver = workflow.addNode(approverComponent);
+        approver.setPosition(new Point(350, 10));
+
+        // const
+        ConstantNode constYes = (ConstantNode) workflow.addNode(this.constantComponent);
+        constYes.setPosition(new Point(350, 200));
+
+        // endif
+        Node endif = workflow.addNode(this.endifComponent);
+        endif.setPosition(new Point(550, 100));
+
+        // Output
+        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
+        output.setPosition(new Point(700, 100));
+
+        // Connect ports
+        graph.addEdge(amount.getOutputPort(0), approver.getInputPort(0));
+        graph.addEdge(amount.getOutputPort(0), ifNode.getInputPort(0));
+        graph.addEdge(ifNode.getControlOutPorts().get(0), approver.getControlInPort());
+        graph.addEdge(ifNode.getControlOutPorts().get(1), constYes.getControlInPort());
+        graph.addEdge(approver.getOutputPort(0), endif.getInputPort(0));
+        graph.addEdge(constYes.getOutputPort(0), endif.getInputPort(1));
+        graph.addEdge(endif.getOutputPort(0), output.getInputPort(0));
+
+        // Set the default values
+        // This needs to be after connection.
+        amount.setDefaultValue("500");
+        constYes.setValue("Yes");
+        ifNode.setXPath("$0 > 1000");
+        output.setConfiguredName("accept");
+        output.setConfigured(true);
+
+        return workflow;
+    }
+    /**
+     * Create a dowhile workflow
+     * @return Workflow created.
+     * @throws GraphException
+     * @throws ComponentException
+     * @throws ComponentRegistryException
+     */
+    public Workflow createDoWhileWorkflow() throws GraphException, ComponentException, ComponentRegistryException {
+        Workflow workflow = new Workflow();
+
+        // Name, description
+        workflow.setName("Do While");
+        workflow.setDescription("Do While");
+
+        Graph graph = workflow.getGraph();
+
+        // amount
+        InputNode amount = (InputNode) workflow.addNode(this.inputComponent);
+        amount.setPosition(new Point(10, 10));
+
+        // if
+        DoWhileNode doWhileNode = (DoWhileNode) workflow.addNode(this.doWhileComponent);
+        doWhileNode.setPosition(new Point(200, 100));
+
+        // Approver nodes
+        Component approverComponent = this.componentRegistry.getComponent(Approver.WSDL_PATH);
+
+        Node approver = workflow.addNode(approverComponent);
+        approver.setPosition(new Point(350, 10));
+
+        // const
+        ConstantNode constYes = (ConstantNode) workflow.addNode(this.constantComponent);
+        constYes.setPosition(new Point(350, 200));
+
+        // endif
+        Node endDoWhile = workflow.addNode(this.endDoWhileComponent);
+        endDoWhile.setPosition(new Point(550, 100));
+
+        // Output
+        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
+        output.setPosition(new Point(700, 100));
+
+        // Connect ports
+        graph.addEdge(amount.getOutputPort(0), approver.getInputPort(0));
+        graph.addEdge(amount.getOutputPort(0), doWhileNode.getInputPort(0));
+        graph.addEdge(doWhileNode.getControlOutPorts().get(0), approver.getControlInPort());
+        graph.addEdge(doWhileNode.getControlOutPorts().get(1), constYes.getControlInPort());
+        graph.addEdge(approver.getOutputPort(0), endDoWhile.getInputPort(0));
+        graph.addEdge(constYes.getOutputPort(0), endDoWhile.getInputPort(1));
+        graph.addEdge(endDoWhile.getOutputPort(0), output.getInputPort(0));
+
+        // Set the default values
+        // This needs to be after connection.
+        amount.setDefaultValue("0");
+        constYes.setValue("Yes");
+        doWhileNode.setXpath("$1 = 1");
+        output.setConfiguredName("accept");
+        output.setConfigured(true);
+
+        return workflow;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
new file mode 100644
index 0000000..0e36d3e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
@@ -0,0 +1,850 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui;
+
+import java.awt.BorderLayout;
+import java.awt.Container;
+import java.awt.Dimension;
+import java.awt.Toolkit;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ContainerEvent;
+import java.awt.event.ContainerListener;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.swing.JFrame;
+import javax.swing.JOptionPane;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import javax.swing.WindowConstants;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.ws.monitor.event.Event;
+import org.apache.airavata.ws.monitor.event.Event.Type;
+import org.apache.airavata.ws.monitor.event.EventListener;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.core.generators.WorkflowFiler;
+import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
+import org.apache.airavata.xbaya.ui.dialogs.ErrorWindow;
+import org.apache.airavata.xbaya.ui.dialogs.workflow.WorkflowPropertyWindow;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent.GraphCanvasEventType;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvasListener;
+import org.apache.airavata.xbaya.ui.menues.XBayaMenu;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.views.ComponentViewer;
+import org.apache.airavata.xbaya.ui.views.JCRBrowserPanel;
+import org.apache.airavata.xbaya.ui.views.MonitorPanel;
+import org.apache.airavata.xbaya.ui.views.PortViewer;
+import org.apache.airavata.xbaya.ui.widgets.ScrollPanel;
+import org.apache.airavata.xbaya.ui.widgets.TabLabelButton;
+import org.apache.airavata.xbaya.ui.widgets.XBayaToolBar;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelector;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+public class XBayaGUI implements EventListener, XBayaExecutionModeListener {
+
+    private static final Logger logger = LoggerFactory.getLogger(XBayaGUI.class);
+
+    private static final int STATIC_MENU_ITEMS = 4;
+
+    private XBayaEngine engine;
+
+    private JFrame frame;
+
+    private XBayaMenu menu;
+
+    private List<GraphCanvas> graphCanvases = new LinkedList<GraphCanvas>();
+
+    private PortViewer portViewer;
+
+    private ComponentViewer componentViewer;
+
+    private ComponentSelector componentSelector;
+
+    private MonitorPanel monitorPane;
+
+    private XBayaToolBar toolbar;
+
+    private ErrorWindow errorWindow;
+
+    private JTabbedPane rightBottomTabbedPane;
+
+    private JTabbedPane graphTabbedPane;
+
+    private boolean graphPanelMaximized;
+
+    private int previousMainDividerLocation;
+
+    private int previousRightDividerLocation;
+
+    private JSplitPane mainSplitPane;
+
+    private JSplitPane leftSplitPane;
+
+    private JSplitPane rightSplitPane;
+
+    private JTabbedPane componentTabbedPane;
+
+    private ScrollPanel compTreeXBayapanel;
+
+	private WorkflowFiler graphFiler;
+
+    private WorkflowPropertyWindow workflowPropertiesWindow;
+
+    /**
+     * Constructs an XBayaEngine.
+     * 
+     * @param engine
+     */
+    public XBayaGUI(XBayaEngine engine) {
+        this.engine = engine;
+        this.engine.getMonitor().addEventListener(this);
+        graphFiler = new WorkflowFiler(engine);
+        engine.getConfiguration().registerExecutionModeChangeListener(this);
+
+        try {
+            SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    init();
+                }
+            });
+        } catch (InterruptedException e) {
+            // Shouldn't happen.
+            throw new WorkflowRuntimeException(e);
+        } catch (InvocationTargetException e) {
+            // Shouldn't happen.
+        	//It happened
+        	/* exception occurs when xbaya is opened twice from the jvm
+        	 * org.apache.airavata.xbaya.XBayaRuntimeException: java.lang.reflect.InvocationTargetException
+				at org.apache.airavata.xbaya.gui.XBayaGUI.<init>(XBayaGUI.java:148)
+				at org.apache.airavata.xbaya.XBayaEngine.<init>(XBayaEngine.java:106)
+				at org.apache.airavata.xbaya.XBaya.<init>(XBaya.java:51)
+				at org.ogce.paramchem.XBayaLauncher.run(XBayaLauncher.java:44)
+				at java.lang.Thread.run(Thread.java:662)
+			Caused by: java.lang.reflect.InvocationTargetException
+				at java.awt.EventQueue.invokeAndWait(EventQueue.java:1042)
+				at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1326)
+				at org.apache.airavata.xbaya.gui.XBayaGUI.<init>(XBayaGUI.java:138)
+				... 4 more
+        	 */
+            throw new WorkflowRuntimeException(e);
+        }
+        
+        // Following suppsed to jump in the middle to save unsaved workflows when exiting xbaya
+        // but its not working because the UI is already disposed it seems :(
+//        Runtime.getRuntime().addShutdownHook(new Thread(){
+//        	@Override
+//        	public void run() {
+//        		while (getGraphCanvases().size()>0){
+//        			removeGraphCanvasFromIndex(0);
+//        		}
+//        	}
+//        });
+    }
+
+    /**
+     * Returns the notificationPane.
+     * 
+     * @return The notificationPane
+     */
+    public MonitorPanel getMonitorPane() {
+        return this.monitorPane;
+    }
+
+    /**
+     * Returns the ComponentTreeViewer.
+     * 
+     * @return The ComponentTreeViewer
+     */
+    public ComponentSelector getComponentSelector() {
+        return this.componentSelector;
+    }
+
+    /**
+     * Returns the ErrorWindow.
+     * 
+     * @return the errorWindow
+     */
+    public ErrorWindow getErrorWindow() {
+        return this.errorWindow;
+    }
+
+    /**
+     * Returns the Frame.
+     * 
+     * @return the Frame
+     */
+    public JFrame getFrame() {
+        return this.frame;
+    }
+
+    /**
+     * @return The list of GraphCanvases.
+     */
+    public List<GraphCanvas> getGraphCanvases() {
+        return this.graphCanvases;
+    }
+
+    /**
+     * Return the active GraphPanel.
+     * 
+     * @return The GraphPanel
+     */
+    public GraphCanvas getGraphCanvas() {
+        int index = this.graphTabbedPane.getSelectedIndex();
+        if (index!=-1) {
+			return this.graphCanvases.get(index);
+		}else{
+			return null;
+		}
+    }
+
+    /**
+     * Returns the toolbar.
+     * 
+     * @return The toolbar
+     */
+    public XBayaToolBar getToolbar() {
+    	if (toolbar==null){
+    		this.toolbar = new XBayaToolBar(this.engine);
+    	}
+        return this.toolbar;
+    }
+
+    public GraphCanvas newGraphCanvas(boolean focus) {
+    	return newGraphCanvas(focus, false);
+    }
+    
+    /**
+     * Creates a new graph tab.
+     * 
+     * This method needs to be called by Swing event thread.
+     * 
+     * @param focus
+     * 
+     * @return The graph canvas created
+     */
+    public GraphCanvas newGraphCanvas(boolean focus, boolean withID) {
+        GraphCanvas newGraphCanvas = new GraphCanvas(this.engine);
+        this.graphCanvases.add(newGraphCanvas);
+        this.graphTabbedPane.addTab(newGraphCanvas.getWorkflow().getName(), newGraphCanvas.getSwingComponent());
+        final int index = graphTabbedPane.getTabCount()-1;
+		TabLabelButton tabLabelButton = new TabLabelButton(graphTabbedPane,"Close this workflow");
+		graphTabbedPane.setTabComponentAt(index, tabLabelButton); 
+		tabLabelButton.setCloseButtonListener(new ActionListener(){
+			@Override
+			public void actionPerformed(ActionEvent e) {
+				removeGraphCanvasFromIndex(index);				
+			}
+		});
+        graphTabbedPane.addContainerListener(new ContainerListener(){
+
+			@Override
+			public void componentAdded(ContainerEvent event) {
+			}
+
+			@Override
+			public void componentRemoved(ContainerEvent event) {
+				List<GraphCanvas> graphCanvases = engine.getGUI().getGraphCanvases();
+				for (GraphCanvas graphCanvas : graphCanvases) {
+					if (graphCanvas.getSwingComponent()==event.getComponent()){
+						if (graphCanvas.isWorkflowChanged()){
+							setFocus(graphCanvas);
+							if (JOptionPane.showConfirmDialog(null, "The workflow '"+graphCanvas.getWorkflow().getName()+"' has been modified. Save changes?", "Save Workflow", JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
+								graphFiler.saveWorkflow(graphCanvas);
+							}
+						}
+						break;
+					}
+				}
+			}
+        	
+        });
+        if (focus) {
+            setFocus(newGraphCanvas);
+        }
+        newGraphCanvas.addGraphCanvasListener(this.componentViewer);
+        newGraphCanvas.addGraphCanvasListener(this.portViewer);
+        newGraphCanvas.addGraphCanvasListener(new GraphCanvasListener() {
+
+            public void graphCanvasChanged(GraphCanvasEvent event) {
+                GraphCanvasEventType type = event.getType();
+                final GraphCanvas graphCanvas = event.getGraphCanvas();
+                final Workflow workflow = event.getWorkflow();
+                switch (type) {
+                case GRAPH_LOADED:
+                case NAME_CHANGED:
+                    SwingUtilities.invokeLater(new Runnable() {
+                        public void run() {
+                            String name = workflow.getName();
+
+                            // Change the name of the tab.
+                            updateTabTitle(graphCanvas, workflow);
+
+                            // Change the name of the frame.
+                            setFrameName(name);
+                        }
+
+						
+                    });
+                    break;
+                case NODE_SELECTED:
+                case INPUT_PORT_SELECTED:
+                case OUTPUT_PORT_SELECTED:
+                    // Do nothing
+                case WORKFLOW_CHANGED:
+                	updateTabTitle(graphCanvas,graphCanvas.getWorkflow());
+                	setFrameName(workflow.getName());
+                	for (ChangeListener listener:tabChangeListeners){
+                		try{
+                			listener.stateChanged(null);
+                		}catch(Exception e){
+                			e.printStackTrace();
+                		}
+                	}
+                }
+            }
+            private void updateTabTitle(
+					final GraphCanvas graphCanvas,
+					final Workflow workflow) {
+				int index = XBayaGUI.this.graphTabbedPane.indexOfComponent(graphCanvas.getSwingComponent());
+                String newTitle = workflow.getName();
+                if (graphCanvas.isWorkflowChanged()){
+                	newTitle="*"+newTitle;
+                }
+				XBayaGUI.this.graphTabbedPane.setTitleAt(index, newTitle);
+			}
+        });
+        if (withID){
+        	getWorkflowPropertyWindow().show();
+        }
+        return newGraphCanvas;
+    }
+
+    /**
+     * @param graphCanvas
+     */
+    public void setFocus(GraphCanvas graphCanvas) {
+        this.graphTabbedPane.setSelectedComponent(graphCanvas.getSwingComponent());
+    }
+
+    /**
+     * Selects a canvas with a specified workflow if any; otherwise create one.
+     * 
+     * This method needs to be called by Swing event thread.
+     * 
+     * @param workflow
+     */
+    public void selectOrCreateGraphCanvas(Workflow workflow) {
+        GraphCanvas graphCanvas = null;
+        for (GraphCanvas canvas : this.graphCanvases) {
+            if (workflow == canvas.getWorkflow()) {
+                graphCanvas = canvas;
+            }
+        }
+        if (graphCanvas == null) {
+            graphCanvas = newGraphCanvas(true);
+            graphCanvas.setWorkflow(workflow);
+        } else {
+            setFocus(graphCanvas);
+        }
+    }
+    
+    private List<ChangeListener> tabChangeListeners=new ArrayList<ChangeListener>();
+
+	private JCRBrowserPanel jcrBrowserPanel;
+    
+    public void addWorkflowTabChangeListener(ChangeListener listener){
+		graphTabbedPane.addChangeListener(listener);
+		tabChangeListeners.add(listener);
+    }
+    
+    public void removeWorkflowTabChangeListener(ChangeListener listener){
+		graphTabbedPane.removeChangeListener(listener);
+		tabChangeListeners.remove(listener);
+    }
+    /**
+     * Closes the selected graph canvas.
+     * 
+     * This method needs to be called by Swing event thread.
+     */
+    public void closeGraphCanvas() {
+        removeGraphCanvasFromIndex(this.graphTabbedPane.getSelectedIndex());
+    	//I dont know why but aparently you have to have atleast one tab present
+//    	newGraphCanvas(true);
+    }
+
+    public boolean closeAllGraphCanvas(){
+    	while (graphTabbedPane.getTabCount()>0){
+    		if (!removeGraphCanvasFromIndex(0)){
+    			return false;
+    		}
+    	}
+		return true;
+    	//I dont know why but aparently you have to have atleast one tab present
+//    	newGraphCanvas(true);
+    }
+    
+	private boolean removeGraphCanvasFromIndex(int index) {
+		boolean actionSuccess=true;
+		if ((graphTabbedPane.getTabCount()>0) && (index<this.graphTabbedPane.getTabCount())){
+			GraphCanvas graphCanvas = graphCanvases.get(index);
+			if (graphCanvas.isWorkflowChanged()){
+				int result = JOptionPane.showConfirmDialog(frame, "'"+graphCanvas.getWorkflow().getName()+"' has been modified. Save changes?", "Save Workflow", JOptionPane.YES_NO_CANCEL_OPTION);
+				try {
+					if (result==JOptionPane.YES_OPTION){
+						graphFiler.saveWorkflow(graphCanvas);
+						if (graphCanvas.isWorkflowChanged()){
+							//if cancelled while trying to save
+							actionSuccess=false;
+						}
+					}else if (result==JOptionPane.CANCEL_OPTION){
+						actionSuccess=false;
+					}
+						
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+			if (actionSuccess) {
+				graphCanvases.remove(index);
+				graphTabbedPane.removeTabAt(index);
+				activeTabChanged();
+			}
+		}
+		return actionSuccess;
+	}
+    
+    /**
+     * Selects the next graph canvas.
+     * 
+     * This method needs to be called by Swing event thread.
+     */
+    public void selectNextGraphCanvas() {
+        int count = this.graphTabbedPane.getTabCount();
+        int index = this.graphTabbedPane.getSelectedIndex();
+        index = (index + 1) % count;
+        this.graphTabbedPane.setSelectedIndex(index);
+    }
+
+    /**
+     * Toggles the maximization of the Graph Panel.
+     */
+    public void toggleMaximizeGraphPanel() {
+        if (XBayaGUI.this.graphPanelMaximized) {
+            unmaximizeGraphPanel();
+        } else {
+            maximizeGraphPanel();
+        }
+    }
+
+    /**
+     * Maximizes the Graph Panel.
+     */
+    public void maximizeGraphPanel() {
+        if (!XBayaGUI.this.graphPanelMaximized) {
+            XBayaGUI.this.graphPanelMaximized = true;
+
+            SwingUtilities.invokeLater(new Runnable() {
+                public void run() {
+                    XBayaGUI.this.previousMainDividerLocation = XBayaGUI.this.mainSplitPane.getDividerLocation();
+                    XBayaGUI.this.previousRightDividerLocation = XBayaGUI.this.rightSplitPane.getDividerLocation();
+                    XBayaGUI.this.mainSplitPane.setDividerLocation(0.0);
+                    XBayaGUI.this.rightSplitPane.setDividerLocation(1.0);
+                }
+            });
+        }
+    }
+
+    /**
+     * Set the size of the graph panel to the original.
+     */
+    public void unmaximizeGraphPanel() {
+        if (XBayaGUI.this.graphPanelMaximized) {
+            XBayaGUI.this.graphPanelMaximized = false;
+
+            SwingUtilities.invokeLater(new Runnable() {
+                public void run() {
+                    XBayaGUI.this.mainSplitPane.setDividerLocation(XBayaGUI.this.previousMainDividerLocation);
+                    XBayaGUI.this.rightSplitPane.setDividerLocation(XBayaGUI.this.previousRightDividerLocation);
+                }
+            });
+        }
+    }
+
+    /**
+     * Adds a selected component as a node at random position.
+     */
+    public void addNode() {
+        getGraphCanvas().addNode(this.componentSelector.getSelectedComponent());
+    }
+
+    /**
+     * @see org.apache.airavata.ws.monitor.event.EventListener#eventReceived(org.apache.airavata.ws.monitor.event.Event)
+     */
+    public void eventReceived(Event event) {
+        Type type = event.getType();
+        if (type == Type.MONITOR_STARTED || type == Type.KARMA_STARTED) {
+            // Show the monitor panel.
+            this.rightBottomTabbedPane.setSelectedComponent(this.monitorPane.getSwingComponent());
+        }
+    }
+
+    /**
+     * Initializes
+     */
+    private void init() {
+        createFrame();
+
+        this.menu = new XBayaMenu(this.engine, getToolbar());
+        this.frame.setJMenuBar(this.menu.getSwingComponent());
+
+        initPane();
+
+        // Create an empty graph canvas.
+//        newGraphCanvas(true);
+
+        this.frame.setVisible(true);
+    	loadDefaultGraph();
+
+        executionModeChanged(this.engine.getConfiguration());
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initPane() {
+        Container contentPane = this.frame.getContentPane();
+
+        // Error window
+        this.errorWindow = new ErrorWindow(contentPane);
+
+        contentPane.add(getToolbar().getSwingComponent(), BorderLayout.PAGE_START);
+
+        this.portViewer = new PortViewer();
+        this.componentViewer = new ComponentViewer();
+        this.componentSelector = new ComponentSelector(this.engine);
+        this.componentSelector.addComponentSelectorListener(this.componentViewer);
+        this.monitorPane = new MonitorPanel(this,this.engine.getMonitor());
+
+        compTreeXBayapanel = new ScrollPanel(this.componentSelector, ComponentSelector.TITLE);
+        ScrollPanel compViewXBayaPanel = new ScrollPanel(this.componentViewer, ComponentViewer.TITLE);
+
+        this.rightBottomTabbedPane = new JTabbedPane();
+        this.rightBottomTabbedPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+        this.rightBottomTabbedPane.setPreferredSize(new Dimension(0, 200));
+        this.rightBottomTabbedPane.addTab(PortViewer.TITLE, this.portViewer.getSwingComponent());
+        this.rightBottomTabbedPane.addTab(MonitorPanel.TITLE, this.monitorPane.getSwingComponent());
+
+        this.graphTabbedPane = new JTabbedPane();
+        this.graphTabbedPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+        this.graphTabbedPane.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                if (e.getClickCount() >= 2) {
+                    toggleMaximizeGraphPanel();
+                }
+            }
+        });
+        this.graphTabbedPane.addChangeListener(new ChangeListener() {
+            public void stateChanged(ChangeEvent event) {
+                // Called when the active tab changed.
+                // Note that this is not called when a tab is removed.
+                logger.debug(event.toString());
+                XBayaGUI.this.activeTabChanged();
+            }
+        });
+
+        this.leftSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
+        this.rightSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
+        this.mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, this.leftSplitPane, this.rightSplitPane);
+        contentPane.add(this.mainSplitPane, BorderLayout.CENTER);
+
+        this.leftSplitPane.setOneTouchExpandable(true);
+        this.rightSplitPane.setOneTouchExpandable(true);
+        this.mainSplitPane.setOneTouchExpandable(true);
+
+        // this.leftSplitPane.setTopComponent(compTreeXBayapanel.getSwingComponent());
+        // this.leftSplitPane.setTopComponent(new JCRBrowserPanel(engine));
+
+        this.componentTabbedPane = new JTabbedPane();
+        this.componentTabbedPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+        this.leftSplitPane.setTopComponent(this.componentTabbedPane);
+        this.componentTabbedPane.add(this.compTreeXBayapanel.getSwingComponent());
+        this.componentTabbedPane.setTitleAt(0, "Component");
+
+        this.leftSplitPane.setBottomComponent(compViewXBayaPanel.getSwingComponent());
+        this.rightSplitPane.setTopComponent(this.graphTabbedPane);
+        this.rightSplitPane.setBottomComponent(this.rightBottomTabbedPane);
+
+        this.leftSplitPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+        this.rightSplitPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
+
+        //
+        // Adjust sizes
+        //
+
+        // Need to pack the frame first to get the size of each component.
+        this.frame.pack();
+
+        final int leftPanelWidth = 250;
+        final int portViewHight = 200;
+
+        this.mainSplitPane.setDividerLocation(leftPanelWidth);
+        this.leftSplitPane.setDividerLocation(0.5);
+        this.leftSplitPane.setResizeWeight(0.5);
+
+        this.rightSplitPane.setDividerLocation(this.rightSplitPane.getSize().height - portViewHight);
+        // The bottom component to stay the same size
+        this.rightSplitPane.setResizeWeight(1.0);
+
+    }
+
+    public void viewJCRBrowserPanel(){
+    	if (jcrBrowserPanel!=null){
+    		jcrBrowserPanel=componentTabbedPane.indexOfComponent(jcrBrowserPanel)==-1? null:jcrBrowserPanel;
+    	}
+    	if (jcrBrowserPanel==null) {
+			jcrBrowserPanel = new JCRBrowserPanel(engine);
+			this.componentTabbedPane.add(jcrBrowserPanel);
+			int index=this.componentTabbedPane.getTabCount()-1;
+			this.componentTabbedPane.setTitleAt(1, "Airavata Registry");
+			TabLabelButton tabLabelButton = new TabLabelButton(componentTabbedPane, "Close JCR Browser");
+			tabLabelButton.setCloseButtonListener(new ActionListener(){
+				@Override
+				public void actionPerformed(ActionEvent arg0) {
+					componentTabbedPane.remove(jcrBrowserPanel);
+				}
+				
+			});
+			this.componentTabbedPane.setTabComponentAt(index, tabLabelButton);
+		}
+		componentTabbedPane.setSelectedComponent(jcrBrowserPanel);
+    }
+    
+    public void viewComponentTree(){
+    	componentTabbedPane.setSelectedComponent(compTreeXBayapanel.getSwingComponent());
+    }
+    
+  
+    /**
+     * Creates a frame.
+     */
+    private void createFrame() {
+        try {
+            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+        } catch (Exception e) {
+            // OK. The default will be used.
+            logger.error(e.getMessage(), e);
+        }
+
+        JFrame.setDefaultLookAndFeelDecorated(false);
+        this.frame = new JFrame();
+
+        // Adjust the size
+        XBayaConfiguration config = this.engine.getConfiguration();
+        int width = config.getWidth();
+        int height = config.getHeight();
+        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+        final int inset = 50;
+        this.frame.setLocation(inset, inset);
+        Dimension size = new Dimension(screenSize.width - inset * 2, screenSize.height - inset * 2);
+        if (width != 0) {
+            size.width = width;
+        }
+        if (height != 0) {
+            size.height = height;
+        }
+
+        // This controls the size when you open in a huge screen
+        if(size.width > 1280 && size.height > 800){
+            size.width = 1280;
+            size.height = 800;
+        }
+        this.frame.setPreferredSize(size);
+
+        this.frame.setTitle(XBayaConstants.APPLICATION_NAME);
+
+        this.frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+        this.frame.addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowClosing(WindowEvent event) {
+            	int result = JOptionPane.showConfirmDialog(frame, "'Are you sure you want to exit?", "Exit XBaya", JOptionPane.YES_NO_OPTION);
+				if (result==JOptionPane.NO_OPTION || (!closeAllGraphCanvas())){
+					return;
+				}
+                logger.debug(event.toString());
+                XBayaGUI.this.frame.setVisible(false);
+                try {
+                    XBayaGUI.this.engine.dispose();
+                } catch (WorkflowException e) {
+                    // Ignore the error.
+                    logger.error(e.getMessage(), e);
+                } catch (RuntimeException e) {
+                    // Ignore the error.
+                    logger.error(e.getMessage(), e);
+                }
+                if (XBayaGUI.this.engine.getConfiguration().isCloseOnExit()) {
+                    System.exit(0);
+                }
+            }
+
+            @Override
+            public void windowClosed(WindowEvent e) {
+                logger.debug(e.toString());
+
+                try {
+                    XBayaGUI.this.engine.getMonitor().stop();
+                } catch (MonitorException e1) {
+                    logger.error(e1.getMessage(), e1);
+                }
+                // Make sure to kill all threads.
+                // Dispose only when it can be disposed to prevent infinite loop
+                if (XBayaGUI.this.frame.isDisplayable()) {
+                    XBayaGUI.this.frame.dispose();
+                }
+            }
+        });
+        this.frame.setIconImage(SwingUtil.createImage("airavata-2.png"));
+    }
+
+    private void activeTabChanged() {
+        GraphCanvas graphPanel = getGraphCanvas();
+
+        if (graphPanel!=null) {
+			// Reset the port viewers.
+			Port inputPort = graphPanel.getSelectedInputPort();
+			Port outputPort = graphPanel.getSelectedOutputPort();
+			this.portViewer.setInputPort(inputPort);
+			this.portViewer.setOutputPort(outputPort);
+			// Reset component viewer.
+			Node node = graphPanel.getSelectedNode();
+			Component component;
+			if (node != null) {
+				component = node.getComponent();
+			} else {
+				component = this.componentSelector.getSelectedComponent();
+			}
+			this.componentViewer.setComponent(component);
+			String name = graphPanel.getWorkflow().getName();
+			setFrameName(name);
+		}else{
+			//TODO what to do when no tabs are present???
+		}
+    }
+
+    public ComponentViewer getComponentVIewer() {
+        return this.componentViewer;
+    }
+
+    private void setFrameName(String workflowName) {
+        String title = this.engine.getConfiguration().getTitle();
+        this.frame.setTitle(workflowName + " - " + title);
+    }
+
+	@Override
+	public void executionModeChanged(XBayaConfiguration config) {
+		this.leftSplitPane.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);
+	}
+
+
+    /**
+     * @return
+     */
+    public WorkflowPropertyWindow getWorkflowPropertyWindow() {
+        if (this.workflowPropertiesWindow == null) {
+            this.workflowPropertiesWindow = new WorkflowPropertyWindow(this);
+        }
+        return this.workflowPropertiesWindow;
+    }
+    
+    /**
+     * Sets the workflow.
+     *
+     * @param workflow
+     *            The workflow
+     */
+    public void setWorkflow(Workflow workflow) {
+        this.getGraphCanvas().setWorkflow(workflow);
+    }
+
+    /**
+     * Return the current workflow.
+     *
+     * @return The current workflow
+     */
+    public Workflow getWorkflow() {
+        return this.getGraphCanvas().getWorkflowWithImage();
+    }
+    
+    private void loadDefaultGraph() {
+        if (this.engine.getConfiguration().getWorkflow() != null) {
+            this.newGraphCanvas(true, false);
+            try {
+            	String xml = this.engine.getConfiguration().getAiravataAPI().getWorkflowManager().getWorkflowAsString(this.engine.getConfiguration().getWorkflow());
+                XmlElement xwf = XMLUtil.stringToXmlElement(xml);
+                Workflow workflow = new Workflow(xwf);
+                setWorkflow(workflow);
+            } catch (AiravataAPIInvocationException e) {
+               getErrorWindow().error(ErrorMessages.REPOSITORY_CONFIGURATION_IS_WRONG_FAILED_TO_LOAD_THE_WORKFLOW, e);
+            } catch (GraphException e) {
+                getErrorWindow().error(ErrorMessages.WORKFLOW_IS_WRONG, e);
+            } catch (ComponentException e) {
+                getErrorWindow().error(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
+            }
+        }
+
+    }
+
+	public XBayaConfiguration getConfiguration() {
+		return engine.getConfiguration();
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/AbstractBrowserActionItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/AbstractBrowserActionItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/AbstractBrowserActionItem.java
new file mode 100644
index 0000000..406e3b7
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/AbstractBrowserActionItem.java
@@ -0,0 +1,90 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.actions;
+
+import java.awt.event.ActionListener;
+
+import javax.swing.Icon;
+import javax.swing.JMenuItem;
+
+public abstract class AbstractBrowserActionItem {
+
+    private String caption;
+    private Icon icon;
+    private JMenuItem menuItem;
+    private String description;
+
+    public abstract String getID();
+
+    public void setIcon(Icon icon) {
+        this.icon = icon;
+        getMenuItem().setIcon(getIcon());
+    }
+
+    public Icon getIcon() {
+        return icon;
+    }
+
+    public String getCaption() {
+        return caption;
+    }
+
+    public void setCaption(String caption) {
+        this.caption = caption;
+        getMenuItem().setText(getCaption());
+    }
+
+    public JMenuItem getMenuItem() {
+        if (menuItem == null) {
+            menuItem = new JMenuItem(getCaption());
+        }
+        menuItem.setText(getCaption());
+        return menuItem;
+    }
+
+    public void addActionListener(ActionListener listener) {
+        getMenuItem().addActionListener(listener);
+    }
+
+    public void removeActionListener(ActionListener listener) {
+        getMenuItem().removeActionListener(listener);
+    }
+
+    public void setVisible(boolean visible) {
+        getMenuItem().setVisible(visible);
+    }
+
+    public void setEnabled(boolean enabled) {
+        getMenuItem().setEnabled(enabled);
+    }
+
+    public abstract String getDefaultCaption();
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+        getMenuItem().setToolTipText(getDescription());
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/AddAction.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/AddAction.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/AddAction.java
new file mode 100644
index 0000000..625aaf8
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/registry/browser/AddAction.java
@@ -0,0 +1,43 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.actions.registry.browser;
+
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class AddAction extends AbstractBrowserActionItem {
+    public static final String ID = "action.add";
+
+    public AddAction() {
+        setCaption(getDefaultCaption());
+    }
+
+    @Override
+    public String getID() {
+        return ID;
+    }
+
+    @Override
+    public String getDefaultCaption() {
+        return "Add";
+    }
+
+}


[47/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/jnlp/LICENSE
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/jnlp/LICENSE b/modules/distribution/xbaya-gui/src/main/resources/jnlp/LICENSE
deleted file mode 100644
index 3a4d1a4..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/jnlp/LICENSE
+++ /dev/null
@@ -1,2272 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
-===================================================================================
-The Apache Airavata distribution includes a number of run time 
-dependencies with separate copyright notices and license terms. Your use of the
-Apache Airavata code is subject to the terms and conditions of the following licenses.
-===================================================================================
-
-===============================================================================
-The following components come under Apache Software License 2.0
-===============================================================================
-
-apache axiom, apache axis2, apache commons, apache derby, apache geronimo,
-apache httpcore components, apache log4j, apache xmlbeans, apache xmlschema,
-aws-java-sdk-1.1.8.jar, bcel-5.1.jar, Codehaus Jackson (jackson-core-asl-1.9.2.jar,
-jackson-jaxrs-1.9.2.jar, jackson-mapper-asl-1.9.2.jar, jackson-xc-1.9.2.jar, 
-jets3t-0.8.0.jar, jettison-1.0-RC2.jar, neethi-2.0.4.jar, PDFBox libraries 
-(pdfbox, jempbox, fontbox), wstx-asl-3.2.4.jar
-
-===============================================================================
-The following components use Apache based Licenses
-===============================================================================
-
-===============================================================================
-For: jdom-1.0.jar
-    Containing Project URL: http://www.jdom.org/
-/*-- 
-
- $Id: LICENSE.txt,v 1.11 2004/02/06 09:32:57 jhunter Exp $
-
- Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin.
- All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 
- 1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions, and the following disclaimer.
- 
- 2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions, and the disclaimer that follows 
-    these conditions in the documentation and/or other materials 
-    provided with the distribution.
-
- 3. The name "JDOM" must not be used to endorse or promote products
-    derived from this software without prior written permission.  For
-    written permission, please contact <request_AT_jdom_DOT_org>.
- 
- 4. Products derived from this software may not be called "JDOM", nor
-    may "JDOM" appear in their name, without prior written permission
-    from the JDOM Project Management <request_AT_jdom_DOT_org>.
- 
- In addition, we request (but do not require) that you include in the 
- end-user documentation provided with the redistribution and/or in the 
- software itself an acknowledgement equivalent to the following:
-     "This product includes software developed by the
-      JDOM Project (http://www.jdom.org/)."
- Alternatively, the acknowledgment may be graphical using the logos 
- available at http://www.jdom.org/images/logos.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED.  IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many 
- individuals on behalf of the JDOM Project and was originally 
- created by Jason Hunter <jhunter_AT_jdom_DOT_org> and
- Brett McLaughlin <brett_AT_jdom_DOT_org>.  For more information
- on the JDOM Project, please see <http://www.jdom.org/>. 
-
- */
-
-===============================================================================
-
-ASM bytecode manipulation library (asm)
-    Containing Project URL: http://asm.ow2.org/
-
-    Copyright (c) 2000-2005 INRIA, France Telecom
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions
-    are met:
-
-    1. Redistributions of source code must retain the above copyright
-       notice, this list of conditions and the following disclaimer.
-
-    2. Redistributions in binary form must reproduce the above copyright
-       notice, this list of conditions and the following disclaimer in the
-       documentation and/or other materials provided with the distribution.
-
-    3. Neither the name of the copyright holders nor the names of its
-       contributors may be used to endorse or promote products derived from
-       this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-    THE POSSIBILITY OF SUCH DAMAGE.
-
-===============================================================================
-
-For: cryptix-asn1-versionless.jar, cryptix32-versionless.jar
-    Containing Project URL: http://www.cryptix.org/
-
-Cryptix General License
-
-Copyright (c) 1995-2005 The Cryptix Foundation Limited.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-  1. Redistributions of source code must retain the copyright notice,
-     this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in
-     the documentation and/or other materials provided with the
-     distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE CRYPTIX FOUNDATION LIMITED AND
-CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE CRYPTIX FOUNDATION LIMITED OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-===============================================================================
-The following components come under Extreme! Lab Software License
-===============================================================================
-
-XPP3
-    Containing Project URL: http://www.extreme.indiana.edu/xgws/xsoap/xpp/
-xsul, xsul5, xutil
-    Containing Project URL: http://www.extreme.indiana.edu/xgws/xsul/
-wsmg
-    Containing Project URL: http://www.extreme.indiana.edu/xgws/messenger/index.html
-gpel, weps-beans, pegasuswebservice, mapReduce-service-client, atomixmiser
-    Containing Project URL: http://www.extreme.indiana.edu/xgws/
-    
-Indiana University Extreme! Lab Software License
-
-Version 1.1.1
-
-Copyright (c) 2002 Extreme! Lab, Indiana University. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in
-   the documentation and/or other materials provided with the distribution.
-
-3. The end-user documentation included with the redistribution, if any,
-   must include the following acknowledgment:
-
-  "This product includes software developed by the Indiana University
-  Extreme! Lab (http://www.extreme.indiana.edu/)."
-
-Alternately, this acknowledgment may appear in the software itself,
-if and wherever such third-party acknowledgments normally appear.
-
-4. The names "Indiana Univeristy" and "Indiana Univeristy Extreme! Lab"
-must not be used to endorse or promote products derived from this
-software without prior written permission. For written permission,
-please contact http://www.extreme.indiana.edu/.
-
-5. Products derived from this software may not use "Indiana Univeristy"
-name nor may "Indiana Univeristy" appear in their name, without prior
-written permission of the Indiana University.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS OR ITS CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-======================================================================== 
-The following components are MIT Licensed 
-========================================================================
-
-SLF4J,log4j-over-slf4j, jcl-over-slf4j, slf4j-api,mockito-all-1.8.5,jopt-simple-3.2.jar
-    Containing Project URL: http://www.slf4j.org/
-
-Copyright (c) 2004-2008 QOS.ch
- All rights reserved.
-
- Permission is hereby granted, free  of charge, to any person obtaining
- a  copy  of this  software  and  associated  documentation files  (the
- "Software"), to  deal in  the Software without  restriction, including
- without limitation  the rights to  use, copy, modify,  merge, publish,
- distribute,  sublicense, and/or sell  copies of  the Software,  and to
- permit persons to whom the Software  is furnished to do so, subject to
- the following conditions:
-
- The  above  copyright  notice  and  this permission  notice  shall  be
- included in all copies or substantial portions of the Software.
-
- THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
- EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
- MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-========================================================================
-
-For dom4j-1.6.1.jar:
-    Containing Project URL: http://dom4j.sourceforge.net/
-Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
-
-Redistribution and use of this software and associated documentation
-("Software"), with or without modification, are permitted provided
-that the following conditions are met:
-
-1. Redistributions of source code must retain copyright
-   statements and notices.  Redistributions must also contain a
-   copy of this document.
- 
-2. Redistributions in binary form must reproduce the
-   above copyright notice, this list of conditions and the
-   following disclaimer in the documentation and/or other
-   materials provided with the distribution.
- 
-3. The name "DOM4J" must not be used to endorse or promote
-   products derived from this Software without prior written
-   permission of MetaStuff, Ltd.  For written permission,
-   please contact dom4j-info@metastuff.com.
- 
-4. Products derived from this Software may not be called "DOM4J"
-   nor may "DOM4J" appear in their names without prior written
-   permission of MetaStuff, Ltd. DOM4J is a registered
-   trademark of MetaStuff, Ltd.
- 
-5. Due credit should be given to the DOM4J Project - 
-   http://www.dom4j.org
- 
-THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
-NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
-METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
-====================================================================================================
-
-For Bouncy Castle:
-    Containing Project URL: http://www.bouncycastle.org/
-
-Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
-
-Permission iss software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions hereby granted, free of charge, to any person obtaining a copy of this software
-and associated documentation files (the "Software"), to deal in the Software without restriction,
-including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
-LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-=======================================================================================================
-
-For: The International Components for Unicode (icu4j-2.6.1.jar)
-    Containing Project URL: http://site.icu-project.org/
-
-    Copyright (c) 1995-2009 International Business Machines Corporation
-    and others
-
-    All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, and/or sell copies of the Software, and to permit persons
-    to whom the Software is furnished to do so, provided that the above
-    copyright notice(s) and this permission notice appear in all copies
-    of the Software and that both the above copyright notice(s) and this
-    permission notice appear in supporting documentation.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
-    IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
-    BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
-    OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-    SOFTWARE.
-
-    Except as contained in this notice, the name of a copyright holder shall
-    not be used in advertising or otherwise to promote the sale, use or other
-    dealings in this Software without prior written authorization of the
-    copyright holder.
-    
-====================================================================== 
-The following components are CDDL based License 
-======================================================================
-
-For activation-1.1.jar, jaxb-api-2.1.jar, mail-1.4.jar, junit, 
-Servlet Specification 2.5 API (servlet-api-2.5-6.1.14.jar),
-Classfish Jasper API (jsp-api-2.1-6.1.14.jar), and
-JSP2.1 Jasper implementation from Glassfish (jsp-2.1-6.1.14.jar), 
-Jersey from Glassfish (jersey-client-1.13.jar, jersey-core-1.13.jar,
-jersey-json-1.13.jar, jersey-multipart-1.13.jar) and JSP2.1 Jasper 
-implementation from Glassfish (jsp-2.1-6.1.14.jar),whirr-core-0.7.1.jar, whirr-hadoop-0.7.1.jar:
- 
-NOTE: jersey is dual licensed (http://jersey.java.net/CDDL+GPL.html), 
-Apahce Airavata elects to include jersey in this distribution under the
-[CDDLv_1.0] license.
-
-    COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
-
-    1. Definitions.
-
-    1.1. Contributor means each individual or entity that creates or
-    contributes to the creation of Modifications.
-
-    1.2. Contributor Version means the combination of the Original Software,
-    prior Modifications used by a Contributor (if any), and the Modifications
-    made by that particular Contributor.
-
-    1.3. Covered Software means (a) the Original Software, or
-    (b) Modifications, or (c) the combination of files containing Original
-    Software with files containing Modifications, in each case including
-    portions thereof.
-
-    1.4. Executable means the Covered Software in any form other than Source
-    Code.
-
-    1.5. Initial Developer means the individual or entity that first makes
-    Original Software available under this License.
-
-    1.6. Larger Work means a work which combines Covered Software or portions
-    thereof with code not governed by the terms of this License.
-
-    1.7. License means this document.
-
-    1.8. Licensable means having the right to grant, to the maximum extent
-    possible, whether at the time of the initial grant or subsequently
-    acquired, any and all of the rights conveyed herein.
-
-    1.9. Modifications means the Source Code and Executable form of any of
-    the following: A. Any file that results from an addition to, deletion
-    from or modification of the contents of a file containing Original
-    Software or previous Modifications; B. Any new file that contains any
-    part of the Original Software or previous Modification; or C. Any new
-    file that is contributed or otherwise made available under the terms of
-    this License.
-
-    1.10. Original Software means the Source Code and Executable form of
-    computer software code that is originally released under this License.
-
-    1.11. Patent Claims means any patent claim(s), now owned or hereafter
-    acquired, including without limitation, method, process, and apparatus
-    claims, in any patent Licensable by grantor.
-
-    1.12. Source Code means (a) the common form of computer software code in
-    which modifications are made and (b) associated documentation included in
-    or with such code.
-
-    1.13. You (or Your) means an individual or a legal entity exercising
-    rights under, and complying with all of the terms of, this License. For
-    legal entities, You includes any entity which controls, is controlled by,
-    or is under common control with You. For purposes of this definition,
-    control means (a) the power, direct or indirect, to cause the direction
-    or management of such entity, whether by contract or otherwise, or
-    (b) ownership of more than fifty percent (50%) of the outstanding shares
-    or beneficial ownership of such entity.
-
-    2. License Grants.
-
-    2.1. The Initial Developer Grant. Conditioned upon Your compliance with
-    Section 3.1 below and subject to third party intellectual property
-    claims, the Initial Developer hereby grants You a world-wide,
-    royalty-free, non-exclusive license:
-
-    (a) under intellectual property rights (other than patent or trademark)
-        Licensable by Initial Developer, to use, reproduce, modify, display,
-        perform, sublicense and distribute the Original Software (or portions
-        thereof), with or without Modifications, and/or as part of a Larger
-        Work; and
-
-    (b) under Patent Claims infringed by the making, using or selling of
-        Original Software, to make, have made, use, practice, sell, and offer
-        for sale, and/or otherwise dispose of the Original Software (or
-        portions thereof);
-
-    (c) The licenses granted in Sections 2.1(a) and (b) are effective on the
-        date Initial Developer first distributes or otherwise makes the
-        Original Software available to a third party under the terms of
-        this License;
-
-    (d) Notwithstanding Section 2.1(b) above, no patent license is granted:
-        (1) for code that You delete from the Original Software, or (2) for
-        infringements caused by: (i) the modification of the Original
-        Software, or (ii) the combination of the Original Software with other
-        software or devices.
-
-    2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1
-    below and subject to third party intellectual property claims, each
-    Contributor hereby grants You a world-wide, royalty-free, non-exclusive
-    license:
-
-    (a) under intellectual property rights (other than patent or trademark)
-        Licensable by Contributor to use, reproduce, modify, display, perform,
-        sublicense and distribute the Modifications created by such
-        Contributor (or portions thereof), either on an unmodified basis,
-        with other Modifications, as Covered Software and/or as part of a
-        Larger Work; and
-
-    (b) under Patent Claims infringed by the making, using, or selling of
-        Modifications made by that Contributor either alone and/or in
-        combination with its Contributor Version (or portions of such
-        combination), to make, use, sell, offer for sale, have made, and/or
-        otherwise dispose of: (1) Modifications made by that Contributor (or
-        portions thereof); and (2) the combination of Modifications made by
-        that Contributor with its Contributor Version (or portions of such
-        combination).
-
-    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on
-        the date Contributor first distributes or otherwise makes the
-        Modifications available to a third party.
-
-    (d) Notwithstanding Section 2.2(b) above, no patent license is granted:
-        (1) for any code that Contributor has deleted from the Contributor
-        Version; (2) for infringements caused by: (i) third party
-        modifications of Contributor Version, or (ii) the combination of
-        Modifications made by that Contributor with other software (except
-        as part of the Contributor Version) or other devices; or (3) under
-        Patent Claims infringed by Covered Software in the absence of
-        Modifications made by that Contributor.
-
-    3. Distribution Obligations.
-
-    3.1. Availability of Source Code. Any Covered Software that You distribute
-    or otherwise make available in Executable form must also be made available
-    in Source Code form and that Source Code form must be distributed only
-    under the terms of this License. You must include a copy of this License
-    with every copy of the Source Code form of the Covered Software You
-    distribute or otherwise make available. You must inform recipients of any
-    such Covered Software in Executable form as to how they can obtain such
-    Covered Software in Source Code form in a reasonable manner on or through
-    a medium customarily used for software exchange.
-
-    3.2. Modifications. The Modifications that You create or to which You
-    contribute are governed by the terms of this License. You represent that
-    You believe Your Modifications are Your original creation(s) and/or You
-    have sufficient rights to grant the rights conveyed by this License.
-
-    3.3. Required Notices. You must include a notice in each of Your
-    Modifications that identifies You as the Contributor of the Modification.
-    You may not remove or alter any copyright, patent or trademark notices
-    contained within the Covered Software, or any notices of licensing or any
-    descriptive text giving attribution to any Contributor or the Initial
-    Developer.
-
-    3.4. Application of Additional Terms. You may not offer or impose any
-    terms on any Covered Software in Source Code form that alters or restricts
-    the applicable version of this License or the recipients rights hereunder.
-    You may choose to offer, and to charge a fee for, warranty, support,
-    indemnity or liability obligations to one or more recipients of Covered
-    Software. However, you may do so only on Your own behalf, and not on
-    behalf of the Initial Developer or any Contributor. You must make it
-    absolutely clear that any such warranty, support, indemnity or liability
-    obligation is offered by You alone, and You hereby agree to indemnify the
-    Initial Developer and every Contributor for any liability incurred by the
-    Initial Developer or such Contributor as a result of warranty, support,
-    indemnity or liability terms You offer.
-
-    3.5. Distribution of Executable Versions. You may distribute the
-    Executable form of the Covered Software under the terms of this License or
-    under the terms of a license of Your choice, which may contain terms
-    different from this License, provided that You are in compliance with the
-    terms of this License and that the license for the Executable form does
-    not attempt to limit or alter the recipients rights in the Source Code
-    form from the rights set forth in this License. If You distribute the
-    Covered Software in Executable form under a different license, You must
-    make it absolutely clear that any terms which differ from this License
-    are offered by You alone, not by the Initial Developer or Contributor.
-    You hereby agree to indemnify the Initial Developer and every Contributor
-    for any liability incurred by the Initial Developer or such Contributor as
-    a result of any such terms You offer.
-
-    3.6. Larger Works. You may create a Larger Work by combining Covered
-    Software with other code not governed by the terms of this License and
-    distribute the Larger Work as a single product. In such a case, You must
-    make sure the requirements of this License are fulfilled for the Covered
-    Software.
-
-    4. Versions of the License.
-
-    4.1. New Versions. Sun Microsystems, Inc. is the initial license steward
-    and may publish revised and/or new versions of this License from time to
-    time. Each version will be given a distinguishing version number. Except
-    as provided in Section 4.3, no one other than the license steward has the
-    right to modify this License.
-
-    4.2. Effect of New Versions. You may always continue to use, distribute
-    or otherwise make the Covered Software available under the terms of the
-    version of the License under which You originally received the Covered
-    Software. If the Initial Developer includes a notice in the Original
-    Software prohibiting it from being distributed or otherwise made
-    available under any subsequent version of the License, You must
-    distribute and make the Covered Software available under the terms of
-    the version of the License under which You originally received the
-    Covered Software. Otherwise, You may also choose to use, distribute or
-    otherwise make the Covered Software available under the terms of any
-    subsequent version of the License published by the license steward.
-
-    4.3. Modified Versions. When You are an Initial Developer and You want
-    to create a new license for Your Original Software, You may create and
-    use a modified version of this License if You: (a) rename the license and
-    remove any references to the name of the license steward (except to note
-    that the license differs from this License); and (b) otherwise make it
-    clear that the license contains terms which differ from this License.
-
-    5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE
-    ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
-    IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED
-    SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
-    OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
-    THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE
-    DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
-    CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
-    CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF
-    THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER
-    EXCEPT UNDER THIS DISCLAIMER.
-
-    6. TERMINATION.
-
-    6.1. This License and the rights granted hereunder will terminate
-    automatically if You fail to comply with terms herein and fail to cure
-    such breach within 30 days of becoming aware of the breach. Provisions
-    which, by their nature, must remain in effect beyond the termination of
-    this License shall survive.
-
-    6.2. If You assert a patent infringement claim (excluding declaratory
-    judgment actions) against Initial Developer or a Contributor (the Initial
-    Developer or Contributor against whom You assert such claim is referred
-    to as Participant) alleging that the Participant Software (meaning the
-    Contributor Version where the Participant is a Contributor or the
-    Original Software where the Participant is the Initial Developer)
-    directly or indirectly infringes any patent, then any and all rights
-    granted directly or indirectly to You by such Participant, the Initial
-    Developer (if the Initial Developer is not the Participant) and all
-    Contributors under Sections 2.1 and/or 2.2 of this License shall, upon
-    60 days notice from Participant terminate prospectively and automatically
-    at the expiration of such 60 day notice period, unless if within such
-    60 day period You withdraw Your claim with respect to the Participant
-    Software against such Participant either unilaterally or pursuant to a
-    written agreement with Participant.
-
-    6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
-    user licenses that have been validly granted by You or any distributor
-    hereunder prior to termination (excluding licenses granted to You by any
-    distributor) shall survive termination.
-
-    7. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
-    THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL
-    YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
-    COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY
-    PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF
-    ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS,
-    LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY
-    AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE
-    BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
-    LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
-    RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW
-    PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
-    OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
-    AND LIMITATION MAY NOT APPLY TO YOU.
-
-    8. U.S. GOVERNMENT END USERS. The Covered Software is a commercial item,
-    as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
-    commercial computer software (as that term is defined at 48 C.F.R.
-    252.227-7014(a)(1)) and commercial computer software documentation as such
-    terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R.
-    12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S.
-    Government End Users acquire Covered Software with only those rights set
-    forth herein. This U.S. Government Rights clause is in lieu of, and
-    supersedes, any other FAR, DFAR, or other clause or provision that
-    addresses Government rights in computer software under this License.
-
-    9. MISCELLANEOUS. This License represents the complete agreement
-    concerning subject matter hereof. If any provision of this License is
-    held to be unenforceable, such provision shall be reformed only to the
-    extent necessary to make it enforceable. This License shall be governed
-    by the law of the jurisdiction specified in a notice contained within
-    the Original Software (except to the extent applicable law, if any,
-    provides otherwise), excluding such jurisdictions conflict-of-law
-    provisions. Any litigation relating to this License shall be subject to
-    the jurisdiction of the courts located in the jurisdiction and venue
-    specified in a notice contained within the Original Software, with the
-    losing party responsible for costs, including, without limitation, court
-    costs and reasonable attorneys fees and expenses. The application of the
-    United Nations Convention on Contracts for the International Sale of
-    Goods is expressly excluded. Any law or regulation which provides that
-    the language of a contract shall be construed against the drafter shall
-    not apply to this License. You agree that You alone are responsible for
-    compliance with the United States export administration regulations (and
-    the export control laws and regulation of any other countries) when You
-    use, distribute or otherwise make available any Covered Software.
-
-    10. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the
-    Contributors, each party is responsible for claims and damages arising,
-    directly or indirectly, out of its utilization of rights under this
-    License and You agree to work with Initial Developer and Contributors
-    to distribute such responsibility on an equitable basis. Nothing herein
-    is intended or shall be deemed to constitute any admission of liability.
-
-    NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION
-    LICENSE (CDDL) The code released under the CDDL shall be governed by the
-    laws of the State of California (excluding conflict-of-law provisions).
-    Any litigation relating to this License shall be subject to the
-    jurisdiction of the Federal Courts of the Northern District of California
-    and the state courts of the State of California, with venue lying in
-    Santa Clara County, California.
-
-
-==============================================================================
-
-For: jaxb-xjc-2.1.7.jar
-    Containing Project URL: 
-
-Copyright (c) 2004 Kohsuke Kawaguchi
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall
-be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
-OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-=============================================================================== 
-The following components are BSD Licensed 
-=============================================================================== 
-
-For jibx-bind-1.2.1.jar,jibx-run-1.2.1.jar, antlr-2.7.7.jar,hamcrest-all-1.1.jar,whirr-core-0.7.1.jar, whirr-hadoop-0.7.1.jar:
-    Containing Project URL: http://jibx.sourceforge.net, http://www.antlr.org/
-
-Copyright (c) 2003-2007, Dennis M. Sosnoski
-All rights reserved.
-
-Copyright (c) 2010 Terence Parr
-All rights reserved.
-
-[The BSD License]
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
- * Neither the name of JiBX nor the names of its contributors may be used
-   to endorse or promote products derived from this software without specific
-   prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-==============================================================================
-
-For YFilter:
-    Containing Project URL: http://yfilter.cs.umass.edu/
-
-YFilter 1.0 COPYRIGHT, LICENSE and DISCLAIMER
-
-Copyright (c) 2002, 2004, Regents of the University of California All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are
-permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice, this
-    list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice, this
-    list of conditions and the following disclaimer in the documentation and/or other
-    materials provided with the distribution.
-    * Neither the name of the University of California at Berkeley nor the names of
-    its contributors may be used to endorse or promote products derived from this
-    software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-==========================================================================================
-For jaxen-1.1.1.jar:
-    Containing Project URL: http://jaxen.codehaus.org/
-
- Copyright 2003-2006 The Werken Company. All Rights Reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
-  * Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-
-  * Neither the name of the Jaxen Project nor the names of its
-    contributors may be used to endorse or promote products derived
-    from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
-OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=============================================================================== 
-The following components are CPL Licensed 
-=============================================================================== 
-
-For wsdl4j-1.6.2.jar:
-    Containing Project URL: http://sourceforge.net/projects/wsdl4j/
-
-Common Public License Version 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-1. DEFINITIONS
-"Contribution" means:
-a) in the case of the initial Contributor, the initial code and
documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate from and are
distributed by that particular Contributor. A Contribution 'originates' from a
Contributor if it was added to the Program by such Contributor itself or anyone
acting on such Contributor's behalf. Contributions do not include additions to
the Program which: (i) are separate modules of software distributed in
conjunction with the Program under their own license agreement, and (ii) are not
derivative works of the Program.
-"Contributor" means any person or entity that distributes the Program.
-"Licensed Patents " mean patent claims licensable by a Contributor which are
necessarily infringed by the use or sale of its Contribution alone or when
combined with the Program.
-"Program" means the Contributions distributed in accordance with this Agreement.
-"Recipient" means anyone who receives the Program under this Agreement,
including all Contributors.
-2. GRANT OF RIGHTS
-a) Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide, royalty-free copyright license to
reproduce, prepare derivative works of, publicly display, publicly perform,
distribute and sublicense the Contribution of such Contributor, if any, and such
derivative works, in source code and object code form.
-b) Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
Patents to make, use, sell, offer to sell, import and otherwise transfer the
Contribution of such Contributor, if any, in source code and object code form.
This patent license shall apply to the combination of the Contribution and the
Program if, at the time the Contribution is added by the Contributor, such
addition of the Contribution causes such combination to be covered by the
Licensed Patents. The patent license shall not apply to any other combinations
which include the Contribution. No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants the licenses
to its Contributions set forth herein, no assurances are provided by any
Contributor that the Program does not infringe the patent or other intellectual
property rights of any other entity. Each Contributor disclaims any liability to
Recipient for claims brought by any other entity based on infringement of
intellectual property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, each Recipient hereby assumes sole
responsibility to secure any other intellectual property rights needed, if any.
For example, if a third party patent license is required to allow Recipient to
distribute the Program, it is Recipient's responsibility to acquire that license
before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient
copyright rights in its Contribution, if any, to grant the copyright license set
forth in this Agreement.
-3. REQUIREMENTS
-A Contributor may choose to distribute the Program in object code form under its
own license agreement, provided that:
-a) it complies with the terms and conditions of this Agreement; and
-b) its license agreement:
-i) effectively disclaims on behalf of all Contributors all warranties and
conditions, express and implied, including warranties or conditions of title and
non-infringement, and implied warranties or conditions of merchantability and
fitness for a particular purpose;
-ii) effectively excludes on behalf of all Contributors all liability for
damages, including direct, indirect, special, incidental and consequential
damages, such as lost profits;
-iii) states that any provisions which differ from this Agreement are offered
by that Contributor alone and not by any other party; and
-iv) states that source code for the Program is available from such
Contributor, and informs licensees how to obtain it in a reasonable manner on or
through a medium customarily used for software exchange.
-When the Program is made available in source code form:
-a) it must be made available under this Agreement; and
-b) a copy of this Agreement must be included with each copy of the Program.
-Contributors may not remove or alter any copyright notices contained within the
Program.
-Each Contributor must identify itself as the originator of its Contribution, if
any, in a manner that reasonably allows subsequent Recipients to identify the
originator of the Contribution.
-4. COMMERCIAL DISTRIBUTION
-Commercial distributors of software may accept certain responsibilities with
respect to end users, business partners and the like. While this license is
intended to facilitate the commercial use of the Program, the Contributor who
includes the Program in a commercial product offering should do so in a manner
which does not create potential liability for other Contributors. Therefore, if
a Contributor includes the Program in a commercial product offering, such
Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
every other Contributor ("Indemnified Contributor") against any losses, damages
and costs (collectively "Losses") arising from claims, lawsuits and other legal
actions brought by a third party against the Indemnified Contributor to the
extent caused by the acts or omissions of such Commercial Contributor in
connection with its distribution of the Program in a commercial product
offering. The obligations in this section do not ap
 ply to any claims or Losses
relating to any actual or alleged intellectual property infringement. In order
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
Contributor in writing of such claim, and b) allow the Commercial Contributor to
control, and cooperate with the Commercial Contributor in, the defense and any
related settlement negotiations. The Indemnified Contributor may participate in
any such claim at its own expense.
-For example, a Contributor might include the Program in a commercial product
offering, Product X. That Contributor is then a Commercial Contributor. If that
Commercial Contributor then makes performance claims, or offers warranties
related to Product X, those performance claims and warranties are such
Commercial Contributor's responsibility alone. Under this section, the
Commercial Contributor would have to defend claims against the other
Contributors related to those performance claims and warranties, and if a court
requires any other Contributor to pay any damages as a result, the Commercial
Contributor must pay those damages.
-5. NO WARRANTY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
Recipient is solely responsible for determining the appropriateness of using and
distributing the Program and assumes all risks associated with its exercise of
rights under this Agreement, including but not limited to the risks and costs of
program errors, compliance with applicable laws, damage to or loss of data,
programs or equipment, and unavailability or interruption of operations.
-6. DISCLAIMER OF LIABILITY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-7. GENERAL
-If any provision of this Agreement is invalid or unenforceable under applicable
law, it shall not affect the validity or enforceability of the remainder of the
terms of this Agreement, and without further action by the parties hereto, such
provision shall be reformed to the minimum extent necessary to make such
provision valid and enforceable.
-If Recipient institutes patent litigation against a Contributor with respect to
a patent applicable to software (including a cross-claim or counterclaim in a
lawsuit), then any patent licenses granted by that Contributor to such Recipient
under this Agreement shall terminate as of the date such litigation is filed. In
addition, if Recipient institutes patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
itself (excluding combinations of the Program with other software or hardware)
infringes such Recipient's patent(s), then such Recipient's rights granted under
Section 2(b) shall terminate as of the date such litigation is filed.
-All Recipient's rights under this Agreement shall terminate if it fails to
comply with any of the material terms or conditions of this Agreement and does
not cure such failure in a reasonable period of time after becoming aware of
such noncompliance. If all Recipient's rights under this Agreement terminate,
Recipient agrees to cease use and distribution of the Program as soon as
reasonably practicable. However, Recipient's obligations under this Agreement
and any licenses granted by Recipient relating to the Program shall continue and
survive.
-Everyone is permitted to copy and distribute copies of this Agreement, but in
order to avoid inconsistency the Agreement is copyrighted and may only be
modified in the following manner. The Agreement Steward reserves the right to
publish new versions (including revisions) of this Agreement from time to time.
No one other than the Agreement Steward has the right to modify this Agreement.
IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
as the Agreement Steward to a suitable separate entity. Each new version of the
Agreement will be given a distinguishing version number. The Program (including
Contributions) may always be distributed subject to the version of the Agreement
under which it was received. In addition, after a new version of the Agreement
is published, Contributor may elect to distribute the Program (including its
Contributions) under the new version. Except as expressly stated in Sections
2(a) and 2(b) above, Recipie
 nt receives no rights or licenses to the
intellectual property of any Contributor under this Agreement, whether
expressly, by implication, estoppel or otherwise. All rights in the Program not
expressly granted under this Agreement are reserved.
-This Agreement is governed by the laws of the State of New York and the
intellectual property laws of the United States of America. No party to this
Agreement will bring a legal action under this Agreement more than one year
after the cause of action arose. Each party waives its rights to a jury trial in
any resulting litigation.
-
-==========================================================================================
-==========================================================================================
-
-For puretls:
-    Containing Project URL: 
-
-  This package is a SSLv3/TLS implementation written by Eric Rescorla
-   <ek...@rtfm.com> and licensed by Claymore Systems, Inc.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-   1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-   2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-   3. Neither the name of Claymore Systems, Inc. nor the name of Eric
-      Rescorla may be used to endorse or promote products derived from this
-      software without specific prior written permission.
-   THIS SOFTWARE IS PROVIDED BY CLAYMORE SYSTEMS AND CONTRIBUTORS ``AS IS'' AND
-   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-   ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-   OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-   SUCH DAMAGE.
-
-==============================================================================
-
-For xml-api,woden-api-1.0M8.jar,woden-impl-dom-1.0M8.jar:
-    Containing Project URL: 
-
-For the W3C schema and DTD files in the org.apache.woden.resolver package:
-
-W3C® DOCUMENT LICENSE
-http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231
-
-Public documents on the W3C site are provided by the copyright holders under
-the following license. By using and/or copying this document, or the W3C
-document from which this statement is linked, you (the licensee) agree that
-you have read, understood, and will comply with the following terms and
-conditions:
-
-Permission to copy, and distribute the contents of this document, or the W3C
-document from which this statement is linked, in any medium for any purpose
-and without fee or royalty is hereby granted, provided that you include the
-following on ALL copies of the document, or portions thereof, that you use:
-
-  1. A link or URL to the original W3C document.
-  2. The pre-existing copyright notice of the original author, or if it
-     doesn't exist, a notice (hypertext is preferred, but a textual
-     representation is permitted) of the form: "Copyright © [$date-of-document]
-     World Wide Web Consortium, (Massachusetts Institute of Technology,
-     European Research Consortium for Informatics and Mathematics, Keio
-     University). All Rights Reserved.
-     http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231"
-  3. If it exists, the STATUS of the W3C document.
-
-When space permits, inclusion of the full text of this NOTICE should be
-provided. We request that authorship attribution be provided in any software,
-documents, or other items or products that you create pursuant to the
-implementation of the contents of this document, or any portion thereof.
-
-No right to create modifications or derivatives of W3C documents is granted
-pursuant to this license. However, if additional requirements (documented in
-the Copyright FAQ) are satisfied, the right to create modifications or
-derivatives is sometimes granted by the W3C to individuals complying with
-those requirements.
-
-THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO
-REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE
-FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT
-INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE
-PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.
-
-The name and trademarks of copyright holders may NOT be used in advertising
-or publicity pertaining to this document or its contents without specific,
-written prior permission. Title to copyright in this document will at all
-times remain with copyright holders.
-
-This formulation of W3C's notice and license became active on December 31 2002. 
-This version removes the copyright ownership notice such that this license can 
-be used with materials other than those owned by the W3C, reflects that ERCIM is 
-now a host of the W3C, includes references to this specific dated version of the 
-license, and removes the ambiguous grant of "use". Otherwise, this version is the 
-same as the previous version and is written so as to preserve the Free Software 
-Foundation's assessment of GPL compatibility and OSI's certification under the 
-Open Source Definition. Please see our Copyright FAQ for common questions about 
-using materials from our site, including specific terms and conditions for packages 
-like libwww, Amaya, and Jigsaw. Other questions about this notice can be directed 
-o site-policy@w3.org.
-
-Joseph Reagle <si...@w3.org>
- 
-Last revised $Id: copyright-software-20021231.html,v 1.11 2004/07/06 16:02:49 slesch Exp $ 
-
-==========================================================================================
-
-XML API library, org.w3c classes (xml-apis)
-    Containing Project URL: 
-
-    DOM Java Language Binding:
-    http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/java-binding.html
-
-    W3C IPR SOFTWARE NOTICE
-    Copyright (C) 2000 World Wide Web Consortium, (Massachusetts Institute of
-    Technology, Institut National de Recherche en Informatique et en
-    Automatique, Keio University). All Rights Reserved.
-
-    The DOM bindings are published under the W3C Software Copyright Notice
-    and License. The software license requires "Notice of any changes or
-    modifications to the W3C files, including the date changes were made."
-    Consequently, modified versions of the DOM bindings must document that
-    they do not conform to the W3C standard; in the case of the IDL binding,
-    the pragma prefix can no longer be 'w3c.org'; in the case of the Java
-    binding, the package names can no longer be in the 'org.w3c' package.
-
-    Note: The original version of the W3C Software Copyright Notice and
-    License could be found at
-    http://www.w3.org/Consortium/Legal/copyright-software-19980720
-
-    Copyright (C) 1994-2000 World Wide Web Consortium, (Massachusetts
-    Institute of Technology, Institut National de Recherche en Informatique
-    et en Automatique, Keio University). All Rights Reserved.
-    http://www.w3.org/Consortium/Legal/
-
-    This W3C work (including software, documents, or other related items) is
-    being provided by the copyright holders under the following license. By
-    obtaining, using and/or copying this work, you (the licensee) agree that
-    you have read, understood, and will comply with the following terms and
-    conditions:
-
-    Permission to use, copy, and modify this software and its documentation,
-    with or without modification, for any purpose and without fee or royalty
-    is hereby granted, provided that you include the following on ALL copies
-    of the software and documentation or portions thereof, including
-    modifications, that you make:
-
-      1. The full text of this NOTICE in a location viewable to users of the
-         redistributed or derivative work.
-
-      2. Any pre-existing intellectual property disclaimers, notices, or
-         terms and conditions. If none exist, a short notice of the following
-         form (hypertext is preferred, text is permitted) should be used
-         within the body of any redistributed or derivative code:
-         "Copyright (C) [$date-of-software] World Wide Web Consortium,
-         (Massachusetts Institute of Technology, Institut National de
-         Recherche en Informatique et en Automatique, Keio University).
-         All Rights Reserved. http://www.w3.org/Consortium/Legal/"
-
-      3. Notice of any changes or modifications to the W3C files, including
-         the date changes were made. (We recommend you provide URIs to the
-         location from which the code is derived.)
-
-    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS
-    MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-    NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
-    PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE
-    ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL
-    OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
-    DOCUMENTATION.
-
-    The name and trademarks of copyright holders may NOT be used in
-    advertising or publicity pertaining to the software without specific,
-    written prior permission. Title to copyright in this software and any
-    associated documentation will at all times remain with copyright holders.
-
-=============================================================================== 
-The following components come under the Eclipse Public 1.0 License 
-=============================================================================== 
-Eclipse JDT Core (core-3.1.1.jar)
-
-  Eclipse Public License - v 1.0
-
-    THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
-    PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
-    THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-    1. DEFINITIONS
-
-    "Contribution" means:
-
-    a) in the case of the initial Contributor, the initial code and
-       documentation distributed under this Agreement, and
-
-    b) in the case of each subsequent Contributor:
-
-       i) changes to the Program, and
-
-       ii) additions to the Program;
-
-       where such changes and/or additions to the Program originate from and
-       are distributed by that particular Contributor. A Contribution
-       'originates' from a Contributor if it was added to the Program by
-       such Contributor itself or anyone acting on such Contributor's behalf.
-       Contributions do not include additions to the Program which: (i) are
-       separate modules of software distributed in conjunction with the
-       Program under their own license agreement, and (ii) are not derivative
-       works of the Program.
-
-    "Contributor" means any person or entity that distributes the Program.
-
-    "Licensed Patents " mean patent claims licensable by a Contributor which
-    are necessarily infringed by the use or sale of its Contribution alone or
-    when combined with the Program.
-
-    "Program" means the Contributions distributed in accordance with this
-    Agreement.
-
-    "Recipient" means anyone who receives the Program under this Agreement,
-    including all Contributors.
-
-    2. GRANT OF RIGHTS
-
-    a) Subject to the terms of this Agreement, each Contributor hereby grants
-       Recipient a non-exclusive, worldwide, royalty-free copyright license to
-       reproduce, prepare derivative works of, publicly display, publicly
-       perform, distribute and sublicense the Contribution of such
-       Contributor, if any, and such derivative works, in source code and
-       object code form.
-
-    b) Subject to the terms of this Agreement, each Contributor hereby grants
-       Recipient a non-exclusive, worldwide, royalty-free patent license under
-       Licensed Patents to make, use, sell, offer to sell, import and
-       otherwise transfer the Contribution of such Contributor, if any, in
-       source code and object code form. This patent license shall apply to
-       the combination of the Contribution and the Program if, at the time
-       the Contribution is added by the Contributor, such addition of the
-       Contribution causes such combination to be covered by the Licensed
-       Patents. The patent license shall not apply to any other combinations
-       which include the Contribution. No hardware per se is licensed hereunder.
-
-    c) Recipient understands that although each Contributor grants the
-       licenses to its Contributions set forth herein, no assurances are
-       provided by any Contributor that the Program does not infringe the
-       patent or other intellectual property rights of any other entity. Each
-       Contributor disclaims any liability to Recipient for claims brought by
-       any other entity based on infringement of intellectual property rights
-       or otherwise. As a condition to exercising the rights and licenses
-       granted hereunder, each Recipient hereby assumes sole responsibility
-       to secure any other intellectual property rights needed, if any. For
-       example, if a third party patent license is required to allow Recipient
-       to distribute the Program, it is Recipient's responsibility to acquire
-       that license before distributing the Program.
-
-    d) Each Contributor represents that to its knowledge it has sufficient
-       copyright rights in its Contribution, if any, to grant the copyright
-       license set forth in this Agreement.
-
-    3. REQUIREMENTS
-
-    A Contributor may choose to distribute the Program in object code form
-    under its own license agreement, provided that:
-
-    a) it complies with the terms and conditions of this Agreement; and
-
-    b) its license agreement:
-
-       i)   effectively disclaims on behalf of all Contributors all warranties
-            and conditions, express and implied, including warranties or
-            conditions of title and non-infringement, and implied warranties
-            or conditions of merchantability and fitness for a particular
-            purpose;
-
-       ii)  effectively excludes on behalf of all Contributors all liability
-            for damages, including direct, indirect, special, incidental and
-            consequential damages, such as lost profits;
-
-       iii) states that any provisions which differ from this Agreement are
-            offered by that Contributor alone and not by any other party; and
-
-       iv)  states that source code for the Program is available from such
-            Contributor, and informs licensees how to obtain it in a
-            reasonable manner on or through a medium customarily used for
-            software exchange.
-
-    When the Program is made available in source code form:
-
-    a) it must be made available under this Agreement; and
-
-    b) a copy of this Agreement must be included with each copy of the
-       Program.
-
-    Contributors may not remove or alter any copyright notices contained
-    within the Program.
-
-    Each Contributor must identify itself as the originator of its
-    Contribution, if any, in a manner that reasonably allows subsequent
-    Recipients to identify the originator of the Contribution.
-
-    4. COMMERCIAL DISTRIBUTION
-
-    Commercial distributors of software may accept certain responsibilities
-    with respect to end users, business partners and the like. While this
-    license is intended to facilitate the commercial use of the Program,
-    the Contributor who includes the Program in a commercial product offering
-    should do so in a manner which does not create potential liability for
-    other Contributors. Therefore, if a Contributor includes the Program in
-    a commercial product offering, such Contributor ("Commercial Contributor")
-    hereby agrees to defend and indemnify every other Contributor
-    ("Indemnified Contributor") against any losses, damages and costs
-    (collectively "Losses") arising from claims, lawsuits and other legal
-    actions brought by a third party against the Indemnified Contributor to
-    the extent caused by the acts or omissions of such Commercial Contributor
-    in connection with its distribution of the Program in a commercial
-    product offering. The obligations in this section do not apply to any
-    claims or Losses relating to any actual or alleged intellectual property
-    infringement. In order to qualify, an Indemnified Contributor must:
-    a) promptly notify the Commercial Contributor in writing of such claim,
-    and b) allow the Commercial Contributor to control, and cooperate with
-    the Commercial Contributor in, the defense and any related settlement
-    negotiations. The Indemnified Contributor may participate in any such
-    claim at its own expense.
-
-    For example, a Contributor might include the Program in a commercial
-    product offering, Product X. That Contributor is then a Commercial
-    Contributor. If that Commercial Contributor then makes performance claims,
-    or offers warranties related to Product X, those performance claims and
-    warranties are such Commercial Contributor's responsibility alone. Under
-    this section, the Commercial Contributor would have to defend claims
-    against the other Contributors related to those performance claims and
-    warranties, and if a court requires any other Contributor to pay any
-    damages as a result, the Commercial Contributor must pay those damages.
-
-    5. NO WARRANTY
-
-    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
-    ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
-    EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
-    CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
-    PARTICULAR PURPOSE. Each Recipient is solely responsible for determining
-    the appropriateness of using and distributing the Program and assumes all
-    risks associated with its exercise of rights under this Agreement ,
-    including but not limited to the risks and costs of program errors,
-    compliance with applicable laws, damage to or loss of data, programs or
-    equipment, and unavailability or interruption of operations.
-
-    6. DISCLAIMER OF LIABILITY
-
-    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
-    ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-    WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-    DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-    HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-    7. GENERAL
-
-    If any provision of this Agreement is invalid or unenforceable under
-    applicable law, it shall not affect the validity or enforceability of
-    the remainder of the terms of this Agreement, and without further action
-    by the parties hereto, such provision shall be reformed to the minimum
-    extent necessary to make such provision valid and enforceable.
-
-    If Recipient institutes patent litigation against any entity (including
-    a cross-claim or counterclaim in a lawsuit) alleging that the Program
-    itself (excluding combinations of the Program with other software or
-    hardware) infringes such Recipient's patent(s), then such Recipient's
-    rights granted under Section 2(b) shall terminate as of the date such
-    litigation is filed.
-
-    All Recipient's rights under this Agreement shall terminate if it fails
-    to comply with any of the material terms or conditions of this Agreement
-    and does not cure such failure in a reasonable period of time after
-    becoming aware of such noncompliance. If all Recipient's rights under
-    this Agreement terminate, Recipient agrees to cease use and distribution
-    of the Program as soon as reasonably practicable. However, Recipient's
-    obligations under this Agreement and any licenses granted by Recipient
-    relating to the Program shall continue and survive.
-
-    Everyone is permitted to copy and distribute copies of this Agreement,
-    but in order to avoid inconsistency the Agreement is copyrighted and may
-    only be modified in the following manner. The Agreement Steward reserves
-    the right to publish new versions (including revisions) of this Agreement
-    from time to time. No one other than the Agreement Steward has the right
-    to modify this Agreement. The Eclipse Foundation is the initial Agreement
-    Steward. The Eclipse Foundation may assign the responsibility to serve as
-    the Agreement Steward to a suitable separate entity. Each new version of
-    the Agreement will be given a distinguishing version number. The Program
-    (including Contributions) may always be distributed subject to the version
-    of the Agreement under which it was received. In addition, after a new
-    version of the Agreement is published, Contributor may elect to distribute
-    the Program (including its Contributions) under the new version. Except as
-    expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
-    rights or licenses to the intellectual property of any Contributor under
-    this Agreement, whether expressly, by implication, estoppel or otherwise.
-    All rights in the Program not expressly granted under this Agreement
-    are reserved.
-
-    This Agreemen

<TRUNCATED>

[33/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
deleted file mode 100644
index 0431c70..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ProvenanceRegistryResource.java
+++ /dev/null
@@ -1,1949 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.ExecutionErrors;
-import org.apache.airavata.registry.api.impl.ExperimentDataImpl;
-import org.apache.airavata.registry.api.impl.WorkflowExecutionDataImpl;
-import org.apache.airavata.registry.api.workflow.*;
-import org.apache.airavata.rest.mappings.resourcemappings.*;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import java.text.DateFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * This class is the REST interface for all the provenance data related methods that are exposed
- * by Airavata Registry API
- */
-@Path(ResourcePathConstants.ProvenanceResourcePathConstants.REGISTRY_API_PROVENANCEREGISTRY)
-public class ProvenanceRegistryResource {
-
-    @Context
-    ServletContext context;
-
-    /**
-     * --------------------------------- Provenance Registry ----------------------------------*
-     */
-
-    /**
-     * This method will update the experiment execution user
-     *
-     * @param experimentId experiment ID
-     * @param user         experiment execution user
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_EXPERIMENT_EXECUTIONUSER)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateExperimentExecutionUser(@FormParam("experimentId") String experimentId,
-                                                  @FormParam("user") String user) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.updateExperimentExecutionUser(experimentId, user);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Experiment execution user updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_EXPERIMENT_EXECUTIONUSER, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve experiment execution user
-     *
-     * @param experimentId experiment ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_EXECUTIONUSER)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response getExperimentExecutionUser(@QueryParam("experimentId") String experimentId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            String user = airavataRegistry.getExperimentExecutionUser(experimentId);
-            if (user != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(user);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_EXECUTIONUSER, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve the experiment name for a given experiment ID
-     *
-     * @param experimentId experiment ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_NAME)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response getExperimentName(@QueryParam("experimentId") String experimentId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            String result = airavataRegistry.getExperimentName(experimentId);
-            if (result != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(result);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_NAME, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the experiment name
-     *
-     * @param experimentId   experiment ID
-     * @param experimentName experiment name
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_EXPERIMENTNAME)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateExperimentName(@FormParam("experimentId") String experimentId,
-                                         @FormParam("experimentName") String experimentName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.updateExperimentName(experimentId, experimentName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Experiment Name updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_EXPERIMENTNAME, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve the experiment metadata
-     *
-     * @param experimentId experiment ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENTMETADATA)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response getExperimentMetadata(@QueryParam("experimentId") String experimentId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            String result = airavataRegistry.getExperimentMetadata(experimentId);
-            if (result != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(result);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENTMETADATA, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the experiment metadata
-     *
-     * @param experimentId experiment ID
-     * @param metadata     experiment metadata
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_EXPERIMENTMETADATA)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateExperimentMetadata(@FormParam("experimentId") String experimentId,
-                                             @FormParam("metadata") String metadata) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.updateExperimentMetadata(experimentId, metadata);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Experiment metadata updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_EXPERIMENTMETADATA, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-
-    /**
-     * This method will retrieve workflow execution name
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWTEMPLATENAME)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response getWorkflowExecutionTemplateName(@QueryParam("workflowInstanceId") String workflowInstanceId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            String result = airavataRegistry.getWorkflowExecutionTemplateName(workflowInstanceId);
-            if (result != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(result);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWTEMPLATENAME, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will set the workflow instance template name
-     *
-     * @param workflowInstanceId workflow instance id
-     * @param templateName       template name
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCETEMPLATENAME)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response setWorkflowInstanceTemplateName(@FormParam("workflowInstanceId") String workflowInstanceId,
-                                                    @FormParam("templateName") String templateName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.setWorkflowInstanceTemplateName(workflowInstanceId, templateName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow template name updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCETEMPLATENAME, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will get experiment workflow instances for a given experiment ID
-     *
-     * @param experimentId experiment ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENTWORKFLOWINSTANCES)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getExperimentWorkflowInstances(@QueryParam("experimentId") String experimentId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<WorkflowExecution> experimentWorkflowInstances = airavataRegistry.getExperimentWorkflowInstances(experimentId);
-            WorkflowInstancesList workflowInstancesList = new WorkflowInstancesList();
-            WorkflowExecution[] workflowInstances = new WorkflowExecution[experimentWorkflowInstances.size()];
-            for (int i = 0; i < experimentWorkflowInstances.size(); i++) {
-                workflowInstances[i] = experimentWorkflowInstances.get(i);
-            }
-            workflowInstancesList.setWorkflowInstances(workflowInstances);
-            if (experimentWorkflowInstances.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowInstancesList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENTWORKFLOWINSTANCES, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will check whether a workflow instance exists
-     *
-     * @param instanceId workflow instance ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_EXIST_CHECK)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isWorkflowInstanceExists(@QueryParam("instanceId") String instanceId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Boolean result = airavataRegistry.isWorkflowInstanceExists(instanceId);
-            if (result) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_EXIST_CHECK, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     * This method will check whether a workflow instance exist and create the workflow instance
-     * according to createIfNotPresent flag
-     *
-     * @param instanceId         workflow instance ID
-     * @param createIfNotPresent flag whether to create a new workflow instance or not
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_EXIST_CREATE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isWorkflowInstanceExistsThenCreate(@FormParam("instanceId") String instanceId,
-                                                       @FormParam("createIfNotPresent") String createIfNotPresent) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Boolean result = airavataRegistry.isWorkflowInstanceExists(instanceId, Boolean.valueOf(createIfNotPresent));
-            if (result) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_EXIST_CREATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update workflow instance status
-     *
-     * @param instanceId      workflow instance ID
-     * @param executionStatus workflow execution status
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCESTATUS_INSTANCEID)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateWorkflowInstanceStatusByInstance(@FormParam("instanceId") String instanceId,
-                                                           @FormParam("executionStatus") String executionStatus) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecutionStatus.State status = WorkflowExecutionStatus.State.valueOf(executionStatus);
-            airavataRegistry.updateWorkflowInstanceStatus(instanceId, status);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow instance status updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCESTATUS_INSTANCEID, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the workflow instance status
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @param executionStatus    workflow execution status
-     * @param statusUpdateTime   workflow status update time
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCESTATUS)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateWorkflowInstanceStatus(@FormParam("workflowInstanceId") String workflowInstanceId,
-                                                 @FormParam("executionStatus") String executionStatus,
-                                                 @FormParam("statusUpdateTime") String statusUpdateTime) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(statusUpdateTime);
-            WorkflowExecutionStatus.State status = WorkflowExecutionStatus.State.valueOf(executionStatus);
-            WorkflowExecutionStatus workflowInstanceStatus = new WorkflowExecutionStatus(workflowInstanceId, workflowInstanceId);
-            workflowInstanceStatus.setExecutionStatus(status);
-            workflowInstanceStatus.setStatusUpdateTime(formattedDate);
-            airavataRegistry.updateWorkflowInstanceStatus(workflowInstanceStatus);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow instance status updated successfully...");
-            return builder.build();
-        } catch (ParseException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWINSTANCESTATUS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve workflow instance statuse for a given workflow instance ID
-     *
-     * @param instanceId workflow instance ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWINSTANCESTATUS)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getWorkflowInstanceStatus(@QueryParam("instanceId") String instanceId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecutionStatus workflowInstanceStatus = airavataRegistry.getWorkflowInstanceStatus(instanceId);
-            if (workflowInstanceStatus != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowInstanceStatus);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWINSTANCESTATUS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update workflowNodeInput
-     *
-     * @param nodeID             workflow node ID
-     * @param workflowInstanceID workflow instance ID
-     * @param data               input data
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODEINPUT)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateWorkflowNodeInput(@FormParam("nodeID") String nodeID,
-                                            @FormParam("workflowInstanceId") String workflowInstanceID,
-                                            @FormParam("data") String data) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecution workflowExecution = new WorkflowExecution(workflowInstanceID, workflowInstanceID);
-            WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(workflowExecution, nodeID);
-            airavataRegistry.updateWorkflowNodeInput(workflowInstanceNode, data);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow node input saved successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODEINPUT, e);
-        }  finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     * This method will update workflow node output
-     *
-     * @param nodeID             workflow node ID
-     * @param workflowInstanceID workflow instance ID
-     * @param data               workflow node output data
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODEOUTPUT)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateWorkflowNodeOutput(@FormParam("nodeID") String nodeID,
-                                             @FormParam("workflowInstanceId") String workflowInstanceID,
-                                             @FormParam("data") String data) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecution workflowExecution = new WorkflowExecution(workflowInstanceID, workflowInstanceID);
-            WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(workflowExecution, nodeID);
-            airavataRegistry.updateWorkflowNodeOutput(workflowInstanceNode, data);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow node output saved successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODEOUTPUT, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /*
-    @GET
-    @Path("search/workflowinstancenodeinput")
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response searchWorkflowInstanceNodeInput(@QueryParam("experimentIdRegEx") String experimentIdRegEx,
-                                                    @QueryParam("workflowNameRegEx") String workflowNameRegEx,
-                                                    @QueryParam("nodeNameRegEx") String nodeNameRegEx) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<WorkflowNodeIOData> workflowNodeIODataList = airavataRegistry.searchWorkflowInstanceNodeInput(experimentIdRegEx, workflowNameRegEx, nodeNameRegEx);
-            WorkflowNodeIODataMapping[] workflowNodeIODataCollection = new WorkflowNodeIODataMapping[workflowNodeIODataList.size()];
-            WorkflowNodeIODataList workflowNodeIOData = new WorkflowNodeIODataList();
-            for (int i = 0; i < workflowNodeIODataList.size(); i++) {
-                WorkflowNodeIOData nodeIOData = workflowNodeIODataList.get(i);
-                WorkflowNodeIODataMapping workflowNodeIODataMapping = new WorkflowNodeIODataMapping();
-
-                workflowNodeIODataMapping.setExperimentId(nodeIOData.getExperimentId());
-                workflowNodeIODataMapping.setWorkflowId(nodeIOData.getWorkflowId());
-                workflowNodeIODataMapping.setWorkflowInstanceId(nodeIOData.getWorkflowInstanceId());
-                workflowNodeIODataMapping.setWorkflowName(nodeIOData.getWorkflowName());
-                workflowNodeIODataMapping.setWorkflowNodeType(nodeIOData.getNodeType().toString());
-                workflowNodeIODataCollection[i] = workflowNodeIODataMapping;
-            }
-            workflowNodeIOData.setWorkflowNodeIOData(workflowNodeIODataCollection);
-            if (workflowNodeIODataList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowNodeIOData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            return builder.build();
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @GET
-    @Path("search/workflowinstancenodeoutput")
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response searchWorkflowInstanceNodeOutput(@QueryParam("experimentIdRegEx") String experimentIdRegEx,
-                                                     @QueryParam("workflowNameRegEx") String workflowNameRegEx,
-                                                     @QueryParam("nodeNameRegEx") String nodeNameRegEx) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<WorkflowNodeIOData> workflowNodeIODataList = airavataRegistry.searchWorkflowInstanceNodeOutput(experimentIdRegEx, workflowNameRegEx, nodeNameRegEx);
-            WorkflowNodeIODataMapping[] workflowNodeIODataCollection = new WorkflowNodeIODataMapping[workflowNodeIODataList.size()];
-            WorkflowNodeIODataList workflowNodeIOData = new WorkflowNodeIODataList();
-            for (int i = 0; i < workflowNodeIODataList.size(); i++) {
-                WorkflowNodeIOData nodeIOData = workflowNodeIODataList.get(i);
-                WorkflowNodeIODataMapping workflowNodeIODataMapping = new WorkflowNodeIODataMapping();
-
-                workflowNodeIODataMapping.setExperimentId(nodeIOData.getExperimentId());
-                workflowNodeIODataMapping.setWorkflowId(nodeIOData.getWorkflowId());
-                workflowNodeIODataMapping.setWorkflowInstanceId(nodeIOData.getWorkflowInstanceId());
-                workflowNodeIODataMapping.setWorkflowName(nodeIOData.getWorkflowName());
-                workflowNodeIODataMapping.setWorkflowNodeType(nodeIOData.getNodeType().toString());
-                workflowNodeIODataCollection[i] = workflowNodeIODataMapping;
-            }
-            workflowNodeIOData.setWorkflowNodeIOData(workflowNodeIODataCollection);
-            if (workflowNodeIODataList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowNodeIOData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            return builder.build();
-        }finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @GET
-    @Path("get/workflowinstancenodeinput")
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getWorkflowInstanceNodeInput(@QueryParam("workflowInstanceId") String workflowInstanceId,
-                                                 @QueryParam("nodeType") String nodeType) {
-        // Airavata JPA Registry method returns null at the moment
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<WorkflowNodeIOData> workflowNodeIODataList = airavataRegistry.getWorkflowInstanceNodeInput(workflowInstanceId, nodeType);
-            WorkflowNodeIODataMapping[] workflowNodeIODataCollection = new WorkflowNodeIODataMapping[workflowNodeIODataList.size()];
-            WorkflowNodeIODataList workflowNodeIOData = new WorkflowNodeIODataList();
-            for (int i = 0; i < workflowNodeIODataList.size(); i++) {
-                WorkflowNodeIOData nodeIOData = workflowNodeIODataList.get(i);
-                WorkflowNodeIODataMapping workflowNodeIODataMapping = new WorkflowNodeIODataMapping();
-
-                workflowNodeIODataMapping.setExperimentId(nodeIOData.getExperimentId());
-                workflowNodeIODataMapping.setWorkflowId(nodeIOData.getWorkflowId());
-                workflowNodeIODataMapping.setWorkflowInstanceId(nodeIOData.getWorkflowInstanceId());
-                workflowNodeIODataMapping.setWorkflowName(nodeIOData.getWorkflowName());
-                workflowNodeIODataMapping.setWorkflowNodeType(nodeIOData.getNodeType().toString());
-                workflowNodeIODataCollection[i] = workflowNodeIODataMapping;
-            }
-            workflowNodeIOData.setWorkflowNodeIOData(workflowNodeIODataCollection);
-            if (workflowNodeIODataList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowNodeIOData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            return builder.build();
-        }  finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @GET
-    @Path("get/workflowinstancenodeoutput")
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getWorkflowInstanceNodeOutput(@QueryParam("workflowInstanceId") String workflowInstanceId,
-                                                  @QueryParam("nodeType") String nodeType) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<WorkflowNodeIOData> workflowNodeIODataList = airavataRegistry.getWorkflowInstanceNodeOutput(workflowInstanceId, nodeType);
-            WorkflowNodeIODataMapping[] workflowNodeIODataCollection = new WorkflowNodeIODataMapping[workflowNodeIODataList.size()];
-            WorkflowNodeIODataList workflowNodeIOData = new WorkflowNodeIODataList();
-            for (int i = 0; i < workflowNodeIODataList.size(); i++) {
-                WorkflowNodeIOData nodeIOData = workflowNodeIODataList.get(i);
-                WorkflowNodeIODataMapping workflowNodeIODataMapping = new WorkflowNodeIODataMapping();
-
-                workflowNodeIODataMapping.setExperimentId(nodeIOData.getExperimentId());
-                workflowNodeIODataMapping.setWorkflowId(nodeIOData.getWorkflowId());
-                workflowNodeIODataMapping.setWorkflowInstanceId(nodeIOData.getWorkflowInstanceId());
-                workflowNodeIODataMapping.setWorkflowName(nodeIOData.getWorkflowName());
-                workflowNodeIODataMapping.setWorkflowNodeType(nodeIOData.getNodeType().toString());
-                workflowNodeIODataCollection[i] = workflowNodeIODataMapping;
-            }
-            workflowNodeIOData.setWorkflowNodeIOData(workflowNodeIODataCollection);
-            if (workflowNodeIODataList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowNodeIOData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (RegistryException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-            return builder.build();
-        }finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-    */
-
-    /**
-     * This method will return all the data related to a given experiment. This will include workflow
-     * status, input values, output values to the workflow, node statuses etc.
-     *
-     * @param experimentId experiment ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getExperiment(@QueryParam("experimentId") String experimentId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ExperimentData experimentData = airavataRegistry.getExperiment(experimentId);
-            if (experimentData != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the experiment IDs for a given user
-     *
-     * @param username experiment execution user
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_ID_USER)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getExperimentIdByUser(@QueryParam("username") String username) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<String> experiments = airavataRegistry.getExperimentIdByUser(username);
-            ExperimentIDList experimentIDList = new ExperimentIDList();
-            experimentIDList.setExperimentIDList(experiments);
-            if (experiments.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentIDList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_ID_USER, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the experiments for a given user
-     *
-     * @param username experiment execution user
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_USER)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getExperimentByUser(@QueryParam("username") String username) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<ExperimentData> experimentDataList = airavataRegistry.getExperimentByUser(username);
-            ExperimentDataList experimentData = new ExperimentDataList();
-            List<ExperimentDataImpl> experimentDatas = new ArrayList<ExperimentDataImpl>();
-            for (ExperimentData anExperimentDataList : experimentDataList) {
-                experimentDatas.add((ExperimentDataImpl)anExperimentDataList);
-            }
-            experimentData.setExperimentDataList(experimentDatas);
-            if (experimentDataList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_USER, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-    
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENTS)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getExperiments(@QueryParam("username") String username, @QueryParam("fromDate") String from, @QueryParam("toDate") String to) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            HashMap<String, String> params = new HashMap<String, String>();
-            if(username!=null && !username.isEmpty()) params.put("username", username);
-            if(from!=null && !from.isEmpty()) params.put("fromDate", from);
-            if(to!=null && !to.isEmpty()) params.put("toDate", to);
-            List<ExperimentData> experiments = airavataRegistry.getExperiments(params);
-            ExperimentDataList experimentData = new ExperimentDataList();
-            List<ExperimentDataImpl> experimentDatas = new ArrayList<ExperimentDataImpl>();
-            for (ExperimentData anExperimentDataList : experiments) {
-                experimentDatas.add((ExperimentDataImpl)anExperimentDataList);
-            }
-            experimentData.setExperimentDataList(experimentDatas);
-            if (experiments.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_USER, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-
-    /**
-     * This method will update the workflow node status
-     *     * @param workflowInstanceId workflow instance ID
-     * @param nodeId             node ID
-     * @param executionStatus    node execution status
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODE_STATUS)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateWorkflowNodeStatus(@FormParam("workflowInstanceId") String workflowInstanceId,
-                                             @FormParam("nodeId") String nodeId,
-                                             @FormParam("executionStatus") String executionStatus) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecutionStatus.State status = WorkflowExecutionStatus.State.valueOf(executionStatus);
-            airavataRegistry.updateWorkflowNodeStatus(workflowInstanceId, nodeId, status);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow node status updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODE_STATUS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve workflow status for a given workflow instance and node
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @param nodeId             node ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWNODE_STATUS)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getWorkflowNodeStatus(@QueryParam("workflowInstanceId") String workflowInstanceId,
-                                          @QueryParam("nodeId") String nodeId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecution workflowExecution = new WorkflowExecution(workflowInstanceId, workflowInstanceId);
-            WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(workflowExecution, nodeId);
-            NodeExecutionStatus workflowNodeStatus = airavataRegistry.getWorkflowNodeStatus(workflowInstanceNode);
-            if (workflowNodeStatus != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowNodeStatus);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWNODE_STATUS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve workflow node started time
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @param nodeId             node ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWNODE_STARTTIME)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response getWorkflowNodeStartTime(@QueryParam("workflowInstanceId") String workflowInstanceId,
-                                             @QueryParam("nodeId") String nodeId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecution workflowExecution = new WorkflowExecution(workflowInstanceId, workflowInstanceId);
-            WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(workflowExecution, nodeId);
-            Date workflowNodeStartTime = airavataRegistry.getWorkflowNodeStartTime(workflowInstanceNode);
-            if (workflowNodeStartTime != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowNodeStartTime.toString());
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWNODE_STARTTIME, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return workflow started time
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOW_STARTTIME)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response getWorkflowStartTime(@QueryParam("workflowInstanceId") String workflowInstanceId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecution workflowInstance = new WorkflowExecution(workflowInstanceId, workflowInstanceId);
-            Date workflowStartTime = airavataRegistry.getWorkflowStartTime(workflowInstance);
-            if (workflowStartTime != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowStartTime.toString());
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOW_STARTTIME, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update workflow node Gram data
-     *
-     * @param workflowNodeGramData workflow node gram data object as a JSON input
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODE_GRAMDATA)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateWorkflowNodeGramData(WorkflowNodeGramData workflowNodeGramData) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.updateWorkflowNodeGramData(workflowNodeGramData);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow node Gram data updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODE_GRAMDATA, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     * This method will return all the information regarding a workflow instance
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWINSTANCEDATA)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getWorkflowInstanceData(@QueryParam("workflowInstanceId") String workflowInstanceId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecutionDataImpl workflowInstanceData = (WorkflowExecutionDataImpl)airavataRegistry.getWorkflowInstanceData(workflowInstanceId);
-            if (workflowInstanceData != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowInstanceData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOWINSTANCEDATA, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method wil check whether a workflow node present
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @param nodeId             node ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_NODE_EXIST)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isWorkflowInstanceNodePresent(@QueryParam("workflowInstanceId") String workflowInstanceId,
-                                                  @QueryParam("nodeId") String nodeId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            boolean workflowInstanceNodePresent = airavataRegistry.isWorkflowInstanceNodePresent(workflowInstanceId, nodeId);
-            if (workflowInstanceNodePresent) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_NODE_EXIST, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     * This method wil check whether a workflow node present and create a new workflow node according
-     * to createIfNotPresent flag
-     *
-     * @param workflowInstanceId workflow instance Id
-     * @param nodeId             node Id
-     * @param createIfNotPresent flag whether to create a new node or not
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_NODE_EXIST_CREATE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isWorkflowInstanceNodePresentCreate(@FormParam("workflowInstanceId") String workflowInstanceId,
-                                                        @FormParam("nodeId") String nodeId,
-                                                        @FormParam("createIfNotPresent") String createIfNotPresent) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            boolean workflowInstanceNodePresent = airavataRegistry.isWorkflowInstanceNodePresent(workflowInstanceId, nodeId, Boolean.getBoolean(createIfNotPresent));
-            if (workflowInstanceNodePresent) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_NODE_EXIST_CREATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-
-    /**
-     * This method will return data related to the workflow instance node
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @param nodeId             node ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_NODE_DATA)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getWorkflowInstanceNodeData(@QueryParam("workflowInstanceId") String workflowInstanceId,
-                                                @QueryParam("nodeId") String nodeId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            NodeExecutionData workflowInstanceNodeData = airavataRegistry.getWorkflowInstanceNodeData(workflowInstanceId, nodeId);
-            if (workflowInstanceNodeData != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowInstanceNodeData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.WORKFLOWINSTANCE_NODE_DATA, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     * This method will add a workflow instance
-     *
-     * @param experimentId       experiment ID
-     * @param workflowInstanceId workflow instance ID
-     * @param templateName       workflow template name
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOWINSTANCE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addWorkflowInstance(@FormParam("experimentId") String experimentId,
-                                        @FormParam("workflowInstanceId") String workflowInstanceId,
-                                        @FormParam("templateName") String templateName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.addWorkflowInstance(experimentId, workflowInstanceId, templateName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow instance added successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOWINSTANCE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the workflow node type
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @param nodeId             node ID
-     * @param nodeType           node type
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODETYPE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateWorkflowNodeType(@FormParam("workflowInstanceId") String workflowInstanceId,
-                                           @FormParam("nodeId") String nodeId,
-                                           @FormParam("nodeType") String nodeType) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowExecution workflowExecution = new WorkflowExecution(workflowInstanceId, workflowInstanceId);
-            WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(workflowExecution, nodeId);
-
-            WorkflowNodeType workflowNodeType = new WorkflowNodeType();
-
-            workflowNodeType.setNodeType(WorkflowNodeType.getType(nodeType).getNodeType());
-//            workflowNodeType.setNodeType(nodeType);
-            airavataRegistry.updateWorkflowNodeType(workflowInstanceNode, workflowNodeType);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow instance node type updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_WORKFLOWNODETYPE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-
-    /**
-     * This method will add a new node to workflow instance
-     *
-     * @param workflowInstanceId workflow instance ID
-     * @param nodeId             node ID
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOWINSTANCENODE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addWorkflowInstanceNode(@FormParam("workflowInstanceId") String workflowInstanceId,
-                                            @FormParam("nodeId") String nodeId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.addWorkflowInstanceNode(workflowInstanceId, nodeId);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow instance node added successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOWINSTANCENODE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-
-    /**
-     * This method wil check whether the experiment name exists
-     *
-     * @param experimentName experiment name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.EXPERIMENTNAME_EXISTS)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isExperimentNameExist(@QueryParam("experimentName") String experimentName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            boolean experimentNameExist = airavataRegistry.isExperimentNameExist(experimentName);
-            if (experimentNameExist) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("False");
-                return builder.build();
-            }
-
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.EXPERIMENTNAME_EXISTS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     * This method will return only information regarding to the experiment. Node information will
-     * not be retrieved
-     *
-     * @param experimentId experiment ID
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_METAINFORMATION)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getExperimentMetaInformation(@QueryParam("experimentId") String experimentId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ExperimentData experimentMetaInformation =
-                     airavataRegistry.getExperimentMetaInformation(experimentId);
-            if (experimentMetaInformation != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentMetaInformation);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_METAINFORMATION, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all meta information for all the experiments
-     *
-     * @param user experiment execution user
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_ALL_EXPERIMENT_METAINFORMATION)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getAllExperimentMetaInformation(@QueryParam("user") String user) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<ExperimentData> allExperimentMetaInformation =
-                    airavataRegistry.getAllExperimentMetaInformation(user);
-            ExperimentDataList experimentDataList = new ExperimentDataList();
-            List<ExperimentDataImpl> experimentDatas = new ArrayList<ExperimentDataImpl>();
-            for (ExperimentData experimentData : allExperimentMetaInformation) {
-                experimentDatas.add((ExperimentDataImpl)experimentData);
-            }
-            experimentDataList.setExperimentDataList(experimentDatas);
-            if (allExperimentMetaInformation.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentDataList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_ALL_EXPERIMENT_METAINFORMATION, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will search all the experiments which has the name like given experiment name for
-     * a given experiment execution user
-     *
-     * @param user                experiment execution user
-     * @param experimentNameRegex experiment name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.SEARCH_EXPERIMENTS)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response searchExperiments(@QueryParam("user") String user,
-                                      @QueryParam("experimentNameRegex") String experimentNameRegex) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<ExperimentData> experimentDataList =
-                    airavataRegistry.searchExperiments(user, experimentNameRegex);
-            ExperimentDataList experimentData = new ExperimentDataList();
-            List<ExperimentDataImpl> experimentDatas = new ArrayList<ExperimentDataImpl>();
-            for (ExperimentData experimentData1 : experimentDataList) {
-                experimentDatas.add((ExperimentDataImpl)experimentData1);
-            }
-            experimentData.setExperimentDataList(experimentDatas);
-            if (experimentDataList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(experimentData);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.SEARCH_EXPERIMENTS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     *
-     * @param experimentId experiment ID
-     * @return
-     */
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_ERRORS)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getExperimentExecutionErrors(@QueryParam("experimentId") String experimentId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ExperimentErrorsList experimentErrorsList = new ExperimentErrorsList();
-            List<ExperimentExecutionError> experimentExecutionErrors = airavataRegistry.getExperimentExecutionErrors(experimentId);
-            if (experimentExecutionErrors.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                experimentErrorsList.setExperimentExecutionErrorList(experimentExecutionErrors);
-                builder.entity(experimentErrorsList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXPERIMENT_ERRORS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOW_ERRORS)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getWorkflowExecutionErrors(@QueryParam("experimentId") String experimentId,
-                                               @QueryParam("workflowInstanceId") String workflowInstanceId) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            WorkflowErrorsList workflowErrorsList = new WorkflowErrorsList();
-            List<WorkflowExecutionError> workflowExecutionErrors = airavataRegistry.getWorkflowExecutionErrors(experimentId, workflowInstanceId);
-            if (workflowExecutionErrors.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                workflowErrorsList.setWorkflowExecutionErrorList(workflowExecutionErrors);
-                builder.entity(workflowErrorsList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_WORKFLOW_ERRORS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_NODE_ERRORS)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getNodeExecutionErrors(@QueryParam("experimentId") String experimentId,
-                                           @QueryParam("workflowInstanceId") String workflowInstanceId,
-                                           @QueryParam("nodeId") String nodeId ) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            NodeErrorsList nodeErrorsList = new NodeErrorsList();
-            List<NodeExecutionError> nodeExecutionErrors = airavataRegistry.getNodeExecutionErrors(experimentId, workflowInstanceId, nodeId);
-            if (nodeExecutionErrors.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                nodeErrorsList.setNodeExecutionErrorList(nodeExecutionErrors);
-                builder.entity(nodeErrorsList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_NODE_ERRORS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_GFAC_ERRORS)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getGFacJobErrors(@QueryParam("experimentId") String experimentId,
-                                           @QueryParam("workflowInstanceId") String workflowInstanceId,
-                                           @QueryParam("nodeId") String nodeId,
-                                           @QueryParam("gfacJobId") String gfacJobId ) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            GFacErrorsList gFacErrorsList = new GFacErrorsList();
-            List<ApplicationJobExecutionError> gFacJobErrors = airavataRegistry.getApplicationJobErrors(experimentId, workflowInstanceId, nodeId, gfacJobId);
-            if (gFacJobErrors.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                gFacErrorsList.setgFacJobExecutionErrorList(gFacJobErrors);
-                builder.entity(gFacErrorsList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_GFAC_ERRORS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_ALL_GFAC_ERRORS)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getAllGFacJobErrors(@QueryParam("gfacJobId") String gfacJobId ) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            GFacErrorsList gFacErrorsList = new GFacErrorsList();
-            List<ApplicationJobExecutionError> gFacJobErrors = airavataRegistry.getApplicationJobErrors(gfacJobId);
-            if (gFacJobErrors.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                gFacErrorsList.setgFacJobExecutionErrorList(gFacJobErrors);
-                builder.entity(gFacErrorsList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_ALL_GFAC_ERRORS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @GET
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXECUTION_ERRORS)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getExecutionErrors(@QueryParam("experimentId") String experimentId,
-                                       @QueryParam("workflowInstanceId") String workflowInstanceId,
-                                       @QueryParam("nodeId") String nodeId,
-                                       @QueryParam("gfacJobId") String gfacJobId,
-                                       @QueryParam("sourceFilter") String sourceFilter) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ExecutionErrorsList executionErrorsList = new ExecutionErrorsList();
-            String[] sourceList = sourceFilter.split(",");
-            List<ExecutionErrors.Source> sourceFilters = new ArrayList<ExecutionErrors.Source>();
-            for (String source : sourceList){
-                ExecutionErrors.Source errorSource = ExecutionErrors.Source.valueOf(source);
-                sourceFilters.add(errorSource);
-            }
-            List<ExecutionError> executionErrors = airavataRegistry.getExecutionErrors(experimentId, workflowInstanceId, nodeId, gfacJobId, sourceFilters.toArray(new ExecutionErrors.Source[]{}));
-            if (executionErrors.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                executionErrorsList.setExecutionErrors(executionErrors);
-                builder.entity(executionErrorsList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.GET_EXECUTION_ERRORS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_EXPERIMENT_ERROR)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addExperimentError(ExperimentExecutionError error) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            int errorID = airavataRegistry.addExperimentError(error);
-            if (errorID != 0){
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(errorID);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_EXPERIMENT_ERROR, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOW_ERROR)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addWorkflowError(WorkflowExecutionError error) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            int errorID = airavataRegistry.addWorkflowExecutionError(error);
-            if (errorID != 0){
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(errorID);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_WORKFLOW_ERROR, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_NODE_ERROR)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addNodeExecutionError(NodeExecutionError error) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            int errorID = airavataRegistry.addNodeExecutionError(error);
-            if (errorID != 0){
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(errorID);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_NODE_ERROR, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_GFAC_ERROR)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addGFacJobExecutionError(ApplicationJobExecutionError error) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            int errorID = airavataRegistry.addApplicationJobExecutionError(error);
-            if (errorID != 0){
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(errorID);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_GFAC_ERROR, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_APPLICATION_JOB)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addApplicationJob(ApplicationJob job) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.addApplicationJob(job);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("GFac Job added successfully");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.ADD_APPLICATION_JOB, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_APPLICATION_JOB)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateApplicationJob(ApplicationJob job) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.updateApplicationJob(job);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("GFac Job updated successfully");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_APPLICATION_JOB, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_APPLICATION_JOB_STATUS)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateApplicationJobStatus(@FormParam("gfacJobID") String gfacJobID,
-                                               @FormParam("gfacJobStatus") String gfacJobStatus,
-                                               @FormParam("statusUpdateDate") String statusUpdatedDate) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            ApplicationJob.ApplicationJobStatus status = ApplicationJob.ApplicationJobStatus.valueOf(gfacJobStatus);
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(statusUpdatedDate);
-            airavataRegistry.updateApplicationJobStatus(gfacJobID, status, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("GFac Job status updated successfully");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_APPLICATION_JOB_STATUS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_APPLICATION_JOB_DATA)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateApplicationJobData(@FormParam("gfacJobID") String gfacJobID,
-                                             @FormParam("jobdata") String jobdata) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.updateApplicationJobData(gfacJobID, jobdata);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("GFac Job data updated successfully");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_APPLICATION_JOB_DATA, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.ProvenanceResourcePathConstants.UPDATE_APPLICATION_JOB_SUBMITTED_TIME)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateApplicationJobSubmittedTime(@FormParam("gfacJobID") String gfacJobID,
-                                                      @FormParam("submittedDate") String submittedDate) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(submittedDate);
-            airavataRegistry.updateApplicationJobSubmittedTime(gfacJobID, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("GFac Job data submitted date upda

<TRUNCATED>

[04/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
deleted file mode 100644
index d67caad..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.amazon;
-
-import com.amazonaws.auth.AWSCredentials;
-import com.amazonaws.auth.BasicAWSCredentials;
-import com.amazonaws.services.ec2.AmazonEC2Client;
-import org.apache.airavata.gfac.ec2.EC2Provider;
-import org.apache.airavata.gfac.ec2.util.EC2ProviderUtil;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
-import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-import java.io.File;
-import java.io.IOException;
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.InvalidKeySpecException;
-
-public class ChangeCredentialWindow {
-    private XBayaEngine engine;
-    private XBayaDialog dialog;
-    private XBayaTextField accessKeyIDTextField;
-    private XBayaTextField secretAccessKeyTextField;
-
-    private JDialog owner;
-
-    /**
-     * Constructs a ChangeCredentialWindow.
-     *
-     * @param engine XBayaEngine
-     */
-    public ChangeCredentialWindow(XBayaEngine engine) {
-        this.engine = engine;
-        initGUI();
-    }
-
-    public ChangeCredentialWindow(JDialog owner) {
-        this.owner = owner;
-        initGUI();
-    }
-
-    protected void initGUI() {
-        this.accessKeyIDTextField = new XBayaTextField();
-        XBayaLabel accessKeyIDLabel = new XBayaLabel("Access Key", this.accessKeyIDTextField);
-
-        this.secretAccessKeyTextField = new XBayaTextField();
-        XBayaLabel secretAccessKeyLabel = new XBayaLabel("Secret Key", this.secretAccessKeyTextField);
-
-        GridPanel infoPanel = new GridPanel();
-        infoPanel.add(accessKeyIDLabel);
-        infoPanel.add(this.accessKeyIDTextField);
-        infoPanel.add(secretAccessKeyLabel);
-        infoPanel.add(this.secretAccessKeyTextField);
-
-        infoPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);
-
-        GridPanel mainPanel = new GridPanel();
-        mainPanel.add(infoPanel);
-        mainPanel.layout(1, 1, GridPanel.WEIGHT_EQUALLY, GridPanel.WEIGHT_EQUALLY);
-
-        JButton okButton = new JButton("Ok");
-        okButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                String accessID = ChangeCredentialWindow.this.accessKeyIDTextField.getText();
-                if (!"".equals(accessID)) {
-                    String secretID = ChangeCredentialWindow.this.secretAccessKeyTextField.getText();
-
-                    if (!"".equals(secretID)) {
-                        AmazonCredential.getInstance().setAwsAccessKeyId(accessID);
-                        AmazonCredential.getInstance().setAwsSecretAccessKey(secretID);
-                        hide();
-                        return;
-                    }
-                }
-
-                JOptionPane.showMessageDialog(dialog.getDialog(),"SecretKey and AccessKey can not be empty!");
-            }
-
-        });
-
-        JButton generateButton = new JButton("Generate Key Pair");
-        generateButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                String accessID = ChangeCredentialWindow.this.accessKeyIDTextField.getText();
-                if (!"".equals(accessID)) {
-                    String secretID = ChangeCredentialWindow.this.secretAccessKeyTextField.getText();
-
-                    if (!"".equals(secretID)) {
-                        AmazonCredential.getInstance().setAwsAccessKeyId(accessID);
-                        AmazonCredential.getInstance().setAwsSecretAccessKey(secretID);
-
-                        File file = new File(System.getProperty("user.home") + "/.ssh/" + EC2Provider.KEY_PAIR_NAME);
-
-                        if (file.exists()) {
-                            ChangeCredentialWindow.this.engine.getGUI().getErrorWindow().
-                                    info(ChangeCredentialWindow.this.dialog.getDialog(),
-                                    "Warning", "The file " + file.getAbsolutePath() + " exists.");
-
-                        } else {
-                            AWSCredentials credential =
-                                    new BasicAWSCredentials(accessID, secretID);
-                            AmazonEC2Client ec2client = new AmazonEC2Client(credential);
-
-                            try {
-                                EC2ProviderUtil.buildKeyPair(ec2client, EC2Provider.KEY_PAIR_NAME);
-                            } catch (NoSuchAlgorithmException e1) {
-                                ChangeCredentialWindow.this.engine.getGUI().getErrorWindow().
-                                        info(ChangeCredentialWindow.this.dialog.getDialog(),
-                                        "Warning", e1.getMessage());
-                            } catch (InvalidKeySpecException e1) {
-                                ChangeCredentialWindow.this.engine.getGUI().getErrorWindow().
-                                        info(ChangeCredentialWindow.this.dialog.getDialog(),
-                                        "Warning", e1.getMessage());
-                            } catch (IOException e1) {
-                                ChangeCredentialWindow.this.engine.getGUI().getErrorWindow().
-                                        info(ChangeCredentialWindow.this.dialog.getDialog(),
-                                        "Warning", e1.getMessage());
-                            }
-
-                            JOptionPane.showMessageDialog(dialog.getDialog(),"The key " +
-                                    file.getAbsolutePath() + " generated.");
-                        }
-
-                        hide();
-                        return;
-                    }
-                }
-
-                JOptionPane.showMessageDialog(dialog.getDialog(),"SecretKey and AccessKey can not be empty!");
-            }
-
-        });
-
-        JButton cancelButton = new JButton("Cancel");
-        cancelButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                hide();
-            }
-        });
-
-        JPanel buttonPanel = new JPanel();
-        buttonPanel.add(okButton);
-        buttonPanel.add(generateButton);
-        buttonPanel.add(cancelButton);
-
-        if (this.owner == null) {
-            this.dialog = new XBayaDialog(this.engine.getGUI(), "Security Credentials", mainPanel, buttonPanel);
-        } else {
-            this.dialog = new XBayaDialog(this.owner, "Security Credentials", mainPanel, buttonPanel);
-        }
-    }
-
-    /**
-     * hide the dialog (when user clicked on cancel)
-     */
-    public void hide() {
-        this.dialog.hide();
-    }
-
-    /**
-     * show the dialog
-     */
-    public void show() {
-        if (!"".equals(AmazonCredential.getInstance().getAwsAccessKeyId())) {
-            ChangeCredentialWindow.this.accessKeyIDTextField
-                    .setText(AmazonCredential.getInstance().getAwsAccessKeyId());
-        }
-        if (!"".equals(AmazonCredential.getInstance().getAwsSecretAccessKey())) {
-            ChangeCredentialWindow.this.secretAccessKeyTextField.setText(AmazonCredential.getInstance()
-                    .getAwsSecretAccessKey());
-        }
-        this.dialog.show();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2InstancesManagementWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2InstancesManagementWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2InstancesManagementWindow.java
deleted file mode 100644
index de40180..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2InstancesManagementWindow.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.amazon;
-
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
-import org.apache.airavata.xbaya.core.amazon.EC2InstanceResult;
-import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XbayaEnhancedList;
-import org.apache.airavata.xbaya.util.AmazonUtil;
-
-import javax.swing.*;
-import javax.swing.border.EtchedBorder;
-import javax.swing.border.TitledBorder;
-import java.awt.*;
-import java.awt.event.ActionEvent;
-import java.util.ArrayList;
-import java.util.List;
-
-public class EC2InstancesManagementWindow {
-    private XBayaEngine engine;
-    private XBayaDialog dialog;
-    private XbayaEnhancedList<EC2InstanceResult> list;
-    private ChangeCredentialWindow credentialWindow;
-
-    /**
-     * Constructs a EC2InstancesManagementWindow.
-     * 
-     * @param engine XBayaEngine
-     */
-    public EC2InstancesManagementWindow(XBayaEngine engine) {
-        this.engine = engine;
-        initGUI();
-    }
-
-    public void show() {
-        this.dialog.show();
-    }
-
-    public void hide() {
-        this.dialog.hide();
-    }
-
-    private void initGUI() {
-        this.list = new XbayaEnhancedList<EC2InstanceResult>();
-
-        GridPanel mainPanel = new GridPanel();
-        TitledBorder border = new TitledBorder(new EtchedBorder(), "My Instances");
-        mainPanel.getSwingComponent().setBorder(border);
-        mainPanel.add(this.list);
-        mainPanel.layout(1, 1, 0, 0);
-
-        /* Connect/Refresh Button */
-        JButton refreshButton = new JButton("Refresh");
-        refreshButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-
-                /* Check if Credential is already set or not */
-                if (credentialSet()) {
-                    InstancesLoader instancesLoader = new InstancesLoader(EC2InstancesManagementWindow.this.engine,
-                            EC2InstancesManagementWindow.this.dialog.getDialog());
-                    instancesLoader.load(EC2InstancesManagementWindow.this.list);
-                }
-            }
-        });
-
-        /* Launch Instance Button */
-        JButton launchButton = new JButton("Launch");
-        launchButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                if (credentialSet()) {
-                    EC2LaunchWindow ec2LaunchWindow = new EC2LaunchWindow(EC2InstancesManagementWindow.this.engine);
-                    ec2LaunchWindow.show();
-                }
-            }
-        });
-
-        /* Terminate Instance */
-        JButton terminateButton = new JButton("Terminate");
-        terminateButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                List<EC2InstanceResult> selected = EC2InstancesManagementWindow.this.list.getSelectedValues();
-
-                if (selected.size() == 0) {
-                    EC2InstancesManagementWindow.this.engine.getGUI().getErrorWindow().info(
-                            EC2InstancesManagementWindow.this.dialog.getDialog(), "Warning", "No instances selected");
-                    return;
-                }
-
-                String text = "";
-                List<String> requestIds = new ArrayList<String>();
-
-                for (EC2InstanceResult ec2InstancesResult : selected) {
-                    requestIds.add(ec2InstancesResult.getInstance().getInstanceId());
-                    text += ec2InstancesResult.getInstance().getInstanceId() + ",";
-                }
-
-                // confirm from user
-                int n = JOptionPane.showConfirmDialog(EC2InstancesManagementWindow.this.dialog.getDialog(),
-                        "Are you want to terminate instances:\n" + text, "Terminate Instances",
-                        JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
-
-                if (n == JOptionPane.YES_OPTION) {
-                    // terminate
-                    AmazonUtil.terminateInstances(requestIds);
-
-                    // reload
-                    InstancesLoader instancesLoader = new InstancesLoader(EC2InstancesManagementWindow.this.engine,
-                            EC2InstancesManagementWindow.this.dialog.getDialog());
-                    instancesLoader.load(EC2InstancesManagementWindow.this.list);
-                }
-            }
-        });
-
-        /* Close Button */
-        JButton closeButton = new JButton("Close");
-        closeButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                EC2InstancesManagementWindow.this.hide();
-            }
-        });
-
-        JPanel buttonPanel = new JPanel();
-        buttonPanel.add(refreshButton);
-        buttonPanel.add(launchButton);
-        buttonPanel.add(terminateButton);
-        buttonPanel.add(closeButton);
-
-        this.dialog = new XBayaDialog(this.engine.getGUI(), "Amazon EC2 Management Console", mainPanel, buttonPanel);
-        int width = 800;
-        int height = 500;
-        this.dialog.getDialog().setPreferredSize(new Dimension(width, height));
-        this.dialog.setDefaultButton(closeButton);
-
-    }
-
-    private boolean credentialSet() {
-        if (AmazonCredential.getInstance().getAwsAccessKeyId().isEmpty()
-                || AmazonCredential.getInstance().getAwsSecretAccessKey().isEmpty()) {
-            EC2InstancesManagementWindow.this.engine.getGUI().getErrorWindow().warning(
-                    EC2InstancesManagementWindow.this.dialog.getDialog(), "Error", "Aws Access Key not set!");
-
-            if (this.credentialWindow == null) {
-                this.credentialWindow = new ChangeCredentialWindow(EC2InstancesManagementWindow.this.dialog.getDialog());
-            }
-            try {
-                this.credentialWindow.show();
-                return false;
-            } catch (Exception e1) {
-                EC2InstancesManagementWindow.this.engine.getGUI().getErrorWindow().error(e1);
-            }
-        }
-        return true;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2LaunchWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2LaunchWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2LaunchWindow.java
deleted file mode 100644
index a62be69..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2LaunchWindow.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.amazon;
-
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaComboBox;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.apache.airavata.xbaya.util.AmazonUtil;
-
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-public class EC2LaunchWindow {
-    private XBayaEngine engine;
-    private XBayaDialog dialog;
-    private XBayaTextField amiTextField;
-    private JSpinner numberOfInstanceSpinner;
-    private XBayaComboBox instanceTypeComboBox;
-    private XBayaComboBox keyComboBox;
-    private JRadioButton existKeyButton;
-    private ComboBoxModel keyComboBoxModel;
-
-    /**
-     * Constructs a EC2LaunchWindow.
-     * 
-     * @param engine XBayaEngine
-     */
-    public EC2LaunchWindow(XBayaEngine engine) {
-        this.engine = engine;
-        initGUI();
-    }
-
-    private void initGUI() {
-        /* Main Panel */
-        this.amiTextField = new XBayaTextField();
-        XBayaLabel amiLabel = new XBayaLabel("AMI ID", this.amiTextField);
-
-        this.numberOfInstanceSpinner = new JSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
-        XBayaLabel nInstanceLabel = new XBayaLabel("Number Of Instances", this.numberOfInstanceSpinner);
-
-        this.instanceTypeComboBox = new XBayaComboBox(new DefaultComboBoxModel(AmazonUtil.INSTANCE_TYPE));
-        this.instanceTypeComboBox.setSelectedItem(AmazonUtil.INSTANCE_TYPE[1]);
-        XBayaLabel instanceTypeLabel = new XBayaLabel("Instance Type", this.instanceTypeComboBox);
-
-        JRadioButton noKeyButton = new JRadioButton("No Key Pair");
-        noKeyButton.setSelected(true);
-        noKeyButton.addActionListener(new ActionListener() {
-            @Override
-            public void actionPerformed(ActionEvent paramActionEvent) {
-                EC2LaunchWindow.this.keyComboBox.getJComboBox().setEnabled(false);
-            }
-        });
-
-        this.existKeyButton = new JRadioButton("Exist Key Pairs");
-        this.existKeyButton.addActionListener(new ActionListener() {
-
-            @Override
-            public void actionPerformed(ActionEvent paramActionEvent) {
-                if (EC2LaunchWindow.this.keyComboBoxModel == null) {
-                    EC2LaunchWindow.this.keyComboBoxModel = new DefaultComboBoxModel(AmazonUtil.loadKeypairs()
-                            .toArray());
-                    EC2LaunchWindow.this.keyComboBox.setModel(EC2LaunchWindow.this.keyComboBoxModel);
-                }
-                EC2LaunchWindow.this.keyComboBox.getJComboBox().setEnabled(true);
-            }
-        });
-
-        ButtonGroup serviceTypeButtonGroup = new ButtonGroup();
-        serviceTypeButtonGroup.add(noKeyButton);
-        serviceTypeButtonGroup.add(this.existKeyButton);
-
-        this.keyComboBox = new XBayaComboBox(new DefaultComboBoxModel());
-        this.keyComboBox.getJComboBox().setEnabled(false);
-
-        GridPanel radioPanel = new GridPanel();
-        radioPanel.add(noKeyButton);
-        radioPanel.add(new JPanel());
-        radioPanel.add(this.existKeyButton);
-        radioPanel.add(this.keyComboBox);
-        radioPanel.layout(2, 2, 0, 1);
-
-        XBayaLabel keyLabel = new XBayaLabel("Key Pair", radioPanel);
-
-        GridPanel mainPanel = new GridPanel(true);
-        mainPanel.add(amiLabel);
-        mainPanel.add(this.amiTextField);
-        mainPanel.add(nInstanceLabel);
-        mainPanel.add(this.numberOfInstanceSpinner);
-        mainPanel.add(instanceTypeLabel);
-        mainPanel.add(this.instanceTypeComboBox);
-        mainPanel.add(keyLabel);
-        mainPanel.add(radioPanel);
-        mainPanel.layout(4, 2, 0, GridPanel.WEIGHT_EQUALLY);
-
-        /* Button Panel */
-        JButton lunchButton = new JButton("Launch");
-        lunchButton.addActionListener(new AbstractAction() {
-
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                // validation
-                if (EC2LaunchWindow.this.amiTextField.getText() == null
-                        || EC2LaunchWindow.this.amiTextField.getText().isEmpty()
-                        || (Integer) EC2LaunchWindow.this.numberOfInstanceSpinner.getValue() <= 0) {
-                    EC2LaunchWindow.this.engine.getGUI().getErrorWindow().info(EC2LaunchWindow.this.dialog.getDialog(),
-                            "Warning", "Please input all fields");
-                    return;
-                }
-
-                try {
-                    // get all data
-                    String ami = EC2LaunchWindow.this.amiTextField.getText();
-                    String instanceType = EC2LaunchWindow.this.instanceTypeComboBox.getText();
-                    Integer n = (Integer) EC2LaunchWindow.this.numberOfInstanceSpinner.getValue();
-
-                    // use exist key pair
-                    if (EC2LaunchWindow.this.existKeyButton.isSelected()) {
-                        String keyname = EC2LaunchWindow.this.keyComboBox.getText();
-                        AmazonUtil.launchInstance(ami, instanceType, n, keyname);
-                    } else {
-                        AmazonUtil.launchInstance(ami, instanceType, n);
-                    }
-
-                    EC2LaunchWindow.this.hide();
-
-                } catch (NumberFormatException nfe) {
-                    EC2LaunchWindow.this.engine.getGUI().getErrorWindow().info(EC2LaunchWindow.this.dialog.getDialog(),
-                            "Warning", "Number of Instances is not numeric");
-                } catch (Exception ex) {
-                    EC2LaunchWindow.this.engine.getGUI().getErrorWindow().error(EC2LaunchWindow.this.dialog.getDialog(),
-                            "Cannot start EC2 instances: " + ex.getMessage(), ex);
-                }
-            }
-        });
-
-        JButton closeButton = new JButton("Close");
-        closeButton.addActionListener(new AbstractAction() {
-            @Override
-            public void actionPerformed(ActionEvent e) {
-                EC2LaunchWindow.this.hide();
-            }
-        });
-
-        JPanel buttonPanel = new JPanel();
-        buttonPanel.add(lunchButton);
-        buttonPanel.add(closeButton);
-
-        this.dialog = new XBayaDialog(this.engine.getGUI(), "Amazon EC2 Launcher", mainPanel, buttonPanel);
-    }
-
-    public void hide() {
-        this.dialog.hide();
-    }
-
-    public void show() {
-        this.dialog.show();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java
deleted file mode 100644
index 72ffd84..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.amazon;
-
-import com.amazonaws.AmazonClientException;
-import com.amazonaws.AmazonServiceException;
-import com.amazonaws.services.ec2.model.Instance;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.core.amazon.EC2InstanceResult;
-import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
-import org.apache.airavata.xbaya.ui.utils.Cancelable;
-import org.apache.airavata.xbaya.ui.widgets.XbayaEnhancedList;
-import org.apache.airavata.xbaya.util.AmazonUtil;
-
-import javax.swing.*;
-import java.util.ArrayList;
-import java.util.List;
-
-public class InstancesLoader implements Cancelable {
-    private XBayaEngine engine;
-    private JDialog parent;
-
-    private boolean canceled;
-
-    private WaitDialog loadingDialog;
-
-    /**
-     * Constructs a InstancesLoader.
-     * 
-     * @param engine XBayaEngine
-     * @param parent JDialog
-     */
-    public InstancesLoader(XBayaEngine engine, JDialog parent) {
-        this.engine = engine;
-        this.parent = parent;
-        this.loadingDialog = new WaitDialog(this, "Loading EC2 Instances.", "Loading EC2 Instances.\n"
-                + "Please wait for a moment.", this.engine.getGUI());
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
-     */
-    @Override
-    public void cancel() {
-        this.canceled = true;
-    }
-
-    /**
-     * Load instance list.
-     *
-     * @param list instance list
-     */
-    public void load(final XbayaEnhancedList<EC2InstanceResult> list) {
-
-        new Thread(new Runnable() {
-
-            @Override
-            public void run() {
-                try {
-
-                    List<EC2InstanceResult> tmpList = new ArrayList<EC2InstanceResult>();
-
-                    List<Instance> instances = AmazonUtil.loadInstances();
-                    for (Instance instance : instances) {
-                        tmpList.add(new EC2InstanceResult(instance));
-                    }
-
-                    if (!InstancesLoader.this.canceled) {
-                        list.setListData(tmpList);
-                    }
-
-                } catch (AmazonServiceException ex) {
-                    InstancesLoader.this.engine.getGUI().getErrorWindow().error(InstancesLoader.this.parent,
-                            "Cannot load EC2 instances", ex);
-                } catch (AmazonClientException ex) {
-                    InstancesLoader.this.engine.getGUI().getErrorWindow().error(InstancesLoader.this.parent,
-                            "Cannot load EC2 instances", ex);
-                } finally {
-                    InstancesLoader.this.loadingDialog.hide();
-                }
-            }
-        }).start();
-
-        this.loadingDialog.show();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java
deleted file mode 100644
index acbdfd5..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.amazon;
-
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
-import org.apache.airavata.xbaya.ui.utils.Cancelable;
-import org.jets3t.service.S3Service;
-import org.jets3t.service.model.S3Object;
-
-import javax.swing.*;
-import java.io.*;
-
-public class S3Downloader implements Cancelable {
-
-    private XBayaEngine engine;
-    private JDialog parent;
-
-    private boolean canceled;
-
-    private WaitDialog loadingDialog;
-
-    /**
-     * Constructs a S3Downloader.
-     * 
-     * @param engine XBayaEngine
-     * @param parent JDialog
-     */
-    public S3Downloader(XBayaEngine engine, JDialog parent) {
-        this.engine = engine;
-        this.parent = parent;
-        this.loadingDialog = new WaitDialog(this, "Downloading file from S3.", "Downloading file from S3.\n"
-                + "Please wait for a moment.", this.engine.getGUI());
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
-     */
-    @Override
-    public void cancel() {
-        this.canceled = true;
-    }
-
-    /**
-     * Download bucket.
-     *
-     * @param s3 S3Service
-     * @param bucket bucket
-     * @param key Key
-     * @param directory directory
-     */
-    public void download(final S3Service s3, final String bucket, final String key, final String directory) {
-
-        new Thread(new Runnable() {
-
-            @Override
-            public void run() {
-
-                BufferedWriter out = null;
-                BufferedReader in = null;
-                try {
-                    S3Object s3Object = s3.getObject(bucket, key);
-
-                    File fileOut = new File(directory + File.separator + s3Object.getKey());
-                    if (!fileOut.getParentFile().exists()) {
-                        fileOut.getParentFile().mkdirs();
-                    }
-                    if (!fileOut.exists()) {
-                        fileOut.createNewFile();
-                    }
-
-                    out = new BufferedWriter(new FileWriter(fileOut));
-                    in = new BufferedReader(new InputStreamReader(s3Object.getDataInputStream()));
-                    String data = null;
-                    while ((data = in.readLine()) != null) {
-
-                        // stop download and delete file
-                        if (S3Downloader.this.canceled) {
-                            out.close();
-                            fileOut.delete();
-                            return;
-                        }
-
-                        out.write(data);
-                        out.newLine();
-                    }
-
-                    S3Downloader.this.engine.getGUI().getErrorWindow().info(S3Downloader.this.parent, "",
-                            "Downloaded successfully!");
-                } catch (Exception ex) {
-                    S3Downloader.this.engine.getGUI().getErrorWindow().error(S3Downloader.this.parent,
-                            "Download failed! Please ensure every fields are filled correctly", ex);
-                } finally {
-                    if (in != null) {
-                        try {
-                            in.close();
-                        } catch (IOException io) {
-                            // do nothing
-                        }
-                    }
-                    if (out != null) {
-                        try {
-                            out.close();
-                        } catch (IOException io) {
-                            // do nothing
-                        }
-                    }
-
-                    // close loading dialog
-                    S3Downloader.this.loadingDialog.hide();
-                }
-            }
-
-        }).start();
-
-        this.loadingDialog.show();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java
deleted file mode 100644
index 5178ce3..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.amazon;
-
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
-import org.apache.airavata.xbaya.ui.utils.Cancelable;
-import org.apache.airavata.xbaya.ui.widgets.amazon.S3Tree;
-import org.jets3t.service.S3Service;
-import org.jets3t.service.model.S3Object;
-
-import javax.swing.*;
-import java.io.File;
-
-public class S3Uploader implements Cancelable {
-    private XBayaEngine engine;
-    private JDialog parent;
-
-    private boolean canceled;
-
-    private WaitDialog loadingDialog;
-
-    /**
-     * Constructs a S3Uploader.
-     * 
-     * @param engine XBayaEngine
-     * @param parent JDialog
-     */
-    public S3Uploader(XBayaEngine engine, JDialog parent) {
-        this.engine = engine;
-        this.parent = parent;
-        this.loadingDialog = new WaitDialog(this, "Uploading file to S3.", "Uploading file to S3.\n"
-                + "Please wait for a moment.", this.engine.getGUI());
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
-     */
-    @Override
-    public void cancel() {
-        this.canceled = true;
-    }
-
-    /**
-     * Upload bucket.
-     *
-     * @param s3 S3Service
-     * @param s3tree S3Tree
-     * @param bucket bucket
-     * @param filePath file path
-     */
-    public void upload(final S3Service s3, final S3Tree s3tree, final String bucket, final String filePath) {
-
-        new Thread(new Runnable() {
-
-            @Override
-            public void run() {
-
-                int index;
-                index = filePath.lastIndexOf('/');
-                String fileName;
-                if (index == -1) {
-                    index = filePath.lastIndexOf('\\');
-                }
-                fileName = filePath.substring(index + 1, filePath.length());
-                try {
-                    S3Object s3Object = new S3Object(new File(filePath));
-                    s3.putObject(bucket, s3Object);
-
-                    /*
-                     * We cannot cancel during upload, so delete file instead
-                     */
-                    if (S3Uploader.this.canceled) {
-                        s3.deleteObject(bucket, s3Object.getKey());
-                    } else {
-
-                        S3Uploader.this.engine.getGUI().getErrorWindow().info(S3Uploader.this.parent, "",
-                                "Uploaded successfully!");
-
-                        // add key to S3Tree
-                        int startIndex = bucket.lastIndexOf('/');
-                        startIndex = startIndex >= 0 ? startIndex : 0;
-                        if (startIndex != 0) {
-                            fileName = bucket.substring(startIndex) + '/' + fileName;
-                        }
-
-                        if (fileName.startsWith("/")) {
-                            fileName = fileName.substring(1, fileName.length());
-                        }
-
-                        s3tree.addObject(bucket, fileName);
-                    }
-
-                } catch (Exception ex) {
-                    S3Uploader.this.engine.getGUI().getErrorWindow().error(S3Uploader.this.parent,
-                            "Upload failed! Please ensure every fields are filled correctly", ex);
-                } finally {
-                    // close loading dialog
-                    S3Uploader.this.loadingDialog.hide();
-                }
-            }
-
-        }).start();
-
-        this.loadingDialog.show();
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/URLRegistryWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/URLRegistryWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/URLRegistryWindow.java
deleted file mode 100644
index 7aac6e3..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/URLRegistryWindow.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.component;
-
-import java.awt.event.ActionEvent;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.swing.AbstractAction;
-import javax.swing.JButton;
-import javax.swing.JPanel;
-
-import org.apache.airavata.workflow.model.component.url.URLComponentRegistry;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
-import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.apache.airavata.xbaya.util.RegistryConstants;
-
-/**
- * 
- * Adds components to the component browser through a URL (eg: add service from a WSDL) 
- *
- */
-public class URLRegistryWindow {
-
-    private XBayaEngine engine;
-
-    private ComponentRegistryLoader loader;
-
-    private XBayaDialog dialog;
-
-    private XBayaTextField urlTextField;
-
-    /**
-     * @param engine
-     */
-    public URLRegistryWindow(XBayaEngine engine) {
-        this.engine = engine;
-        this.loader = ComponentRegistryLoader.getLoader(this.engine, RegistryConstants.REGISTRY_TYPE_URL);
-        initGUI();
-    }
-
-    /**
-     * Displays the dialog.
-     */
-    public void show() {
-        this.dialog.show();
-    }
-
-    private void hide() {
-        this.dialog.hide();
-    }
-
-    private void ok() {
-        String urlString = this.urlTextField.getText();
-
-        if (urlString.length() == 0) {
-            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_EMPTY);
-            return;
-        }
-        URI url;
-        try {
-            url = new URI(urlString);
-        } catch (URISyntaxException e) {
-            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_WRONG, e);
-            return;
-        }
-
-        URLComponentRegistry registry = new URLComponentRegistry(url);
-
-        hide();
-
-        this.loader.load(registry);
-    }
-
-    /**
-     * Initializes the GUI.
-     */
-    private void initGUI() {
-        this.urlTextField = new XBayaTextField();
-        XBayaLabel urlLabel = new XBayaLabel("URL", this.urlTextField);
-
-        GridPanel infoPanel = new GridPanel();
-        infoPanel.add(urlLabel);
-        infoPanel.add(this.urlTextField);
-        infoPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);
-
-        JButton okButton = new JButton("OK");
-        okButton.addActionListener(new AbstractAction() {
-            public void actionPerformed(ActionEvent e) {
-                ok();
-            }
-        });
-
-        JButton cancelButton = new JButton("Cancel");
-        cancelButton.addActionListener(new AbstractAction() {
-            public void actionPerformed(ActionEvent e) {
-                hide();
-            }
-        });
-
-        JPanel buttonPanel = new JPanel();
-        buttonPanel.add(okButton);
-        buttonPanel.add(cancelButton);
-
-        this.dialog = new XBayaDialog(this.engine.getGUI(), "Web Registry", infoPanel, buttonPanel);
-        this.dialog.setDefaultButton(okButton);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/WebResigtryWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/WebResigtryWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/WebResigtryWindow.java
deleted file mode 100644
index aae1652..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/WebResigtryWindow.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.component;
-
-import java.awt.event.ActionEvent;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.swing.AbstractAction;
-import javax.swing.JButton;
-import javax.swing.JPanel;
-
-import org.apache.airavata.workflow.model.component.web.WebComponentRegistry;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
-import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.apache.airavata.xbaya.util.RegistryConstants;
-
-public class WebResigtryWindow {
-
-    private XBayaEngine engine;
-
-    private ComponentRegistryLoader loader;
-
-    private XBayaDialog dialog;
-
-    private XBayaTextField urlTextField;
-
-    /**
-     * @param engine
-     */
-    public WebResigtryWindow(XBayaEngine engine) {
-        this.engine = engine;
-        this.loader = ComponentRegistryLoader.getLoader(this.engine, RegistryConstants.REGISTRY_TYPE_WEB);
-        initGUI();
-    }
-
-    /**
-     * Displays the dialog.
-     */
-    public void show() {
-        if (this.urlTextField.getText().length() == 0) {
-            this.urlTextField.setText(XBayaConstants.DEFAULT_WEB_REGISTRY.toString());
-        }
-        this.dialog.show();
-    }
-
-    private void hide() {
-        this.dialog.hide();
-    }
-
-    private void ok() {
-        String urlString = this.urlTextField.getText();
-
-        if (urlString.length() == 0) {
-            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_EMPTY);
-            return;
-        }
-        URL url;
-        try {
-            url = new URL(urlString);
-        } catch (MalformedURLException e) {
-            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_WRONG, e);
-            return;
-        }
-
-        WebComponentRegistry registry = new WebComponentRegistry(url);
-
-        hide();
-
-        this.loader.load(registry);
-    }
-
-    /**
-     * Initializes the GUI.
-     */
-    private void initGUI() {
-        this.urlTextField = new XBayaTextField();
-        XBayaLabel urlLabel = new XBayaLabel("URL", this.urlTextField);
-
-        GridPanel infoPanel = new GridPanel();
-        infoPanel.add(urlLabel);
-        infoPanel.add(this.urlTextField);
-        infoPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);
-
-        JButton okButton = new JButton("OK");
-        okButton.addActionListener(new AbstractAction() {
-            public void actionPerformed(ActionEvent e) {
-                ok();
-            }
-        });
-
-        JButton cancelButton = new JButton("Cancel");
-        cancelButton.addActionListener(new AbstractAction() {
-            public void actionPerformed(ActionEvent e) {
-                hide();
-            }
-        });
-
-        JPanel buttonPanel = new JPanel();
-        buttonPanel.add(okButton);
-        buttonPanel.add(cancelButton);
-
-        this.dialog = new XBayaDialog(this.engine.getGUI(), "Web Registry", infoPanel, buttonPanel);
-        this.dialog.setDefaultButton(okButton);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
deleted file mode 100644
index fe72516..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.descriptors;
-
-import java.awt.Font;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JSeparator;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.SwingConstants;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
-import org.apache.airavata.schemas.gfac.NameValuePairType;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-
-public class ApplicationDescriptionAdvancedOptionDialog extends JDialog {
-    private static final long serialVersionUID = 3920479739097405014L;
-    private XBayaTextField txtInputDir;
-    private XBayaTextField txtOutputDir;
-    private XBayaTextField txtSTDIN;
-    private XBayaTextField txtSTDOUT;
-    private XBayaTextField txtSTDERR;
-    private JTable tblEnv;
-    private ApplicationDescription shellApplicationDescription;
-    private DefaultTableModel defaultTableModel;
-    private boolean tableModelChanging = false;
-    private JButton btnDeleteVariable;
-    private JButton okButton;
-    private AiravataAPI registry;
-	private XBayaTextField txtWorkingDir;
-
-    /**
-     * Launch the application.
-     */
-    public static void main(String[] args) {
-        try {
-            ApplicationDescriptionAdvancedOptionDialog dialog = new ApplicationDescriptionAdvancedOptionDialog(null,
-                    null);
-            dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-            dialog.setVisible(true);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-    }
-
-    /**
-     * Create the dialog.
-     */
-    public ApplicationDescriptionAdvancedOptionDialog(AiravataAPI registry, ApplicationDescription descriptor) {
-        addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowOpened(WindowEvent arg0) {
-                loadApplicationDescriptionAdvancedOptions();
-            }
-        });
-        setRegistry(registry);
-        setShellApplicationDescription(descriptor);
-        initGUI();
-    }
-
-    public void open() {
-        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        setVisible(true);
-    }
-
-    protected ApplicationDescriptionAdvancedOptionDialog getDialog() {
-        return this;
-    }
-
-    public void close() {
-        getDialog().setVisible(false);
-    }
-
-    @SuppressWarnings("serial")
-	private void initGUI() {
-        setTitle("Application Description Advance Options");
-        setModal(true);
-        setBounds(100, 100, 600, 400);
-        setLocationRelativeTo(null);
-        GridPanel buttonPane = new GridPanel();
-        okButton = new JButton("Update");
-        okButton.setActionCommand("OK");
-        okButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                saveApplicationDescriptionAdvancedOptions();
-                close();
-            }
-        });
-        getRootPane().setDefaultButton(okButton);
-    
-    
-        JButton cancelButton = new JButton("Cancel");
-        cancelButton.setActionCommand("Cancel");
-        cancelButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                close();
-            }
-        });
-            
-        
-        
-    	GridPanel panel = new GridPanel();
-        
-        txtInputDir = new XBayaTextField();
-        
-        XBayaLabel lblInputDirectory = new XBayaLabel("Input directory",txtInputDir);
-
-        JLabel lblLocations = new JLabel("Locations");
-        lblLocations.setFont(new Font("Tahoma", Font.BOLD, 11));
-
-        txtOutputDir = new XBayaTextField();
-        XBayaLabel lblOutputDirectory = new XBayaLabel("Output directory",txtOutputDir);
-
-        txtWorkingDir = new XBayaTextField();
-        XBayaLabel lblWorkingDir = new XBayaLabel("Static Working directory",txtWorkingDir);
-        
-        JLabel lblProgramData = new JLabel("Program data");
-        lblProgramData.setFont(new Font("Tahoma", Font.BOLD, 11));
-
-
-        txtSTDIN = new XBayaTextField();
-        XBayaLabel lblStdin = new XBayaLabel("STDIN",txtSTDIN);
-
-
-        txtSTDOUT = new XBayaTextField();
-        XBayaLabel lblStdout = new XBayaLabel("STDOUT",txtSTDOUT);
-
-
-        txtSTDERR = new XBayaTextField();
-        XBayaLabel lblStderr = new XBayaLabel("STDERR",txtSTDERR);
-
-        JLabel other = new JLabel("Other");
-        other.setFont(new Font("Tahoma", Font.BOLD, 11));
-
-        JSeparator separator_1 = new JSeparator();
-        separator_1.setOrientation(SwingConstants.VERTICAL);
-
-        JLabel lblEnvironmentalVariables = new JLabel("Environmental Variables");
-        lblEnvironmentalVariables.setFont(new Font("Tahoma", Font.BOLD, 11));
-
-        JScrollPane scrollPane = new JScrollPane();
-
-        btnDeleteVariable = new JButton("Delete variable");
-        btnDeleteVariable.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                deleteSelectedRows();
-            }
-        });
-        btnDeleteVariable.setEnabled(false);
-        tblEnv = new JTable();
-        tblEnv.setFillsViewportHeight(true);
-        scrollPane.setViewportView(tblEnv);
-        tblEnv.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-        defaultTableModel = new DefaultTableModel(new Object[][] { { null, null }, }, new String[] { "Name",
-                "Value" }) {
-            @SuppressWarnings("rawtypes")
-			Class[] columnTypes = new Class[] { String.class, String.class };
-
-            @SuppressWarnings({ "rawtypes", "unchecked" })
-			public Class getColumnClass(int columnIndex) {
-                return columnTypes[columnIndex];
-            }
-        };
-        tblEnv.setModel(defaultTableModel);
-        defaultTableModel.addTableModelListener(new TableModelListener() {
-            public void tableChanged(TableModelEvent arg0) {
-                if (!tableModelChanging) {
-                    addNewRowIfLastIsNotEmpty();
-                }
-            }
-
-        });
-        tblEnv.getColumnModel().getColumn(0).setPreferredWidth(67);
-        tblEnv.getColumnModel().getColumn(1).setPreferredWidth(158);
-        ListSelectionModel selectionModel = tblEnv.getSelectionModel();
-        selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
-
-        selectionModel.addListSelectionListener(new ListSelectionListener() {
-            public void valueChanged(ListSelectionEvent e) {
-                btnDeleteVariable.setEnabled(tblEnv.getSelectedRows().length > 0);
-            }
-
-        });
-        
-        GridPanel leftPanel = new GridPanel();
-        leftPanel.add(lblLocations);
-        leftPanel.add(new JLabel());
-        leftPanel.add(lblInputDirectory);
-        leftPanel.add(txtInputDir);
-        leftPanel.add(lblOutputDirectory);
-        leftPanel.add(txtOutputDir);
-        leftPanel.add(lblWorkingDir);
-        leftPanel.add(txtWorkingDir);
-        leftPanel.add(lblProgramData);
-        
-        leftPanel.add(new JLabel());
-        leftPanel.add(lblStdin);
-        leftPanel.add(txtSTDIN);
-        leftPanel.add(lblStdout);
-        leftPanel.add(txtSTDOUT);
-        leftPanel.add(lblStderr);
-        leftPanel.add(txtSTDERR);
-        
-        SwingUtil.layoutToGrid(leftPanel.getSwingComponent(), 8, 2, SwingUtil.WEIGHT_NONE, 1);
-        
-        GridPanel rightPanel = new GridPanel();
-        rightPanel.add(lblEnvironmentalVariables);
-        rightPanel.add(scrollPane);
-        rightPanel.add(btnDeleteVariable);
-        rightPanel.getSwingComponent().setSize(150, -1);
-        leftPanel.getSwingComponent().setSize(150, -1);
-        SwingUtil.layoutToGrid(rightPanel.getSwingComponent(), 3, 1, 1, 0);
-        
-        GridPanel p=new GridPanel();
-        p.add(leftPanel);
-        p.add(new JSeparator(JSeparator.VERTICAL));
-        p.layout(1,2, 0,0);
-        panel.add(p);
-        panel.add(rightPanel);
-        panel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-
-        SwingUtil.layoutToGrid(panel.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, SwingUtil.WEIGHT_EQUALLY);
-        
-        buttonPane.add(okButton);
-        buttonPane.add(cancelButton);
-        buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-
-        getContentPane().add(panel.getSwingComponent());
-        getContentPane().add(buttonPane.getSwingComponent());
-        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
-        setResizable(true);
-        getRootPane().setDefaultButton(okButton);
-    }
-
-    private void deleteSelectedRows() {
-        // TODO confirm deletion of selected rows
-        int selectedRow = tblEnv.getSelectedRow();
-        while (selectedRow >= 0) {
-            defaultTableModel.removeRow(selectedRow);
-            selectedRow = tblEnv.getSelectedRow();
-        }
-        addNewRowIfLastIsNotEmpty();
-    }
-
-    public ApplicationDescription getApplicationDescription() {
-        return shellApplicationDescription;
-    }
-
-    public ApplicationDeploymentDescriptionType getShellApplicationDescriptionType() {
-        return (ApplicationDeploymentDescriptionType)shellApplicationDescription.getType();
-    }
-    
-    public void setShellApplicationDescription(ApplicationDescription shellApplicationDescription) {
-        this.shellApplicationDescription = shellApplicationDescription;
-    }
-
-    private void addNewRowIfLastIsNotEmpty() {
-        Object varName = null;
-        if (defaultTableModel.getRowCount() > 0) {
-            varName = defaultTableModel.getValueAt(defaultTableModel.getRowCount() - 1, 0);
-        }
-        if (defaultTableModel.getRowCount() == 0 || (varName != null && !varName.equals(""))) {
-            defaultTableModel.addRow(new Object[] { null, null });
-        }
-    }
-
-    private void saveApplicationDescriptionAdvancedOptions() {
-    	getShellApplicationDescriptionType().setInputDataDirectory(txtInputDir.getText());
-    	getShellApplicationDescriptionType().setOutputDataDirectory(txtOutputDir.getText());
-    	getShellApplicationDescriptionType().setStaticWorkingDirectory(txtWorkingDir.getText());
-    	getShellApplicationDescriptionType().setStandardInput(txtSTDIN.getText());
-    	getShellApplicationDescriptionType().setStandardOutput(txtSTDOUT.getText());
-    	getShellApplicationDescriptionType().setStandardError(txtSTDERR.getText());
-    	
-    	while(getShellApplicationDescriptionType().getApplicationEnvironmentArray().length>0){
-    		getShellApplicationDescriptionType().removeApplicationEnvironment(0);
-    	}
-    	for (int i = 0; i < defaultTableModel.getRowCount(); i++) {
-            String parameterName = (String) defaultTableModel.getValueAt(i, 0);
-            String paramValue = (String) defaultTableModel.getValueAt(i, 1);
-            if (parameterName != null && !parameterName.trim().equals("")) {
-            	NameValuePairType envType = getShellApplicationDescriptionType().addNewApplicationEnvironment();
-        		envType.setName(parameterName);
-                envType.setValue(paramValue);
-            }
-        }
-    }
-
-    private void loadApplicationDescriptionAdvancedOptions() {
-        txtInputDir.setText(getShellApplicationDescriptionType().getInputDataDirectory());
-        txtOutputDir.setText(getShellApplicationDescriptionType().getOutputDataDirectory());
-        txtWorkingDir.setText(getShellApplicationDescriptionType().getStaticWorkingDirectory());
-        txtSTDIN.setText(getShellApplicationDescriptionType().getStandardInput());
-        txtSTDOUT.setText(getShellApplicationDescriptionType().getStandardOutput());
-        txtSTDERR.setText(getShellApplicationDescriptionType().getStandardError());
-        tableModelChanging = true;
-        while(defaultTableModel.getRowCount()>0){
-    		defaultTableModel.removeRow(0);
-    	}
-        NameValuePairType[] envParams = getShellApplicationDescriptionType().getApplicationEnvironmentArray();
-    	for (NameValuePairType envParam : envParams) {
-    		defaultTableModel.addRow(new Object[] { envParam.getName(),envParam.getValue()});
-		}
-    	addNewRowIfLastIsNotEmpty();
-        tableModelChanging = false;
-    }
-
-
-
-    public AiravataAPI getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-
-
-}


[89/90] [abbrv] git commit: AIRAVATA-1124

Posted by sa...@apache.org.
AIRAVATA-1124


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/9c47eec8
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/9c47eec8
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/9c47eec8

Branch: refs/heads/master
Commit: 9c47eec85f9bf56d311f14677cbeaa20b8474c70
Parents: 0e2c10f
Author: Saminda Wijeratne <sa...@gmail.com>
Authored: Sun Apr 13 22:33:09 2014 -0700
Committer: Saminda Wijeratne <sa...@gmail.com>
Committed: Sun Apr 13 22:33:09 2014 -0700

----------------------------------------------------------------------
 modules/security/pom.xml                        |   55 +
 .../security/AbstractAuthenticator.java         |  150 ++
 .../security/AbstractDatabaseAuthenticator.java |  129 ++
 .../security/AuthenticationException.java       |   41 +
 .../apache/airavata/security/Authenticator.java |  108 ++
 .../apache/airavata/security/Authoriser.java    |   43 +
 .../org/apache/airavata/security/UserStore.java |   71 +
 .../airavata/security/UserStoreException.java   |   46 +
 .../AbstractConfigurationReader.java            |   55 +
 .../AuthenticatorConfigurationReader.java       |  244 +++
 .../userstore/AbstractJDBCUserStore.java        |  134 ++
 .../security/userstore/JDBCUserStore.java       |  166 ++
 .../security/userstore/LDAPUserStore.java       |  147 ++
 .../security/userstore/SessionDBUserStore.java  |  132 ++
 .../security/util/PasswordDigester.java         |  111 ++
 .../AuthenticatorConfigurationReaderTest.java   |  119 ++
 .../configurations/TestDBAuthenticator1.java    |   57 +
 .../configurations/TestDBAuthenticator2.java    |   58 +
 .../configurations/TestDBAuthenticator3.java    |   57 +
 .../security/configurations/TestUserStore.java  |   47 +
 .../security/userstore/JDBCUserStoreTest.java   |  106 ++
 .../security/userstore/LDAPUserStoreTest.java   |   69 +
 .../userstore/SessionDBUserStoreTest.java       |  101 ++
 .../src/test/resources/authenticators.xml       |   88 +
 .../test/resources/disabled-authenticator.xml   |   84 +
 .../src/test/resources/jdbc-authenticator.xml   |   39 +
 .../src/test/resources/ldap-authenticator.xml   |   41 +
 .../test/resources/session-authenticator.xml    |   45 +
 .../ws-messenger/messagebox/maven-eclipse.xml   |   16 +
 modules/ws-messenger/messagebox/pom.xml         |  100 ++
 .../wsmg/msgbox/MsgBoxServiceLifeCycle.java     |  192 +++
 .../MsgBoxServiceMessageReceiverInOut.java      |  138 ++
 .../wsmg/msgbox/MsgBoxServiceSkeleton.java      |  186 +++
 .../wsmg/msgbox/Storage/MsgBoxStorage.java      |   59 +
 .../Storage/dbpool/DatabaseStorageImpl.java     |  125 ++
 .../msgbox/Storage/dbpool/MessageBoxDB.java     |  265 +++
 .../msgbox/Storage/memory/InMemoryImpl.java     |  133 ++
 .../wsmg/msgbox/StoreMessageHandler.java        |  123 ++
 .../airavata/wsmg/msgbox/util/ConfigKeys.java   |   36 +
 .../wsmg/msgbox/util/MsgBoxCommonConstants.java |   26 +
 .../wsmg/msgbox/util/MsgBoxOperations.java      |   53 +
 .../airavata/wsmg/msgbox/util/MsgBoxUtils.java  |   71 +
 .../resources/database_scripts/msgBox-derby.sql |   41 +
 .../resources/database_scripts/msgBox-mysql.sql |   42 +
 .../messagebox/src/main/resources/services.xml  |   57 +
 .../wsmg/msgbox/InMemoryMessageBoxServer.java   |  157 ++
 .../wsmg/msgbox/MessageBoxStressTest.java       |  129 ++
 .../apache/airavata/wsmg/msgbox/MsgBoxTest.java |  103 ++
 modules/ws-messenger/messagebroker/pom.xml      |  117 ++
 .../wsmg/broker/AbstractBrokerMsgReceiver.java  |  105 ++
 .../wsmg/broker/AdditionalMessageContent.java   |  131 ++
 .../wsmg/broker/BrokerServiceLifeCycle.java     |  328 ++++
 .../airavata/wsmg/broker/ConsumerInfo.java      |  123 ++
 .../airavata/wsmg/broker/ConsumerList.java      |   73 +
 .../wsmg/broker/ConsumerListManager.java        |   79 +
 .../wsmg/broker/NotificationProcessor.java      |  313 ++++
 .../broker/amqp/AMQPNotificationProcessor.java  |  132 ++
 .../broker/context/ContextParameterInfo.java    |   58 +
 .../wsmg/broker/context/ContextParameters.java  |   72 +
 .../wsmg/broker/context/ProcessingContext.java  |  114 ++
 .../context/ProcessingContextBuilder.java       |   30 +
 .../broker/handler/PublishedMessageHandler.java |  120 ++
 .../wsmg/broker/subscription/CleanupThread.java |  148 ++
 .../broker/subscription/SubscriptionEntry.java  |   49 +
 .../subscription/SubscriptionManager.java       |  440 +++++
 .../broker/subscription/SubscriptionState.java  |  301 ++++
 .../wseventing/WSEProcessingContextBuilder.java |  186 +++
 .../broker/wseventing/WSEProtocolSupport.java   |  204 +++
 .../wseventing/WSEventingMsgReceiver.java       |   77 +
 .../WSEventingPublishMsgReceiver.java           |   74 +
 .../wsnotification/WSNTProtocolSupport.java     |  237 +++
 .../WSNotificationMsgReceiver.java              |  110 ++
 .../WSNotificationProcessingContextBuilder.java |  179 +++
 .../airavata/wsmg/commons/OutGoingMessage.java  |  125 ++
 .../commons/storage/WsmgInMemoryStorage.java    |  106 ++
 .../commons/storage/WsmgPersistantStorage.java  |  773 +++++++++
 .../wsmg/commons/storage/WsmgQueue.java         |   34 +
 .../wsmg/commons/storage/WsmgStorage.java       |   39 +
 .../wsmg/commons/util/OMElementComparator.java  |  177 ++
 .../airavata/wsmg/config/WSMGParameter.java     |   48 +
 .../wsmg/config/WsmgConfigurationContext.java   |  118 ++
 .../wsmg/matching/AbstractMessageMatcher.java   |   89 ++
 .../wsmg/matching/XPath/YFilterInfo.java        |  156 ++
 .../matching/XPath/YFilterMessageMatcher.java   |  183 +++
 .../simpleTopic/DirectWsntMessageMatcher.java   |  125 ++
 .../wsmg/messenger/ConsumerUrlManager.java      |  195 +++
 .../airavata/wsmg/messenger/Deliverable.java    |   32 +
 .../wsmg/messenger/DeliveryProcessor.java       |   90 ++
 .../airavata/wsmg/messenger/OutGoingQueue.java  |   65 +
 .../airavata/wsmg/messenger/SenderUtils.java    |  161 ++
 .../messenger/protocol/DeliveryProtocol.java    |   34 +
 .../messenger/protocol/SendingException.java    |   37 +
 .../messenger/protocol/impl/Axis2Protocol.java  |  156 ++
 .../messenger/strategy/SendingStrategy.java     |   33 +
 .../strategy/impl/ConsumerHandler.java          |   71 +
 .../strategy/impl/FixedParallelSender.java      |  185 +++
 .../messenger/strategy/impl/LightweightMsg.java |   54 +
 .../messenger/strategy/impl/ParallelSender.java |  155 ++
 .../messenger/strategy/impl/SerialSender.java   |   75 +
 .../apache/airavata/wsmg/util/BrokerUtil.java   |  121 ++
 .../org/apache/airavata/wsmg/util/Counter.java  |   77 +
 .../airavata/wsmg/util/RunTimeStatistics.java   |  157 ++
 .../apache/airavata/wsmg/util/TimerThread.java  |   87 +
 .../wsmg/util/WsEventingOperations.java         |   55 +
 .../wsmg/util/WsNotificationOperations.java     |   56 +
 .../database_scripts/cleanDBScript.sql          |   27 +
 .../database_scripts/msgBroker-derby.sql        |   60 +
 .../database_scripts/msgBroker-mysql.sql        |   61 +
 .../src/main/resources/services.xml             |  125 ++
 .../airavata/wsmg/broker/BrokerWSETest.java     |  107 ++
 .../airavata/wsmg/broker/BrokerWSNTTest.java    |  108 ++
 .../wsmg/commons/TestCommonRoutines.java        |   57 +
 .../TestAddtionalWseXpathAndTopicScenarios.java |  151 ++
 .../XPath/TestWseXpathAndTopicSubscription.java |  137 ++
 .../XPath/TestWseXpathSubscription.java         |  139 ++
 .../matching/XPath/performance/XppXPath.java    |  269 ++++
 .../rtt/NotificationManager.java                |  151 ++
 .../rtt/PerformanceTest.java                    |  399 +++++
 .../rtt/PublisherThread.java                    |   99 ++
 .../rtt/StatCalculatorThread.java               |  103 ++
 .../rtt/StatContainer.java                      |   49 +
 .../performance_evaluator/rtt/Subscription.java |  107 ++
 .../rtt/util/ConfigKeys.java                    |   43 +
 .../rtt/util/LoadMsgPayload.java                |   66 +
 .../rtt/util/LoadXpath.java                     |   66 +
 .../airavata/wsmg/util/BrokerUtilTest.java      |  167 ++
 .../apache/airavata/wsmg/util/ConfigKeys.java   |   34 +
 .../airavata/wsmg/util/TestUtilServer.java      |  225 +++
 .../src/test/resources/unit_tests.properties    |   24 +
 modules/xbaya-gui/pom.xml                       |  322 ++++
 .../java/org/apache/airavata/xbaya/XBaya.java   |  315 ++++
 .../airavata/xbaya/XBayaConfiguration.java      |  974 +++++++++++
 .../apache/airavata/xbaya/XBayaConstants.java   |  205 +++
 .../org/apache/airavata/xbaya/XBayaEngine.java  |  302 ++++
 .../org/apache/airavata/xbaya/XBayaVersion.java |   42 +
 .../component/registry/ComponentController.java |   50 +
 .../registry/ComponentRegistryLoader.java       |  195 +++
 .../xbaya/concurrent/PredicatedExecutable.java  |   33 +
 .../xbaya/concurrent/PredicatedTaskRunner.java  |  153 ++
 .../xbaya/core/amazon/AmazonCredential.java     |   79 +
 .../xbaya/core/amazon/EC2InstanceResult.java    |   94 ++
 .../xbaya/core/generators/BPELFiler.java        |  145 ++
 .../xbaya/core/generators/ImageFiler.java       |  106 ++
 .../xbaya/core/generators/JythonFiler.java      |  128 ++
 .../xbaya/core/generators/ODEScriptFiler.java   |  165 ++
 .../xbaya/core/generators/ScuflFiler.java       |  127 ++
 .../xbaya/core/generators/WorkflowFiler.java    |  267 ++++
 .../xbaya/core/generators/XmlBeansFiler.java    |   71 +
 .../core/ide/XBayaExecutionModeListener.java    |   34 +
 .../xbaya/core/workflow/ParameterListModel.java |   88 +
 .../xbaya/datadriven/WorkflowHarvester.java     |  191 +++
 .../airavata/xbaya/file/XBayaPathConstants.java |   64 +
 .../airavata/xbaya/gfac/GFacRegistryClient.java |  169 ++
 .../airavata/xbaya/gfac/SimpleWSClient.java     |  134 ++
 .../xbaya/globus/FileTransferConstants.java     |   38 +
 .../xbaya/globus/GridFTPFileTransferClient.java |  238 +++
 .../xbaya/graph/controller/NodeController.java  |  199 +++
 .../xbaya/interpretor/DoWhileHandler.java       |  251 +++
 .../xbaya/interpretor/ExperimentTemplate.java   |   37 +
 .../GUIWorkflowInterpreterInteractorImpl.java   |  211 +++
 .../xbaya/interpretor/HeaderConstants.java      |   33 +
 .../SSWorkflowInterpreterInteractorImpl.java    |  118 ++
 .../StandaloneNotificationSender.java           |  135 ++
 .../interpretor/SystemComponentInvoker.java     |  114 ++
 .../WorkFlowInterpreterException.java           |   37 +
 .../interpretor/WorkflowExecutionMessage.java   |   40 +
 .../interpretor/WorkflowExecutionTemplate.java  |   51 +
 .../xbaya/interpretor/WorkflowInterpreter.java  | 1508 ++++++++++++++++++
 .../WorkflowInterpreterConfiguration.java       |  233 +++
 .../WorkflowInterpreterInteractor.java          |   94 ++
 .../interpretor/WorkflowInterpreterInvoker.java |   66 +
 .../WorkflowInterpretorEventListener.java       |  387 +++++
 ...WorkflowInterpretorMessageReceiverInOut.java |  262 +++
 .../WorkflowInterpretorSkeleton.java            |  572 +++++++
 .../xbaya/invoker/AsynchronousInvoker.java      |  118 ++
 .../airavata/xbaya/invoker/DynamicInvoker.java  |  167 ++
 .../xbaya/invoker/DynamicServiceCreator.java    |   86 +
 .../xbaya/invoker/EmbeddedGFacInvoker.java      |  686 ++++++++
 .../airavata/xbaya/invoker/GFacInvoker.java     |  199 +++
 .../airavata/xbaya/invoker/GenericInvoker.java  |  529 ++++++
 .../apache/airavata/xbaya/invoker/Invoker.java  |  105 ++
 .../invoker/MsgBoxWsaResponsesCorrelator.java   |  140 ++
 .../airavata/xbaya/invoker/SimpleInvoker.java   |  260 +++
 .../xbaya/invoker/WorkflowInputUtil.java        |   84 +
 .../WorkflowInvokerWrapperForGFacInvoker.java   |  233 +++
 .../xbaya/invoker/factory/InvokerFactory.java   |   90 ++
 .../xbaya/jython/lib/GFacServiceCreator.java    |  168 ++
 .../xbaya/jython/lib/NotificationSender.java    |  289 ++++
 .../xbaya/jython/lib/ServiceNotifiable.java     |   82 +
 .../jython/lib/ServiceNotificationSender.java   |  293 ++++
 .../StandaloneServiceNotificationSender.java    |   95 ++
 .../xbaya/jython/lib/WorkflowNotifiable.java    |   92 ++
 .../xbaya/jython/runner/JythonClassLoader.java  |  423 +++++
 .../jython/runner/JythonOneTimeRunner.java      |   35 +
 .../jython/runner/JythonOneTimeRunnerImpl.java  |   85 +
 .../xbaya/jython/runner/JythonRunner.java       |   73 +
 .../xbaya/jython/script/JythonScript.java       |  671 ++++++++
 .../apache/airavata/xbaya/lead/LEADTypes.java   |  225 +++
 .../xbaya/lead/LeadContextHeaderHelper.java     |  155 ++
 .../xbaya/lead/NotificationHandler.java         |  190 +++
 .../xbaya/menues/tools/ToolsMenuItem.java       |  100 ++
 .../registrybrowser/AiravataConfigurations.java |   54 +
 .../ApplicationDeploymentDescriptionWrap.java   |   98 ++
 .../ApplicationDeploymentDescriptions.java      |  107 ++
 .../registrybrowser/EventingServiceURL.java     |   54 +
 .../registrybrowser/EventingServiceURLs.java    |   54 +
 .../xbaya/model/registrybrowser/GFacURL.java    |   54 +
 .../xbaya/model/registrybrowser/GFacURLs.java   |   56 +
 .../model/registrybrowser/HostDescriptions.java |   50 +
 .../model/registrybrowser/InputParameters.java  |   36 +
 .../registrybrowser/InterpreterServiceURL.java  |   54 +
 .../registrybrowser/InterpreterServiceURLs.java |   56 +
 .../model/registrybrowser/MessageBoxURL.java    |   54 +
 .../model/registrybrowser/MessageBoxURLs.java   |   54 +
 .../model/registrybrowser/NodeParameter.java    |   60 +
 .../model/registrybrowser/OutputParameters.java |   36 +
 .../registrybrowser/ServiceDescriptions.java    |   50 +
 .../registrybrowser/ServiceParameters.java      |   57 +
 .../model/registrybrowser/XBayaWorkflow.java    |   94 ++
 .../XBayaWorkflowExperiment.java                |   81 +
 .../XBayaWorkflowExperiments.java               |   65 +
 .../XBayaWorkflowNodeElement.java               |  107 ++
 .../registrybrowser/XBayaWorkflowTemplate.java  |   50 +
 .../registrybrowser/XBayaWorkflowTemplates.java |   63 +
 .../xbaya/modifier/WorkflowModifier.java        |  260 +++
 .../xbaya/provenance/ProvenanceReader.java      |   64 +
 .../xbaya/provenance/ProvenanceWrite.java       |  217 +++
 .../provenance/WorkflowNodeStatusUpdater.java   |  135 ++
 .../xbaya/provenance/WorkflowStatusUpdater.java |  103 ++
 .../xbaya/registry/PasswordCallbackImpl.java    |   39 +
 .../xbaya/registry/RegistryAccesser.java        |  212 +++
 .../nodes/AbstractAiravataTreeNode.java         |  255 +++
 .../nodes/AiravataConfigurationsNode.java       |   94 ++
 .../nodes/AiravataTreeNodeFactory.java          |  112 ++
 .../ApplicationDeploymentDescriptionNode.java   |  131 ++
 .../ApplicationDeploymentDescriptionsNode.java  |  139 ++
 .../nodes/EventingServiceURLNode.java           |   98 ++
 .../nodes/EventingServiceURLsNode.java          |   91 ++
 .../registrybrowser/nodes/GFacURLNode.java      |   98 ++
 .../registrybrowser/nodes/GFacURLsNode.java     |   91 ++
 .../nodes/HostDescriptionNode.java              |  127 ++
 .../nodes/HostDescriptionsNode.java             |  131 ++
 .../nodes/InputParametersNode.java              |   46 +
 .../nodes/InterpreterServiceURLNode.java        |   98 ++
 .../nodes/InterpreterServiceURLsNode.java       |   90 ++
 .../registrybrowser/nodes/JCRBrowserIcons.java  |   50 +
 .../nodes/MessageBoxURLNode.java                |   98 ++
 .../nodes/MessageBoxURLsNode.java               |   90 ++
 .../nodes/OutputParametersNode.java             |   46 +
 .../registrybrowser/nodes/ParameterNode.java    |  136 ++
 .../nodes/ParameterValueNode.java               |   90 ++
 .../registrybrowser/nodes/ParametersNode.java   |   90 ++
 .../registrybrowser/nodes/RegistryNode.java     |  130 ++
 .../nodes/RegistryTreeCellRenderer.java         |   43 +
 .../nodes/ServiceDescriptionNode.java           |  142 ++
 .../nodes/ServiceDescriptionsNode.java          |  137 ++
 .../nodes/XBayaWorkflowExperimentNode.java      |  141 ++
 .../nodes/XBayaWorkflowExperimentsNode.java     |   89 ++
 .../nodes/XBayaWorkflowNode.java                |  107 ++
 .../nodes/XBayaWorkflowNodeElementNode.java     |  101 ++
 .../nodes/XBayaWorkflowTemplateNode.java        |  130 ++
 .../nodes/XBayaWorkflowTemplatesNode.java       |   99 ++
 .../xbaya/scufl/script/ScuflScript.java         |  539 +++++++
 .../airavata/xbaya/test/BPELScriptTestCase.java |  209 +++
 .../airavata/xbaya/test/BrowserTestCase.java    |   38 +
 .../apache/airavata/xbaya/test/DSCTestCase.java |  131 ++
 .../airavata/xbaya/test/DSCUtilTestCase.java    |   79 +
 .../xbaya/test/GFacServiceCreaterTestCase.java  |  120 ++
 .../airavata/xbaya/test/GraphTestCase.java      |   54 +
 .../airavata/xbaya/test/MetadataTestCase.java   |  221 +++
 .../airavata/xbaya/test/MonitorTestCase.java    |   67 +
 .../xbaya/test/ResourceNotifierTestCase.java    |   59 +
 .../airavata/xbaya/test/StringUtilTestCase.java |   55 +
 .../airavata/xbaya/test/WSDLTestCase.java       |   92 ++
 .../airavata/xbaya/test/WSDLUtilTestCase.java   |   51 +
 .../airavata/xbaya/test/WSIFTestCase.java       |   53 +
 .../airavata/xbaya/test/WaitDialogTestCase.java |  282 ++++
 .../WebComponentRegistryClientTestCase.java     |  173 ++
 .../test/WorkflowModificationTestCase.java      |  373 +++++
 .../airavata/xbaya/test/WorkflowTestCase.java   |  120 ++
 .../xbaya/test/XBayaSecurityTestCase.java       |   68 +
 .../airavata/xbaya/test/XBayaTestCase.java      |   77 +
 .../apache/airavata/xbaya/test/XppTestCase.java |   71 +
 .../test/jython/JythonClassLoaderTestCase.java  |   44 +
 .../xbaya/test/jython/JythonLibraryTest.java    |  115 ++
 .../jython/JythonOneTimeRunnerTestCase.java     |   70 +
 .../xbaya/test/jython/JythonRunnerTestCase.java |   74 +
 .../xbaya/test/jython/JythonScriptTestCase.java |  131 ++
 .../xbaya/test/service/AllServices.java         |  115 ++
 .../airavata/xbaya/test/service/Service.java    |   44 +
 .../test/service/ServiceNotificationSender.java |  161 ++
 .../xbaya/test/service/adder/Adder.java         |   54 +
 .../xbaya/test/service/adder/AdderClient.java   |  114 ++
 .../xbaya/test/service/adder/AdderImpl.java     |   79 +
 .../xbaya/test/service/adder/AdderService.java  |  131 ++
 .../xbaya/test/service/approver/Approver.java   |   54 +
 .../test/service/approver/ApproverClient.java   |  113 ++
 .../test/service/approver/ApproverImpl.java     |   74 +
 .../test/service/approver/ApproverService.java  |  131 ++
 .../test/service/arrayadder/ArrayAdder.java     |   54 +
 .../service/arrayadder/ArrayAdderClient.java    |  121 ++
 .../test/service/arrayadder/ArrayAdderImpl.java |   83 +
 .../service/arrayadder/ArrayAdderService.java   |  131 ++
 .../test/service/arraygen/ArrayGenerator.java   |   54 +
 .../service/arraygen/ArrayGeneratorClient.java  |  113 ++
 .../service/arraygen/ArrayGeneratorImpl.java    |   77 +
 .../service/arraygen/ArrayGeneratorService.java |  131 ++
 .../airavata/xbaya/test/service/echo/Echo.java  |   54 +
 .../xbaya/test/service/echo/EchoClient.java     |  116 ++
 .../xbaya/test/service/echo/EchoImpl.java       |   73 +
 .../xbaya/test/service/echo/EchoService.java    |  113 ++
 .../test/service/multiplier/Multiplier.java     |   54 +
 .../test/service/multiplier/MultiplierImpl.java |   80 +
 .../service/multiplier/MultiplierService.java   |  132 ++
 .../xbaya/test/util/WorkflowCreator.java        |  741 +++++++++
 .../org/apache/airavata/xbaya/ui/XBayaGUI.java  |  850 ++++++++++
 .../ui/actions/AbstractBrowserActionItem.java   |   90 ++
 .../ui/actions/registry/browser/AddAction.java  |   43 +
 .../actions/registry/browser/BrowserAction.java |   39 +
 .../ui/actions/registry/browser/CopyAction.java |   39 +
 .../actions/registry/browser/DeleteAction.java  |   42 +
 .../ui/actions/registry/browser/EditAction.java |   39 +
 .../actions/registry/browser/ImportAction.java  |   39 +
 .../actions/registry/browser/RefreshAction.java |   43 +
 .../ui/actions/registry/browser/ViewAction.java |   39 +
 .../airavata/xbaya/ui/dialogs/AboutWindow.java  |  126 ++
 .../airavata/xbaya/ui/dialogs/ErrorWindow.java  |  279 ++++
 .../ui/dialogs/GlobusFileTransferWindow.java    |  258 +++
 .../airavata/xbaya/ui/dialogs/TextWindow.java   |  139 ++
 .../airavata/xbaya/ui/dialogs/WaitDialog.java   |  140 ++
 .../airavata/xbaya/ui/dialogs/XBayaDialog.java  |  267 ++++
 .../dialogs/amazon/AmazonEC2InvokerWindow.java  |  222 +++
 .../ui/dialogs/amazon/AmazonS3UtilsWindow.java  |  312 ++++
 .../xbaya/ui/dialogs/amazon/BucketsLoader.java  |  123 ++
 .../dialogs/amazon/ChangeCredentialWindow.java  |  204 +++
 .../amazon/EC2InstancesManagementWindow.java    |  183 +++
 .../ui/dialogs/amazon/EC2LaunchWindow.java      |  181 +++
 .../ui/dialogs/amazon/InstancesLoader.java      |  105 ++
 .../xbaya/ui/dialogs/amazon/S3Downloader.java   |  137 ++
 .../xbaya/ui/dialogs/amazon/S3Uploader.java     |  127 ++
 .../ui/dialogs/component/URLRegistryWindow.java |  132 ++
 .../ui/dialogs/component/WebResigtryWindow.java |  131 ++
 ...licationDescriptionAdvancedOptionDialog.java |  358 +++++
 .../ApplicationDescriptionDialog.java           |  822 ++++++++++
 ...tionDescriptionHostAdvancedOptionDialog.java |  459 ++++++
 .../DeploymentDescriptionDialog.java            |  816 ++++++++++
 .../descriptors/DescriptorEditorDialog.java     |  424 +++++
 .../descriptors/DescriptorListDialog.java       |  261 +++
 .../descriptors/HostDeploymentDialog.java       |  617 +++++++
 .../descriptors/HostDescriptionDialog.java      |  592 +++++++
 .../descriptors/ServiceDescriptionDialog.java   |  727 +++++++++
 .../amazon/InstanceConfigurationDialog.java     |  224 +++
 .../graph/dynamic/DynamicNodeWindow.java        |  472 ++++++
 .../dynamic/DynamicWorkflowRunnerWindow.java    |  394 +++++
 .../system/ConstantConfigurationDialog.java     |  213 +++
 .../DifferedInputConfigurationDialog.java       |  263 +++
 .../graph/system/DoWhileConfigrationDialog.java |  189 +++
 .../system/EndBlockConfigurationDialog.java     |  163 ++
 .../system/EndDoWhileConfigurationDialog.java   |  172 ++
 .../system/EndForEachConfigurationDialog.java   |  161 ++
 .../graph/system/EndifConfigurationDialog.java  |  163 ++
 .../system/ForEachConfigurationDialog.java      |  161 ++
 .../graph/system/IfConfigurationDialog.java     |  190 +++
 .../graph/system/InputConfigurationDialog.java  |  261 +++
 .../graph/system/MemoConfigurationDialog.java   |  115 ++
 .../graph/system/OutputConfigurationDialog.java |  172 ++
 .../system/ReceiveConfigurationDialog.java      |  161 ++
 .../ui/dialogs/graph/system/S3FileChooser.java  |  193 +++
 .../system/StreamSourceConfigurationDialog.java |  129 ++
 .../graph/ws/ServiceInteractionWindow.java      |  132 ++
 .../xbaya/ui/dialogs/graph/ws/WSNodeWindow.java |  140 ++
 .../monitor/MonitorConfigurationWindow.java     |  196 +++
 .../xbaya/ui/dialogs/monitor/MonitorWindow.java |  178 +++
 .../dialogs/registry/NewRegistryUserDialog.java |  305 ++++
 .../ui/dialogs/registry/RegistryWindow.java     |  313 ++++
 .../registry/browser/JCRBrowserDialog.java      |  117 ++
 .../workflow/ParameterPropertyWindow.java       |  170 ++
 .../workflow/WorkflowPropertyWindow.java        |  216 +++
 .../xbaya/ui/experiment/ExperimentMenu.java     |  110 ++
 .../ui/experiment/RegistryLoaderWindow.java     |  239 +++
 .../ui/experiment/RegistrySearchResult.java     |  131 ++
 .../RegistryWorkflowPublisherWindow.java        |  144 ++
 .../WorkflowInterpreterLaunchWindow.java        |  350 ++++
 .../apache/airavata/xbaya/ui/graph/EdgeGUI.java |  142 ++
 .../airavata/xbaya/ui/graph/GraphCanvas.java    | 1375 ++++++++++++++++
 .../xbaya/ui/graph/GraphCanvasEvent.java        |   99 ++
 .../xbaya/ui/graph/GraphCanvasListener.java     |   32 +
 .../airavata/xbaya/ui/graph/GraphGUI.java       |  198 +++
 .../airavata/xbaya/ui/graph/GraphPieceGUI.java  |   36 +
 .../apache/airavata/xbaya/ui/graph/NodeGUI.java |  535 +++++++
 .../airavata/xbaya/ui/graph/Paintable.java      |   35 +
 .../apache/airavata/xbaya/ui/graph/PortGUI.java |  274 ++++
 .../xbaya/ui/graph/amazon/InstanceNodeGUI.java  |  166 ++
 .../graph/amazon/TerminateInstanceNodeGUI.java  |  160 ++
 .../xbaya/ui/graph/dynamic/DynamicNodeGUI.java  |   73 +
 .../graph/subworkflow/SubWorkflowNodeGUI.java   |   89 ++
 .../xbaya/ui/graph/system/BlockNodeGUI.java     |   87 +
 .../ui/graph/system/ConfigurableNodeGUI.java    |  140 ++
 .../xbaya/ui/graph/system/ConstantNodeGUI.java  |   63 +
 .../ui/graph/system/DifferedInputHandler.java   |   87 +
 .../ui/graph/system/DifferedInputNodeGUI.java   |  101 ++
 .../xbaya/ui/graph/system/DoWhileNodeGUI.java   |  191 +++
 .../xbaya/ui/graph/system/EndBlockNodeGUI.java  |  176 ++
 .../ui/graph/system/EndDoWhileNodeGUI.java      |  178 +++
 .../ui/graph/system/EndForEachNodeGUI.java      |  148 ++
 .../xbaya/ui/graph/system/EndifNodeGUI.java     |  176 ++
 .../xbaya/ui/graph/system/ExitNodeGUI.java      |   98 ++
 .../xbaya/ui/graph/system/ForEachNodeGUI.java   |  155 ++
 .../xbaya/ui/graph/system/IfNodeGUI.java        |  183 +++
 .../xbaya/ui/graph/system/InputNodeGUI.java     |   81 +
 .../xbaya/ui/graph/system/MemoNodeGUI.java      |  107 ++
 .../xbaya/ui/graph/system/OutputNodeGUI.java    |   91 ++
 .../xbaya/ui/graph/system/ReceiveNodeGUI.java   |  150 ++
 .../xbaya/ui/graph/system/S3InputNodeGUI.java   |   81 +
 .../ui/graph/system/StreamSourceNodeGUI.java    |   73 +
 .../airavata/xbaya/ui/graph/ws/WSNodeGUI.java   |  156 ++
 .../xbaya/ui/graph/ws/WorkflowNodeGUI.java      |   74 +
 .../xbaya/ui/menues/AmazonEC2MenuItem.java      |  160 ++
 .../airavata/xbaya/ui/menues/EditMenuItem.java  |  169 ++
 .../airavata/xbaya/ui/menues/MenuIcons.java     |   39 +
 .../xbaya/ui/menues/RegistryMenuItem.java       |  118 ++
 .../airavata/xbaya/ui/menues/RunMenuItem.java   |  412 +++++
 .../airavata/xbaya/ui/menues/ViewMenuItem.java  |  140 ++
 .../airavata/xbaya/ui/menues/XBayaMenu.java     |  158 ++
 .../airavata/xbaya/ui/menues/XBayaMenuItem.java |  610 +++++++
 .../xbaya/ui/monitor/MonitorEventHandler.java   |  547 +++++++
 .../xbaya/ui/monitor/MonitorStarter.java        |  125 ++
 .../xbaya/ui/monitor/ResourcePaintable.java     |   65 +
 .../airavata/xbaya/ui/utils/Cancelable.java     |   30 +
 .../airavata/xbaya/ui/utils/DrawUtils.java      |  108 ++
 .../airavata/xbaya/ui/utils/ErrorMessages.java  |  240 +++
 .../xbaya/ui/views/ComponentViewer.java         |  139 ++
 .../xbaya/ui/views/JCRBrowserPanel.java         |  287 ++++
 .../airavata/xbaya/ui/views/MonitorPanel.java   |  307 ++++
 .../xbaya/ui/views/ParameterPropertyPanel.java  |  194 +++
 .../airavata/xbaya/ui/views/PortViewer.java     |  167 ++
 .../airavata/xbaya/ui/widgets/GridPanel.java    |  165 ++
 .../airavata/xbaya/ui/widgets/ScrollPanel.java  |  124 ++
 .../xbaya/ui/widgets/TabLabelButton.java        |  142 ++
 .../xbaya/ui/widgets/TableRenderable.java       |   31 +
 .../xbaya/ui/widgets/ToolbarButton.java         |  109 ++
 .../xbaya/ui/widgets/XBayaComboBox.java         |  100 ++
 .../xbaya/ui/widgets/XBayaComponent.java        |   35 +
 .../airavata/xbaya/ui/widgets/XBayaLabel.java   |   95 ++
 .../xbaya/ui/widgets/XBayaLinkButton.java       |  306 ++++
 .../airavata/xbaya/ui/widgets/XBayaList.java    |  169 ++
 .../xbaya/ui/widgets/XBayaTextArea.java         |  120 ++
 .../xbaya/ui/widgets/XBayaTextComponent.java    |   37 +
 .../xbaya/ui/widgets/XBayaTextField.java        |  124 ++
 .../airavata/xbaya/ui/widgets/XBayaToolBar.java |  362 +++++
 .../xbaya/ui/widgets/XbayaEnhancedList.java     |  308 ++++
 .../xbaya/ui/widgets/amazon/S3Tree.java         |  133 ++
 .../xbaya/ui/widgets/amazon/S3TreeModel.java    |   65 +
 .../ui/widgets/component/ComponentSelector.java |  530 ++++++
 .../component/ComponentSelectorEvent.java       |   85 +
 .../component/ComponentSelectorListener.java    |   32 +
 .../component/ComponentSourceTransferable.java  |   73 +
 .../widgets/component/ComponentTreeModel.java   |   71 +
 .../ui/widgets/component/ComponentTreeNode.java |  107 ++
 .../apache/airavata/xbaya/util/AmazonUtil.java  |  150 ++
 .../org/apache/airavata/xbaya/util/Data.java    |   70 +
 .../apache/airavata/xbaya/util/GOConstants.java |   30 +
 .../airavata/xbaya/util/GlobusOnlineUtils.java  |  245 +++
 .../airavata/xbaya/util/InterpreterUtil.java    |  391 +++++
 .../airavata/xbaya/util/RegistryConstants.java  |   30 +
 .../airavata/xbaya/util/TransferFile.java       |  170 ++
 .../apache/airavata/xbaya/util/XBayaUtil.java   |  353 ++++
 .../airavata/xbaya/workflow/WorkflowClient.java |  246 +++
 .../xbaya/workflow/WorkflowEngineException.java |   42 +
 .../xbaya/workflow/proxy/ProxyWSDL.java         |   87 +
 .../xbaya/workflow/proxy/WorkflowClient.java    |   35 +
 .../xbaya/workflow/proxy/WorkflowContext.java   |   42 +
 .../workflow/proxy/WorkflowProxyException.java  |   64 +
 .../src/main/resources/WorkflowInterpretor.wsdl |   72 +
 .../src/main/resources/images/airavata-2.png    |  Bin 0 -> 5582 bytes
 .../main/resources/images/airavata-config.png   |  Bin 0 -> 1297 bytes
 .../src/main/resources/images/airavata-icon.png |  Bin 0 -> 584 bytes
 .../main/resources/images/airavata-icon2.png    |  Bin 0 -> 981 bytes
 .../src/main/resources/images/airavata-name.png |  Bin 0 -> 8261 bytes
 .../resources/images/airavata-title-text.png    |  Bin 0 -> 16438 bytes
 .../src/main/resources/images/airavata.png      |  Bin 0 -> 17280 bytes
 .../src/main/resources/images/application.png   |  Bin 0 -> 894 bytes
 .../src/main/resources/images/applications.png  |  Bin 0 -> 657 bytes
 .../src/main/resources/images/closed.gif        |  Bin 0 -> 923 bytes
 .../src/main/resources/images/cloud.png         |  Bin 0 -> 573 bytes
 .../src/main/resources/images/experiment.png    |  Bin 0 -> 543 bytes
 .../src/main/resources/images/experiments.png   |  Bin 0 -> 1142 bytes
 .../src/main/resources/images/gfac_url.png      |  Bin 0 -> 739 bytes
 .../src/main/resources/images/gfac_urls.png     |  Bin 0 -> 816 bytes
 .../src/main/resources/images/host.png          |  Bin 0 -> 652 bytes
 .../src/main/resources/images/hosts.png         |  Bin 0 -> 671 bytes
 .../src/main/resources/images/input_para.png    |  Bin 0 -> 428 bytes
 .../src/main/resources/images/jcr-repo.png      |  Bin 0 -> 1010 bytes
 .../src/main/resources/images/leaf.gif          |  Bin 0 -> 906 bytes
 .../src/main/resources/images/menu/jcr.png      |  Bin 0 -> 1158 bytes
 .../src/main/resources/images/menu/new2.png     |  Bin 0 -> 1175 bytes
 .../src/main/resources/images/menu/open1.png    |  Bin 0 -> 925 bytes
 .../src/main/resources/images/menu/open2.png    |  Bin 0 -> 964 bytes
 .../src/main/resources/images/menu/open_dir.png |  Bin 0 -> 749 bytes
 .../src/main/resources/images/menu/pause1.png   |  Bin 0 -> 1101 bytes
 .../resources/images/menu/pause_monitor1.png    |  Bin 0 -> 873 bytes
 .../src/main/resources/images/menu/play3.png    |  Bin 0 -> 1192 bytes
 .../src/main/resources/images/menu/play4.png    |  Bin 0 -> 765 bytes
 .../images/menu/resume_monitoring1.png          |  Bin 0 -> 957 bytes
 .../src/main/resources/images/menu/save1.png    |  Bin 0 -> 1200 bytes
 .../src/main/resources/images/menu/stop.png     |  Bin 0 -> 316 bytes
 .../src/main/resources/images/opened.gif        |  Bin 0 -> 917 bytes
 .../src/main/resources/images/output_para.png   |  Bin 0 -> 490 bytes
 .../src/main/resources/images/parameter.png     |  Bin 0 -> 544 bytes
 .../src/main/resources/images/pause.jpeg        |  Bin 0 -> 458 bytes
 .../src/main/resources/images/play.jpeg         |  Bin 0 -> 471 bytes
 .../src/main/resources/images/registry.png      |  Bin 0 -> 3419 bytes
 .../src/main/resources/images/service.png       |  Bin 0 -> 871 bytes
 .../src/main/resources/images/services.png      |  Bin 0 -> 899 bytes
 .../src/main/resources/images/step.gif          |  Bin 0 -> 211 bytes
 .../src/main/resources/images/stop.jpeg         |  Bin 0 -> 497 bytes
 .../src/main/resources/images/workflow.png      |  Bin 0 -> 601 bytes
 .../resources/images/workflow_templates.png     |  Bin 0 -> 710 bytes
 .../src/main/resources/images/workflows.png     |  Bin 0 -> 778 bytes
 .../xbaya-gui/src/main/resources/services.xml   |   30 +
 .../resources/wsdls/TestCMD_Example1_AWSDL.xml  |   56 +
 .../src/main/resources/wsdls/adder-awsdl.xml    |   63 +
 .../src/main/resources/wsdls/eventing.wsdl      |  332 ++++
 .../interpreter/ComplexForEachWorkflowTest.java |   73 +
 .../xbaya/interpreter/ComplexMathService.java   |   40 +
 .../interpreter/ComplexMathWorkflowTest.java    |   71 +
 .../interpreter/CrossProductWorkflowTest.java   |   71 +
 .../airavata/xbaya/interpreter/EchoService.java |   28 +
 .../xbaya/interpreter/ForEachWorkflowTest.java  |   73 +
 .../interpreter/LevenshteinDistanceService.java |   48 +
 .../airavata/xbaya/interpreter/Listener.java    |   31 +
 .../xbaya/interpreter/NotificationSender.java   |  204 +++
 .../xbaya/interpreter/RegistryServiceTest.java  |  105 ++
 .../interpreter/SimpleForEachWorkflowTest.java  |   72 +
 .../interpreter/SimpleMathWorkflowTest.java     |   73 +
 .../xbaya/interpreter/WorkflowTest.java         |   74 +
 .../xbaya/interpreter/WorkflowTrackingTest.java |  105 ++
 .../xbaya/interpreter/XBayaClientTest.java      |   80 +
 .../interpreter/XBayaConsolidatedTestSuite.java |   67 +
 .../xbaya/interpreter/utils/ConfigKeys.java     |   34 +
 .../xbaya/interpreter/utils/TestUtilServer.java |  243 +++
 .../interpreter/utils/WorkflowTestUtils.java    |   97 ++
 modules/xbaya-gui/src/test/java/test.xwf        |  251 +++
 .../src/test/resources/axis2_default.xml        |  278 ++++
 544 files changed, 75861 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/pom.xml
----------------------------------------------------------------------
diff --git a/modules/security/pom.xml b/modules/security/pom.xml
new file mode 100644
index 0000000..bfe2a01
--- /dev/null
+++ b/modules/security/pom.xml
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
+    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+    the License. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>airavata</artifactId>
+        <version>0.12-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>airavata-security</artifactId>
+    <name>Airavata Security Implementation</name>
+    <description>Module for managing security features in Airavata</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-common-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-simple</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.shiro</groupId>
+            <artifactId>shiro-core</artifactId>
+            <version>1.2.1</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-dbcp</groupId>
+            <artifactId>commons-dbcp</artifactId>
+            <version>1.4</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.7</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/AbstractAuthenticator.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/AbstractAuthenticator.java b/modules/security/src/main/java/org/apache/airavata/security/AbstractAuthenticator.java
new file mode 100644
index 0000000..536b80b
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/AbstractAuthenticator.java
@@ -0,0 +1,150 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security;
+
+import org.apache.airavata.common.context.RequestContext;
+import org.apache.airavata.common.context.WorkflowContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.text.SimpleDateFormat;
+import java.util.Calendar;
+
+/**
+ * An abstract implementation of the authenticator.
+ */
+@SuppressWarnings("UnusedDeclaration")
+public abstract class AbstractAuthenticator implements Authenticator {
+
+    protected static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
+
+    protected static Logger log = LoggerFactory.getLogger(AbstractAuthenticator.class);
+
+    public static int DEFAULT_AUTHENTICATOR_PRIORITY = 5;
+
+    protected String authenticatorName;
+
+    private int priority = DEFAULT_AUTHENTICATOR_PRIORITY;
+
+    protected boolean enabled = true;
+
+    protected UserStore userStore;
+
+    public AbstractAuthenticator() {
+
+    }
+
+    public AbstractAuthenticator(String name) {
+        this.authenticatorName = name;
+    }
+
+    public void setUserStore(UserStore store) {
+        this.userStore = store;
+    }
+
+    public UserStore getUserStore() {
+        return this.userStore;
+    }
+
+    public int getPriority() {
+        return priority;
+    }
+
+    public boolean canProcess(Object credentials) {
+        return false;
+    }
+
+    public String getAuthenticatorName() {
+        return authenticatorName;
+    }
+
+    public void setAuthenticatorName(String authenticatorName) {
+        this.authenticatorName = authenticatorName;
+    }
+
+    public void setPriority(int priority) {
+        this.priority = priority;
+    }
+
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    public boolean authenticate(Object credentials) throws AuthenticationException {
+
+        boolean authenticated = doAuthentication(credentials);
+
+        if (authenticated) {
+            onSuccessfulAuthentication(credentials);
+        } else {
+            onFailedAuthentication(credentials);
+        }
+
+        return authenticated;
+    }
+
+    /**
+     * Gets the current time converted to format in DATE_TIME_FORMAT.
+     * 
+     * @return Current time as a string.
+     */
+    protected String getCurrentTime() {
+        Calendar cal = Calendar.getInstance();
+        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(DATE_TIME_FORMAT);
+        return simpleDateFormat.format(cal.getTime());
+    }
+
+    /**
+     * The actual authenticating logic goes here. If user is successfully authenticated this should return
+     * <code>true</code> else this should return <code>false</code>. If an error occurred while authenticating this will
+     * throw an exception.
+     * 
+     * @param credentials
+     *            The object which contains request credentials. This could be request most of the time.
+     * @return <code>true</code> if successfully authenticated else <code>false</code>.
+     * @throws AuthenticationException
+     *             If system error occurs while authenticating.
+     */
+    protected abstract boolean doAuthentication(Object credentials) throws AuthenticationException;
+
+    /**
+     * If authentication is successful we can do post authentication actions in following method. E.g :- adding user to
+     * session, audit logging etc ...
+     * 
+     * @param authenticationInfo
+     *            A generic object with authentication information.
+     */
+    public abstract void onSuccessfulAuthentication(Object authenticationInfo);
+
+    /**
+     * If authentication is failed we can do post authentication actions in following method. E.g :- adding user to
+     * session, audit logging etc ...
+     * 
+     * @param authenticationInfo
+     *            A generic object with authentication information.
+     */
+    public abstract void onFailedAuthentication(Object authenticationInfo);
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/AbstractDatabaseAuthenticator.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/AbstractDatabaseAuthenticator.java b/modules/security/src/main/java/org/apache/airavata/security/AbstractDatabaseAuthenticator.java
new file mode 100644
index 0000000..a980876
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/AbstractDatabaseAuthenticator.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security;
+
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * An abstract authenticator class which reads database configurations.
+ */
+@SuppressWarnings("UnusedDeclaration")
+public abstract class AbstractDatabaseAuthenticator extends AbstractAuthenticator {
+
+    private String databaseURL;
+
+    private String databaseDriver;
+
+    private String databaseUserName;
+
+    private String databasePassword;
+
+    public AbstractDatabaseAuthenticator() {
+        super();
+    }
+
+    public AbstractDatabaseAuthenticator(String name) {
+        super(name);
+    }
+
+    /**
+     * We are reading database parameters in this case.
+     * 
+     * @param node
+     *            An XML configuration node.
+     */
+    public void configure(Node node) {
+
+        /**
+         * <specificConfigurations> <database> <jdbcUrl></jdbcUrl> <databaseDriver></databaseDriver>
+         * <userName></userName> <password></password> </database> </specificConfigurations>
+         */
+
+        NodeList databaseNodeList = node.getChildNodes();
+
+        Node databaseNode = null;
+
+        for (int k = 0; k < databaseNodeList.getLength(); ++k) {
+
+            Node n = databaseNodeList.item(k);
+
+            if (n != null && n.getNodeType() == Node.ELEMENT_NODE) {
+                databaseNode = n;
+            }
+        }
+
+        if (databaseNode != null) {
+            NodeList nodeList = databaseNode.getChildNodes();
+
+            for (int i = 0; i < nodeList.getLength(); ++i) {
+                Node n = nodeList.item(i);
+
+                if (n.getNodeType() == Node.ELEMENT_NODE) {
+
+                    Element element = (Element) n;
+
+                    if (element.getNodeName().equals("jdbcUrl")) {
+                        databaseURL = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("databaseDriver")) {
+                        databaseDriver = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("userName")) {
+                        databaseUserName = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("password")) {
+                        databasePassword = element.getFirstChild().getNodeValue();
+                    }
+                }
+            }
+        }
+
+        StringBuilder stringBuilder = new StringBuilder("Configuring DB parameters for authenticator with JDBC URL - ");
+        stringBuilder.append(databaseURL).append(" DB driver - ").append(" DB user - ").append(databaseUserName)
+                .append(" DB password - xxxxxx");
+
+        log.debug(stringBuilder.toString());
+
+        try {
+            getUserStore().configure(node);
+        } catch (UserStoreException e) {
+            String msg = "Error configuring user store associated with authenticator.";
+            log.error(msg, e);
+            throw new RuntimeException(msg, e);
+        }
+    }
+
+    public String getDatabaseURL() {
+        return databaseURL;
+    }
+
+    public String getDatabaseDriver() {
+        return databaseDriver;
+    }
+
+    public String getDatabaseUserName() {
+        return databaseUserName;
+    }
+
+    public String getDatabasePassword() {
+        return databasePassword;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/AuthenticationException.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/AuthenticationException.java b/modules/security/src/main/java/org/apache/airavata/security/AuthenticationException.java
new file mode 100644
index 0000000..f4aca49
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/AuthenticationException.java
@@ -0,0 +1,41 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security;
+
+/**
+ * Wraps errors during authentication. This exception will be thrown if there is a system error during authentication.
+ */
+public class AuthenticationException extends Exception {
+
+    public AuthenticationException() {
+        super();
+    }
+
+    public AuthenticationException(String message) {
+        super(message);
+    }
+
+    public AuthenticationException(String message, Exception e) {
+        super(message, e);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/Authenticator.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/Authenticator.java b/modules/security/src/main/java/org/apache/airavata/security/Authenticator.java
new file mode 100644
index 0000000..814bdb6
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/Authenticator.java
@@ -0,0 +1,108 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security;
+
+import org.w3c.dom.Node;
+
+/**
+ * A generic interface to do request authentication. Specific authenticator will implement authenticate method.
+ */
+@SuppressWarnings("UnusedDeclaration")
+public interface Authenticator {
+
+    /**
+     * Authenticates the request with given credentials.
+     * 
+     * @param credentials
+     *            Credentials can be a session ticket, password or session id.
+     * @return <code>true</code> if request is successfully authenticated else <code>false</code>.
+     * @throws AuthenticationException
+     *             If a system error occurred during authentication process.
+     */
+    boolean authenticate(Object credentials) throws AuthenticationException;
+
+    /**
+     * Checks whether given user is already authenticated.
+     * 
+     * @param credentials
+     *            The token to be authenticated.
+     * @return <code>true</code> if token is already authenticated else <code>false</code>.
+     */
+    boolean isAuthenticated(Object credentials);
+
+    /**
+     * Says whether current authenticator can handle given credentials.
+     * 
+     * @param credentials
+     *            Credentials used during authentication.
+     * @return <code>true</code> is can authenticate else <code>false</code>.
+     */
+    boolean canProcess(Object credentials);
+
+    /**
+     * Gets the priority of this authenticator.
+     * 
+     * @return Higher the priority higher the precedence of selecting the authenticator.
+     */
+    int getPriority();
+
+    /**
+     * Returns the authenticator name. Each authenticator is associated with an identifiable name.
+     * 
+     * @return The authenticator name.
+     */
+    String getAuthenticatorName();
+
+    /**
+     * Authenticator specific configurations goes into this method.
+     * 
+     * @param node
+     *            An XML configuration node.
+     * @throws RuntimeException
+     *             If an error occurred while configuring the authenticator.
+     */
+    void configure(Node node) throws RuntimeException;
+
+    /**
+     * Return <code>true</code> if current authenticator is enabled. Else <code>false</code>.
+     * 
+     * @return <code>true</code> if enabled.
+     */
+    boolean isEnabled();
+
+    /**
+     * User store that should be used by this authenticator. When authenticating a request authenticator should use the
+     * user store set by this method.
+     * 
+     * @param userStore
+     *            The user store to be used.
+     */
+    void setUserStore(UserStore userStore);
+
+    /**
+     * Gets the user store used by this authenticator.
+     * 
+     * @return The user store used by this authenticator.
+     */
+    UserStore getUserStore();
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/Authoriser.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/Authoriser.java b/modules/security/src/main/java/org/apache/airavata/security/Authoriser.java
new file mode 100644
index 0000000..f0fdea9
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/Authoriser.java
@@ -0,0 +1,43 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security;
+
+/**
+ * An interface which can be used to authorise accessing resources.
+ */
+@SuppressWarnings("UnusedDeclaration")
+public interface Authoriser {
+
+    /**
+     * Checks whether user has sufficient privileges to perform action on the given resource.
+     * 
+     * @param userName
+     *            The user who is performing the action.
+     * @param resource
+     *            The resource which user is trying to access.
+     * @param action
+     *            The action (GET, PUT etc ...)
+     * @return Returns <code>true</code> if user is authorised to perform the action, else false.
+     */
+    boolean isAuthorised(String userName, String resource, String action);
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/UserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/UserStore.java b/modules/security/src/main/java/org/apache/airavata/security/UserStore.java
new file mode 100644
index 0000000..cfee957
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/UserStore.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+package org.apache.airavata.security;
+
+import org.w3c.dom.Node;
+
+/**
+ * An interface to wrap the functionality of a user store. A user store is place where we keep user attribute
+ * information. Usually this contains, user id, user name, password etc ...
+ * We also authenticate users against the credentials stored in a user store. In addition to user attributes
+ * we also store role information and group information.
+ * This interface provide methods to manipulated data in a user store.
+ * Such operations are as follows,
+ * <ol>
+ *     <li>authenticate user</li>
+ *     <li>add user</li>
+ *     <li>delete user</li>
+ *     <li>add a role</li>
+ *     <li>delete a role</li>
+ *     <li>... etc ...</li>
+ * </ol>
+ */
+public interface UserStore {
+
+    /**
+     * Checks whether given user exists in the user store and its credentials match with the credentials stored
+     * in the user store.
+     * @param userName Name of the user to authenticate.
+     * @param credentials User credentials as an object. User credentials may not be a string always.
+     * @return True if user exists in the user store and its credentials match with the credentials in user store.
+     *          <code>false</code> else.
+     * @throws UserStoreException if a system wide error occurred while authenticating the user.
+     */
+    boolean authenticate(String userName, Object credentials) throws UserStoreException;
+
+    /**
+     * Authenticates a user using a token.
+     * @param credentials The token information.
+     * @return <code>true</code> if authentication successful else <code>false</code>.
+     * @throws UserStoreException if a system wide error occurred while authenticating the user.
+     */
+    boolean authenticate(Object credentials) throws UserStoreException;
+
+    /**
+     * This method will do necessary configurations of the user store.
+     * @param node An XML configuration node.
+     * @throws RuntimeException If an error occurred while configuring the authenticator.
+     */
+    void configure(Node node) throws UserStoreException;
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/UserStoreException.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/UserStoreException.java b/modules/security/src/main/java/org/apache/airavata/security/UserStoreException.java
new file mode 100644
index 0000000..927bf8a
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/UserStoreException.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+
+package org.apache.airavata.security;
+
+/**
+ * Exception class to wrap user store errors.
+ */
+public class UserStoreException extends Exception {
+
+    public UserStoreException() {
+        super();
+    }
+
+    public UserStoreException(String message) {
+        super(message);
+    }
+
+    public UserStoreException(String message, Exception e) {
+        super(message, e);
+    }
+
+    public UserStoreException(Exception e) {
+        super(e);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/configurations/AbstractConfigurationReader.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/configurations/AbstractConfigurationReader.java b/modules/security/src/main/java/org/apache/airavata/security/configurations/AbstractConfigurationReader.java
new file mode 100644
index 0000000..5ba0915
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/configurations/AbstractConfigurationReader.java
@@ -0,0 +1,55 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.configurations;
+
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Abstract implementation to read configurations.
+ */
+public abstract class AbstractConfigurationReader {
+
+    public void init(String fileName) throws IOException, SAXException, ParserConfigurationException {
+
+        File configurationFile = new File(fileName);
+
+        if (!configurationFile.canRead()) {
+            throw new IOException("Error reading configuration file " + configurationFile.getAbsolutePath());
+        }
+
+        FileInputStream streamIn = new FileInputStream(configurationFile);
+
+        try {
+            init(streamIn);
+        } finally {
+            streamIn.close();
+        }
+    }
+
+    public abstract void init(InputStream inputStream) throws IOException, ParserConfigurationException, SAXException;
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReader.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReader.java b/modules/security/src/main/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReader.java
new file mode 100644
index 0000000..278c8a9
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReader.java
@@ -0,0 +1,244 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.configurations;
+
+import org.apache.airavata.security.AbstractAuthenticator;
+import org.apache.airavata.security.Authenticator;
+import org.apache.airavata.security.UserStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+/**
+ * This class will read authenticators.xml and load all configurations related to authenticators.
+ */
+public class AuthenticatorConfigurationReader extends AbstractConfigurationReader {
+
+    private List<Authenticator> authenticatorList = new ArrayList<Authenticator>();
+
+    protected static Logger log = LoggerFactory.getLogger(AuthenticatorConfigurationReader.class);
+
+    protected static boolean authenticationEnabled = true;
+
+    public AuthenticatorConfigurationReader() {
+
+    }
+
+    public void init(InputStream inputStream) throws IOException, ParserConfigurationException, SAXException {
+
+        authenticationEnabled = true;
+
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        Document doc = dBuilder.parse(inputStream);
+        doc.getDocumentElement().normalize();
+
+        NodeList rootNodeList = doc.getElementsByTagName("authenticators");
+
+        if (rootNodeList == null || rootNodeList.getLength() == 0) {
+            throw new ParserConfigurationException("authenticators.xml should have authenticators root element.");
+        }
+
+        Node authenticatorsNode = rootNodeList.item(0);
+        NamedNodeMap rootAttributes = authenticatorsNode.getAttributes();
+
+        if (rootAttributes != null && rootAttributes.getNamedItem("enabled") != null) {
+
+            String enabledAttribute = rootAttributes.getNamedItem("enabled").getNodeValue();
+            if (enabledAttribute != null) {
+
+                if (enabledAttribute.equals("false")) {
+                    authenticationEnabled = false;
+                }
+            }
+        }
+
+        NodeList authenticators = doc.getElementsByTagName("authenticator");
+
+        for (int i = 0; i < authenticators.getLength(); ++i) {
+            Node node = authenticators.item(i);
+
+            if (node.getNodeType() == Node.ELEMENT_NODE) {
+
+                NamedNodeMap namedNodeMap = node.getAttributes();
+
+                String name = namedNodeMap.getNamedItem("name").getNodeValue();
+                String className = namedNodeMap.getNamedItem("class").getNodeValue();
+                String enabled = namedNodeMap.getNamedItem("enabled").getNodeValue();
+                String priority = namedNodeMap.getNamedItem("priority").getNodeValue();
+                String userStoreClass = namedNodeMap.getNamedItem("userstore").getNodeValue();
+
+                if (className == null) {
+                    reportError("class");
+                }
+
+                if (userStoreClass == null) {
+                    reportError("userstore");
+                }
+
+                Authenticator authenticator = createAuthenticator(name, className, enabled, priority, userStoreClass);
+
+                NodeList configurationNodes = node.getChildNodes();
+
+                for (int j = 0; j < configurationNodes.getLength(); ++j) {
+
+                    Node configurationNode = configurationNodes.item(j);
+
+                    if (configurationNode.getNodeType() == Node.ELEMENT_NODE) {
+
+                        if (configurationNode.getNodeName().equals("specificConfigurations")) {
+                            authenticator.configure(configurationNode);
+                        }
+                    }
+                }
+
+                if (authenticator.isEnabled()) {
+                    authenticatorList.add(authenticator);
+                }
+
+                Collections.sort(authenticatorList, new AuthenticatorComparator());
+
+                StringBuilder stringBuilder = new StringBuilder("Successfully initialized authenticator ");
+                stringBuilder.append(name).append(" with class ").append(className).append(" enabled? ")
+                        .append(enabled).append(" priority = ").append(priority);
+
+                log.debug(stringBuilder.toString());
+            }
+        }
+    }
+
+    private void reportError(String element) throws ParserConfigurationException {
+        throw new ParserConfigurationException("Error in configuration. Missing mandatory element " + element);
+    }
+
+    protected Authenticator createAuthenticator(String name, String className, String enabled, String priority,
+            String userStoreClassName) {
+
+        log.debug("Loading authenticator class " + className + " and name " + name);
+
+        // Load a class and instantiate an object
+        Class authenticatorClass;
+        try {
+            authenticatorClass = Class.forName(className, true, Thread.currentThread().getContextClassLoader());
+            // authenticatorClass = Class.forName(className);
+        } catch (ClassNotFoundException e) {
+            log.error("Error loading authenticator class " + className);
+            throw new RuntimeException("Error loading authenticator class " + className, e);
+
+        }
+
+        try {
+            AbstractAuthenticator authenticatorInstance = (AbstractAuthenticator) authenticatorClass.newInstance();
+            authenticatorInstance.setAuthenticatorName(name);
+
+            if (enabled != null) {
+                authenticatorInstance.setEnabled(Boolean.parseBoolean(enabled));
+            }
+
+            if (priority != null) {
+                authenticatorInstance.setPriority(Integer.parseInt(priority));
+            }
+
+            UserStore userStore = createUserStore(userStoreClassName);
+            authenticatorInstance.setUserStore(userStore);
+
+            return authenticatorInstance;
+
+        } catch (InstantiationException e) {
+            String error = "Error instantiating authenticator class " + className + " object.";
+            log.error(error);
+            throw new RuntimeException(error, e);
+
+        } catch (IllegalAccessException e) {
+            String error = "Not allowed to instantiate authenticator class " + className;
+            log.error(error);
+            throw new RuntimeException(error, e);
+        }
+
+    }
+
+    protected UserStore createUserStore(String userStoreClassName) {
+
+        try {
+            Class userStoreClass = Class.forName(userStoreClassName, true, Thread.currentThread()
+                    .getContextClassLoader());
+
+            return (UserStore) userStoreClass.newInstance();
+        } catch (ClassNotFoundException e) {
+            log.error("Error loading authenticator class " + userStoreClassName);
+            throw new RuntimeException("Error loading authenticator class " + userStoreClassName, e);
+
+        } catch (InstantiationException e) {
+            String error = "Error instantiating authenticator class " + userStoreClassName + " object.";
+            log.error(error);
+            throw new RuntimeException(error, e);
+
+        } catch (IllegalAccessException e) {
+            String error = "Not allowed to instantiate authenticator class " + userStoreClassName;
+            log.error(error);
+            throw new RuntimeException(error, e);
+        }
+
+    }
+
+    public List<Authenticator> getAuthenticatorList() {
+        return Collections.unmodifiableList(authenticatorList);
+    }
+
+    /**
+     * We can specify whether authentication is enabled in the system for all request or not. This we can state in the
+     * configuration. AuthenticatorConfigurationReader will read that information and will populate that to static
+     * boolean authenticationEnabled. This method will say whether authentication is enabled in the system or disabled
+     * in the system.
+     * 
+     * @return <code>true</code> if authentication is enabled. Else <code>false</code>.
+     */
+    public static boolean isAuthenticationEnabled() {
+        return authenticationEnabled;
+    }
+
+    /**
+     * Comparator to sort authenticators based on authenticator priority.
+     */
+    public class AuthenticatorComparator implements Comparator<Authenticator> {
+
+        @Override
+        public int compare(Authenticator o1, Authenticator o2) {
+            return (o1.getPriority() > o2.getPriority() ? -1 : (o1.getPriority() == o2.getPriority() ? 0 : 1));
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/userstore/AbstractJDBCUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/userstore/AbstractJDBCUserStore.java b/modules/security/src/main/java/org/apache/airavata/security/userstore/AbstractJDBCUserStore.java
new file mode 100644
index 0000000..96d2485
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/userstore/AbstractJDBCUserStore.java
@@ -0,0 +1,134 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.userstore;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ApplicationSettings;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.security.UserStore;
+import org.apache.airavata.security.UserStoreException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * An abstract implementation of the UserStore. This will encapsulate JDBC configurations reading code.
+ */
+public abstract class AbstractJDBCUserStore implements UserStore {
+
+    protected static Logger log = LoggerFactory.getLogger(JDBCUserStore.class);
+
+    private String databaseURL = null;
+    private String databaseDriver = null;
+    private String databaseUserName = null;
+    private String databasePassword = null;
+
+    public String getDatabaseURL() {
+        return databaseURL;
+    }
+
+    public String getDatabaseDriver() {
+        return databaseDriver;
+    }
+
+    public String getDatabaseUserName() {
+        return databaseUserName;
+    }
+
+    public String getDatabasePassword() {
+        return databasePassword;
+    }
+
+    /**
+     * Configures primary JDBC parameters. i.e
+     *
+     * @param node An XML configuration node.
+     * @throws UserStoreException
+     */
+    public void configure(Node node) throws UserStoreException {
+
+        /**
+         * <specificConfigurations> <database> <jdbcUrl></jdbcUrl> <databaseDriver></databaseDriver>
+         * <userName></userName> <password></password> </database> </specificConfigurations>
+         */
+
+        NodeList databaseNodeList = node.getChildNodes();
+
+        Node databaseNode = null;
+
+        for (int k = 0; k < databaseNodeList.getLength(); ++k) {
+
+            Node n = databaseNodeList.item(k);
+
+            if (n != null && n.getNodeType() == Node.ELEMENT_NODE) {
+                databaseNode = n;
+            }
+        }
+
+        if (databaseNode != null) {
+            NodeList nodeList = databaseNode.getChildNodes();
+
+            for (int i = 0; i < nodeList.getLength(); ++i) {
+                Node n = nodeList.item(i);
+
+                if (n.getNodeType() == Node.ELEMENT_NODE) {
+
+                    Element element = (Element) n;
+
+                    if (element.getNodeName().equals("jdbcUrl")) {
+                        databaseURL = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("databaseDriver")) {
+                        databaseDriver = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("userName")) {
+                        databaseUserName = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("password")) {
+                        databasePassword = element.getFirstChild().getNodeValue();
+                    }
+                }
+            }
+        }
+
+        if (databaseURL == null || databaseUserName == null || databasePassword == null) {
+            // If database configurations are not specified in authenticators.xml we will read them from
+            // server.properties file.
+            try {
+                databaseDriver = ServerSettings.getCredentialStoreDBDriver();
+                databaseURL = ServerSettings.getCredentialStoreDBURL();
+                databaseUserName = ServerSettings.getCredentialStoreDBUser();
+                databasePassword = ServerSettings.getCredentialStoreDBPassword();
+
+            } catch (ApplicationSettingsException e) {
+                log.error("Error reading default user store DB configurations.");
+                throw new UserStoreException(e);
+            }
+
+            StringBuilder stringBuilder = new StringBuilder("User store configurations - dbDriver - ");
+            stringBuilder.append(databaseDriver);
+            stringBuilder.append(" URL - ").append(databaseURL).append(" DB user - ").append(databaseUserName);
+            log.info(stringBuilder.toString());
+
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/userstore/JDBCUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/userstore/JDBCUserStore.java b/modules/security/src/main/java/org/apache/airavata/security/userstore/JDBCUserStore.java
new file mode 100644
index 0000000..f1a486d
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/userstore/JDBCUserStore.java
@@ -0,0 +1,166 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.userstore;
+
+import org.apache.airavata.security.UserStoreException;
+import org.apache.airavata.common.utils.DBUtil;
+import org.apache.airavata.security.util.PasswordDigester;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.AuthenticationInfo;
+import org.apache.shiro.authc.AuthenticationToken;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.realm.jdbc.JdbcRealm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+import javax.sql.DataSource;
+
+/**
+ * The JDBC user store implementation.
+ */
+public class JDBCUserStore extends AbstractJDBCUserStore {
+
+    protected static Logger log = LoggerFactory.getLogger(JDBCUserStore.class);
+
+    private JdbcRealm jdbcRealm;
+
+    private PasswordDigester passwordDigester;
+
+    public JDBCUserStore() {
+        jdbcRealm = new JdbcRealm();
+    }
+
+    @Override
+    public boolean authenticate(String userName, Object credentials) throws UserStoreException {
+        AuthenticationToken authenticationToken = new UsernamePasswordToken(userName,
+                passwordDigester.getPasswordHashValue((String) credentials));
+
+        AuthenticationInfo authenticationInfo;
+        try {
+
+            authenticationInfo = jdbcRealm.getAuthenticationInfo(authenticationToken);
+            return authenticationInfo != null;
+
+        } catch (AuthenticationException e) {
+            log.debug(e.getLocalizedMessage(), e);
+            return false;
+        }
+    }
+
+    @Override
+    public boolean authenticate(Object credentials) throws UserStoreException {
+        log.error("JDBC user store only supports user name, password based authentication.");
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public void configure(Node node) throws UserStoreException {
+
+        super.configure(node);
+
+        /**
+         * <specificConfigurations> <database> <jdbcUrl></jdbcUrl> <databaseDriver></databaseDriver>
+         * <userName></userName> <password></password> <passwordHashMethod>MD5</passwordHashMethod>
+         * <userTableName></userTableName> <userNameColumnName></userNameColumnName>
+         * <passwordColumnName></passwordColumnName> </database> </specificConfigurations>
+         */
+
+        NodeList databaseNodeList = node.getChildNodes();
+
+        Node databaseNode = null;
+
+        for (int k = 0; k < databaseNodeList.getLength(); ++k) {
+
+            Node n = databaseNodeList.item(k);
+
+            if (n != null && n.getNodeType() == Node.ELEMENT_NODE) {
+                databaseNode = n;
+            }
+        }
+
+        String userTable = null;
+        String userNameColumn = null;
+        String passwordColumn = null;
+        String passwordHashMethod = null;
+
+        if (databaseNode != null) {
+            NodeList nodeList = databaseNode.getChildNodes();
+
+            for (int i = 0; i < nodeList.getLength(); ++i) {
+                Node n = nodeList.item(i);
+
+                if (n.getNodeType() == Node.ELEMENT_NODE) {
+
+                    Element element = (Element) n;
+
+                    if (element.getNodeName().equals("userTableName")) {
+                        userTable = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("userNameColumnName")) {
+                        userNameColumn = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("passwordColumnName")) {
+                        passwordColumn = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("passwordHashMethod")) {
+                        passwordHashMethod = element.getFirstChild().getNodeValue();
+                    }
+                }
+            }
+        }
+
+        passwordDigester = new PasswordDigester(passwordHashMethod);
+
+        try {
+            initializeDatabaseLookup(passwordColumn, userTable, userNameColumn);
+        } catch (Exception e) {
+            log.error("Error while initializing database configurations.", e);
+            throw new UserStoreException("Error while initializing database configurations.", e);
+        }
+
+        StringBuilder stringBuilder = new StringBuilder(
+                "Configuring DB parameters for authenticator with User name Table - ");
+        stringBuilder.append(userTable).append(" User name column - ").append(userNameColumn)
+                .append(" Password column - ").append(passwordColumn);
+
+        log.debug(stringBuilder.toString());
+    }
+
+    protected void initializeDatabaseLookup(String passwordColumn, String userTable, String userNameColumn) throws IllegalAccessException, ClassNotFoundException, InstantiationException {
+
+        DBUtil dbUtil = new DBUtil(getDatabaseURL(), getDatabaseUserName(), getDatabasePassword(), getDatabaseDriver());
+        DataSource dataSource = dbUtil.getDataSource();
+        jdbcRealm.setDataSource(dataSource);
+
+        StringBuilder stringBuilder = new StringBuilder();
+
+        stringBuilder.append("SELECT ").append(passwordColumn).append(" FROM ").append(userTable).append(" WHERE ")
+                .append(userNameColumn).append(" = ?");
+
+        jdbcRealm.setAuthenticationQuery(stringBuilder.toString());
+    }
+
+    public PasswordDigester getPasswordDigester() {
+        return passwordDigester;
+    }
+}


[21/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java
deleted file mode 100644
index 29fdbdf..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.util;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.InOutAxisOperation;
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.engine.ServiceLifeCycle;
-import org.apache.axis2.transport.http.SimpleHTTPServer;
-
-import java.io.IOException;
-import java.net.ServerSocket;
-import java.nio.channels.ServerSocketChannel;
-
-public class TestUtilServer {
-    private static int count = 0;
-
-    private static SimpleHTTPServer receiver;
-
-    public static int TESTING_PORT = 5555;
-
-    public static final String FAILURE_MESSAGE = "Intentional Failure";
-
-    public static synchronized void deployService(AxisService service) throws AxisFault {
-        receiver.getConfigurationContext().getAxisConfiguration().addService(service);
-    }
-
-    public static synchronized void unDeployService(QName service) throws AxisFault {
-        receiver.getConfigurationContext().getAxisConfiguration().removeService(service.getLocalPart());
-    }
-
-    public static synchronized void unDeployClientService() throws AxisFault {
-        if (receiver.getConfigurationContext().getAxisConfiguration() != null) {
-            receiver.getConfigurationContext().getAxisConfiguration().removeService("AnonymousService");
-        }
-    }
-
-    public static synchronized void start(String repository, String axis2xml) throws Exception {
-        if (count == 0) {
-            ConfigurationContext er = getNewConfigurationContext(repository, axis2xml);
-            TESTING_PORT = getAvailablePort();
-            receiver = new SimpleHTTPServer(er, TESTING_PORT);
-
-            try {
-                receiver.start();
-                System.out.print("Server started on port " + TESTING_PORT + ".....");
-            } catch (Exception e) {
-                throw AxisFault.makeFault(e);
-            }
-
-            try {
-                Thread.sleep(2000);
-            } catch (InterruptedException e1) {
-                throw new AxisFault("Thread interuptted", e1);
-            }
-            startBroker();
-        }
-        count++;
-    }
-
-    public static void startBroker() throws Exception {
-
-        ServiceLifeCycle brokerLifeCycle = new BrokerServiceLifeCycle();
-
-        final String configFileParam = "configuration.file.name";
-        final String configFileValue = "airavata-server.properties";
-
-        AxisService notificationService = getNotificationService();
-        notificationService.addParameter(configFileParam, configFileValue);
-        notificationService.setServiceLifeCycle(brokerLifeCycle);
-        TestUtilServer.deployService(notificationService);
-        brokerLifeCycle.startUp(TestUtilServer.getConfigurationContext(), notificationService);
-
-        AxisService eventingService = getEventingService();
-        eventingService.addParameter(configFileParam, configFileValue);
-        eventingService.setServiceLifeCycle(brokerLifeCycle);
-        TestUtilServer.deployService(eventingService);
-        brokerLifeCycle.startUp(TestUtilServer.getConfigurationContext(), eventingService);
-
-    }
-
-    public static AxisService getEventingService() {
-
-        AxisService eventingService = new AxisService("EventingService");
-
-        createOperation(eventingService, "renew",
-                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
-                "http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew",
-                "http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse");
-        createOperation(eventingService, "getStatus",
-                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
-                "http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus",
-                "http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse");
-
-        createOperation(eventingService, "subscriptionEnd",
-                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
-                "http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd", null);
-
-        createOperation(eventingService, "subscribe",
-                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
-                "http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe",
-                "http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse");
-        createOperation(eventingService, "unsubscribe",
-                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
-                "http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe",
-                "http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse");
-        createOperation(eventingService, "publish",
-                new org.apache.airavata.wsmg.broker.wseventing.WSEventingPublishMsgReceiver(),
-                "http://org.apache.airavata/WseNotification", null);
-
-        return eventingService;
-    }
-
-    public static AxisService getNotificationService() {
-
-        AxisService notificationService = new AxisService("NotificationService");
-
-        createOperation(notificationService, "notify",
-                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/Notify",
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/NotifyResponse");
-
-        createOperation(notificationService, "subscribe",
-                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequest",
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequestResponse");
-
-        createOperation(notificationService, "getCurrentMessage",
-                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageRequest",
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageResponse");
-
-        createOperation(notificationService, "pauseSubscription",
-                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubsriptionRequest",
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubscriptionResponse");
-
-        createOperation(notificationService, "resumeSubscription",
-                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubsriptionRequest",
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubscriptionResponse");
-
-        createOperation(notificationService, "unsubscribe",
-                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubsribeRequest",
-                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubscribeResponse");
-
-        return notificationService;
-
-    }
-
-    public static void createOperation(AxisService axisService, String name, MessageReceiver messageReceiver,
-            String inputAction, String outputAction) {
-        InOutAxisOperation operation1 = new InOutAxisOperation(new QName(name));
-        operation1.setMessageReceiver(messageReceiver);
-        operation1.setOutputAction(outputAction);
-        axisService.addOperation(operation1);
-        if (inputAction != null) {
-            axisService.mapActionToOperation(inputAction, operation1);
-        }
-    }
-
-    public static ConfigurationContext getNewConfigurationContext(String repository, String axis2xml) throws Exception {
-        return ConfigurationContextFactory.createConfigurationContextFromFileSystem(repository, axis2xml);
-    }
-
-    public static synchronized void stop() throws AxisFault {
-        if (count == 1) {
-            receiver.stop();
-            while (receiver.isRunning()) {
-                try {
-                    Thread.sleep(1000);
-                } catch (InterruptedException e1) {
-                    // nothing to do here
-                }
-            }
-            count = 0;
-            // tp.doStop();
-            System.out.print("Server stopped .....");
-        } else {
-            count--;
-        }
-        receiver.getConfigurationContext().terminate();
-    }
-
-    public static ConfigurationContext getConfigurationContext() {
-        return receiver.getConfigurationContext();
-    }
-
-    public static int getAvailablePort(){
-        ServerSocket serverSocket = null;
-        try {
-             serverSocket = new ServerSocket(0);
-             serverSocket.close();
-        } catch (IOException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        }
-        return serverSocket.getLocalPort();
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties b/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties
deleted file mode 100644
index 33b6161..0000000
--- a/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-consumer.port=2222
-consumer.location=http://localhost:2222
-topic.simple=MySimpleTestTopic
-topic.xpath=MyXpathTextTopic

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/pom.xml b/modules/ws-messenger/pom.xml
index 7f4bc99..275e217 100644
--- a/modules/ws-messenger/pom.xml
+++ b/modules/ws-messenger/pom.xml
@@ -146,10 +146,7 @@
             <modules>
                 <module>commons</module>
                 <module>client</module>
-                <!--module>messagebox</module-->
-                <!--module>messagebroker</module-->
                 <module>message-monitor</module>
-                <!-- <module>distribution</module> -->
             </modules>
         </profile>
     </profiles>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/README.txt
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/README.txt b/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/README.txt
deleted file mode 100644
index aaf1ec5..0000000
--- a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/README.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-wsmg-msgbox Quick Start Guide- Sample 1 
-=================================
-
-This sample demonstrate how create a message box, how to store a message and retrieve that message and ultimately how to destroy the created
-message box. 
-
-
-
-Pre-Requisites
-==============
-
-Apache Ant 1.7.1 or later
-Apache Axis2 1.5 or later
-
-
-
-Steps:
-======
-
-1) configure and run wsmg-msgbox. please refer wsmg-msgbox user guide to know how to run the wsmg-msgbox.
-
-2) configure 'build.properties' located in the sample directory.
-
-3) set configurations in './conf/configuration.properties' file.
-
-4) run following command:
-      ant run
-      

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/build.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/build.properties b/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/build.properties
deleted file mode 100644
index bbb4014..0000000
--- a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/build.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-
-
-axis2.home=../../../standalone-server/

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/build.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/build.xml b/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/build.xml
deleted file mode 100644
index 9925e14..0000000
--- a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/build.xml
+++ /dev/null
@@ -1,78 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-<project name="msgboxsamples" default="run" basedir=".">
-
-	<property file="build.properties" />
-	<property name="lib.path" value="../../../lib" />
-	<property name="dest.dir" value="bin" />
-	<property name="src.dir" value="src" />
-	<property name="conf.dir" location="conf" />
-
-	
-
-	<path id="msgbox.class.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-
-		<path location="${conf.dir}" />
-
-		<pathelement location="${dest.dir}" />
-
-	</path>
-
-
-	<target name="clean">
-		<delete dir="${dest.dir}" />
-	</target>
-
-	<target name="build" depends="makeDest">
-		<antcall target="compile" />
-	</target>
-
-	<target name="makeDest">
-		<mkdir dir="${dest.dir}" />
-	</target>
-
-
-	<target name="compile" depends="makeDest">
-		<javac debug="true" srcdir="${src.dir}" destdir="${dest.dir}">
-			<classpath refid="msgbox.class.path" />
-		</javac>
-	</target>
-
-
-	<target name="run" depends="build">
-
-		<java classname="org.apache.airavata.wsmg.samples.msgBox.SimpleMsgBoxExec" fork="true">
-			<classpath refid="msgbox.class.path" />
-		</java>
-
-	</target>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/conf/configuration.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/conf/configuration.properties b/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/conf/configuration.properties
deleted file mode 100644
index 875cdfe..0000000
--- a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/conf/configuration.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-axis2.repository=../../../standalone-server/
-msgbox.service.url=http://localhost:8080/axis2/services/MsgBoxService
-msgbox.id=67889-28837892-33457700-33-4889uu9688--4770333068

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/src/org/apache/airavata/wsmg/samples/msgBox/SimpleMsgBoxExec.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/src/org/apache/airavata/wsmg/samples/msgBox/SimpleMsgBoxExec.java b/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/src/org/apache/airavata/wsmg/samples/msgBox/SimpleMsgBoxExec.java
deleted file mode 100644
index 5a6f83f..0000000
--- a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/src/org/apache/airavata/wsmg/samples/msgBox/SimpleMsgBoxExec.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.msgBox;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.net.URL;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.UUID;
-import javax.xml.stream.XMLStreamException;
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.airavata.wsmg.msgbox.client.MsgBoxClient;
-import org.apache.airavata.wsmg.msgbox.util.MsgBoxUtils;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-import java.io.*;
-
-public class SimpleMsgBoxExec {
-
-	private static Properties getDefaults() {
-		Properties defaults = new Properties();
-		defaults.setProperty(ConfigKeys.MSGBOX_SERVICE_URL,
-				"http://localhost:8080/axis2/services/MsgBoxService");
-		return defaults;
-	}
-
-	public static void main(String[] args) throws IOException {
-
-		Properties configurations = new Properties(getDefaults());
-		try {
-			InputStream ioStream = new FileInputStream(ConfigKeys.CONFIG_FILE_NAME);
-			configurations.load(ioStream);
-		} catch (IOException ioe) {
-
-			System.out.println("unable to load configuration file, "
-					+ "default settings will be used");
-		}
-
-		String msgBoxId = UUID.randomUUID().toString();
-		MsgBoxClient client = new MsgBoxClient();
-
-		EndpointReference msgBoxEpr = client.createMessageBox(configurations
-				.getProperty(ConfigKeys.MSGBOX_SERVICE_URL), 500L);
-
-		try {
-			client.storeMessage(msgBoxEpr, 500L, MsgBoxUtils
-					.reader2OMElement(new StringReader(
-							"<test>A simple test message</test>")));
-		} catch (XMLStreamException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}
-		Iterator<OMElement> iterator = client.takeMessagesFromMsgBox(msgBoxEpr,
-				500L);
-		int i = 0;
-		if (iterator != null)
-			while (iterator.hasNext()) {
-				i++;
-				System.out.println("Retrieved message :" + i);
-				try {
-					System.out.println(iterator.next().toStringWithConsume());
-				} catch (XMLStreamException e) {
-					e.printStackTrace();
-				}
-			}
-
-		/*
-		System.out.println("Delete message box response :  "
-				+ client.deleteMsgBox(msgBoxEpr, 500L));
-				*/
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java b/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
deleted file mode 100644
index 15962b4..0000000
--- a/modules/ws-messenger/samples/messagebox/messagebox-create-store-take-delete/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.util;
-
-public class ConfigKeys {
-	
-	public static final String AXIS2_REPO = "axis2.repository";
-	public static final String CONFIG_FILE_NAME = "configuration.properties";
-	public static final String MSGBOX_SERVICE_URL = "msgbox.service.url";
-	public static final String MSGBOX_ID = "msgbox.id";
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/README.txt
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/README.txt b/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/README.txt
deleted file mode 100644
index ccd8103..0000000
--- a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/README.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-OGCE-WS messenger Quick Start Guide- Sample 2
-=================================
-
-This sample demonstrates a scenarios where multiple producers publish messages under a topic, while a single consumer receive them.
-
-
-Pre-Requisites
-==============
-
-Apache Ant 1.7.1 or later
-Apache Axis2 1.5 or later
-
-
-
-Steps:
-======
-
-1) configure and run ws-messenger in any mode. please refer ws-messenger user guide to know how to run the ws-messenger.
-
-2) configure 'build.properties' located in the sample directory.
-
-3) set configurations in './conf/configuration.properties' file.
-
-4) run following command:
-      ant run
-
-5) Start the WS-Notification Viewer
-      Configure the Topic as 'topic'

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/build.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/build.properties b/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/build.properties
deleted file mode 100644
index 3919fd5..0000000
--- a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-
-axis2.home=../../../standalone-server/

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/build.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/build.xml b/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/build.xml
deleted file mode 100644
index d56a079..0000000
--- a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/build.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-
-
-<project name="wse-multi-topics-sample" default="run" basedir=".">
-
-	<property file="build.properties" />
-	<property name="lib.path" value="../../../lib" />
-	<property name="dest.dir" value="bin" />
-	<property name="src.dir" value="src" />
-	<property name="conf.dir" location="conf" />
-
-	<path id="broker.libs.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-	</path>
-
-
-	<path id="broker.class.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-		
-		<path location="${conf.dir}" />
-		
-		<pathelement location="${dest.dir}" />
-	</path>
-
-	<target name="clean">
-		<delete dir="${dest.dir}" />
-	</target>
-
-	<target name="build" depends="makeDest">
-		<antcall target="compile" />
-	</target>
-
-	<target name="makeDest">
-		<mkdir dir="${dest.dir}" />
-	</target>
-
-
-	<target name="compile" depends="makeDest">
-		<javac debug="true" srcdir="${src.dir}" destdir="${dest.dir}">
-			<classpath refid="broker.libs.path" />
-		</javac>
-	</target>
-
-
-	<target name="run" depends="build">
-
-		<java classname="org.apache.airavata.wsmg.samples.wse.MultipleProducersConsumersTopics" fork="true">
-			<classpath refid="broker.class.path" />
-		</java>
-
-	</target>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/conf/configurations.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/conf/configurations.properties b/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/conf/configurations.properties
deleted file mode 100644
index 29f5242..0000000
--- a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/conf/configurations.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-#broker.eventing.service.epr=http://localhost:8080/axis2/services/EventingService
-broker.notification.service.epr=http://localhost:8080/axis2/services/NotificationService
-consumer.port=6060
-topic.prefix=topic
-publish.time.interval=6
-producer.count.per.topic=2
-consumer.count.per.topic=3
-number.of.topics=1

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java b/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
deleted file mode 100644
index 3dcdff4..0000000
--- a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.util;
-
-public interface ConfigKeys {
-
-	String CONFIG_FILE_NAME = "configurations.properties";
-
-	String BROKER_EVENTING_SERVICE_EPR = "broker.eventing.service.epr";
-	String BROKER_NOTIFICATIONS_SERVICE_EPR = "broker.notification.service.epr";
-
-	String CONSUMER_PORT_OFFSET = "consumer.port";
-	String TOPIC_PREFIX = "topic.prefix";
-	String PUBLISH_TIME_INTERVAL = "publish.time.interval";
-	String PRODUCER_COUNT_PER_TOPIC = "producer.count.per.topic";
-	String CONSUMER_COUNT_PER_TOPIC = "consumer.count.per.topic";
-	String NUMBER_OF_TOPICS = "number.of.topics";
-	String LOG_FILE_PATH = "logfile.path";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MsgUtil.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MsgUtil.java b/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MsgUtil.java
deleted file mode 100644
index d390e0f..0000000
--- a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MsgUtil.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-
-public class MsgUtil {
-
-	static final String TAG_MSG = "msg";
-	static final String TAG_SEQ = "seq";
-	static final String TAG_SRC = "src";
-	static final String TAG_UUID = "uuid";
-
-	public static OMElement createMsg(long seq, String src, String uuid) {
-
-		// "<msg><seq>%d</seq><src>%s</src><uuid>%s</uuid></msg>"
-
-		OMFactory factory = OMAbstractFactory.getOMFactory();
-
-		OMElement omMsg = factory.createOMElement(TAG_MSG, null);
-
-		OMElement omSeq = factory.createOMElement(TAG_SEQ, null, omMsg);
-		omSeq.setText("" + seq);
-
-		OMElement omSrc = factory.createOMElement(TAG_SRC, null, omMsg);
-		omSrc.setText(src);
-
-		OMElement omUUID = factory.createOMElement(TAG_UUID, null, omMsg);
-		omUUID.setText(uuid);
-
-		return omMsg;
-	}
-
-	public static String getSeq(OMElement msg) {
-
-		return msg.getFirstElement().getText();
-
-	}
-
-	public static void print(String msg, OMElement ele){
-		
-		try{
-			System.out.println(msg + "-" + ele.toStringWithConsume());
-		}catch(Exception e){
-			e.printStackTrace();
-		}
-		
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumersTopics.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumersTopics.java b/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumersTopics.java
deleted file mode 100644
index c0bfd6e..0000000
--- a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumersTopics.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.io.*;
-import java.net.URL;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-import java.io.FileInputStream;
-import java.io.InputStream;
-
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class MultipleProducersConsumersTopics {
-
-	static DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
-
-	private static Properties getDefaults() {
-
-		Properties defaults = new Properties();
-		defaults.setProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR,
-				"http://localhost:8080/axis2/services/EventingService");
-		defaults.setProperty(ConfigKeys.CONSUMER_PORT_OFFSET, "2222");
-
-		defaults.setProperty(ConfigKeys.PUBLISH_TIME_INTERVAL, "5");
-		defaults.setProperty(ConfigKeys.PRODUCER_COUNT_PER_TOPIC, "2");
-		defaults.setProperty(ConfigKeys.CONSUMER_COUNT_PER_TOPIC, "3");
-		defaults.setProperty(ConfigKeys.NUMBER_OF_TOPICS, "5");
-		defaults.setProperty(ConfigKeys.TOPIC_PREFIX, "topic_prefix_");
-		defaults.setProperty(ConfigKeys.LOG_FILE_PATH, "stats.log");
-
-		return defaults;
-	}
-
-	public static void main(String[] args) throws InterruptedException {
-
-		Properties configurations = new Properties(getDefaults());
-		try {
-			InputStream ioStream = new FileInputStream(ConfigKeys.CONFIG_FILE_NAME);
-			configurations.load(ioStream);
-		} catch (IOException ioe) {
-
-			System.out.println("unable to load configuration file, "
-					+ "default settings will be used");
-		}
-
-		int numberOfProducers = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.PRODUCER_COUNT_PER_TOPIC));
-
-		int numberOfConsumers = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.CONSUMER_COUNT_PER_TOPIC));
-
-		int numberOfTopics = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.NUMBER_OF_TOPICS));
-
-		String topicPrefix = configurations
-				.getProperty(ConfigKeys.TOPIC_PREFIX);
-
-		int portOffset = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.CONSUMER_PORT_OFFSET));
-
-		//List<List<Consumer>> consumers = new ArrayList<List<Consumer>>();
-		List<List<Producer>> producers = new ArrayList<List<Producer>>();
-
-		for (int i = 0; i < numberOfTopics; i++) {
-
-			TimeUnit.SECONDS.sleep(1);
-
-			producers.add(createProducers(numberOfProducers, topicPrefix,
-					configurations));
-		}
-
-		PrintStream printStream = null;
-		try {
-			FileOutputStream outputStream = new FileOutputStream(configurations
-					.getProperty(ConfigKeys.LOG_FILE_PATH), true);
-
-			printStream = new PrintStream(outputStream, true);
-
-		} catch (FileNotFoundException e) {
-			System.out
-					.println("unable to open the file - stats will be printed to console");
-			printStream = System.out;
-		}
-	}
-
-	private static List<Producer> createProducers(int number, String topic,
-			Properties config) {
-
-		List<Producer> ret = new ArrayList<Producer>();
-
-		for (int i = 0; i < number; i++) {
-			Producer p = new Producer(
-					String.format("producer_%s_%d", topic, i), topic, config);
-			p.start();
-			ret.add(p);
-		}
-
-		return ret;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Producer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Producer.java b/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Producer.java
deleted file mode 100644
index 9a556be..0000000
--- a/modules/ws-messenger/samples/messagebroker/wnt-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Producer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.util.Properties;
-import java.util.Random;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.axiom.om.OMElement;
-
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WsntMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class Producer extends Thread {
-
-	private Properties configurations;
-	private String topicExpression;
-
-	private Random random;
-
-	public Producer(String producerId, String topic, Properties config) {
-		super(producerId);
-		configurations = config;
-		topicExpression = topic;
-		random = new Random();
-	}
-
-	public void run() {
-
-		System.out.println(String
-				.format("producer [%s] starting...", getName()));
-
-		String brokerLocation = configurations
-				.getProperty(ConfigKeys.BROKER_NOTIFICATIONS_SERVICE_EPR);
-
-		int timeIntervalUpperLimit = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.PUBLISH_TIME_INTERVAL));
-
-		WsntMsgBrokerClient client = new WsntMsgBrokerClient();
-		client.init(brokerLocation);
-
-		try {
-
-			long count = 0;
-			while (true) {
-				UUID uuid = UUID.randomUUID();
-				count++;
-				OMElement omMsg = MsgUtil.createMsg(count, getName(), uuid
-						.toString());
-				//MsgUtil.print("seding msg", omMsg);
-				client.publish(topicExpression, omMsg);
-
-				TimeUnit.SECONDS
-						.sleep(getRandomSleepTime(timeIntervalUpperLimit));
-			}
-
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-			System.out.println("interruped");
-		} catch (MsgBrokerClientException f) {
-			f.printStackTrace();
-			System.out.println("unable to publish messages - producer will stop.");
-		}
-	}
-
-	private int getRandomSleepTime(int upperLimit) {
-
-		int rnd = random.nextInt() % upperLimit;
-
-		return rnd < 2 ? 2 : rnd;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/README.txt
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/README.txt b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/README.txt
deleted file mode 100644
index 8c166bb..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/README.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-OGCE-WS messenger Quick Start Guide- Sample 1 
-=================================
-
-This sample demonstrates a scenarios where multiple producers publish messages under a topic, while multiple consumers receive them.
-
-
-Pre-Requisites
-==============
-
-Apache Ant 1.7.1 or later
-Apache Axis2 1.5 or later
-
-
-
-Steps:
-======
-
-1) configure and run ws-messenger in any mode. please refer ws-messenger user guide to know how to run the ws-messenger.
-
-2) configure 'build.properties' located in the sample directory.
-
-3) set configurations in './conf/configuration.properties' file.
-
-4) run following command:
-      ant run

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/build.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/build.properties b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/build.properties
deleted file mode 100644
index 3919fd5..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-
-axis2.home=../../../standalone-server/

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/build.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/build.xml b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/build.xml
deleted file mode 100644
index d56a079..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/build.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-
-
-<project name="wse-multi-topics-sample" default="run" basedir=".">
-
-	<property file="build.properties" />
-	<property name="lib.path" value="../../../lib" />
-	<property name="dest.dir" value="bin" />
-	<property name="src.dir" value="src" />
-	<property name="conf.dir" location="conf" />
-
-	<path id="broker.libs.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-	</path>
-
-
-	<path id="broker.class.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-		
-		<path location="${conf.dir}" />
-		
-		<pathelement location="${dest.dir}" />
-	</path>
-
-	<target name="clean">
-		<delete dir="${dest.dir}" />
-	</target>
-
-	<target name="build" depends="makeDest">
-		<antcall target="compile" />
-	</target>
-
-	<target name="makeDest">
-		<mkdir dir="${dest.dir}" />
-	</target>
-
-
-	<target name="compile" depends="makeDest">
-		<javac debug="true" srcdir="${src.dir}" destdir="${dest.dir}">
-			<classpath refid="broker.libs.path" />
-		</javac>
-	</target>
-
-
-	<target name="run" depends="build">
-
-		<java classname="org.apache.airavata.wsmg.samples.wse.MultipleProducersConsumersTopics" fork="true">
-			<classpath refid="broker.class.path" />
-		</java>
-
-	</target>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/conf/configurations.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/conf/configurations.properties b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/conf/configurations.properties
deleted file mode 100644
index b4c37dd..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/conf/configurations.properties
+++ /dev/null
@@ -1,29 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-broker.eventing.service.epr=http://localhost:8080/axis2/services/EventingService
-broker.notification.service.epr=http://localhost:8080/axis2/services/NotificationService
-consumer.port=6060
-topic.prefix=topic_prefix_
-publish.time.interval=6
-producer.count.per.topic=2
-consumer.count.per.topic=3
-number.of.topics=1

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
deleted file mode 100644
index 3dcdff4..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.util;
-
-public interface ConfigKeys {
-
-	String CONFIG_FILE_NAME = "configurations.properties";
-
-	String BROKER_EVENTING_SERVICE_EPR = "broker.eventing.service.epr";
-	String BROKER_NOTIFICATIONS_SERVICE_EPR = "broker.notification.service.epr";
-
-	String CONSUMER_PORT_OFFSET = "consumer.port";
-	String TOPIC_PREFIX = "topic.prefix";
-	String PUBLISH_TIME_INTERVAL = "publish.time.interval";
-	String PRODUCER_COUNT_PER_TOPIC = "producer.count.per.topic";
-	String CONSUMER_COUNT_PER_TOPIC = "consumer.count.per.topic";
-	String NUMBER_OF_TOPICS = "number.of.topics";
-	String LOG_FILE_PATH = "logfile.path";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Consumer.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
deleted file mode 100644
index 07c8d83..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.util.Properties;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import java.util.concurrent.atomic.AtomicInteger;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPEnvelope;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class Consumer extends Thread {
-
-	class NotificationMsgReciever implements ConsumerNotificationHandler {
-
-		private BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
-
-		public void handleNotification(SOAPEnvelope msgEnvelope) {
-
-			queue.add(msgEnvelope);
-		}
-
-		public BlockingQueue<SOAPEnvelope> getQueue() {
-			return queue;
-		}
-
-	}
-
-	private Properties configurations;
-	private int consumerPort;
-	private String topic;
-
-	AtomicLong numberOfMsgRecieved;
-
-	public Consumer(String consumerName, int port, String topic,
-			Properties config) {
-		super(consumerName);
-		consumerPort = port;
-		configurations = config;
-		this.topic = topic;
-		numberOfMsgRecieved = new AtomicLong(0);
-	}
-
-	public void run() {
-
-		String brokerLocation = configurations
-				.getProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR);
-
-		NotificationMsgReciever msgReciever = new NotificationMsgReciever();
-
-		String[] consumerEprs = null;
-
-		String subscriptionId = null;
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-		try {
-			consumerEprs = client.startConsumerService(consumerPort,
-					msgReciever);
-
-		} catch (MsgBrokerClientException e) {
-
-			e.printStackTrace();
-
-			System.out.println("unable to start consumer service, exiting");
-			return;
-		}
-
-		try {
-
-			subscriptionId = client.subscribe(consumerEprs[0], topic, null);
-			System.out.println(getName() + "got the subscription id :"
-					+ subscriptionId);
-
-		} catch (MsgBrokerClientException e) {
-
-			e.printStackTrace();
-
-			System.out
-					.println("unable to subscribe for the xpath consumer exiting");
-			return;
-		}
-
-		try {
-
-			do {
-				SOAPEnvelope env = msgReciever.getQueue().take();
-
-				try {
-					OMElement msg = env.getBody().getFirstElement();
-
-					numberOfMsgRecieved.incrementAndGet();
-
-					 System.out .println(String.format(
-					 "consumer [%s] recieved: %s", getName(),
-					 numberOfMsgRecieved));
-				} catch (Exception e) {
-					System.err.print("invalid msg recieved");
-				}
-
-			} while (true);
-
-		} catch (InterruptedException ie) {
-
-			try {
-				// unsubscribe from the topic.
-				client.unSubscribe(subscriptionId);
-
-			} catch (MsgBrokerClientException e) {
-
-				e.printStackTrace();
-				System.out.println("unable to unsubscribe, ignoring");
-			}
-
-			// shutdown the consumer service.
-			client.shutdownConsumerService();
-
-			System.out.println("interrupted");
-
-		}
-
-	}
-
-	public long getLatestSeq() {
-		return numberOfMsgRecieved.get();
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MsgUtil.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MsgUtil.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MsgUtil.java
deleted file mode 100644
index d390e0f..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MsgUtil.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-
-public class MsgUtil {
-
-	static final String TAG_MSG = "msg";
-	static final String TAG_SEQ = "seq";
-	static final String TAG_SRC = "src";
-	static final String TAG_UUID = "uuid";
-
-	public static OMElement createMsg(long seq, String src, String uuid) {
-
-		// "<msg><seq>%d</seq><src>%s</src><uuid>%s</uuid></msg>"
-
-		OMFactory factory = OMAbstractFactory.getOMFactory();
-
-		OMElement omMsg = factory.createOMElement(TAG_MSG, null);
-
-		OMElement omSeq = factory.createOMElement(TAG_SEQ, null, omMsg);
-		omSeq.setText("" + seq);
-
-		OMElement omSrc = factory.createOMElement(TAG_SRC, null, omMsg);
-		omSrc.setText(src);
-
-		OMElement omUUID = factory.createOMElement(TAG_UUID, null, omMsg);
-		omUUID.setText(uuid);
-
-		return omMsg;
-	}
-
-	public static String getSeq(OMElement msg) {
-
-		return msg.getFirstElement().getText();
-
-	}
-
-	public static void print(String msg, OMElement ele){
-		
-		try{
-			System.out.println(msg + "-" + ele.toStringWithConsume());
-		}catch(Exception e){
-			e.printStackTrace();
-		}
-		
-	}
-	
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumersTopics.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumersTopics.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumersTopics.java
deleted file mode 100644
index fbf12b0..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumersTopics.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.io.*;
-import java.net.URL;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-import java.io.FileInputStream;
-import java.io.InputStream;
-
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class MultipleProducersConsumersTopics {
-
-	static DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
-
-	private static Properties getDefaults() {
-
-		Properties defaults = new Properties();
-		defaults.setProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR,
-				"http://localhost:8080/axis2/services/EventingService");
-		defaults.setProperty(ConfigKeys.CONSUMER_PORT_OFFSET, "2222");
-
-		defaults.setProperty(ConfigKeys.PUBLISH_TIME_INTERVAL, "5");
-		defaults.setProperty(ConfigKeys.PRODUCER_COUNT_PER_TOPIC, "2");
-		defaults.setProperty(ConfigKeys.CONSUMER_COUNT_PER_TOPIC, "3");
-		defaults.setProperty(ConfigKeys.NUMBER_OF_TOPICS, "5");
-		defaults.setProperty(ConfigKeys.TOPIC_PREFIX, "topic_prefix_");
-		defaults.setProperty(ConfigKeys.LOG_FILE_PATH, "stats.log");
-
-		return defaults;
-	}
-
-	public static void main(String[] args) throws InterruptedException {
-
-		Properties configurations = new Properties(getDefaults());
-		try {
-			InputStream ioStream = new FileInputStream(ConfigKeys.CONFIG_FILE_NAME);
-			configurations.load(ioStream);
-		} catch (IOException ioe) {
-
-			System.out.println("unable to load configuration file, "
-					+ "default settings will be used");
-		}
-
-		int numberOfProducers = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.PRODUCER_COUNT_PER_TOPIC));
-
-		int numberOfConsumers = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.CONSUMER_COUNT_PER_TOPIC));
-
-		int numberOfTopics = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.NUMBER_OF_TOPICS));
-
-		String topicPrefix = configurations
-				.getProperty(ConfigKeys.TOPIC_PREFIX);
-
-		int portOffset = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.CONSUMER_PORT_OFFSET));
-
-		List<List<Consumer>> consumers = new ArrayList<List<Consumer>>();
-		List<List<Producer>> producers = new ArrayList<List<Producer>>();
-
-		for (int i = 0; i < numberOfTopics; i++) {
-			String topic = topicPrefix + i;
-			consumers.add(createConsumers(numberOfConsumers, portOffset
-					+ (i * numberOfConsumers), topic, configurations));
-
-			TimeUnit.SECONDS.sleep(1);
-
-			producers.add(createProducers(numberOfProducers, topic,
-					configurations));
-		}
-
-		PrintStream printStream = null;
-		try {
-			FileOutputStream outputStream = new FileOutputStream(configurations
-					.getProperty(ConfigKeys.LOG_FILE_PATH), true);
-
-			printStream = new PrintStream(outputStream, true);
-
-		} catch (FileNotFoundException e) {
-			System.out
-					.println("unable to open the file - stats will be printed to console");
-			printStream = System.out;
-		}
-
-		while (true) {
-
-			Date date = new Date();
-			printStream.println("---- statistics at : ["
-					+ dateFormat.format(date) + "]------");
-			for (List<Consumer> l : consumers) {
-
-				for (Consumer c : l) {
-					printStream.println(c.getName() + " latest seq: "
-							+ c.getLatestSeq());
-
-				}
-			}
-
-			TimeUnit.SECONDS.sleep(5);
-		}
-
-	}
-
-	private static List<Consumer> createConsumers(int number, int portOffset,
-			String topic, Properties config) {
-
-		List<Consumer> ret = new ArrayList<Consumer>();
-
-		for (int i = 0; i < number; i++) {
-
-			int port = portOffset + i;
-			Consumer c = new Consumer("consumer_" + port, port, topic, config);
-			c.start();
-			ret.add(c);
-		}
-
-		return ret;
-	}
-
-	private static List<Producer> createProducers(int number, String topic,
-			Properties config) {
-
-		List<Producer> ret = new ArrayList<Producer>();
-
-		for (int i = 0; i < number; i++) {
-			Producer p = new Producer(
-					String.format("producer_%s_%d", topic, i), topic, config);
-			p.start();
-			ret.add(p);
-		}
-
-		return ret;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Producer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Producer.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Producer.java
deleted file mode 100644
index b8d773c..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-topics/src/org/apache/airavata/wsmg/samples/wse/Producer.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.util.Properties;
-import java.util.Random;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.axiom.om.OMElement;
-
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class Producer extends Thread {
-
-	private Properties configurations;
-	private String topicExpression;
-
-	private Random random;
-
-	public Producer(String producerId, String topic, Properties config) {
-		super(producerId);
-		configurations = config;
-		topicExpression = topic;
-		random = new Random();
-	}
-
-	public void run() {
-
-		System.out.println(String
-				.format("producer [%s] starting...", getName()));
-
-		String brokerLocation = configurations
-				.getProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR);
-
-		int timeIntervalUpperLimit = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.PUBLISH_TIME_INTERVAL));
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-
-		try {
-
-			long count = 0;
-			while (true) {
-				UUID uuid = UUID.randomUUID();
-				count++;
-				OMElement omMsg = MsgUtil.createMsg(count, getName(), uuid
-						.toString());
-				//MsgUtil.print("seding msg", omMsg);
-				client.publish(topicExpression, omMsg);
-
-				TimeUnit.SECONDS
-						.sleep(getRandomSleepTime(timeIntervalUpperLimit));
-			}
-
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-			System.out.println("interruped");
-		} catch (MsgBrokerClientException f) {
-			f.printStackTrace();
-			System.out.println("unable to publish messages - producer will stop.");
-		}
-	}
-
-	private int getRandomSleepTime(int upperLimit) {
-
-		int rnd = random.nextInt() % upperLimit;
-
-		return rnd < 2 ? 2 : rnd;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/README.txt
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/README.txt b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/README.txt
deleted file mode 100644
index 8c166bb..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/README.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-OGCE-WS messenger Quick Start Guide- Sample 1 
-=================================
-
-This sample demonstrates a scenarios where multiple producers publish messages under a topic, while multiple consumers receive them.
-
-
-Pre-Requisites
-==============
-
-Apache Ant 1.7.1 or later
-Apache Axis2 1.5 or later
-
-
-
-Steps:
-======
-
-1) configure and run ws-messenger in any mode. please refer ws-messenger user guide to know how to run the ws-messenger.
-
-2) configure 'build.properties' located in the sample directory.
-
-3) set configurations in './conf/configuration.properties' file.
-
-4) run following command:
-      ant run

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/build.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/build.properties b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/build.properties
deleted file mode 100644
index 3919fd5..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-
-axis2.home=../../../standalone-server/

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/build.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/build.xml b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/build.xml
deleted file mode 100644
index cdc9cc2..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/build.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-
-
-<project name="wse-multi-xpath-sample" default="run" basedir=".">
-
-	<property file="build.properties" />
-	<property name="lib.path" value="../../../lib" />
-	<property name="dest.dir" value="bin" />
-	<property name="src.dir" value="src" />
-	<property name="conf.dir" location="conf" />
-
-	<path id="broker.libs.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-	</path>
-
-
-	<path id="broker.class.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-		
-		<path location="${conf.dir}" />
-		
-		<pathelement location="${dest.dir}" />
-	</path>
-
-	<target name="clean">
-		<delete dir="${dest.dir}" />
-	</target>
-
-	<target name="build" depends="makeDest">
-		<antcall target="compile" />
-	</target>
-
-	<target name="makeDest">
-		<mkdir dir="${dest.dir}" />
-	</target>
-
-
-	<target name="compile" depends="makeDest">
-		<javac debug="true" srcdir="${src.dir}" destdir="${dest.dir}">
-			<classpath refid="broker.libs.path" />
-		</javac>
-	</target>
-
-
-	<target name="run" depends="build">
-
-		<java classname="org.apache.airavata.wsmg.samples.wse.MultipleProducersConsumers" fork="true">
-			<classpath refid="broker.class.path" />
-		</java>
-
-	</target>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/conf/configurations.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/conf/configurations.properties b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/conf/configurations.properties
deleted file mode 100644
index cd2821b..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/conf/configurations.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-broker.eventing.service.epr=http://localhost:8080/axis2/services/EventingService
-broker.notification.service.epr=http://localhost:8080/axis2/services/NotificationService
-consumer.port=6060
-topic.xpath=/msg/src
-publish.time.interval=5
-producer.count=2
-consumer.count=3

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
deleted file mode 100644
index 4ed6566..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.util;
-
-public interface ConfigKeys {
-
-	String CONFIG_FILE_NAME = "configurations.properties";
-
-	String BROKER_EVENTING_SERVICE_EPR = "broker.eventing.service.epr";
-	String BROKER_NOTIFICATIONS_SERVICE_EPR = "broker.notification.service.epr";
-
-	String CONSUMER_EPR = "consumer.location";
-	String CONSUMER_PORT_OFFSET = "consumer.port";
-	String TOPIC_SIMPLE = "topic.simple";
-	String TOPIC_XPATH = "topic.xpath";
-	String AXIS2_REPO = "axis2.repo";
-	String PUBLISH_TIME_INTERVAL = "publish.time.interval";
-	String PRODUCER_COUNT = "producer.count";
-	String CONSUMER_COUNT = "consumer.count";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/Consumer.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
deleted file mode 100644
index 9462a8b..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.util.Properties;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class Consumer extends Thread {
-
-	class NotificationMsgReciever implements ConsumerNotificationHandler {
-
-		private BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
-
-		public void handleNotification(SOAPEnvelope msgEnvelope) {
-
-			queue.add(msgEnvelope);
-		}
-
-		public BlockingQueue<SOAPEnvelope> getQueue() {
-			return queue;
-		}
-
-	}
-
-	private Properties configurations;
-	private int consumerPort;
-
-	public Consumer(String consumerName, int port, Properties config) {
-		super(consumerName);
-		consumerPort = port;
-		configurations = config;
-	}
-
-	public void run() {
-
-		String brokerLocation = configurations
-				.getProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR);
-		String xpathExpression = configurations
-				.getProperty(ConfigKeys.TOPIC_XPATH);
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-
-		System.out.println("subscribing with xpath expression: "
-				+ xpathExpression);
-
-		NotificationMsgReciever msgReciever = new NotificationMsgReciever();
-
-		String[] consumerEprs = null;
-
-		String subscriptionId = null;
-
-		try {
-			consumerEprs = client.startConsumerService(consumerPort,
-					msgReciever);
-
-		} catch (MsgBrokerClientException e) {
-
-			e.printStackTrace();
-
-			System.out.println("unable to start consumer service, exiting");
-			return;
-		}
-
-		try {
-
-			subscriptionId = client.subscribe(consumerEprs[0], null,
-					xpathExpression);
-			System.out.println(getName() + "got the subscription id :"
-					+ subscriptionId);
-
-		} catch (MsgBrokerClientException e) {
-
-			e.printStackTrace();
-
-			System.out
-					.println("unable to subscribe for the xpath consumer exiting");
-			return;
-		}
-
-		try {
-
-			do {
-
-				SOAPEnvelope env = msgReciever.getQueue().take();
-
-				String msg;
-				try {
-					msg = env.getBody().getFirstElement().toStringWithConsume();
-					System.out.println(String.format(
-							"consumer [%s] recieved: %s", getName(), msg));
-
-				} catch (Exception e) {
-					System.err.print("invalid msg recieved");
-				}
-
-			} while (true);
-
-		} catch (InterruptedException ie) {
-
-			try {
-				// unsubscribe from the topic.
-				client.unSubscribe(subscriptionId);
-			} catch (MsgBrokerClientException e) {
-
-				e.printStackTrace();
-				System.out.println("unable to unsubscribe, ignoring");
-			}
-
-			// shutdown the consumer service.
-			client.shutdownConsumerService();
-
-			System.out.println("interrupted");
-
-		}
-
-	}
-
-}


[66/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
new file mode 100644
index 0000000..d67caad
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/ChangeCredentialWindow.java
@@ -0,0 +1,204 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.amazon;
+
+import com.amazonaws.auth.AWSCredentials;
+import com.amazonaws.auth.BasicAWSCredentials;
+import com.amazonaws.services.ec2.AmazonEC2Client;
+import org.apache.airavata.gfac.ec2.EC2Provider;
+import org.apache.airavata.gfac.ec2.util.EC2ProviderUtil;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.io.File;
+import java.io.IOException;
+import java.security.NoSuchAlgorithmException;
+import java.security.spec.InvalidKeySpecException;
+
+public class ChangeCredentialWindow {
+    private XBayaEngine engine;
+    private XBayaDialog dialog;
+    private XBayaTextField accessKeyIDTextField;
+    private XBayaTextField secretAccessKeyTextField;
+
+    private JDialog owner;
+
+    /**
+     * Constructs a ChangeCredentialWindow.
+     *
+     * @param engine XBayaEngine
+     */
+    public ChangeCredentialWindow(XBayaEngine engine) {
+        this.engine = engine;
+        initGUI();
+    }
+
+    public ChangeCredentialWindow(JDialog owner) {
+        this.owner = owner;
+        initGUI();
+    }
+
+    protected void initGUI() {
+        this.accessKeyIDTextField = new XBayaTextField();
+        XBayaLabel accessKeyIDLabel = new XBayaLabel("Access Key", this.accessKeyIDTextField);
+
+        this.secretAccessKeyTextField = new XBayaTextField();
+        XBayaLabel secretAccessKeyLabel = new XBayaLabel("Secret Key", this.secretAccessKeyTextField);
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(accessKeyIDLabel);
+        infoPanel.add(this.accessKeyIDTextField);
+        infoPanel.add(secretAccessKeyLabel);
+        infoPanel.add(this.secretAccessKeyTextField);
+
+        infoPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);
+
+        GridPanel mainPanel = new GridPanel();
+        mainPanel.add(infoPanel);
+        mainPanel.layout(1, 1, GridPanel.WEIGHT_EQUALLY, GridPanel.WEIGHT_EQUALLY);
+
+        JButton okButton = new JButton("Ok");
+        okButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                String accessID = ChangeCredentialWindow.this.accessKeyIDTextField.getText();
+                if (!"".equals(accessID)) {
+                    String secretID = ChangeCredentialWindow.this.secretAccessKeyTextField.getText();
+
+                    if (!"".equals(secretID)) {
+                        AmazonCredential.getInstance().setAwsAccessKeyId(accessID);
+                        AmazonCredential.getInstance().setAwsSecretAccessKey(secretID);
+                        hide();
+                        return;
+                    }
+                }
+
+                JOptionPane.showMessageDialog(dialog.getDialog(),"SecretKey and AccessKey can not be empty!");
+            }
+
+        });
+
+        JButton generateButton = new JButton("Generate Key Pair");
+        generateButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                String accessID = ChangeCredentialWindow.this.accessKeyIDTextField.getText();
+                if (!"".equals(accessID)) {
+                    String secretID = ChangeCredentialWindow.this.secretAccessKeyTextField.getText();
+
+                    if (!"".equals(secretID)) {
+                        AmazonCredential.getInstance().setAwsAccessKeyId(accessID);
+                        AmazonCredential.getInstance().setAwsSecretAccessKey(secretID);
+
+                        File file = new File(System.getProperty("user.home") + "/.ssh/" + EC2Provider.KEY_PAIR_NAME);
+
+                        if (file.exists()) {
+                            ChangeCredentialWindow.this.engine.getGUI().getErrorWindow().
+                                    info(ChangeCredentialWindow.this.dialog.getDialog(),
+                                    "Warning", "The file " + file.getAbsolutePath() + " exists.");
+
+                        } else {
+                            AWSCredentials credential =
+                                    new BasicAWSCredentials(accessID, secretID);
+                            AmazonEC2Client ec2client = new AmazonEC2Client(credential);
+
+                            try {
+                                EC2ProviderUtil.buildKeyPair(ec2client, EC2Provider.KEY_PAIR_NAME);
+                            } catch (NoSuchAlgorithmException e1) {
+                                ChangeCredentialWindow.this.engine.getGUI().getErrorWindow().
+                                        info(ChangeCredentialWindow.this.dialog.getDialog(),
+                                        "Warning", e1.getMessage());
+                            } catch (InvalidKeySpecException e1) {
+                                ChangeCredentialWindow.this.engine.getGUI().getErrorWindow().
+                                        info(ChangeCredentialWindow.this.dialog.getDialog(),
+                                        "Warning", e1.getMessage());
+                            } catch (IOException e1) {
+                                ChangeCredentialWindow.this.engine.getGUI().getErrorWindow().
+                                        info(ChangeCredentialWindow.this.dialog.getDialog(),
+                                        "Warning", e1.getMessage());
+                            }
+
+                            JOptionPane.showMessageDialog(dialog.getDialog(),"The key " +
+                                    file.getAbsolutePath() + " generated.");
+                        }
+
+                        hide();
+                        return;
+                    }
+                }
+
+                JOptionPane.showMessageDialog(dialog.getDialog(),"SecretKey and AccessKey can not be empty!");
+            }
+
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(generateButton);
+        buttonPanel.add(cancelButton);
+
+        if (this.owner == null) {
+            this.dialog = new XBayaDialog(this.engine.getGUI(), "Security Credentials", mainPanel, buttonPanel);
+        } else {
+            this.dialog = new XBayaDialog(this.owner, "Security Credentials", mainPanel, buttonPanel);
+        }
+    }
+
+    /**
+     * hide the dialog (when user clicked on cancel)
+     */
+    public void hide() {
+        this.dialog.hide();
+    }
+
+    /**
+     * show the dialog
+     */
+    public void show() {
+        if (!"".equals(AmazonCredential.getInstance().getAwsAccessKeyId())) {
+            ChangeCredentialWindow.this.accessKeyIDTextField
+                    .setText(AmazonCredential.getInstance().getAwsAccessKeyId());
+        }
+        if (!"".equals(AmazonCredential.getInstance().getAwsSecretAccessKey())) {
+            ChangeCredentialWindow.this.secretAccessKeyTextField.setText(AmazonCredential.getInstance()
+                    .getAwsSecretAccessKey());
+        }
+        this.dialog.show();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2InstancesManagementWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2InstancesManagementWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2InstancesManagementWindow.java
new file mode 100644
index 0000000..de40180
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2InstancesManagementWindow.java
@@ -0,0 +1,183 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.amazon;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
+import org.apache.airavata.xbaya.core.amazon.EC2InstanceResult;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XbayaEnhancedList;
+import org.apache.airavata.xbaya.util.AmazonUtil;
+
+import javax.swing.*;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+import java.awt.*;
+import java.awt.event.ActionEvent;
+import java.util.ArrayList;
+import java.util.List;
+
+public class EC2InstancesManagementWindow {
+    private XBayaEngine engine;
+    private XBayaDialog dialog;
+    private XbayaEnhancedList<EC2InstanceResult> list;
+    private ChangeCredentialWindow credentialWindow;
+
+    /**
+     * Constructs a EC2InstancesManagementWindow.
+     * 
+     * @param engine XBayaEngine
+     */
+    public EC2InstancesManagementWindow(XBayaEngine engine) {
+        this.engine = engine;
+        initGUI();
+    }
+
+    public void show() {
+        this.dialog.show();
+    }
+
+    public void hide() {
+        this.dialog.hide();
+    }
+
+    private void initGUI() {
+        this.list = new XbayaEnhancedList<EC2InstanceResult>();
+
+        GridPanel mainPanel = new GridPanel();
+        TitledBorder border = new TitledBorder(new EtchedBorder(), "My Instances");
+        mainPanel.getSwingComponent().setBorder(border);
+        mainPanel.add(this.list);
+        mainPanel.layout(1, 1, 0, 0);
+
+        /* Connect/Refresh Button */
+        JButton refreshButton = new JButton("Refresh");
+        refreshButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+
+                /* Check if Credential is already set or not */
+                if (credentialSet()) {
+                    InstancesLoader instancesLoader = new InstancesLoader(EC2InstancesManagementWindow.this.engine,
+                            EC2InstancesManagementWindow.this.dialog.getDialog());
+                    instancesLoader.load(EC2InstancesManagementWindow.this.list);
+                }
+            }
+        });
+
+        /* Launch Instance Button */
+        JButton launchButton = new JButton("Launch");
+        launchButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (credentialSet()) {
+                    EC2LaunchWindow ec2LaunchWindow = new EC2LaunchWindow(EC2InstancesManagementWindow.this.engine);
+                    ec2LaunchWindow.show();
+                }
+            }
+        });
+
+        /* Terminate Instance */
+        JButton terminateButton = new JButton("Terminate");
+        terminateButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                List<EC2InstanceResult> selected = EC2InstancesManagementWindow.this.list.getSelectedValues();
+
+                if (selected.size() == 0) {
+                    EC2InstancesManagementWindow.this.engine.getGUI().getErrorWindow().info(
+                            EC2InstancesManagementWindow.this.dialog.getDialog(), "Warning", "No instances selected");
+                    return;
+                }
+
+                String text = "";
+                List<String> requestIds = new ArrayList<String>();
+
+                for (EC2InstanceResult ec2InstancesResult : selected) {
+                    requestIds.add(ec2InstancesResult.getInstance().getInstanceId());
+                    text += ec2InstancesResult.getInstance().getInstanceId() + ",";
+                }
+
+                // confirm from user
+                int n = JOptionPane.showConfirmDialog(EC2InstancesManagementWindow.this.dialog.getDialog(),
+                        "Are you want to terminate instances:\n" + text, "Terminate Instances",
+                        JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE);
+
+                if (n == JOptionPane.YES_OPTION) {
+                    // terminate
+                    AmazonUtil.terminateInstances(requestIds);
+
+                    // reload
+                    InstancesLoader instancesLoader = new InstancesLoader(EC2InstancesManagementWindow.this.engine,
+                            EC2InstancesManagementWindow.this.dialog.getDialog());
+                    instancesLoader.load(EC2InstancesManagementWindow.this.list);
+                }
+            }
+        });
+
+        /* Close Button */
+        JButton closeButton = new JButton("Close");
+        closeButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                EC2InstancesManagementWindow.this.hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(refreshButton);
+        buttonPanel.add(launchButton);
+        buttonPanel.add(terminateButton);
+        buttonPanel.add(closeButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Amazon EC2 Management Console", mainPanel, buttonPanel);
+        int width = 800;
+        int height = 500;
+        this.dialog.getDialog().setPreferredSize(new Dimension(width, height));
+        this.dialog.setDefaultButton(closeButton);
+
+    }
+
+    private boolean credentialSet() {
+        if (AmazonCredential.getInstance().getAwsAccessKeyId().isEmpty()
+                || AmazonCredential.getInstance().getAwsSecretAccessKey().isEmpty()) {
+            EC2InstancesManagementWindow.this.engine.getGUI().getErrorWindow().warning(
+                    EC2InstancesManagementWindow.this.dialog.getDialog(), "Error", "Aws Access Key not set!");
+
+            if (this.credentialWindow == null) {
+                this.credentialWindow = new ChangeCredentialWindow(EC2InstancesManagementWindow.this.dialog.getDialog());
+            }
+            try {
+                this.credentialWindow.show();
+                return false;
+            } catch (Exception e1) {
+                EC2InstancesManagementWindow.this.engine.getGUI().getErrorWindow().error(e1);
+            }
+        }
+        return true;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2LaunchWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2LaunchWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2LaunchWindow.java
new file mode 100644
index 0000000..a62be69
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/EC2LaunchWindow.java
@@ -0,0 +1,181 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.amazon;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaComboBox;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.airavata.xbaya.util.AmazonUtil;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+public class EC2LaunchWindow {
+    private XBayaEngine engine;
+    private XBayaDialog dialog;
+    private XBayaTextField amiTextField;
+    private JSpinner numberOfInstanceSpinner;
+    private XBayaComboBox instanceTypeComboBox;
+    private XBayaComboBox keyComboBox;
+    private JRadioButton existKeyButton;
+    private ComboBoxModel keyComboBoxModel;
+
+    /**
+     * Constructs a EC2LaunchWindow.
+     * 
+     * @param engine XBayaEngine
+     */
+    public EC2LaunchWindow(XBayaEngine engine) {
+        this.engine = engine;
+        initGUI();
+    }
+
+    private void initGUI() {
+        /* Main Panel */
+        this.amiTextField = new XBayaTextField();
+        XBayaLabel amiLabel = new XBayaLabel("AMI ID", this.amiTextField);
+
+        this.numberOfInstanceSpinner = new JSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
+        XBayaLabel nInstanceLabel = new XBayaLabel("Number Of Instances", this.numberOfInstanceSpinner);
+
+        this.instanceTypeComboBox = new XBayaComboBox(new DefaultComboBoxModel(AmazonUtil.INSTANCE_TYPE));
+        this.instanceTypeComboBox.setSelectedItem(AmazonUtil.INSTANCE_TYPE[1]);
+        XBayaLabel instanceTypeLabel = new XBayaLabel("Instance Type", this.instanceTypeComboBox);
+
+        JRadioButton noKeyButton = new JRadioButton("No Key Pair");
+        noKeyButton.setSelected(true);
+        noKeyButton.addActionListener(new ActionListener() {
+            @Override
+            public void actionPerformed(ActionEvent paramActionEvent) {
+                EC2LaunchWindow.this.keyComboBox.getJComboBox().setEnabled(false);
+            }
+        });
+
+        this.existKeyButton = new JRadioButton("Exist Key Pairs");
+        this.existKeyButton.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent paramActionEvent) {
+                if (EC2LaunchWindow.this.keyComboBoxModel == null) {
+                    EC2LaunchWindow.this.keyComboBoxModel = new DefaultComboBoxModel(AmazonUtil.loadKeypairs()
+                            .toArray());
+                    EC2LaunchWindow.this.keyComboBox.setModel(EC2LaunchWindow.this.keyComboBoxModel);
+                }
+                EC2LaunchWindow.this.keyComboBox.getJComboBox().setEnabled(true);
+            }
+        });
+
+        ButtonGroup serviceTypeButtonGroup = new ButtonGroup();
+        serviceTypeButtonGroup.add(noKeyButton);
+        serviceTypeButtonGroup.add(this.existKeyButton);
+
+        this.keyComboBox = new XBayaComboBox(new DefaultComboBoxModel());
+        this.keyComboBox.getJComboBox().setEnabled(false);
+
+        GridPanel radioPanel = new GridPanel();
+        radioPanel.add(noKeyButton);
+        radioPanel.add(new JPanel());
+        radioPanel.add(this.existKeyButton);
+        radioPanel.add(this.keyComboBox);
+        radioPanel.layout(2, 2, 0, 1);
+
+        XBayaLabel keyLabel = new XBayaLabel("Key Pair", radioPanel);
+
+        GridPanel mainPanel = new GridPanel(true);
+        mainPanel.add(amiLabel);
+        mainPanel.add(this.amiTextField);
+        mainPanel.add(nInstanceLabel);
+        mainPanel.add(this.numberOfInstanceSpinner);
+        mainPanel.add(instanceTypeLabel);
+        mainPanel.add(this.instanceTypeComboBox);
+        mainPanel.add(keyLabel);
+        mainPanel.add(radioPanel);
+        mainPanel.layout(4, 2, 0, GridPanel.WEIGHT_EQUALLY);
+
+        /* Button Panel */
+        JButton lunchButton = new JButton("Launch");
+        lunchButton.addActionListener(new AbstractAction() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                // validation
+                if (EC2LaunchWindow.this.amiTextField.getText() == null
+                        || EC2LaunchWindow.this.amiTextField.getText().isEmpty()
+                        || (Integer) EC2LaunchWindow.this.numberOfInstanceSpinner.getValue() <= 0) {
+                    EC2LaunchWindow.this.engine.getGUI().getErrorWindow().info(EC2LaunchWindow.this.dialog.getDialog(),
+                            "Warning", "Please input all fields");
+                    return;
+                }
+
+                try {
+                    // get all data
+                    String ami = EC2LaunchWindow.this.amiTextField.getText();
+                    String instanceType = EC2LaunchWindow.this.instanceTypeComboBox.getText();
+                    Integer n = (Integer) EC2LaunchWindow.this.numberOfInstanceSpinner.getValue();
+
+                    // use exist key pair
+                    if (EC2LaunchWindow.this.existKeyButton.isSelected()) {
+                        String keyname = EC2LaunchWindow.this.keyComboBox.getText();
+                        AmazonUtil.launchInstance(ami, instanceType, n, keyname);
+                    } else {
+                        AmazonUtil.launchInstance(ami, instanceType, n);
+                    }
+
+                    EC2LaunchWindow.this.hide();
+
+                } catch (NumberFormatException nfe) {
+                    EC2LaunchWindow.this.engine.getGUI().getErrorWindow().info(EC2LaunchWindow.this.dialog.getDialog(),
+                            "Warning", "Number of Instances is not numeric");
+                } catch (Exception ex) {
+                    EC2LaunchWindow.this.engine.getGUI().getErrorWindow().error(EC2LaunchWindow.this.dialog.getDialog(),
+                            "Cannot start EC2 instances: " + ex.getMessage(), ex);
+                }
+            }
+        });
+
+        JButton closeButton = new JButton("Close");
+        closeButton.addActionListener(new AbstractAction() {
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                EC2LaunchWindow.this.hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(lunchButton);
+        buttonPanel.add(closeButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Amazon EC2 Launcher", mainPanel, buttonPanel);
+    }
+
+    public void hide() {
+        this.dialog.hide();
+    }
+
+    public void show() {
+        this.dialog.show();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java
new file mode 100644
index 0000000..72ffd84
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/InstancesLoader.java
@@ -0,0 +1,105 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.amazon;
+
+import com.amazonaws.AmazonClientException;
+import com.amazonaws.AmazonServiceException;
+import com.amazonaws.services.ec2.model.Instance;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.core.amazon.EC2InstanceResult;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+import org.apache.airavata.xbaya.ui.widgets.XbayaEnhancedList;
+import org.apache.airavata.xbaya.util.AmazonUtil;
+
+import javax.swing.*;
+import java.util.ArrayList;
+import java.util.List;
+
+public class InstancesLoader implements Cancelable {
+    private XBayaEngine engine;
+    private JDialog parent;
+
+    private boolean canceled;
+
+    private WaitDialog loadingDialog;
+
+    /**
+     * Constructs a InstancesLoader.
+     * 
+     * @param engine XBayaEngine
+     * @param parent JDialog
+     */
+    public InstancesLoader(XBayaEngine engine, JDialog parent) {
+        this.engine = engine;
+        this.parent = parent;
+        this.loadingDialog = new WaitDialog(this, "Loading EC2 Instances.", "Loading EC2 Instances.\n"
+                + "Please wait for a moment.", this.engine.getGUI());
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
+     */
+    @Override
+    public void cancel() {
+        this.canceled = true;
+    }
+
+    /**
+     * Load instance list.
+     *
+     * @param list instance list
+     */
+    public void load(final XbayaEnhancedList<EC2InstanceResult> list) {
+
+        new Thread(new Runnable() {
+
+            @Override
+            public void run() {
+                try {
+
+                    List<EC2InstanceResult> tmpList = new ArrayList<EC2InstanceResult>();
+
+                    List<Instance> instances = AmazonUtil.loadInstances();
+                    for (Instance instance : instances) {
+                        tmpList.add(new EC2InstanceResult(instance));
+                    }
+
+                    if (!InstancesLoader.this.canceled) {
+                        list.setListData(tmpList);
+                    }
+
+                } catch (AmazonServiceException ex) {
+                    InstancesLoader.this.engine.getGUI().getErrorWindow().error(InstancesLoader.this.parent,
+                            "Cannot load EC2 instances", ex);
+                } catch (AmazonClientException ex) {
+                    InstancesLoader.this.engine.getGUI().getErrorWindow().error(InstancesLoader.this.parent,
+                            "Cannot load EC2 instances", ex);
+                } finally {
+                    InstancesLoader.this.loadingDialog.hide();
+                }
+            }
+        }).start();
+
+        this.loadingDialog.show();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java
new file mode 100644
index 0000000..acbdfd5
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Downloader.java
@@ -0,0 +1,137 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.amazon;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+import org.jets3t.service.S3Service;
+import org.jets3t.service.model.S3Object;
+
+import javax.swing.*;
+import java.io.*;
+
+public class S3Downloader implements Cancelable {
+
+    private XBayaEngine engine;
+    private JDialog parent;
+
+    private boolean canceled;
+
+    private WaitDialog loadingDialog;
+
+    /**
+     * Constructs a S3Downloader.
+     * 
+     * @param engine XBayaEngine
+     * @param parent JDialog
+     */
+    public S3Downloader(XBayaEngine engine, JDialog parent) {
+        this.engine = engine;
+        this.parent = parent;
+        this.loadingDialog = new WaitDialog(this, "Downloading file from S3.", "Downloading file from S3.\n"
+                + "Please wait for a moment.", this.engine.getGUI());
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
+     */
+    @Override
+    public void cancel() {
+        this.canceled = true;
+    }
+
+    /**
+     * Download bucket.
+     *
+     * @param s3 S3Service
+     * @param bucket bucket
+     * @param key Key
+     * @param directory directory
+     */
+    public void download(final S3Service s3, final String bucket, final String key, final String directory) {
+
+        new Thread(new Runnable() {
+
+            @Override
+            public void run() {
+
+                BufferedWriter out = null;
+                BufferedReader in = null;
+                try {
+                    S3Object s3Object = s3.getObject(bucket, key);
+
+                    File fileOut = new File(directory + File.separator + s3Object.getKey());
+                    if (!fileOut.getParentFile().exists()) {
+                        fileOut.getParentFile().mkdirs();
+                    }
+                    if (!fileOut.exists()) {
+                        fileOut.createNewFile();
+                    }
+
+                    out = new BufferedWriter(new FileWriter(fileOut));
+                    in = new BufferedReader(new InputStreamReader(s3Object.getDataInputStream()));
+                    String data = null;
+                    while ((data = in.readLine()) != null) {
+
+                        // stop download and delete file
+                        if (S3Downloader.this.canceled) {
+                            out.close();
+                            fileOut.delete();
+                            return;
+                        }
+
+                        out.write(data);
+                        out.newLine();
+                    }
+
+                    S3Downloader.this.engine.getGUI().getErrorWindow().info(S3Downloader.this.parent, "",
+                            "Downloaded successfully!");
+                } catch (Exception ex) {
+                    S3Downloader.this.engine.getGUI().getErrorWindow().error(S3Downloader.this.parent,
+                            "Download failed! Please ensure every fields are filled correctly", ex);
+                } finally {
+                    if (in != null) {
+                        try {
+                            in.close();
+                        } catch (IOException io) {
+                            // do nothing
+                        }
+                    }
+                    if (out != null) {
+                        try {
+                            out.close();
+                        } catch (IOException io) {
+                            // do nothing
+                        }
+                    }
+
+                    // close loading dialog
+                    S3Downloader.this.loadingDialog.hide();
+                }
+            }
+
+        }).start();
+
+        this.loadingDialog.show();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java
new file mode 100644
index 0000000..5178ce3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/amazon/S3Uploader.java
@@ -0,0 +1,127 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.amazon;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+import org.apache.airavata.xbaya.ui.widgets.amazon.S3Tree;
+import org.jets3t.service.S3Service;
+import org.jets3t.service.model.S3Object;
+
+import javax.swing.*;
+import java.io.File;
+
+public class S3Uploader implements Cancelable {
+    private XBayaEngine engine;
+    private JDialog parent;
+
+    private boolean canceled;
+
+    private WaitDialog loadingDialog;
+
+    /**
+     * Constructs a S3Uploader.
+     * 
+     * @param engine XBayaEngine
+     * @param parent JDialog
+     */
+    public S3Uploader(XBayaEngine engine, JDialog parent) {
+        this.engine = engine;
+        this.parent = parent;
+        this.loadingDialog = new WaitDialog(this, "Uploading file to S3.", "Uploading file to S3.\n"
+                + "Please wait for a moment.", this.engine.getGUI());
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
+     */
+    @Override
+    public void cancel() {
+        this.canceled = true;
+    }
+
+    /**
+     * Upload bucket.
+     *
+     * @param s3 S3Service
+     * @param s3tree S3Tree
+     * @param bucket bucket
+     * @param filePath file path
+     */
+    public void upload(final S3Service s3, final S3Tree s3tree, final String bucket, final String filePath) {
+
+        new Thread(new Runnable() {
+
+            @Override
+            public void run() {
+
+                int index;
+                index = filePath.lastIndexOf('/');
+                String fileName;
+                if (index == -1) {
+                    index = filePath.lastIndexOf('\\');
+                }
+                fileName = filePath.substring(index + 1, filePath.length());
+                try {
+                    S3Object s3Object = new S3Object(new File(filePath));
+                    s3.putObject(bucket, s3Object);
+
+                    /*
+                     * We cannot cancel during upload, so delete file instead
+                     */
+                    if (S3Uploader.this.canceled) {
+                        s3.deleteObject(bucket, s3Object.getKey());
+                    } else {
+
+                        S3Uploader.this.engine.getGUI().getErrorWindow().info(S3Uploader.this.parent, "",
+                                "Uploaded successfully!");
+
+                        // add key to S3Tree
+                        int startIndex = bucket.lastIndexOf('/');
+                        startIndex = startIndex >= 0 ? startIndex : 0;
+                        if (startIndex != 0) {
+                            fileName = bucket.substring(startIndex) + '/' + fileName;
+                        }
+
+                        if (fileName.startsWith("/")) {
+                            fileName = fileName.substring(1, fileName.length());
+                        }
+
+                        s3tree.addObject(bucket, fileName);
+                    }
+
+                } catch (Exception ex) {
+                    S3Uploader.this.engine.getGUI().getErrorWindow().error(S3Uploader.this.parent,
+                            "Upload failed! Please ensure every fields are filled correctly", ex);
+                } finally {
+                    // close loading dialog
+                    S3Uploader.this.loadingDialog.hide();
+                }
+            }
+
+        }).start();
+
+        this.loadingDialog.show();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/URLRegistryWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/URLRegistryWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/URLRegistryWindow.java
new file mode 100644
index 0000000..7aac6e3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/URLRegistryWindow.java
@@ -0,0 +1,132 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.component;
+
+import java.awt.event.ActionEvent;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.apache.airavata.workflow.model.component.url.URLComponentRegistry;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.airavata.xbaya.util.RegistryConstants;
+
+/**
+ * 
+ * Adds components to the component browser through a URL (eg: add service from a WSDL) 
+ *
+ */
+public class URLRegistryWindow {
+
+    private XBayaEngine engine;
+
+    private ComponentRegistryLoader loader;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField urlTextField;
+
+    /**
+     * @param engine
+     */
+    public URLRegistryWindow(XBayaEngine engine) {
+        this.engine = engine;
+        this.loader = ComponentRegistryLoader.getLoader(this.engine, RegistryConstants.REGISTRY_TYPE_URL);
+        initGUI();
+    }
+
+    /**
+     * Displays the dialog.
+     */
+    public void show() {
+        this.dialog.show();
+    }
+
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void ok() {
+        String urlString = this.urlTextField.getText();
+
+        if (urlString.length() == 0) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_EMPTY);
+            return;
+        }
+        URI url;
+        try {
+            url = new URI(urlString);
+        } catch (URISyntaxException e) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_WRONG, e);
+            return;
+        }
+
+        URLComponentRegistry registry = new URLComponentRegistry(url);
+
+        hide();
+
+        this.loader.load(registry);
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGUI() {
+        this.urlTextField = new XBayaTextField();
+        XBayaLabel urlLabel = new XBayaLabel("URL", this.urlTextField);
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(urlLabel);
+        infoPanel.add(this.urlTextField);
+        infoPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                ok();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Web Registry", infoPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/WebResigtryWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/WebResigtryWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/WebResigtryWindow.java
new file mode 100644
index 0000000..aae1652
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/component/WebResigtryWindow.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.component;
+
+import java.awt.event.ActionEvent;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.apache.airavata.workflow.model.component.web.WebComponentRegistry;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.airavata.xbaya.util.RegistryConstants;
+
+public class WebResigtryWindow {
+
+    private XBayaEngine engine;
+
+    private ComponentRegistryLoader loader;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField urlTextField;
+
+    /**
+     * @param engine
+     */
+    public WebResigtryWindow(XBayaEngine engine) {
+        this.engine = engine;
+        this.loader = ComponentRegistryLoader.getLoader(this.engine, RegistryConstants.REGISTRY_TYPE_WEB);
+        initGUI();
+    }
+
+    /**
+     * Displays the dialog.
+     */
+    public void show() {
+        if (this.urlTextField.getText().length() == 0) {
+            this.urlTextField.setText(XBayaConstants.DEFAULT_WEB_REGISTRY.toString());
+        }
+        this.dialog.show();
+    }
+
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void ok() {
+        String urlString = this.urlTextField.getText();
+
+        if (urlString.length() == 0) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_EMPTY);
+            return;
+        }
+        URL url;
+        try {
+            url = new URL(urlString);
+        } catch (MalformedURLException e) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_WRONG, e);
+            return;
+        }
+
+        WebComponentRegistry registry = new WebComponentRegistry(url);
+
+        hide();
+
+        this.loader.load(registry);
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGUI() {
+        this.urlTextField = new XBayaTextField();
+        XBayaLabel urlLabel = new XBayaLabel("URL", this.urlTextField);
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(urlLabel);
+        infoPanel.add(this.urlTextField);
+        infoPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                ok();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Web Registry", infoPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
new file mode 100644
index 0000000..fe72516
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/ApplicationDescriptionAdvancedOptionDialog.java
@@ -0,0 +1,358 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.descriptors;
+
+import java.awt.Font;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JScrollPane;
+import javax.swing.JSeparator;
+import javax.swing.JTable;
+import javax.swing.ListSelectionModel;
+import javax.swing.SwingConstants;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableModel;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
+import org.apache.airavata.schemas.gfac.NameValuePairType;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class ApplicationDescriptionAdvancedOptionDialog extends JDialog {
+    private static final long serialVersionUID = 3920479739097405014L;
+    private XBayaTextField txtInputDir;
+    private XBayaTextField txtOutputDir;
+    private XBayaTextField txtSTDIN;
+    private XBayaTextField txtSTDOUT;
+    private XBayaTextField txtSTDERR;
+    private JTable tblEnv;
+    private ApplicationDescription shellApplicationDescription;
+    private DefaultTableModel defaultTableModel;
+    private boolean tableModelChanging = false;
+    private JButton btnDeleteVariable;
+    private JButton okButton;
+    private AiravataAPI registry;
+	private XBayaTextField txtWorkingDir;
+
+    /**
+     * Launch the application.
+     */
+    public static void main(String[] args) {
+        try {
+            ApplicationDescriptionAdvancedOptionDialog dialog = new ApplicationDescriptionAdvancedOptionDialog(null,
+                    null);
+            dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+            dialog.setVisible(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Create the dialog.
+     */
+    public ApplicationDescriptionAdvancedOptionDialog(AiravataAPI registry, ApplicationDescription descriptor) {
+        addWindowListener(new WindowAdapter() {
+            @Override
+            public void windowOpened(WindowEvent arg0) {
+                loadApplicationDescriptionAdvancedOptions();
+            }
+        });
+        setRegistry(registry);
+        setShellApplicationDescription(descriptor);
+        initGUI();
+    }
+
+    public void open() {
+        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+        setVisible(true);
+    }
+
+    protected ApplicationDescriptionAdvancedOptionDialog getDialog() {
+        return this;
+    }
+
+    public void close() {
+        getDialog().setVisible(false);
+    }
+
+    @SuppressWarnings("serial")
+	private void initGUI() {
+        setTitle("Application Description Advance Options");
+        setModal(true);
+        setBounds(100, 100, 600, 400);
+        setLocationRelativeTo(null);
+        GridPanel buttonPane = new GridPanel();
+        okButton = new JButton("Update");
+        okButton.setActionCommand("OK");
+        okButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                saveApplicationDescriptionAdvancedOptions();
+                close();
+            }
+        });
+        getRootPane().setDefaultButton(okButton);
+    
+    
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.setActionCommand("Cancel");
+        cancelButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                close();
+            }
+        });
+            
+        
+        
+    	GridPanel panel = new GridPanel();
+        
+        txtInputDir = new XBayaTextField();
+        
+        XBayaLabel lblInputDirectory = new XBayaLabel("Input directory",txtInputDir);
+
+        JLabel lblLocations = new JLabel("Locations");
+        lblLocations.setFont(new Font("Tahoma", Font.BOLD, 11));
+
+        txtOutputDir = new XBayaTextField();
+        XBayaLabel lblOutputDirectory = new XBayaLabel("Output directory",txtOutputDir);
+
+        txtWorkingDir = new XBayaTextField();
+        XBayaLabel lblWorkingDir = new XBayaLabel("Static Working directory",txtWorkingDir);
+        
+        JLabel lblProgramData = new JLabel("Program data");
+        lblProgramData.setFont(new Font("Tahoma", Font.BOLD, 11));
+
+
+        txtSTDIN = new XBayaTextField();
+        XBayaLabel lblStdin = new XBayaLabel("STDIN",txtSTDIN);
+
+
+        txtSTDOUT = new XBayaTextField();
+        XBayaLabel lblStdout = new XBayaLabel("STDOUT",txtSTDOUT);
+
+
+        txtSTDERR = new XBayaTextField();
+        XBayaLabel lblStderr = new XBayaLabel("STDERR",txtSTDERR);
+
+        JLabel other = new JLabel("Other");
+        other.setFont(new Font("Tahoma", Font.BOLD, 11));
+
+        JSeparator separator_1 = new JSeparator();
+        separator_1.setOrientation(SwingConstants.VERTICAL);
+
+        JLabel lblEnvironmentalVariables = new JLabel("Environmental Variables");
+        lblEnvironmentalVariables.setFont(new Font("Tahoma", Font.BOLD, 11));
+
+        JScrollPane scrollPane = new JScrollPane();
+
+        btnDeleteVariable = new JButton("Delete variable");
+        btnDeleteVariable.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                deleteSelectedRows();
+            }
+        });
+        btnDeleteVariable.setEnabled(false);
+        tblEnv = new JTable();
+        tblEnv.setFillsViewportHeight(true);
+        scrollPane.setViewportView(tblEnv);
+        tblEnv.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
+        defaultTableModel = new DefaultTableModel(new Object[][] { { null, null }, }, new String[] { "Name",
+                "Value" }) {
+            @SuppressWarnings("rawtypes")
+			Class[] columnTypes = new Class[] { String.class, String.class };
+
+            @SuppressWarnings({ "rawtypes", "unchecked" })
+			public Class getColumnClass(int columnIndex) {
+                return columnTypes[columnIndex];
+            }
+        };
+        tblEnv.setModel(defaultTableModel);
+        defaultTableModel.addTableModelListener(new TableModelListener() {
+            public void tableChanged(TableModelEvent arg0) {
+                if (!tableModelChanging) {
+                    addNewRowIfLastIsNotEmpty();
+                }
+            }
+
+        });
+        tblEnv.getColumnModel().getColumn(0).setPreferredWidth(67);
+        tblEnv.getColumnModel().getColumn(1).setPreferredWidth(158);
+        ListSelectionModel selectionModel = tblEnv.getSelectionModel();
+        selectionModel.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
+
+        selectionModel.addListSelectionListener(new ListSelectionListener() {
+            public void valueChanged(ListSelectionEvent e) {
+                btnDeleteVariable.setEnabled(tblEnv.getSelectedRows().length > 0);
+            }
+
+        });
+        
+        GridPanel leftPanel = new GridPanel();
+        leftPanel.add(lblLocations);
+        leftPanel.add(new JLabel());
+        leftPanel.add(lblInputDirectory);
+        leftPanel.add(txtInputDir);
+        leftPanel.add(lblOutputDirectory);
+        leftPanel.add(txtOutputDir);
+        leftPanel.add(lblWorkingDir);
+        leftPanel.add(txtWorkingDir);
+        leftPanel.add(lblProgramData);
+        
+        leftPanel.add(new JLabel());
+        leftPanel.add(lblStdin);
+        leftPanel.add(txtSTDIN);
+        leftPanel.add(lblStdout);
+        leftPanel.add(txtSTDOUT);
+        leftPanel.add(lblStderr);
+        leftPanel.add(txtSTDERR);
+        
+        SwingUtil.layoutToGrid(leftPanel.getSwingComponent(), 8, 2, SwingUtil.WEIGHT_NONE, 1);
+        
+        GridPanel rightPanel = new GridPanel();
+        rightPanel.add(lblEnvironmentalVariables);
+        rightPanel.add(scrollPane);
+        rightPanel.add(btnDeleteVariable);
+        rightPanel.getSwingComponent().setSize(150, -1);
+        leftPanel.getSwingComponent().setSize(150, -1);
+        SwingUtil.layoutToGrid(rightPanel.getSwingComponent(), 3, 1, 1, 0);
+        
+        GridPanel p=new GridPanel();
+        p.add(leftPanel);
+        p.add(new JSeparator(JSeparator.VERTICAL));
+        p.layout(1,2, 0,0);
+        panel.add(p);
+        panel.add(rightPanel);
+        panel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+
+        SwingUtil.layoutToGrid(panel.getSwingComponent(), 1, 2, SwingUtil.WEIGHT_NONE, SwingUtil.WEIGHT_EQUALLY);
+        
+        buttonPane.add(okButton);
+        buttonPane.add(cancelButton);
+        buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+
+        getContentPane().add(panel.getSwingComponent());
+        getContentPane().add(buttonPane.getSwingComponent());
+        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
+        setResizable(true);
+        getRootPane().setDefaultButton(okButton);
+    }
+
+    private void deleteSelectedRows() {
+        // TODO confirm deletion of selected rows
+        int selectedRow = tblEnv.getSelectedRow();
+        while (selectedRow >= 0) {
+            defaultTableModel.removeRow(selectedRow);
+            selectedRow = tblEnv.getSelectedRow();
+        }
+        addNewRowIfLastIsNotEmpty();
+    }
+
+    public ApplicationDescription getApplicationDescription() {
+        return shellApplicationDescription;
+    }
+
+    public ApplicationDeploymentDescriptionType getShellApplicationDescriptionType() {
+        return (ApplicationDeploymentDescriptionType)shellApplicationDescription.getType();
+    }
+    
+    public void setShellApplicationDescription(ApplicationDescription shellApplicationDescription) {
+        this.shellApplicationDescription = shellApplicationDescription;
+    }
+
+    private void addNewRowIfLastIsNotEmpty() {
+        Object varName = null;
+        if (defaultTableModel.getRowCount() > 0) {
+            varName = defaultTableModel.getValueAt(defaultTableModel.getRowCount() - 1, 0);
+        }
+        if (defaultTableModel.getRowCount() == 0 || (varName != null && !varName.equals(""))) {
+            defaultTableModel.addRow(new Object[] { null, null });
+        }
+    }
+
+    private void saveApplicationDescriptionAdvancedOptions() {
+    	getShellApplicationDescriptionType().setInputDataDirectory(txtInputDir.getText());
+    	getShellApplicationDescriptionType().setOutputDataDirectory(txtOutputDir.getText());
+    	getShellApplicationDescriptionType().setStaticWorkingDirectory(txtWorkingDir.getText());
+    	getShellApplicationDescriptionType().setStandardInput(txtSTDIN.getText());
+    	getShellApplicationDescriptionType().setStandardOutput(txtSTDOUT.getText());
+    	getShellApplicationDescriptionType().setStandardError(txtSTDERR.getText());
+    	
+    	while(getShellApplicationDescriptionType().getApplicationEnvironmentArray().length>0){
+    		getShellApplicationDescriptionType().removeApplicationEnvironment(0);
+    	}
+    	for (int i = 0; i < defaultTableModel.getRowCount(); i++) {
+            String parameterName = (String) defaultTableModel.getValueAt(i, 0);
+            String paramValue = (String) defaultTableModel.getValueAt(i, 1);
+            if (parameterName != null && !parameterName.trim().equals("")) {
+            	NameValuePairType envType = getShellApplicationDescriptionType().addNewApplicationEnvironment();
+        		envType.setName(parameterName);
+                envType.setValue(paramValue);
+            }
+        }
+    }
+
+    private void loadApplicationDescriptionAdvancedOptions() {
+        txtInputDir.setText(getShellApplicationDescriptionType().getInputDataDirectory());
+        txtOutputDir.setText(getShellApplicationDescriptionType().getOutputDataDirectory());
+        txtWorkingDir.setText(getShellApplicationDescriptionType().getStaticWorkingDirectory());
+        txtSTDIN.setText(getShellApplicationDescriptionType().getStandardInput());
+        txtSTDOUT.setText(getShellApplicationDescriptionType().getStandardOutput());
+        txtSTDERR.setText(getShellApplicationDescriptionType().getStandardError());
+        tableModelChanging = true;
+        while(defaultTableModel.getRowCount()>0){
+    		defaultTableModel.removeRow(0);
+    	}
+        NameValuePairType[] envParams = getShellApplicationDescriptionType().getApplicationEnvironmentArray();
+    	for (NameValuePairType envParam : envParams) {
+    		defaultTableModel.addRow(new Object[] { envParam.getName(),envParam.getValue()});
+		}
+    	addNewRowIfLastIsNotEmpty();
+        tableModelChanging = false;
+    }
+
+
+
+    public AiravataAPI getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+
+
+}


[73/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/NodeParameter.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/NodeParameter.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/NodeParameter.java
new file mode 100644
index 0000000..acaa398
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/NodeParameter.java
@@ -0,0 +1,60 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.schemas.gfac.Parameter;
+
+
+public class NodeParameter {
+	private Parameter parameter;
+	private Object value;
+	
+	public NodeParameter(Parameter parameter) {
+		this(parameter,null);
+	}
+	
+	public NodeParameter(Parameter parameter, Object value) {
+		setParameter(parameter);
+		setValue(value);
+	}
+	public Parameter getParameter() {
+		return parameter;
+	}
+	public void setParameter(Parameter parameter) {
+		this.parameter = parameter;
+	}
+	public Object getValue() {
+		return value;
+	}
+	public void setValue(Object value) {
+		this.value = value;
+	}
+	
+	public String getName(){
+		return getParameter().getParameterName();
+	}
+	
+	public String getDescription(){
+		return getParameter().getParameterDescription();
+	}
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/OutputParameters.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/OutputParameters.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/OutputParameters.java
new file mode 100644
index 0000000..f3067e5
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/OutputParameters.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import org.apache.airavata.schemas.gfac.Parameter;
+
+public class OutputParameters extends ServiceParameters {
+
+	public OutputParameters(NodeParameter[] parameters) {
+		super(parameters);
+	}
+	
+	public OutputParameters(Parameter[] parameters) {
+		super(parameters);
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceDescriptions.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceDescriptions.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceDescriptions.java
new file mode 100644
index 0000000..dcef41f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceDescriptions.java
@@ -0,0 +1,50 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import java.util.List;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class ServiceDescriptions {
+    private AiravataAPI airavataAPI;
+
+    public ServiceDescriptions(AiravataAPI airavataAPI) {
+        setAiravataAPI(airavataAPI);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public List<ServiceDescription> getDescriptions() throws RegistryException, AiravataAPIInvocationException {
+        return getAiravataAPI().getApplicationManager().getAllServiceDescriptions();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceParameters.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceParameters.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceParameters.java
new file mode 100644
index 0000000..a3ea981
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceParameters.java
@@ -0,0 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.apache.airavata.schemas.gfac.Parameter;
+
+public class ServiceParameters {
+	private List<NodeParameter> parameters;
+	
+	public ServiceParameters(Parameter[] parameters) {
+		if (parameters!=null) {
+			List<NodeParameter> serviceParaList = new ArrayList<NodeParameter>();
+			for (Parameter parameter : parameters) {
+				serviceParaList.add(new NodeParameter(parameter));
+			}
+			setParameters(serviceParaList);
+		}
+	}
+	
+	public ServiceParameters(NodeParameter[] parameters) {
+		if (parameters!=null) {
+			setParameters(Arrays.asList(parameters));
+		}
+	}
+	public List<NodeParameter> getParameters() {
+		if (parameters==null){
+			parameters=new ArrayList<NodeParameter>();
+		}
+		return parameters;
+	}
+	public void setParameters(List<NodeParameter> parameters) {
+		this.parameters = parameters;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflow.java
new file mode 100644
index 0000000..4b619b3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflow.java
@@ -0,0 +1,94 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException;
+import org.apache.airavata.registry.api.workflow.NodeExecutionData;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowExecutionData;
+
+public class XBayaWorkflow {
+	private List<XBayaWorkflowNodeElement> workflowServices;
+	private WorkflowExecution workflowInstance;
+	private AiravataAPI airavataAPI;
+	
+	public XBayaWorkflow(WorkflowExecution workflowInstance, AiravataAPI airavataAPI) {
+		setWorkflowInstance(workflowInstance);
+		setAiravataAPI(airavataAPI);
+	}
+
+	public List<XBayaWorkflowNodeElement> getWorkflowServices() {
+		if (workflowServices==null){
+			workflowServices=new ArrayList<XBayaWorkflowNodeElement>();
+			try {
+				WorkflowExecutionData workflowInstanceData = getAiravataAPI().getProvenanceManager().getWorkflowInstanceData(getWorkflowId(), getWorkflowId());
+				List<NodeExecutionData> nodeDataList = workflowInstanceData.getNodeDataList();
+				for (NodeExecutionData nodeData : nodeDataList) {
+					workflowServices.add(new XBayaWorkflowNodeElement(nodeData.getWorkflowInstanceNode().getNodeId(), nodeData));
+				}
+			} catch (AiravataAPIInvocationException e) {
+				e.printStackTrace();
+			} catch (ExperimentLazyLoadedException e) {
+                e.printStackTrace();
+            }
+        }
+		return workflowServices;
+	}
+
+	public void setWorkflowNodes(List<XBayaWorkflowNodeElement> workflowServices) {
+		this.workflowServices = workflowServices;
+	}
+	
+	public void add(XBayaWorkflowNodeElement workflowService){
+		getWorkflowServices().add(workflowService);
+	}
+
+	public String getWorkflowName() {
+		return getWorkflowInstance().getTemplateName();
+	}
+
+	public String getWorkflowId() {
+		return getWorkflowInstance().getWorkflowExecutionId();
+	}
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public WorkflowExecution getWorkflowInstance() {
+		return workflowInstance;
+	}
+
+	public void setWorkflowInstance(WorkflowExecution workflowInstance) {
+		this.workflowInstance = workflowInstance;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiment.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiment.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiment.java
new file mode 100644
index 0000000..04f6fae
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiment.java
@@ -0,0 +1,81 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+
+public class XBayaWorkflowExperiment {
+	private List<XBayaWorkflow> workflows;
+	private String experimentId;
+	private AiravataAPI airavataAPI;
+	
+	public XBayaWorkflowExperiment(String experimentId, AiravataAPI airavataAPI) {
+		setExperimentId(experimentId);
+		setAiravataAPI(airavataAPI);
+	}
+
+	public List<XBayaWorkflow> getWorkflows() {
+		if (workflows==null){
+			workflows=new ArrayList<XBayaWorkflow>();
+			try {
+				List<WorkflowExecution> experimentWorkflowInstances = getAiravataAPI().getProvenanceManager().getExperimentWorkflowInstances(getExperimentId());
+				for (WorkflowExecution workflowInstance : experimentWorkflowInstances) {
+					workflows.add(new XBayaWorkflow(workflowInstance, getAiravataAPI()));
+				}
+			}  catch (AiravataAPIInvocationException e) {
+                e.printStackTrace();
+            }
+        }
+		return workflows;
+	}
+
+	public void setWorkflows(List<XBayaWorkflow> workflows) {
+		this.workflows = workflows;
+	}
+	
+	public void add(XBayaWorkflow workflow){
+		getWorkflows().add(workflow);
+	}
+
+	public String getExperimentId() {
+		return experimentId;
+	}
+
+	public void setExperimentId(String experimentId) {
+		this.experimentId = experimentId;
+	}
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiments.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiments.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiments.java
new file mode 100644
index 0000000..555aaf2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiments.java
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class XBayaWorkflowExperiments {
+	private AiravataAPI airavataAPI;
+	
+	public XBayaWorkflowExperiments(AiravataAPI airavataAPI) {
+		setAiravataAPI(airavataAPI);
+	}
+	
+	public List<XBayaWorkflowExperiment> getAllExperiments(){
+		Map<String, XBayaWorkflowExperiment> experiments=new HashMap<String,XBayaWorkflowExperiment>();
+    	try {
+    		initializeExperimentMap(experiments);
+		} catch (AiravataAPIInvocationException e) {
+			e.printStackTrace();
+		}
+    	return Arrays.asList(experiments.values().toArray(new XBayaWorkflowExperiment[]{}));
+	}
+	
+	public void initializeExperimentMap(Map<String, XBayaWorkflowExperiment> experiments) throws AiravataAPIInvocationException {
+		List<String> experimentIdByUser = getAiravataAPI().getProvenanceManager().getExperimentIdList();
+		for (String id : experimentIdByUser) {
+			experiments.put(id, new XBayaWorkflowExperiment(id, getAiravataAPI()));
+		}
+	}
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowNodeElement.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowNodeElement.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowNodeElement.java
new file mode 100644
index 0000000..a3072e0
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowNodeElement.java
@@ -0,0 +1,107 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.airavata.registry.api.workflow.NodeExecutionData;
+import org.apache.airavata.registry.api.workflow.InputData;
+import org.apache.airavata.registry.api.workflow.OutputData;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
+import org.apache.airavata.schemas.gfac.Parameter;
+
+public class XBayaWorkflowNodeElement {
+	private InputParameters inputParameters;
+	private OutputParameters outputParameters;
+	private NodeExecutionData nodeData;
+	private String nodeId;
+	
+	public XBayaWorkflowNodeElement(String nodeId, NodeExecutionData nodeData) {
+		setNodeId(nodeId);
+		setNodeData(nodeData);
+	}
+
+	public OutputParameters getOutputParameters() {
+		if (outputParameters==null){
+			outputParameters=new OutputParameters((NodeParameter[])null);
+			outputParameters.getParameters().addAll(generateParameterListForOutput(nodeData.getOutputData()));
+		}
+		return outputParameters;
+	}
+
+	private List<NodeParameter> generateParameterListForInput(
+			List<InputData> list) {
+		List<NodeParameter> params=new ArrayList<NodeParameter>();
+		for (WorkflowInstanceNodePortData portData : list) {
+			Parameter parameter = Parameter.Factory.newInstance();
+			parameter.setParameterName(portData.getName());
+			NodeParameter serviceParameter = new NodeParameter(parameter, portData.getValue());
+			params.add(serviceParameter);
+		}
+		return params;
+	}
+	
+	private List<NodeParameter> generateParameterListForOutput(
+			List<OutputData> list) {
+		List<NodeParameter> params=new ArrayList<NodeParameter>();
+		for (WorkflowInstanceNodePortData portData : list) {
+			Parameter parameter = Parameter.Factory.newInstance();
+			parameter.setParameterName(portData.getName());
+			NodeParameter serviceParameter = new NodeParameter(parameter, portData.getValue());
+			params.add(serviceParameter);
+		}
+		return params;
+	}
+
+	public void setOutputParameters(OutputParameters outputParameters) {
+		this.outputParameters = outputParameters;
+	}
+
+	public InputParameters getInputParameters() {
+		if (inputParameters==null){
+			inputParameters=new InputParameters((NodeParameter[])null);
+			inputParameters.getParameters().addAll(generateParameterListForInput(nodeData.getInputData()));
+		}
+		return inputParameters;
+	}
+
+	public void setInputParameters(InputParameters inputParameters) {
+		this.inputParameters = inputParameters;
+	}
+
+	public String getNodeId() {
+		return nodeId;
+	}
+
+	public void setNodeId(String nodeId) {
+		this.nodeId = nodeId;
+	}
+
+	public NodeExecutionData getNodeData() {
+		return nodeData;
+	}
+
+	public void setNodeData(NodeExecutionData nodeData) {
+		this.nodeData = nodeData;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplate.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplate.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplate.java
new file mode 100644
index 0000000..63af7ac
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplate.java
@@ -0,0 +1,50 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+
+public class XBayaWorkflowTemplate {
+    private String workflowGraph;
+    private String workflowName;
+
+    public XBayaWorkflowTemplate(String workflowName, String workflowGraph) {
+        setWorkflowGraph(workflowGraph);
+        setWorkflowName(workflowName);
+    }
+
+    public String getWorkflowGraph() {
+        return workflowGraph;
+    }
+
+    public void setWorkflowGraph(String workflowGraph) {
+        this.workflowGraph = workflowGraph;
+    }
+
+	public String getWorkflowName() {
+		return workflowName;
+	}
+
+	public void setWorkflowName(String workflowName) {
+		this.workflowName = workflowName;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplates.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplates.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplates.java
new file mode 100644
index 0000000..318c3ac
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplates.java
@@ -0,0 +1,63 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.model.registrybrowser;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class XBayaWorkflowTemplates {
+    private AiravataAPI airavataAPI;
+
+    public XBayaWorkflowTemplates(AiravataAPI airavataAPI) {
+        setAiravataAPI(airavataAPI);
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public List<XBayaWorkflowTemplate> getWorkflows() {
+        List<XBayaWorkflowTemplate> workflows = new ArrayList<XBayaWorkflowTemplate>();
+        try {
+            List<Workflow> list = getAiravataAPI().getWorkflowManager().getWorkflows();
+
+            for (Workflow workflow : list){
+                String workflowAsString = getAiravataAPI().getWorkflowManager().getWorkflowAsString(workflow.getName());
+                workflows.add(new XBayaWorkflowTemplate(workflow.getName(), workflowAsString));
+            }
+		} catch (AiravataAPIInvocationException e) {
+			e.printStackTrace();
+		}
+        return workflows;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java
new file mode 100644
index 0000000..5a0746c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java
@@ -0,0 +1,260 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.modifier;
+
+import java.awt.Color;
+import java.awt.Point;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.airavata.common.exception.UtilsException;
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.workflow.model.component.system.InputComponent;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.impl.PortImpl;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.graph.ws.WSPort;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.ws.monitor.EventData;
+import org.apache.airavata.ws.monitor.EventDataRepository;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.ws.monitor.MonitorUtil;
+import org.apache.airavata.ws.monitor.MonitorUtil.EventType;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+import xsul.XmlConstants;
+import xsul5.wsdl.WsdlPortTypeOperation;
+
+public class WorkflowModifier {
+
+    private static final Logger logger = LoggerFactory.getLogger(WorkflowModifier.class);
+
+    private Workflow modifiedWorkflow;
+
+    private EventDataRepository eventData;
+
+    /**
+     * Constructs a WorkflowModifier.
+     * 
+     * @param modifiedWorkflow
+     * @param eventData
+     */
+    public WorkflowModifier(Workflow modifiedWorkflow, EventDataRepository eventData) {
+        this.modifiedWorkflow = modifiedWorkflow;
+        this.eventData = eventData;
+    }
+
+    /**
+     * @return The workflow that needs to be executed.
+     * @throws GraphException
+     * @throws MonitorException
+     */
+    public Workflow createDifference() throws GraphException, MonitorException {
+        WSGraph originalGraph = this.modifiedWorkflow.getGraph();
+        Workflow workflow = this.modifiedWorkflow.clone();
+        String name = workflow.getName();
+        name += " (diff)";
+        workflow.setName(name);
+        WSGraph graph = workflow.getGraph();
+
+        // Remove the finished node.
+        removeFinishedNodes(originalGraph, graph);
+
+        Set<WSPort> originalFromPorts = getFinalOutputPorts(originalGraph, graph);
+
+        // Create input nodes for unconnected input ports.
+        createInputNodes(graph, originalFromPorts);
+
+        // Set default values.
+        for (WSPort originalFromPort : originalFromPorts) {
+            // TODO handle the case that node is not WSNode.
+            Node originalFromNode = originalFromPort.getNode();
+            String fromNodeID = originalFromNode.getID();
+            String output;
+            if (originalFromNode instanceof InputNode) {
+                // notification that includes the input of the workflow.
+                output = getWorkflowInput(fromNodeID);
+            } else if (originalFromNode instanceof WSNode) {
+                // Retrieve input value from notification.
+                WSComponent component = ((WSNode) originalFromNode).getComponent();
+                String messageName = component.getOutputTypeName();
+                String parameterName = originalFromPort.getComponentPort().getName();
+                output = getOutput(fromNodeID, messageName, parameterName);
+            } else {
+                // This should not happen.
+                throw new WorkflowRuntimeException(originalFromNode.getClass().getName());
+            }
+            Port originalToPort = originalFromPort.getToPorts().get(0);
+            PortImpl toPort = graph.getPort(originalToPort.getID());
+            InputNode inputNode = (InputNode) toPort.getFromNode();
+            inputNode.setDefaultValue(output);
+        }
+
+        return workflow;
+    }
+
+    /**
+     * @param originalGraph
+     * @param graph
+     * @throws GraphException
+     */
+    private void removeFinishedNodes(WSGraph originalGraph, WSGraph graph) throws GraphException {
+        ArrayList<Node> finishedNodes = new ArrayList<Node>();
+        for (Node node : originalGraph.getNodes()) {
+            Color color = NodeController.getGUI(node).getBodyColor();
+            if (NodeState.FINISHED.color.equals(color)) {
+                finishedNodes.add(node);
+            }
+        }
+        for (Node finishedNode : finishedNodes) {
+            Node node = graph.getNode(finishedNode.getID());
+            graph.removeNode(node);
+        }
+    }
+
+    /**
+     * @param originalGraph
+     * @param graph
+     * @return The final output ports.
+     */
+    private Set<WSPort> getFinalOutputPorts(WSGraph originalGraph, WSGraph graph) {
+        Collection<Port> inputPorts = GraphUtil.getPorts(graph, Port.Kind.DATA_IN);
+        Set<WSPort> originalFromPorts = new HashSet<WSPort>();
+        for (Port inputPort : inputPorts) {
+            Port fromPort = inputPort.getFromPort();
+            if (fromPort == null) {
+                // This input port is not connected.
+                String inputPortID = inputPort.getID();
+                logger.debug("id: " + inputPortID);
+                Port originalInputPort = originalGraph.getPort(inputPortID);
+                // No duplicate in set.
+                Port originalFromPort = originalInputPort.getFromPort();
+                originalFromPorts.add((WSPort) originalFromPort);
+            }
+        }
+        return originalFromPorts;
+    }
+
+    /**
+     * @param graph
+     * @param originalFromPorts
+     * @throws GraphException
+     */
+    private void createInputNodes(WSGraph graph, Set<WSPort> originalFromPorts) throws GraphException {
+        InputComponent inputComponent = new InputComponent();
+        for (WSPort originalFromPort : originalFromPorts) {
+            InputNode inputNode = inputComponent.createNode(graph);
+            List<Port> originalToPorts = originalFromPort.getToPorts();
+            boolean first = true;
+            for (Port originalToPort : originalToPorts) {
+                String toPortID = originalToPort.getID();
+                Port toPort = graph.getPort(toPortID);
+                graph.addEdge(inputNode.getPort(), toPort);
+                if (first) {
+                    first = false;
+                    Point position = NodeController.getGUI(originalToPort).getPosition();
+                    Point inputNodePosition = new Point(0, position.y);
+                    inputNode.setPosition(inputNodePosition);
+                }
+            }
+        }
+    }
+
+    private String getWorkflowInput(String nodeID) throws MonitorException {
+        logger.debug("Node:" + nodeID);
+        List<EventData> events = this.eventData.getEvents();
+        for (EventData event : events) {
+            EventType type = event.getType();
+            // TODO change this to read from the notification from GPEL.
+            if (type != EventType.INVOKING_SERVICE) {
+                continue;
+            }
+            String id = event.getNodeID();
+            if (!"".equals(id)) {
+                continue;
+            }
+            // TODO null check
+            XmlElement eventElement = event.getEvent();
+            XmlElement result = eventElement.element(MonitorUtil.REQUEST);
+            XmlElement body = result.element(MonitorUtil.BODY);
+            XmlElement soapBody = body.element(XmlConstants.S_BODY);
+            WsdlPortTypeOperation wsdlPortTypeOperation;
+            try {
+                wsdlPortTypeOperation = WSDLUtil.getFirstOperation(this.modifiedWorkflow.getWorkflowWSDL());
+            } catch (UtilsException e) {
+                throw new MonitorException(e);
+            }
+            XmlElement part = soapBody.element(wsdlPortTypeOperation.getName());
+            XmlElement parameter = part.element(nodeID);
+            // TODO support complex type.
+            String value = parameter.requiredText();
+            return value;
+        }
+        // TODO
+        String message = "Couldn't find a notification of about the input with nodeID, " + nodeID;
+        throw new MonitorException(message);
+    }
+
+    private String getOutput(String nodeID, String messageName, String parameterName) throws MonitorException {
+        List<EventData> events = this.eventData.getEvents();
+        for (EventData event : events) {
+            // We need to find the notification that contains the output of the
+            // service invocation.
+            EventType type = event.getType();
+            if (!(type == EventType.SENDING_RESULT || type == EventType.RECEIVED_RESULT)) {
+                continue;
+            }
+            String id = event.getNodeID();
+            if (!nodeID.equals(id)) {
+                continue;
+            }
+            // TODO null check
+            XmlElement eventElement = event.getEvent();
+            XmlElement result = eventElement.element(MonitorUtil.RESULT);
+            XmlElement body = result.element(MonitorUtil.BODY);
+            XmlElement soapBody = body.element(XmlConstants.S_BODY);
+            XmlElement part = soapBody.element(messageName);
+            XmlElement parameter = part.element(parameterName);
+            // TODO support complex type.
+            String value = parameter.requiredText();
+            return value;
+        }
+        // TODO
+        String message = "Couldn't find a notification of the output from the service with nodeID, " + nodeID;
+        throw new MonitorException(message);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java
new file mode 100644
index 0000000..cf6ce0c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java
@@ -0,0 +1,64 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.provenance;
+
+import java.util.List;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.registry.api.workflow.ExperimentData;
+import org.apache.airavata.registry.api.workflow.NodeExecutionData;
+import org.apache.airavata.workflow.model.graph.Node;
+
+public class ProvenanceReader {
+
+    public String DEFAULT_LIBRARY_FOLDER_NAME = "provenance";
+
+    private String experimentId;
+
+    private AiravataAPI airavataAPI;
+
+    private Node node;
+
+    public ProvenanceReader(Node node,String experimentId,AiravataAPI airavataAPI) {
+       this.experimentId = experimentId;
+        this.airavataAPI = airavataAPI;
+        this.node = node;
+	}
+
+    public Object read() throws Exception {
+        try {
+            ExperimentData workflowExecution = airavataAPI.getProvenanceManager().getExperimentData(experimentId);
+            List<NodeExecutionData> nodeDataList = workflowExecution.getWorkflowExecutionDataList().get(0).getNodeDataList();
+            if (nodeDataList.size() == 0) {
+                return null;
+            }
+            for (NodeExecutionData data : nodeDataList) {
+                if (this.node.getID().equals(data.getWorkflowInstanceNode().getNodeId())) {
+                    return data.getOutputData().get(0).getValue();
+                }
+            }
+            return null;
+        } catch (Exception e) {
+            return null;
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
new file mode 100644
index 0000000..25401dc
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
@@ -0,0 +1,217 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.provenance;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.common.utils.XMLUtil;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.ForEachExecutableNode;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
+import org.apache.airavata.workflow.model.graph.system.ForEachNode;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.xbaya.concurrent.PredicatedExecutable;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.invoker.Invoker;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+import org.xmlpull.infoset.XmlElement;
+
+import xsul5.XmlConstants;
+
+/**
+ * @author Chathura Herath
+ */
+public final class ProvenanceWrite implements PredicatedExecutable {
+
+	private static final String PROVENANCE_DIR = "provenance";
+
+	private Node node;
+
+	private String workflowName;
+
+	private Map<Node, Invoker> invokerMap;
+
+    private String experimentId;
+
+    private AiravataAPI airavataAPI;
+
+	public ProvenanceWrite(Node node, String workflowName,
+                           Map<Node, Invoker> invokerMap, String experimentId,AiravataAPI airavataAPI) {
+		this.node = node;
+		this.workflowName = workflowName;
+		this.invokerMap = invokerMap;
+        this.experimentId = experimentId;
+        this.airavataAPI = airavataAPI;
+	}
+
+	public void run() {
+
+		try {
+			saveNodeOutputs(node, invokerMap, workflowName);
+		} catch (WorkflowException e) {
+			// do nothing its a failure but go on
+			e.printStackTrace();
+		}
+
+	}
+
+	public boolean isReady() {
+		return NodeController.isFinished(this.node) && invokerMap.get(node) != null;
+	}
+
+	private void saveNodeOutputs(Node node,
+			Map<Node, Invoker> invokerMap, String workflowName)
+			throws WorkflowException {
+
+		if (null != node && !(node instanceof InputNode)) {
+			XmlElement elem = XmlConstants.BUILDER.newFragment("previousdat");
+			XmlElement inputs = null;
+			if (node instanceof WSNode) {
+				String nodeID = node.getComponent().getName();
+				XmlElement nodeElement = elem.newElement("wsnode");
+				elem.addChild(nodeElement);
+				nodeElement.addChild(nodeID);
+				inputs = elem.newElement("inputs");
+				elem.addChild(inputs);
+
+				List<DataPort> portsToBeSaved = node.getInputPorts();
+				for (DataPort savePort : portsToBeSaved) {
+
+					String portID = savePort.getName();
+					XmlElement portElem = inputs.newElement(portID);
+					inputs.addChild(portElem);
+					Object portInput = XBayaUtil.findInputFromPort(
+                            savePort, invokerMap);
+					if (portInput instanceof org.xmlpull.v1.builder.XmlElement) {
+						portInput = XMLUtil
+								.xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) portInput);
+					}
+					portElem.addChild(portInput);
+
+				}
+
+			} else if (node instanceof EndForEachNode) {
+				// here we save the inputs for the entire foreach block
+				Node middleNode = node.getInputPort(0).getFromNode();
+				String nodeID = middleNode.getComponent().getName();
+				XmlElement nodeElement = elem.newElement("foreach");
+				elem.addChild(nodeElement);
+				nodeElement.addChild(nodeID);
+				inputs = elem.newElement("inputs");
+				elem.addChild(inputs);
+				XmlConstants.BUILDER.serializeToString(elem);
+				if (middleNode instanceof ForEachExecutableNode) {
+					List<DataPort> portsToBeSaved = middleNode.getInputPorts();
+					for (DataPort savePort : portsToBeSaved) {
+						// we will save all the inputs
+						// these are static inputs and
+						// input to the foreach node
+
+						if (savePort.getFromNode() instanceof ForEachNode) {
+							// this is the foreach node rest are simple
+							// inputs
+							Object value = XBayaUtil
+									.getInputsForForEachNode(
+											(ForEachNode) savePort
+													.getFromNode(),
+											new LinkedList<String>(),
+											invokerMap);
+							if (value instanceof org.xmlpull.v1.builder.XmlElement) {
+								value = XMLUtil
+										.xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) value);
+							}
+
+							XmlElement portElement = inputs.newElement(savePort
+									.getName());
+							inputs.addChild(portElement);
+							portElement.addChild(value);
+						} else {
+							String portID = savePort.getName();
+							XmlElement portElem = inputs.newElement(portID);
+							inputs.addChild(portElem);
+							Object portInput = XBayaUtil
+									.findInputFromPort(savePort, invokerMap);
+							if (portInput instanceof org.xmlpull.v1.builder.XmlElement) {
+								portInput = XMLUtil
+										.xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) portInput);
+							}
+
+							portElem.addChild(portInput);
+						}
+
+					}
+
+				} else {
+					// error but we will let it pass because it will be
+					// caught at higher level
+				}
+
+			}
+            if (inputs!=null) {
+				try {
+					this.airavataAPI.getProvenanceManager().setWorkflowInstanceNodeInput(new WorkflowInstanceNode(new WorkflowExecution(experimentId, experimentId), node.getID()), xsul5.XmlConstants.BUILDER.serializeToString(inputs));
+                } catch (AiravataAPIInvocationException e) {
+					throw new WorkflowException(e);
+				}
+				// deal with the outputs
+			}
+			XmlElement outputs = elem.newElement("outputs");
+			elem.addChild(outputs);
+
+			List<DataPort> outputPorts = node.getOutputPorts();
+			for (DataPort outputPort : outputPorts) {
+				String outputName = outputPort.getName();
+
+				XmlElement outputParamElement = outputs.newElement(outputName);
+				outputs.addChild(outputParamElement);
+				Object ouputParamValue = invokerMap.get(node).getOutput(
+						outputName);
+
+				if (ouputParamValue instanceof org.xmlpull.v1.builder.XmlElement) {
+					ouputParamValue = XMLUtil
+							.xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) ouputParamValue);
+				}
+
+				if (ouputParamValue != null) {
+					outputParamElement.addChild(ouputParamValue);
+				} else {
+					outputParamElement.addChild("null");
+				}
+			}
+            try {
+				this.airavataAPI.getProvenanceManager().setWorkflowInstanceNodeOutput(new WorkflowInstanceNode(new WorkflowExecution(experimentId,experimentId),node.getID()),xsul5.XmlConstants.BUILDER.serializeToString(outputs));
+            } catch (AiravataAPIInvocationException e) {
+				throw new WorkflowException(e);
+			}
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
new file mode 100644
index 0000000..de2d836
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
@@ -0,0 +1,135 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.provenance;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
+import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus;
+import org.apache.airavata.registry.api.workflow.WorkflowNodeType;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WorkflowNodeStatusUpdater {
+       private static Logger logger = LoggerFactory.getLogger(WorkflowNodeStatusUpdater.class);
+
+    private AiravataAPI airavataAPI;
+
+    public WorkflowNodeStatusUpdater(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public boolean workflowNodeStarted(String workflowInstanceID,String nodeID,String inputs,String workflowID){
+        try {
+            //todo we currently save only service nodes
+            WorkflowNodeType workflowNodeType = new WorkflowNodeType();
+            workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
+            WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowExecution(workflowInstanceID,workflowInstanceID), nodeID);
+			airavataAPI.getProvenanceManager().setWorkflowInstanceNodeInput(node, inputs);
+            airavataAPI.getProvenanceManager().setWorkflowNodeType(node, workflowNodeType);
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.STARTED);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+    public boolean workflowNodeFailed(String workflowInstanceID,String nodeID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.FAILED);
+            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(workflowInstanceID, workflowInstanceID, WorkflowExecutionStatus.State.FAILED);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+    public boolean workflowNodeFinished(String workflowInstanceID,String nodeID,String inputs,String workflowID){
+        try {
+        	WorkflowNodeType workflowNodeType = new WorkflowNodeType();
+            workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
+            WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowExecution(workflowInstanceID,workflowInstanceID), nodeID);
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeOutput(node, inputs);
+            airavataAPI.getProvenanceManager().setWorkflowNodeType(node,workflowNodeType);
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.FINISHED);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+    public boolean workflowNodeRunning(String workflowInstanceID,String nodeID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.RUNNING);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+     public boolean workflowNodePaused(String workflowInstanceID,String nodeID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.PAUSED);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+    public boolean workflowNodeStatusPending(String workflowInstanceID,String nodeID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.PENDING);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+       public boolean workflowNodeStatusActive(String workflowInstanceID,String nodeID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.ACTIVE);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+       public boolean workflowNodeStatusDone(String workflowInstanceID,String nodeID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.DONE);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowStatusUpdater.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowStatusUpdater.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowStatusUpdater.java
new file mode 100644
index 0000000..cc444b0
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowStatusUpdater.java
@@ -0,0 +1,103 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.provenance;
+
+import java.sql.Timestamp;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.registry.api.workflow.WorkflowExecution;
+import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WorkflowStatusUpdater {
+    private static Logger logger = LoggerFactory.getLogger(WorkflowStatusUpdater.class);
+
+    private AiravataAPI airavataAPI;
+
+    public WorkflowStatusUpdater(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+
+    public boolean workflowStarted(String experimentID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.STARTED);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+    public boolean workflowFailed(String experimentID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.FAILED);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+    public boolean workflowFinished(String experimentID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.FINISHED);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+    public boolean workflowRunning(String experimentID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.RUNNING);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+     public boolean workflowPaused(String experimentID){
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.PAUSED);
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error updating Wokflow Node status !!");
+            return false;
+        }
+        return true;
+    }
+
+    public boolean saveWorkflowData(String experimentID,String workflowInstanceID,String workflowTemplateID) {
+        Timestamp currentTime = new Timestamp((new java.util.Date()).getTime());
+        try {
+            airavataAPI.getProvenanceManager().setWorkflowInstanceTemplateName(workflowInstanceID, workflowTemplateID);
+            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(new WorkflowExecutionStatus(new WorkflowExecution(experimentID, workflowInstanceID), WorkflowExecutionStatus.State.STARTED,currentTime));
+        } catch (AiravataAPIInvocationException e) {
+            logger.error("Error saving Workflow Data !!");
+        }
+        return true;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/PasswordCallbackImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/PasswordCallbackImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/PasswordCallbackImpl.java
new file mode 100644
index 0000000..da83cb2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/PasswordCallbackImpl.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registry;
+
+import org.apache.airavata.registry.api.PasswordCallback;
+
+public class PasswordCallbackImpl implements PasswordCallback {
+    private String username;
+    private String password;
+
+    public PasswordCallbackImpl(String username, String password) {
+        this.username = username;
+        this.password = password;
+    }
+
+    @Override
+    public String getPassword(String username) {
+       return password;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
new file mode 100644
index 0000000..63c6948
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
@@ -0,0 +1,212 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registry;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.RepositoryException;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.apache.airavata.xbaya.ui.experiment.RegistryWorkflowPublisherWindow;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+import org.ietf.jgss.GSSCredential;
+import org.xmlpull.infoset.XmlElement;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class RegistryAccesser {
+
+    /**
+     * PUBLIC_ACTOR
+     */
+    public static final String PUBLIC_ACTOR = "public";
+
+    private XBayaEngine engine;
+
+    private GSSCredential gssCredential;
+
+    /**
+     * Constructs a RegistryAccesser.
+     * 
+     * @param engine
+     */
+    public RegistryAccesser(XBayaEngine engine) {
+        this.engine = engine;
+    }
+
+    private AiravataAPI connectToRegistry() {
+        return this.engine.getConfiguration().getAiravataAPI();
+    }
+
+    /**
+     * 
+     * @return
+     * @throws RepositoryException
+     */
+    public Map<String, String> getOGCEWorkflowTemplateList() throws AiravataAPIInvocationException {
+        AiravataAPI airavataAPI = connectToRegistry();
+        List<Workflow> workflows = airavataAPI.getWorkflowManager().getWorkflows();
+        Map<String, String> workflowMap = new HashMap<String, String>();
+        for(Workflow workflow : workflows){
+            workflowMap.put(workflow.getName(), airavataAPI.getWorkflowManager().getWorkflowAsString(workflow.getName()));
+        }
+        return workflowMap;
+    }
+
+    /**
+     * 
+     * @param workflowTemplateId
+     * @return
+     * @throws RepositoryException
+     * @throws GraphException
+     * @throws ComponentException
+     * @throws Exception
+     */
+    public Workflow getOGCEWorkflow(QName workflowTemplateId) throws RepositoryException, GraphException,
+            ComponentException, Exception {
+        AiravataAPI registry = connectToRegistry();
+        String xml = registry.getWorkflowManager().getWorkflowAsString(workflowTemplateId.getLocalPart());
+        XmlElement xwf = XMLUtil.stringToXmlElement(xml);
+        Workflow workflow = new Workflow(xwf);
+        return workflow;
+    }
+
+    /**
+     * Save workflow in to Registry
+     */
+    public boolean saveWorkflow() {
+        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
+            try {
+
+                Workflow workflow = this.engine.getGUI().getWorkflow();
+                JythonScript script = new JythonScript(workflow, this.engine.getConfiguration());
+
+                // Check if there is any errors in the workflow first.
+                ArrayList<String> warnings = new ArrayList<String>();
+                if (!script.validate(warnings)) {
+                    StringBuilder buf = new StringBuilder();
+                    for (String warning : warnings) {
+                        buf.append("- ");
+                        buf.append(warning);
+                        buf.append("\n");
+                    }
+                    this.engine.getGUI().getErrorWindow().warning(buf.toString());
+                    return false;
+                }
+                RegistryWorkflowPublisherWindow registryPublishingWindow = new RegistryWorkflowPublisherWindow(
+                        this.engine);
+                registryPublishingWindow.show();
+
+                String workflowId = workflow.getName();
+
+                workflowId = StringUtil.convertToJavaIdentifier(workflowId);
+
+                QName workflowQName = new QName(XBayaConstants.OGCE_WORKFLOW_NS, workflowId);
+
+                String workflowAsString = XMLUtil.xmlElementToString(workflow.toXML());
+                String owner = this.engine.getConfiguration().getRegistryUserName();
+
+                AiravataAPI registry = this.connectToRegistry();
+                if (registry.getWorkflowManager().isWorkflowExists(workflow.getName())){
+            		registry.getWorkflowManager().updateWorkflow(workflow.getName(), workflowAsString);
+            	}else{
+            		registry.getWorkflowManager().saveWorkflow(workflowAsString);
+            	}
+                if (registryPublishingWindow.isMakePublic()){
+                	
+                	registry.getWorkflowManager().publishWorkflow(workflow.getName());
+                }
+                registryPublishingWindow.hide();
+                return true;
+            } catch (Exception e) {
+                this.engine.getGUI().getErrorWindow().error(e.getMessage(), e);
+            }
+        }
+		return false;
+    }
+
+    /**
+     * 
+     * @param workflowTemplateId
+     * @throws RepositoryException
+     */
+    public void deleteOGCEWorkflow(QName workflowTemplateId) throws AiravataAPIInvocationException {
+        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
+            AiravataAPI registry = connectToRegistry();
+            registry.getWorkflowManager().removeWorkflow(workflowTemplateId.getLocalPart());
+        }
+    }
+
+    /**
+     * 
+     * @param qname
+     * @return
+     */
+    public Workflow getWorkflow(QName qname) throws AiravataAPIInvocationException {
+        AiravataAPI registry = connectToRegistry();
+        String xml = registry.getWorkflowManager().getWorkflowAsString(qname.getLocalPart());
+        Workflow workflow = null;
+        try {
+            XmlElement xwf = XMLUtil.stringToXmlElement(xml);
+            workflow = new Workflow(xwf);
+        } catch (GraphException e) {
+            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
+        } catch (ComponentException e) {
+            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
+        }
+        return workflow;
+    }
+
+    /**
+     * 
+     * @param name
+     * @return
+     * @throws RegistryException 
+     */
+    public Workflow getWorkflow(String name) throws AiravataAPIInvocationException {
+        return getWorkflow(new QName(XBayaConstants.LEAD_NS, name));
+    }
+
+    public void main() {
+
+        XBayaConfiguration config = new XBayaConfiguration();
+        config.setMyProxyServer("myproxy.teragrid.org");
+        config.setMyProxyUsername("USER");
+        config.setMyProxyPassphrase("PASSWORD");
+
+        new XBayaEngine(config);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
new file mode 100644
index 0000000..9203e01
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
@@ -0,0 +1,255 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JTree;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.DefaultTreeModel;
+import javax.swing.tree.TreeNode;
+import javax.swing.tree.TreePath;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+
+public abstract class AbstractAiravataTreeNode implements TreeNode {
+
+    private TreeNode parent;
+    private Color backgroundSelectionColor;
+    private DefaultTreeCellRenderer defaultCellRenderer = new DefaultTreeCellRenderer();
+    private List<TreeNode> children;
+
+    public AbstractAiravataTreeNode(TreeNode parent) {
+        setParent(parent);
+    }
+
+    protected XBayaEngine getXBayaEngine(){
+        TreeNode root=getRootNode();
+        if (root instanceof RegistryNode){
+            return ((RegistryNode)root).getEngine();
+        }
+        return null;
+    }
+
+    @SuppressWarnings("rawtypes")
+	@Override
+    public Enumeration children() {
+        this.children = listOfChildren();
+        Collections.enumeration(children);
+        return Collections.enumeration(children);
+    }
+
+    protected abstract List<TreeNode> getChildren();
+
+    private List<TreeNode> listOfChildren() {
+        children = (children == null) ? getChildren() : children;
+        return children;
+    }
+
+    @Override
+    public boolean getAllowsChildren() {
+        return listOfChildren().size() > 0;
+    }
+
+    @Override
+    public TreeNode getChildAt(int index) {
+        return listOfChildren().get(index);
+    }
+
+    @Override
+    public int getChildCount() {
+        return listOfChildren().size();
+    }
+
+    @Override
+    public int getIndex(TreeNode node) {
+        return listOfChildren().indexOf(node);
+    }
+
+    @Override
+    public TreeNode getParent() {
+        return parent;
+    }
+
+    @Override
+    public boolean isLeaf() {
+        return listOfChildren().size() == 0;
+    }
+
+    public void setParent(TreeNode parent) {
+        this.parent = parent;
+    }
+
+    public abstract String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus);
+
+    public abstract Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus);
+
+    public void setBackgroundSelectionColor(Color c) {
+        backgroundSelectionColor = c;
+    }
+
+    public Color getBackgroundSelectionColor() {
+        return backgroundSelectionColor;
+    }
+
+    public Component getNodeComponent(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return null;
+    }
+
+    public Component getNodeComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf,
+            int row, boolean hasFocus) {
+        Component nodeComponent = getNodeComponent(selected, expanded, leaf, hasFocus);
+        if (nodeComponent == null) {
+            nodeComponent = getDefaultCellRenderer().getTreeCellRendererComponent(tree, value, selected, expanded,
+                    leaf, row, hasFocus);
+            if (nodeComponent instanceof JLabel) {
+                JLabel lbl = (JLabel) nodeComponent;
+                lbl.setText(getCaption(selected, expanded, leaf, hasFocus));
+                lbl.setIcon(getIcon(selected, expanded, leaf, hasFocus));
+            }
+        }
+        return nodeComponent;
+    }
+
+    protected DefaultTreeCellRenderer getDefaultCellRenderer() {
+        return defaultCellRenderer;
+    }
+
+    protected List<TreeNode> getTreeNodeList(Object[] list, TreeNode parent) {
+        List<TreeNode> nodes = new ArrayList<TreeNode>();
+        for (Object o : list) {
+            nodes.add(AiravataTreeNodeFactory.getTreeNode(o, parent));
+        }
+        return nodes;
+    }
+
+    protected List<TreeNode> emptyList() {
+        return new ArrayList<TreeNode>();
+    }
+
+    public void refresh() {
+        this.children = null;
+    }
+
+    public abstract List<String> getSupportedActions();
+    
+	public String getDefaultAction() {
+		return null;
+	}
+
+    public boolean isActionSupported(AbstractBrowserActionItem action) {
+        return getSupportedActions().contains(action.getID());
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        return triggerAction(tree, action, false);
+    }
+
+    public boolean triggerAction(JTree tree, String action, boolean force) throws Exception {
+        if (action.equals(RefreshAction.ID)) {
+            refresh();
+            ((DefaultTreeModel) tree.getModel()).reload(this);
+            return true;
+        }
+        return false;
+    }
+
+    protected TreeNode getRootNode() {
+        TreeNode rootNode = this;
+        while (rootNode.getParent() != null) {
+            rootNode = rootNode.getParent();
+        }
+        return rootNode;
+    }
+
+    public AiravataAPI getRegistry() {
+        TreeNode rootNode = getRootNode();
+        if (rootNode instanceof RegistryNode) {
+            return ((RegistryNode) rootNode).getRegistry();
+        }
+        return null;
+    }
+
+    protected boolean askQuestion(String title, String question) {
+        return JOptionPane.showConfirmDialog(null, question, title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
+    }
+
+    protected void reloadTreeNode(JTree tree, TreeNode node) {
+        TreePath selectionPath = tree.getSelectionPath();
+        ((DefaultTreeModel) tree.getModel()).nodeChanged(node);
+        ((DefaultTreeModel) tree.getModel()).reload(node);
+        tree.expandPath(selectionPath);
+    }
+
+    public abstract String getActionCaption(AbstractBrowserActionItem action);
+
+    public abstract Icon getActionIcon(AbstractBrowserActionItem action);
+
+    public abstract String getActionDescription(AbstractBrowserActionItem action);
+    
+    protected String wrapAsHtml(String...data){
+    	String result="<html>";
+    	for (String item : data) {
+			result+=item;
+		}
+    	result+="</html>";
+    	return result;
+    }
+    
+    public String createHTMLUrlTaggedString(String value) {
+		String urledString = "";
+		int lastIndex=0,index=0;
+		while(index!=-1){
+			index=value.toLowerCase().indexOf("://",lastIndex);
+			if (index!=-1){
+				int beginIndex=value.lastIndexOf(" ",index);
+				urledString+=value.substring(lastIndex,beginIndex+1);
+				int endIndex=value.indexOf(" ",index);
+				if (beginIndex==-1){
+					beginIndex=0;
+				}else{
+					beginIndex++;
+				}
+				if (endIndex==-1){
+					endIndex=value.length();
+				}
+				String url=value.substring(beginIndex, endIndex);
+				urledString+="<a href='"+url+"'>"+url+"</a>";
+				lastIndex=endIndex;
+			}
+		}
+		urledString+=value.substring(lastIndex, value.length());
+		return urledString;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
new file mode 100644
index 0000000..6a3bf87
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
@@ -0,0 +1,94 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.AiravataConfigurations;
+import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURLs;
+import org.apache.airavata.xbaya.model.registrybrowser.GFacURLs;
+import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
+import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURLs;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+
+public class AiravataConfigurationsNode extends AbstractAiravataTreeNode {
+	private AiravataConfigurations airavataConfigurations;
+
+    public AiravataConfigurationsNode(AiravataConfigurations airavataConfigurations, TreeNode parent) {
+        super(parent);
+        setAiravataConfigurations(airavataConfigurations);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+    	List<Object> children=new ArrayList<Object>();
+//    	children.add(new GFacURLs(getRegistry()));
+    	children.add(new InterpreterServiceURLs(getRegistry()));
+    	children.add(new MessageBoxURLs(getRegistry()));
+    	children.add(new EventingServiceURLs(getRegistry()));
+        return getTreeNodeList(children.toArray(), this);
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return "Airavata Configuration";
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.AIRAVATA_CONFIG_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(RefreshAction.ID);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public AiravataConfigurations getAiravataConfigurations() {
+		return airavataConfigurations;
+	}
+
+	public void setAiravataConfigurations(AiravataConfigurations airavataConfigurations) {
+		this.airavataConfigurations = airavataConfigurations;
+	}
+}


[57/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
new file mode 100644
index 0000000..ab8f102
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/RunMenuItem.java
@@ -0,0 +1,412 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.menues;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.MenuEvent;
+import javax.swing.event.MenuListener;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.ws.monitor.MonitorConfiguration;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.ws.monitor.event.Event;
+import org.apache.airavata.ws.monitor.event.Event.Type;
+import org.apache.airavata.ws.monitor.event.EventListener;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
+import org.apache.airavata.xbaya.ui.dialogs.graph.dynamic.DynamicWorkflowRunnerWindow;
+import org.apache.airavata.xbaya.ui.dialogs.monitor.MonitorConfigurationWindow;
+import org.apache.airavata.xbaya.ui.experiment.WorkflowInterpreterLaunchWindow;
+import org.apache.airavata.xbaya.ui.monitor.MonitorStarter;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.ToolbarButton;
+import org.apache.airavata.xbaya.ui.widgets.XBayaToolBar;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class RunMenuItem  implements EventListener, XBayaExecutionModeListener{
+
+    private XBayaEngine engine;
+
+    private JMenu runMenu;
+    
+//    private JMenuItem launchDynamicWorkflowItem;
+
+    private JMenuItem launchXBayaInterpreterItem;
+
+    private JMenuItem configMonitorItem;
+
+    private JMenuItem resumeMonitoringItem;
+
+    private JMenuItem pauseMonitoringItem;
+
+    private JMenuItem resetMonitoringItem;
+
+    private static final Logger logger = LoggerFactory.getLogger(RunMenuItem.class);
+
+	private static final String EXECUTE_ACTIONS = "run_actions";
+	private static final String EXECUTE_MONITOR_ACTIONS = "monitor_actions";
+
+    private XBayaToolBar toolBar;
+
+	private ToolbarButton toolbarButtonRunWorkflow;
+
+	private ToolbarButton toolbarButtonPauseMonitor;
+
+	private ToolbarButton toolbarButtonResumeMonitor;
+
+	private JMenuItem stopWorkflowItem;
+
+	private ToolbarButton toolbarButtonStopWorkflow;
+    
+    /**
+     * Constructs a WorkflowMenu.
+     * 
+     * @param engine
+     */
+    public RunMenuItem(XBayaEngine engine, XBayaToolBar toolBar) {
+        this.engine = engine;
+        setToolBar(toolBar);
+        createWorkflowMenu();
+        Monitor monitor = this.engine.getMonitor();
+        monitor.addEventListener(this);
+        monitor.getConfiguration().addEventListener(this);
+        engine.getConfiguration().registerExecutionModeChangeListener(this);
+        XBayaToolBar.setGroupOrder(EXECUTE_ACTIONS, 5);
+        XBayaToolBar.setGroupOrder(EXECUTE_MONITOR_ACTIONS, 6);
+    }
+
+    /**
+     * @return The workflow menu.
+     */
+    public JMenu getMenu() {
+        return this.runMenu;
+    }
+
+    /**
+     * Creates workflow menu.
+     */
+    private void createWorkflowMenu() {
+//        this.launchDynamicWorkflowItem = createLaunchDynamicWorkflowItem();
+        createLaunchXBayaInterpreterItem();
+        this.configMonitorItem = createConfigMonitoring();
+        this.resumeMonitoringItem = createResumeMonitoring();
+        this.pauseMonitoringItem = createPauseMonitoring();
+        this.resetMonitoringItem = createResetMonitoring();
+        stopWorkflowItem = createStopWorkflow();
+        
+        runMenu = new JMenu("Run");
+        runMenu.setMnemonic(KeyEvent.VK_R);
+
+        runMenu.add(launchXBayaInterpreterItem);
+//        runMenu.add(launchDynamicWorkflowItem);
+        
+        runMenu.addSeparator();
+        runMenu.add(stopWorkflowItem);
+
+        runMenu.addSeparator();
+        
+        runMenu.add(this.resumeMonitoringItem);
+        runMenu.add(this.pauseMonitoringItem);
+        runMenu.add(this.resetMonitoringItem);
+        runMenu.add(this.configMonitorItem);
+        
+        runMenu.addMenuListener(new MenuListener(){
+			@Override
+			public void menuCanceled(MenuEvent e) {}
+			@Override
+			public void menuDeselected(MenuEvent e) {}
+			@Override
+			public void menuSelected(MenuEvent e) {
+				stopWorkflowItem.setEnabled(isWorkflowRunning());
+			}
+        });
+        
+        setupMonitors();
+        startStopButtonStateUpdater();
+        executionModeChanged(engine.getConfiguration());
+    }
+
+	private void setupMonitors() {
+		SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+            	while(engine.getGUI()==null){
+            		Thread.yield();
+            	}
+                engine.getGUI().addWorkflowTabChangeListener(new ChangeListener(){
+					@Override
+					public void stateChanged(ChangeEvent event) {
+						boolean runShouldBeActive = isRunShouldBeActive();
+						toolbarButtonRunWorkflow.setEnabled(runShouldBeActive);	
+//						launchDynamicWorkflowItem.setEnabled(runShouldBeActive);
+						launchXBayaInterpreterItem.setEnabled(runShouldBeActive);
+					}
+                });
+            }
+        });
+	}
+    
+    private JMenuItem createConfigMonitoring() {
+        JMenuItem item = new JMenuItem("Configure Monitoring...");
+        item.setMnemonic(KeyEvent.VK_C);
+        item.addActionListener(new AbstractAction() {
+            private MonitorConfigurationWindow window;
+
+            public void actionPerformed(ActionEvent e) {
+                if (this.window == null) {
+                    this.window = new MonitorConfigurationWindow(engine);
+                }
+                this.window.show();
+            }
+        });
+        return item;
+    }
+
+    private JMenuItem createResumeMonitoring() {
+        JMenuItem item = new JMenuItem("Resume monitoring",MenuIcons.MONITOR_RESUME_ICON);
+        item.setMnemonic(KeyEvent.VK_S);
+        AbstractAction action = new AbstractAction() {
+            private MonitorStarter starter;
+
+            public void actionPerformed(ActionEvent event) {
+                if (this.starter == null) {
+                    this.starter = new MonitorStarter(engine);
+                }
+                this.starter.start();
+            }
+        };
+		item.addActionListener(action);
+        boolean valid = this.engine.getMonitor().getConfiguration().isValid();
+        item.setVisible(valid);
+        toolbarButtonResumeMonitor = getToolBar().addToolbarButton(EXECUTE_MONITOR_ACTIONS,item.getText(), MenuIcons.MONITOR_RESUME_ICON, "Resume monitoring", action,4);
+        toolbarButtonResumeMonitor.setEnabled(false);
+        return item;
+    }
+
+    private JMenuItem createPauseMonitoring() {
+        JMenuItem item = new JMenuItem("Pause monitoring", MenuIcons.MONITOR_PAUSE_ICON);
+        item.setMnemonic(KeyEvent.VK_T);
+        AbstractAction action = new AbstractAction() {
+            public void actionPerformed(ActionEvent event) {
+                try {
+                    engine.getMonitor().stopMonitoring();
+                } catch (RuntimeException e) {
+                    engine.getGUI().getErrorWindow().error(ErrorMessages.MONITOR_ERROR, e);
+                } catch (Error e) {
+                    engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                }
+            }
+        };
+		item.addActionListener(action);
+        item.setVisible(false);
+        toolbarButtonPauseMonitor = getToolBar().addToolbarButton(EXECUTE_MONITOR_ACTIONS,item.getText(), MenuIcons.MONITOR_PAUSE_ICON, "Pause monitoring", action,3);
+        toolbarButtonPauseMonitor.setEnabled(false);
+        return item;
+    }
+
+    private JMenuItem createResetMonitoring() {
+        JMenuItem item = new JMenuItem("Reset monitoring");
+        item.setMnemonic(KeyEvent.VK_R);
+        item.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent event) {
+                engine.getMonitor().resetEventData();
+            }
+        });
+        item.setVisible(false);
+        return item;
+    }
+
+    private JMenuItem createStopWorkflow() {
+        JMenuItem item = new JMenuItem("Stop running workflow",MenuIcons.STOP_ICON);
+        item.setMnemonic(KeyEvent.VK_S);
+        AbstractAction action = new AbstractAction() {
+            public void actionPerformed(ActionEvent event) {
+                cleanup();
+            }
+        };
+		item.addActionListener(action);
+        item.setEnabled(false);
+        toolbarButtonStopWorkflow = getToolBar().addToolbarButton(EXECUTE_ACTIONS,item.getText(), MenuIcons.STOP_ICON, "Stop workflow", action,2);
+        toolbarButtonStopWorkflow.setEnabled(item.isEnabled());
+        return item;
+    }
+
+    private JMenuItem createLaunchDynamicWorkflowItem() {
+        JMenuItem menuItem = new JMenuItem("Run workflow...");
+        menuItem.setMnemonic(KeyEvent.VK_D);
+        AbstractAction action = new AbstractAction() {
+            private DynamicWorkflowRunnerWindow window;
+
+            public void actionPerformed(ActionEvent event) {
+            	if (isWorkflowRunning()){
+            		if (JOptionPane.showConfirmDialog(null, "A previous workflow excution data needs to be cleared before launching another workflow. Do you wish to continue?", "Run Dynamic Workflow", JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
+            			cleanup();
+                    }else{
+            			return;
+            		}
+            	}
+                if (this.window == null) {
+                    int count = 0;
+                    //there is a possibility the ealier run is not yet cleanedup yet.. so wait until it finishes
+                    // and sets the execution state to NONE as the last task of scheduleDynamically
+                    while(engine.getGUI().getWorkflow().getExecutionState() != WorkflowExecutionState.NONE){
+                        try {
+                            Thread.sleep(500);
+                        } catch (InterruptedException e) {
+                            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                        }
+                        count++;
+                        if(count > 20){
+                            throw new WorkflowRuntimeException("Error stopping previous workflow Execution");
+                        }
+                    }
+                    
+                }
+                this.window = new DynamicWorkflowRunnerWindow(engine);
+                this.window.show();
+            }
+        };
+		menuItem.addActionListener(action);
+		menuItem.setEnabled(false);
+        return menuItem;
+    }
+    
+    private boolean isRunShouldBeActive() {
+		return engine.getGUI().getGraphCanvas() !=null;
+	}
+    
+    private void createLaunchXBayaInterpreterItem() {
+        this.launchXBayaInterpreterItem = new JMenuItem("Run on Interpreter Server...", MenuIcons.RUN_ICON);
+        AbstractAction action = new AbstractAction() {
+            private WorkflowInterpreterLaunchWindow window;
+            public void actionPerformed(ActionEvent e) {
+                if(!engine.getMonitor().hasCurrentExecutionTerminatedNotificationReceived() && engine.getMonitor().isMonitoring()){
+                    if (JOptionPane.showConfirmDialog(null,
+                            "A previous workflow execution data needs to be cleared before launching another workflow. Do you wish to continue?",
+                            "Run Workflow", JOptionPane.YES_NO_OPTION)!=JOptionPane.YES_OPTION){
+                        return;
+                    }
+                }
+//                if (this.window == null) {
+                this.window = new WorkflowInterpreterLaunchWindow(engine);
+//                }
+                try {
+                    this.window.show();
+                } catch (Exception e1) {
+                    engine.getGUI().getErrorWindow().error(e1);
+                }
+            }
+        };
+        launchXBayaInterpreterItem.addActionListener(action);
+        toolbarButtonRunWorkflow = getToolBar().addToolbarButton(EXECUTE_ACTIONS, launchXBayaInterpreterItem.getText(), MenuIcons.RUN_ICON, "Run workflow", action,1);
+        toolbarButtonRunWorkflow.setEnabled(launchXBayaInterpreterItem.isEnabled());
+        launchXBayaInterpreterItem.setEnabled(false);
+    }
+    
+    /**
+     * @see org.apache.airavata.ws.monitor.event.EventListener#eventReceived(org.apache.airavata.ws.monitor.event.Event)
+     */
+    public void eventReceived(Event event) {
+        Type type = event.getType();
+        if (type.equals(Type.MONITOR_CONFIGURATION_CHANGED)) {
+            MonitorConfiguration configuration = this.engine.getMonitor().getConfiguration();
+            boolean valid = configuration.isValid();
+            resumeMonitoringItem.setVisible(valid);
+            pauseMonitoringItem.setVisible(false);
+            resetMonitoringItem.setVisible(false);
+        } else if (type.equals(Type.MONITOR_STARTED)) {
+            resumeMonitoringItem.setVisible(false);
+            pauseMonitoringItem.setVisible(true);
+            resetMonitoringItem.setVisible(true);
+        } else if (type.equals(Type.MONITOR_STOPED)) {
+            resumeMonitoringItem.setVisible(true);
+            pauseMonitoringItem.setVisible(false);
+            resetMonitoringItem.setVisible(false);
+        }
+        toolbarButtonPauseMonitor.setEnabled(pauseMonitoringItem.isVisible());
+        toolbarButtonResumeMonitor.setEnabled(resumeMonitoringItem.isVisible());
+    }
+
+	public XBayaToolBar getToolBar() {
+		return toolBar;
+	}
+
+	public void setToolBar(XBayaToolBar toolBar) {
+		this.toolBar = toolBar;
+	}
+	
+	private void cleanup() {
+		try {
+            try {
+                Thread.sleep(1000);
+            } catch (InterruptedException e) {
+                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+            }
+            engine.getWorkflowInterpreter().cleanup();
+		} catch (MonitorException e) {
+			this.engine.getGUI().getErrorWindow().error(e);
+		}
+	}
+
+	private boolean isWorkflowRunning() {
+		return engine.getWorkflowInterpreter()!=null;
+	}
+
+	@Override
+	public void executionModeChanged(XBayaConfiguration config) {
+		toolbarButtonRunWorkflow.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);
+		toolbarButtonStopWorkflow.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);
+	}
+	
+	private void startStopButtonStateUpdater() {
+		Thread t=new Thread(){
+			@Override
+			public void run() {
+				while(true){
+					toolbarButtonStopWorkflow.setEnabled(isWorkflowRunning());
+//					if (!isWorkflowRunning()){
+//						pauseMonitorButton.setEnabled(false);
+//						resumeMonitorButton.setEnabled(false);
+//					}
+					try {
+						Thread.sleep(1000);
+					} catch (InterruptedException e) {
+					}
+				}
+			}
+		};
+		t.start();
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/ViewMenuItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/ViewMenuItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/ViewMenuItem.java
new file mode 100644
index 0000000..ab12e13
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/ViewMenuItem.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.menues;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.net.URI;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ViewMenuItem {
+
+	private XBayaEngine engine;
+
+	private JMenu viewMenu;
+
+	private JMenuItem jcrRegistryView;
+
+	private JMenuItem componentsView;
+
+	private JMenuItem monitoringView;
+
+	private JMenuItem parametersView;
+
+	private static final Logger logger = LoggerFactory
+			.getLogger(ViewMenuItem.class);
+
+	/**
+	 * Constructs a WorkflowMenu.
+	 * 
+	 * @param engine
+	 */
+	public ViewMenuItem(XBayaEngine engine) {
+		this.engine = engine;
+		createWorkflowMenu();
+	}
+
+	/**
+	 * @return The workflow menu.
+	 */
+	public JMenu getMenu() {
+		return this.viewMenu;
+	}
+
+	/**
+	 * Creates workflow menu.
+	 */
+	private void createWorkflowMenu() {
+		this.jcrRegistryView = createShpwJCRRegistryView();
+		this.componentsView = createShowComponentsView();
+
+		monitoringView = createShowMonitoringView();
+		parametersView = createShowParameterView();
+
+		viewMenu = new JMenu("View");
+		viewMenu.setMnemonic(KeyEvent.VK_V);
+
+		viewMenu.add(this.jcrRegistryView);
+
+		viewMenu.addSeparator();
+
+		viewMenu.add(this.componentsView);
+
+		viewMenu.addSeparator();
+
+		viewMenu.add(monitoringView);
+		viewMenu.add(parametersView);
+	}
+
+	private JMenuItem createShpwJCRRegistryView() {
+		JMenuItem menuItem = new JMenuItem("Airavata Registry");
+		menuItem.addActionListener(new AbstractAction() {
+			public void actionPerformed(ActionEvent e) {
+				engine.getGUI().viewJCRBrowserPanel();
+			}
+		});
+		return menuItem;
+	}
+
+	private JMenuItem createShowComponentsView() {
+		JMenuItem menuItem = new JMenuItem("Components");
+		menuItem.addActionListener(new AbstractAction() {
+			public void actionPerformed(ActionEvent e) {
+				engine.getGUI().viewComponentTree();
+			}
+		});
+		return menuItem;
+	}
+
+	private JMenuItem createShowMonitoringView() {
+		JMenuItem menuItem = new JMenuItem("Monitoring");
+		menuItem.addActionListener(new AbstractAction() {
+			public void actionPerformed(ActionEvent e) {
+				// TODO
+			}
+		});
+		// FIXME remove this once save all functionality is fixed
+		menuItem.setEnabled(false);
+		return menuItem;
+	}
+
+	private JMenuItem createShowParameterView() {
+		JMenuItem menuItem = new JMenuItem("Parameters");
+		menuItem.addActionListener(new AbstractAction() {
+			public void actionPerformed(ActionEvent e) {
+				// TODO
+			}
+		});
+		// FIXME remove this once save all functionality is fixed
+		menuItem.setEnabled(false);
+		return menuItem;
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenu.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenu.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenu.java
new file mode 100644
index 0000000..5b472ed
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenu.java
@@ -0,0 +1,158 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.menues;
+
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
+//import org.apache.airavata.xbaya.menues.tools.ToolsMenuItem;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.AboutWindow;
+import org.apache.airavata.xbaya.ui.widgets.XBayaComponent;
+import org.apache.airavata.xbaya.ui.widgets.XBayaToolBar;
+
+import javax.swing.*;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+public class XBayaMenu implements XBayaComponent,XBayaExecutionModeListener{
+
+    private XBayaEngine engine;
+
+    private JMenuBar menuBar;
+
+	private XBayaMenuItem xBayaMenuItem;
+
+	private EditMenuItem editMenuItem;
+
+	private ViewMenuItem viewMenuItem;
+
+	private RunMenuItem runMenuItem;
+
+	private RegistryMenuItem registryMenuItem;
+
+    private AmazonEC2MenuItem amazonEC2MenuItem;
+
+//	private ToolsMenuItem toolsMenuItem;
+
+	private XBayaGUI gui;
+
+	private XBayaToolBar toolBar;
+	
+    /**
+     * Constructs an XwfMenu.
+     * 
+     * @param engine
+     */
+    public XBayaMenu(XBayaEngine engine, XBayaToolBar toolBar) {
+        this.setEngine(engine);
+        setToolBar(toolBar);
+        initMenu();
+		engine.getConfiguration().registerExecutionModeChangeListener(this);
+    }
+    
+	private void initMenu() {
+		xBayaMenuItem = new XBayaMenuItem(getEngine(),getToolBar());
+		editMenuItem = new EditMenuItem(getEngine());
+        amazonEC2MenuItem = new AmazonEC2MenuItem(getEngine());
+		viewMenuItem = new ViewMenuItem(getEngine());
+		runMenuItem = new RunMenuItem(getEngine(), getToolBar());
+		registryMenuItem = new RegistryMenuItem(getEngine(),getToolBar());
+//		toolsMenuItem = new ToolsMenuItem(getEngine());
+
+		createMenuBar();
+		executionModeChanged(getEngine().getConfiguration());
+	}
+
+    /**
+     * Returns the menu bar.
+     * 
+     * @return The menu bar.
+     */
+    public JMenuBar getSwingComponent() {
+        return this.menuBar;
+    }
+
+    /**
+     * Creates the menu bar.
+     */
+    private void createMenuBar() {
+        this.menuBar = new JMenuBar();
+        menuBar.add(xBayaMenuItem.getMenu());
+        menuBar.add(editMenuItem.getMenu());
+        menuBar.add(viewMenuItem.getMenu());
+        menuBar.add(runMenuItem.getMenu());
+//        menuBar.add(toolsMenuItem.getMenu());
+        menuBar.add(registryMenuItem.getMenu());
+        menuBar.add(amazonEC2MenuItem.getMenu());
+        // Space before Help
+        this.menuBar.add(Box.createHorizontalGlue());
+
+        this.menuBar.add(createHelpMenu());
+    }
+
+    private JMenu createHelpMenu() {
+        // Help
+        JMenu helpMenu = new JMenu("Help");
+        helpMenu.setMnemonic(KeyEvent.VK_H);
+
+        JMenuItem aboutItem = new JMenuItem("About " + XBayaConstants.APPLICATION_SHORT_NAME);
+        aboutItem.setMnemonic(KeyEvent.VK_A);
+        aboutItem.addActionListener(new AbstractAction() {
+            private AboutWindow window;
+
+            public void actionPerformed(ActionEvent event) {
+                if (this.window == null) {
+                    this.window = new AboutWindow(XBayaMenu.this.getEngine());
+                }
+                this.window.show();
+            }
+        });
+        helpMenu.add(aboutItem);
+
+        return helpMenu;
+    }
+
+	public XBayaEngine getEngine() {
+		return engine;
+	}
+
+	public void setEngine(XBayaEngine engine) {
+		this.engine = engine;
+	}
+
+	public XBayaToolBar getToolBar() {
+		return toolBar;
+	}
+
+	public void setToolBar(XBayaToolBar toolBar) {
+		this.toolBar = toolBar;
+	}
+
+	@Override
+	public void executionModeChanged(XBayaConfiguration config) {
+		this.menuBar.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);	
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java
new file mode 100644
index 0000000..98dad2b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/menues/XBayaMenuItem.java
@@ -0,0 +1,610 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.menues;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+import java.awt.event.WindowEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.KeyStroke;
+import javax.swing.SwingUtilities;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.MenuEvent;
+import javax.swing.event.MenuListener;
+
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
+import org.apache.airavata.xbaya.core.generators.BPELFiler;
+import org.apache.airavata.xbaya.core.generators.ImageFiler;
+import org.apache.airavata.xbaya.core.generators.JythonFiler;
+import org.apache.airavata.xbaya.core.generators.ODEScriptFiler;
+import org.apache.airavata.xbaya.core.generators.WorkflowFiler;
+import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
+import org.apache.airavata.xbaya.registry.RegistryAccesser;
+import org.apache.airavata.xbaya.ui.dialogs.component.URLRegistryWindow;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.ApplicationDescriptionDialog;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.DeploymentDescriptionDialog;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.HostDescriptionDialog;
+import org.apache.airavata.xbaya.ui.experiment.RegistryLoaderWindow;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.airavata.xbaya.ui.widgets.ToolbarButton;
+import org.apache.airavata.xbaya.ui.widgets.XBayaToolBar;
+import org.apache.airavata.xbaya.util.RegistryConstants;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class XBayaMenuItem implements XBayaExecutionModeListener {
+
+    private static final Logger logger = LoggerFactory.getLogger(XBayaMenuItem.class);
+
+    private JMenu xbayaMenuItem;
+
+    private WorkflowFiler graphFiler;
+
+    private JythonFiler jythonFiler;
+
+    private ImageFiler imageFiler;
+
+    private BPELFiler bpelFiler;
+
+//    private ScuflFiler scuflFiler;
+    
+    private JMenuItem urlItem;
+
+//    private ODEDeploymentDescriptor odeDeploymentDescription;
+
+    private JMenuItem openWorkflowItem;
+
+    private JMenuItem saveWorkflowItem;
+
+    private JMenuItem exportJythonItem;
+
+    private JMenuItem exportBpelItem;
+
+    private JMenuItem saveImageItem;
+
+    private JMenuItem importWorkflowItemFromFileSystem;
+
+    private JMenuItem exportODEScriptsItem;
+    
+    private JMenuItem clearWorkflowItem;
+
+    private JMenuItem newWorkflowTabItem;
+
+    private JMenuItem closeWorkflowItem;
+
+    private JMenuItem nextWorkflowTabItem;
+    
+    private JMenuItem exitItem;
+
+    private XBayaEngine engine;
+    
+    private JMenuItem registerServiceDesc;
+
+    private JMenuItem registerApplicationDesc;
+
+    private JMenuItem registerHostDesc;
+
+	private JMenuItem closeAllWorkflowItem;
+
+	private JMenuItem saveAsWorkflowItem;
+
+	private JMenuItem saveAllWorkflowItem;
+
+    private JMenuItem saveWorkflowtoRegistryItem;
+
+	private JMenuItem importWorkflowItemFromRegistry;
+
+	private RegistryAccesser registryAccesser;
+
+	private XBayaToolBar toolBar;
+
+	private ToolbarButton toolbarButtonSave;
+
+	private ToolbarButton toolbarButtonOpen;
+
+	private ToolbarButton toolbarButtonNew;
+	
+	private static final String FILE_ACTIONS="file";
+	
+    /**
+     * Constructs a FileMenu.
+     * 
+     * @param engine
+     * 
+     */
+    public XBayaMenuItem(XBayaEngine engine, XBayaToolBar toolBar) {
+        this.engine = engine;
+        this.toolBar=toolBar;
+        this.registryAccesser = new RegistryAccesser(engine);
+
+        this.graphFiler = new WorkflowFiler(engine);
+        this.jythonFiler = new JythonFiler(engine);
+        this.imageFiler = new ImageFiler(engine);
+        this.bpelFiler = new BPELFiler(engine);
+//        this.scuflFiler = new ScuflFiler(engine);
+//        this.odeDeploymentDescription = new ODEDeploymentDescriptor();
+
+        this.exitItem = createExitItem();
+
+        createFileMenu();
+        engine.getConfiguration().registerExecutionModeChangeListener(this);
+        XBayaToolBar.setGroupOrder(FILE_ACTIONS, 1);
+    }
+
+    private void createFileMenu() {
+
+        createOpenWorkflowMenuItem();
+        createSaveWorkflowItem();
+        createSaveAsWorkflowItem();
+        createSaveAllWorkflowItem();
+        createSaveWorkflowtoRegistryItem();
+
+        createImportWorkflowItemFromFileSystem();
+        createImportWorkflowItemFromRegistry();
+        createExportJythonScriptItem();
+        createExportBpelScriptItem();
+        createSaveWorkflowImageItem();
+        createExportODEScriptsItem();
+        
+        clearWorkflowItem = createClearWorkflowItem();
+        newWorkflowTabItem = createNewWorkflowTabMenuItem();
+        closeWorkflowItem = createCloseWorkflowTabItem();
+        closeAllWorkflowItem = createCloseAllWorkflowTabItem();
+        nextWorkflowTabItem = createNextWorkflowTabItem();
+        urlItem = createURLRegistryItem();
+        
+        createRegisterHostDesc();
+        createRegisterServiceDesc();
+        createRegisterApplicationDesc();
+        
+        xbayaMenuItem = new JMenu("XBaya");
+        xbayaMenuItem.setMnemonic(KeyEvent.VK_X);
+//        JMenu newMenu = new JMenu("New");
+//	        newMenu.add(newWorkflowTabItem);
+//	        newMenu.addSeparator();
+//	        
+//	        newMenu.add(this.registerApplicationDesc);
+//	        newMenu.addSeparator();
+//	        JMenu regAddSubMenuItem = new JMenu("Registry additions");
+//	        newMenu.add(regAddSubMenuItem);
+//	        regAddSubMenuItem.add(this.registerHostDesc);
+//	        regAddSubMenuItem.add(this.registerServiceDesc);
+//	        
+//        xbayaMenuItem.add(newMenu);
+        xbayaMenuItem.add(newWorkflowTabItem);
+        xbayaMenuItem.add(registerHostDesc);
+        xbayaMenuItem.add(this.registerServiceDesc);
+//        xbayaMenuItem.add(registerApplicationDesc);
+        xbayaMenuItem.add(this.openWorkflowItem);
+
+        xbayaMenuItem.addSeparator();
+        
+        xbayaMenuItem.add(clearWorkflowItem);
+        xbayaMenuItem.add(closeWorkflowItem);
+        xbayaMenuItem.add(closeAllWorkflowItem);
+        
+        //This menu item did not seem useful at all
+//        xbayaMenuItem.add(this.nextWorkflowTabItem);
+
+        xbayaMenuItem.addSeparator();
+
+        xbayaMenuItem.add(this.saveWorkflowItem);
+
+        xbayaMenuItem.add(this.saveAsWorkflowItem);
+        xbayaMenuItem.add(this.saveAllWorkflowItem);
+        
+        xbayaMenuItem.addSeparator();
+        JMenu importMenu = new JMenu("Import");
+        	importMenu.add(importWorkflowItemFromFileSystem);
+        	importMenu.add(importWorkflowItemFromRegistry);
+        	importMenu.addSeparator();
+        	importMenu.add(urlItem);	
+        	
+        JMenu exportMenu = new JMenu("Export");
+        	exportMenu.add(saveWorkflowtoRegistryItem);
+        	exportMenu.addSeparator();
+	        exportMenu.add(exportJythonItem);
+	        exportMenu.add(exportBpelItem);
+	        exportMenu.add(exportODEScriptsItem);
+	        exportMenu.addSeparator();
+	        exportMenu.add(saveImageItem);
+        
+        xbayaMenuItem.add(importMenu);
+        xbayaMenuItem.add(exportMenu);
+        
+        xbayaMenuItem.addSeparator();
+        
+        xbayaMenuItem.add(exitItem);
+        
+        xbayaMenuItem.addMenuListener(new MenuListener() {
+			
+			@Override
+			public void menuSelected(MenuEvent e) {
+				GraphCanvas graphCanvas = engine.getGUI().getGraphCanvas();
+				saveAsWorkflowItem.setEnabled(isWorkflowTabPresent() && graphCanvas.getWorkflowFile()!=null);
+				saveWorkflowItem.setEnabled(isSaveShouldBeActive());
+				saveAllWorkflowItem.setEnabled(engine.getGUI().getGraphCanvases().size()>0);
+				saveWorkflowtoRegistryItem.setEnabled(isWorkflowTabPresent());
+				exportJythonItem.setEnabled(isWorkflowTabPresent());
+				exportBpelItem.setEnabled(isWorkflowTabPresent());
+				exportODEScriptsItem.setEnabled(isWorkflowTabPresent());
+				saveImageItem.setEnabled(isWorkflowTabPresent());
+			}
+			@Override
+			public void menuDeselected(MenuEvent e) {}
+			@Override
+			public void menuCanceled(MenuEvent e) {}
+		});
+        executionModeChanged(engine.getConfiguration());
+    }
+
+    /**
+     * @return The file menu.
+     */
+    public JMenu getMenu() {
+        return this.xbayaMenuItem;
+    }
+
+    private void createSaveWorkflowtoRegistryItem() {
+        this.saveWorkflowtoRegistryItem = new JMenuItem("Workflow To Registry...");
+        this.saveWorkflowtoRegistryItem.setMnemonic(KeyEvent.VK_C);
+        this.saveWorkflowtoRegistryItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                if (registryAccesser.saveWorkflow()){
+                	if (engine.getGUI().getGraphCanvas().getWorkflowFile()==null){
+                		engine.getGUI().getGraphCanvas().workflowSaved();
+                	}
+                }
+            }
+        });
+    }
+    
+    private JMenuItem createURLRegistryItem() {
+        JMenuItem item = new JMenuItem("WSDL From URL...");
+        item.setMnemonic(KeyEvent.VK_U);
+        item.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            private URLRegistryWindow window;
+            public void actionPerformed(ActionEvent e) {
+                if (this.window == null) {
+                    this.window = new URLRegistryWindow(engine);
+                }
+                this.window.show();
+            }
+        });
+        return item;
+    }
+    
+    private void createRegisterServiceDesc() {
+        this.registerServiceDesc = new JMenuItem("Register Application...");
+
+        this.registerServiceDesc.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (XBayaUtil.acquireJCRRegistry(engine)) {
+                    try {
+                        DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(XBayaMenuItem.this.engine.getGUI().getFrame(), engine.getConfiguration()
+                                        .getAiravataAPI());
+                    	serviceDescriptionDialog.open();
+//                        ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(
+//                                engine.getConfiguration().getJcrComponentRegistry()
+//                                        .getRegistry());
+//                        serviceDescriptionDialog.open();
+                    	if (serviceDescriptionDialog.isServiceCreated()){
+//                    		engine.reloadRegistry();
+                    		ComponentRegistryLoader loader = ComponentRegistryLoader.getLoader(engine, RegistryConstants.REGISTRY_TYPE_JCR);
+                    		loader.load(engine.getConfiguration().getJcrComponentRegistry());
+                    	}
+                    } catch (Exception e1) {
+                        engine.getGUI().getErrorWindow().error(e1);
+                    }
+                }
+            }
+        });
+
+    }
+
+    private void createRegisterApplicationDesc() {
+        this.registerApplicationDesc = new JMenuItem("Register Application...");
+
+        this.registerApplicationDesc.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (XBayaUtil.acquireJCRRegistry(engine)) {
+                    try {
+                        ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(
+                                engine);
+        	    		applicationDescriptionDialog.setLocationRelativeTo(engine.getGUI().getFrame());
+                        applicationDescriptionDialog.open();
+                    } catch (Exception e1) {
+                        engine.getGUI().getErrorWindow().error(e1);
+                    }
+                }
+            }
+        });
+
+    }
+
+    private void createRegisterHostDesc() {
+        this.registerHostDesc = new JMenuItem("Add Host...");
+
+        this.registerHostDesc.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                if (XBayaUtil.acquireJCRRegistry(engine)) {
+                    try {
+                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(
+                        		engine.getConfiguration().getAiravataAPI(),XBayaMenuItem.this.engine.getGUI().getFrame() );
+                        hostDescriptionDialog.open();
+                    } catch (Exception e1) {
+                        engine.getGUI().getErrorWindow().error(e1);
+                    }
+                }
+            }
+        });
+
+    }
+    private JMenuItem createClearWorkflowItem() {
+        JMenuItem menuItem = new JMenuItem("Clear Workflow");
+        menuItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+			public void actionPerformed(ActionEvent e) {
+                engine.getGUI().getGraphCanvas().newWorkflow();
+            }
+        });
+        return menuItem;
+    }
+
+    private JMenuItem createNewWorkflowTabMenuItem() {
+        
+		JMenuItem menuItem = new JMenuItem("New Workflow", MenuIcons.NEW_ICON);
+        menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, ActionEvent.CTRL_MASK));
+        AbstractAction action = new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                engine.getGUI().newGraphCanvas(true, true);
+            }
+        };
+		menuItem.addActionListener(action);
+		toolbarButtonNew=getToolBar().addToolbarButton(FILE_ACTIONS,menuItem.getText(), MenuIcons.NEW_ICON, "Create new workflow", action,1);
+        return menuItem;
+    }
+
+    private JMenuItem createCloseWorkflowTabItem() {
+        JMenuItem menuItem = new JMenuItem("Close Tab");
+        menuItem.setMnemonic(KeyEvent.VK_C);
+        menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F4, ActionEvent.CTRL_MASK));
+        menuItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                engine.getGUI().closeGraphCanvas();
+            }
+        });
+        return menuItem;
+    }
+
+    private JMenuItem createCloseAllWorkflowTabItem() {
+        JMenuItem menuItem = new JMenuItem("Close All Tabs");
+        menuItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                engine.getGUI().closeAllGraphCanvas();
+            }
+        });
+        return menuItem;
+    }
+    
+    private JMenuItem createNextWorkflowTabItem() {
+        JMenuItem menuItem = new JMenuItem("Select Next Workflow Tab");
+        menuItem.setMnemonic(KeyEvent.VK_S);
+        // XXX VK_TAB doesn't work...
+        // menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_TAB,
+        // ActionEvent.CTRL_MASK));
+        menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F6, ActionEvent.CTRL_MASK));
+        menuItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                engine.getGUI().selectNextGraphCanvas();
+            }
+        });
+        return menuItem;
+    }
+    
+    private void createOpenWorkflowMenuItem() {
+		this.openWorkflowItem = new JMenuItem("Open Workflow...", MenuIcons.OPEN_ICON);
+        this.openWorkflowItem.setMnemonic(KeyEvent.VK_O);
+        openWorkflowItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, ActionEvent.CTRL_MASK));
+        AbstractAction action = new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent event) {
+                XBayaMenuItem.this.graphFiler.openWorkflow();
+            }
+        };
+		this.openWorkflowItem.addActionListener(action);
+		toolbarButtonOpen=getToolBar().addToolbarButton(FILE_ACTIONS,openWorkflowItem.getText(), MenuIcons.OPEN_ICON, "Open workflow", action,2);
+    }
+
+    private void createSaveWorkflowItem() {
+		saveWorkflowItem = new JMenuItem("Save", MenuIcons.SAVE_ICON);
+        saveWorkflowItem.setMnemonic(KeyEvent.VK_S);
+        saveWorkflowItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, ActionEvent.CTRL_MASK));
+        AbstractAction action = new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                XBayaMenuItem.this.graphFiler.saveWorkflow();
+                toolbarButtonSave.setEnabled(isSaveShouldBeActive());
+            }
+        };
+		saveWorkflowItem.addActionListener(action);
+        toolbarButtonSave = getToolBar().addToolbarButton(FILE_ACTIONS,saveWorkflowItem.getText(), MenuIcons.SAVE_ICON, "Save workflow", action,3);
+        toolbarButtonSave.setEnabled(false);
+        SwingUtilities.invokeLater(new Runnable() {
+            public void run() {
+            	while(engine.getGUI()==null){
+            		Thread.yield();
+            	}
+                engine.getGUI().addWorkflowTabChangeListener(new ChangeListener(){
+					@Override
+					public void stateChanged(ChangeEvent event) {
+						toolbarButtonSave.setEnabled(isSaveShouldBeActive());						
+					}
+                });
+            }
+        });
+    }
+    
+    private void createSaveAsWorkflowItem() {
+        saveAsWorkflowItem = new JMenuItem("Save as...");
+        saveAsWorkflowItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                XBayaMenuItem.this.graphFiler.saveAsWorkflow();
+            }
+        });
+    }
+    
+    private void createSaveAllWorkflowItem() {
+        saveAllWorkflowItem = new JMenuItem("Save all");
+        saveAllWorkflowItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                XBayaMenuItem.this.graphFiler.saveAllWorkflows();
+            }
+        });
+        saveAllWorkflowItem.setEnabled(false);
+    }
+
+    private void createImportWorkflowItemFromFileSystem() {
+        importWorkflowItemFromFileSystem = new JMenuItem("Workflow From File System...");
+        importWorkflowItemFromFileSystem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                XBayaMenuItem.this.graphFiler.importWorkflow();
+            }
+        });
+    }
+    
+    private void createImportWorkflowItemFromRegistry() {
+        importWorkflowItemFromRegistry = new JMenuItem("Workflow From Registry...");
+        importWorkflowItemFromRegistry.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                new RegistryLoaderWindow(engine).show();
+            }
+        });
+    }
+    
+    private void createExportJythonScriptItem() {
+        this.exportJythonItem = new JMenuItem("Workflow To Jython Script...");
+        this.exportJythonItem.setMnemonic(KeyEvent.VK_J);
+        this.exportJythonItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                XBayaMenuItem.this.jythonFiler.exportJythonScript();
+            }
+        });
+    }
+
+    private void createExportBpelScriptItem() {
+        this.exportBpelItem = new JMenuItem("Workflow To BPEL2 Script...");
+        this.exportBpelItem.setMnemonic(KeyEvent.VK_B);
+        this.exportBpelItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                XBayaMenuItem.this.bpelFiler.exportBPEL();
+            }
+        });
+    }
+
+    private void createSaveWorkflowImageItem() {
+        this.saveImageItem = new JMenuItem("Workflow To Image...");
+        this.saveImageItem.setMnemonic(KeyEvent.VK_I);
+        this.saveImageItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                XBayaMenuItem.this.imageFiler.saveWorkflowImage();
+            }
+        });
+    }
+
+    private void createExportODEScriptsItem() {
+        this.exportODEScriptsItem = new JMenuItem("Workflow To ODE Scripts...");
+        this.exportODEScriptsItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent e) {
+                new ODEScriptFiler(XBayaMenuItem.this.engine).save();
+
+            }
+        });
+    }
+
+    private JMenuItem createExitItem() {
+        JMenuItem menuItem = new JMenuItem("Exit");
+        menuItem.setMnemonic(KeyEvent.VK_X);
+        menuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, ActionEvent.CTRL_MASK));
+        menuItem.addActionListener(new AbstractAction() {
+			private static final long serialVersionUID = 1L;
+            public void actionPerformed(ActionEvent event) {
+            	JFrame frame = XBayaMenuItem.this.engine.getGUI().getFrame();
+				frame.dispatchEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING)); 
+            }
+        });
+        return menuItem;
+    }
+
+	public XBayaToolBar getToolBar() {
+		return toolBar;
+	}
+
+	public void setToolBar(XBayaToolBar toolBar) {
+		this.toolBar = toolBar;
+	}
+
+	private boolean isSaveShouldBeActive() {
+		GraphCanvas graphCanvas = engine.getGUI().getGraphCanvas();
+		return isWorkflowTabPresent() && (graphCanvas.getWorkflowFile()==null || graphCanvas.isWorkflowChanged());
+	}
+
+	private boolean isWorkflowTabPresent() {
+		return engine.getGUI().getGraphCanvas() !=null;
+	}
+
+	@Override
+	public void executionModeChanged(XBayaConfiguration config) {
+		toolbarButtonNew.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);
+		toolbarButtonSave.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);
+		toolbarButtonOpen.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java
new file mode 100644
index 0000000..2b89082
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorEventHandler.java
@@ -0,0 +1,547 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.monitor;
+
+import java.awt.Color;
+import java.net.URI;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.apache.airavata.workflow.model.graph.ControlPort;
+import org.apache.airavata.workflow.model.graph.EPRPort;
+import org.apache.airavata.workflow.model.graph.Edge;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
+import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.ws.monitor.EventData;
+import org.apache.airavata.ws.monitor.EventDataRepository;
+import org.apache.airavata.ws.monitor.MonitorUtil;
+import org.apache.airavata.ws.monitor.MonitorUtil.EventType;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+public class MonitorEventHandler implements ChangeListener {
+
+    /**
+     * The state of a node
+     */
+    public static enum NodeState {
+
+        /**
+         * FINISHED
+         */
+        FINISHED(Color.GRAY),
+
+        /**
+         * EXECUTING
+         */
+        EXECUTING(Color.GREEN),
+
+        /**
+         * FAILED
+         */
+        FAILED(Color.RED),
+
+        /**
+         * DEFAULT COLOR
+         */
+        DEFAULT(NodeGUI.DEFAULT_BODY_COLOR);
+
+
+        /**
+         * color
+         */
+        final public Color color;
+
+        private NodeState(Color color) {
+            this.color = color;
+        }
+    }
+
+    private static Logger logger = LoggerFactory.getLogger(MonitorEventHandler.class);
+
+    private XBayaGUI xbayaGUI;
+
+    private int sliderValue;
+
+    private Collection<URI> incorrectWorkflowIDs;
+
+    private Collection<URI> triedWorkflowIDs;
+
+    private Map<Node, LinkedList<ResourcePaintable>> resourcePaintableMap;
+
+//    private WorkflowStatusUpdater workflowStatusUpdater;
+
+//    private WorkflowNodeStatusUpdater workflowNodeStatusUpdater;
+
+    /**
+     * Model MonitorEventHandler
+     *
+     * @param xbayaGUI
+     */
+    public MonitorEventHandler(XBayaGUI xbayaGUI) {
+        this.xbayaGUI = xbayaGUI;
+        this.incorrectWorkflowIDs = Collections.synchronizedSet(new HashSet<URI>());
+        this.triedWorkflowIDs = Collections.synchronizedSet(new HashSet<URI>());
+        this.resourcePaintableMap = new HashMap<Node, LinkedList<ResourcePaintable>>();
+//        try {
+//            if (this.getClass().getClassLoader().getResource("airavata-server.properties") != null) {
+//                this.workflowNodeStatusUpdater =
+//                        new WorkflowNodeStatusUpdater(XBayaUtil.getRegistry(this.getClass().getClassLoader().getResource("airavata-server.properties")));
+//                this.workflowStatusUpdater =
+//                        new WorkflowStatusUpdater(XBayaUtil.getRegistry(this.getClass().getClassLoader().getResource("airavata-server.properties")));
+//            }
+//        } catch (IOException e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//        } catch (RepositoryException e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//        } catch (URISyntaxException e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//        }
+    }
+
+    /**
+     * @see javax.swing.event.ChangeListener#stateChanged(javax.swing.event.ChangeEvent)
+     */
+    public void stateChanged(ChangeEvent event) {
+        try {
+            Object source = event.getSource();
+            if (source instanceof EventDataRepository) {
+                handleChange((EventDataRepository) source);
+            }
+        } catch (RuntimeException e) {
+            // Don't want to pop up an error dialog every time XBaya received an
+            // ill-formatted notification.
+            logger.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * @param model
+     */
+    private void handleChange(EventDataRepository model) {
+        int newValue = model.getValue();
+
+        if (model.getEventSize() == 0) {
+            // The monitor was reset.
+            resetAll();
+        } else if (newValue > this.sliderValue) {
+            // 3 -> 5
+            // 3, 4
+            for (int i = this.sliderValue; i < newValue; i++) {
+                handleEvent(model.getEvent(i), true);
+            }
+        } else if (newValue < this.sliderValue) {
+            // 5 -> 3
+            // 4, 3
+            for (int i = this.sliderValue - 1; i >= newValue; i--) {
+                handleEvent(model.getEvent(i), false);
+            }
+        }
+        this.sliderValue = newValue;
+
+        // Repaints only the active canvas.
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    private void handleEvent(EventData event, boolean forward) {
+        EventType type = event.getType();
+        //todo currrently we do not set the workflowID properly its just node ID
+        URI workflowID = event.getWorkflowID();
+
+        List<GraphCanvas> graphCanvases = this.xbayaGUI.getGraphCanvases();
+        boolean found = false;
+        for (GraphCanvas graphCanvas : graphCanvases) {
+            Workflow workflow = graphCanvas.getWorkflow();
+//            URI instanceID = workflow.getGPELInstanceID();
+//            if (instanceID == null) {
+            // If the workflow doesn't have an instance ID, it's a template.
+            // We handle it so that users can use a workflow template to
+            // monitor a workflow too.
+            // This is also needed in the case of jython workflow.
+            handleEvent(event, forward, workflow.getGraph());
+//            } else if (instanceID.equals(workflowID)) {
+//                This is the regular case.
+//                found = true;
+//                handleEvent(event, forward, workflow.getGraph());
+//            } else if (null != workflowID
+//                    && -1 != WSDLUtil.findWorkflowName(workflowID).indexOf(WSDLUtil.findWorkflowName(instanceID))) {
+//                handleEvent(event, WSDLUtil.findWorkflowName(workflowID), workflow.getGraph());
+//            }
+        }
+
+        // Load a sub-workflow.
+        if (type == MonitorUtil.EventType.WORKFLOW_INITIALIZED) {
+            if (forward) {
+                // Check if the workflow instance is already open.
+                for (GraphCanvas graphCanvas : graphCanvases) {
+                    Workflow workflow = graphCanvas.getWorkflow();
+                    URI instanceID = workflow.getGPELInstanceID();
+                    if (workflowID.equals(instanceID)) {
+                        // The workflow instance is already loaded.
+                        return;
+                    }
+                }
+                loadWorkflow(workflowID);
+            } else {
+                // Don't need to close the workflow when it's opened.
+            }
+        }
+
+        if (found == false && workflowID != null) {
+            // Loads the workflow instance ID in case a user started to monitor
+            // in the middle.
+            loadWorkflow(workflowID);
+        }
+
+        /*
+         * Handle resource mapping message which contains resource from Amazon EC2 Since workflowID (workflowName) from
+         * message and instanceID do not equal, so we have to handle it explicitly
+         */
+        if (type == EventType.RESOURCE_MAPPING && event.getMessage().contains("i-")) {
+            String nodeID = event.getNodeID();
+            for (GraphCanvas graphCanvas : graphCanvases) {
+                Node node = graphCanvas.getWorkflow().getGraph().getNode(nodeID);
+                if (node != null) {
+                    ControlPort control = node.getControlInPort();
+                    if (control != null) {
+                        Node fromNode = control.getFromNode();
+                        if (fromNode instanceof InstanceNode) {
+                            InstanceNode ec2Node = (InstanceNode) fromNode;
+
+                            /*
+                             * parse message and set output to InstanceNode
+                             */
+                            int start = event.getMessage().indexOf("i-");
+                            String instanceId = event.getMessage().substring(start, start + 10);
+                            ec2Node.setOutputInstanceId(instanceId);
+
+                            // make this node to not start a new instance
+                            ec2Node.setStartNewInstance(false);
+                            ec2Node.setInstanceId(instanceId);
+                            ec2Node.setAmiId(null);
+                        }
+                    }
+                }
+            }
+        }
+
+        // TODO There is a possibility that XBaya misses to handle some
+        // notification while a workflow is being loaded. Create a thread for
+        // each workflow ID to handle notifications.
+    }
+
+    /**
+     * @param graph
+     * @return
+     */
+    private LinkedList<InputNode> getInputNodes(WSGraph graph) {
+        List<NodeImpl> nodes = graph.getNodes();
+        LinkedList<InputNode> inputNodes = new LinkedList<InputNode>();
+        for (NodeImpl nodeImpl : nodes) {
+            if (nodeImpl instanceof InputNode) {
+                inputNodes.add((InputNode) nodeImpl);
+            }
+        }
+        return inputNodes;
+    }
+
+    private LinkedList<OutputNode> getOutputNodes(WSGraph graph) {
+        List<NodeImpl> nodes = graph.getNodes();
+        LinkedList<OutputNode> outputNodes = new LinkedList<OutputNode>();
+        for (NodeImpl nodeImpl : nodes) {
+            if (nodeImpl instanceof OutputNode) {
+                outputNodes.add((OutputNode) nodeImpl);
+            }
+        }
+        return outputNodes;
+    }
+
+    /**
+     * @param event
+     * @param forward
+     * @param graph
+     */
+    private void handleEvent(EventData event, boolean forward, Graph graph) {
+        EventType type = event.getType();
+        String nodeID = event.getNodeID();
+        Node node = graph.getNode(nodeID);
+        System.out.println(type);
+        ;
+        // logger.info("type: " + type);
+        if (type == MonitorUtil.EventType.WORKFLOW_INVOKED) {
+            workflowStarted(graph, forward);
+//            workflowStatusUpdater.workflowStarted(event.getExperimentID());
+        } else if (type == MonitorUtil.EventType.WORKFLOW_TERMINATED) {
+            workflowFinished(graph, forward);
+//            workflowStatusUpdater.workflowFinished(event.getExperimentID());
+        } else if (type == EventType.INVOKING_SERVICE
+                // TODO this should be removed when GPEL sends all notification
+                // correctly.
+                || type == EventType.SERVICE_INVOKED) {
+            if (node == null) {
+                logger.warn("There is no node that has ID, " + nodeID);
+            } else {
+                nodeStarted(node, forward);
+//                workflowNodeStatusUpdater.workflowStarted(event.getExperimentID(), event.getNodeID());
+            }
+        } else if (type == MonitorUtil.EventType.RECEIVED_RESULT
+                // TODO this should be removed when GPEL sends all notification
+                // correctly.
+                || type == EventType.SENDING_RESULT) {
+            if (node == null) {
+                logger.warn("There is no node that has ID, " + nodeID);
+            } else {
+                nodeFinished(node, forward);
+//                workflowNodeStatusUpdater.workflowFinished(event.getExperimentID(), event.getNodeID());
+            }
+
+        } else if (type == EventType.INVOKING_SERVICE_FAILED || type == EventType.RECEIVED_FAULT
+                // TODO
+                || type == EventType.SENDING_FAULT || type == EventType.SENDING_RESPONSE_FAILED) {
+            if (node == null) {
+                logger.warn("There is no node that has ID, " + nodeID);
+            } else {
+                nodeFailed(node, forward);
+//                workflowNodeStatusUpdater.workflowFailed(event.getExperimentID(), event.getNodeID());
+            }
+        } else if (type == MonitorUtil.EventType.RESOURCE_MAPPING) {
+            if (node == null) {
+                logger.warn("There is no node that has ID, " + nodeID);
+            } else {
+                nodeResourceMapped(node, event.getEvent(), forward);
+//                workflowNodeStatusUpdater.workflowRunning(event.getExperimentID(), event.getNodeID());
+            }
+        } else {
+            // Ignore the rest.
+        }
+    }
+
+    /**
+     * @param workflowInstanceID
+     */
+    private void loadWorkflow(final URI workflowInstanceID) {
+        // To avoid to load a same workflow twice.
+        if (this.triedWorkflowIDs.contains(workflowInstanceID)) {
+            return;
+        }
+        this.triedWorkflowIDs.add(workflowInstanceID);
+
+        new Thread() {
+            @Override
+            public void run() {
+                loadWorkflowInThread(workflowInstanceID);
+            }
+        }.start();
+    }
+
+    private void loadWorkflowInThread(URI workflowInstanceID) {
+        try {
+            if (this.incorrectWorkflowIDs.contains(workflowInstanceID)) {
+                // Do not try to load a workflow that failed before.
+                return;
+            }
+            //There is not workflow client assigned in the engine. thus the following code is commented
+//            WorkflowClient client = this.engine.getWorkflowClient();
+//            Workflow loadedWorkflow = client.load(workflowInstanceID, WorkflowType.INSTANCE);
+//            GraphCanvas canvas = this.xbayaGUI.newGraphCanvas(true);
+//            canvas.setWorkflow(loadedWorkflow);
+//        } catch (GraphException e) {
+//            this.incorrectWorkflowIDs.add(workflowInstanceID);
+//            logger.error(e.getMessage(), e);
+//        } catch (WorkflowEngineException e) {
+//            this.incorrectWorkflowIDs.add(workflowInstanceID);
+//            logger.error(e.getMessage(), e);
+//        } catch (ComponentException e) {
+//            this.incorrectWorkflowIDs.add(workflowInstanceID);
+//            logger.error(e.getMessage(), e);
+        } catch (RuntimeException e) {
+            this.incorrectWorkflowIDs.add(workflowInstanceID);
+            logger.error(e.getMessage(), e);
+        }
+
+    }
+
+    private void workflowStarted(Graph graph, boolean forward) {
+        for (InputNode node : GraphUtil.getInputNodes(graph)) {
+            if (forward) {
+                finishNode(node);
+            } else {
+                resetNode(node);
+            }
+        }
+    }
+
+    private void workflowFinished(Graph graph, boolean forward) {
+        for (OutputNode node : GraphUtil.getOutputNodes(graph)) {
+            if (forward) {
+                finishNode(node);
+                finishPredecessorNodes(node);
+            } else {
+                resetNode(node);
+            }
+        }
+    }
+
+    private void nodeStarted(Node node, boolean forward) {
+        if (forward) {
+            if (node.getState() != NodeExecutionState.FINISHED) {
+                executeNode(node);
+                finishPredecessorNodes(node);
+            }
+        } else {
+            resetNode(node);
+        }
+    }
+
+    private void nodeFinished(Node node, boolean forward) {
+        if (forward) {
+            finishNode(node);
+            finishPredecessorNodes(node);
+        } else {
+            executeNode(node);
+        }
+    }
+
+    private void nodeFailed(Node node, boolean forward) {
+        if (forward) {
+            failNode(node);
+            finishPredecessorNodes(node);
+        } else {
+            executeNode(node);
+        }
+    }
+
+    private void nodeResourceMapped(Node node, XmlElement event, boolean forward) {
+        String resource = MonitorUtil.getMappedResource(event);
+        String retryCount = MonitorUtil.getRetryCount(event);
+        NodeGUI nodeGUI = NodeController.getGUI(node);
+        if (forward) {
+            LinkedList<ResourcePaintable> paintables = this.resourcePaintableMap.get(node);
+            if (paintables == null) {
+                paintables = new LinkedList<ResourcePaintable>();
+                this.resourcePaintableMap.put(node, paintables);
+            }
+            if (paintables.size() > 0) {
+                // Remove the previous one.
+                ResourcePaintable previousPaintable = paintables.getLast();
+                nodeGUI.removePaintable(previousPaintable);
+            }
+            ResourcePaintable paintable = new ResourcePaintable(resource, retryCount);
+            paintables.addLast(paintable);
+            nodeGUI.addPaintable(paintable);
+        } else {
+            LinkedList<ResourcePaintable> paintables = this.resourcePaintableMap.get(node);
+            if (paintables == null) {
+                paintables = new LinkedList<ResourcePaintable>();
+                this.resourcePaintableMap.put(node, paintables);
+            }
+            if (paintables.size() > 0) {
+                // Remove the last one.
+                ResourcePaintable lastPaintable = paintables.removeLast();
+                nodeGUI.removePaintable(lastPaintable);
+            }
+            if (paintables.size() > 0) {
+                // Add the previous one.
+                ResourcePaintable previousPaintable = paintables.getLast();
+                nodeGUI.addPaintable(previousPaintable);
+            }
+        }
+    }
+
+    private void resetAll() {
+        List<GraphCanvas> graphCanvases = this.xbayaGUI.getGraphCanvases();
+        for (GraphCanvas graphCanvas : graphCanvases) {
+            Graph graph = graphCanvas.getGraph();
+            for (Node node : graph.getNodes()) {
+                resetNode(node);
+            }
+        }
+    }
+
+    private void executeNode(Node node) {
+        node.setState(NodeExecutionState.EXECUTING);
+    }
+
+    private void finishNode(Node node) {
+        if (!NodeExecutionState.FAILED.equals(node.getState())) {
+            node.setState(NodeExecutionState.FINISHED);
+        }
+    }
+
+    private void failNode(Node node) {
+        node.setState(NodeExecutionState.FAILED);
+    }
+
+    private void resetNode(Node node) {
+        node.setState(NodeExecutionState.WAITING);
+        NodeController.getGUI(node).resetTokens();
+    }
+
+    /**
+     * Make preceding nodes done. This helps the monitoring GUI when a user subscribes from the middle of the workflow
+     * execution.
+     *
+     * @param node
+     */
+    private void finishPredecessorNodes(Node node) {
+        for (Port inputPort : node.getInputPorts()) {
+            for (Edge edge : inputPort.getEdges()) {
+                Port fromPort = edge.getFromPort();
+                if (!(fromPort instanceof EPRPort)) {
+                    Node fromNode = fromPort.getNode();
+                    finishNode(fromNode);
+                    finishPredecessorNodes(fromNode);
+                }
+            }
+        }
+        Port controlInPort = node.getControlInPort();
+        if (controlInPort != null) {
+            for (Node fromNode : controlInPort.getFromNodes()) {
+                finishNode(fromNode);
+                finishPredecessorNodes(fromNode);
+            }
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorStarter.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorStarter.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorStarter.java
new file mode 100644
index 0000000..94e856c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/MonitorStarter.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.monitor;
+
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MonitorStarter implements Cancelable {
+
+    private static final Logger logger = LoggerFactory.getLogger(MonitorStarter.class);
+
+    private XBayaEngine engine;
+
+    private Thread subscribingThread;
+
+    private boolean canceled;
+
+    private WaitDialog startingDialog;
+
+    /**
+     * Constructs a MonitorStarter.
+     * 
+     * @param engine
+     */
+    public MonitorStarter(XBayaEngine engine) {
+        this.engine = engine;
+
+        this.startingDialog = new WaitDialog(this, "Starting Monitoring", "Subscribing to notification.\n"
+                + "Please wait for a moment.", this.engine.getGUI());
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
+     */
+    public void cancel() {
+        this.canceled = true;
+        this.subscribingThread.interrupt();
+    }
+
+    /**
+     * Starts monitoring.
+     */
+    public void start() {
+        // Non blocking
+        start(false);
+    }
+
+    /**
+     * Starts monitoring.
+     * 
+     * @param blocking
+     */
+    public void start(final boolean blocking) {
+        this.canceled = false;
+
+        this.subscribingThread = new Thread() {
+            @Override
+            public void run() {
+                runInThread();
+            }
+
+        };
+        this.subscribingThread.start();
+
+        // This has to be the last because it blocks when the dialog is modal.
+        this.startingDialog.show();
+
+        if (blocking) {
+            try {
+                this.subscribingThread.join();
+            } catch (InterruptedException e) {
+                logger.error(e.getMessage(), e);
+            }
+        }
+    }
+
+    private void runInThread() {
+        try {
+            this.engine.getMonitor().start();
+            this.startingDialog.hide();
+        } catch (MonitorException e) {
+            // Probably canceled by a user.
+            if (this.canceled) {
+                logger.error(e.getMessage(), e);
+            } else {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
+                this.startingDialog.hide();
+            }
+        } catch (RuntimeException e) {
+            if (this.canceled) {
+                logger.error(e.getMessage(), e);
+            } else {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
+                this.startingDialog.hide();
+            }
+        } catch (Error e) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            this.startingDialog.hide();
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/ResourcePaintable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/ResourcePaintable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/ResourcePaintable.java
new file mode 100644
index 0000000..049edc0
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/monitor/ResourcePaintable.java
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.monitor;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Point;
+
+import org.apache.airavata.xbaya.ui.graph.Paintable;
+
+public class ResourcePaintable implements Paintable {
+
+    private String resource;
+
+    private String retryCount;
+
+    private String displayText;
+
+    /**
+     * Constructs a ResourcePaintable.
+     * 
+     * @param resource
+     * @param retryCount
+     */
+    public ResourcePaintable(String resource, String retryCount) {
+        this.resource = resource;
+        this.retryCount = retryCount;
+
+        this.displayText = "";
+        if (this.resource != null) {
+            this.displayText += this.resource;
+        }
+        if (this.retryCount != null && this.retryCount.length() > 0 && !"0".equals(this.retryCount)) {
+            this.displayText += "/" + this.retryCount;
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.Paintable#paint(java.awt.Graphics2D, java.awt.Point)
+     */
+    public void paint(Graphics2D graphics, Point point) {
+        graphics.setColor(Color.BLACK);
+        graphics.drawString(this.displayText, point.x, point.y - 10);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/Cancelable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/Cancelable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/Cancelable.java
new file mode 100644
index 0000000..42658c7
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/Cancelable.java
@@ -0,0 +1,30 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.utils;
+
+public interface Cancelable {
+
+    /**
+     * Cancels a task.
+     */
+    public void cancel();
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/DrawUtils.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/DrawUtils.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/DrawUtils.java
new file mode 100644
index 0000000..47e79bc
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/utils/DrawUtils.java
@@ -0,0 +1,108 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.utils;
+
+import java.awt.Color;
+import java.awt.GradientPaint;
+import java.awt.Graphics2D;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.Shape;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.RoundRectangle2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.python.modules.math;
+
+public class DrawUtils {
+	public static final int ARC_SIZE=10;
+	
+	public static void gradientFillShape(Graphics2D g,Color startColor, Color endColor, Shape shape) {
+		initializeGraphics2D(g);
+		GradientPaint gp = getGradientPaint(startColor, endColor, shape);
+        g.setPaint(gp);
+        g.fill(shape);
+	}
+
+
+	public static GradientPaint getGradientPaint(Color startColor,
+			Color endColor, Shape shape) {
+		GradientPaint gp = new GradientPaint((int)shape.getBounds().getX(), (int)shape.getBounds().getY(),
+				startColor, (int)(shape.getBounds().getX()+shape.getBounds().getWidth()), (int)(shape.getBounds().getY()+shape.getBounds().getHeight()),
+				endColor,false);
+		return gp;
+	}
+	
+
+	public static void initializeGraphics2D(Graphics2D g) {
+		g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+                RenderingHints.VALUE_ANTIALIAS_ON);
+	}
+	
+	public static Shape getRoundedShape(Rectangle shape) {
+		return new RoundRectangle2D.Double(shape.getX(),shape.getY(),shape.getWidth(),shape.getHeight(),DrawUtils.ARC_SIZE,DrawUtils.ARC_SIZE);
+    }
+	
+	public static GeneralPath getRoundedShape(Polygon polygon) {
+    	GeneralPath generalPath=new GeneralPath();
+    	DrawUtils.setupRoundedGeneralPath(polygon, generalPath);
+    	return generalPath;
+    }
+
+	public static void setupRoundedGeneralPath(Polygon polygon, GeneralPath generalPath) {
+		generalPath.reset();
+		List<int[]> l = new ArrayList<int[]>();
+		for(int i=0; i < polygon.npoints; i++){
+			l.add(new int[]{polygon.xpoints[i],polygon.ypoints[i]});
+		}
+		l.add(l.get(0));
+		l.add(l.get(1));
+		int[][] a=l.toArray(new int[][]{});
+		generalPath.moveTo(a[0][0],a[0][1]);
+		for(int pointIndex=1; pointIndex<a.length-1;pointIndex++){
+			int[] p1=a[pointIndex-1];
+			int[] p2=a[pointIndex];
+			int[] p3=a[pointIndex+1];
+			int[] mPoint = calculatePoint(p1, p2);
+			generalPath.lineTo(mPoint[0], mPoint[1]);
+			mPoint = calculatePoint(p3, p2);
+			generalPath.curveTo(p2[0], p2[1], p2[0], p2[1], mPoint[0], mPoint[1]);
+		}
+	}
+	
+
+    private static int[] calculatePoint(int[] p1, int[] p2) {
+		double d1=math.sqrt(math.pow(p1[0]-p2[0], 2)+math.pow(p1[1]-p2[1], 2));
+		double per=ARC_SIZE/d1;
+		
+		double d_x=(p1[0]-p2[0])*per;
+		double d_y=(p1[1]-p2[1])*per;
+		
+		int xx=(int)(p2[0]+d_x);
+		int yy=(int)(p2[1]+d_y);
+		
+		int[] mPoint={xx,yy};
+		return mPoint;
+	}
+}


[25/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
deleted file mode 100644
index 9ddadb3..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.subscription;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.commons.util.OMElementComparator;
-import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-import org.apache.airavata.wsmg.util.BrokerUtil;
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.addressing.EndpointReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SubscriptionState {
-
-    private final Logger logger = LoggerFactory.getLogger(SubscriptionState.class);
-
-    private long creationTime = 0;
-    private long lastAvailableTime = 0;
-
-    private int unAvailableCounter = 0;
-    private boolean isNeverExpire = false;
-    private boolean isWsrmPolicy;
-
-    public String subId;
-    public String curNotif;
-    private String localTopicString;
-    private String xpathString;
-    private String subscribeXml;
-
-    ConsumerInfo consumerInfo = null;
-
-    EndpointReference consumerReference;
-
-    URI consumerURI = null;
-
-    private OutGoingQueue outGoingQueue;
-
-    /**
-     * @return Returns the creationTime.
-     */
-    public long getCreationTime() {
-        return creationTime;
-    }
-
-    /**
-     * @param creationTime
-     *            The creationTime to set.
-     */
-    public void setCreationTime(long creationTime) {
-        this.creationTime = creationTime;
-    }
-
-    public void setId(String id) {
-        subId = id;
-    }
-
-    public String getId() {
-        return subId;
-    }
-
-    public boolean isWsrmPolicy() {
-        return isWsrmPolicy;
-    }
-
-    public void setWsrmPolicy(boolean wsrmPolicy) {
-        this.isWsrmPolicy = wsrmPolicy;
-    }
-
-    // TODO: outGoingQueue is not belong to this class. Move it to elsewhere
-    // related to notification handler in wsntAdapter.
-    public SubscriptionState(EndpointReference consumerRef, boolean useNotify, boolean wsrmEnabled, String topic,
-            String xpath, String type, OutGoingQueue outGoingQueue) {
-        this.consumerReference = consumerRef;
-        try {
-            this.consumerURI = new URI(consumerRef.getAddress());
-        } catch (URISyntaxException e) {
-            // this should not happen
-            logger.error("invalid consumer URI returned by axis om", e);
-
-        }
-        this.outGoingQueue = outGoingQueue;
-        // if (topic == null) {
-        // throw new IllegalArgumentException();
-        // }
-        this.localTopicString = topic;
-        this.xpathString = xpath;
-        this.isWsrmPolicy = wsrmEnabled;
-        consumerInfo = new ConsumerInfo(consumerRef.getAddress(), type, useNotify, false);
-
-    }
-
-    public void resume() {
-        consumerInfo.setPaused(false);
-    }
-
-    public void pause() {
-        consumerInfo.setPaused(true);
-    }
-
-    public String getConsumerIPAddressStr() {
-        return consumerURI.toString();
-    }
-
-    public URI getConsumerAddressURI() {
-        return consumerURI;
-    }
-
-    public String getLocalTopic() {
-        // QName topicExpressionQName =
-        // xsul.util.XsulUtil.toQName(localTopicString, localTopicString
-        // .requiredTextContent());
-        // String topicLocalString = topicExpressionQName.getLocalPart();
-        return localTopicString;
-    }
-
-    /**
-     * @return Returns the consumeReference.
-     */
-    public EndpointReference getConsumerReference() {
-        return consumerReference;
-    }
-
-    /**
-     * @return Returns the curNotif.
-     */
-    public String getCurNotif() {
-        return curNotif;
-    }
-
-    /**
-     * @param curNotif
-     *            The curNotif to set.
-     */
-    public void setCurNotif(String curNotif) {
-        this.curNotif = curNotif;
-    }
-
-    /**
-     * @return Returns the outGoingQueue.
-     */
-    public OutGoingQueue getOutGoingQueue() {
-        return outGoingQueue;
-    }
-
-    /**
-     * @param outGoingQueue
-     *            The outGoingQueue to set.
-     */
-    public void setOutGoingQueue(OutGoingQueue outGoingQueue) {
-        this.outGoingQueue = outGoingQueue;
-    }
-
-    /**
-     * @return Returns the consumerInfo.
-     */
-    public ConsumerInfo getConsumerInfo() {
-        return consumerInfo;
-    }
-
-    public void resetUnAvailableCounter() {
-        unAvailableCounter = 0;
-    }
-
-    public int addUnAvailableCounter() {
-        unAvailableCounter++;
-        return unAvailableCounter;
-    }
-
-    /**
-     * @return Returns the unAvailableCounter.
-     */
-    public int getUnAvailableCounter() {
-        return unAvailableCounter;
-    }
-
-    public String getXpathString() {
-        return xpathString;
-    }
-
-    public void setXpathString(String xpathString) {
-        this.xpathString = xpathString;
-    }
-
-    /**
-     * @return Returns the isNeverExpire.
-     */
-    public boolean isNeverExpire() {
-        return isNeverExpire;
-    }
-
-    /**
-     * @param isNeverExpire
-     *            The isNeverExpire to set.
-     */
-    public void setNeverExpire(boolean neverExpire) {
-        this.isNeverExpire = neverExpire;
-    }
-
-    /**
-     * @return Returns the lastAvailableTime.
-     */
-    public long getLastAvailableTime() {
-        return lastAvailableTime;
-    }
-
-    /**
-     * @param lastAvailableTime
-     *            The lastAvailableTime to set.
-     */
-    public void setLastAvailableTime(long lastAvailableTime) {
-        this.lastAvailableTime = lastAvailableTime;
-
-    }
-
-    public void setSubscribeXml(String xml) {
-        subscribeXml = xml;
-    }
-
-    public String getSubscribeXml() {
-        return subscribeXml;
-    }
-
-    @Override
-    public boolean equals(Object o) {
-        if (o instanceof SubscriptionState) {
-            SubscriptionState subscription = (SubscriptionState) o;
-            return BrokerUtil.sameStringValue(subscription.getLocalTopic(), this.getLocalTopic())
-                    && BrokerUtil.sameStringValue(subscription.getXpathString(), this.getXpathString())
-                    && BrokerUtil.sameStringValue(subscription.getConsumerIPAddressStr(),
-                            this.getConsumerIPAddressStr()) && equalReferenceParameters(subscription);
-        }
-        return false;
-    }
-
-    private boolean equalReferenceParameters(SubscriptionState anotherSubscription) {
-
-        Map<QName, OMElement> otherRefProperties = anotherSubscription.getConsumerReference()
-                .getAllReferenceParameters();
-        Map<QName, OMElement> myRefProperties = getConsumerReference().getAllReferenceParameters();
-
-        /*
-         * Basic comparison
-         */
-        if (otherRefProperties == null && myRefProperties == null) {
-            return true;
-        } else if (otherRefProperties == null || myRefProperties == null) {
-            return false;
-        } else if (otherRefProperties.size() != myRefProperties.size()) {
-            return false;
-        }
-
-        /*
-         * This OMElementComparator supports ignore list, but we don't use it here.
-         */
-        Iterator<Entry<QName, OMElement>> iterator = otherRefProperties.entrySet().iterator();
-        while (iterator.hasNext()) {
-
-            Entry<QName, OMElement> entry = iterator.next();
-            if (!myRefProperties.containsKey(entry.getKey())) {
-                return false;
-            }
-
-            OMElement myElement = myRefProperties.get(entry.getKey());
-            OMElement otherElement = entry.getValue();
-
-            if (!OMElementComparator.compare(myElement, otherElement)) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
deleted file mode 100644
index fe276bf..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.wseventing;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.wsmg.broker.context.ContextParameters;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.broker.context.ProcessingContextBuilder;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.util.BrokerUtil;
-import org.apache.airavata.wsmg.util.WsEventingOperations;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.apache.axis2.context.MessageContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WSEProcessingContextBuilder extends ProcessingContextBuilder {
-
-    private static final Logger logger = LoggerFactory.getLogger(WSEProcessingContextBuilder.class);
-
-    public ProcessingContext build(OMElement elem) {
-
-        ProcessingContext processingContext = new ProcessingContext();
-
-        if (elem != null && elem.getLocalName().equals("Subscribe")) {
-            logger.debug("found subscribe element");
-            onSubscription(processingContext, elem);
-
-        }
-
-        return processingContext;
-    }
-
-    public ProcessingContext build(SOAPEnvelope elem) {
-
-        ProcessingContext context = null;
-
-        SOAPBody soapBody = elem.getBody();
-        if (soapBody != null) {
-
-            context = build(soapBody.getFirstElement());
-
-        } else {
-            context = build((OMElement) null);
-        }
-
-        context.setEnvelope(elem);
-        extractInfoFromHeader(context, elem.getHeader());
-
-        return context;
-    }
-
-    public ProcessingContext build(MessageContext msgContext, WsEventingOperations operation) {
-
-        ProcessingContext processingContext = new ProcessingContext();
-
-        switch (operation) {
-        case SUBSCRIBE: {
-
-            Iterator<OMElement> iterator = msgContext.getEnvelope().getBody()
-                    .getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(), "Subscribe"));
-
-            if (!iterator.hasNext()) {
-                throw new RuntimeException("invalid subscription message - no subscribe element");
-            }
-
-            onSubscription(processingContext, iterator.next());
-        }
-            break;
-
-        }
-
-        processingContext.setMessageConext(msgContext);
-        processingContext.setEnvelope(msgContext.getEnvelope());
-        extractInfoFromHeader(processingContext, msgContext.getEnvelope().getHeader());
-        String topicFromUrl = BrokerUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
-
-        processingContext.setContextParameter(ContextParameters.TOPIC_FROM_URL, topicFromUrl);
-
-        return processingContext;
-    }
-
-    /**
-     * @param processingContext
-     * @param subscribeElement
-     */
-    private void onSubscription(ProcessingContext processingContext, OMElement subscribeElement) {
-
-        processingContext.setContextParameter(ContextParameters.SUBSCRIBE_ELEMENT, subscribeElement);
-
-        // -- check optional element - expires
-        Iterator iterator = subscribeElement.getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(),
-                "Expires"));
-
-        if (iterator.hasNext()) {
-
-            processingContext.setContextParameter(ContextParameters.SUBSCRIBER_EXPIRES,
-                    ((OMElement) iterator.next()).getText());
-
-        }
-
-        iterator = subscribeElement
-                .getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(), "Filter"));
-
-        if (!iterator.hasNext()) {
-
-            throw new RuntimeException("invalid subscription - unable to find filter dialet");
-
-        }
-
-        processingContext.setContextParameter(ContextParameters.FILTER_ELEMENT, iterator.next());
-
-        iterator = subscribeElement.getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(),
-                "Delivery"));
-
-        if (!iterator.hasNext()) {
-            throw new RuntimeException("invalid subscription - unable to find delivery tag");
-        }
-
-        OMElement delivery = (OMElement) iterator.next();
-
-        iterator = delivery.getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(), "NotifyTo"));
-
-        if (!iterator.hasNext()) {
-            throw new RuntimeException("invalid subscription - unable to find NotifyTo tag");
-        }
-
-        OMElement notifyToElement = (OMElement) iterator.next();
-
-        processingContext.setContextParameter(ContextParameters.NOTIFY_TO_ELEMENT, notifyToElement);
-
-        try {
-
-            processingContext.setContextParameter(ContextParameters.NOTIFY_TO_EPR,
-                    EndpointReferenceHelper.fromOM(notifyToElement));
-
-        } catch (AxisFault e) {
-            throw new RuntimeException("invalid subscription - unable to parse notify to end point reference", e);
-        }
-
-    }
-
-    private void extractInfoFromHeader(ProcessingContext context, SOAPHeader header) {
-
-        Iterator ite = header.getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(),
-                WsmgCommonConstants.SUBSCRIPTION_ID));
-
-        if (ite.hasNext()) {
-            OMElement identifier = (OMElement) ite.next();
-            logger.debug("extracted identifier " + identifier.getText());
-
-            context.setContextParameter(ContextParameters.SUB_ID, identifier.getText());
-
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
deleted file mode 100644
index f17a980..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.wseventing;
-
-import java.util.Calendar;
-import java.util.Date;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.wsmg.broker.context.ContextParameters;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.apache.airavata.wsmg.commons.CommonRoutines;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-import org.apache.airavata.wsmg.util.BrokerUtil;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WSEProtocolSupport {
-
-    private static final Logger log = LoggerFactory.getLogger(WSEProtocolSupport.class);
-
-    public SubscriptionState createSubscriptionState(ProcessingContext ctx, OutGoingQueue outgoingQueue)
-            throws AxisFault {
-
-        boolean neverExpire = false; // is true if expiration time is less than
-        String topicLocalString = "";
-        String xpathString = "";
-        EndpointReference consumerReference = ctx.getContextParameter(ContextParameters.NOTIFY_TO_EPR);
-
-        if (consumerReference == null) {
-            throw new AxisFault("Only Push delivery Mode (NotifyTo) is supported in WSE");
-        }
-
-        String expireTimeString = ctx.getContextParameter(ContextParameters.SUBSCRIBER_EXPIRES);
-
-        if (expireTimeString == null) {
-            neverExpire = true;
-
-        } else {
-
-            long expireTime = Long.valueOf(expireTimeString);
-            if (expireTime < 0) {
-                neverExpire = true;
-            }
-        }
-
-        OMElement filterEl = ctx.getContextParameter(ContextParameters.FILTER_ELEMENT);
-
-        if (filterEl == null) {
-
-            topicLocalString = ctx.getContextParameter(ContextParameters.TOPIC_FROM_URL);
-
-            if (topicLocalString == null) {
-                topicLocalString = WsmgCommonConstants.WILDCARD_TOPIC;
-            }
-
-            log.debug("got topicLocalString=" + topicLocalString);
-            // topicLocalString = "wseTopic";
-            // // a special topic, used in WSNT and JMS. Do not use a
-            // wildcard topic here since wildcard string varies by system
-        } else {
-
-            String filterDialectAttrib = filterEl.getAttributeValue(new QName(null, "Dialect"));
-
-            if (filterDialectAttrib.compareTo(WsmgCommonConstants.TOPIC_EXPRESSION_SIMPLE_DIALECT) == 0) {
-                topicLocalString = BrokerUtil.getTopicLocalString(filterEl.getText()); // get what ever inside this
-                                                                                       // element
-
-                if (topicLocalString == null) {
-                    throw new AxisFault("topic is not given in the subscription");
-                }
-
-            } else if (filterDialectAttrib.compareTo(WsmgCommonConstants.XPATH_DIALECT) == 0) {
-
-                // use topicFromUrl if
-                // was provided
-                topicLocalString = ctx.getContextParameter(ContextParameters.TOPIC_FROM_URL);
-
-                xpathString = filterEl.getText();
-
-                log.debug("got topicLocalString=" + topicLocalString + " xpathString=" + xpathString);
-
-                // TODO: Add XPath canonicalization here in the parsing. To
-                // generate a
-                // canonicalized XPath string
-                // Possibly use Query query =
-                // XPQuery.parseQuery(xpathExpression, index);
-                if (xpathString == null) {
-                    throw new AxisFault("xpath expression is not given");
-                }
-            } else if (filterDialectAttrib.compareTo(WsmgCommonConstants.TOPIC_AND_XPATH_DIALECT) == 0) {
-                OMElement topicEl = filterEl.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
-                        .getNamespaceURI(), "TopicExpression"));
-                if (topicEl != null) {
-                    topicLocalString = BrokerUtil.getTopicLocalString(topicEl.getText());
-                }
-                OMElement xpathEl = filterEl.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
-                        .getNamespaceURI(), "MessageContent"));
-                if (xpathEl != null) {
-                    xpathString = xpathEl.getText();
-                    if (xpathString == null && topicLocalString == null) {
-                        throw new AxisFault("Both topic string and " + "XPath String are null!");
-                    }
-                }
-            } else {
-                throw new AxisFault("Unkown dialect: ");
-                // topicLocalString = "wseTopic"; //a special topic, used in
-                // WSNT and JMS
-            }
-
-        }
-
-        if (topicLocalString == null || topicLocalString.length() == 0) {
-            topicLocalString = WsmgCommonConstants.WILDCARD_TOPIC;
-        }
-
-        // Create SubscriptionState Object
-        SubscriptionState state = new SubscriptionState(consumerReference, true, false, topicLocalString, xpathString,
-                "wse", outgoingQueue);
-
-        state.setNeverExpire(neverExpire); // default false
-
-        return state;
-    }
-
-    public void createSubscribeResponse(ProcessingContext ctx, String subId) throws AxisFault {
-
-        OMFactory factory = OMAbstractFactory.getOMFactory();
-
-        ctx.addResponseMsgNameSpaces(NameSpaceConstants.WSE_NS);
-
-        OMElement responseMessage = factory.createOMElement("SubscribeResponse", NameSpaceConstants.WSE_NS);
-
-        OMElement identifier = factory.createOMElement(WsmgCommonConstants.SUBSCRIPTION_ID,
-                responseMessage.getNamespace());
-        identifier.setText(subId);
-        EndpointReference serviceLocationEndpointReference = new EndpointReference(ctx.getMessageContext()
-                .getAxisService().getEndpointURL());
-
-        serviceLocationEndpointReference.addReferenceParameter(identifier);
-
-        OMElement expiresEl = factory.createOMElement("Expires", responseMessage.getNamespace(), responseMessage);
-
-        Date expiration = getFutureExpirationDate();
-        String dateString = CommonRoutines.getXsdDateTime(expiration);
-        expiresEl.setText(dateString);
-
-        OMElement subscriptionManagerEpr = null;
-        try {
-
-            subscriptionManagerEpr = EndpointReferenceHelper.toOM(factory, serviceLocationEndpointReference, new QName(
-                    NameSpaceConstants.WSE_NS.getNamespaceURI(), "SubscriptionManager"), NameSpaceConstants.WSA_NS
-                    .getNamespaceURI());
-
-            responseMessage.addChild(subscriptionManagerEpr);
-            subscriptionManagerEpr.setNamespace(responseMessage.getNamespace());
-        } catch (AxisFault e) {
-            log.error("unable to resolve EPR from OM", e);
-            throw e;
-        }
-
-        ctx.setRespMessage(responseMessage);
-    }
-
-    private Date getFutureExpirationDate() {
-        // Get a Calendar for current locale and time zone
-        Calendar cal = Calendar.getInstance();
-        // currentDate.setDate(currentDate.getDate()+1);
-        // Get a Date object that represents 30 days from now
-        Date currentDate = new Date(); // Current date
-        cal.setTime(currentDate); // Set it in the Calendar object
-        cal.add(Calendar.DATE, 30); // Add 30 days
-        Date expiration = cal.getTime(); // Retrieve the resulting date
-        return expiration;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingMsgReceiver.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingMsgReceiver.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingMsgReceiver.java
deleted file mode 100644
index 6af3bc5..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingMsgReceiver.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.wseventing;
-
-import org.apache.airavata.wsmg.broker.AbstractBrokerMsgReceiver;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
-import org.apache.airavata.wsmg.util.WsEventingOperations;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * BrokerServiceMessageReceiverInOut message receiver
- */
-
-public class WSEventingMsgReceiver extends AbstractBrokerMsgReceiver {
-
-    private static final Logger log = LoggerFactory.getLogger(WSEventingMsgReceiver.class);
-    WSEProcessingContextBuilder builder = new WSEProcessingContextBuilder();
-
-    public MessageContext process(MessageContext inMsg, String operationName) throws AxisFault {
-
-        WsEventingOperations msgType = WsEventingOperations.valueFrom(operationName);
-        ProcessingContext processingContext = builder.build(inMsg, msgType);
-        MessageContext outputMsg = null;
-
-        log.debug("WS-Eventing: " + msgType);
-
-        switch (msgType) {
-        case SUBSCRIBE: {
-            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
-                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
-
-            brokerConfigContext.getSubscriptionManager().subscribe(processingContext);
-            outputMsg = createOutputMessageContext(inMsg, processingContext);
-            break;
-        }
-        case UNSUBSCRIBE: {
-            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
-                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
-
-            brokerConfigContext.getSubscriptionManager().unsubscribe(processingContext);
-            outputMsg = createOutputMessageContext(inMsg, processingContext);
-            break;
-        }
-        case RENEW:
-        case GET_STATUS:
-        case SUBSCRIPTION_END:
-        default:
-            throw new AxisFault("unsupported operation" + msgType.toString());
-
-        }
-        return outputMsg;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingPublishMsgReceiver.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingPublishMsgReceiver.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingPublishMsgReceiver.java
deleted file mode 100644
index 63c6bbc..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingPublishMsgReceiver.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.wseventing;
-
-import org.apache.airavata.wsmg.broker.AbstractBrokerMsgReceiver;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
-import org.apache.airavata.wsmg.util.WsEventingOperations;
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-
-public class WSEventingPublishMsgReceiver extends AbstractBrokerMsgReceiver {
-
-    WSEProcessingContextBuilder builder = new WSEProcessingContextBuilder();
-
-    @Override
-    protected MessageContext process(MessageContext inMsgContext, String operationName) throws AxisFault {
-
-        ProcessingContext processingContext = builder.build(inMsgContext, WsEventingOperations.PUBLISH);
-
-        try {
-
-            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsgContext
-                    .getConfigurationContext().getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
-
-            brokerConfigContext.getNotificationProcessor().processMsg(processingContext, NameSpaceConstants.WSE_NS);
-        } catch (Exception e) {
-            throw new AxisFault("unable to process message", e);
-        }
-        return createOutputMessageContext(inMsgContext, processingContext);
-    }
-
-    @Override
-    protected MessageContext createOutputMessageContext(MessageContext inMsg, ProcessingContext processingContext)
-            throws AxisFault {
-
-        MessageContext outputContext = null;
-
-        OMElement responseMessage = processingContext.getRespMessage();
-        if (responseMessage != null) {
-
-            outputContext = super.createOutputMessageContext(inMsg, processingContext);
-
-            String responseAction = String.format("%s/%s", NameSpaceConstants.WSE_NS.getNamespaceURI(),
-                    responseMessage.getLocalName());
-
-            outputContext.setSoapAction(responseAction);
-        }
-
-        return outputContext;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
deleted file mode 100644
index c8d3e37..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.wsnotification;
-
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.wsmg.broker.context.ContextParameters;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-import org.apache.airavata.wsmg.util.BrokerUtil;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WSNTProtocolSupport {
-
-    private static final Logger log = LoggerFactory.getLogger(WSNTProtocolSupport.class);
-
-    public SubscriptionState createSubscriptionState(ProcessingContext ctx, OutGoingQueue outgoingQueue)
-            throws AxisFault {
-
-        EndpointReference consumerReference = ctx.getContextParameter(ContextParameters.NOTIFY_TO_EPR);
-
-        if (consumerReference == null) {
-            throw new AxisFault("Only Push delivery Mode (NotifyTo) is supported");
-        }
-
-        boolean neverExpire = false; // is true if expiration time is less than
-        boolean useNotify = true; // notify by event notifications
-        boolean wsrmEnabled = false;
-        String topicLocalString = "";
-        String xpathString = "";
-
-        String expireTimeString = ctx.getContextParameter(ContextParameters.SUBSCRIBER_EXPIRES);
-
-        if (expireTimeString == null) {
-            neverExpire = true;
-        } else {
-            long expireTime = Long.valueOf(expireTimeString);
-            if (expireTime < 0) {
-                neverExpire = true;
-            }
-        }
-
-        OMElement useNotifyEl = ctx.getContextParameter(ContextParameters.USE_NOTIFY_ELEMENT);
-        if (useNotifyEl != null) {
-            String s = useNotifyEl.getText();
-            useNotify = Boolean.valueOf(s);
-        }
-
-        // get policy if exist
-        OMElement element = ctx.getContextParameter(ContextParameters.SUB_POLICY);
-        if (element != null) {
-            wsrmEnabled = true;
-        }
-
-        OMElement topicExpressionEl = ctx.getContextParameter(ContextParameters.TOPIC_EXPRESSION_ELEMENT);
-
-        if (topicExpressionEl != null) {
-            topicLocalString = BrokerUtil.getTopicLocalString(topicExpressionEl.getText());
-        }
-
-        OMElement xpathEl = ctx.getContextParameter(ContextParameters.XPATH_ELEMENT);
-
-        if (xpathEl != null) {
-            xpathString = BrokerUtil.getXPathString(xpathEl);
-        }
-        if (xpathString == null && topicLocalString == null) {
-            throw new AxisFault("Both topic string and XPath String are null!");
-
-        }
-
-        if (topicLocalString == null || topicLocalString.length() == 0) {
-            topicLocalString = WsmgCommonConstants.WILDCARD_TOPIC;
-        }
-
-        // Create SubscriptionState Object
-        SubscriptionState state = new SubscriptionState(consumerReference, useNotify, wsrmEnabled, topicLocalString,
-                xpathString, "wsnt", outgoingQueue);
-
-        state.setNeverExpire(neverExpire); // default false
-
-        return state;
-    }
-
-    public void createSubscribeResponse(ProcessingContext ctx, String subId) throws AxisFault {
-
-        OMFactory factory = OMAbstractFactory.getOMFactory();
-
-        ctx.addResponseMsgNameSpaces(NameSpaceConstants.WSNT_NS);
-        OMElement responseMessage = factory.createOMElement("SubscribeResponse", NameSpaceConstants.WSNT_NS);
-
-        OMElement identifier = factory.createOMElement(WsmgCommonConstants.SUBSCRIPTION_ID,
-                responseMessage.getNamespace());
-        identifier.setText(subId);
-        EndpointReference serviceLocationEndpointReference = new EndpointReference(ctx.getMessageContext()
-                .getAxisService().getEndpointURL());
-        serviceLocationEndpointReference.addReferenceParameter(identifier);
-
-        OMElement subscriptionReference = null;
-        try {
-            subscriptionReference = EndpointReferenceHelper.toOM(factory, serviceLocationEndpointReference, new QName(
-                    "SubscriptionReference"), NameSpaceConstants.WSA_NS.getNamespaceURI());
-
-            responseMessage.addChild(subscriptionReference);
-            subscriptionReference.setNamespace(responseMessage.getNamespace());
-
-        } catch (AxisFault e) {
-            log.error("unable to resolve EPR from OM", e);
-            throw e;
-        }
-
-        ctx.setRespMessage(responseMessage);
-    }
-
-    public static class Client {
-
-        public static OMElement createSubscriptionMsg(EndpointReference eventSinkLocation, String topicExpression,
-                String xpathExpression) throws AxisFault {
-            OMFactory factory = OMAbstractFactory.getOMFactory();
-
-            OMElement message = factory.createOMElement("SubscribeRequest", NameSpaceConstants.WSNT_NS);
-
-            if (topicExpression != null) {
-                OMElement topicExpEl = factory.createOMElement("TopicExpression", NameSpaceConstants.WSNT_NS, message);
-
-                topicExpEl.addAttribute("Dialect", WsmgCommonConstants.TOPIC_EXPRESSION_SIMPLE_DIALECT,
-                        NameSpaceConstants.WSNT_NS);
-                topicExpEl.declareNamespace(NameSpaceConstants.WIDGET_NS);
-                topicExpEl.setText(NameSpaceConstants.WIDGET_NS.getPrefix() + ":" + topicExpression);
-            }
-
-            if (xpathExpression != null) {
-                OMElement xpathExpEl = factory.createOMElement("Selector", NameSpaceConstants.WSNT_NS, message);
-                xpathExpEl.addAttribute("Dialect", WsmgCommonConstants.XPATH_DIALECT, null);
-                xpathExpEl.setText(xpathExpression);
-            }
-
-            OMElement useNotifyEl = factory.createOMElement("UseNotify", message.getNamespace(), message);
-            useNotifyEl.setText("true");// check wether we still need this
-
-            OMElement eprCrEl = EndpointReferenceHelper.toOM(factory, eventSinkLocation,
-                    new QName("ConsumerReference"), NameSpaceConstants.WSA_NS.getNamespaceURI());
-
-            message.addChild(eprCrEl);
-            eprCrEl.setNamespace(message.getNamespace());
-
-            return message;
-        }
-
-        public static String decodeSubscriptionResponse(OMElement subscriptionReference) throws AxisFault {
-
-            String subscriptionId = null;
-
-            EndpointReference subscriptionReferenceEPR = EndpointReferenceHelper.fromOM(subscriptionReference);
-
-            Map<QName, OMElement> referenceParams = subscriptionReferenceEPR.getAllReferenceParameters();
-
-            if (referenceParams != null) {
-                QName identifierQName = new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(),
-                        WsmgCommonConstants.SUBSCRIPTION_ID);
-
-                OMElement identifierEl = referenceParams.get(identifierQName);
-                subscriptionId = (identifierEl != null) ? identifierEl.getText() : null;
-
-            }
-
-            return subscriptionId;
-        }
-
-        public static OMElement createUnsubscribeMsg() {
-            OMFactory factory = OMAbstractFactory.getOMFactory();
-            OMElement message = factory.createOMElement("UnsubsribeRequest", NameSpaceConstants.WSNT_NS);
-
-            return message;
-        }
-
-        public static OMElement encodeNotification(String topic, OMElement message, EndpointReference producerReference)
-                throws AxisFault {
-            OMFactory factory = OMAbstractFactory.getOMFactory();
-
-            OMElement topicExpEl = factory.createOMElement("Topic", NameSpaceConstants.WSNT_NS);
-            topicExpEl.addAttribute("Dialect", WsmgCommonConstants.TOPIC_EXPRESSION_SIMPLE_DIALECT, null);
-            topicExpEl.declareNamespace(NameSpaceConstants.WIDGET_NS);
-            topicExpEl.setText(NameSpaceConstants.WIDGET_NS.getPrefix() + ":" + topic);
-
-            OMElement messageToNotify = factory.createOMElement("Notify", NameSpaceConstants.WSNT_NS);
-            messageToNotify.declareNamespace(NameSpaceConstants.WSNT_NS);
-            messageToNotify.declareNamespace(NameSpaceConstants.WSA_NS);
-            OMElement notificationMesssageEl = factory.createOMElement("NotificationMessage",
-                    messageToNotify.getNamespace(), messageToNotify);
-
-            notificationMesssageEl.addChild(topicExpEl);
-
-            notificationMesssageEl.addChild(EndpointReferenceHelper.toOM(factory, producerReference, new QName(
-                    notificationMesssageEl.getNamespace().getNamespaceURI(), "ProducerReference",
-                    notificationMesssageEl.getNamespace().getPrefix()), NameSpaceConstants.WSA_NS.getNamespaceURI()));
-
-            OMElement messageEl = factory.createOMElement("Message", notificationMesssageEl.getNamespace(),
-                    notificationMesssageEl);
-
-            messageEl.addChild(message);
-            return messageToNotify;
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationMsgReceiver.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationMsgReceiver.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationMsgReceiver.java
deleted file mode 100644
index 9d32ee9..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationMsgReceiver.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.wsnotification;
-
-import org.apache.airavata.wsmg.broker.AbstractBrokerMsgReceiver;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
-import org.apache.airavata.wsmg.util.WsNotificationOperations;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * BrokerServiceMessageReceiverInOut message receiver
- */
-
-public class WSNotificationMsgReceiver extends AbstractBrokerMsgReceiver {
-
-    private static final Logger log = LoggerFactory.getLogger(WSNotificationMsgReceiver.class);
-
-    WSNotificationProcessingContextBuilder builder = new WSNotificationProcessingContextBuilder();
-
-    public MessageContext process(MessageContext inMsg, String operationName) throws AxisFault {
-
-        WsNotificationOperations msgType = WsNotificationOperations.valueFrom(operationName);
-
-        ProcessingContext processingContext = builder.build(inMsg, msgType);
-
-        MessageContext outputMsg = null;
-
-        switch (msgType) {
-        case NOTIFY: {
-            try {
-
-                WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg
-                        .getConfigurationContext().getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
-
-                brokerConfigContext.getNotificationProcessor()
-                        .processMsg(processingContext, NameSpaceConstants.WSNT_NS);
-            } catch (Exception e) {
-                throw new AxisFault("unable to process message", e);
-            }
-            outputMsg = createOutputMessageContext(inMsg, processingContext);
-            break;
-        }
-        case SUBSCRIBE: {
-
-            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
-                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
-            brokerConfigContext.getSubscriptionManager().subscribe(processingContext);
-            outputMsg = createOutputMessageContext(inMsg, processingContext);
-            break;
-        }
-        case UNSUBSCRIBE: {
-
-            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
-                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
-
-            brokerConfigContext.getSubscriptionManager().unsubscribe(processingContext);
-            outputMsg = createOutputMessageContext(inMsg, processingContext);
-            break;
-        }
-        case RESUME_SUBSCRIPTION: {
-
-            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
-                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
-
-            brokerConfigContext.getSubscriptionManager().resumeSubscription(processingContext);
-            outputMsg = createOutputMessageContext(inMsg, processingContext);
-            break;
-        }
-        case PAUSE_SUBSCRIPTION: {
-            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
-                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
-
-            brokerConfigContext.getSubscriptionManager().pauseSubscription(processingContext);
-            outputMsg = createOutputMessageContext(inMsg, processingContext);
-            break;
-        }
-        case GET_CURRENT_MSG:
-        default:
-            throw new AxisFault("not implemented yet");
-        }
-
-        return outputMsg;
-    }
-
-}// end of class

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
deleted file mode 100644
index b517234..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker.wsnotification;
-
-import java.util.Iterator;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.wsmg.broker.context.ContextParameters;
-import org.apache.airavata.wsmg.broker.context.ProcessingContext;
-import org.apache.airavata.wsmg.broker.context.ProcessingContextBuilder;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.util.BrokerUtil;
-import org.apache.airavata.wsmg.util.WsNotificationOperations;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPHeader;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.addressing.EndpointReferenceHelper;
-import org.apache.axis2.context.MessageContext;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WSNotificationProcessingContextBuilder extends ProcessingContextBuilder {
-
-    private static final Logger logger = LoggerFactory.getLogger(WSNotificationProcessingContextBuilder.class);
-
-    public ProcessingContext build(OMElement elem) {
-
-        ProcessingContext processingContext = new ProcessingContext();
-
-        if (elem == null
-                || (!elem.getNamespace().getNamespaceURI().equals(NameSpaceConstants.WSNT_NS.getNamespaceURI()))) {
-
-            logger.warn("invalid message payload recieved: " + elem);
-
-            return processingContext;
-        }
-
-        String localName = elem.getLocalName();
-
-        if (localName.equals("SubscribeRequest")) {
-            onSubscription(processingContext, elem);
-        }
-        return processingContext;
-    }
-
-    public void onSubscription(ProcessingContext context, OMElement subscribeElement) {
-        context.setContextParameter(ContextParameters.SUBSCRIBE_ELEMENT, subscribeElement);
-
-        OMElement consumerReference = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
-                .getNamespaceURI(), "ConsumerReference"));
-        if (consumerReference == null) {
-            logger.warn("unable to find consumer reference" + " in subscribe message: " + subscribeElement);
-            return;
-        }
-        context.setContextParameter(ContextParameters.NOTIFY_TO_ELEMENT, consumerReference);
-
-        try {
-            EndpointReference consumerEpr = EndpointReferenceHelper.fromOM(consumerReference);
-            context.setContextParameter(ContextParameters.NOTIFY_TO_EPR, consumerEpr);
-
-        } catch (AxisFault e) {
-            logger.warn("invalid epr", e);
-            return;
-        }
-
-        OMElement topicExpression = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
-                .getNamespaceURI(), "TopicExpression"));
-
-        if (topicExpression != null) { // topic can be null
-
-            context.setContextParameter(ContextParameters.TOPIC_EXPRESSION_ELEMENT, topicExpression);
-
-        }
-
-        OMElement useNotify = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
-                .getNamespaceURI(), "UseNotify"));
-
-        if (useNotify != null) {
-            context.setContextParameter(ContextParameters.USE_NOTIFY_ELEMENT, useNotify);
-        }
-
-        OMElement selector = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
-                .getNamespaceURI(), "Selector"));
-
-        if (selector != null) {
-            context.setContextParameter(ContextParameters.XPATH_ELEMENT, selector);
-        }
-
-        OMElement subscriptionPolicy = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
-                .getNamespaceURI(), WsmgCommonConstants.SUBSCRIPTION_POLICY));
-
-        if (subscriptionPolicy != null) {
-            context.setContextParameter(ContextParameters.SUB_POLICY, subscriptionPolicy);
-        }
-
-    }
-
-    public ProcessingContext build(MessageContext msgContext, WsNotificationOperations operation) {
-        ProcessingContext context = new ProcessingContext();
-
-        SOAPEnvelope soapEnvelope = msgContext.getEnvelope();
-
-        if (soapEnvelope == null) {
-            throw new RuntimeException("invalid message context - envelope is not found");
-        }
-
-        SOAPBody soapBody = soapEnvelope.getBody();
-
-        if (soapBody == null) {
-            throw new RuntimeException("invalid message context - soap envelope is not found");
-        }
-
-        SOAPHeader soapHeader = soapEnvelope.getHeader();
-
-        if (soapHeader == null) {
-            throw new RuntimeException("invalid message context - soap header is not found");
-        }
-
-        switch (operation) {
-        case SUBSCRIBE: {
-
-            Iterator<OMElement> iterator = soapBody.getChildrenWithName(new QName(NameSpaceConstants.WSNT_NS
-                    .getNamespaceURI(), "SubscribeRequest"));
-            if (!iterator.hasNext()) {
-                throw new RuntimeException("invalid message context - unable to find Subscribe information");
-            }
-
-            onSubscription(context, iterator.next());
-        }
-            break;
-        }
-
-        context.setEnvelope(soapEnvelope);
-        extractInfoFromHeader(context, soapHeader);
-        context.setMessageConext(msgContext);
-        String topicFromUrl = BrokerUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
-        context.setContextParameter(ContextParameters.TOPIC_FROM_URL, topicFromUrl);
-
-        return context;
-    }
-
-    private void extractInfoFromHeader(ProcessingContext context, SOAPHeader header) {
-
-        Iterator ite = header.getChildrenWithName(new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(),
-                WsmgCommonConstants.SUBSCRIPTION_ID));
-        if (ite.hasNext()) {
-            OMElement identifier = (OMElement) ite.next();
-            logger.debug("extracted identifier " + identifier.getText());
-
-            context.setContextParameter(ContextParameters.SUB_ID, identifier.getText());
-
-        }
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/OutGoingMessage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/OutGoingMessage.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/OutGoingMessage.java
deleted file mode 100644
index 73eba17..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/OutGoingMessage.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.commons;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-
-public class OutGoingMessage implements Serializable {
-    /**
-	 * 
-	 */
-    private static final long serialVersionUID = -6999667921413261492L;
-
-    String textMessage;
-
-    AdditionalMessageContent additionalMessageContent;
-
-    List<ConsumerInfo> consumerInfoList = null;
-
-    // ConsumerInfo consumerInfo=null;
-
-    /**
-	 * 
-	 */
-    public OutGoingMessage() {
-        // super();
-        // TODO Auto-generated constructor stub
-        // consumerInfo=new ConsumerInfo();
-    }
-
-    /**
-     * @param textMessage
-     * @param additionalMessageContent
-     * @param consumerInfoList
-     */
-    public OutGoingMessage(String textMessage, AdditionalMessageContent additionalMessageContent,
-            List<ConsumerInfo> consumerInfoList) {
-        super();
-        // TODO Auto-generated constructor stub
-        this.textMessage = textMessage;
-        this.additionalMessageContent = additionalMessageContent;
-        this.consumerInfoList = consumerInfoList;
-    }
-
-    /**
-     * @param consumerInfo
-     *            The consumerInfo to set.
-     */
-    public void addConsumerInfo(ConsumerInfo consumerInfo) {
-        // this.consumerInfo = consumerInfo;
-        if (consumerInfoList == null) {
-            consumerInfoList = new ArrayList<ConsumerInfo>();
-        }
-        consumerInfoList.add(consumerInfo);
-    }
-
-    /**
-     * @return Returns the textMessage.
-     */
-    public String getTextMessage() {
-        return textMessage;
-    }
-
-    /**
-     * @param textMessage
-     *            The textMessage to set.
-     */
-    public void setTextMessage(String textMessage) {
-        this.textMessage = textMessage;
-    }
-
-    /**
-     * @return Returns the consumerInfoList.
-     */
-    public List<ConsumerInfo> getConsumerInfoList() {
-        return consumerInfoList;
-    }
-
-    /**
-     * @param consumerInfoList
-     *            The consumerInfoList to set.
-     */
-    public void setConsumerInfoList(List<ConsumerInfo> consumerInfoList) {
-        this.consumerInfoList = consumerInfoList;
-    }
-
-    /**
-     * @return Returns the soapHeader.
-     */
-    public AdditionalMessageContent getAdditionalMessageContent() {
-        return additionalMessageContent;
-    }
-
-    /**
-     * @param soapHeader
-     *            The soapHeader to set.
-     */
-    public void setAdditionalMessageContent(AdditionalMessageContent soapHeader) {
-        this.additionalMessageContent = soapHeader;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgInMemoryStorage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgInMemoryStorage.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgInMemoryStorage.java
deleted file mode 100644
index 6b051b1..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgInMemoryStorage.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.commons.storage;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionEntry;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-
-public class WsmgInMemoryStorage implements WsmgStorage, WsmgQueue {
-
-    private LinkedBlockingQueue<Object> queue = new LinkedBlockingQueue<Object>();
-
-    private Map<String, SubscriptionState> expirableSubscriptions = new ConcurrentHashMap<String, SubscriptionState>();
-
-    private Map<String, SubscriptionState> unexpirableSubscriptions = new ConcurrentHashMap<String, SubscriptionState>();
-
-    public void dispose() {
-        queue.clear();
-        expirableSubscriptions.clear();
-        unexpirableSubscriptions.clear();
-    }
-
-    public int insert(SubscriptionState subscription) {
-        if (subscription.isNeverExpire()) {
-            unexpirableSubscriptions.put(subscription.getId(), subscription);
-        } else {
-            expirableSubscriptions.put(subscription.getId(), subscription);
-        }
-        return 0;
-    }
-
-    public int delete(String subscriptionId) {
-        expirableSubscriptions.remove(subscriptionId);
-        unexpirableSubscriptions.remove(subscriptionId);
-        return 0;
-    }
-
-    public List<SubscriptionEntry> getAllSubscription() {
-
-        List<SubscriptionEntry> ret = new ArrayList<SubscriptionEntry>(expirableSubscriptions.size()
-                + unexpirableSubscriptions.size());
-
-        Collection<SubscriptionState> entries = expirableSubscriptions.values();
-
-        for (SubscriptionState s : entries) {
-            SubscriptionEntry se = new SubscriptionEntry();
-            se.setSubscribeXml(s.getSubscribeXml());
-            se.setSubscriptionId(s.getId());
-            ret.add(se);
-        }
-        entries = unexpirableSubscriptions.values();
-        for (SubscriptionState s : entries) {
-            SubscriptionEntry se = new SubscriptionEntry();
-            se.setSubscribeXml(s.getSubscribeXml());
-            se.setSubscriptionId(s.getId());
-            ret.add(se);
-        }
-
-        return ret;
-    }
-
-    public Object blockingDequeue() {
-        Object obj = null;
-
-        try {
-            obj = queue.take();
-        } catch (InterruptedException ie) {
-            throw new RuntimeException("interruped exception occured", ie);
-        }
-
-        return obj;
-    }
-
-    public void cleanup() {
-        queue.clear();
-    }
-
-    public void enqueue(Object object, String trackId) {
-        queue.offer(object);
-    }
-}


[59/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphGUI.java
new file mode 100644
index 0000000..15379bb
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphGUI.java
@@ -0,0 +1,198 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph;
+
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.swing.SwingUtilities;
+
+import org.apache.airavata.workflow.model.graph.Edge;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.GraphPiece;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.system.MemoNode;
+import org.apache.airavata.workflow.model.graph.system.StreamSourceNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+
+public class GraphGUI implements GraphPieceGUI {
+
+    private Graph graph;
+
+    /**
+     * @param graph
+     */
+    public GraphGUI(Graph graph) {
+        this.graph = graph;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
+     *      org.apache.airavata.xbaya.XBayaEngine)
+     */
+    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+        GraphPiece piece = getGraphPieceAt(event.getPoint());
+        if (piece != null && graph.isEditable()) {
+            NodeController.getGUI(piece).mouseClicked(event, engine);
+        }
+    }
+
+    /**
+     * Gets the bounding Rectangle of this Graph.
+     * 
+     * @return A rectangle indicating this component's bounds
+     */
+    protected Rectangle getBounds() {
+        Rectangle bounds = new Rectangle();
+        for (Node node : this.graph.getNodes()) {
+            bounds.add(NodeController.getGUI(node).getBounds());
+        }
+        final int margin = 10;
+        bounds.height += margin;
+        bounds.width += margin;
+        return bounds;
+    }
+
+    /**
+     * @param g
+     */
+    protected void paint(Graphics2D g) {
+
+        // Calcurate the widge of the nodes.
+        for (Node node : this.graph.getNodes()) {
+        	NodeController.getGUI(node).calculatePositions(g);
+        }
+
+        LinkedList<Node> nodes = new LinkedList<Node>(this.graph.getNodes());
+        List<MemoNode> memoNodes = GraphUtil.getNodes(this.graph, MemoNode.class);
+        nodes.removeAll(memoNodes);
+
+        // Paints the edges before nodes.
+        for (Edge edge : this.graph.getEdges()) {
+            NodeController.getGUI(edge).paint(g);
+        }
+
+        // Paint regular nodes.
+        // The ports are painted from inside of each node.
+        for (Node node : nodes) {
+        	NodeController.getGUI(node).paint(g);
+        }
+
+        // Print memoNodes at last so that they stay on top of everything.
+        for (MemoNode node : memoNodes) {
+            NodeController.getGUI(node).paint(g);
+        }
+    }
+
+    protected StreamSourceNode getStreamSourceAt(Point point) {
+        for (Node node : this.graph.getNodes()) {
+            // Check the node first
+            if (NodeController.getGUI(node).isIn(point) && node instanceof StreamSourceNode) {
+                return (StreamSourceNode) node;
+            }
+        }
+        return null;
+    }
+
+    /**
+     * Returns the visible object at the specified location. The object is either a Node, a Port, or an Edge.
+     * 
+     * @param point
+     *            The location
+     * @return The visible object a the specified location
+     */
+    protected GraphPiece getGraphPieceAt(Point point) {
+
+        GraphPiece piece = null;
+
+        // Starts from edge because it is drawn first, which means it's at the
+        // bottom.
+        double minEdgeDist = Double.MAX_VALUE;
+        Edge closestEdge = null;
+        for (Edge edge : this.graph.getEdges()) {
+            double dist = NodeController.getGUI(edge).getMiddlePosition().distance(point);
+            if (dist < minEdgeDist) {
+                closestEdge = edge;
+                minEdgeDist = dist;
+            }
+        }
+        if (minEdgeDist < 20) {
+            piece = closestEdge;
+        }
+
+        // Then, each node and ports of it.
+        for (Node node : this.graph.getNodes()) {
+            // Check the node first
+            if (NodeController.getGUI(node).isIn(point)) {
+                piece = node;
+            }
+
+            // Find the closest port of this node.
+            double minPortDist = Double.MAX_VALUE;
+            Port closestPort = null;
+            for (Port port : node.getAllPorts()) {
+                double dist = NodeController.getGUI(port).getPosition().distance(point);
+                if (dist < minPortDist) {
+                    closestPort = port;
+                    minPortDist = dist;
+                }
+            }
+            if (minPortDist <= PortGUI.DATA_PORT_SIZE) {
+                piece = closestPort;
+            }
+
+            // Don't break from this loop because the later ones are drawn at
+            // the top of other nodes.
+        }
+        return piece;
+    }
+
+    /**
+     * Returns the visible object in the specified area. The objects are either a Node, a Port, or an Edge.
+     * 
+     * @param rec
+     *            area to cover
+     * @return The visible object a the specified location
+     */
+    protected List<Node> getNodesIn(Rectangle rec) {
+        ArrayList<Node> pieces = new ArrayList<Node>();
+
+        // Then, each node and ports of it.
+        for (Node node : this.graph.getNodes()) {
+            Rectangle inter = SwingUtilities.computeIntersection(rec.x, rec.y, rec.width, rec.height, NodeController.getGUI(node)
+                    .getBounds());
+            if (inter.width != 0 && inter.height != 0)
+                pieces.add(node);
+        }
+
+        return pieces;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphPieceGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphPieceGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphPieceGUI.java
new file mode 100644
index 0000000..a73b6a0
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphPieceGUI.java
@@ -0,0 +1,36 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph;
+
+import java.awt.event.MouseEvent;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+
+public interface GraphPieceGUI {
+
+    /**
+     * @param event
+     * @param engine
+     */
+    public void mouseClicked(MouseEvent event, XBayaEngine engine);
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/NodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/NodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/NodeGUI.java
new file mode 100644
index 0000000..255a961
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/NodeGUI.java
@@ -0,0 +1,535 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph;
+
+import java.awt.AlphaComposite;
+import java.awt.Color;
+import java.awt.Composite;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Shape;
+import java.awt.event.MouseEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeObserver;
+import org.apache.airavata.workflow.model.graph.Node.NodeUpdateType;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public abstract class NodeGUI implements GraphPieceGUI, NodeObserver {
+
+    /**
+     * BREAK_POINT_BORDER_COLOR
+     */
+    protected static final Color BREAK_POINT_BORDER_COLOR = new Color(53, 103, 157);
+
+    /**
+     * The minimum width of the node.
+     */
+    protected static final int MINIMUM_WIDTH = 100;
+
+    /**
+     * The minimum height of the node
+     */
+    protected static final int MINIMUM_HEIGHT = 37;
+
+    protected static final int TEXT_GAP_X = 5;
+
+    protected static final int TEXT_GAP_Y = 2;
+
+    protected static final Color TEXT_COLOR = Color.black;
+
+    protected static final int PORT_GAP = 13;
+
+    protected static final int PORT_INITIAL_GAP = 10;
+
+    protected static final Color EDGE_COLOR = Color.GRAY;
+
+    protected static final Color DEFAULT_HEAD_COLOR = Color.white;
+
+    protected static final Color SELECTED_HEAD_COLOR = Color.pink;
+
+    /**
+     * The default body color.
+     */
+    public static final Color DEFAULT_BODY_COLOR = new Color(250, 220, 100);
+
+    protected static final Color DRAGGED_BODY_COLOR = Color.lightGray;
+
+    protected static final Color BREAK_POINT_COLOR = new Color(174, 197, 221);
+
+    protected Node node;
+
+    protected Dimension dimension;
+
+    protected int headHeight;
+
+    protected boolean selected = false;
+
+    protected boolean dragged = false;
+
+    protected Color headColor;
+
+    protected Color bodyColor;
+
+    protected List<Paintable> paintables;
+    
+    /**
+     * @param node
+     */
+    public NodeGUI(Node node) {
+        this.node = node;
+        this.bodyColor = DEFAULT_BODY_COLOR;
+        this.headColor = DEFAULT_HEAD_COLOR;
+        // The followings are just to make sure that it has some size.
+        this.dimension = new Dimension(MINIMUM_WIDTH, MINIMUM_HEIGHT);
+        this.paintables = new LinkedList<Paintable>();
+        node.registerObserver(this);
+    }
+
+    /**
+     * Sets the color of the body.
+     * 
+     * @param color
+     *            The color
+     */
+    public void setBodyColor(Color color) {
+        this.bodyColor = color;
+    }
+
+    /**
+     * @return The color of the body.
+     */
+    public Color getBodyColor() {
+        return this.bodyColor;
+    }
+
+    /**
+     * Sets the color of the head.
+     * 
+     * @param color
+     *            The color to set
+     */
+    public void setHeadColor(Color color) {
+        this.headColor = color;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
+     *      org.apache.airavata.xbaya.XBayaEngine)
+     */
+    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+        // Nothing by default
+    }
+
+    /**
+     * @param paintable
+     */
+    public void addPaintable(Paintable paintable) {
+        this.paintables.add(paintable);
+    }
+
+    /**
+     * @param paintable
+     */
+    public void removePaintable(Paintable paintable) {
+        this.paintables.remove(paintable);
+    }
+
+    /**
+     * @param flag
+     */
+    protected void setSelectedFlag(boolean flag) {
+        this.selected = flag;
+        if (this.selected) {
+            this.headColor = SELECTED_HEAD_COLOR;
+        } else {
+            this.headColor = DEFAULT_HEAD_COLOR;
+        }
+    }
+
+    /**
+     * @param flag
+     */
+    protected void setDraggedFlag(boolean flag) {
+        this.dragged = flag;
+    }
+
+    /**
+     * Returns the position of the node.
+     * 
+     * @return the position of the node
+     */
+    protected Point getPosition() {
+        return getNode().getPosition();
+    }
+
+    /**
+     * Gets the bounding Rectangle of this Node.
+     * 
+     * @return A rectangle indicating this component's bounds
+     */
+    protected Rectangle getBounds() {
+        return new Rectangle(getNode().getPosition(), this.dimension);
+    }
+
+    /**
+     * Checks if a user's click is to select the node.
+     * 
+     * @param point
+     *            The location.
+     * @return true if the user's click is to select the node; false otherwise
+     */
+    protected boolean isIn(Point point) {
+        Rectangle bounds = getBounds();
+        return bounds.contains(point);
+    }
+
+    /**
+     * Checks if a user's click is to select the configuration
+     * 
+     * @param point
+     * @return true if the user's click is to select the node, false otherwise
+     */
+    @SuppressWarnings("unused")
+    protected boolean isInConfig(Point point) {
+        return false;
+    }
+
+    /**
+     * Calculates the width of the node and x-coordinate of the ports. This method has to be called before painting any
+     * parts of the graph.
+     * 
+     * @param g
+     */
+    protected void calculatePositions(Graphics g) {
+        Font oldFont = g.getFont();
+        g.setFont(new Font(oldFont.getFontName(),Font.BOLD,oldFont.getSize()));
+        FontMetrics fm = g.getFontMetrics();
+
+        this.headHeight = fm.getHeight() + TEXT_GAP_Y * 2;
+
+        int maxNumPort = Math.max(getNode().getOutputPorts().size(), getNode().getInputPorts().size());
+        this.dimension.height = Math.max(this.headHeight + PORT_INITIAL_GAP + PORT_GAP * maxNumPort, MINIMUM_HEIGHT);
+        this.dimension.width = Math.max(MINIMUM_WIDTH, fm.stringWidth(getNode().getID()) + TEXT_GAP_X * 5);
+
+        /* Calculates the position of ports */
+        setPortPositions();
+        g.setFont(oldFont);
+    }
+
+    /**
+     * @param g
+     */
+    protected void paint(Graphics2D g) {
+        Shape componentShape = getComponentShape();
+        
+        // Draws the body.
+        drawBody(g, componentShape, getComponentBodyColor());
+        
+        // Draws the head.
+		drawHeader(g, getComponentHeaderShape(), getComponentHeaderText(), getComponentHeaderColor());
+        
+        // Draw a small circle to indicate the break
+        drawBreaks(g, getNode().getPosition());
+
+        // Edge
+		drawEdge(g, componentShape, getComponentEdgeColor());
+
+        // Paint all ports
+        drawPorts(g, getAllPorts());
+
+        // Paint extras
+        drawExtras(g);
+    }
+    
+    /** Following functions need to be overridden for if the component shape/text/color is different **/
+	
+	protected final Collection<? extends Port> getAllPorts() {
+		return getNode().getAllPorts();
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+	protected final Color getComponentEdgeColor() {
+		return EDGE_COLOR;
+	}
+
+	protected Color getComponentHeaderColor() {
+		return this.headColor;
+	}
+
+	protected Shape getComponentHeaderShape() {
+		Point position = getNode().getPosition();
+		RoundRectangle2D headerBoundaryRect = new RoundRectangle2D.Double(position.x, position.y, this.dimension.width, this.headHeight,DrawUtils.ARC_SIZE, DrawUtils.ARC_SIZE);
+		return headerBoundaryRect;
+	}
+
+	protected final Color getComponentBodyColor() {
+		Color paintBodyColor;
+        if (this.dragged) {
+        	paintBodyColor=DRAGGED_BODY_COLOR;
+        } else {
+        	paintBodyColor=this.bodyColor;
+        }
+		return paintBodyColor;
+	}
+
+	protected Shape getComponentShape() {
+		Point position = getNode().getPosition();
+        RoundRectangle2D completeComponentBoundaryRect = new RoundRectangle2D.Float(position.x, position.y, this.dimension.width, this.dimension.height, DrawUtils.ARC_SIZE, DrawUtils.ARC_SIZE);
+		return completeComponentBoundaryRect;
+	}
+
+	protected String getComponentHeaderText() {
+		// XXX it's debatable if we should show the ID or the name.
+        // String headerText = this.node.getName();
+        String headerText = getNode().getID();
+		return headerText;
+	}
+
+	/**---------------------------------------------------------------------------------**/
+	
+	protected void drawBody(Graphics2D g,
+			Shape shape, Color paintBodyColor) {
+		DrawUtils.initializeGraphics2D(g);
+		AffineTransform affineTransform = new AffineTransform();
+		affineTransform.translate(5,5);
+		Shape shadow = affineTransform.createTransformedShape(shape);
+		Composite oldComposite = g.getComposite();
+		g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.65F));
+		g.setColor(Color.GRAY);
+		g.fill(shadow);
+		g.setComposite(oldComposite);
+		DrawUtils.gradientFillShape(g, getEndColor(paintBodyColor), paintBodyColor, shape);
+	}
+
+	protected void drawBreaks(Graphics2D g, Point position) {
+		if (getNode().isBreak()) {
+			DrawUtils.initializeGraphics2D(g);
+            g.setColor(BREAK_POINT_COLOR);
+            int r = this.headHeight / 4;
+            g.fillOval(position.x + this.dimension.width - 3 * r, position.y + r, 2 * r, 2 * r);
+            g.setColor(BREAK_POINT_BORDER_COLOR);
+            g.drawOval(position.x + this.dimension.width - 3 * r, position.y + r, 2 * r, 2 * r);
+        }
+	}
+
+	protected void drawExtras(Graphics2D g) {
+		DrawUtils.initializeGraphics2D(g);
+		for (Paintable paintable : this.paintables) {
+            paintable.paint(g, getNode().getPosition());
+        }
+	}
+
+	protected void drawPorts(Graphics2D g, Collection<? extends Port> ports) {
+		DrawUtils.initializeGraphics2D(g);
+		for (Port port : ports) {
+            NodeController.getGUI(port).paint(g);
+        }
+	}
+	
+	protected void drawPorts(Graphics2D g, Node node) {
+		drawPorts(g, node.getAllPorts());
+	}
+
+	protected void drawEdge(Graphics2D g,
+			Shape completeComponentBoundaryShape, Color edgeColor) {
+		DrawUtils.initializeGraphics2D(g);
+		g.setColor(edgeColor);
+		//uncomment the commented lines to enable a double line edge
+//		g.setStroke(new BasicStroke(4.0f));
+        g.draw(completeComponentBoundaryShape);
+//        g.setColor(Color.white);
+//        g.setStroke(new BasicStroke(3.0f));
+//        g.draw(completeComponentBoundaryShape);
+	}
+	protected void drawHeader(Graphics2D g, Shape shape,
+			String headerText, Color headColor, boolean lowerBorderflat) {
+		drawHeader(g, shape, headerText, headColor, shape, lowerBorderflat);
+	}
+	
+	protected void drawHeader(Graphics2D g, Shape shape,
+			String headerText, Color headColor) {
+		drawHeader(g, shape, headerText, headColor, true);
+	}
+	
+	protected void drawHeader(Graphics2D g, Shape shape,
+			String headerText, Color headColor,
+			Shape headerDrawBoundaryShape) {
+		drawHeader(g, shape, headerText, headColor, headerDrawBoundaryShape, true);
+	}
+	
+	protected void drawHeader(Graphics2D g, Shape shape,
+			String headerText, Color headColor,
+			Shape headerDrawBoundaryShape, boolean lowerBorderflat) {
+		DrawUtils.initializeGraphics2D(g);
+        if (lowerBorderflat) {
+    		g.setColor(getEndColor(headColor));
+    		Rectangle rect=new Rectangle((int) shape.getBounds().getX()+1, (int) (shape.getBounds()
+					.getY() + shape.getBounds().getHeight() - DrawUtils.ARC_SIZE),
+					(int) shape.getBounds().getWidth(), DrawUtils.ARC_SIZE);
+			DrawUtils.gradientFillShape(g, getEndColor(headColor), headColor, rect);
+		}
+        DrawUtils.gradientFillShape(g, getEndColor(headColor), headColor, headerDrawBoundaryShape);
+        
+        // Text
+        g.setColor(TEXT_COLOR);
+        Font oldFont = g.getFont();
+		g.setFont(new Font(oldFont.getFontName(),Font.BOLD,oldFont.getSize()));
+        Rectangle2D bounds = g.getFontMetrics().getStringBounds(headerText, g);
+        g.drawString(headerText, (int)(shape.getBounds().getX() + (shape.getBounds().getWidth()-bounds.getWidth())/2), 
+		(int)(shape.getBounds().getY() + (shape.getBounds().getHeight()+bounds.getHeight())/2));
+        g.setFont(oldFont);
+	}
+
+    /**
+     * Sets up the position of ports
+     */
+    protected void setPortPositions() {
+        // inputs
+        List<? extends Port> inputPorts = getNode().getInputPorts();
+        for (int i = 0; i < inputPorts.size(); i++) {
+            Port port = inputPorts.get(i);
+            Point offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // outputs
+        List<? extends Port> outputPorts = getNode().getOutputPorts();
+        for (int i = 0; i < outputPorts.size(); i++) {
+            Port port = outputPorts.get(i);
+            // Use getBounds() instead of this.dimension because subclass might
+            // overwrite getBounds() to have different shape.
+            Point offset = new Point(this.getBounds().width - PortGUI.DATA_PORT_SIZE / 2, this.headHeight
+                    + PORT_INITIAL_GAP + PORT_GAP * i);
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // control-in
+        Port controlInPort = getNode().getControlInPort();
+        if (controlInPort != null) {
+        	NodeController.getGUI(controlInPort).setOffset(new Point(0, 0));
+        }
+
+        // control-outs
+        for (Port controlOutPort : getNode().getControlOutPorts()) {
+            // By default, all ports will be drawn at the same place. Subclass
+            // should rearrange them if there are more than one control-out
+            // ports.
+        	NodeController.getGUI(controlOutPort).setOffset(new Point(getBounds().width, getBounds().height));
+        }
+    }
+
+    /**
+     * @param workflowName
+     * @param state
+     */
+    public void setToken(String workflowName, NodeState state) {
+        List<DataPort> inputPorts = getNode().getInputPorts();
+        switch (state) {
+        case EXECUTING:
+
+            for (DataPort dataPort : inputPorts) {
+            	NodeController.getGUI(((DataPort) dataPort.getFromPort())).removeToken(workflowName);
+            	NodeController.getGUI(dataPort).addToken(workflowName);
+            }
+            break;
+        case FINISHED:
+            for (DataPort dataPort : inputPorts) {
+            	NodeController.getGUI(dataPort).removeToken(workflowName);
+            }
+
+            List<DataPort> outputPorts = getNode().getOutputPorts();
+            for (DataPort dataPort : outputPorts) {
+            	NodeController.getGUI(dataPort).addToken(workflowName);
+            }
+            break;
+        case FAILED:
+
+            break;
+
+        }
+
+    }
+
+    /**
+	 * 
+	 */
+    public void resetTokens() {
+
+        List<DataPort> inputPorts = getNode().getInputPorts();
+        for (DataPort dataPort : inputPorts) {
+            NodeController.getGUI(dataPort).reset();
+        }
+        List<DataPort> outputPorts = getNode().getOutputPorts();
+        for (DataPort dataPort : outputPorts) {
+            NodeController.getGUI(dataPort).reset();
+        }
+    }
+    
+    protected Color getEndColor(Color bodyColor){
+    	return Color.white;
+    }
+    
+    @Override
+    public void nodeUpdated(NodeUpdateType type) {
+    	switch(type){
+    	case STATE_CHANGED:
+    		updateNodeColor();
+    		break;
+		default:
+			break;
+    	}
+    	
+    }
+
+	private void updateNodeColor() {
+		switch(node.getState()){
+		case WAITING:
+			setBodyColor(NodeState.DEFAULT.color); break;
+		case EXECUTING:
+			setBodyColor(NodeState.EXECUTING.color); break;
+		case FAILED:
+			setBodyColor(NodeState.FAILED.color); break;
+		case FINISHED:
+			setBodyColor(NodeState.FINISHED.color); break;
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/Paintable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/Paintable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/Paintable.java
new file mode 100644
index 0000000..ce8c8fb
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/Paintable.java
@@ -0,0 +1,35 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph;
+
+import java.awt.Graphics2D;
+import java.awt.Point;
+
+public interface Paintable {
+
+    /**
+     * @param graphics
+     * @param point
+     *            The position of the object.
+     */
+    public void paint(Graphics2D graphics, Point point);
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/PortGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/PortGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/PortGUI.java
new file mode 100644
index 0000000..1efdbe7
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/PortGUI.java
@@ -0,0 +1,274 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Shape;
+import java.awt.event.MouseEvent;
+import java.awt.geom.Ellipse2D;
+import java.awt.geom.Rectangle2D;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.Port.Kind;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class PortGUI implements GraphPieceGUI {
+
+    /**
+     * The size of the port (diameter of the triangle)
+     */
+    public static final int DATA_PORT_SIZE = 10;
+
+    /**
+     * CONTROL_PORT_SIZE
+     */
+    public static final int CONTROL_PORT_SIZE = 6;
+
+    private static final Color DATA_IN_COLOR = Color.BLUE;
+
+    private static final Color DATA_OUT_COLOR = Color.GREEN;
+
+    private static final Color CONTROL_IN_COLOR = Color.RED;
+
+    private static final Color CONTROL_OUT_COLOR = Color.RED;
+
+    private static final Color EPR_COLOR = Color.GREEN;
+
+    private static final Color SELECTED_COLOR = Color.PINK;
+
+    protected static final Color TEXT_COLOR = Color.black;
+
+    private static final int TOKEN_SIZE = 22;
+
+    private static final Color TOKEN_COLOR = Color.GREEN;
+
+    private List<String> tokens = new LinkedList<String>();
+
+    private Port port;
+    
+    private String portText=null;
+
+    /**
+     * The position of this port relative to the node this port belongs to.
+     */
+    private Point offset;
+
+    private boolean selected = false;
+
+    /**
+     * @param port
+     */
+    public PortGUI(Port port) {
+        this.port = port;
+        this.offset = new Point(); // To avoid null check.
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
+     *      org.apache.airavata.xbaya.XBayaEngine)
+     */
+    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+        // Nothing
+    }
+
+    /**
+     * @param g
+     */
+    public void paint(Graphics2D g) {
+
+        Kind kind = this.port.getKind();
+        Color color = null;
+        switch (kind) {
+        case DATA_IN:
+            color = this.selected ? SELECTED_COLOR : DATA_IN_COLOR;
+            break;
+        case DATA_OUT:
+            color = this.selected ? SELECTED_COLOR : DATA_OUT_COLOR;
+            break;
+        case CONTROL_IN:
+            color = this.selected ? SELECTED_COLOR : CONTROL_IN_COLOR;
+            break;
+        case CONTROL_OUT:
+            color = this.selected ? SELECTED_COLOR : CONTROL_OUT_COLOR;
+            break;
+        case EPR:
+            color = this.selected ? SELECTED_COLOR : EPR_COLOR;
+            break;
+        }
+
+        Point point = getPosition();
+        Shape shape = null;
+        switch (kind) {
+        case DATA_IN:
+
+            shape = drawPortArrow(point);
+            int count = 0;
+            String[] tokenArray = new String[this.tokens.size()];
+            this.tokens.toArray(tokenArray);
+            for (String token : tokenArray) {
+                g.setColor(TOKEN_COLOR);
+                g.fill(new Ellipse2D.Double(point.x + TOKEN_SIZE /* +count*5 */, point.y + TOKEN_SIZE * count,
+                        TOKEN_SIZE, TOKEN_SIZE / 2));
+                g.setColor(TEXT_COLOR);
+                g.drawString(token, point.x + TOKEN_SIZE * 3 /* +count*5 */, point.y + TOKEN_SIZE * count);
+
+                ++count;
+            }
+
+            break;
+        case DATA_OUT:
+            shape = drawPortArrow(point);
+            count = 0;
+            tokenArray = new String[this.tokens.size()];
+            this.tokens.toArray(tokenArray);
+            for (String token : tokenArray) {
+                g.setColor(TOKEN_COLOR);
+                g.fill(new Ellipse2D.Double(point.x + 5 /* +count*5 */, point.y + TOKEN_SIZE * count, TOKEN_SIZE,
+                        TOKEN_SIZE / 2));
+                g.setColor(TEXT_COLOR);
+                g.drawString(token, point.x + TOKEN_SIZE + 10 /* +count*0 */, point.y + TOKEN_SIZE * count);
+
+                ++count;
+            }
+            break;
+        case CONTROL_IN:
+        case CONTROL_OUT:
+            shape = new Ellipse2D.Double(point.x - CONTROL_PORT_SIZE / 2, point.y - CONTROL_PORT_SIZE / 2,
+                    CONTROL_PORT_SIZE, CONTROL_PORT_SIZE);
+            break;
+        case EPR:
+            shape = new Ellipse2D.Double(point.x - CONTROL_PORT_SIZE / 2, point.y - CONTROL_PORT_SIZE / 2,
+                    CONTROL_PORT_SIZE, CONTROL_PORT_SIZE);
+            break;
+        }
+        DrawUtils.gradientFillShape(g, color.brighter().brighter().brighter().brighter(), color.darker(), shape);
+        if (getPortText()!=null){
+        	g.setColor(Color.WHITE);
+            Font oldFont = g.getFont();
+    		g.setFont(new Font(oldFont.getFontName(),Font.BOLD,7));
+            Rectangle2D bounds = g.getFontMetrics().getStringBounds(getPortText(), g);
+            g.drawString(getPortText(), (int)(shape.getBounds().getX() + (shape.getBounds().getWidth()-bounds.getWidth())*2/4), 
+    		(int)(shape.getBounds().getY() + (shape.getBounds().getHeight()+bounds.getHeight())*4/8));
+            g.setFont(oldFont);
+        }
+    }
+
+    /**
+     * @param point
+     * @return
+     */
+    private Shape drawPortArrow(Point point) {
+        Shape shape;
+        Polygon triangle = new Polygon();
+        triangle.addPoint(point.x - DATA_PORT_SIZE / 2, point.y - DATA_PORT_SIZE / 2);
+        triangle.addPoint(point.x + DATA_PORT_SIZE / 2, point.y);
+        triangle.addPoint(point.x - DATA_PORT_SIZE / 2, point.y + DATA_PORT_SIZE / 2);
+//        shape = DrawUtils.getRoundedShape(triangle);
+        shape = triangle;
+        return shape;
+    }
+
+    /**
+     * @param offset
+     */
+    public void setOffset(Point offset) {
+        this.offset = offset;
+    }
+
+    /**
+     * @return the absolute position of the port
+     */
+    public Point getPosition() {
+        Point nodePosition = this.port.getNode().getPosition();
+        int offsetX=this.offset.x;
+//        if ((PortGUI.DATA_PORT_SIZE / 2) + 1 < this.offset.x){
+//        	offsetX=this.offset.x+(PortGUI.DATA_PORT_SIZE / 2);
+//        }else{
+//        	offsetX=0;
+//        }
+        return new Point(nodePosition.x + offsetX, nodePosition.y + this.offset.y);
+    }
+
+    /**
+     * @param bool
+     */
+    protected void setSelectedFlag(boolean bool) {
+        this.selected = bool;
+    }
+
+    /**
+     * @param workflowName
+     */
+    public void removeToken(String workflowName) {
+        int count = -1;
+        for (String key : this.tokens) {
+            count++;
+            if (workflowName.equals(key)) {
+                break;
+            }
+        }
+        if (count != -1) {
+            this.tokens.remove(count);
+        }
+
+    }
+
+    /**
+     * @param workflowName
+     */
+    public void addToken(String workflowName) {
+        boolean found = false;
+        for (String key : this.tokens) {
+            if (workflowName.equals(key)) {
+                found = true;
+                break;
+            }
+        }
+        if (!found) {
+            this.tokens.add(workflowName);
+        }
+
+    }
+
+    /**
+	 * 
+	 */
+    public void reset() {
+        this.tokens.clear();
+
+    }
+
+	public String getPortText() {
+		return portText;
+	}
+
+	public void setPortText(String portText) {
+		this.portText = portText;
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/amazon/InstanceNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/amazon/InstanceNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/amazon/InstanceNodeGUI.java
new file mode 100644
index 0000000..b2647ac
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/amazon/InstanceNodeGUI.java
@@ -0,0 +1,166 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.amazon;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+import java.awt.geom.RoundRectangle2D;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.amazon.InstanceConfigurationDialog;
+import org.apache.airavata.xbaya.ui.graph.PortGUI;
+import org.apache.airavata.xbaya.ui.graph.system.ConfigurableNodeGUI;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class InstanceNodeGUI extends ConfigurableNodeGUI {
+
+    private InstanceNode node;
+
+    private Polygon polygon;
+    
+    private GeneralPath generalPath;
+
+    private InstanceConfigurationDialog configDialog;
+
+    /**
+     * Constructs a InstanceNodeGUI.
+     * 
+     * @param node
+     */
+    public InstanceNodeGUI(InstanceNode node) {
+        super(node);
+        this.node = node;
+        this.polygon = new Polygon();
+        generalPath = new GeneralPath();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.system.ConfigurableNodeGUI#showConfigurationDialog(org.apache.airavata.xbaya.XBayaEngine)
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.configDialog == null) {
+            this.configDialog = new InstanceConfigurationDialog(this.node, xbayaGUI);
+        }
+        this.configDialog.show();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.system.ConfigurableNodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+        calculatePositions();
+        setPortPositions();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds()
+     */
+    @Override
+    protected Rectangle getBounds() {
+        return this.getComponentShape().getBounds();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#isIn(java.awt.Point)
+     */
+    @Override
+    protected boolean isIn(Point point) {
+        return this.polygon.contains(point);
+    }
+
+	protected Color getComponentHeaderColor() {
+		return this.headColor;
+	}
+
+	protected String getComponentHeaderText() {
+		return this.node.getName();
+	}
+
+	protected GeneralPath getComponentShape() {
+		return generalPath;
+	}
+
+	protected RoundRectangle2D getComponentHeaderShape() {
+		RoundRectangle2D componentHeaderBoundaryRect = new RoundRectangle2D.Double(getPosition().x, getPosition().y, this.dimension.width, this.headHeight, DrawUtils.ARC_SIZE,DrawUtils.ARC_SIZE);
+		return componentHeaderBoundaryRect;
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+    /**
+     * Sets up the position of ports
+     */
+    @Override
+    protected void setPortPositions() {
+        // inputs
+        List<? extends Port> inputPorts = this.node.getInputPorts();
+        for (int i = 0; i < inputPorts.size(); i++) {
+            Port port = inputPorts.get(i);
+            Point offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // outputs
+        List<? extends Port> outputPorts = this.node.getOutputPorts();
+        for (int i = 0; i < outputPorts.size(); i++) {
+            Port port = outputPorts.get(i);
+            // Use getBounds() instead of this.dimension because subclass might
+            // overwrite getBounds() to have different shape.
+            Point offset = new Point(this.getBounds().width - PortGUI.DATA_PORT_SIZE / 2, this.headHeight
+                    + PORT_INITIAL_GAP + PORT_GAP * i);
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // control out port
+        List<? extends Port> controlOutPorts = this.node.getControlOutPorts();
+        Port controlOutPort1 = controlOutPorts.get(0);
+        Point offset = new Point(getBounds().width / 2, getBounds().height);
+        NodeController.getGUI(controlOutPort1).setOffset(offset);
+    }
+    
+    private void calculatePositions() {
+        // Avoid instantiating a new polygon each time.
+        this.polygon.reset();
+        Point position = getPosition();
+        this.polygon.addPoint(position.x, position.y);
+        this.polygon.addPoint(position.x, position.y + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width / 2, position.y + this.dimension.height
+                + this.headHeight);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y);
+        DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/amazon/TerminateInstanceNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/amazon/TerminateInstanceNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/amazon/TerminateInstanceNodeGUI.java
new file mode 100644
index 0000000..74128da
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/amazon/TerminateInstanceNodeGUI.java
@@ -0,0 +1,160 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.amazon;
+
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.amazon.TerminateInstanceNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.apache.airavata.xbaya.ui.graph.PortGUI;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class TerminateInstanceNodeGUI extends NodeGUI {
+
+    private TerminateInstanceNode node;
+
+    private Polygon polygon;
+
+    private GeneralPath generalPath;
+
+    /**
+     * Constructs a InstanceNodeGUI.
+     * 
+     * @param node
+     */
+    public TerminateInstanceNodeGUI(TerminateInstanceNode node) {
+        super(node);
+        this.node = node;
+        this.polygon = new Polygon();
+        generalPath = new GeneralPath();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.system.ConfigurableNodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+        calculatePositions();
+        setPortPositions();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds()
+     */
+    @Override
+    protected Rectangle getBounds() {
+        return this.polygon.getBounds();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#isIn(java.awt.Point)
+     */
+    @Override
+    protected boolean isIn(Point point) {
+        return this.polygon.contains(point);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.system.ConfigurableNodeGUI#paint(java.awt.Graphics2D)
+     */
+    @Override
+    protected void paint(Graphics2D g) {
+        Point position = getPosition();
+
+        // Draws the body.
+        if (this.dragged) {
+            g.setColor(DRAGGED_BODY_COLOR);
+        } else {
+            g.setColor(this.bodyColor);
+        }
+        drawBody(g, generalPath, g.getColor());
+
+        // Draws the head.
+        Polygon head = createHeader(position);
+        drawHeader(g, DrawUtils.getRoundedShape(head), node.getName(), headColor);
+
+        // Edge
+        drawEdge(g, generalPath, EDGE_COLOR);
+
+        // Paint all ports
+        drawPorts(g, node);
+    }
+
+	private Polygon createHeader(Point position) {
+		Polygon head = new Polygon();
+        head.addPoint(position.x, position.y);
+        head.addPoint(position.x, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+		return head;
+	}
+
+    /**
+     * Sets up the position of ports
+     */
+    @Override
+    protected void setPortPositions() {
+        // inputs
+        List<? extends Port> inputPorts = this.node.getInputPorts();
+        for (int i = 0; i < inputPorts.size(); i++) {
+            Port port = inputPorts.get(i);
+            Point offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // outputs
+        List<? extends Port> outputPorts = this.node.getOutputPorts();
+        for (int i = 0; i < outputPorts.size(); i++) {
+            Port port = outputPorts.get(i);
+            // Use getBounds() instead of this.dimension because subclass might
+            // overwrite getBounds() to have different shape.
+            Point offset = new Point(this.getBounds().width - PortGUI.DATA_PORT_SIZE / 2, this.headHeight
+                    + PORT_INITIAL_GAP + PORT_GAP * i);
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // control in port
+        Port controlInPort = this.node.getControlInPort();
+        NodeController.getGUI(controlInPort).setOffset(new Point(0, 0));
+    }
+
+    private void calculatePositions() {
+        // Avoid instantiating a new polygon each time.
+        this.polygon.reset();
+        Point position = getPosition();
+        this.polygon.addPoint(position.x, position.y);
+        this.polygon.addPoint(position.x, position.y + this.dimension.height + this.headHeight / 2);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height + this.headHeight
+                / 2);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+        DrawUtils.setupRoundedGeneralPath(polygon, generalPath);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/dynamic/DynamicNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/dynamic/DynamicNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/dynamic/DynamicNodeGUI.java
new file mode 100644
index 0000000..4229ba7
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/dynamic/DynamicNodeGUI.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.dynamic;
+
+import java.awt.event.MouseEvent;
+
+import org.apache.airavata.workflow.model.graph.dynamic.DynamicNode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.graph.dynamic.DynamicNodeWindow;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DynamicNodeGUI extends NodeGUI {
+
+    private final static Logger logger = LoggerFactory.getLogger(DynamicNodeGUI.class);
+
+    private DynamicNode node;
+
+    private DynamicNodeWindow window;
+
+    /**
+     * Creates a WsNodeGui
+     * 
+     * @param node
+     */
+    public DynamicNodeGUI(DynamicNode node) {
+        super(node);
+        this.node = node;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
+     *      org.apache.airavata.xbaya.XBayaEngine)
+     */
+    @Override
+    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+        logger.debug(event.toString());
+        if (event.getClickCount() >= 2) {
+            showWindow(engine);
+        }
+    }
+
+    private void showWindow(XBayaEngine engine) {
+        if (this.window == null) {
+            this.window = new DynamicNodeWindow(engine, this.node);
+        }
+        try {
+            this.window.show();
+        } catch (Throwable e) {
+            engine.getGUI().getErrorWindow().error(e);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/subworkflow/SubWorkflowNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/subworkflow/SubWorkflowNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/subworkflow/SubWorkflowNodeGUI.java
new file mode 100644
index 0000000..4ad9796
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/subworkflow/SubWorkflowNodeGUI.java
@@ -0,0 +1,89 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.subworkflow;
+
+import java.awt.Color;
+import java.awt.event.MouseEvent;
+
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.subworkflow.SubWorkflowNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SubWorkflowNodeGUI extends NodeGUI {
+
+    private final static Logger logger = LoggerFactory.getLogger(SubWorkflowNodeGUI.class);
+
+    private SubWorkflowNode node;
+
+    private static final Color HEAD_COLOR = new Color(138, 43, 226);
+
+    /**
+     * Constructs a SubWorkflowNodeGUI.
+     * 
+     * @param node
+     */
+    public SubWorkflowNodeGUI(SubWorkflowNode node) {
+        super(node);
+        this.node = node;
+        this.setHeadColor(HEAD_COLOR);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
+     *      org.apache.airavata.xbaya.XBayaEngine)
+     */
+    @Override
+    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+        logger.debug(event.toString());
+        if (event.getClickCount() >= 2) {
+            openWorkflowTab(engine.getGUI());
+        }
+    }
+
+    protected void setSelectedFlag(boolean flag) {
+        this.selected = flag;
+        if (this.selected) {
+            this.headColor = SELECTED_HEAD_COLOR;
+        } else {
+            this.headColor = HEAD_COLOR;
+        }
+    }
+
+    public void openWorkflowTab(XBayaGUI xbayaGUI) {
+        try {
+            Workflow workflow = this.node.getComponent().getWorkflow();
+            xbayaGUI.selectOrCreateGraphCanvas(workflow);
+        } catch (GraphException e) {
+        	xbayaGUI.getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+        } catch (ComponentException e) {
+        	xbayaGUI.getErrorWindow().error(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/BlockNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/BlockNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/BlockNodeGUI.java
new file mode 100644
index 0000000..f7692f5
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/BlockNodeGUI.java
@@ -0,0 +1,87 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.system.BlockNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+
+public class BlockNodeGUI extends NodeGUI {
+
+    private static final int HEIGHT = 100;
+
+    private BlockNode node;
+
+    /**
+     * @param node
+     */
+    public BlockNodeGUI(BlockNode node) {
+        super(node);
+        this.node = node;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        FontMetrics fm = g.getFontMetrics();
+        this.headHeight = fm.getHeight() + TEXT_GAP_Y * 2;
+
+        this.dimension.height = this.headHeight + PORT_INITIAL_GAP + HEIGHT;
+        this.dimension.width = fm.stringWidth(this.node.getID() + TEXT_GAP_X * 2);
+
+        /* Calculates the position of ports */
+        setPortPositions();
+    }
+
+    /**
+     * Sets up the position of ports
+     */
+    @Override
+    protected void setPortPositions() {
+        // No input ports
+
+        Port controlInPort = this.node.getControlInPort();
+        if (controlInPort != null) {
+        	NodeController.getGUI(controlInPort).setOffset(new Point(0, 0));
+        }
+
+        // There are two controlOutPorts.
+        List<? extends Port> controlOutPorts = this.node.getControlOutPorts();
+        Port controlOutPort1 = controlOutPorts.get(0);
+        Point offset = new Point(getBounds().width, +getBounds().height / 2);
+        NodeController.getGUI(controlOutPort1).setOffset(offset);
+
+        Port controlOutPort2 = controlOutPorts.get(1);
+        offset = new Point(this.getBounds().width, getBounds().height);
+        NodeController.getGUI(controlOutPort2).setOffset(offset);
+
+        // No outputs
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConfigurableNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConfigurableNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConfigurableNodeGUI.java
new file mode 100644
index 0000000..9601f56
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConfigurableNodeGUI.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.event.MouseEvent;
+import java.awt.geom.Rectangle2D;
+import java.awt.geom.RoundRectangle2D;
+
+import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public abstract class ConfigurableNodeGUI extends NodeGUI {
+
+	protected static final Color CONFIG_AREA_COLOR = new Color(220, 220, 220);
+
+	protected static final String DEFAULT_CONFIG_AREA_TEXT = "Config";
+
+	protected static final int CONFIG_AREA_GAP_X = 20;
+
+	protected String configurationText;
+
+	protected RoundRectangle2D configurationArea;
+
+	/**
+	 * @param node
+	 */
+	public ConfigurableNodeGUI(NodeImpl node) {
+		super(node);
+		this.configurationText = DEFAULT_CONFIG_AREA_TEXT;
+//		this.configurationArea = new RoundRectangle2D();
+
+	}
+
+	/**
+	 * Sets the text shown on the configuration area.
+	 * 
+	 * @param text
+	 *            The text to set
+	 */
+	public void setConfigurationText(String text) {
+		this.configurationText = text;
+	}
+
+	/**
+	 * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
+	 *      org.apache.airavata.xbaya.XBayaEngine)
+	 */
+	@Override
+	public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+		if (isInConfig(event.getPoint())) {
+			showConfigurationDialog(engine.getGUI());
+		}
+	}
+
+	/**
+	 * @param engine
+	 */
+	protected abstract void showConfigurationDialog(XBayaGUI xbayaGUI);
+
+	/**
+	 * Checks if a user's click is to select the configuration
+	 * 
+	 * @param point
+	 * @return true if the user's click is to select the node, false otherwise
+	 */
+	@Override
+	protected boolean isInConfig(Point point) {
+		return this.configurationArea.contains(point);
+	}
+
+	@Override
+	protected void calculatePositions(Graphics g) {
+		super.calculatePositions(g);
+
+		Point position = this.node.getPosition();
+		FontMetrics fm = g.getFontMetrics();
+		
+		int h = fm.getHeight() + TEXT_GAP_Y * 2+1;
+		int w = this.dimension.width - CONFIG_AREA_GAP_X * 2;
+		int x = position.x + CONFIG_AREA_GAP_X;
+		int y = position.y
+				+ this.headHeight
+				+ (this.dimension.height - this.headHeight - h)
+				/ 2;
+		this.configurationArea=new RoundRectangle2D.Float(x,y,w,h,DrawUtils.ARC_SIZE, DrawUtils.ARC_SIZE);
+	}
+
+	/**
+	 * Paints the config area
+	 * 
+	 * @param g
+	 */
+	@Override
+	protected final void paint(Graphics2D g) {
+		super.paint(g);
+		drawComponentConfiguration(g);
+	}
+
+	/**
+	 * @param g
+	 */
+	protected void drawComponentConfiguration(Graphics2D g) {
+		String s = this.configurationText;
+		g.setColor(CONFIG_AREA_COLOR);
+		g.fill(this.configurationArea);
+		g.setColor(TEXT_COLOR);
+		Rectangle2D bounds = g.getFontMetrics().getStringBounds(s, g);
+		
+		g.drawString(s, 
+				(int)(this.configurationArea.getX() + (this.configurationArea.getWidth()-bounds.getWidth())/2), 
+				(int)(this.configurationArea.getY() + (this.configurationArea.getHeight()+bounds.getHeight()/2)/2));
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConstantNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConstantNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConstantNodeGUI.java
new file mode 100644
index 0000000..5f45161
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/ConstantNodeGUI.java
@@ -0,0 +1,63 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import org.apache.airavata.workflow.model.graph.system.ConstantNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.ConstantConfigurationDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+
+public class ConstantNodeGUI extends ConfigurableNodeGUI {
+
+    private static final String CONFIG_AREA_STRING = "Value";
+
+    private ConstantNode node;
+
+    private ConstantConfigurationDialog configurationWindow;
+
+    /**
+     * @param node
+     */
+    public ConstantNodeGUI(ConstantNode node) {
+        super(node);
+        this.node = node;
+        setConfigurationText(CONFIG_AREA_STRING);
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.node.isConnected()) {
+            if (this.configurationWindow == null) {
+                this.configurationWindow = new ConstantConfigurationDialog(this.node, xbayaGUI);
+            }
+            this.configurationWindow.show();
+
+        } else {
+        	xbayaGUI.getErrorWindow().info(ErrorMessages.CONSTANT_NOT_CONNECTED_WARNING);
+        }
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputHandler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputHandler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputHandler.java
new file mode 100644
index 0000000..ad1e673
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputHandler.java
@@ -0,0 +1,87 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.system.DifferedInputNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+
+public class DifferedInputHandler {
+	
+	
+	public static void handleDifferredInputsofDependentNodes(Node node, final XBayaGUI xbayaGUI){
+		List<DataPort> inputPorts = node.getInputPorts();
+		for (DataPort dataPort : inputPorts) {
+			Node fromNode = dataPort.getFromNode();
+			if(isDifferedInputNode(fromNode)){
+				final DifferedInputNode differedInputNode = (DifferedInputNode)fromNode;
+				if(!differedInputNode.isConfigured()){
+					//not configured differed node this is what we are looking for
+					//set the flag and ensure all the rest is finished
+					Runnable task = new Runnable() {
+						
+						@Override
+						public void run() {
+							((DifferedInputNodeGUI)NodeController.getGUI(differedInputNode)).showConfigurationDialog(xbayaGUI);
+						}
+					};
+					new Thread(task).start();
+					
+					
+					
+				}
+			}
+		}
+	}
+	
+	
+	
+	public static boolean onlyWaitingOnIncompleteDifferedInputNode(Node node){
+		List<DataPort> inputPorts = node.getInputPorts();
+		boolean atleadOneDifferedInputNodeIsIncomplete = false; 
+		for (DataPort dataPort : inputPorts) {
+			Node fromNode = dataPort.getFromNode();
+			if(NodeController.isFinished(fromNode)){
+				//no op
+			}else if(isDifferedInputNode(fromNode)){
+				//not finished
+				if(!((DifferedInputNode)node).isConfigured()){
+					//not configured differed node this is what we are looking for
+					//set the flag and ensure all the rest is finished
+					atleadOneDifferedInputNodeIsIncomplete = true;
+				}
+			}else{
+				//there is a not finished non differed input node
+				return false;
+			}
+		}
+		//if not finished nodes were found we wil not be here so
+		return atleadOneDifferedInputNodeIsIncomplete;
+	}
+	public static boolean isDifferedInputNode(Node node){
+		return node instanceof DifferedInputNode;
+	}
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputNodeGUI.java
new file mode 100644
index 0000000..e0571fc
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DifferedInputNodeGUI.java
@@ -0,0 +1,101 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+
+import org.apache.airavata.workflow.model.graph.system.DifferedInputNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.DifferedInputConfigurationDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+
+public class DifferedInputNodeGUI extends ConfigurableNodeGUI {
+
+	// private static final MLogger logger = MLogger.getLogger();
+
+	private static final String CONFIG_AREA_STRING = "Config";
+
+	private static final Color HEAD_COLOR = new Color(153, 204, 255);
+
+	private DifferedInputNode inputNode;
+
+	private DifferedInputConfigurationDialog configurationWindow;
+
+	private volatile boolean configCanBeDisplayed = true;
+
+	/**
+	 * @param node
+	 */
+	public DifferedInputNodeGUI(DifferedInputNode node) {
+		super(node);
+		this.inputNode = node;
+		setConfigurationText(CONFIG_AREA_STRING);
+		this.headColor = HEAD_COLOR;
+	}
+
+	/**
+	 * Shows a configuration window when a user click the configuration area.
+	 * 
+	 * @param engine
+	 */
+	@Override
+	public void showConfigurationDialog(XBayaGUI xbayaGUI) {
+		if (testAndSetConfigDisplay()) {
+			if (this.inputNode.isConnected()) {
+				if (this.configurationWindow == null) {
+					this.configurationWindow = new DifferedInputConfigurationDialog(
+							this.inputNode, xbayaGUI);
+				}
+				this.configurationWindow.show();
+
+			} else {
+				xbayaGUI.getErrorWindow().info(
+						ErrorMessages.INPUT_NOT_CONNECTED_WARNING);
+			}
+		}
+	}
+
+	protected synchronized boolean testAndSetConfigDisplay() {
+		if (this.configCanBeDisplayed) {
+			this.configCanBeDisplayed = false;
+			return true;
+		}
+		return false;
+	}
+
+	public synchronized void closingDisplay() {
+		this.configCanBeDisplayed = true;
+	}
+
+	public DifferedInputNode getInputNode() {
+		return this.inputNode;
+	}
+
+	@Override
+	protected void setSelectedFlag(boolean flag) {
+		this.selected = flag;
+		if (this.selected) {
+			this.headColor = SELECTED_HEAD_COLOR;
+		} else {
+			this.headColor = HEAD_COLOR;
+		}
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DoWhileNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DoWhileNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DoWhileNodeGUI.java
new file mode 100644
index 0000000..e4c94f7
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/DoWhileNodeGUI.java
@@ -0,0 +1,191 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.impl.PortImpl;
+import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.DoWhileConfigrationDialog;
+import org.apache.airavata.xbaya.ui.graph.PortGUI;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class DoWhileNodeGUI extends ConfigurableNodeGUI {
+
+	private static final String CONFIG_AREA_STRING = "Config";
+
+	private DoWhileNode node;
+
+	private DoWhileConfigrationDialog configurationWindow;
+
+	private Polygon polygon;
+	
+    private GeneralPath generalPath;
+
+	/**
+	 * Constructs a DoWhileNodeGUI.
+	 *
+	 * @param node
+	 */
+	public DoWhileNodeGUI(DoWhileNode node) {
+		super(node);
+		this.node = node;
+		setConfigurationText(CONFIG_AREA_STRING);
+		this.polygon = new Polygon();
+        generalPath = new GeneralPath();
+	}
+
+	/**
+	 * Shows a configuration window when a user click the configuration area.
+	 *
+	 * @param engine
+	 */
+	@Override
+	protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+		if (this.configurationWindow == null) {
+			this.configurationWindow = new DoWhileConfigrationDialog(this.node, xbayaGUI);
+		}
+		this.configurationWindow.show();
+	}
+
+
+	/**
+	 * @see edu.indiana.extreme.xbaya.graph.system.gui.ConfigurableNodeGUI#calculatePositions(java.awt.Graphics)
+	 */
+	@Override
+	protected void calculatePositions(Graphics g) {
+		super.calculatePositions(g);
+		calculatePositions();
+		setPortPositions();
+	}
+
+	/**
+	 * @see edu.indiana.extreme.xbaya.graph.gui.NodeGUI#getBounds()
+	 */
+	@Override
+	protected Rectangle getBounds() {
+		return this.polygon.getBounds();
+	}
+
+	/**
+	 * @see edu.indiana.extreme.xbaya.graph.gui.NodeGUI#isIn(java.awt.Point)
+	 */
+	@Override
+	protected boolean isIn(Point point) {
+		return this.polygon.contains(point);
+	}
+
+	protected GeneralPath getComponentHeaderShape() {
+		return DrawUtils.getRoundedShape(createHeader(getPosition()));
+	}
+
+	protected String getComponentHeaderText() {
+		return node.getName();
+	}
+
+	protected Color getComponentHeaderColor() {
+		return headColor;
+	}
+
+	protected GeneralPath getComponentShape() {
+		return generalPath;
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+	private Polygon createHeader(Point position) {
+		Polygon head = new Polygon();
+		head.addPoint(position.x, position.y + this.headHeight / 2);
+		head.addPoint(position.x, position.y + this.headHeight);
+		head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
+		head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+		head.addPoint(position.x + this.dimension.width / 2, position.y);
+		return head;
+	}
+
+	/**
+	 * Sets up the position of ports
+	 */
+	@Override
+	protected void setPortPositions() {
+		List<? extends Port> inputPorts = this.node.getInputPorts();
+		for (int i = 0; i < inputPorts.size(); i++) {
+			Port port = inputPorts.get(i);
+			Point offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
+			NodeController.getGUI(port).setOffset(offset);
+		}
+
+		// outputs
+		List<? extends Port> outputPorts = this.node.getOutputPorts();
+		for (int i = 0; i < outputPorts.size(); i++) {
+			Port port = outputPorts.get(i);
+			// Use getBounds() instead of this.dimension because subclass might
+			// overwrite getBounds() to have different shape.
+			Point offset = new Point(this.getBounds().width
+					- PortGUI.DATA_PORT_SIZE / 2, this.headHeight
+					+ PORT_INITIAL_GAP + PORT_GAP * i);
+			NodeController.getGUI(port).setOffset(offset);
+		}
+
+		PortImpl controlInPort = this.node.getControlInPort();
+		if (controlInPort != null) {
+			Point offset = new Point(0, this.headHeight / 2);
+			NodeController.getGUI(controlInPort).setOffset(offset);
+		}
+
+		// There are two controlOutPorts.
+		List<? extends Port> controlOutPorts = this.node.getControlOutPorts();
+		Port controlOutPort1 = controlOutPorts.get(0);
+		Point offset = new Point(getBounds().width, +this.headHeight / 2);
+		NodeController.getGUI(controlOutPort1).setOffset(offset);
+
+		Port controlOutPort2 = controlOutPorts.get(1);
+		offset = new Point(this.getBounds().width, getBounds().height - this.headHeight / 2);
+		NodeController.getGUI(controlOutPort2).setOffset(offset);
+	}
+
+	private void calculatePositions() {
+		// Avoid instantiating a new polygon each time.
+		this.polygon.reset();
+		Point position = getPosition();
+		this.polygon.addPoint(position.x, position.y + this.headHeight / 2);
+		this.polygon.addPoint(position.x, position.y + this.dimension.height);
+		this.polygon.addPoint(position.x + this.dimension.width / 2, position.y + this.dimension.height
+				+ this.headHeight / 2);
+		this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height);
+		this.polygon.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+		this.polygon.addPoint(position.x + this.dimension.width / 2, position.y);
+		DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndBlockNodeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndBlockNodeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndBlockNodeGUI.java
new file mode 100644
index 0000000..b6d0e8b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/system/EndBlockNodeGUI.java
@@ -0,0 +1,176 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph.system;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Point;
+import java.awt.Polygon;
+import java.awt.Rectangle;
+import java.awt.geom.GeneralPath;
+import java.util.List;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.system.EndBlockNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.graph.system.EndBlockConfigurationDialog;
+import org.apache.airavata.xbaya.ui.graph.PortGUI;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class EndBlockNodeGUI extends ConfigurableNodeGUI {
+
+    private EndBlockConfigurationDialog configurationWindow;
+
+    private EndBlockNode node;
+
+    private Polygon polygon;
+
+    private GeneralPath generalPath;
+
+    /**
+     * @param node
+     */
+    public EndBlockNodeGUI(EndBlockNode node) {
+        super(node);
+        this.node = node;
+        this.polygon = new Polygon();
+        generalPath = new GeneralPath();
+    }
+
+    /**
+     * Shows a configuration window when a user click the configuration area.
+     * 
+     * @param engine
+     */
+    @Override
+    protected void showConfigurationDialog(XBayaGUI xbayaGUI) {
+        if (this.configurationWindow == null) {
+            this.configurationWindow = new EndBlockConfigurationDialog(this.node, xbayaGUI);
+        }
+        this.configurationWindow.show();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#calculatePositions(java.awt.Graphics)
+     */
+    @Override
+    protected void calculatePositions(Graphics g) {
+        super.calculatePositions(g);
+        calculatePositions();
+        setPortPositions();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds()
+     */
+    @Override
+    protected Rectangle getBounds() {
+        return this.polygon.getBounds();
+    }
+
+    @Override
+    protected boolean isIn(Point point) {
+        return this.polygon.contains(point);
+    }
+
+	protected GeneralPath getComponentHeaderShape() {
+		return DrawUtils.getRoundedShape(createHeader(getPosition()));
+	}
+
+	protected String getComponentHeaderText() {
+		return node.getName();
+	}
+
+	protected Color getComponentHeaderColor() {
+		return headColor;
+	}
+
+	protected GeneralPath getComponentShape() {
+		return generalPath;
+	}
+
+	protected Node getNode() {
+		return this.node;
+	}
+
+	protected Polygon createHeader(Point position) {
+		Polygon head = new Polygon();
+        head.addPoint(position.x, position.y);
+        head.addPoint(position.x, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight);
+        head.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+		return head;
+	}
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#setPortPositions()
+     */
+    @Override
+    protected void setPortPositions() {
+        // inputs
+        List<? extends Port> inputPorts = this.node.getInputPorts();
+        for (int i = 0; i < inputPorts.size(); i++) {
+            Port port = inputPorts.get(i);
+            Point offset;
+            if (i < inputPorts.size() / 2) {
+                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * i);
+            } else {
+                offset = new Point(PortGUI.DATA_PORT_SIZE / 2, this.headHeight + PORT_INITIAL_GAP + PORT_GAP * (i + 1));
+            }
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // outputs
+        List<? extends Port> outputPorts = this.node.getOutputPorts();
+        for (int i = 0; i < outputPorts.size(); i++) {
+            Port port = outputPorts.get(i);
+            Point offset = new Point(this.getBounds().width - PortGUI.DATA_PORT_SIZE / 2, (int) (this.headHeight
+                    + PORT_INITIAL_GAP + PORT_GAP * (outputPorts.size() / 2.0 + i)));
+            NodeController.getGUI(port).setOffset(offset);
+        }
+
+        // control-in
+        Port controlInPort = this.node.getControlInPort();
+        if (controlInPort != null) {
+        	NodeController.getGUI(controlInPort).setOffset(new Point(0, 0));
+        }
+
+        // control-out
+        for (Port controlOutPort : this.node.getControlOutPorts()) {
+        	NodeController.getGUI(controlOutPort).setOffset(new Point(getBounds().width, getBounds().height - this.headHeight / 2));
+            break; // Has only one
+        }
+
+    }
+
+    private void calculatePositions() {
+        this.polygon.reset();
+        Point position = getPosition();
+        this.polygon.addPoint(position.x, position.y);
+        this.polygon.addPoint(position.x, position.y + this.dimension.height + this.headHeight / 2);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.dimension.height);
+        this.polygon.addPoint(position.x + this.dimension.width, position.y + this.headHeight / 2);
+        DrawUtils.setupRoundedGeneralPath(polygon, getComponentShape());
+    }
+}
\ No newline at end of file


[32/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java
deleted file mode 100644
index 5eecb01..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/PublishWorkflowRegistryResource.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.exception.gateway.PublishedWorkflowAlreadyExistsException;
-import org.apache.airavata.registry.api.exception.gateway.PublishedWorkflowDoesNotExistsException;
-import org.apache.airavata.registry.api.exception.worker.UserWorkflowDoesNotExistsException;
-import org.apache.airavata.rest.mappings.resourcemappings.PublishWorkflowNamesList;
-import org.apache.airavata.rest.mappings.resourcemappings.Workflow;
-import org.apache.airavata.rest.mappings.resourcemappings.WorkflowList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This class is the REST interface for all the operations related to published workflows that has
- * been exposed by Airavata Registry API
- */
-@Path(ResourcePathConstants.PublishedWFConstants.REGISTRY_API_PUBLISHWFREGISTRY)
-public class PublishWorkflowRegistryResource {
-
-    @Context
-    ServletContext context;
-
-    /**---------------------------------Published Workflow Registry----------------------------------**/
-
-    /**
-     * This method will check whether a given published workflow name already exists
-     *
-     * @param workflowname publish workflow name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.PublishedWFConstants.PUBLISHWF_EXIST)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isPublishedWorkflowExists(@QueryParam("workflowName") String workflowname) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            boolean workflowExists = airavataRegistry.isPublishedWorkflowExists(workflowname);
-            if (workflowExists) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.PublishedWFConstants.PUBLISHWF_EXIST, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will make a user workflow as a published workflow with the given name
-     *
-     * @param workflowName        user workflow name
-     * @param publishWorkflowName name need to save the published workflow as
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.PublishedWFConstants.PUBLISH_WORKFLOW)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response publishWorkflow(@FormParam("workflowName") String workflowName,
-                                    @FormParam("publishWorkflowName") String publishWorkflowName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.publishWorkflow(workflowName, publishWorkflowName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow published successfully...");
-            return builder.build();
-        } catch (UserWorkflowDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (PublishedWorkflowAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.PublishedWFConstants.PUBLISH_WORKFLOW, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will publish a workflow with the default workflow name
-     *
-     * @param workflowName workflow name
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.PublishedWFConstants.PUBLISH_DEFAULT_WORKFLOW)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response publishWorkflow(@FormParam("workflowName") String workflowName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.publishWorkflow(workflowName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow published successfully...");
-            return builder.build();
-        } catch (UserWorkflowDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (PublishedWorkflowAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.PublishedWFConstants.PUBLISH_DEFAULT_WORKFLOW, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return the worklflow graph
-     *
-     * @param workflowName workflow name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.PublishedWFConstants.GET_PUBLISHWORKFLOWGRAPH)
-    @Produces(MediaType.APPLICATION_FORM_URLENCODED)
-    public Response getPublishedWorkflowGraphXML(@QueryParam("workflowName") String workflowName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            String publishedWorkflowGraphXML =
-                    airavataRegistry.getPublishedWorkflowGraphXML(workflowName);
-            if (publishedWorkflowGraphXML != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(publishedWorkflowGraphXML);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (PublishedWorkflowDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.PublishedWFConstants.GET_PUBLISHWORKFLOWGRAPH, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the published workflow names
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.PublishedWFConstants.GET_PUBLISHWORKFLOWNAMES)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getPublishedWorkflowNames() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<String> publishedWorkflowNames = airavataRegistry.getPublishedWorkflowNames();
-            PublishWorkflowNamesList publishWorkflowNamesList = new PublishWorkflowNamesList();
-            publishWorkflowNamesList.setPublishWorkflowNames(publishedWorkflowNames);
-            if (publishedWorkflowNames.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(publishWorkflowNamesList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.PublishedWFConstants.GET_PUBLISHWORKFLOWNAMES, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the published workflows
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.PublishedWFConstants.GET_PUBLISHWORKFLOWS)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getPublishedWorkflows() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Map<String, String> publishedWorkflows = airavataRegistry.getPublishedWorkflows();
-            WorkflowList workflowList = new WorkflowList();
-            List<Workflow> workflowsModels = new ArrayList<Workflow>();
-            for (String workflowName : publishedWorkflows.keySet()) {
-                Workflow workflow = new Workflow();
-                workflow.setWorkflowName(workflowName);
-                workflow.setWorkflowGraph(publishedWorkflows.get(workflowName));
-                workflowsModels.add(workflow);
-            }
-            workflowList.setWorkflowList(workflowsModels);
-            if (publishedWorkflows.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.PublishedWFConstants.GET_PUBLISHWORKFLOWS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will delete a published workflow with the given published workflow name
-     *
-     * @param workflowName published workflow name
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.PublishedWFConstants.REMOVE_PUBLISHWORKFLOW)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removePublishedWorkflow(@QueryParam("workflowName") String workflowName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removePublishedWorkflow(workflowName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Publish workflow removed successfully...");
-            return builder.build();
-        } catch (PublishedWorkflowDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.PublishedWFConstants.REMOVE_PUBLISHWORKFLOW, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserRegistryResource.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserRegistryResource.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserRegistryResource.java
deleted file mode 100644
index 36b7a4a..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserRegistryResource.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-import java.util.List;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.GET;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.rest.mappings.resourcemappings.UserList;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-/**
- * This class provides a REST interface to all the user management related operations
- */
-@Path(ResourcePathConstants.UserResourceConstants.REGISTRY_API_USERREGISTRY)
-public class UserRegistryResource {
-
-    @Context
-    ServletContext context;
-
-    /**
-     * This method gets all users of Airavata present in the registry
-     *
-     * @return HTTP response - List of AiravataUsers
-     */
-    @GET
-    @Path(ResourcePathConstants.UserResourceConstants.GET_ALL_USERS)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getAllUsers() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-        	List<AiravataUser> users = airavataRegistry.getUsers();
-        	UserList userList = new UserList();
-        	userList.setUserList(users);
-            if (users.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(userList);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.UserResourceConstants.GET_ALL_USERS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java
deleted file mode 100644
index c2fc066..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/UserWorkflowRegistryResource.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-import de.odysseus.staxon.json.JsonXMLConfig;
-import de.odysseus.staxon.json.JsonXMLConfigBuilder;
-import de.odysseus.staxon.json.JsonXMLOutputFactory;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.exception.worker.UserWorkflowAlreadyExistsException;
-import org.apache.airavata.registry.api.exception.worker.UserWorkflowDoesNotExistsException;
-import org.apache.airavata.rest.mappings.resourcemappings.Workflow;
-import org.apache.airavata.rest.mappings.resourcemappings.WorkflowList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.xml.stream.XMLEventReader;
-import javax.xml.stream.XMLEventWriter;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-/**
- * This class is a REST interface to all the operations related to user workflows that has been
- * exposed by Airavata Registry API
- */
-@Path(ResourcePathConstants.UserWFConstants.REGISTRY_API_USERWFREGISTRY)
-public class UserWorkflowRegistryResource {
-
-    @Context
-    ServletContext context;
-
-    /**---------------------------------User Workflow Registry----------------------------------**/
-
-    /**
-     * This method will check whether a given user workflow name already exists
-     *
-     * @param workflowName workflow name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.UserWFConstants.WORKFLOW_EXIST)
-    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response isWorkflowExists(@QueryParam("workflowName") String workflowName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            boolean workflowExists = airavataRegistry.isWorkflowExists(workflowName);
-            if (workflowExists) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("True");
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity("False");
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.UserWFConstants.WORKFLOW_EXIST, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will add a new workflow
-     *
-     * @param workflowName     workflow name
-     * @param workflowGraphXml workflow content
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.UserWFConstants.ADD_WORKFLOW)
-    @Consumes({MediaType.APPLICATION_FORM_URLENCODED,MediaType.APPLICATION_JSON})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addWorkflow(@FormParam("workflowName") String workflowName,
-                                @FormParam("workflowGraphXml") String workflowGraphXml) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.addWorkflow(workflowName, workflowGraphXml);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow added successfully...");
-            return builder.build();
-        } catch (UserWorkflowAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.UserWFConstants.ADD_WORKFLOW, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the workflow
-     *
-     * @param workflowName     workflow name
-     * @param workflowGraphXml workflow content
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.UserWFConstants.UPDATE_WORKFLOW)
-    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response updateWorkflow(@FormParam("workflowName") String workflowName,
-                                   @FormParam("workflowGraphXml") String workflowGraphXml) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.updateWorkflow(workflowName, workflowGraphXml);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow updated successfully...");
-            return builder.build();
-        } catch (UserWorkflowAlreadyExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.UserWFConstants.UPDATE_WORKFLOW, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return the content of the given workflow
-     *
-     * @param workflowName workflow name
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.UserWFConstants.GET_WORKFLOWGRAPH)
-    @Produces({MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON})
-    public Response getWorkflowGraphXML(@DefaultValue("false") @QueryParam("isJson") boolean isJson,
-                                        @QueryParam("workflowName") String workflowName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            String workflowGraphXML = airavataRegistry.getWorkflowGraphXML(workflowName);
-            if (workflowGraphXML != null) {
-                if (isJson && workflowGraphXML.startsWith("<")) {
-                    workflowGraphXML = getJSONWorkflowGraph(workflowGraphXML);
-                }
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(workflowGraphXML);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (UserWorkflowDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.UserWFConstants.GET_WORKFLOWGRAPH, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will return all the user workflows
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.UserWFConstants.GET_WORKFLOWS)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getWorkflows(@DefaultValue("false") @QueryParam("isJson") boolean isJson) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Map<String, String> workflows = airavataRegistry.getWorkflows();
-            WorkflowList workflowList = new WorkflowList();
-            List<Workflow> workflowsModels = new ArrayList<Workflow>();
-            for (String workflowName : workflows.keySet()) {
-                Workflow workflow = new Workflow();
-                workflow.setWorkflowName(workflowName);
-                String workflowGraph = workflows.get(workflowName);
-                if (isJson && workflowGraph.startsWith("<")) {
-                    workflowGraph = getJSONWorkflowGraph(workflowGraph);
-                }
-                workflow.setWorkflowGraph(workflowGraph);
-                workflowsModels.add(workflow);
-            }
-            workflowList.setWorkflowList(workflowsModels);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity(workflowList);
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.UserWFConstants.GET_WORKFLOWS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will delete a user workflow with the given user workflow name
-     *
-     * @param workflowName user workflow name
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.UserWFConstants.REMOVE_WORKFLOW)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removeWorkflow(@QueryParam("workflowName") String workflowName) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removeWorkflow(workflowName);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow removed successfully...");
-            return builder.build();
-        } catch (UserWorkflowDoesNotExistsException e) {
-            Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-            builder.entity(e.getMessage());
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.UserWFConstants.REMOVE_WORKFLOW, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-
-    private String getJSONWorkflowGraph(String workflowGraphXML) throws XMLStreamException, IOException {
-        String workflowGraphJSON;
-        ByteArrayOutputStream output = new ByteArrayOutputStream();
-        ByteArrayInputStream input = new ByteArrayInputStream(workflowGraphXML.getBytes());
-        try {
-            JsonXMLConfig config = new JsonXMLConfigBuilder()
-                    .autoArray(true)
-                    .autoPrimitive(true)
-                    .prettyPrint(true)
-                    .build();
-            XMLEventReader reader = XMLInputFactory.newInstance().
-                    createXMLEventReader(input);
-
-            XMLEventWriter writer = new JsonXMLOutputFactory(config).createXMLEventWriter(output);
-            writer.add(reader);
-            reader.close();
-            workflowGraphJSON = output.toString("UTF-8");
-            writer.close();
-        } finally {
-            /*
-			 * As per StAX specification, XMLEventReader/Writer.close() doesn't close
-			 * the underlying stream.
-			 */
-            output.close();
-            input.close();
-        }
-        return workflowGraphJSON;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/HttpAuthenticatorFilter.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/HttpAuthenticatorFilter.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/HttpAuthenticatorFilter.java
deleted file mode 100644
index 8865a0e..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/HttpAuthenticatorFilter.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security;
-
-import org.apache.airavata.security.AuthenticationException;
-import org.apache.airavata.security.Authenticator;
-import org.apache.airavata.security.configurations.AuthenticatorConfigurationReader;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xml.sax.SAXException;
-
-import javax.servlet.*;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Calendar;
-import java.util.List;
-
-/**
- * A servlet filter class which intercepts the request and do authentication.
- */
-public class HttpAuthenticatorFilter implements Filter {
-
-    private List<Authenticator> authenticatorList;
-
-    private static Logger log = LoggerFactory.getLogger(HttpAuthenticatorFilter.class);
-
-    private ServletRequestHelper servletRequestHelper = new ServletRequestHelper();
-
-    @Override
-    public void init(FilterConfig filterConfig) throws ServletException {
-        String authenticatorConfiguration = filterConfig.getInitParameter("authenticatorConfigurations");
-
-        //TODO make this able to read from a file as well
-
-
-        InputStream configurationFileStream = HttpAuthenticatorFilter.class.getClassLoader().
-                getResourceAsStream(authenticatorConfiguration);
-
-        if (configurationFileStream == null) {
-            String msg = "Invalid authenticator configuration. Cannot read file - ".concat(authenticatorConfiguration);
-            log.error(msg);
-            throw new ServletException(msg);
-        }
-
-        AuthenticatorConfigurationReader authenticatorConfigurationReader
-                = new AuthenticatorConfigurationReader();
-        try {
-            authenticatorConfigurationReader.init(configurationFileStream);
-        } catch (IOException e) {
-            String msg = "Error reading authenticator configurations.";
-
-            log.error(msg, e);
-            throw new ServletException(msg, e);
-        } catch (ParserConfigurationException e) {
-            String msg = "Error parsing authenticator configurations.";
-
-            log.error(msg, e);
-            throw new ServletException(msg, e);
-        } catch (SAXException e) {
-            String msg = "Error parsing authenticator configurations.";
-
-            log.error(msg, e);
-            throw new ServletException(msg, e);
-        } finally {
-            try {
-                configurationFileStream.close();
-            } catch (IOException e) {
-                log.error("Error closing authenticator file stream.", e);
-            }
-        }
-
-        this.authenticatorList = authenticatorConfigurationReader.getAuthenticatorList();
-
-        if (this.authenticatorList.isEmpty()) {
-            String msg = "No authenticators registered in the system. System cannot function without authenticators";
-            log.error(msg);
-            throw new ServletException(msg);
-        }
-
-    }
-
-    @Override
-    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
-
-        // Firs check whether authenticators are disabled
-        if (! AuthenticatorConfigurationReader.isAuthenticationEnabled()) {
-
-            // Extract user id and gateway id
-            try {
-                servletRequestHelper.addIdentityInformationToSession((HttpServletRequest) servletRequest);
-            } catch (AuthenticationException e) {
-                log.warn("Error adding identity information to session.", e);
-                populateUnauthorisedData(servletResponse, "Error adding identity information to session.");
-
-            }
-
-            filterChain.doFilter(servletRequest, servletResponse);
-            return;
-        }
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) servletRequest;
-
-        Authenticator authenticator = getAuthenticator(httpServletRequest);
-
-        if (authenticator == null) {
-            //sendUnauthorisedError(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
-            populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
-        } else {
-            if (authenticator.isAuthenticated(httpServletRequest)) {
-                // Allow request to flow
-                filterChain.doFilter(servletRequest, servletResponse);
-            } else {
-                try {
-                    if (!authenticator.authenticate(httpServletRequest)) {
-                        //sendUnauthorisedError(servletResponse, "Unauthorised : Provided credentials are not valid.");
-                        populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
-                    } else {
-                        // Allow request to flow
-                        filterChain.doFilter(servletRequest, servletResponse);
-                    }
-                } catch (AuthenticationException e) {
-                    String msg = "An error occurred while authenticating request.";
-                    log.error(msg, e);
-                    //sendUnauthorisedError(servletResponse, e.getMessage());
-                    populateUnauthorisedData(servletResponse, "Invalid request. Request does not contain sufficient credentials to authenticate");
-                }
-            }
-        }
-    }
-
-    public static void sendUnauthorisedError(ServletResponse servletResponse, String message) throws IOException {
-        HttpServletResponse httpServletResponse = (HttpServletResponse) servletResponse;
-        httpServletResponse.sendError(HttpServletResponse.SC_UNAUTHORIZED, message);
-    }
-
-    @Override
-    public void destroy() {
-
-        this.authenticatorList = null;
-    }
-
-    private Authenticator getAuthenticator(HttpServletRequest httpServletRequest) {
-
-        for (Authenticator authenticator : authenticatorList) {
-            if (authenticator.canProcess(httpServletRequest)) {
-                return authenticator;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * This method will create a 401 unauthorized response to be sent.
-     *
-     * @param servletResponse The HTTP response.
-     */
-    public static void populateUnauthorisedData(ServletResponse servletResponse, String message) {
-
-        HttpServletResponse httpServletResponse = (HttpServletResponse)servletResponse;
-
-        httpServletResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
-        httpServletResponse.addHeader("Server", "Airavata Server");
-        httpServletResponse.addHeader("Description", message);
-        httpServletResponse.addDateHeader("Date", Calendar.getInstance().getTimeInMillis());
-        httpServletResponse.addHeader("WWW-Authenticate", "Basic realm=Airavata");
-        httpServletResponse.setContentType("text/html");
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/ServletRequestHelper.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/ServletRequestHelper.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/ServletRequestHelper.java
deleted file mode 100644
index a8e5dbc..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/ServletRequestHelper.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security;
-
-import org.apache.airavata.common.context.RequestContext;
-import org.apache.airavata.common.context.WorkflowContext;
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.security.AuthenticationException;
-import org.apache.commons.codec.binary.Base64;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Helper class to extract request information.
- */
-public class ServletRequestHelper {
-
-    /**
-     * Header names
-     */
-    public static final String AUTHORISATION_HEADER_NAME = "Authorization";
-
-    protected void addIdentityInformationToSession(HttpServletRequest servletRequest) throws AuthenticationException {
-
-        addUserToSession(null, servletRequest);
-    }
-
-    public void addUserToSession(String userName, HttpServletRequest servletRequest) throws AuthenticationException {
-
-        if (userName == null) {
-            userName = getUserName(servletRequest);
-        }
-
-        String gatewayId = getGatewayId(servletRequest);
-
-        if (servletRequest.getSession() != null) {
-            servletRequest.getSession().setAttribute(Constants.USER_IN_SESSION, userName);
-            servletRequest.getSession().setAttribute(Constants.GATEWAY_NAME, gatewayId);
-        }
-
-        addToContext(userName, gatewayId);
-    }
-
-    String getUserName(HttpServletRequest httpServletRequest) throws AuthenticationException {
-
-        String basicHeader = httpServletRequest.getHeader(AUTHORISATION_HEADER_NAME);
-
-        if (basicHeader == null) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        String[] userNamePasswordArray = basicHeader.split(" ");
-
-        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        String decodedString = decode(userNamePasswordArray[1]);
-
-        String[] array = decodedString.split(":");
-
-        if (array == null || array.length != 1) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        return array[0];
-
-    }
-
-    public String decode(String encoded) {
-        return new String(Base64.decodeBase64(encoded.getBytes()));
-    }
-
-    String getGatewayId(HttpServletRequest request) throws AuthenticationException {
-        String gatewayId = request.getHeader(Constants.GATEWAY_NAME);
-
-        if (gatewayId == null) {
-            try {
-                gatewayId = ServerSettings.getSystemUserGateway();
-            } catch (ApplicationSettingsException e) {
-                throw new AuthenticationException("Unable to retrieve default gateway", e);
-            }
-        }
-
-        return gatewayId;
-    }
-
-    public void addToContext(String userName, String gatewayId) {
-
-        RequestContext requestContext = new RequestContext();
-        requestContext.setUserIdentity(userName);
-        requestContext.setGatewayId(gatewayId);
-
-        WorkflowContext.set(requestContext);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticator.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticator.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticator.java
deleted file mode 100644
index 8908743..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticator.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security.basic;
-
-import org.apache.airavata.common.exception.ApplicationSettingsException;
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.security.AbstractAuthenticator;
-import org.apache.airavata.security.AuthenticationException;
-import org.apache.airavata.security.UserStoreException;
-import org.apache.airavata.services.registry.rest.security.ServletRequestHelper;
-import org.apache.commons.codec.binary.Base64;
-import org.w3c.dom.Node;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-/**
- * This authenticator handles basic access authentication requests. In basic access authentication
- * we get user name and password as HTTP headers. The password is encoded with base64.
- * More information @link{http://en.wikipedia.org/wiki/Basic_access_authentication}
- */
-public class BasicAccessAuthenticator extends AbstractAuthenticator {
-
-
-    private static final String AUTHENTICATOR_NAME = "BasicAccessAuthenticator";
-
-    private ServletRequestHelper servletRequestHelper = new ServletRequestHelper();
-
-    public BasicAccessAuthenticator() {
-        super(AUTHENTICATOR_NAME);
-    }
-
-
-    /**
-     * Returns user name and password as an array. The first element is user name and second is password.
-     *
-     * @param httpServletRequest The servlet request.
-     * @return User name password pair as an array.
-     * @throws AuthenticationException If an error occurred while extracting user name and password.
-     */
-    private String[] getUserNamePassword(HttpServletRequest httpServletRequest) throws AuthenticationException {
-
-        String basicHeader = httpServletRequest.getHeader(ServletRequestHelper.AUTHORISATION_HEADER_NAME);
-
-        if (basicHeader == null) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        String[] userNamePasswordArray = basicHeader.split(" ");
-
-        if (userNamePasswordArray == null || userNamePasswordArray.length != 2) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        String decodedString = servletRequestHelper.decode(userNamePasswordArray[1]);
-
-        String[] array = decodedString.split(":");
-
-        if (array == null || array.length != 2) {
-            throw new AuthenticationException("Authorization Required");
-        }
-
-        return array;
-
-    }
-
-    @Override
-    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
-        if (this.getUserStore() == null) {
-            throw new AuthenticationException("Authenticator is not initialized. Error processing request.");
-        }
-
-        if (credentials == null)
-            return false;
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;
-
-        String[] array = getUserNamePassword(httpServletRequest);
-
-        String userName = array[0];
-        String password = array[1];
-
-        try {
-            return this.getUserStore().authenticate(userName, password);
-
-        } catch (UserStoreException e) {
-            throw new AuthenticationException("Error querying database for session information.", e);
-        }
-    }
-
-
-
-    @Override
-    public void onSuccessfulAuthentication(Object authenticationInfo) {
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) authenticationInfo;
-
-        try {
-            String[] array = getUserNamePassword(httpServletRequest);
-
-            StringBuilder stringBuilder = new StringBuilder("User : ");
-
-            if (array != null) {
-
-                servletRequestHelper.addUserToSession(array[0], httpServletRequest);
-
-                stringBuilder.append(array[0]).append(" successfully logged into system at ").append(getCurrentTime());
-                log.debug(stringBuilder.toString());
-
-            } else {
-                log.error("System error occurred while extracting user name after authentication. " +
-                        "Couldn't extract user name from the request.");
-            }
-        } catch (AuthenticationException e) {
-            log.error("System error occurred while extracting user name after authentication.", e);
-        }
-
-    }
-
-    @Override
-    public void onFailedAuthentication(Object authenticationInfo) {
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) authenticationInfo;
-
-        try {
-            String[] array = getUserNamePassword(httpServletRequest);
-
-            StringBuilder stringBuilder = new StringBuilder("User : ");
-
-            if (array != null) {
-
-                stringBuilder.append(array[0]).append(" Failed login attempt to system at ").append(getCurrentTime());
-                log.warn(stringBuilder.toString());
-
-            } else {
-                stringBuilder.append("Failed login attempt to system at ").append(getCurrentTime()).append( ". User unknown.");
-                log.warn(stringBuilder.toString());
-            }
-        } catch (AuthenticationException e) {
-            log.error("System error occurred while extracting user name after authentication.", e);
-        }
-    }
-
-    @Override
-    public boolean isAuthenticated(Object credentials) {
-        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;
-
-        HttpSession httpSession = httpServletRequest.getSession();
-
-        boolean seenInSession = false;
-
-        if (httpSession != null) {
-            String user = (String)httpSession.getAttribute(Constants.USER_IN_SESSION);
-            String gateway = (String)httpSession.getAttribute(Constants.GATEWAY_NAME);
-
-            if (user != null && gateway != null) {
-                servletRequestHelper.addToContext(user, gateway);
-                seenInSession = true;
-            }
-        }
-
-        return seenInSession;
-
-    }
-
-    @Override
-    public boolean canProcess(Object credentials) {
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest) credentials;
-
-        return (httpServletRequest.getHeader(ServletRequestHelper.AUTHORISATION_HEADER_NAME) != null);
-    }
-
-
-
-    @Override
-    public void configure(Node node) throws RuntimeException {
-
-        /**
-         <specificConfigurations>
-         <database>
-         <jdbcUrl></jdbcUrl>
-         <databaseDriver></databaseDriver>
-         <userName></userName>
-         <password></password>
-         <userTableName></userTableName>
-         <userNameColumnName></userNameColumnName>
-         <passwordColumnName></passwordColumnName>
-         </database>
-         </specificConfigurations>
-         */
-
-        try {
-            this.getUserStore().configure(node);
-        } catch (UserStoreException e) {
-            throw new RuntimeException("Error while configuring authenticator user store", e);
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/local/LocalUserStore.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/local/LocalUserStore.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/local/LocalUserStore.java
deleted file mode 100644
index c4ec4c1..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/local/LocalUserStore.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security.local;
-
-import java.security.NoSuchAlgorithmException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import javax.servlet.ServletContext;
-
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.SecurityUtil;
-import org.apache.airavata.registry.api.util.RegistrySettings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * User store to maintain internal DB database.
- */
-public class LocalUserStore {
-
-    protected static Logger log = LoggerFactory.getLogger(LocalUserStore.class);
-
-    private DBUtil dbUtil;
-
-    private String hashMethod;
-
-    public LocalUserStore(ServletContext servletContext) throws Exception {
-        // Properties properties = WebAppUtil.getAiravataProperties(servletContext);
-
-        hashMethod = RegistrySettings.getSetting("default.registry.password.hash.method");
-
-        dbUtil = new DBUtil(RegistrySettings.getSetting("registry.jdbc.url"),
-                RegistrySettings.getSetting("registry.jdbc.user"),
-                RegistrySettings.getSetting("registry.jdbc.password"),
-                RegistrySettings.getSetting("registry.jdbc.driver"));
-
-    }
-
-    public LocalUserStore(DBUtil db) {
-        dbUtil = db;
-    }
-
-    public void addUser(String userName, String password) {
-
-        String sql = "insert into Users values (?, ?)";
-
-        Connection connection = null;
-        PreparedStatement preparedStatement = null;
-
-        try {
-            connection = dbUtil.getConnection();
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, userName);
-            preparedStatement.setString(2, SecurityUtil.digestString(password, hashMethod));
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-            log.debug("User " + userName + " successfully added.");
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error persisting user information.");
-            stringBuilder.append(" user - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } catch (NoSuchAlgorithmException e) {
-            String stringBuilder = "Error creating hash value for password.";
-            log.error(stringBuilder, e);
-
-            throw new RuntimeException(stringBuilder, e);
-        } finally {
-
-            dbUtil.cleanup(preparedStatement, connection);
-        }
-
-    }
-
-    protected String getPassword(String userName, Connection connection) {
-
-        String sql = "select password from Users where user_name = ?";
-
-        PreparedStatement preparedStatement = null;
-        ResultSet resultSet = null;
-
-        try {
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, userName);
-
-            resultSet = preparedStatement.executeQuery();
-
-            if (resultSet.next()) {
-                return resultSet.getString("password");
-            }
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error retrieving credentials for user.");
-            stringBuilder.append("name - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } finally {
-
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    log.error("Error closing result set", e);
-                }
-            }
-
-            if (preparedStatement != null) {
-                try {
-                    preparedStatement.close();
-                } catch (SQLException e) {
-                    log.error("Error closing prepared statement", e);
-                }
-            }
-        }
-
-        return null;
-    }
-
-    public void changePassword(String userName, String oldPassword, String newPassword) {
-
-        Connection connection = null;
-        PreparedStatement preparedStatement = null;
-
-        try {
-            connection = dbUtil.getConnection();
-
-            String storedPassword = getPassword(userName, connection);
-
-            String oldDigestedPassword = SecurityUtil.digestString(oldPassword, hashMethod);
-
-            if (storedPassword != null) {
-                if (!storedPassword.equals(oldDigestedPassword)) {
-                    throw new RuntimeException("Previous password did not match correctly. Please specify old password"
-                            + " correctly.");
-                }
-            }
-
-            String sql = "update Users set password = ? where user_name = ?";
-
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, SecurityUtil.digestString(newPassword, hashMethod));
-            preparedStatement.setString(2, userName);
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-            log.debug("Password changed for user " + userName);
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error updating credentials.");
-            stringBuilder.append(" user - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } catch (NoSuchAlgorithmException e) {
-            String stringBuilder = "Error creating hash value for password.";
-            log.error(stringBuilder, e);
-
-            throw new RuntimeException(stringBuilder, e);
-        } finally {
-
-            dbUtil.cleanup(preparedStatement, connection);
-        }
-
-    }
-
-    public void changePasswordByAdmin(String userName, String newPassword) {
-
-        Connection connection = null;
-        PreparedStatement preparedStatement = null;
-
-        try {
-            connection = dbUtil.getConnection();
-
-            String sql = "update Users set password = ? where user_name = ?";
-
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, SecurityUtil.digestString(newPassword, hashMethod));
-            preparedStatement.setString(2, userName);
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-            log.debug("Admin changed password of user " + userName);
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error updating credentials.");
-            stringBuilder.append(" user - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } catch (NoSuchAlgorithmException e) {
-            String stringBuilder = "Error creating hash value for password.";
-            log.error(stringBuilder, e);
-
-            throw new RuntimeException(stringBuilder, e);
-        } finally {
-
-            dbUtil.cleanup(preparedStatement, connection);
-        }
-
-    }
-
-    public void deleteUser(String userName) {
-
-        String sql = "delete from Users where user_name=?";
-
-        Connection connection = null;
-        PreparedStatement preparedStatement = null;
-
-        try {
-            connection = dbUtil.getConnection();
-            preparedStatement = connection.prepareStatement(sql);
-
-            preparedStatement.setString(1, userName);
-
-            preparedStatement.executeUpdate();
-
-            connection.commit();
-
-            log.debug("User " + userName + " deleted.");
-
-        } catch (SQLException e) {
-            StringBuilder stringBuilder = new StringBuilder("Error deleting user.");
-            stringBuilder.append("user - ").append(userName);
-
-            log.error(stringBuilder.toString(), e);
-
-            throw new RuntimeException(stringBuilder.toString(), e);
-        } finally {
-            dbUtil.cleanup(preparedStatement, connection);
-        }
-
-    }
-
-    public List<String> getUsers() {
-
-        List<String> userList = new ArrayList<String>();
-
-        String sql = "select user_name from Users";
-
-        PreparedStatement preparedStatement = null;
-        ResultSet resultSet = null;
-        Connection connection = null;
-
-        try {
-
-            connection = dbUtil.getConnection();
-            preparedStatement = connection.prepareStatement(sql);
-
-            resultSet = preparedStatement.executeQuery();
-
-            while (resultSet.next()) {
-                userList.add(resultSet.getString("user_name"));
-            }
-
-        } catch (SQLException e) {
-            String errorString = "Error retrieving Users.";
-            log.error(errorString, e);
-
-            throw new RuntimeException(errorString, e);
-        } finally {
-
-            if (resultSet != null) {
-                try {
-                    resultSet.close();
-                } catch (SQLException e) {
-                    log.error("Error closing result set", e);
-                }
-            }
-
-            if (preparedStatement != null) {
-                try {
-                    preparedStatement.close();
-                } catch (SQLException e) {
-                    log.error("Error closing prepared statement", e);
-                }
-            }
-
-            if (connection != null) {
-                try {
-                    connection.close();
-                } catch (SQLException e) {
-                    log.error("Error closing connection", e);
-                }
-            }
-        }
-
-        Collections.sort(userList);
-
-        return userList;
-
-    }
-
-    public static String getPasswordRegularExpression() {
-        return "'^[a-zA-Z0-9_-]{6,15}$'";
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/session/SessionAuthenticator.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/session/SessionAuthenticator.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/session/SessionAuthenticator.java
deleted file mode 100644
index 86299a4..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/security/session/SessionAuthenticator.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security.session;
-
-import org.apache.airavata.security.AbstractAuthenticator;
-import org.apache.airavata.security.AuthenticationException;
-import org.apache.airavata.security.UserStoreException;
-import org.w3c.dom.Node;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-/**
- * This authenticator will authenticate requests based on a session (NOT HTTP Session) id stored
- * in the database.
- */
-public class SessionAuthenticator extends AbstractAuthenticator {
-
-    private static final String AUTHENTICATOR_NAME = "SessionAuthenticator";
-
-    private static final String SESSION_TICKET = "sessionTicket";
-
-    public SessionAuthenticator() {
-        super(AUTHENTICATOR_NAME);
-    }
-
-    @Override
-    public boolean doAuthentication(Object credentials) throws AuthenticationException {
-
-       if (credentials == null)
-            return false;
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest)credentials;
-        String sessionTicket = httpServletRequest.getHeader(SESSION_TICKET);
-        try {
-            return this.getUserStore().authenticate(sessionTicket);
-        } catch (UserStoreException e) {
-            throw new AuthenticationException("Error querying database for session information.", e);
-        }
-    }
-
-    @Override
-    public boolean canProcess(Object credentials) {
-
-        if (credentials instanceof HttpServletRequest) {
-            HttpServletRequest request = (HttpServletRequest) credentials;
-
-            String ticket = request.getHeader(SESSION_TICKET);
-            if (ticket != null) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    @Override
-    public void onSuccessfulAuthentication(Object authenticationInfo) {
-
-        HttpServletRequest httpServletRequest = (HttpServletRequest)authenticationInfo;
-        String sessionTicket = httpServletRequest.getHeader(SESSION_TICKET);
-
-        // Add sessionTicket to http session
-        HttpSession httpSession = httpServletRequest.getSession();
-
-        if (httpSession != null) {
-            httpSession.setAttribute(SESSION_TICKET, sessionTicket);
-        }
-
-        log.debug("A request with a session ticket is successfully logged in.");
-
-    }
-
-    @Override
-    public void onFailedAuthentication(Object authenticationInfo) {
-        log.warn("Failed attempt to login.");
-    }
-
-    @Override
-    public void configure(Node node) throws RuntimeException {
-
-        try {
-            this.getUserStore().configure(node);
-        } catch (UserStoreException e) {
-            throw new RuntimeException("Error while configuring authenticator user store", e);
-        }
-    }
-
-
-    @Override
-    public boolean isAuthenticated(Object credentials) {
-        HttpServletRequest httpServletRequest = (HttpServletRequest)credentials;
-
-        if (httpServletRequest.getSession() != null) {
-            String sessionTicket = (String)httpServletRequest.getSession().getAttribute(SESSION_TICKET);
-            return (sessionTicket != null);
-        }
-
-        return false;
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/WebAppUtil.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/WebAppUtil.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/WebAppUtil.java
deleted file mode 100644
index 6a58c56..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/utils/WebAppUtil.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.utils;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.core.Response;
-
-import org.apache.airavata.rest.mappings.utils.RestServicesConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * A utility class for webapp operations.
- */
-public class WebAppUtil {
-
-    protected static Logger log = LoggerFactory.getLogger(WebAppUtil.class);
-
-    public static Response reportInternalServerError(String resourceMethod, Throwable t) {
-
-        log.error("Resource Method : " + resourceMethod + " : Internal Server Error ", t);
-        Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-        builder.entity(t.getMessage());
-        return builder.build();
-    }
-
-    // public static Properties getAiravataProperties(ServletContext servletContext) throws IOException {
-    //
-    // URL url = WebAppUtil.class.getClassLoader().
-    // getResource(RestServicesConstants.AIRAVATA_SERVER_PROPERTIES);
-    // Properties properties = new Properties();
-    // try {
-    // properties.load(url.openStream());
-    // } catch (IOException e) {
-    // log.error("Error reading Airavata properties");
-    // throw e;
-    // }
-    //
-    // return properties;
-    // }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/server/ServerConfigurationService.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/server/ServerConfigurationService.java b/modules/rest/service/src/main/java/org/apache/airavata/services/server/ServerConfigurationService.java
deleted file mode 100644
index ff6713c..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/server/ServerConfigurationService.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.server;
-
-import javax.ws.rs.Path;
-
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants.ServerManagerConstants;
-import org.apache.airavata.services.registry.rest.resources.ConfigurationRegistryResource;
-
-@Path(ServerManagerConstants.PATH)
-public class ServerConfigurationService extends ConfigurationRegistryResource{
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/AbstractAuthenticatorTest.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/AbstractAuthenticatorTest.java b/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/AbstractAuthenticatorTest.java
deleted file mode 100644
index 65ca00f..0000000
--- a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/AbstractAuthenticatorTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security;
-
-import junit.framework.TestCase;
-import org.apache.airavata.common.utils.DatabaseTestCases;
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.apache.airavata.security.Authenticator;
-import org.apache.airavata.security.configurations.AuthenticatorConfigurationReader;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-import java.util.List;
-
-/**
- * An abstract class to implement test cases for authenticators.
- */
-public abstract class AbstractAuthenticatorTest extends DatabaseTestCases {
-
-    private String authenticatorName;
-
-    protected Authenticator authenticator = null;
-
-    public AbstractAuthenticatorTest(String name) throws Exception {
-        authenticatorName = name;
-    }
-
-    protected AuthenticatorConfigurationReader authenticatorConfigurationReader;
-
-    @Before
-    public void setUp() throws Exception {
-
-        authenticatorConfigurationReader = new AuthenticatorConfigurationReader();
-        authenticatorConfigurationReader.init(this.getClass().getClassLoader()
-                .getResourceAsStream("authenticators.xml"));
-
-        List<Authenticator> listAuthenticators = authenticatorConfigurationReader.getAuthenticatorList();
-
-        if (listAuthenticators == null) {
-            throw new Exception("No authenticators found !");
-        }
-
-        for (Authenticator a : listAuthenticators) {
-            if (a.getAuthenticatorName().equals(authenticatorName)) {
-                authenticator = a;
-            }
-        }
-
-        if (authenticator == null) {
-            throw new Exception("Could not find an authenticator with name " + authenticatorName);
-        }
-
-    }
-
-    @Test
-    public abstract void testAuthenticateSuccess() throws Exception;
-
-    @Test
-    public abstract void testAuthenticateFail() throws Exception;
-
-    @Test
-    public abstract void testCanProcess() throws Exception;
-}


[50/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/assembly/bin-assembly.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/assembly/bin-assembly.xml b/modules/distribution/xbaya-gui/src/main/assembly/bin-assembly.xml
deleted file mode 100644
index 3f16978..0000000
--- a/modules/distribution/xbaya-gui/src/main/assembly/bin-assembly.xml
+++ /dev/null
@@ -1,165 +0,0 @@
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-	
-<!DOCTYPE assembly [
-        <!ELEMENT assembly (id|includeBaseDirectory|baseDirectory|formats|fileSets|dependencySets)*>
-        <!ELEMENT id (#PCDATA)>
-        <!ELEMENT includeBaseDirectory (#PCDATA)>
-        <!ELEMENT baseDirectory (#PCDATA)>
-        <!ELEMENT formats (format)*>
-        <!ELEMENT format (#PCDATA)>
-        <!ELEMENT fileSets (fileSet)*>
-        <!ELEMENT fileSet (directory|outputDirectory|includes)*>
-        <!ELEMENT directory (#PCDATA)>
-        <!ELEMENT outputDirectory (#PCDATA)>
-        <!ELEMENT includes (include)*>
-        <!ELEMENT include (#PCDATA)>
-        <!ELEMENT dependencySets (dependencySet)*>
-        <!ELEMENT dependencySet (outputDirectory|includes)*>
-        ]>
-<assembly>
-    <id>bin</id>
-    <includeBaseDirectory>true</includeBaseDirectory>
-    <baseDirectory>${archieve.name}-${version}</baseDirectory>
-    <formats>
-        <format>tar.gz</format>
-        <format>zip</format>
-    </formats>
-    <fileSets>
-        <!-- ********************** copy release notes files ********************** -->
-        <fileSet>
-            <directory>../../../</directory>
-            <outputDirectory>.</outputDirectory>
-            <includes>
-                <include>RELEASE_NOTES</include>
-            </includes>
-        </fileSet>
-        <!-- ********************** copy licenses, readme etc. ********************** -->
-        <fileSet>
-            <directory>src/main/resources/</directory>
-            <outputDirectory>.</outputDirectory>
-            <includes>
-                <include>LICENSE</include>
-                <include>NOTICE</include>
-                <include>README</include>
-                <include>INSTALL</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>../../../xbaya-gui/src/test/resources/</directory>
-            <outputDirectory>samples/workflows</outputDirectory>
-            <includes>
-                <include>*.xwf</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>../../../samples</directory>
-            <outputDirectory>samples</outputDirectory>
-            <includes>
-                <include>*.sh</include>
-            </includes>
-        </fileSet>
-	<fileSet>
-            <directory>${project.build.directory}/</directory>
-            <outputDirectory>bin</outputDirectory>
-	    <includes>
-                <include>*.properties</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>src/main/resources/bin</directory>
-            <outputDirectory>bin</outputDirectory>
-            <includes>
-                <include>**/*</include>
-            </includes>
-        </fileSet>
-    </fileSets>
-
-    <dependencySets>
-        <dependencySet>
-            <outputDirectory>lib</outputDirectory>
-            <outputFileNameMapping>${artifact.artifactId}.${artifact.extension}</outputFileNameMapping>
-            <includes>
-                <include>org.apache.derby:derby:jar</include>
-                <include>org.apache.derby:derbytools:jar</include>
-                <include>org.apache.derby:derbynet:jar</include>
-                <include>org.apache.derby:derbyclient:jar</include>
-            </includes>
-        </dependencySet>
-        <dependencySet>
-            <outputDirectory>lib</outputDirectory>
-            <includes>
-                <include>javax.jcr:jcr:jar</include>
-                <include>commons-collections:commons-collections</include>
-                <include>commons-configuration:commons-configuration</include>
-                <include>commons-lang:commons-lang</include>
-                <include>org.ogce:xpp3:jar</include>
-                <include>org.ogce:xpp5:jar</include>
-                <include>org.ogce:xsul:jar</include>
-                <include>org.ogce:xsul5:jar</include>
-                <include>org.ogce:gpel-client:jar</include>
-                <include>org.ogce:atomixmiser:jar</include>
-                <include>org.ogce:yfilter:jar</include>
-                <include>org.python:jython:jar</include>
-                <include>org.apache.xmlbeans:xmlbeans</include>
-                <include>com.amazonaws:aws-java-sdk</include>
-                <include>net.java.dev.jets3t:jets3t</include>
-                <include>org.apache.airavata:airavata-registry-api</include>
-                <include>org.apache.airavata:airavata-workflow-execution-context</include>
-                <include>org.apache.airavata:airavata-workflow-tracking</include>
-                <include>org.apache.airavata:airavata-gfac-core</include>
-                <include>org.apache.airavata:airavata-gfac-ec2</include>
-                <include>org.apache.airavata:airavata-messenger-client</include>
-                <include>org.apache.airavata:airavata-messenger-client</include>
-                <include>org.apache.airavata:airavata-messenger-commons</include>
-                <include>org.apache.airavata:airavata-gfac-schema-utils</include>
-                <include>org.apache.airavata:airavata-common-utils</include>
-                <include>org.apache.airavata:airavata-workflow-model-core:jar</include>
-                <include>org.apache.airavata:airavata-workflow-model-component:jar</include>
-                <include>org.apache.airavata:airavata-message-monitor:jar</include>
-                <include>org.apache.airavata:airavata-client-api:jar</include>
-                <include>org.apache.airavata:airavata-jpa-registry:jar</include>
-                <include>org.apache.airavata:airavata-interpreter-service-client:jar</include>
-                <include>org.apache.airavata:airavata-interpreter-service:jar</include>
-                <include>org.apache.airavata:airavata-interpreter-service-handler:jar</include>
-                <include>org.apache.airavata:airavata-xbaya-gui</include>
-                <include>org.apache.openjpa:openjpa-all:jar</include>
-                <include>com.sun.jersey:jersey-client:jar</include>
-                <include>com.sun.jersey:jersey-core:jar</include>
-                <include>com.sun.jersey:jersey-json</include>
-                <include>org.codehaus.jackson:jackson-jaxrs</include>
-                <include>org.codehaus.jackson:jackson-core-asl</include>
-                <include>org.codehaus.jackson:jackson-mapper-asl</include>
-                <include>org.codehaus.jackson:jackson-xc</include>
-                <include>xerces:xercesImpl:jar:2.9.1</include>
-                <include>de.fzj.unicore:jsdl-xmlbeans:jar:2.1.0</include>
-                <include>commons-codec:commons-codec:jar</include>
-                <include>wsdl4j:wsdl4j:jar</include>
-                <include>org.apache.axis2:axis2-kernel:jar</include>
-                <include>commons-httpclient:commons-httpclient:jar</include>
-                <include>org.apache.ws.commons.axiom:axiom-api:jar</include>
-                <include>org.apache.axis2:axis2:jar</include>
-                <include>org.apache.ws.commons.schema:XmlSchema:jar</include>
-                <include>org.apache.ws.commons.axiom:axiom-impl:jar</include>
-                <include>org.apache.neethi:neethi:jar</include>
-                <include>org.apache.axis2:axis2-transport-local:jar</include>
-                <include>org.apache.axis2:axis2-transport-http:jar</include>
-                <include>javax.mail:mail:jar</include>
-                <include>org.apache.woden:woden-api:jar</include>
-                <!--<include>org.apache.httpcomponents:httpcore:jar</include> -->
-                <include>org.apache.axis2:axis2-adb:jar</include>
-                <include>com.google.guava:guava</include>
-                <include>org.apache.httpcomponents:httpcore:jar:4.3</include>
-                <include>org.apache.httpcomponents:httpclient:jar:4.3</include>
-                <!--<include>org.globusonline:transfer-api-client-java:jar:0.10.8</include>-->
-                <include>org.bouncycastle:bcprov-jdk16:jar:1.45</include>
-                <include>org.apache.thrift:libthrift:jar:0.9.1</include>
-            </includes>
-        </dependencySet>
-    </dependencySets>
-</assembly>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/java/org/apache/airavata/distribution/xbaya/jnlp/Main.java
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/java/org/apache/airavata/distribution/xbaya/jnlp/Main.java b/modules/distribution/xbaya-gui/src/main/java/org/apache/airavata/distribution/xbaya/jnlp/Main.java
deleted file mode 100644
index b9998b7..0000000
--- a/modules/distribution/xbaya-gui/src/main/java/org/apache/airavata/distribution/xbaya/jnlp/Main.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.distribution.xbaya.jnlp;
-
-import java.io.*;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- * This class will go through lib directory and creates the jnlp configuration file.
- */
-public class Main {
-
-    private static final String CONFIGURATION_ELEMENT = "DEPENDENT_JARS";
-
-    public static void main(String[] args) {
-
-        if (args.length != 2) {
-            System.err
-                    .println("[ERROR] JNLP creator must be given with lib directory of Xbaya and JNLP template location.");
-            System.exit(-1);
-        }
-
-        String libDirectory = args[0];
-        String jnlpTemplateFile = args[1];
-
-        System.out.println("[INFO] The lib directory is " + libDirectory);
-        System.out.println("[INFO] The jnlp file is " + jnlpTemplateFile);
-
-        File libDirectoryFile = new File(libDirectory);
-
-        if (!libDirectoryFile.exists()) {
-            System.err.println("[ERROR] Invalid lib directory given - " + libDirectory + ". Cannot add dependent jars");
-            System.exit(-1);
-        }
-
-        File jnlpFile = new File(jnlpTemplateFile);
-        if (!jnlpFile.canRead()) {
-            System.err.println("[ERROR] Unable to read given jnlp file - " + jnlpTemplateFile + ".");
-            System.exit(-1);
-
-        }
-
-        StringBuilder stringBuilder = new StringBuilder();
-
-        // Read all dependencies
-        for (File file : libDirectoryFile.listFiles(new JarFileFilter())) {
-            String line = "<jar href=\"lib/" + file.getName() + "\"/>";
-            stringBuilder.append(line);
-            stringBuilder.append("\n");
-        }
-
-        // System.out.println(stringBuilder.toString());
-        modifyConfigurations(jnlpFile, stringBuilder);
-
-    }
-
-    private static void modifyConfigurations(File jnlpFile, StringBuilder dependencies) {
-
-        List<String> lines = new ArrayList<String>();
-
-        // first, read the file and store the changes
-        BufferedReader in = null;
-        try {
-            in = new BufferedReader(new FileReader(jnlpFile));
-        } catch (FileNotFoundException e) {
-            System.err.println("[ERROR] Error occurred while reading the file. " + e.getMessage());
-        }
-
-        String line = null;
-        if (in != null) {
-            try {
-                line = in.readLine();
-            } catch (IOException e) {
-                System.err.println("[ERROR] Error occurred while reading the file. " + e.getMessage());
-                try {
-                    in.close();
-                } catch (IOException e1) {
-                    System.err.println("[ERROR] Error occurred while closing the file. " + e.getMessage());
-                }
-            }
-        }
-
-        try {
-            while (line != null) {
-
-                if (line.trim().startsWith(CONFIGURATION_ELEMENT)) {
-                    line = line.replaceAll(CONFIGURATION_ELEMENT, dependencies.toString());
-                }
-                lines.add(line);
-                line = in.readLine();
-
-            }
-        } catch (IOException e) {
-            System.err.println("[ERROR] Error occurred while reading the file. " + e.getMessage());
-        } finally {
-            try {
-                if (in != null) {
-                    in.close();
-                }
-            } catch (IOException e) {
-                System.err.println("[ERROR] Error occurred while closing the file. " + e.getMessage());
-            }
-        }
-
-        // now, write the file again with the changes
-        PrintWriter out = null;
-        try {
-            out = new PrintWriter(jnlpFile);
-            for (String l : lines) {
-                out.println(l);
-                out.flush();
-            }
-        } catch (FileNotFoundException e) {
-            System.err.println("[ERROR] Error occurred while writing back to the file. " + e.getMessage());
-        } finally {
-            if (out != null) {
-                out.flush();
-                out.close();
-            }
-        }
-
-    }
-
-    public static class JarFileFilter implements FilenameFilter {
-        String ext;
-
-        public JarFileFilter() {
-            this.ext = ".jar";
-        }
-
-        public boolean accept(File dir, String name) {
-            return name.endsWith(ext);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/INSTALL
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/INSTALL b/modules/distribution/xbaya-gui/src/main/resources/INSTALL
deleted file mode 100644
index 1d6d275..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/INSTALL
+++ /dev/null
@@ -1,44 +0,0 @@
-Installing  Apache Airavata XBaya 0.11
--------------------------------------
-
-Prerequisites
--------------
-Java 1.5 or later
-Maven (tested on v 3.0.2)
-
-Build Apache Airavata XBaya from Source
----------------------------------
-* Unzip/untar the source file or check out from svn.
-* cd to project folder and type
-	$ mvn clean install
-	Note: in order to skip tests use the command
-			$ mvn clean install -Dmaven.test.skip=true
-* The compressed binary distribution is created at <PROJECT DIR>/modules/distribution/xbaya-gui/target/apache-airavata-xbaya-gui-<airavata-version>-bin.zip
-
-Installing the Airavata XBaya
------------------------------
-No installation is necessary. Just extract the compressed distribution.
-Note: For customizing the default configurations of the Airavata Server please 
-      refer to Airavata web-site (http://airavata.apache.org/) and/or Airavata 
-      mailing lists (http://airavata.apache.org/community/mailing-lists.html)
-
-Starting Apache Airavata XBaya
-------------------------------
-* Navigate to <XBAYA_HOME>/bin
-* type for following command to start the Airavata XBaya
-	MAC/Unix systems
-		$ sh xbaya-gui.sh
-	Windows
-		> xbaya-gui.bat
-	Note: Pass "-h" as parameters to see more options when starting the server
-
-Running Tests
--------------
-Once the binary is unzipped, instructions to run the tests should be followed from README
-
-Tutorials 
-----------
-The airavata website has instructions for basic tutorials:
-* For basic understanding of how Airavata works - http://airavata.apache.org/documentation/tutorials/airavata-in-5-minutes.html
-* Describing and executing applications using Airavata - http://airavata.apache.org/documentation/tutorials/airavata-in-10-minutes.html
-* Advanced tutorial to provide understanding of how to run sample workflows distributed with Airavata - http://airavata.apache.org/documentation/tutorials/advanced-workflow-samples.html


[07/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonOneTimeRunnerTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonOneTimeRunnerTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonOneTimeRunnerTestCase.java
deleted file mode 100644
index fa3f2e4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonOneTimeRunnerTestCase.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.jython;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.jython.runner.JythonOneTimeRunnerImpl;
-import org.apache.airavata.xbaya.jython.script.JythonScript;
-import org.apache.airavata.xbaya.test.XBayaTestCase;
-import org.apache.airavata.xbaya.test.service.adder.AdderService;
-import org.apache.airavata.xbaya.test.service.multiplier.MultiplierService;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-
-public class JythonOneTimeRunnerTestCase extends XBayaTestCase {
-
-    /**
-     * @throws WorkflowException
-     */
-    public void testRun() throws WorkflowException {
-
-        WorkflowCreator creator = new WorkflowCreator();
-        Workflow workflow = creator.createComplexMathWorkflow();
-        JythonScript script = new JythonScript(workflow, this.configuration);
-        script.create();
-        String jythonString = script.getJythonString();
-
-        AdderService adder = new AdderService();
-        adder.run();
-        String adderWSDLLoc = adder.getServiceWsdlLocation();
-
-        MultiplierService multiplier = new MultiplierService();
-        multiplier.run();
-        String multiplierWSDLLoc = multiplier.getServiceWsdlLocation();
-
-        String[] arguments = new String[] { "-topic", "complex-math", "-Adder_wsdl", adderWSDLLoc, "-Adder_2_wsdl",
-                adderWSDLLoc, "-Multiplier_wsdl", multiplierWSDLLoc };
-
-        JythonOneTimeRunnerImpl runner = new JythonOneTimeRunnerImpl();
-        runner.run(jythonString, arguments);
-
-        try {
-            runner.run(jythonString, arguments);
-            fail();
-        } catch (Exception e) {
-            // It succeeds only once.
-        }
-
-        adder.shutdownServer();
-        multiplier.shutdownServer();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonRunnerTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonRunnerTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonRunnerTestCase.java
deleted file mode 100644
index c7a815f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonRunnerTestCase.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.jython;
-
-import java.util.LinkedList;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.jython.runner.JythonRunner;
-import org.apache.airavata.xbaya.jython.script.JythonScript;
-import org.apache.airavata.xbaya.test.XBayaTestCase;
-import org.apache.airavata.xbaya.test.service.adder.AdderService;
-import org.apache.airavata.xbaya.test.service.multiplier.MultiplierService;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-
-public class JythonRunnerTestCase extends XBayaTestCase {
-
-    /**
-     * @throws WorkflowException
-     */
-    public void testRun() throws WorkflowException {
-
-        WorkflowCreator creator = new WorkflowCreator();
-        Workflow workflow = creator.createComplexMathWorkflow();
-        JythonScript script = new JythonScript(workflow, this.configuration);
-        script.create();
-        String jythonString = script.getJythonString();
-
-        AdderService adder = new AdderService();
-        adder.run();
-        String adderWSDLLoc = adder.getServiceWsdlLocation();
-
-        MultiplierService multiplier = new MultiplierService();
-        multiplier.run();
-        String multiplierWSDLLoc = multiplier.getServiceWsdlLocation();
-
-        LinkedList<String> arguments = new LinkedList<String>();
-        arguments.add("-topic");
-        arguments.add("complex-math");
-        arguments.add("-Adder_wsdl");
-        arguments.add(adderWSDLLoc);
-        arguments.add("-Adder_2_wsdl");
-        arguments.add(adderWSDLLoc);
-        arguments.add("-Multiplier_wsdl");
-        arguments.add(multiplierWSDLLoc);
-
-        JythonRunner runner = new JythonRunner();
-        runner.run(jythonString, arguments);
-        runner.run(jythonString, arguments);
-
-        adder.shutdownServer();
-        multiplier.shutdownServer();
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonScriptTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonScriptTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonScriptTestCase.java
deleted file mode 100644
index 022b099..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/jython/JythonScriptTestCase.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.jython;
-
-import java.io.IOException;
-
-import org.apache.airavata.common.utils.IOUtil;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.jython.runner.JythonRunner;
-import org.apache.airavata.xbaya.jython.script.JythonScript;
-import org.apache.airavata.xbaya.test.XBayaTestCase;
-import org.apache.airavata.xbaya.test.service.adder.AdderService;
-import org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdderService;
-import org.apache.airavata.xbaya.test.service.arraygen.ArrayGeneratorService;
-import org.apache.airavata.xbaya.test.service.multiplier.MultiplierService;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-
-public class JythonScriptTestCase extends XBayaTestCase {
-
-    private WorkflowCreator workflowCreator;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        this.workflowCreator = new WorkflowCreator();
-    }
-
-    /**
-     * @throws IOException
-     * @throws WorkflowException
-     */
-    public void testSimpleMath() throws IOException, WorkflowException {
-        Workflow workflow = this.workflowCreator.createSimpleMathWorkflow();
-        JythonScript script = new JythonScript(workflow, this.configuration);
-        script.create();
-        String jythonString = script.getJythonString();
-        String filename = "tmp/simple-math.py";
-        IOUtil.writeToFile(jythonString, filename);
-
-        AdderService service = new AdderService();
-        service.run();
-        String adderWSDLLoc = service.getServiceWsdlLocation();
-
-        String[] arguments = new String[] { "-Adder_add_wsdl", adderWSDLLoc };
-        JythonRunner runner = new JythonRunner();
-        runner.run(jythonString, arguments);
-
-        service.shutdownServer();
-    }
-
-    /**
-     * @throws IOException
-     * @throws WorkflowException
-     */
-    public void testComplexMath() throws IOException, WorkflowException {
-        Workflow workflow = this.workflowCreator.createComplexMathWorkflow();
-        JythonScript script = new JythonScript(workflow, this.configuration);
-        script.create();
-        String jythonString = script.getJythonString();
-        String filename = "tmp/complex-math.py";
-        IOUtil.writeToFile(jythonString, filename);
-
-        AdderService adder = new AdderService();
-        adder.run();
-        String adderWSDLLoc = adder.getServiceWsdlLocation();
-
-        MultiplierService multiplier = new MultiplierService();
-        multiplier.run();
-        String multiplierWSDLLoc = multiplier.getServiceWsdlLocation();
-
-        String[] arguments = new String[] { "-topic", "complex-math", "-Adder_add_wsdl", adderWSDLLoc,
-                "-Adder_add_2_wsdl", adderWSDLLoc, "-Multiplier_multiply_wsdl", multiplierWSDLLoc };
-
-        JythonRunner runner = new JythonRunner();
-        runner.run(jythonString, arguments);
-
-        adder.shutdownServer();
-        multiplier.shutdownServer();
-    }
-
-    /**
-     * @throws IOException
-     * @throws WorkflowException
-     */
-    public void testArray() throws IOException, WorkflowException {
-        Workflow workflow = this.workflowCreator.createArrayWorkflow();
-        JythonScript script = new JythonScript(workflow, this.configuration);
-        script.create();
-        String jythonString = script.getJythonString();
-        String filename = "tmp/array-test.py";
-        IOUtil.writeToFile(jythonString, filename);
-
-        ArrayGeneratorService arrayGenerator = new ArrayGeneratorService();
-        arrayGenerator.run();
-        String arrayGeneratorWSDLLoc = arrayGenerator.getServiceWsdlLocation();
-
-        ArrayAdderService arrayAdder = new ArrayAdderService();
-        arrayAdder.run();
-        String arrayAdderWSDLLoc = arrayAdder.getServiceWsdlLocation();
-
-        String[] arguments = new String[] { "-topic", "array-test", "-ArrayAdder_add_wsdl", arrayAdderWSDLLoc,
-                "-ArrayGenerator_generate_wsdl", arrayGeneratorWSDLLoc };
-
-        JythonRunner runner = new JythonRunner();
-        runner.run(jythonString, arguments);
-
-        arrayGenerator.shutdownServer();
-        arrayAdder.shutdownServer();
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/AllServices.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/AllServices.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/AllServices.java
deleted file mode 100644
index e63027b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/AllServices.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.test.service.adder.Adder;
-import org.apache.airavata.xbaya.test.service.adder.AdderImpl;
-import org.apache.airavata.xbaya.test.service.approver.Approver;
-import org.apache.airavata.xbaya.test.service.approver.ApproverImpl;
-import org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdder;
-import org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdderImpl;
-import org.apache.airavata.xbaya.test.service.arraygen.ArrayGenerator;
-import org.apache.airavata.xbaya.test.service.arraygen.ArrayGeneratorImpl;
-import org.apache.airavata.xbaya.test.service.echo.Echo;
-import org.apache.airavata.xbaya.test.service.echo.EchoImpl;
-import org.apache.airavata.xbaya.test.service.multiplier.Multiplier;
-import org.apache.airavata.xbaya.test.service.multiplier.MultiplierImpl;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xservo.XService;
-import xsul.xservo_soap.XSoapDocLiteralService;
-import xsul.xservo_soap_http.HttpBasedServices;
-
-public class AllServices {
-
-    // private static final Logger logger = LoggerFactory.getLogger();
-
-    private int port;
-
-    private HttpBasedServices httpServices;
-
-    /**
-     * Constructs an AllService.
-     * 
-     * @param port
-     */
-    public AllServices(int port) {
-        this.port = port;
-    }
-
-    /**
-     * @throws IOException
-     */
-    public void startAll() throws IOException {
-        this.httpServices = new HttpBasedServices(this.port);
-
-        start(Adder.SERVICE_NAME, Adder.WSDL_NAME, Adder.WSDL_PATH, new AdderImpl());
-        start(Multiplier.SERVICE_NAME, Multiplier.WSDL_NAME, Multiplier.WSDL_PATH, new MultiplierImpl());
-        start(ArrayGenerator.SERVICE_NAME, ArrayGenerator.WSDL_NAME, ArrayGenerator.WSDL_PATH, new ArrayGeneratorImpl());
-        start(ArrayAdder.SERVICE_NAME, ArrayAdder.WSDL_NAME, ArrayAdder.WSDL_PATH, new ArrayAdderImpl());
-        start(Echo.SERVICE_NAME, Echo.WSDL_NAME, Echo.WSDL_PATH, new EchoImpl());
-
-        start(Approver.SERVICE_NAME, Approver.WSDL_NAME, Approver.WSDL_PATH, new ApproverImpl());
-    }
-
-    /**
-     * @param serviceName
-     * @param wsdlName
-     * @param wsdlPath
-     * @param serviceImpl
-     * @throws IOException
-     */
-    private void start(String serviceName, String wsdlName, String wsdlPath, Object serviceImpl) throws IOException {
-        String wsdlLocation = XBayaPathConstants.WSDL_DIRECTORY + File.separator + wsdlPath;
-        XService xservice = this.httpServices.addService(new XSoapDocLiteralService(serviceName, wsdlLocation,
-                serviceImpl));
-        xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
-        xservice.startService();
-
-        WsdlDefinitions wsdl = xservice.getWsdl();
-
-        File wsdlFile = new File(Service.SAMPLE_WSDL_DIRECTORY, wsdlName);
-        XMLUtil.saveXML(wsdl, wsdlFile);
-    }
-
-    /**
-     * @param args
-     * @throws IOException
-     */
-    public static void main(String args[]) throws IOException {
-        int port = 0;
-        if (args.length == 2) {
-            if ("-port".equalsIgnoreCase(args[0])) {
-                port = Integer.parseInt(args[1]);
-            }
-        }
-        AllServices service = new AllServices(port);
-        service.startAll();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/Service.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/Service.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/Service.java
deleted file mode 100644
index ca6a4df..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/Service.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service;
-
-import java.io.File;
-
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-
-public interface Service {
-
-    /**
-     * SAMPLE_WSDL_DIRECTORY
-     */
-    public static final String SAMPLE_WSDL_DIRECTORY = XBayaPathConstants.WSDL_DIRECTORY + File.separator + "sample";
-
-    /**
-     * MATH_DIRECTORY_NAME
-     */
-    public static final String MATH_DIRECTORY_NAME = "math";
-
-    /**
-     * LOAD_DIRECTORY_NAME
-     */
-    public static final String LOAN_DIRECTORY_NAME = "loan";
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/ServiceNotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/ServiceNotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/ServiceNotificationSender.java
deleted file mode 100644
index cd2db2b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/ServiceNotificationSender.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.tracking.Notifier;
-import org.apache.airavata.workflow.tracking.NotifierFactory;
-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.axis2.addressing.EndpointReference;
-import org.apache.xmlbeans.XmlObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlDocument;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.XmlConstants;
-import xsul.lead.LeadContextHeader;
-import xsul.soap.SoapUtil;
-import xsul.soap11_util.Soap11Util;
-import xsul.soap12_util.Soap12Util;
-import xsul.xbeans_util.XBeansUtil;
-
-public class ServiceNotificationSender {
-
-    private final static Logger logger = LoggerFactory.getLogger(ServiceNotificationSender.class);
-
-    private final static String INVOKED_MESSAGE = "Service is invoked";
-
-    private final static String SENDING_RESULT_MESSAGE = "Sending successful result of invocation";
-
-    private Notifier notifier;
-
-    private InvocationEntity initiator;
-
-    private InvocationEntity receiver;
-
-    private InvocationContext invocationContext;
-
-    private WorkflowTrackingContext context;
-
-    private SoapUtil soapFragrance;
-
-    /**
-     * @param inputElement
-     * @return The ServiceNotificationSender
-     */
-    public static ServiceNotificationSender invoked(XmlElement inputElement) {
-        try {
-
-            XmlElement soapBody = (XmlElement) inputElement.getParent();
-            XmlElement soapEnvelope = (XmlElement) soapBody.getParent();
-            SoapUtil soapFragrance = SoapUtil.selectSoapFragrance(soapEnvelope,
-                    new SoapUtil[] { Soap11Util.getInstance(), Soap12Util.getInstance() });
-            XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
-            XmlElement leadHeader = soapHeader.element(LeadContextHeader.NS, LeadContextHeader.TYPE.getLocalPart());
-            logger.info("leadHeader: " + XMLUtil.xmlElementToString(leadHeader));
-            if (leadHeader == null) {
-                return null;
-            }
-            LeadContextHeader leadContext = new LeadContextHeader(leadHeader);
-            ServiceNotificationSender sender = new ServiceNotificationSender(soapFragrance, leadContext);
-            sender.serviceInvoked(inputElement);
-
-            return sender;
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            return null;
-        }
-    }
-
-    /**
-     * Constructs a ServiceNotificationSender.
-     * 
-     * @param soapFragrance
-     * @param leadContext
-     */
-    private ServiceNotificationSender(SoapUtil soapFragrance, LeadContextHeader leadContext) {
-        this.soapFragrance = soapFragrance;
-        this.notifier = NotifierFactory.createNotifier();
-
-        URI workflowID = leadContext.getWorkflowId();
-        String serviceIDString = leadContext.getServiceId();
-        if (serviceIDString == null) {
-            serviceIDString = "serviceIDWasNull";
-        }
-        URI serviceID = URI.create(serviceIDString);
-        String nodeID = leadContext.getNodeId();
-        String timeStepString = leadContext.getTimeStep();
-        Integer timeStep = null;
-        if (timeStepString != null) {
-            try {
-                timeStep = new Integer(timeStepString);
-            } catch (NumberFormatException e) {
-                logger.error(e.getMessage(), e);
-            }
-        }
-        this.initiator = this.notifier.createEntity(workflowID, serviceID, nodeID, timeStep);
-        this.receiver = this.notifier.createEntity(workflowID, serviceID, nodeID, timeStep);
-        EndpointReference epr = new EndpointReference(leadContext.getEventSink().getAddress().toString());
-        this.context = this.notifier.createTrackingContext(new Properties(), epr.toString(), workflowID, serviceID,
-                nodeID, timeStep);
-    }
-
-    /**
-     * @param inputElement
-     */
-    private void serviceInvoked(XmlElement inputElement) {
-        XmlElement soapBody = (XmlElement) inputElement.getParent();
-        XmlElement soapEnvelope = (XmlElement) soapBody.getParent();
-        XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
-        XmlObject headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
-        XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody);
-        this.invocationContext = this.notifier.serviceInvoked(this.context, this.initiator, headerObject, bodyObject,
-                INVOKED_MESSAGE);
-    }
-
-    /**
-     * @param outputElement
-     */
-    public void sendingResult(XmlElement outputElement) {
-        try {
-            XmlDocument document = this.soapFragrance.wrapBodyContent(outputElement);
-            XmlElement soapEnvelope = document.getDocumentElement();
-            XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
-            XmlElement soapBody = soapEnvelope.element(null, XmlConstants.S_BODY);
-            XmlObject headerObject = null;
-            if (soapHeader != null) {
-                headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
-            }
-            XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody);
-            this.notifier.sendingResult(this.context, this.invocationContext, headerObject, bodyObject,
-                    SENDING_RESULT_MESSAGE);
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/Adder.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/Adder.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/Adder.java
deleted file mode 100644
index 1d29245..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/Adder.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.adder;
-
-import java.io.File;
-
-import org.apache.airavata.xbaya.test.service.Service;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.xwsif_runtime.XmlElementBasedStub;
-
-public interface Adder extends XmlElementBasedStub {
-
-    /**
-     * SERVICE_NAME
-     */
-    public final static String SERVICE_NAME = "AdderService";
-
-    /**
-     * WSDL_NAME
-     */
-    public final static String WSDL_NAME = "adder.wsdl";
-
-    /**
-     * WSDL_PATH
-     */
-    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
-
-    /**
-     * @param input
-     *            the input message
-     * @return the output message
-     */
-    public XmlElement add(XmlElement input);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderClient.java
deleted file mode 100644
index d3cfe7c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderClient.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.adder;
-
-import java.net.URI;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
-
-public class AdderClient {
-
-    private final static Logger logger = LoggerFactory.getLogger(AdderClient.class);
-
-    private AdderService service;
-
-    /**
-     * 
-     */
-    public void run() {
-        String wsdlLoc = startServer();
-        runClient(wsdlLoc);
-        shutdownServer();
-    }
-
-    private String startServer() {
-        this.service = new AdderService();
-        this.service.run();
-        return this.service.getServiceWsdlLocation();
-    }
-
-    private void shutdownServer() {
-        this.service.shutdownServer();
-    }
-
-    private void runClient(String wsdlLoc) {
-        logger.info("Invoking operation echoString using WSDL from " + wsdlLoc);
-
-        WSIFAsyncResponsesCorrelator correlator;
-        correlator = null;
-
-        // pass some headers
-        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
-        helper.setXBayaConfiguration(new XBayaConfiguration());
-        LeadContextHeader leadContext = helper.getLeadContextHeader();
-        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
-        leadContext.setNodeId("decoder1");
-        leadContext.setTimeStep("5");
-        leadContext.setServiceId("decoder-instance-10");
-
-        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
-                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
-                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
-        // seconds
-
-        WSIFPort port = wclient.getPort();
-        WSIFOperation operation = port.createOperation("add");
-        WSIFMessage inputMessage = operation.createInputMessage();
-        WSIFMessage outputMessage = operation.createOutputMessage();
-        WSIFMessage faultMessage = operation.createFaultMessage();
-
-        inputMessage.setObjectPart("x", "2");
-        inputMessage.setObjectPart("y", "3");
-
-        logger.info("Sending a message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
-        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
-
-        XmlElement result;
-        if (success) {
-            result = (XmlElement) outputMessage;
-        } else {
-            result = (XmlElement) faultMessage;
-        }
-        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        (new AdderClient()).run();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderImpl.java
deleted file mode 100644
index ee37bf4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderImpl.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.adder;
-
-import java.util.Random;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-import org.xmlpull.v1.builder.XmlNamespace;
-
-import xsul.XmlConstants;
-
-public class AdderImpl implements Adder {
-
-    private final static Logger logger = LoggerFactory.getLogger(AdderImpl.class);
-
-    /**
-     * @see org.apache.airavata.xbaya.test.service.adder.Adder#add(org.xmlpull.v1.builder.XmlElement)
-     */
-    public XmlElement add(XmlElement inputElement) {
-        logger.info(XMLUtil.xmlElementToString(inputElement));
-        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
-
-        XmlElement xElement = inputElement.requiredElement(null, "x");
-        XmlElement yElement = inputElement.requiredElement(null, "y");
-        String xString = xElement.requiredTextContent();
-        String yString = yElement.requiredTextContent();
-
-        int x = Integer.parseInt(xString);
-        int y = Integer.parseInt(yString);
-
-        int z = x + y;
-
-        Random random = new Random();
-        int msec = random.nextInt(5000);
-        logger.info("Sleep for " + msec + " msec");
-        try {
-            Thread.sleep(msec);
-        } catch (InterruptedException e) {
-            logger.error(e.getMessage(), e);
-        }
-
-        String zString = "" + z;
-
-        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("addertypens",
-                "http://www.extreme.indiana.edu/math/adder/xsd/");
-        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "AddOutput");
-        XmlElement zElement = outputElement.addElement("z");
-        zElement.addChild(zString);
-
-        if (notifier != null) {
-            notifier.sendingResult(outputElement);
-        }
-        logger.info(XMLUtil.xmlElementToString(outputElement));
-        return outputElement;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderService.java
deleted file mode 100644
index d14e5f6..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/adder/AdderService.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.adder;
-
-import java.io.File;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xservo.XService;
-import xsul.xservo_soap.XSoapDocLiteralService;
-import xsul.xservo_soap_http.HttpBasedServices;
-
-public class AdderService {
-
-    private final static String SERVICE_NAME = "AdderService";
-
-    private final static String BASE_WSDL_LOCATION = "wsdls/math/adder.wsdl";
-
-    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/adder.wsdl";
-
-    private final static Logger logger = LoggerFactory.getLogger(AdderService.class);
-
-    private HttpBasedServices httpServices;
-
-    private XService xservice;
-
-    private int port;
-
-    /**
-     * Constructs a AdderService.
-     */
-    public AdderService() {
-        this(0);
-    }
-
-    /**
-     * Constructs a AdderService.
-     * 
-     * @param port
-     */
-    public AdderService(int port) {
-        this.port = port;
-    }
-
-    /**
-     * Runs the service.
-     */
-    public void run() {
-        this.httpServices = new HttpBasedServices(this.port);
-        logger.info("Server started on " + this.httpServices.getServerPort());
-
-        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
-        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
-                new AdderImpl()));
-        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
-        this.xservice.startService();
-        logger.info("Service started");
-        logger.info("Service WSDL available at " + getServiceWsdlLocation());
-
-    }
-
-    /**
-     * Returns the location of the WSDL of the service.
-     * 
-     * @return The location of the WSDL of the service.
-     */
-    public String getServiceWsdlLocation() {
-        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
-    }
-
-    /**
-     * Returns the WSDL of the service.
-     * 
-     * @return The WSDL of the service.
-     */
-    public WsdlDefinitions getWsdl() {
-        return this.xservice.getWsdl();
-    }
-
-    /**
-     * Shutdowns the service.
-     */
-    public void shutdownServer() {
-        this.httpServices.getServer().shutdownServer();
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        try {
-            int port = 0;
-            if (args.length == 2) {
-                if ("-port".equalsIgnoreCase(args[0])) {
-                    port = Integer.parseInt(args[1]);
-                }
-            }
-            AdderService service = new AdderService(port);
-            service.run();
-            WsdlDefinitions wsdl = service.getWsdl();
-            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
-            XMLUtil.saveXML(wsdl, wsdlFile);
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/Approver.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/Approver.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/Approver.java
deleted file mode 100644
index 067770d..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/Approver.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.approver;
-
-import java.io.File;
-
-import org.apache.airavata.xbaya.test.service.Service;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.xwsif_runtime.XmlElementBasedStub;
-
-public interface Approver extends XmlElementBasedStub {
-
-    /**
-     * SERVICE_NAME
-     */
-    public final static String SERVICE_NAME = "ApproverService";
-
-    /**
-     * WSDL_NAME
-     */
-    public final static String WSDL_NAME = "approver.wsdl";
-
-    /**
-     * WSDL_PATH
-     */
-    public final static String WSDL_PATH = Service.LOAN_DIRECTORY_NAME + File.separator + WSDL_NAME;
-
-    /**
-     * @param input
-     *            the input message
-     * @return the output message
-     */
-    public XmlElement approve(XmlElement input);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverClient.java
deleted file mode 100644
index 954d93e..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverClient.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.approver;
-
-import java.net.URI;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
-
-public class ApproverClient {
-
-    private final static Logger logger = LoggerFactory.getLogger(ApproverClient.class);
-
-    private ApproverService service;
-
-    /**
-     * 
-     */
-    public void run() {
-        String wsdlLoc = startServer();
-        runClient(wsdlLoc);
-        shutdownServer();
-    }
-
-    private String startServer() {
-        this.service = new ApproverService();
-        this.service.run();
-        return this.service.getServiceWsdlLocation();
-    }
-
-    private void shutdownServer() {
-        this.service.shutdownServer();
-    }
-
-    private void runClient(String wsdlLoc) {
-        logger.info("Invoking operation echoString using WSDL from " + wsdlLoc);
-
-        WSIFAsyncResponsesCorrelator correlator;
-        correlator = null;
-
-        // pass some headers
-        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
-        helper.setXBayaConfiguration(new XBayaConfiguration());
-        LeadContextHeader leadContext = helper.getLeadContextHeader();
-        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
-        leadContext.setNodeId("decoder1");
-        leadContext.setTimeStep("5");
-        leadContext.setServiceId("decoder-instance-10");
-
-        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
-                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
-                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
-        // seconds
-
-        WSIFPort port = wclient.getPort();
-        WSIFOperation operation = port.createOperation("approve");
-        WSIFMessage inputMessage = operation.createInputMessage();
-        WSIFMessage outputMessage = operation.createOutputMessage();
-        WSIFMessage faultMessage = operation.createFaultMessage();
-
-        inputMessage.setObjectPart("amount", "100");
-
-        logger.info("Sending a message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
-        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
-
-        XmlElement result;
-        if (success) {
-            result = (XmlElement) outputMessage;
-        } else {
-            result = (XmlElement) faultMessage;
-        }
-        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        (new ApproverClient()).run();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverImpl.java
deleted file mode 100644
index 37bff40..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverImpl.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.approver;
-
-import java.util.Random;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-import org.xmlpull.v1.builder.XmlNamespace;
-
-import xsul.XmlConstants;
-
-public class ApproverImpl implements Approver {
-
-    private final static Logger logger = LoggerFactory.getLogger(ApproverImpl.class);
-
-    /**
-     * @see org.apache.airavata.xbaya.test.service.approver.Approver#approve(org.xmlpull.v1.builder.XmlElement)
-     */
-    public XmlElement approve(XmlElement inputElement) {
-        logger.info(XMLUtil.xmlElementToString(inputElement));
-        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
-
-        XmlElement amountElement = inputElement.requiredElement(null, "amount");
-        String amountString = amountElement.requiredTextContent();
-        int amount = Integer.parseInt(amountString);
-        logger.info("amount: " + amount);
-
-        Random random = new Random();
-        int msec = random.nextInt(5000);
-        logger.info("Sleep for " + msec + " msec");
-        try {
-            Thread.sleep(msec);
-        } catch (InterruptedException e) {
-            logger.error(e.getMessage(), e);
-        }
-
-        String accept = "No";
-
-        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("approvertypens",
-                "http://www.extreme.indiana.edu/loan/approver/xsd/");
-        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "ApproveOutput");
-        XmlElement acceptElement = outputElement.addElement("accept");
-        acceptElement.addChild(accept);
-
-        if (notifier != null) {
-            notifier.sendingResult(outputElement);
-        }
-        logger.info(XMLUtil.xmlElementToString(outputElement));
-        return outputElement;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverService.java
deleted file mode 100644
index 30caac2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/approver/ApproverService.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.approver;
-
-import java.io.File;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xservo.XService;
-import xsul.xservo_soap.XSoapDocLiteralService;
-import xsul.xservo_soap_http.HttpBasedServices;
-
-public class ApproverService {
-
-    private final static String SERVICE_NAME = "ApproverService";
-
-    private final static String BASE_WSDL_LOCATION = "wsdls/loan/approver-wsdl.xml";
-
-    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/approver-wsdl.xml";
-
-    private final static Logger logger = LoggerFactory.getLogger(ApproverService.class);
-
-    private HttpBasedServices httpServices;
-
-    private XService xservice;
-
-    private int port;
-
-    /**
-     * Constructs a AdderService.
-     */
-    public ApproverService() {
-        this(0);
-    }
-
-    /**
-     * Constructs a AdderService.
-     * 
-     * @param port
-     */
-    public ApproverService(int port) {
-        this.port = port;
-    }
-
-    /**
-     * Runs the service.
-     */
-    public void run() {
-        this.httpServices = new HttpBasedServices(this.port);
-        logger.info("Server started on " + this.httpServices.getServerPort());
-
-        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
-        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
-                new ApproverImpl()));
-        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
-        this.xservice.startService();
-        logger.info("Service started");
-        logger.info("Service WSDL available at " + getServiceWsdlLocation());
-
-    }
-
-    /**
-     * Returns the location of the WSDL of the service.
-     * 
-     * @return The location of the WSDL of the service.
-     */
-    public String getServiceWsdlLocation() {
-        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
-    }
-
-    /**
-     * Returns the WSDL of the service.
-     * 
-     * @return The WSDL of the service.
-     */
-    public WsdlDefinitions getWsdl() {
-        return this.xservice.getWsdl();
-    }
-
-    /**
-     * Shutdowns the service.
-     */
-    public void shutdownServer() {
-        this.httpServices.getServer().shutdownServer();
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        try {
-            int port = 0;
-            if (args.length == 2) {
-                if ("-port".equalsIgnoreCase(args[0])) {
-                    port = Integer.parseInt(args[1]);
-                }
-            }
-            ApproverService service = new ApproverService(port);
-            service.run();
-            WsdlDefinitions wsdl = service.getWsdl();
-            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
-            XMLUtil.saveXML(wsdl, wsdlFile);
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdder.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdder.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdder.java
deleted file mode 100644
index 4fc4bb9..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdder.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.arrayadder;
-
-import java.io.File;
-
-import org.apache.airavata.xbaya.test.service.Service;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.xwsif_runtime.XmlElementBasedStub;
-
-public interface ArrayAdder extends XmlElementBasedStub {
-
-    /**
-     * SERVICE_NAME
-     */
-    public final static String SERVICE_NAME = "ArrayAdderService";
-
-    /**
-     * WSDL_NAME
-     */
-    public final static String WSDL_NAME = "arrayadder.wsdl";
-
-    /**
-     * WSDL_PATH
-     */
-    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
-
-    /**
-     * @param input
-     *            the input message
-     * @return the output message
-     */
-    public XmlElement add(XmlElement input);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderClient.java
deleted file mode 100644
index 58786e2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderClient.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.arrayadder;
-
-import java.net.URI;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.XmlConstants;
-import xsul.lead.LeadContextHeader;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
-
-public class ArrayAdderClient {
-
-    private final static Logger logger = LoggerFactory.getLogger(ArrayAdderClient.class);
-
-    private ArrayAdderService service;
-
-    /**
-     * 
-     */
-    public void run() {
-        String wsdlLoc = startServer();
-        runClient(wsdlLoc);
-        shutdownServer();
-    }
-
-    private String startServer() {
-        this.service = new ArrayAdderService();
-        this.service.run();
-        return this.service.getServiceWsdlLocation();
-    }
-
-    private void shutdownServer() {
-        this.service.shutdownServer();
-    }
-
-    private void runClient(String wsdlLoc) {
-        logger.info("Invoking operation add using WSDL from " + wsdlLoc);
-
-        WSIFAsyncResponsesCorrelator correlator;
-        correlator = null;
-
-        // pass some headers
-        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
-        helper.setXBayaConfiguration(new XBayaConfiguration());
-        LeadContextHeader leadContext = helper.getLeadContextHeader();
-        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
-        leadContext.setNodeId("decoder1");
-        leadContext.setTimeStep("5");
-        leadContext.setServiceId("decoder-instance-10");
-
-        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
-                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
-                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
-        // seconds
-
-        WSIFPort port = wclient.getPort();
-        WSIFOperation operation = port.createOperation("add");
-        WSIFMessage inputMessage = operation.createInputMessage();
-        WSIFMessage outputMessage = operation.createOutputMessage();
-        WSIFMessage faultMessage = operation.createFaultMessage();
-
-        // Input
-        XmlElement arrayElement = XmlConstants.BUILDER.newFragment("input");
-        for (int i = 0; i < 5; i++) {
-            XmlElement valueElement = arrayElement.addElement("value");
-            valueElement.addChild("" + i);
-        }
-
-        inputMessage.setObjectPart("input", arrayElement);
-
-        logger.info("Sending a message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
-        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
-
-        XmlElement result;
-        if (success) {
-            result = (XmlElement) outputMessage;
-        } else {
-            result = (XmlElement) faultMessage;
-        }
-        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        (new ArrayAdderClient()).run();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderImpl.java
deleted file mode 100644
index ab2792c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.arrayadder;
-
-import java.util.Iterator;
-import java.util.Random;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-import org.xmlpull.v1.builder.XmlNamespace;
-
-import xsul.XmlConstants;
-
-public class ArrayAdderImpl implements ArrayAdder {
-
-    private final static Logger logger = LoggerFactory.getLogger(ArrayAdderImpl.class);
-
-    /**
-     * @see org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdder#add(org.xmlpull.v1.builder.XmlElement)
-     */
-    public XmlElement add(XmlElement inputElement) {
-        logger.info(XMLUtil.xmlElementToString(inputElement));
-
-        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
-
-        XmlElement arrayElement = inputElement.requiredElement(null, "input");
-
-        int sum = 0;
-        @SuppressWarnings("rawtypes")
-		Iterator valueIt = arrayElement.elements(null, "value").iterator();
-        while (valueIt.hasNext()) {
-            XmlElement valueElement = (XmlElement) valueIt.next();
-            String valueString = valueElement.requiredTextContent();
-            int value = Integer.parseInt(valueString);
-            sum += value;
-        }
-
-        Random random = new Random();
-        int msec = random.nextInt(5000);
-        logger.info("Sleep for " + msec + " msec");
-        try {
-            Thread.sleep(msec);
-        } catch (InterruptedException e) {
-            logger.error(e.getMessage(), e);
-        }
-
-        String sumString = "" + sum;
-
-        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("typens",
-                "http://www.extreme.indiana.edu/math/arrayadder/xsd/");
-        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "ArrayAdderOutput");
-        XmlElement sumElement = outputElement.addElement("sum");
-        sumElement.addChild(sumString);
-
-        if (notifier != null) {
-            notifier.sendingResult(outputElement);
-        }
-        logger.info(XMLUtil.xmlElementToString(outputElement));
-        return outputElement;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderService.java
deleted file mode 100644
index b5f9cae..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arrayadder/ArrayAdderService.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.arrayadder;
-
-import java.io.File;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xservo.XService;
-import xsul.xservo_soap.XSoapDocLiteralService;
-import xsul.xservo_soap_http.HttpBasedServices;
-
-public class ArrayAdderService {
-
-    private final static String SERVICE_NAME = "ArrayGeneratorService";
-
-    private final static String BASE_WSDL_LOCATION = "wsdls/math/arrayadder-wsdl.xml";
-
-    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/arrayadder-wsdl.xml";
-
-    private final static Logger logger = LoggerFactory.getLogger(ArrayAdderService.class);
-
-    private HttpBasedServices httpServices;
-
-    private XService xservice;
-
-    private int port;
-
-    /**
-     * Constructs a AdderService.
-     */
-    public ArrayAdderService() {
-        this(0);
-    }
-
-    /**
-     * Constructs a AdderService.
-     * 
-     * @param port
-     */
-    public ArrayAdderService(int port) {
-        this.port = port;
-    }
-
-    /**
-     * Runs the service.
-     */
-    public void run() {
-        this.httpServices = new HttpBasedServices(this.port);
-        logger.info("Server started on " + this.httpServices.getServerPort());
-
-        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
-        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
-                new ArrayAdderImpl()));
-        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
-        this.xservice.startService();
-        logger.info("Service started");
-        logger.info("Service WSDL available at " + getServiceWsdlLocation());
-
-    }
-
-    /**
-     * Returns the location of the WSDL of the service.
-     * 
-     * @return The location of the WSDL of the service.
-     */
-    public String getServiceWsdlLocation() {
-        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
-    }
-
-    /**
-     * Returns the WSDL of the service.
-     * 
-     * @return The WSDL of the service.
-     */
-    public WsdlDefinitions getWsdl() {
-        return this.xservice.getWsdl();
-    }
-
-    /**
-     * Shutdowns the service.
-     */
-    public void shutdownServer() {
-        this.httpServices.getServer().shutdownServer();
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        try {
-            int port = 0;
-            if (args.length == 2) {
-                if ("-port".equalsIgnoreCase(args[0])) {
-                    port = Integer.parseInt(args[1]);
-                }
-            }
-            ArrayAdderService service = new ArrayAdderService(port);
-            service.run();
-            WsdlDefinitions wsdl = service.getWsdl();
-            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
-            XMLUtil.saveXML(wsdl, wsdlFile);
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGenerator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGenerator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGenerator.java
deleted file mode 100644
index 4ffd01b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGenerator.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.arraygen;
-
-import java.io.File;
-
-import org.apache.airavata.xbaya.test.service.Service;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.xwsif_runtime.XmlElementBasedStub;
-
-public interface ArrayGenerator extends XmlElementBasedStub {
-
-    /**
-     * SERVICE_NAME
-     */
-    public final static String SERVICE_NAME = "ArrayGeneratorService";
-
-    /**
-     * WSDL_NAME
-     */
-    public final static String WSDL_NAME = "arraygen.wsdl";
-
-    /**
-     * WSDL_PATH
-     */
-    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
-
-    /**
-     * @param input
-     *            the input message
-     * @return the output message
-     */
-    public XmlElement generate(XmlElement input);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorClient.java
deleted file mode 100644
index 3256d6f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorClient.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.arraygen;
-
-import java.net.URI;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
-
-public class ArrayGeneratorClient {
-
-    private final static Logger logger = LoggerFactory.getLogger(ArrayGeneratorClient.class);
-
-    private ArrayGeneratorService service;
-
-    /**
-     * 
-     */
-    public void run() {
-        String wsdlLoc = startServer();
-        runClient(wsdlLoc);
-        shutdownServer();
-    }
-
-    private String startServer() {
-        this.service = new ArrayGeneratorService();
-        this.service.run();
-        return this.service.getServiceWsdlLocation();
-    }
-
-    private void shutdownServer() {
-        this.service.shutdownServer();
-    }
-
-    private void runClient(String wsdlLoc) {
-        logger.info("Invoking operation echoString using WSDL from " + wsdlLoc);
-
-        WSIFAsyncResponsesCorrelator correlator;
-        correlator = null;
-
-        // pass some headers
-        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
-        helper.setXBayaConfiguration(new XBayaConfiguration());
-        LeadContextHeader leadContext = helper.getLeadContextHeader();
-        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
-        leadContext.setNodeId("decoder1");
-        leadContext.setTimeStep("5");
-        leadContext.setServiceId("decoder-instance-10");
-
-        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
-                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
-                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
-        // seconds
-
-        WSIFPort port = wclient.getPort();
-        WSIFOperation operation = port.createOperation("generate");
-        WSIFMessage inputMessage = operation.createInputMessage();
-        WSIFMessage outputMessage = operation.createOutputMessage();
-        WSIFMessage faultMessage = operation.createFaultMessage();
-
-        inputMessage.setObjectPart("n", "3");
-
-        logger.info("Sending a message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
-        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
-
-        XmlElement result;
-        if (success) {
-            result = (XmlElement) outputMessage;
-        } else {
-            result = (XmlElement) faultMessage;
-        }
-        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        (new ArrayGeneratorClient()).run();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorImpl.java
deleted file mode 100644
index 3f6cb9d..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorImpl.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.arraygen;
-
-import java.util.Random;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-import org.xmlpull.v1.builder.XmlNamespace;
-
-import xsul.XmlConstants;
-
-public class ArrayGeneratorImpl implements ArrayGenerator {
-
-    private final static Logger logger = LoggerFactory.getLogger(ArrayGeneratorImpl.class);
-
-    /**
-     * @see org.apache.airavata.xbaya.test.service.arraygen.ArrayGenerator#generate(org.xmlpull.v1.builder.XmlElement)
-     */
-    public XmlElement generate(XmlElement inputElement) {
-        logger.info(XMLUtil.xmlElementToString(inputElement));
-
-        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
-
-        XmlElement nElement = inputElement.requiredElement(null, "n");
-        String nString = nElement.requiredTextContent();
-
-        int n = Integer.parseInt(nString);
-
-        Random random = new Random();
-        int msec = random.nextInt(5000);
-        logger.info("Sleep for " + msec + " msec");
-        try {
-            Thread.sleep(msec);
-        } catch (InterruptedException e) {
-            logger.error(e.getMessage(), e);
-        }
-
-        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("typens",
-                "http://www.extreme.indiana.edu/math/arraygen/xsd/");
-        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "ArrayGeneratorOutput");
-
-        XmlElement arrayElement = outputElement.addElement("output");
-        for (int i = 0; i < n; i++) {
-            XmlElement valueElement = arrayElement.addElement("value");
-            valueElement.addChild("" + i);
-        }
-
-        if (notifier != null) {
-            notifier.sendingResult(outputElement);
-        }
-        logger.info(XMLUtil.xmlElementToString(outputElement));
-        return outputElement;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorService.java
deleted file mode 100644
index 5685c69..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/arraygen/ArrayGeneratorService.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.arraygen;
-
-import java.io.File;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xservo.XService;
-import xsul.xservo_soap.XSoapDocLiteralService;
-import xsul.xservo_soap_http.HttpBasedServices;
-
-public class ArrayGeneratorService {
-
-    private final static String SERVICE_NAME = "ArrayGeneratorService";
-
-    private final static String BASE_WSDL_LOCATION = "wsdls/math/arraygen-wsdl.xml";
-
-    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/arraygen-wsdl.xml";
-
-    private final static Logger logger = LoggerFactory.getLogger(ArrayGeneratorService.class);
-
-    private HttpBasedServices httpServices;
-
-    private XService xservice;
-
-    private int port;
-
-    /**
-     * Constructs a AdderService.
-     */
-    public ArrayGeneratorService() {
-        this(0);
-    }
-
-    /**
-     * Constructs a AdderService.
-     * 
-     * @param port
-     */
-    public ArrayGeneratorService(int port) {
-        this.port = port;
-    }
-
-    /**
-     * Runs the service.
-     */
-    public void run() {
-        this.httpServices = new HttpBasedServices(this.port);
-        logger.info("Server started on " + this.httpServices.getServerPort());
-
-        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
-        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
-                new ArrayGeneratorImpl()));
-        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
-        this.xservice.startService();
-        logger.info("Service started");
-        logger.info("Service WSDL available at " + getServiceWsdlLocation());
-
-    }
-
-    /**
-     * Returns the location of the WSDL of the service.
-     * 
-     * @return The location of the WSDL of the service.
-     */
-    public String getServiceWsdlLocation() {
-        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
-    }
-
-    /**
-     * Returns the WSDL of the service.
-     * 
-     * @return The WSDL of the service.
-     */
-    public WsdlDefinitions getWsdl() {
-        return this.xservice.getWsdl();
-    }
-
-    /**
-     * Shutdowns the service.
-     */
-    public void shutdownServer() {
-        this.httpServices.getServer().shutdownServer();
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        try {
-            int port = 0;
-            if (args.length == 2) {
-                if ("-port".equalsIgnoreCase(args[0])) {
-                    port = Integer.parseInt(args[1]);
-                }
-            }
-            ArrayGeneratorService service = new ArrayGeneratorService(port);
-            service.run();
-            WsdlDefinitions wsdl = service.getWsdl();
-            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
-            XMLUtil.saveXML(wsdl, wsdlFile);
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-}
\ No newline at end of file


[44/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/AiravataRegistryAPITest.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/AiravataRegistryAPITest.java b/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/AiravataRegistryAPITest.java
deleted file mode 100644
index 33c0520..0000000
--- a/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/AiravataRegistryAPITest.java
+++ /dev/null
@@ -1,1800 +0,0 @@
-/*
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied.  See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*
-*/
-
-package org.apache.airavata.registry.api.test;
-
-import junit.framework.TestCase;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
-import org.apache.airavata.registry.api.*;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.test.util.Initialize;
-import org.apache.airavata.registry.api.workflow.*;
-import org.apache.airavata.schemas.gfac.*;
-
-import java.net.URI;
-import java.sql.Date;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.List;
-import java.util.Map;
-
-public class AiravataRegistryAPITest extends TestCase {
-    private AiravataRegistry2 registry;
-    private  Initialize initialize;
-    @Override
-    protected void setUp() throws Exception {
-        initialize = new Initialize();
-        initialize.initializeDB();
-        registry = AiravataRegistryFactory.getRegistry(new Gateway("default"), new AiravataUser("admin"));
-
-    }
-
-    public void testAddConfiguration() throws Exception {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        registry.addConfiguration("configkey", "configval", currentTime);
-
-        assertTrue("configuration add successfully", ResourceUtils.isConfigurationExists("configkey", "configval"));
-        Object config = registry.getConfiguration("configkey");
-        ResourceUtils.removeConfiguration("configkey", "configval");
-
-    }
-
-    public void testGetConfigurationList() throws Exception {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        registry.addConfiguration("configkey1", "configval1", currentTime);
-        registry.addConfiguration("configkey1", "configval2", currentTime);
-
-        List<Object> list = registry.getConfigurationList("configkey1");
-        assertTrue("configurations retrieved successfully", list.size() == 2);
-
-        ResourceUtils.removeConfiguration("configkey1");
-
-    }
-
-    public void testSetConfiguration() throws Exception {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        registry.addConfiguration("configkey1", "configval1", currentTime);
-        registry.setConfiguration("configkey1", "configval1", currentTime);
-        registry.setConfiguration("configkey2", "configval2", currentTime);
-
-        assertTrue("Configuration updated successfully", ResourceUtils.isConfigurationExist("configkey1"));
-        assertTrue("Configuration updated successfully", ResourceUtils.isConfigurationExist("configkey2"));
-
-        ResourceUtils.removeConfiguration("configkey1");
-        ResourceUtils.removeConfiguration("configkey2");
-    }
-
-    public void testRemoveAllConfiguration() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        registry.addConfiguration("configkey1", "configval1", currentTime);
-        registry.addConfiguration("configkey1", "configval2", currentTime);
-
-        registry.removeAllConfiguration("configkey1");
-
-        assertFalse("configurations removed successfully", ResourceUtils.isConfigurationExist("configkey1"));
-    }
-
-
-    public void testRemoveConfiguration() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        registry.addConfiguration("configkey1", "configval1", currentTime);
-
-        registry.removeConfiguration("configkey1", "configval1");
-        assertFalse("comnfiguration removed successfully", ResourceUtils.isConfigurationExists("configkey1", "configval1"));
-    }
-
-
-    public void testGetGFacURIs() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        registry.addConfiguration("gfac.url", "http://192.168.17.1:8080/axis2/services/GFacService", currentTime);
-        List<URI> gFacURIs = registry.getGFacURIs();
-        assertTrue("gfac urls retrieved successfully", gFacURIs.size() == 1);
-        ResourceUtils.removeConfiguration("gfac.url");
-    }
-
-
-    public void testGetWorkflowInterpreterURIs() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        registry.addConfiguration("interpreter.url", "http://192.168.17.1:8080/axis2/services/WorkflowInterpretor", currentTime);
-        List<URI> interpreterURIs = registry.getWorkflowInterpreterURIs();
-        assertTrue("interpreter urls retrieved successfully", interpreterURIs.size() == 1);
-        ResourceUtils.removeConfiguration("interpreter.url");
-    }
-
-
-    public void testGetEventingServiceURI() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        registry.addConfiguration("eventing.url", "http://192.168.17.1:8080/axis2/services/EventingService", currentTime);
-        URI eventingServiceURI = registry.getEventingServiceURI();
-        assertNotNull("eventing url retrieved successfully", eventingServiceURI);
-        ResourceUtils.removeConfiguration("eventing.url");
-    }
-
-    public void testGetMessageBoxURI() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        registry.addConfiguration("messagebox.url", "http://192.168.17.1:8080/axis2/services/MsgBoxService", currentTime);
-        URI messageBoxURI = registry.getMessageBoxURI();
-        assertNotNull("message box url retrieved successfully", messageBoxURI);
-        ResourceUtils.removeConfiguration("messagebox.url");
-    }
-
-
-    public void testAddGFacURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/GFacService");
-        registry.addGFacURI(uri);
-        List<URI> gFacURIs = registry.getGFacURIs();
-        assertTrue("gfac url add successfully", gFacURIs.size() == 1);
-        registry.removeConfiguration("gfac.url", "http://192.168.17.1:8080/axis2/services/GFacService");
-    }
-
-
-    public void testAddWorkflowInterpreterURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/WorkflowInterpretor");
-        registry.addWorkflowInterpreterURI(uri);
-        List<URI> interpreterURIs = registry.getWorkflowInterpreterURIs();
-        assertTrue("interpreter url add successfully", interpreterURIs.size() == 1);
-        registry.removeConfiguration("interpreter.url", "http://192.168.17.1:8080/axis2/services/WorkflowInterpretor");
-    }
-
-
-    public void testSetEventingURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/EventingService");
-        registry.setEventingURI(uri);
-        URI eventingServiceURI = registry.getEventingServiceURI();
-        assertNotNull("eventing url added successfully", eventingServiceURI);
-        registry.removeConfiguration("eventing.url", "http://192.168.17.1:8080/axis2/services/EventingService");
-    }
-
-    public void testSetMessageBoxURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/MsgBoxService");
-        registry.setMessageBoxURI(uri);
-        URI messageBoxURI = registry.getMessageBoxURI();
-        assertNotNull("message box url added successfully", messageBoxURI);
-        registry.removeConfiguration("messagebox.url", "http://192.168.17.1:8080/axis2/services/MsgBoxService");
-    }
-
-
-    public void testAddGFacURIWithExpireDate() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/GFacService");
-        registry.addGFacURI(uri, currentTime);
-        List<URI> gFacURIs = registry.getGFacURIs();
-        assertTrue("gfac url add successfully", gFacURIs.size() == 1);
-        registry.removeConfiguration("gfac.url", "http://192.168.17.1:8080/axis2/services/GFacService");
-    }
-
-
-    public void testAddWorkflowInterpreterURIWithExpireDate() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/WorkflowInterpretor");
-        registry.addWorkflowInterpreterURI(uri, currentTime);
-        List<URI> interpreterURIs = registry.getWorkflowInterpreterURIs();
-        assertTrue("interpreter url add successfully", interpreterURIs.size() == 1);
-        registry.removeConfiguration("interpreter.url", "http://192.168.17.1:8080/axis2/services/WorkflowInterpretor");
-
-    }
-
-
-    public void testSetEventingURIWithExpireDate() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/EventingService");
-        registry.setEventingURI(uri, currentTime);
-        URI eventingServiceURI = registry.getEventingServiceURI();
-        assertNotNull("eventing url added successfully", eventingServiceURI);
-        registry.removeConfiguration("eventing.url", "http://192.168.17.1:8080/axis2/services/EventingService");
-    }
-
-
-    public void testSetMessageBoxURIWithExpireDate() throws RegistryException {
-        Calendar calender = Calendar.getInstance();
-        java.util.Date d = calender.getTime();
-        Date currentTime = new Date(d.getTime());
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/MsgBoxService");
-        registry.setMessageBoxURI(uri, currentTime);
-        URI messageBoxURI = registry.getMessageBoxURI();
-        assertNotNull("message box url added successfully", messageBoxURI);
-        registry.removeConfiguration("messagebox.url", "http://192.168.17.1:8080/axis2/services/MsgBoxService");
-    }
-
-
-    public void testRemoveGFacURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/GFacService");
-        registry.addGFacURI(uri);
-        registry.removeGFacURI(uri);
-        assertFalse("Gfac uri removed successfully", ResourceUtils.isConfigurationExist("gfac.url"));
-    }
-
-
-    public void testRemoveAllGFacURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/GFacService");
-        registry.addGFacURI(uri);
-        registry.removeAllGFacURI();
-        assertFalse("Gfac uri removed successfully", ResourceUtils.isConfigurationExist("gfac.url"));
-    }
-
-    public void testRemoveWorkflowInterpreterURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/WorkflowInterpretor");
-        registry.addWorkflowInterpreterURI(uri);
-        registry.removeWorkflowInterpreterURI(uri);
-        assertFalse("workflow interpreter uri removed successfully", ResourceUtils.isConfigurationExist("interpreter.url"));
-    }
-
-    public void testRemoveAllWorkflowInterpreterURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/WorkflowInterpretor");
-        registry.addWorkflowInterpreterURI(uri);
-        registry.removeAllWorkflowInterpreterURI();
-        assertFalse("workflow interpreter uri removed successfully", ResourceUtils.isConfigurationExist("interpreter.url"));
-    }
-
-    public void testUnsetEventingURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/EventingService");
-        registry.setEventingURI(uri);
-        registry.unsetEventingURI();
-        assertNotNull("eventing url removed successfully", ResourceUtils.isConfigurationExist("eventing.url"));
-    }
-
-    public void testUnsetMessageBoxURI() throws RegistryException {
-        URI uri = URI.create("http://192.168.17.1:8080/axis2/services/MsgBoxService");
-        registry.setMessageBoxURI(uri);
-        registry.unsetMessageBoxURI();
-        assertNotNull("message url removed successfully", ResourceUtils.isConfigurationExist("messagebox.url"));
-    }
-
-    public void testIsHostDescriptorExists() throws Exception {
-        HostDescription descriptor = new HostDescription(GlobusHostType.type);
-        descriptor.getType().setHostName("testHost");
-        descriptor.getType().setHostAddress("testHostAddress");
-        registry.addHostDescriptor(descriptor);
-        assertTrue("Host added successfully", registry.isHostDescriptorExists("testHost"));
-        registry.removeHostDescriptor("testHost");
-    }
-
-
-    public void testAddHostDescriptor() throws Exception {
-        HostDescription descriptor = new HostDescription(GlobusHostType.type);
-        descriptor.getType().setHostName("testHost");
-        descriptor.getType().setHostAddress("testHostAddress");
-        registry.addHostDescriptor(descriptor);
-        assertTrue("Host added successfully", registry.isHostDescriptorExists("testHost"));
-        registry.removeHostDescriptor("testHost");
-    }
-
-
-    public void testUpdateHostDescriptor() throws Exception {
-        HostDescription descriptor = new HostDescription(GlobusHostType.type);
-        descriptor.getType().setHostName("testHost");
-        descriptor.getType().setHostAddress("testHostAddress");
-        registry.addHostDescriptor(descriptor);
-        HostDescription hostDescriptor = registry.getHostDescriptor("testHost");
-        hostDescriptor.getType().setHostAddress("testHostAddress2");
-        registry.updateHostDescriptor(hostDescriptor);
-        HostDescription testHost = registry.getHostDescriptor("testHost");
-        assertTrue("host updated successfully", testHost.getType().getHostAddress().equals("testHostAddress2"));
-        registry.removeHostDescriptor("testHost");
-    }
-
-
-    public void testGetHostDescriptor() throws Exception {
-        HostDescription descriptor = new HostDescription(GlobusHostType.type);
-        descriptor.getType().setHostName("testHost");
-        descriptor.getType().setHostAddress("testHostAddress");
-        registry.addHostDescriptor(descriptor);
-        HostDescription hostDescriptor = registry.getHostDescriptor("testHost");
-        assertNotNull("host descriptor retrieved successfully", hostDescriptor);
-        registry.removeHostDescriptor("testHost");
-    }
-
-    public void testRemoveHostDescriptor() throws Exception {
-        HostDescription descriptor = new HostDescription(GlobusHostType.type);
-        descriptor.getType().setHostName("testHost");
-        descriptor.getType().setHostAddress("testHostAddress");
-        registry.addHostDescriptor(descriptor);
-        registry.removeHostDescriptor("testHost");
-        assertFalse("host descriptor removed successfully", registry.isHostDescriptorExists("testHost"));
-    }
-
-    public void testGetHostDescriptors() throws Exception {
-        HostDescription descriptor = new HostDescription(GlobusHostType.type);
-        descriptor.getType().setHostName("testHost");
-        descriptor.getType().setHostAddress("testHostAddress");
-        registry.addHostDescriptor(descriptor);
-        List<HostDescription> hostDescriptors = registry.getHostDescriptors();
-        assertTrue("host descriptors retrieved successfully", hostDescriptors.size() == 1);
-        registry.removeHostDescriptor("testHost");
-    }
-
-
-    public void testIsServiceDescriptorExists() throws Exception {
-        ServiceDescription serviceDescription = new ServiceDescription();
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-        serviceDescription.getType().setName("testServiceDesc");
-        serviceDescription.getType().setDescription("testDescription");
-        InputParameterType parameter = InputParameterType.Factory.newInstance();
-        parameter.setParameterName("input1");
-        parameter.setParameterDescription("testDesc");
-        ParameterType parameterType = parameter.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString("testType"));
-        parameterType.setName("testParamtype");
-        inputParameters.add(parameter);
-
-        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-        outputParameter.setParameterName("input1");
-        outputParameter.setParameterDescription("testDesc");
-        ParameterType outputParaType = outputParameter.addNewParameterType();
-        outputParaType.setType(DataType.Enum.forString("testType"));
-        outputParaType.setName("testParamtype");
-        outputParameters.add(outputParameter);
-
-        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-
-        registry.addServiceDescriptor(serviceDescription);
-        assertTrue("Service desc exists", registry.isServiceDescriptorExists("testServiceDesc"));
-
-        registry.removeServiceDescriptor("testServiceDesc");
-    }
-
-
-    public void testAddServiceDescriptor() throws Exception {
-        ServiceDescription serviceDescription = new ServiceDescription();
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-        serviceDescription.getType().setName("testServiceDesc");
-        serviceDescription.getType().setDescription("testDescription");
-        InputParameterType parameter = InputParameterType.Factory.newInstance();
-        parameter.setParameterName("input1");
-        parameter.setParameterDescription("testDesc");
-        ParameterType parameterType = parameter.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString("testType"));
-        parameterType.setName("testParamtype");
-        inputParameters.add(parameter);
-
-        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-        outputParameter.setParameterName("input1");
-        outputParameter.setParameterDescription("testDesc");
-        ParameterType outputParaType = outputParameter.addNewParameterType();
-        outputParaType.setType(DataType.Enum.forString("testType"));
-        outputParaType.setName("testParamtype");
-        outputParameters.add(outputParameter);
-
-        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-
-        registry.addServiceDescriptor(serviceDescription);
-        assertTrue("Service desc saved successfully", registry.isServiceDescriptorExists("testServiceDesc"));
-        ServiceDescription serviceDescriptor = registry.getServiceDescriptor("testServiceDesc");
-        registry.removeServiceDescriptor("testServiceDesc");
-    }
-
-
-    public void testUpdateServiceDescriptor() throws Exception {
-        ServiceDescription serviceDescription = new ServiceDescription();
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-        serviceDescription.getType().setName("testServiceDesc");
-        serviceDescription.getType().setDescription("testDescription1");
-        InputParameterType parameter = InputParameterType.Factory.newInstance();
-        parameter.setParameterName("input1");
-        parameter.setParameterDescription("testDesc");
-        ParameterType parameterType = parameter.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString("testType"));
-        parameterType.setName("testParamtype");
-        inputParameters.add(parameter);
-
-        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-        outputParameter.setParameterName("input1");
-        outputParameter.setParameterDescription("testDesc");
-        ParameterType outputParaType = outputParameter.addNewParameterType();
-        outputParaType.setType(DataType.Enum.forString("testType"));
-        outputParaType.setName("testParamtype");
-        outputParameters.add(outputParameter);
-
-        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-
-        registry.addServiceDescriptor(serviceDescription);
-        ServiceDescription testServiceDesc = registry.getServiceDescriptor("testServiceDesc");
-        testServiceDesc.getType().setDescription("testDescription2");
-
-        parameter = InputParameterType.Factory.newInstance();
-        parameter.setParameterName("input2");
-        parameter.setParameterDescription("testDesc2");
-        parameterType = parameter.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString("testType2"));
-        parameterType.setName("testParamtype2");
-        inputParameters.add(parameter);
-
-        outputParameter = OutputParameterType.Factory.newInstance();
-        outputParameter.setParameterName("input2");
-        outputParameter.setParameterDescription("testDesc2");
-        outputParaType = outputParameter.addNewParameterType();
-        outputParaType.setType(DataType.Enum.forString("testType2"));
-        outputParaType.setName("testParamtype2");
-        outputParameters.add(outputParameter);
-
-        testServiceDesc.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-        testServiceDesc.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-
-        registry.updateServiceDescriptor(testServiceDesc);
-        assertTrue("Service updated successfully", registry.getServiceDescriptor("testServiceDesc").getType().getDescription().equals("testDescription2"));
-        registry.removeServiceDescriptor("testServiceDesc");
-    }
-
-
-    public void testGetServiceDescriptor() throws Exception {
-        ServiceDescription serviceDescription = new ServiceDescription();
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-        serviceDescription.getType().setName("testServiceDesc");
-        serviceDescription.getType().setDescription("testDescription1");
-        InputParameterType parameter = InputParameterType.Factory.newInstance();
-        parameter.setParameterName("input1");
-        parameter.setParameterDescription("testDesc");
-        ParameterType parameterType = parameter.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString("testType"));
-        parameterType.setName("testParamtype");
-        inputParameters.add(parameter);
-
-        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-        outputParameter.setParameterName("input1");
-        outputParameter.setParameterDescription("testDesc");
-        ParameterType outputParaType = outputParameter.addNewParameterType();
-        outputParaType.setType(DataType.Enum.forString("testType"));
-        outputParaType.setName("testParamtype");
-        outputParameters.add(outputParameter);
-
-        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-
-        registry.addServiceDescriptor(serviceDescription);
-        ServiceDescription testServiceDesc = registry.getServiceDescriptor("testServiceDesc");
-
-        assertNotNull("service descriptor retrieved successfully", testServiceDesc);
-        registry.removeServiceDescriptor("testServiceDesc");
-    }
-
-
-    public void testRemoveServiceDescriptor() throws Exception {
-        ServiceDescription serviceDescription = new ServiceDescription();
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-        serviceDescription.getType().setName("testServiceDesc");
-        InputParameterType parameter = InputParameterType.Factory.newInstance();
-        parameter.setParameterName("input1");
-        parameter.setParameterDescription("testDesc");
-        ParameterType parameterType = parameter.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString("testType"));
-        parameterType.setName("testParamtype");
-        inputParameters.add(parameter);
-
-        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-        outputParameter.setParameterName("input1");
-        outputParameter.setParameterDescription("testDesc");
-        ParameterType outputParaType = outputParameter.addNewParameterType();
-        outputParaType.setType(DataType.Enum.forString("testType"));
-        outputParaType.setName("testParamtype");
-        outputParameters.add(outputParameter);
-
-        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-
-        registry.addServiceDescriptor(serviceDescription);
-        registry.removeServiceDescriptor("testServiceDesc");
-        assertFalse("Service desc removed successfully", registry.isServiceDescriptorExists("testServiceDesc"));
-    }
-
-
-    public void testGetServiceDescriptors() throws Exception {
-        ServiceDescription serviceDescription = new ServiceDescription();
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-        serviceDescription.getType().setName("testServiceDesc");
-        InputParameterType parameter = InputParameterType.Factory.newInstance();
-        parameter.setParameterName("input1");
-        parameter.setParameterDescription("testDesc");
-        ParameterType parameterType = parameter.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString("testType"));
-        parameterType.setName("testParamtype");
-        inputParameters.add(parameter);
-
-        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-        outputParameter.setParameterName("input1");
-        outputParameter.setParameterDescription("testDesc");
-        ParameterType outputParaType = outputParameter.addNewParameterType();
-        outputParaType.setType(DataType.Enum.forString("testType"));
-        outputParaType.setName("testParamtype");
-        outputParameters.add(outputParameter);
-
-        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-        registry.addServiceDescriptor(serviceDescription);
-        List<ServiceDescription> serviceDescriptors = registry.getServiceDescriptors();
-
-        assertTrue("Service desc retrieved successfully", serviceDescriptors.size() == 1);
-        registry.removeServiceDescriptor("testServiceDesc");
-    }
-
-
-    public void testIsApplicationDescriptorExists() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        registry.addApplicationDescriptor("testService", "testHost", applicationDescription);
-        assertTrue("application descriptor exists", registry.isApplicationDescriptorExists("testService", "testHost", "testApplication"));
-        registry.removeApplicationDescriptor("testService", "testHost", "testApplication");
-    }
-
-
-    public void testAddApplicationDescriptorWithOtherDescriptors() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        HostDescription hostDescription = new HostDescription(GlobusHostType.type);
-        hostDescription.getType().setHostName("testHost");
-        hostDescription.getType().setHostAddress("testHostAddress");
-
-        ServiceDescription serviceDescription = new ServiceDescription();
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-        serviceDescription.getType().setName("testServiceDesc");
-        InputParameterType parameter = InputParameterType.Factory.newInstance();
-        parameter.setParameterName("input1");
-        parameter.setParameterDescription("testDesc");
-        ParameterType parameterType = parameter.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString("testType"));
-        parameterType.setName("testParamtype");
-        inputParameters.add(parameter);
-
-        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-        outputParameter.setParameterName("input1");
-        outputParameter.setParameterDescription("testDesc");
-        ParameterType outputParaType = outputParameter.addNewParameterType();
-        outputParaType.setType(DataType.Enum.forString("testType"));
-        outputParaType.setName("testParamtype");
-        outputParameters.add(outputParameter);
-
-        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-
-        registry.addApplicationDescriptor(serviceDescription, hostDescription, applicationDescription);
-        assertTrue("application hostDescription added successfully", registry.isApplicationDescriptorExists("testServiceDesc", "testHost", "testApplication"));
-        registry.removeApplicationDescriptor("testServiceDesc", "testHost", "testApplication");
-    }
-
-
-    public void testAddApplicationDescriptor() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        registry.addApplicationDescriptor("testService", "testHost", applicationDescription);
-        assertTrue("application descriptor added successfully", registry.isApplicationDescriptorExists("testService", "testHost", "testApplication"));
-        registry.removeApplicationDescriptor("testService", "testHost", "testApplication");
-    }
-
-
-    public void testUpdateApplicationDescriptorWithOtherDescriptors() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        HostDescription hostDescription = new HostDescription(GlobusHostType.type);
-        hostDescription.getType().setHostName("testHost");
-        hostDescription.getType().setHostAddress("testHostAddress");
-
-        ServiceDescription serviceDescription = new ServiceDescription();
-        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-        serviceDescription.getType().setName("testServiceDesc");
-        InputParameterType parameter = InputParameterType.Factory.newInstance();
-        parameter.setParameterName("input1");
-        parameter.setParameterDescription("testDesc");
-        ParameterType parameterType = parameter.addNewParameterType();
-        parameterType.setType(DataType.Enum.forString("testType"));
-        parameterType.setName("testParamtype");
-        inputParameters.add(parameter);
-
-        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-        outputParameter.setParameterName("input1");
-        outputParameter.setParameterDescription("testDesc");
-        ParameterType outputParaType = outputParameter.addNewParameterType();
-        outputParaType.setType(DataType.Enum.forString("testType"));
-        outputParaType.setName("testParamtype");
-        outputParameters.add(outputParameter);
-
-        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-
-        registry.addApplicationDescriptor(serviceDescription, hostDescription, applicationDescription);
-
-        ApplicationDescription applicationDescriptor = registry.getApplicationDescriptor("testServiceDesc", "testHost", "testApplication");
-        applicationDescriptor.getType().setExecutableLocation("/bin/echo1");
-
-        registry.udpateApplicationDescriptor(serviceDescription, hostDescription, applicationDescriptor);
-
-        ApplicationDescription descriptor = registry.getApplicationDescriptor("testServiceDesc", "testHost", "testApplication");
-        String executableLocation = descriptor.getType().getExecutableLocation();
-
-        assertTrue("application descriptor updated successfully", executableLocation.equals("/bin/echo1"));
-        registry.removeApplicationDescriptor("testServiceDesc", "testHost", "testApplication");
-
-    }
-
-    public void testUpdateApplicationDescriptor() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        registry.addApplicationDescriptor("testService", "testHost", applicationDescription);
-        ApplicationDescription applicationDescriptor = registry.getApplicationDescriptor("testService", "testHost", "testApplication");
-        applicationDescriptor.getType().setExecutableLocation("/bin/echo1");
-        registry.updateApplicationDescriptor("testService", "testHost", applicationDescriptor);
-
-        ApplicationDescription descriptor = registry.getApplicationDescriptor("testService", "testHost", "testApplication");
-        String executableLocation = descriptor.getType().getExecutableLocation();
-
-        assertTrue("application descriptor updated successfully", executableLocation.equals("/bin/echo1"));
-        registry.removeApplicationDescriptor("testService", "testHost", "testApplication");
-
-    }
-
-
-    public void testGetApplicationDescriptor() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        registry.addApplicationDescriptor("testService", "testHost", applicationDescription);
-        ApplicationDescription applicationDescriptor = registry.getApplicationDescriptor("testService", "testHost", "testApplication");
-        applicationDescriptor.getType().setExecutableLocation("/bin/echo1");
-        registry.updateApplicationDescriptor("testService", "testHost", applicationDescriptor);
-
-        ApplicationDescription descriptor = registry.getApplicationDescriptor("testService", "testHost", "testApplication");
-        assertNotNull("application descriptor retrieved successfully", descriptor);
-        registry.removeApplicationDescriptor("testService", "testHost", "testApplication");
-    }
-
-
-    public void testGetApplicationDescriptorsForServiceAndHost() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        registry.addApplicationDescriptor("testService", "testHost", applicationDescription);
-
-        ApplicationDescription description = registry.getApplicationDescriptors("testService", "testHost");
-        assertNotNull("application descriptor retrieved successfully", description);
-        registry.removeApplicationDescriptor("testService", "testHost", "testApplication");
-    }
-
-    public void testGetApplicationDescriptorsForService() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        registry.addApplicationDescriptor("testService", "testHost1", applicationDescription);
-        registry.addApplicationDescriptor("testService", "testHost2", applicationDescription);
-
-        Map<String,ApplicationDescription> applicationDescriptors = registry.getApplicationDescriptors("testService");
-        assertTrue("application retrieved successfully", applicationDescriptors.size()==2);
-
-        registry.removeApplicationDescriptor("testService", "testHost1", "testApplication");
-        registry.removeApplicationDescriptor("testService", "testHost2", "testApplication");
-    }
-
-
-    public void testGetApplicationDescriptors() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        registry.addApplicationDescriptor("testService", "testHost1", applicationDescription);
-        registry.addApplicationDescriptor("testService", "testHost2", applicationDescription);
-
-        Map<String[], ApplicationDescription> applicationDescriptors = registry.getApplicationDescriptors();
-        assertTrue("application retrieved successfully", applicationDescriptors.size()==2);
-
-        registry.removeApplicationDescriptor("testService", "testHost1", "testApplication");
-        registry.removeApplicationDescriptor("testService", "testHost2", "testApplication");
-
-    }
-
-
-    public void testRemoveApplicationDescriptor() throws Exception {
-        ApplicationDescription applicationDescription = new ApplicationDescription(ApplicationDeploymentDescriptionType.type);
-        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDescription.getType().addNewApplicationName();
-        applicationName.setStringValue("testApplication");
-        applicationDescription.getType().setApplicationName(applicationName);
-        applicationDescription.getType().setInputDataDirectory("/bin");
-        applicationDescription.getType().setExecutableLocation("/bin/echo");
-        applicationDescription.getType().setOutputDataDirectory("/tmp");
-
-        registry.addApplicationDescriptor("testService", "testHost", applicationDescription);
-        registry.removeApplicationDescriptor("testService", "testHost", "testApplication");
-
-        assertFalse("application descriptor removed successfully", registry.isApplicationDescriptorExists("testService", "testHost", "testApplication"));
-    }
-
-    public void testIsWorkspaceProjectExists() throws Exception {
-        WorkspaceProject workspaceProject = new WorkspaceProject("testProject", registry);
-        registry.addWorkspaceProject(workspaceProject);
-
-        assertTrue("workspace project exists", registry.isWorkspaceProjectExists("testProject"));
-        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-    public void testAddWorkspaceProject() throws Exception {
-        WorkspaceProject workspaceProject = new WorkspaceProject("testProject", registry);
-        registry.addWorkspaceProject(workspaceProject);
-
-        assertTrue("workspace project added successfully", registry.isWorkspaceProjectExists("testProject"));
-        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-//    public void testUpdateWorkspaceProject() throws Exception {
-//        WorkspaceProject workspaceProject = new WorkspaceProject("testProject", registry);
-//        registry.addWorkspaceProject(workspaceProject);
-//        WorkspaceProject testProject = registry.getWorkspaceProject("testProject");
-//        testProject.setProjectName("testProject2");
-//
-//        registry.updateWorkspaceProject(testProject);
-//
-//        assertTrue("workspace project updated", registry.isWorkspaceProjectExists("testProject2"));
-//        registry.deleteWorkspaceProject("testProject2");
-//    }
-
-
-    public void testDeleteWorkspaceProject() throws Exception {
-        WorkspaceProject workspaceProject = new WorkspaceProject("testProject", registry);
-        registry.addWorkspaceProject(workspaceProject);
-
-        registry.deleteWorkspaceProject("testProject");
-        assertFalse("workspace project deleted successfully", registry.isWorkspaceProjectExists("testProject"));
-    }
-
-
-    public void testGetWorkspaceProject() throws Exception {
-        WorkspaceProject workspaceProject = new WorkspaceProject("testProject", registry);
-        registry.addWorkspaceProject(workspaceProject);
-        WorkspaceProject testProject = registry.getWorkspaceProject("testProject");
-        assertNotNull("workspace project retrieved successfully", testProject);
-        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-    public void testGetWorkspaceProjects() throws Exception {
-        WorkspaceProject workspaceProject1 = new WorkspaceProject("testProject1", registry);
-        registry.addWorkspaceProject(workspaceProject1);
-        WorkspaceProject workspaceProject2 = new WorkspaceProject("testProject2", registry);
-        registry.addWorkspaceProject(workspaceProject2);
-
-        List<WorkspaceProject> workspaceProjects = registry.getWorkspaceProjects();
-        assertTrue("workspace projects retrieved successfully", workspaceProjects.size() == 3);
-
-        registry.deleteWorkspaceProject("testProject1");
-        registry.deleteWorkspaceProject("testProject2");
-    }
-
-
-    public void testAddExperiment() throws Exception {
-        WorkspaceProject workspaceProject = null;
-        if(!registry.isWorkspaceProjectExists("testProject"))  {
-            workspaceProject =  new WorkspaceProject("testProject", registry);
-            registry.addWorkspaceProject(workspaceProject);
-        }
-        AiravataExperiment experiment = new AiravataExperiment();
-        experiment.setExperimentId("testExperiment");
-        registry.addExperiment("testProject", experiment);
-
-        ExperimentData testExperiment = registry.getExperiment("testExperiment");
-        String user = testExperiment.getUser();
-
-        assertTrue("experiment saved successfully", registry.isExperimentExists("testExperiment"));
-        registry.removeExperiment("testExperiment");
-        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-    public void testRemoveExperiment() throws Exception {
-        WorkspaceProject workspaceProject = null;
-        if(!registry.isWorkspaceProjectExists("testProject"))  {
-            workspaceProject =  new WorkspaceProject("testProject", registry);
-            registry.addWorkspaceProject(workspaceProject);
-        }
-        AiravataExperiment experiment = new AiravataExperiment();
-        experiment.setExperimentId("testExperiment");
-        registry.addExperiment("testProject", experiment);
-
-        registry.removeExperiment("testExperiment");
-        assertFalse("experiment removed successfully", registry.isExperimentExists("testExperiment"));
-
-        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-//    public void testGetExperiments() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment1 = new AiravataExperiment();
-//        experiment1.setExperimentId("testExperiment1");
-//        Calendar calender = Calendar.getInstance();
-//        java.util.Date d = calender.getTime();
-//        Date currentTime = new Date(d.getTime());
-//        experiment1.setSubmittedDate(currentTime);
-//        registry.addExperiment("testProject", experiment1);
-//
-//        AiravataExperiment experiment2 = new AiravataExperiment();
-//        experiment2.setExperimentId("testExperiment2");
-//        experiment2.setSubmittedDate(currentTime);
-//        registry.addExperiment("testProject", experiment2);
-//
-//        List<AiravataExperiment> experiments = registry.getExperiments();
-//
-//        assertTrue("experiments retrieved successfully", experiments.size() == 2);
-//        registry.removeExperiment("testExperiment1");
-//        registry.removeExperiment("testExperiment2");
-//        registry.deleteWorkspaceProject("testProject");
-//    }
-
-
-//    public void testGetExperimentsForProject() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment1 = new AiravataExperiment();
-//        experiment1.setExperimentId("testExperiment1");
-//        experiment1.setProject(workspaceProject);
-//        Calendar calender = Calendar.getInstance();
-//        java.util.Date d = calender.getTime();
-//        Date currentTime = new Date(d.getTime());
-//        experiment1.setSubmittedDate(currentTime);
-//        registry.addExperiment("testProject", experiment1);
-//
-//        AiravataExperiment experiment2 = new AiravataExperiment();
-//        experiment2.setExperimentId("testExperiment2");
-//        experiment2.setSubmittedDate(currentTime);
-//        experiment2.setProject(workspaceProject);
-//        registry.addExperiment("testProject", experiment2);
-//
-//        List<AiravataExperiment> experiments = registry.getExperiments("testProject");
-//
-//        assertTrue("experiments retrieved successfully", experiments.size() == 2);
-//        registry.removeExperiment("testExperiment1");
-//        registry.removeExperiment("testExperiment2");
-//        registry.deleteWorkspaceProject("testProject");
-//    }
-
-
-//    public void testGetExperimentsDuringPeriod() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment1 = new AiravataExperiment();
-//        experiment1.setExperimentId("testExperiment1");
-//        Calendar calender = Calendar.getInstance();
-//        calender.set(Calendar.YEAR, 2012);
-//        calender.set(Calendar.MONTH, Calendar.JANUARY);
-//        calender.set(Calendar.DATE, 2);
-//        java.util.Date d = calender.getTime();
-//        Date currentTime = new Date(d.getTime());
-//        experiment1.setSubmittedDate(currentTime);
-//        experiment1.setProject(workspaceProject);
-//        registry.addExperiment("testProject", experiment1);
-//
-//        AiravataExperiment experiment2 = new AiravataExperiment();
-//        experiment2.setExperimentId("testExperiment2");
-//        Calendar c = Calendar.getInstance();
-//        java.util.Date date = c.getTime();
-//        Date experiment2Time = new Date(date.getTime());
-//        experiment2.setSubmittedDate(experiment2Time);
-//        experiment2.setProject(workspaceProject);
-//        registry.addExperiment("testProject", experiment2);
-//
-//        Calendar a = Calendar.getInstance();
-//        a.set(Calendar.YEAR, 2012);
-//        a.set(Calendar.MONTH, Calendar.JANUARY);
-//        a.set(Calendar.DATE, 1);
-//        java.util.Date da = a.getTime();
-//        Date ct = new Date(da.getTime());
-//
-//        Calendar aa = Calendar.getInstance();
-//        aa.set(Calendar.YEAR, 2012);
-//        aa.set(Calendar.MONTH, Calendar.DECEMBER);
-//        aa.set(Calendar.DATE, 1);
-//        java.util.Date dda = aa.getTime();
-//
-//        List<AiravataExperiment> experiments = registry.getExperiments(ct, dda);
-//
-//        assertTrue("experiments retrieved successfully", experiments.size() != 0);
-//        registry.removeExperiment("testExperiment1");
-//        registry.removeExperiment("testExperiment2");
-//        registry.deleteWorkspaceProject("testProject");
-//
-//    }
-
-
-//    public void testGetExperimentsPerProjectDuringPeriod() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment1 = new AiravataExperiment();
-//        experiment1.setExperimentId("testExperiment1");
-//        Calendar calender = Calendar.getInstance();
-//        calender.set(Calendar.YEAR, 2012);
-//        calender.set(Calendar.MONTH, Calendar.JANUARY);
-//        calender.set(Calendar.DATE, 2);
-//        java.util.Date d = calender.getTime();
-//        Date currentTime = new Date(d.getTime());
-//        experiment1.setSubmittedDate(currentTime);
-//        registry.addExperiment("testProject", experiment1);
-//
-//        AiravataExperiment experiment2 = new AiravataExperiment();
-//        experiment2.setExperimentId("testExperiment2");
-//        Calendar c = Calendar.getInstance();
-//        java.util.Date date = c.getTime();
-//        Date experiment2Time = new Date(date.getTime());
-//        experiment2.setSubmittedDate(experiment2Time);
-//        registry.addExperiment("testProject", experiment2);
-//
-//        Calendar a = Calendar.getInstance();
-//        a.set(Calendar.YEAR, 2012);
-//        a.set(Calendar.MONTH, Calendar.JANUARY);
-//        a.set(Calendar.DATE, 1);
-//        java.util.Date da = a.getTime();
-//        Date ct = new Date(da.getTime());
-//
-//        Calendar aa = Calendar.getInstance();
-//        aa.set(Calendar.YEAR, 2012);
-//        aa.set(Calendar.MONTH, Calendar.DECEMBER);
-//        aa.set(Calendar.DATE, 1);
-//        java.util.Date dda = aa.getTime();
-//
-//        List<AiravataExperiment> experiments = registry.getExperiments("testProject", ct, dda);
-//
-//        assertTrue("experiments retrieved successfully", experiments.size() == 2);
-//        registry.removeExperiment("testExperiment1");
-//        registry.removeExperiment("testExperiment2");
-//        registry.deleteWorkspaceProject("testProject");
-//
-//    }
-
-
-    public void testIsExperimentExists() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExperiment");
-//        registry.addExperiment("testProject", experiment);
-//
-//        assertTrue("experiment exists", registry.isExperimentExists("testExperiment"));
-//        registry.removeExperiment("testExperiment");
-//        registry.deleteWorkspaceProject("testProject");
-    }
-
-    public void testUpdateExperimentExecutionUser() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExperiment");
-//        registry.addExperiment("testProject", experiment);
-//        registry.updateExperimentExecutionUser("testExperiment", "testUser");
-//        ExperimentData testExperiment = registry.getExperiment("testExperiment");
-//        assertTrue("execution user updated successfully", testExperiment.getUser().equals("testUser"));
-//        registry.removeExperiment("testExperiment");
-//        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-    public void testGetExperimentExecutionUser() throws Exception {
-//        Calendar c = Calendar.getInstance();
-//        java.util.Date date = c.getTime();
-//        Date currentTime = new Date(date.getTime());
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        experiment.setSubmittedDate(currentTime);
-//        registry.addExperiment("testProject", experiment);
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//
-//        ExperimentData testExperiment = registry.getExperiment("testExp");
-//        assertTrue("execution user retrieved successfully", testExperiment.getUser().equals("admin"));
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-    public void testGetExperimentName() throws Exception {
-//        Calendar c = Calendar.getInstance();
-//        java.util.Date date = c.getTime();
-//        Date currentTime = new Date(date.getTime());
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        experiment.setSubmittedDate(currentTime);
-//        registry.addExperiment("testProject", experiment);
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testExperiment");
-//
-//        ExperimentData testExperiment = registry.getExperiment("testExp");
-//        assertTrue("experiment name retrieved successfully", testExperiment.getExperimentName().equals("testExperiment"));
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-    public void testUpdateExperimentName() throws Exception {
-//        Calendar c = Calendar.getInstance();
-//        java.util.Date date = c.getTime();
-//        Date currentTime = new Date(date.getTime());
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        experiment.setSubmittedDate(currentTime);
-//        registry.addExperiment("testProject", experiment);
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testExperiment");
-//
-//        ExperimentData testExperiment = registry.getExperiment("testExp");
-//        assertTrue("experiment name updated successfully", testExperiment.getExperimentName().equals("testExperiment"));
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-//    public void testGetExperimentMetadata() throws Exception {
-//        Calendar c = Calendar.getInstance();
-//        java.util.Date date = c.getTime();
-//        Date currentTime = new Date(date.getTime());
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        experiment.setSubmittedDate(currentTime);
-//        registry.addExperiment("testProject", experiment);
-//        registry.updateExperimentMetadata("testExp", "testMetadata");
-//
-//        assertTrue("experiment metadata retrieved successfully", registry.getExperimentMetadata("testExp").equals("testMetadata"));
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-//    }
-
-
-//    public void testUpdateExperimentMetadata() throws Exception {
-//        Calendar c = Calendar.getInstance();
-//        java.util.Date date = c.getTime();
-//        Date currentTime = new Date(date.getTime());
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        experiment.setSubmittedDate(currentTime);
-//        registry.addExperiment("testProject", experiment);
-//        registry.updateExperimentMetadata("testExp", "testMetadata");
-//
-//        assertTrue("experiment metadata updated successfully", registry.getExperimentMetadata("testExp").equals("testMetadata"));
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-//    }
-
-
-    public void testGetWorkflowExecutionTemplateName() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        ExperimentData experimentData = registry.getExperiment("testExp");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow1", "template1");
-//
-//        String testWorkflow = registry.getWorkflowExecutionTemplateName("testWorkflow1");
-//        assertTrue("workflow execution template name retrieved successfully", testWorkflow.equals("template1"));
-//
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-
-    }
-
-
-    public void testSetWorkflowInstanceTemplateName() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        ExperimentData experimentData = registry.getExperiment("testExp");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow2", "template1");
-//        registry.setWorkflowInstanceTemplateName("testWorkflow2", "template2");
-//
-//        String testWorkflow = registry.getWorkflowExecutionTemplateName("testWorkflow2");
-//        assertTrue("workflow execution template name retrieved successfully", testWorkflow.equals("template2"));
-//
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-    public void testGetExperimentWorkflowInstances() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow3", "template1");
-//        List<WorkflowExecution> workflowInstances = registry.getExperimentWorkflowInstances("testExp");
-//
-//        assertTrue("workflow instances retrieved successfully", workflowInstances.size() != 0);
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-    public void testIsWorkflowInstanceExists() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow4", "template1");
-//
-//        assertTrue("workflow instance exists", registry.isWorkflowInstanceExists("testWorkflow4"));
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-    }
-
-    public void testUpdateWorkflowInstanceStatus() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject"))  {
-//            workspaceProject =  new WorkspaceProject("testProject", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow5", "template1");
-//        registry.updateWorkflowInstanceStatus("testWorkflow5", WorkflowExecutionStatus.State.STARTED);
-//
-//        assertTrue("workflow instance status updated successfully", registry.getWorkflowInstanceStatus("testWorkflow5").getExecutionStatus().equals(WorkflowExecutionStatus.State.STARTED));
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-    }
-
-
-    public void testGetWorkflowInstanceStatus() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject1"))  {
-//            workspaceProject =  new WorkspaceProject("testProject1", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject1", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow6", "template1");
-//        Calendar c = Calendar.getInstance();
-//        java.util.Date date = c.getTime();
-//        Date currentTime = new Date(date.getTime());
-//
-//        registry.updateWorkflowInstanceStatus(new WorkflowExecutionStatus(new WorkflowExecution("testExp", "testWorkflow6"), WorkflowExecutionStatus.State.STARTED,currentTime));
-//        assertTrue("workflow instance status updated successfully", registry.getWorkflowInstanceStatus("testWorkflow6").getExecutionStatus().equals(WorkflowExecutionStatus.State.STARTED));
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject1");
-
-    }
-
-    public void testUpdateWorkflowNodeInput() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject1"))  {
-//            workspaceProject =  new WorkspaceProject("testProject1", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject1", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow7", "template1");
-//
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(new WorkflowExecution("testExp", "testWorkflow7"), "testNode");
-//        WorkflowNodeType nodeType = new WorkflowNodeType(WorkflowNodeType.WorkflowNode.INPUTNODE);
-//        registry.updateWorkflowNodeType(workflowInstanceNode, nodeType);
-//        registry.updateWorkflowNodeInput(workflowInstanceNode, "testParameter=testData");
-//
-//        NodeExecutionData nodeData = registry.getWorkflowInstanceNodeData("testWorkflow7", "testNode");
-//        assertTrue("workflow instance node input saved successfully", nodeData.getInput().equals("testParameter=testData"));
-//
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject1");
-
-    }
-
-
-    public void testUpdateWorkflowNodeOutput() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject1"))  {
-//            workspaceProject =  new WorkspaceProject("testProject1", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject1", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow8", "template1");
-//
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(new WorkflowExecution("testExp", "testWorkflow8"), "testNode");
-//        registry.updateWorkflowNodeOutput(workflowInstanceNode, "testData");
-//
-//        NodeExecutionData nodeData = registry.getWorkflowInstanceNodeData("testWorkflow8", "testNode");
-//        assertTrue("workflow instance node output saved successfully", nodeData.getOutput().equals("testData"));
-//
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject1");
-
-    }
-
-//    public void testGetExperiment() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject1"))  {
-//            workspaceProject =  new WorkspaceProject("testProject1", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject1", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow9", "template1");
-//        ExperimentData testExp = registry.getExperiment("testExp");
-//
-//        assertNotNull("experiment data retrieved successfully", testExp);
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject1");
-//    }
-//
-//
-//    public void testGetExperimentMetaInformation() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject1"))  {
-//            workspaceProject =  new WorkspaceProject("testProject1", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject1", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow10", "template1");
-//        ExperimentData testExp = registry.getExperimentMetaInformation("testExp");
-//
-//        assertNotNull("experiment data retrieved successfully", testExp);
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject1");
-//    }
-//
-//
-//    public void testGetAllExperimentMetaInformation() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject1"))  {
-//            workspaceProject =  new WorkspaceProject("testProject1", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject1", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow11", "template1");
-//        ExperimentData testExp = registry.getExperimentMetaInformation("testExp");
-//
-//        assertNotNull("experiment data retrieved successfully", testExp);
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject1");
-//    }
-//
-//
-//    public void testGetExperimentIdByUser() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject1"))  {
-//            workspaceProject =  new WorkspaceProject("testProject1", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment1 = new AiravataExperiment();
-//        experiment1.setExperimentId("testExp1");
-//        registry.addExperiment("testProject1", experiment1);
-//
-//        AiravataExperiment experiment2 = new AiravataExperiment();
-//        experiment2.setExperimentId("testExp2");
-//        registry.addExperiment("testProject1", experiment2);
-//
-//        registry.updateExperimentExecutionUser("testExp1", "admin");
-//        registry.updateExperimentExecutionUser("testExp2", "admin");
-//        registry.updateExperimentName("testExp1", "testexperiment1");
-//        registry.updateExperimentName("testExp2", "testexperiment2");
-//
-//        registry.addWorkflowInstance("testExp1", "testWorkflow12", "template1");
-//        registry.addWorkflowInstance("testExp2", "testWorkflow13", "template2");
-//        List<String> experimentIdByUser = registry.getExperimentIdByUser("admin");
-//
-//        assertNotNull("experiment ID s for user retrieved successfully", experimentIdByUser.size() != 0);
-//        registry.removeExperiment("testExp1");
-//        registry.removeExperiment("testExp2");
-//        registry.deleteWorkspaceProject("testProject1");
-//    }
-//
-//
-//    public void testGetExperimentByUser() throws Exception {
-//        WorkspaceProject workspaceProject = null;
-//        if(!registry.isWorkspaceProjectExists("testProject1"))  {
-//            workspaceProject =  new WorkspaceProject("testProject1", registry);
-//            registry.addWorkspaceProject(workspaceProject);
-//        }
-//        AiravataExperiment experiment1 = new AiravataExperiment();
-//        experiment1.setExperimentId("testExp1");
-//        registry.addExperiment("testProject1", experiment1);
-//
-//        AiravataExperiment experiment2 = new AiravataExperiment();
-//        experiment2.setExperimentId("testExp2");
-//        registry.addExperiment("testProject1", experiment2);
-//
-//        registry.updateExperimentExecutionUser("testExp1", "admin");
-//        registry.updateExperimentExecutionUser("testExp2", "admin");
-//        registry.updateExperimentName("testExp1", "testexperiment1");
-//        registry.updateExperimentName("testExp2", "testexperiment2");
-//
-//        registry.addWorkflowInstance("testExp1", "testWorkflow14", "template1");
-//        registry.addWorkflowInstance("testExp2", "testWorkflow15", "template2");
-//        List<ExperimentData> experimentDataList = registry.getExperimentByUser("admin");
-//
-//        assertNotNull("experiment ID s for user retrieved successfully", experimentDataList.size() != 0);
-//        registry.removeExperiment("testExp1");
-//        registry.removeExperiment("testExp2");
-//        registry.deleteWorkspaceProject("testProject1");
-//    }
-//
-//
-////    public void testUpdateWorkflowNodeStatus() throws Exception {
-////        WorkspaceProject workspaceProject1 = new WorkspaceProject("testProject", registry);
-////        registry.addWorkspaceProject(workspaceProject1);
-////        AiravataExperiment experiment = new AiravataExperiment();
-////        experiment.setExperimentId("testExp");
-////        registry.addExperiment("testProject", experiment);
-////
-////        registry.updateExperimentExecutionUser("testExp", "admin");
-////        registry.updateExperimentName("testExp", "testexperiment");
-////
-////        registry.addWorkflowInstance("testExp", "testWorkflow", "template1");
-////
-////
-////
-////        WorkflowNodeType workflowNodeType = new WorkflowNodeType();
-////        workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
-////
-////        WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowInstance("testExp", "testWorkflow"), "testNode");
-////        registry.addWorkflowInstanceNode("testWorkflow", "testNode");
-////
-////        WorkflowInstanceData workflowInstanceData = registry.getWorkflowInstanceData("testWorkflow");
-////        WorkflowInstanceNodeData workflowInstanceNodeData = registry.getWorkflowInstanceNodeData("testWorkflow", "testNode");
-////
-////        Calendar c = Calendar.getInstance();
-////        java.util.Date date = c.getTime();
-////        Date currentTime = new Date(date.getTime());
-////
-////        workflowInstanceNodeData.setStatus(WorkflowInstanceStatus.ExecutionStatus.FINISHED, currentTime);
-////        workflowInstanceData.addNodeData(workflowInstanceNodeData);
-////
-////        registry.updateWorkflowNodeOutput(node, "testData");
-////        registry.updateWorkflowNodeType(node,workflowNodeType);
-////
-////        registry.updateWorkflowNodeStatus("testWorkflow", "testNode", WorkflowInstanceStatus.ExecutionStatus.FINISHED);
-////
-////        WorkflowInstanceNodeStatus workflowNodeStatus = registry.getWorkflowNodeStatus(node);
-////
-////        assertTrue("workflow instance node status updated successfully", workflowNodeStatus.getExecutionStatus().equals(WorkflowInstanceStatus.ExecutionStatus.FINISHED));
-////
-////        registry.removeExperiment("testExp");
-////        registry.deleteWorkspaceProject("testProject");
-////
-////    }
-//
-//    /*
-//    public void testGetWorkflowNodeStatus() throws Exception {
-//        WorkspaceProject workspaceProject1 = new WorkspaceProject("testProject", registry);
-//        registry.addWorkspaceProject(workspaceProject1);
-//        AiravataExperiment experiment = new AiravataExperiment();
-//        experiment.setExperimentId("testExp");
-//        registry.addExperiment("testProject", experiment);
-//
-//        registry.updateExperimentExecutionUser("testExp", "admin");
-//        registry.updateExperimentName("testExp", "testexperiment");
-//
-//        registry.addWorkflowInstance("testExp", "testWorkflow", "template1");
-//
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(new WorkflowInstance("testExp", "testWorkflow"), "testNode");
-//        registry.updateWorkflowNodeOutput(workflowInstanceNode, "testData");
-//
-//        WorkflowInstanceNodeData nodeData = registry.getWorkflowInstanceNodeData("testWorkflow", "testNode");
-//
-//
-//        assertTrue("workflow instance node output saved successfully", nodeData.getOutput().equals("testData"));
-//
-//        registry.removeExperiment("testExp");
-//        registry.deleteWorkspaceProject("testProject");
-//
-//    }
-//
-//
-//    public void testGetWorkflowNodeStartTime() throws Exception {
-////        WorkspaceProject workspaceProject1 = new WorkspaceProject("testProject", registry);
-////        registry.addWorkspaceProject(workspaceProject1);
-////        AiravataExperiment experiment = new AiravataExperiment();
-////        experiment.setExperimentId("testExp");
-////        registry.addExperiment("testProject", experiment);
-////
-////        registry.updateExperimentExecutionUser("testExp", "admin");
-////        registry.updateExperimentName("testExp", "testexperiment");
-////
-////        registry.addWorkflowInstance("testExp", "testWorkflow", "template1");
-////
-////        WorkflowNodeType workflowNodeType = new WorkflowNodeType();
-////        workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
-////
-////        WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowInstance("testExp", "testWorkflow"), "testNode");
-////        registry.addWorkflowInstanceNode("testWorkflow", "testNode");
-////
-////        WorkflowInstanceData workflowInstanceData = registry.getWorkflowInstanceData("testWorkflow");
-////        WorkflowInstanceNodeData workflowInstanceNodeData = registry.getWorkflowInstanceNodeData("testWorkflow", "testNode");
-////
-////        Calendar c = Calendar.getInstance();
-////        java.util.Date date = c.getTime();
-////        Date currentTime = new Date(date.getTime());
-////
-////        workflowInstanceNodeData.setStatus(WorkflowInstanceStatus.ExecutionStatus.FINISHED, currentTime);
-////        workflowInstanceData.addNodeData(workflowInstanceNodeData);
-////
-////        registry.updateWorkflowNodeOutput(node, "testData");
-////        registry.updateWorkflowNodeType(node,workflowNodeType);
-////
-////        registry.updateWorkflowNodeStatus("testWorkflow", "testNode", WorkflowInstanceStatus.ExecutionStatus.FINISHED);
-////
-////        WorkflowInstanceNodeStatus workflowNodeStatus = registry.getWorkflowNodeStatus(node);
-////
-////        assertTrue("workflow instance node status updated successfully", workflowNodeStatus.getExecutionStatus().equals(WorkflowInstanceStatus.ExecutionStatus.FINISHED));
-////
-////        registry.removeExperiment("testExp");
-////        registry.deleteWorkspaceProject("testProject");
-//    }
-//
-//
-//    public void testGetWorkflowStartTime() throws Exception {
-//    }
-//
-//
-//    public void testUpdateWorkflowNodeGramData() throws Exception {
-//    }
-//
-//
-//    public void testGetWorkflowInstanceData() throws Exception {
-//    }
-//
-//
-//    public void testIsWorkflowInstanceNodePresent() throws Exception {
-//    }
-//
-//    public void testGetWorkflowInstanceNodeData() throws Exception {
-//    }
-//
-//
-//    public void testAddWorkflowInstance() throws Exception {
-//    }
-//
-//
-//    public void testUpdateWorkflowNodeType() throws Exception {
-//    }
-//
-//
-//    public void testAddWorkflowInstanceNode() throws Exception {
-//    }   */
-//
-//
-//
-//    public void testIsPublishedWorkflowExists() throws Exception {
-//        registry.addWorkflow("workflow1", "testContent");
-//        registry.publishWorkflow("workflow1");
-//
-//        assertTrue("published workflow exists", registry.isPublishedWorkflowExists("workflow1"));
-//
-//        registry.removePublishedWorkflow("workflow1");
-//        registry.removeWorkflow("workflow1");
-//    }
-//
-//
-//    public void testPublishWorkflow() throws Exception {
-//        registry.addWorkflow("workflow1", "testContent");
-//        registry.publishWorkflow("workflow1");
-//
-//        assertTrue("workflow is published", registry.isPublishedWorkflowExists("workflow1"));
-//
-//        registry.removePublishedWorkflow("workflow1");
-//        registry.removeWorkflow("workflow1");
-//    }
-//
-//
-//    public void testPublishWorkflowWithGivenName() throws Exception {
-//        registry.addWorkflow("workflow1", "testContent");
-//        registry.publishWorkflow("workflow1", "publishedWorkflow1");
-//
-//        assertTrue("workflow published with given name", registry.isPublishedWorkflowExists("publishedWorkflow1"));
-//
-//        registry.removePublishedWorkflow("publishedWorkflow1");
-//        registry.removeWorkflow("workflow1");
-//    }
-//
-//
-//    public void testGetPublishedWorkflowGraphXML() throws Exception {
-//        registry.addWorkflow("workflow1", "testContent");
-//        registry.publishWorkflow("workflow1");
-//
-//        

<TRUNCATED>

[28/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/assembly/bin-assembly.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/assembly/bin-assembly.xml b/modules/ws-messenger/distribution/src/main/assembly/bin-assembly.xml
deleted file mode 100644
index cc35c39..0000000
--- a/modules/ws-messenger/distribution/src/main/assembly/bin-assembly.xml
+++ /dev/null
@@ -1,190 +0,0 @@
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<!DOCTYPE assembly [
-        <!ELEMENT assembly (id|includeBaseDirectory|baseDirectory|formats|fileSets|dependencySets)*>
-        <!ELEMENT id (#PCDATA)>
-        <!ELEMENT includeBaseDirectory (#PCDATA)>
-        <!ELEMENT baseDirectory (#PCDATA)>
-        <!ELEMENT formats (format)*>
-        <!ELEMENT format (#PCDATA)>
-        <!ELEMENT fileSets (fileSet)*>
-        <!ELEMENT fileSet (directory|outputDirectory|includes)*>
-        <!ELEMENT directory (#PCDATA)>
-        <!ELEMENT outputDirectory (#PCDATA)>
-        <!ELEMENT includes (include)*>
-        <!ELEMENT include (#PCDATA)>
-        <!ELEMENT dependencySets (dependencySet)*>
-        <!ELEMENT dependencySet (outputDirectory|includes)*>
-        ]>
-<assembly>
-    <id>bin</id>
-    <includeBaseDirectory>true</includeBaseDirectory>
-    <baseDirectory>${archieve.name}-${version}</baseDirectory>
-    <formats>
-        <!--<format>tar.gz</format> //uncomment,if tar.gz archive needed -->
-        <format>zip</format>
-    </formats>
-
-
-    <fileSets>
-        <!-- ********************** copy axis2 distribution from messenger folder ********************** -->
-
-        <fileSet>
-            <directory>target/axis2-${used.axis2.release}/WEB-INF/lib</directory>
-            <outputDirectory>standalone-server/lib</outputDirectory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-
-        <fileSet>
-            <directory>target/axis2-${used.axis2.release}/WEB-INF/</directory>
-            <outputDirectory>standalone-server/repository</outputDirectory>
-            <includes>
-                <include>services/*</include>
-                <include>modules/*</include>
-            </includes>
-        </fileSet>
-
-        <fileSet>
-            <directory>target/axis2-${used.axis2.release}/WEB-INF/classes</directory>
-            <outputDirectory>standalone-server/conf</outputDirectory>
-            <includes>
-                <include>log4j.properties</include>
-                <include>commons-logging.properties</include>
-            </includes>
-        </fileSet>
-
-        <fileSet>
-            <directory>target/axis2-${used.axis2.release}/WEB-INF/conf</directory>
-            <outputDirectory>standalone-server/conf</outputDirectory>
-            <includes>
-                <include>axis2.xml</include>
-            </includes>
-        </fileSet>
-
-        <!-- ********************** copy wsmg.broker and messagebox property files ********************** -->
-
-        <fileSet>
-            <directory>resources</directory>
-            <outputDirectory>standalone-server/conf</outputDirectory>
-            <includes>
-                <include>*properties*</include>
-            </includes>
-        </fileSet>
-
-
-        <!-- ********************** replace bin directory ********************** -->
-
-        <fileSet>
-            <directory>resources/bin</directory>
-            <outputDirectory>standalone-server/bin</outputDirectory>
-            <includes>
-                <include>**/*</include>
-            </includes>
-        </fileSet>
-
-        <!-- ********************** copy messenger commons ********************** -->
-
-
-
-        <fileSet>
-            <directory>../../ws-messenger/client/target/</directory>
-            <outputDirectory>standalone-server/lib</outputDirectory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-        <fileSet>
-            <directory>../../ws-messenger/commons/target/</directory>
-            <outputDirectory>standalone-server/lib</outputDirectory>
-            <includes>
-                <include>*.jar</include>
-            </includes>
-        </fileSet>
-
-
-
-        <!-- ********************** copymessagebrokerjar ********************** -->
-
-
-        <!-- ********************** copy messagebroker+ messagebox samples ********************** -->
-
-        <fileSet>
-            <directory>../samples</directory>
-            <outputDirectory>samples</outputDirectory>
-            <includes>
-                <include>**/*</include>
-            </includes>
-        </fileSet>
-
-
-        <!-- ********************** copy gui start up script ********************** -->
-
-        <fileSet>
-            <directory>resources</directory>
-            <outputDirectory>gui</outputDirectory>
-            <includes>
-                <include>*sh</include>
-            </includes>
-        </fileSet>
-
-
-        <fileSet>
-            <directory>../</directory>
-            <includes>
-                <include>LICENSE*</include>
-                <include>NOTICE*</include>
-            </includes>
-        </fileSet>
-
-
-        <!-- ********************** copy database scripts ********************** -->
-
-        <fileSet>
-            <directory>../messagebroker/src/main/resources/database_scripts</directory>
-            <outputDirectory>standalone-server/conf/database_scripts</outputDirectory>
-            <includes>
-                <include>*sql*</include>
-            </includes>
-        </fileSet>
-
-        <fileSet>
-            <directory>../messagebox/src/main/resources/database_scripts</directory>
-            <outputDirectory>standalone-server/conf/database_scripts</outputDirectory>
-            <includes>
-                <include>*sql*</include>
-            </includes>
-        </fileSet>
-
-    </fileSets>
-    <dependencySets>
-
-        <dependencySet>
-            <outputDirectory>standalone-server/lib</outputDirectory>
-            <includes>
-                <include>org.slf4j:slf4j-api:jar</include>
-                <include>org.apache.derby:derby:jar</include>
-                <include>org.apache.derby:derbytools:jar</include>
-                <include>org.apache.airavata:messenger-client:jar</include>
-                <include>org.apache.airavata:messenger-commons:jar</include>
-                <include>org.ogce:yfilter:jar</include>
-                <include>wsdl4j:wsdl4j:jar</include>
-            </includes>
-        </dependencySet>
-        <dependencySet>
-            <outputDirectory>standalone-server/repository/services</outputDirectory>
-            <includes>
-                <include>org.apache.airavata:messagebox:jar</include>
-                <include>org.apache.airavata:messagebroker:jar</include>
-            </includes>
-        </dependencySet>
-    </dependencySets>
-
-</assembly>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/axis2.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/axis2.xml b/modules/ws-messenger/distribution/src/main/resources/axis2.xml
deleted file mode 100755
index 011bd32..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/axis2.xml
+++ /dev/null
@@ -1,551 +0,0 @@
-<!--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  -->
-
-<axisconfig name="AxisJava2.0">
-    <!-- ================================================= -->
-    <!-- Parameters -->
-    <!-- ================================================= -->
-    <parameter name="hotdeployment">true</parameter>
-    <parameter name="hotupdate">false</parameter>
-    <parameter name="enableMTOM">false</parameter>
-    <parameter name="enableSwA">false</parameter>
-
-    <!--Uncomment if you want to enable file caching for attachments -->
-    <!--parameter name="cacheAttachments">true</parameter>
-    <parameter name="attachmentDIR"></parameter>
-    <parameter name="sizeThreshold">4000</parameter-->
-
-    <!--Uncomment if you want to plugin your own attachments lifecycle implementation -->
-    <!--<attachmentsLifecycleManager class="org.apache.axiom.attachments.lifecycle.impl.LifecycleManagerImpl"/>-->
-
-
-    <!--Uncomment if you want to enable the reduction of the in-memory cache of WSDL definitions -->
-    <!--In some server environments, the available memory heap is limited and can fill up under load -->
-    <!--Since in-memory copies of WSDL definitions can be large, some steps can be taken-->
-    <!--to reduce the memory needed for the cached WSDL definitions. -->
-    <!--parameter name="reduceWSDLMemoryCache">true</parameter-->
-
-    <!--This will give out the timout of the configuration contexts, in milliseconds-->
-    <parameter name="ConfigContextTimeoutInterval">30000</parameter>
-
-    <!--During a fault, stack trace can be sent with the fault message. The following flag will control -->
-    <!--that behavior.-->
-    <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
-
-    <!--If there aren't any information available to find out the fault reason, we set the message of the exception-->
-    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
-    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
-    <!--is set, then Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
-    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
-
-    <parameter name="userName">admin</parameter>
-    <parameter name="password">axis2</parameter>
-
-    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
-    <!--ServicesDirectory only works on the following cases-->
-    <!---File based configurator and in that case the value should be a file URL (http:// not allowed)-->
-    <!---When creating URL Based configurator with URL file:// -->
-    <!--- War based configurator with expanded case , -->
-
-    <!--All the other scenarios it will be ignored.-->
-    <!--<parameter name="ServicesDirectory">service</parameter>-->
-    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
-    <!--<parameter name="ModulesDirectory">modules</parameter>-->
-
-
-    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
-    <!--root which can configured using the following contextRoot parameter-->
-    <!--<parameter name="contextRoot">axis2</parameter>-->
-
-    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distinguiush those endpoints-->
-    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
-    <!--context path to proper Axis2 servlets-->
-    <!--<parameter name="servicePath">services</parameter>-->
-    <!--<parameter name="restPath">rest</parameter>-->
-
-    <!-- Following parameter will completely disable REST handling in Axis2-->
-    <parameter name="disableREST" locked="false">false</parameter>
-
-    <!-- Following parameter will suppress generation of SOAP 1.2 bindings in auto-generated WSDL files -->
-    <parameter name="disableSOAP12" locked="true">false</parameter>
-
-    <!--POJO deployer , this will alow users to drop .class file and make that into a service-->
-    <deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
-    <deployer extension=".jar" directory="servicejars"
-              class="org.apache.axis2.jaxws.framework.JAXWSDeployer"/>
-    <deployer extension=".jar" directory="transports"
-              class="org.apache.axis2.deployment.TransportDeployer"/>
-
-    <!--CORBA deployer , this will alow users to invoke remote CORBA services through Axis2-->
-    <!--<deployer extension=".xml" directory="corba" class="org.apache.axis2.corba.deployer.CorbaDeployer"/>-->
-
-    <!--<deployer extension=".jsa" directory="rmiservices" class="org.apache.axis2.rmi.deploy.RMIServiceDeployer"/>-->
-
-
-    <!-- Following parameter will set the host name for the epr-->
-    <!--<parameter name="hostname" locked="true">myhost.com</parameter>-->
-
-    <!-- If you have a front end host which exposes this webservice using a different public URL  -->
-    <!-- use this parameter to override autodetected url -->
-    <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
-
-
-    <!--    The way of adding listener to the system-->
-    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
-    <!--        <parameter name="RSS_URL">http://127.0.0.1/rss</parameter>-->
-    <!--    </listener>-->
-
-    <threadContextMigrators>
-        <threadContextMigrator listId="JAXWS-ThreadContextMigrator-List"
-                               class="org.apache.axis2.jaxws.addressing.migrator.EndpointContextMapMigrator"/>
-    </threadContextMigrators>
-
-    <!-- ================================================= -->
-    <!-- Message Receivers -->
-    <!-- ================================================= -->
-    <!--This is the default MessageReceiver for the system , if you want to have MessageReceivers for -->
-    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
-    <!--any operation -->
-    <!--Note : You can override this for a particular service by adding the same element with your requirement-->
-    <messageReceivers>
-        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
-                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
-                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
-                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
-                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-only"
-                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
-        <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out"
-                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
-    </messageReceivers>
-
-    <!-- ================================================= -->
-    <!-- Message Formatter -->
-    <!-- ================================================= -->
-    <!--Following content type to message formatter mapping can be used to implement support for different message -->
-    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
-    <messageFormatters>
-        <messageFormatter contentType="application/x-www-form-urlencoded"
-                          class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
-        <messageFormatter contentType="multipart/form-data"
-                          class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
-        <messageFormatter contentType="application/xml"
-                          class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
-        <messageFormatter contentType="text/xml"
-                          class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
-        <messageFormatter contentType="application/soap+xml"
-                          class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
-    </messageFormatters>
-
-    <!-- ================================================= -->
-    <!-- Message Builders -->
-    <!-- ================================================= -->
-    <!--Following content type to builder mapping can be used to implement support for different message -->
-    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
-    <messageBuilders>
-        <messageBuilder contentType="application/xml"
-                        class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
-        <messageBuilder contentType="application/x-www-form-urlencoded"
-                        class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
-        <messageBuilder contentType="multipart/form-data"
-                        class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
-    </messageBuilders>
-
-    <!-- ================================================= -->
-    <!-- Transport Ins -->
-    <!-- ================================================= -->
-    <transportReceiver name="http" class="org.apache.synapse.transport.nhttp.HttpCoreNIOListener">
-    	<parameter name="port">8080</parameter>
-    	<parameter name="non-blocking">true</parameter>
-        <!--parameter name="bind-address" locked="false">hostname or IP address</parameter-->
-        <!--parameter name="WSDLEPRPrefix" locked="false">https://apachehost:port/somepath</parameter-->
-    </transportReceiver>
-
-    <!-- the non blocking https transport based on HttpCore + SSL-NIO extensions -->
-    
-
-    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
-    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
-        <parameter name="myTopicConnectionFactory">
-        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
-        	<parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
-		<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
-        </parameter>
-
-        <parameter name="myQueueConnectionFactory">
-        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
-        	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
-		<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
-        </parameter>
-
-        <parameter name="default">
-        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
-        	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
-		<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
-        </parameter>
-    </transportReceiver>-->
-
-     <!--Uncomment this for FIX transport support
-    <transportReceiver name="fix" class="org.apache.synapse.transport.fix.FIXTransportListener">
-        <parameter name="non-blocking">true</parameter>
-    </transportReceiver>-->
-
-    <!-- ================================================= -->
-    <!-- Transport Outs -->
-    <!-- ================================================= -->
-
-    <transportSender name="http"  class="org.apache.synapse.transport.nhttp.HttpCoreNIOSender">
-        <parameter name="non-blocking" locked="false">true</parameter>
-        <parameter name="warnOnHTTP500" locked="false">*</parameter>
-        <!--parameter name="http.proxyHost" locked="false">localhost</parameter>
-        <parameter name="http.proxyPort" locked="false">3128</parameter>
-        <parameter name="http.nonProxyHosts" locked="false">localhost|moon|sun</parameter-->
-    </transportSender>
-   
-
-    <!-- Uncomment and configure the SMTP server information
-    check com.sun.mail.smtp package documentation for descriptions of properties
-    <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
-        <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
-        <parameter name="mail.smtp.port">587</parameter>
-        <parameter name="mail.smtp.starttls.enable">true</parameter>
-        <parameter name="mail.smtp.auth">true</parameter>
-        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
-        <parameter name="mail.smtp.password">mailpassword</parameter>
-        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
-    </transportSender>-->
-
-    <!--Uncomment this for FIX transport support
-    <transportSender name="fix" class="org.apache.synapse.transport.fix.FIXTransportSender">
-	    <parameter name="non-blocking">true</parameter>
-    </transportSender>-->
-
-    <!-- ================================================= -->
-    <!-- Global Modules  -->
-    <!-- ================================================= -->
-    <!-- Comment this to disable Addressing -->
-    <module ref="addressing"/>
-
-    <!--Configuring module , providing parameters for modules whether they refer or not-->
-    <!--<moduleConfig name="addressing">-->
-    <!--<parameter name="addressingPara">N/A</parameter>-->
-    <!--</moduleConfig>-->
-
-    <!-- ================================================= -->
-    <!-- Clustering  -->
-    <!-- ================================================= -->
-    <!--
-     To enable clustering for this node, set the value of "enable" attribute of the "cluster"
-     element to "true". The initilization of a node in the cluster is handled by the class
-     corresponding to the "class" attribute of the "cluster" element. It is also responsible for
-     getting this node to join the cluster.
-     -->
-    <cluster class="org.apache.axis2.clustering.tribes.TribesClusterManager" enable="false">
-
-        <!--
-           This parameter indicates whther the cluster has to be automatically initalized
-           when the AxisConfiguration is built. If set to "true" the initialization will not be
-           done at that stage, and some other party will have to explictly initialize the cluster.
-        -->
-        <parameter name="AvoidInitiation">true</parameter>
-
-        <!--
-           Indicates whether this member is active or not. This will be useful in a setup where
-           members are deployed in ACTIVE and/or PASSIVE configuration 
-        -->
-        <parameter name="isActive">true</parameter>
-
-        <!--
-           An implementation of org.apache.axis2.clustering.MembershipListener
-           which will be called on membership changes
-        -->
-        <!--
-        <parameter name="membershipListener">
-            <class>org.apache.axis2.clustering.MembershipListenerImpl</class>
-            <properties>
-                <property name="foo">bar</property>
-            </properties>
-        </parameter>
-        -->
-
-        <!--
-           The membership scheme used in this setup. The only values supported at the moment are
-           "multicast" and "wka"
-
-           1. multicast - membership is automatically discovered using multicasting
-           2. wka - Well-Known Address based multicasting. Membership is discovered with the help
-                    of one or more nodes running at a Well-Known Address. New members joining a
-                    cluster will first connect to a well-known node, register with the well-known node
-                    and get the membership list from it. When new members join, one of the well-known
-                    nodes will notify the others in the group. When a member leaves the cluster or
-                    is deemed to have left the cluster, it will be detected by the Group Membership
-                    Service (GMS) using a TCP ping mechanism.
-        -->
-        <parameter name="membershipScheme">multicast</parameter>
-
-        <!--
-         The clustering domain/group. Nodes in the same group will belong to the same multicast
-         domain. There will not be interference between nodes in different groups.
-        -->
-        <parameter name="domain">apache.axis2.domain</parameter>
-
-        <!--
-        This parameter is only valid when the "mode" parameter is set to application. This indicates
-        the domain in which the the applications being load balanced are deployed.
-        -->
-        <parameter name="applicationDomain">apache.axis2.application.domain</parameter>
-
-        <!--
-           When a Web service request is received, and processed, before the response is sent to the
-           client, should we update the states of all members in the cluster? If the value of
-           this parameter is set to "true", the response to the client will be sent only after
-           all the members have been updated. Obviously, this can be time consuming. In some cases,
-           such this overhead may not be acceptable, in which case the value of this parameter
-           should be set to "false"
-        -->
-        <parameter name="synchronizeAll">true</parameter>
-
-        <!--
-          The maximum number of times we need to retry to send a message to a particular node
-          before giving up and considering that node to be faulty
-        -->
-        <parameter name="maxRetries">10</parameter>
-
-        <!-- The multicast address to be used -->
-        <parameter name="mcastAddress">228.0.0.4</parameter>
-
-        <!-- The multicast port to be used -->
-        <parameter name="mcastPort">45564</parameter>
-
-        <!-- The frequency of sending membership multicast messages (in ms) -->
-        <parameter name="mcastFrequency">500</parameter>
-
-        <!-- The time interval within which if a member does not respond, the member will be
-         deemed to have left the group (in ms)
-         -->
-        <parameter name="memberDropTime">3000</parameter>
-
-        <!--
-           The IP address of the network interface to which the multicasting has to be bound to.
-           Multicasting would be done using this interface.
-        -->
-        <parameter name="mcastBindAddress">127.0.0.1</parameter>
-
-        <!-- The host name or IP address of this member -->
-        <parameter name="localMemberHost">127.0.0.1</parameter>
-
-        <!--
-        The TCP port used by this member. This is the port through which other nodes will
-        contact this member
-         -->
-        <parameter name="localMemberPort">4000</parameter>
-
-        <!--
-        Preserve message ordering. This will be done according to sender order.
-        -->
-        <parameter name="preserveMessageOrder">true</parameter>
-
-        <!--
-        Maintain atmost-once message processing semantics
-        -->
-        <parameter name="atmostOnceMessageSemantics">true</parameter>
-
-        <!--
-           The list of static or well-known members. These entries will only be valid if the
-           "membershipScheme" above is set to "wka"
-        -->
-        <members>
-            <member>
-                <hostName>127.0.0.1</hostName>
-                <port>4000</port>
-            </member>
-            <member>
-                <hostName>127.0.0.1</hostName>
-                <port>4001</port>
-            </member>
-        </members>
-
-        <!--
-        Enable the load balancer entry if you need to run this node as a load balancer.
-        Multiple application domains with different LoadBalanceEventHandler implementations
-        can be defined in this section.
-        -->
-        <loadBalancer enable="false">
-            <applicationDomain name="apache.axis2.application.domain"
-                               handler="org.apache.axis2.clustering.DefaultLoadBalanceEventHandler"/>
-        </loadBalancer>
-
-        <!--
-           This interface is responsible for handling configuration management.
-           Configuraion changes include:
-
-            1. Rebooting an entire cluster, in which case, all nodes have to load the new
-               Axis2 configuration in a consistent manner
-            2. Deploying a new service to a cluster or undeploying a service from a cluster
-            3. Changing the policies of a service deployed on the cluster
-
-            The "enable" attribute indicates whether Configuration management has been enabled
-        -->
-        <configurationManager
-                class="org.apache.axis2.clustering.configuration.DefaultConfigurationManager"
-                enable="true">
-            <listener
-                    class="org.apache.axis2.clustering.configuration.DefaultConfigurationManagerListener"/>
-        </configurationManager>
-
-        <!--
-           This interface is responsible for handling context replication. The property changes in
-           the Axis2 context hierarchy in this node, are propagated to all other nodes in the cluster.
-
-           The "excludes" patterns can be used to specify the prefixes (e.g. local_*) or
-           suffixes (e.g. *_local) of the properties to be excluded from replication. The pattern
-           "*" indicates that all properties in a particular context should not be replicated.
-
-            The "enable" attribute indicates whether context replication has been enabled
-        -->
-        <contextManager class="org.apache.axis2.clustering.context.DefaultContextManager"
-                        enable="true">
-            <listener class="org.apache.axis2.clustering.context.DefaultContextManagerListener"/>
-            <replication>
-                <defaults>
-                    <exclude name="local_*"/>
-                    <exclude name="LOCAL_*"/>
-                </defaults>
-                <context class="org.apache.axis2.context.ConfigurationContext">
-                    <exclude name="UseAsyncOperations"/>
-                    <exclude name="SequencePropertyBeanMap"/>
-                </context>
-                <context class="org.apache.axis2.context.ServiceGroupContext">
-                    <exclude name="my.sandesha.*"/>
-                </context>
-                <context class="org.apache.axis2.context.ServiceContext">
-                    <exclude name="my.sandesha.*"/>
-                </context>
-            </replication>
-        </contextManager>
-    </cluster>
-
-    <!-- ================================================= -->
-    <!-- Phases  -->
-    <!-- ================================================= -->
-    <phaseOrder type="InFlow">
-        <!--  System predefined phases       -->
-        <phase name="Transport">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
-                <order phase="Transport"/>
-            </handler>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
-                <order phase="Transport"/>
-            </handler>
-        </phase>
-        <phase name="Addressing">
-            <handler name="AddressingBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
-                <order phase="Addressing"/>
-            </handler>
-        </phase>
-        <phase name="Security"/>
-        <phase name="PreDispatch"/>
-        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
-            <handler name="RequestURIOperationDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
-            <handler name="SOAPMessageBodyBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
-            <handler name="HTTPLocationBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
-            <handler name="GenericProviderDispatcher"
-                     class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher"/>
-            <handler name="MustUnderstandValidationDispatcher"
-                     class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher"/>
-        </phase>
-        <phase name="RMPhase"/>
-        <!--  System predefined phases       -->
-        <!--   After Postdispatch phase module author or service author can add any phase he want      -->
-        <phase name="OperationInPhase">
-            <handler name="MustUnderstandChecker"
-                     class="org.apache.axis2.jaxws.dispatchers.MustUnderstandChecker">
-                <order phase="OperationInPhase"/>
-            </handler>
-        </phase>
-        <phase name="soapmonitorPhase"/>
-    </phaseOrder>
-    <phaseOrder type="OutFlow">
-        <!--      user can add his own phases to this area  -->
-        <phase name="soapmonitorPhase"/>
-        <phase name="OperationOutPhase"/>
-        <!--system predefined phase-->
-        <!--these phase will run irrespective of the service-->
-        <phase name="RMPhase"/>
-        <phase name="PolicyDetermination"/>
-        <phase name="MessageOut"/>
-        <phase name="Security"/>
-    </phaseOrder>
-    <phaseOrder type="InFaultFlow">
-        <phase name="Addressing">
-            <handler name="AddressingBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
-                <order phase="Addressing"/>
-            </handler>
-        </phase>
-        <phase name="Security"/>
-        <phase name="PreDispatch"/>
-        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
-            <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
-            <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
-            <handler name="RequestURIOperationDispatcher"
-                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
-            <handler name="SOAPMessageBodyBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
-            <handler name="HTTPLocationBasedDispatcher"
-                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
-            <handler name="GenericProviderDispatcher"
-                     class="org.apache.axis2.jaxws.dispatchers.GenericProviderDispatcher"/>
-            <handler name="MustUnderstandValidationDispatcher"
-                     class="org.apache.axis2.jaxws.dispatchers.MustUnderstandValidationDispatcher"/>
-        </phase>
-        <phase name="RMPhase"/>
-        <!--      user can add his own phases to this area  -->
-        <phase name="OperationInFaultPhase"/>
-        <phase name="soapmonitorPhase"/>
-    </phaseOrder>
-    <phaseOrder type="OutFaultFlow">
-        <!--      user can add his own phases to this area  -->
-        <phase name="soapmonitorPhase"/>
-        <phase name="OperationOutFaultPhase"/>
-        <phase name="RMPhase"/>
-        <phase name="PolicyDetermination"/>
-        <phase name="MessageOut"/>
-        <phase name="Security"/>
-    </phaseOrder>
-</axisconfig>
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/bin/axis2.bat
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/bin/axis2.bat b/modules/ws-messenger/distribution/src/main/resources/bin/axis2.bat
deleted file mode 100644
index 89e10fd..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/bin/axis2.bat
+++ /dev/null
@@ -1,75 +0,0 @@
-@echo off
-
-REM  Licensed to the Apache Software Foundation (ASF) under one
-REM  or more contributor license agreements. See the NOTICE file
-REM  distributed with this work for additional information
-REM  regarding copyright ownership. The ASF licenses this file
-REM  to you under the Apache License, Version 2.0 (the
-REM  "License"); you may not use this file except in compliance
-REM  with the License. You may obtain a copy of the License at
-REM  
-REM  http://www.apache.org/licenses/LICENSE-2.0
-REM  
-REM  Unless required by applicable law or agreed to in writing,
-REM  software distributed under the License is distributed on an
-REM  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-REM  KIND, either express or implied. See the License for the
-REM  specific language governing permissions and limitations
-REM  under the License.
-
-rem ---------------------------------------------------------------------------
-rem Axis2 Script
-rem
-rem Environment Variable Prequisites
-rem
-rem   AXIS2_HOME      Must point at your AXIS2 directory
-rem
-rem   JAVA_HOME       Must point at your Java Development Kit installation.
-rem
-rem   JAVA_OPTS       (Optional) Java runtime options
-rem ---------------------------------------------------------------------------
-set CURRENT_DIR=%cd%
-
-rem Make sure prerequisite environment variables are set
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto end
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-echo NB: JAVA_HOME should point to a JDK/JRE
-goto end
-:okJavaHome
-
-rem check the AXIS2_HOME environment variable
-if not "%AXIS2_HOME%" == "" goto gotHome
-set AXIS2_HOME=%CURRENT_DIR%
-if exist "%AXIS2_HOME%\bin\java2wsdl.bat" goto okHome
-
-rem guess the home. Jump one directory up to check if that is the home
-cd ..
-set AXIS2_HOME=%cd%
-cd "%CURRENT_DIR%"
-
-:gotHome
-if EXIST "%AXIS2_HOME%\lib\axis2*.jar" goto okHome
-echo The AXIS2_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-
-:okHome
-rem set the classes
-setlocal EnableDelayedExpansion
-
-rem ----- Execute The Requested Command ---------------------------------------
-echo Using AXIS2_HOME:   %AXIS2_HOME%
-echo Using JAVA_HOME:    %JAVA_HOME%
-set _RUNJAVA="%JAVA_HOME%\bin\java"
-
-%_RUNJAVA% %JAVA_OPTS% -Djava.ext.dirs="%AXIS2_HOME%\lib\" -Daxis2.repo="%AXIS2_HOME%\repository" -Daxis2.xml="%AXIS2_HOME%\conf\axis2.xml" %*
-endlocal
-:end

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/bin/axis2.sh
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/bin/axis2.sh b/modules/ws-messenger/distribution/src/main/resources/bin/axis2.sh
deleted file mode 100755
index 733860d..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/bin/axis2.sh
+++ /dev/null
@@ -1,56 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# ----------------------------------------------------------------------------
-#    Axis2 Script
-#
-# Pre-requisites
-#   - setenv.sh must have been called.
-#
-#   AXIS2_HOME   Home of Axis2 installation. If not set I will  try
-#                   to figure it out.
-#
-#   JAVA_HOME       Must point at your Java Development Kit installation.
-#
-# -----------------------------------------------------------------------------
-
-# Get the context and from that find the location of setenv.sh
-dir=`dirname "$0"`
-. "${dir}"/setenv.sh
-
-#add any user given classpath's
-USER_COMMANDS=""
-prearg=""
-for arg in "$@"
-do
-   if [ "$arg" != -classpath ] && [ "$arg" != -cp ] && [ "$prearg" != -classpath ] && [ "$prearg" != -cp  ]
-   then
-      USER_COMMANDS="$USER_COMMANDS ""$arg"
-   fi
-
-   if [ "$prearg"=-classpath ] || [ "$prearg"=-cp  ]
-   then
-      AXIS2_CLASSPATH="$arg":"$AXIS2_CLASSPATH"
-   fi
-   prearg="$arg"
-done 
-
-
-"$JAVA_HOME"/bin/java -classpath "$AXIS2_CLASSPATH" \
--Daxis2.xml="$AXIS2_HOME/conf/axis2.xml" -Daxis2.repo="$AXIS2_HOME/repository"  $USER_COMMANDS

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/bin/axis2server.bat
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/bin/axis2server.bat b/modules/ws-messenger/distribution/src/main/resources/bin/axis2server.bat
deleted file mode 100644
index 4bd7061..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/bin/axis2server.bat
+++ /dev/null
@@ -1,118 +0,0 @@
-@echo off
-
-REM  Licensed to the Apache Software Foundation (ASF) under one
-REM  or more contributor license agreements. See the NOTICE file
-REM  distributed with this work for additional information
-REM  regarding copyright ownership. The ASF licenses this file
-REM  to you under the Apache License, Version 2.0 (the
-REM  "License"); you may not use this file except in compliance
-REM  with the License. You may obtain a copy of the License at
-REM  
-REM  http://www.apache.org/licenses/LICENSE-2.0
-REM  
-REM  Unless required by applicable law or agreed to in writing,
-REM  software distributed under the License is distributed on an
-REM  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-REM  KIND, either express or implied. See the License for the
-REM  specific language governing permissions and limitations
-REM  under the License.
-
-rem ---------------------------------------------------------------------------
-rem Startup script for the Simple Axis Server (with default parameters)
-rem
-rem Environment Variable Prequisites
-rem
-rem   AXIS2_HOME      Must point at your AXIS2 directory 
-rem
-rem   JAVA_HOME       Must point at your Java Development Kit installation.
-rem
-rem   JAVA_OPTS       (Optional) Java runtime options 
-rem ---------------------------------------------------------------------------
-
-if "%OS%"=="Windows_NT" @setlocal
-if "%OS%"=="WINNT" @setlocal
-
-rem %~dp0 is expanded pathname of the current script under NT
-set DEFAULT_AXIS2_HOME=%~dp0..
-
-if "%AXIS2_HOME%"=="" set AXIS2_HOME=%DEFAULT_AXIS2_HOME%
-set DEFAULT_AXIS2_HOME=
-
-:loop
-if ""%1""==""-xdebug"" goto xdebug
-if ""%1""==""-security"" goto security
-if ""%1""==""-h"" goto help
-if ""%1""=="""" goto checkConf
-
-:xdebug
-set JAVA_OPTS= %JAVA_OPTS% -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000
-shift
-goto loop
-
-:security
-set JAVA_OPTS=%JAVA_OPTS% -Djava.security.manager -Djava.security.policy=%AXIS2_HOME%\conf\axis2.policy -Daxis2.home=%AXIS2_HOME%
-shift
-goto loop
-
-:help
-echo  Usage: axis2server.bat
-   
-echo  commands:    
-echo   -xdebug    Start Axis2 Server under JPDA debugger
-echo   -security  Enable Java 2 security
-echo   -h         help
-goto end
-
-
-
-rem find AXIS2_HOME if it does not exist due to either an invalid value passed
-rem by the user or the %0 problem on Windows 9x
-:checkConf
-if exist "%AXIS2_HOME%\conf\axis2.xml" goto checkJava
-
-:noAxis2Home
-echo AXIS2_HOME environment variable is set incorrectly or AXIS2 could not be located. 
-echo Please set the AXIS2_HOME variable appropriately
-goto end
-
-:checkJava
-set _JAVACMD=%JAVACMD%
-
-if "%JAVA_HOME%" == "" goto noJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-if "%_JAVACMD%" == "" set _JAVACMD=%JAVA_HOME%\bin\java.exe
-if  "%AXIS2_CMD_LINE_ARGS%" == "" goto defaultParams
-
-goto runAxis2
-
-:defaultParams
-set AXIS2_CMD_LINE_ARGS=-repo "%AXIS2_HOME%\repository" -conf "%AXIS2_HOME%\conf\axis2.xml"
-goto runAxis2
-
-:noJavaHome
-if "%_JAVACMD%" == "" set _JAVACMD=java.exe
-echo JAVA_HOME environment variable is set incorrectly or Java runtime could not be located.
-echo Please set the JAVA_HOME variable appropriately
-goto end
-
-:runAxis2
-rem set the classes by looping through the libs
-setlocal EnableDelayedExpansion
-set AXIS2_CLASS_PATH=%AXIS2_HOME%;%AXIS2_HOME%\conf;%JAVA_HOME%\lib\tools.jar;
-FOR %%C in ("%AXIS2_HOME%\lib\*.jar") DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;".\lib\%%~nC%%~xC"
-
-echo Using JAVA_HOME    %JAVA_HOME%
-echo Using AXIS2_HOME   %AXIS2_HOME%
-
-cd %AXIS2_HOME%
-"%_JAVACMD%" %JAVA_OPTS% -cp "!AXIS2_CLASS_PATH!" -Djava.endorsed.dirs="%AXIS2_HOME%\lib\endorsed";"%JAVA_HOME%\jre\lib\endorsed";"%JAVA_HOME%\lib\endorsed" org.apache.axis2.transport.SimpleAxis2Server %AXIS2_CMD_LINE_ARGS%
-goto end
-
-:end
-set _JAVACMD=
-set AXIS2_CMD_LINE_ARGS=
-
-if "%OS%"=="Windows_NT" @endlocal
-if "%OS%"=="WINNT" @endlocal
-
-:mainEnd

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/bin/axis2server.sh
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/bin/axis2server.sh b/modules/ws-messenger/distribution/src/main/resources/bin/axis2server.sh
deleted file mode 100755
index a4bdb60..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/bin/axis2server.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# ----------------------------------------------------------------------------
-# SimpleAxis2Server Script
-#
-# Environment Variable Prequisites
-#
-#   AXIS2_HOME   Home of Axis2 installation. If not set I will  try
-#                   to figure it out.
-#
-#   JAVA_HOME       Must point at your Java Development Kit installation.
-#
-# -----------------------------------------------------------------------------
-
-# Get the context and from that find the location of setenv.sh
-. `dirname $0`/setenv.sh
-
-JAVA_OPTS=""
-while [ $# -ge 1 ]; do
-    case $1 in
-        -xdebug)
-            JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000"
-            shift
-        ;;
-        -security)
-            JAVA_OPTS="$JAVA_OPTS -Djava.security.manager -Djava.security.policy=$AXIS2_HOME/conf/axis2.policy -Daxis2.home=$AXIS2_HOME"
-            shift
-        ;;
-        -h)
-            echo "Usage: axis2server.sh"
-            echo "commands:"
-            echo "  -xdebug    Start Axis2 Server under JPDA debugger"
-            echo "  -security  Enable Java 2 security"
-            echo "  -h         help"
-            shift
-            exit 0
-        ;;
-        *)
-            echo "Error: unknown command:$1"
-            echo "For help: axis2server.sh -h"
-            shift
-            exit 1
-    esac
-done
-
-java $JAVA_OPTS -classpath "$AXIS2_CLASSPATH" \
-    -Djava.endorsed.dirs="$AXIS2_HOME/lib/endorsed":"$JAVA_HOME/jre/lib/endorsed":"$JAVA_HOME/lib/endorsed" \
-    org.apache.axis2.transport.SimpleAxis2Server \
-    -repo "$AXIS2_HOME"/repository -conf "$AXIS2_HOME"/conf/axis2.xml $*

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/bin/java2wsdl.bat
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/bin/java2wsdl.bat b/modules/ws-messenger/distribution/src/main/resources/bin/java2wsdl.bat
deleted file mode 100644
index 81b2471..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/bin/java2wsdl.bat
+++ /dev/null
@@ -1,79 +0,0 @@
-@echo off
-
-REM  Licensed to the Apache Software Foundation (ASF) under one
-REM  or more contributor license agreements. See the NOTICE file
-REM  distributed with this work for additional information
-REM  regarding copyright ownership. The ASF licenses this file
-REM  to you under the Apache License, Version 2.0 (the
-REM  "License"); you may not use this file except in compliance
-REM  with the License. You may obtain a copy of the License at
-REM  
-REM  http://www.apache.org/licenses/LICENSE-2.0
-REM  
-REM  Unless required by applicable law or agreed to in writing,
-REM  software distributed under the License is distributed on an
-REM  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-REM  KIND, either express or implied. See the License for the
-REM  specific language governing permissions and limitations
-REM  under the License.
-
-rem ---------------------------------------------------------------------------
-rem Startup script for the WSDLJava
-rem
-rem Environment Variable Prequisites
-rem
-rem   AXIS2_HOME      Must point at your AXIS2 directory 
-rem
-rem   JAVA_HOME       Must point at your Java Development Kit installation.
-rem
-rem   JAVA_OPTS       (Optional) Java runtime options 
-rem ---------------------------------------------------------------------------
-set CURRENT_DIR=%cd%
-
-rem Make sure prerequisite environment variables are set
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto end
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-echo NB: JAVA_HOME should point to a JDK/JRE
-goto end
-:okJavaHome
-
-rem check the AXIS2_HOME environment variable
-if not "%AXIS2_HOME%" == "" goto gotHome
-set AXIS2_HOME=%CURRENT_DIR%
-if exist "%AXIS2_HOME%\bin\axis2.bat" goto okHome
-
-rem guess the home. Jump one directory up to check if that is the home
-cd ..
-set AXIS2_HOME=%cd%
-cd %CURRENT_DIR%
-
-:gotHome
-if EXIST "%AXIS2_HOME%\lib\axis2*.jar" goto okHome
-echo The AXIS2_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-
-:okHome
-rem set the classes
-setlocal EnableDelayedExpansion
-rem append the existing classpath to AXIS2_CLASS_PATH
-set AXIS2_CLASS_PATH=%CLASSPATH%;%AXIS2_HOME%
-rem loop through the libs and add them to the class path
-FOR %%c in ("%AXIS2_HOME%\lib\*.jar") DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;%%c
-
-rem ----- Execute The Requested Command ---------------------------------------
-echo Using AXIS2_HOME:   %AXIS2_HOME%
-echo Using JAVA_HOME:    %JAVA_HOME%
-set _RUNJAVA="%JAVA_HOME%\bin\java"
-
-%_RUNJAVA% %JAVA_OPTS% -cp "!AXIS2_CLASS_PATH!" org.apache.ws.java2wsdl.Java2WSDL %*
-endlocal
-:end

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/bin/java2wsdl.sh
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/bin/java2wsdl.sh b/modules/ws-messenger/distribution/src/main/resources/bin/java2wsdl.sh
deleted file mode 100755
index cff7810..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/bin/java2wsdl.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-dir=`dirname "$0"`
-sh "$dir"/axis2.sh org.apache.ws.java2wsdl.Java2WSDL $*

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/bin/setenv.sh
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/bin/setenv.sh b/modules/ws-messenger/distribution/src/main/resources/bin/setenv.sh
deleted file mode 100755
index d4bac81..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/bin/setenv.sh
+++ /dev/null
@@ -1,112 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# ----------------------------------------------------------------------------
-#  Set Environment Shell Script
-#
-#  This will set AXIS2_HOME and JAVA_HOME environment variables properly.
-#
-#   AXIS2_HOME   Home of Axis2 installation. If not set I will  try
-#                   to figure it out.
-#
-#   JAVA_HOME       Must point at your Java Development Kit installation.
-#
-# NOTE: Borrowed generously from Apache Tomcat startup scripts.
-# -----------------------------------------------------------------------------
-
-# if JAVA_HOME is not set we're not happy
-if [ -z "$JAVA_HOME" ]; then
-  echo "You must set the JAVA_HOME variable before running Axis2 Script."
-  exit 1
-fi
-
-# OS specific support.  $var _must_ be set to either true or false.
-cygwin=false
-os400=false
-case "`uname`" in
-CYGWIN*) cygwin=true;;
-OS400*) os400=true;;
-esac
-
-# resolve links - $0 may be a softlink
-PRG="$0"
-
-while [ -h "$PRG" ]; do
-  ls=`ls -ld "$PRG"`
-  link=`expr "$ls" : '.*-> \(.*\)$'`
-  if expr "$link" : '.*/.*' > /dev/null; then
-    PRG="$link"
-  else
-    PRG=`dirname "$PRG"`/"$link"
-  fi
-done
-
-# Get standard environment variables
-PRGDIR=`dirname "$PRG"`
-
-# Only set AXIS2_HOME if not already set
-[ -z "$AXIS2_HOME" ] && AXIS2_HOME=`cd "$PRGDIR/.." ; pwd`
-
-# For Cygwin, ensure paths are in UNIX format before anything is touched
-if $cygwin; then
-  [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
-  [ -n "$AXIS2_HOME" ] && AXIS2_HOME=`cygpath --unix "$AXIS2_HOME"`
-  [ -n "$CLASSPATH" ] && CLASSPATH=`cygpath --path --unix "$CLASSPATH"`
-fi
-
-# For OS400
-if $os400; then
-  # Set job priority to standard for interactive (interactive - 6) by using
-  # the interactive priority - 6, the helper threads that respond to requests
-  # will be running at the same priority as interactive jobs.
-  COMMAND='chgjob job('$JOBNAME') runpty(6)'
-  system $COMMAND
-
-  # Enable multi threading
-  QIBM_MULTI_THREADED=Y
-  export QIBM_MULTI_THREADED
-fi
-
-# update classpath
-AXIS2_CLASSPATH=""
-for f in "$AXIS2_HOME"/lib/*.jar
-do
-  AXIS2_CLASSPATH="$AXIS2_CLASSPATH":$f
-done
-AXIS2_CLASSPATH="$AXIS2_HOME":"$AXIS2_HOME/conf":"$JAVA_HOME/lib/tools.jar":"$AXIS2_CLASSPATH":"$CLASSPATH"
-
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin; then
-  JAVA_HOME=`cygpath --absolute --windows "$JAVA_HOME"`
-  AXIS2_HOME=`cygpath --absolute --windows "$AXIS2_HOME"`
-  CLASSPATH=`cygpath --path --windows "$CLASSPATH"`
-  AXIS2_CLASSPATH=`cygpath --path --windows "$AXIS2_CLASSPATH"`
-  JAVA_ENDORSED_DIRS=`cygpath --path --windows "$JAVA_ENDORSED_DIRS"`
-fi
-
-export AXIS2_HOME
-export JAVA_HOME
-export AXIS2_CLASSPATH
-
-
-echo " Using AXIS2_HOME: $AXIS2_HOME"
-echo " Using JAVA_HOME:  $JAVA_HOME"
-
-
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/bin/wsdl2java.bat
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/bin/wsdl2java.bat b/modules/ws-messenger/distribution/src/main/resources/bin/wsdl2java.bat
deleted file mode 100644
index 17a1345..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/bin/wsdl2java.bat
+++ /dev/null
@@ -1,78 +0,0 @@
-@echo off
-
-REM  Licensed to the Apache Software Foundation (ASF) under one
-REM  or more contributor license agreements. See the NOTICE file
-REM  distributed with this work for additional information
-REM  regarding copyright ownership. The ASF licenses this file
-REM  to you under the Apache License, Version 2.0 (the
-REM  "License"); you may not use this file except in compliance
-REM  with the License. You may obtain a copy of the License at
-REM  
-REM  http://www.apache.org/licenses/LICENSE-2.0
-REM  
-REM  Unless required by applicable law or agreed to in writing,
-REM  software distributed under the License is distributed on an
-REM  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-REM  KIND, either express or implied. See the License for the
-REM  specific language governing permissions and limitations
-REM  under the License.
-
-rem ---------------------------------------------------------------------------
-rem Startup script for the WSDLJava
-rem
-rem Environment Variable Prequisites
-rem
-rem   AXIS2_HOME      Must point at your AXIS2 directory 
-rem
-rem   JAVA_HOME       Must point at your Java Development Kit installation.
-rem
-rem   JAVA_OPTS       (Optional) Java runtime options 
-rem ---------------------------------------------------------------------------
-set CURRENT_DIR=%cd%
-
-rem Make sure prerequisite environment variables are set
-if not "%JAVA_HOME%" == "" goto gotJavaHome
-echo The JAVA_HOME environment variable is not defined
-echo This environment variable is needed to run this program
-goto end
-:gotJavaHome
-if not exist "%JAVA_HOME%\bin\java.exe" goto noJavaHome
-goto okJavaHome
-:noJavaHome
-echo The JAVA_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-echo NB: JAVA_HOME should point to a JDK/JRE
-goto end
-:okJavaHome
-
-rem check the AXIS2_HOME environment variable
-if not "%AXIS2_HOME%" == "" goto gotHome
-set AXIS2_HOME=%CURRENT_DIR%
-if exist "%AXIS2_HOME%\bin\axis2.bat" goto okHome
-
-rem guess the home. Jump one directory up to check if that is the home
-cd ..
-set AXIS2_HOME=%cd%
-cd %CURRENT_DIR%
-
-:gotHome
-if EXIST "%AXIS2_HOME%\lib\axis2*.jar" goto okHome
-echo The AXIS2_HOME environment variable is not defined correctly
-echo This environment variable is needed to run this program
-goto end
-
-:okHome
-rem set the classes
-setlocal EnableDelayedExpansion
-rem loop through the libs and add them to the class path
-set AXIS2_CLASS_PATH=%AXIS2_HOME%
-FOR %%c in ("%AXIS2_HOME%\lib\*.jar") DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;%%c
-
-rem ----- Execute The Requested Command ---------------------------------------
-echo Using AXIS2_HOME:   %AXIS2_HOME%
-echo Using JAVA_HOME:    %JAVA_HOME%
-set _RUNJAVA="%JAVA_HOME%\bin\java"
-
-%_RUNJAVA% %JAVA_OPTS% -cp "!AXIS2_CLASS_PATH!" org.apache.axis2.wsdl.WSDL2Java %*
-endlocal
-:end

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/bin/wsdl2java.sh
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/bin/wsdl2java.sh b/modules/ws-messenger/distribution/src/main/resources/bin/wsdl2java.sh
deleted file mode 100755
index 1ce66dd..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/bin/wsdl2java.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-dir=`dirname "$0"`
-sh "$dir"/axis2.sh org.apache.axis2.wsdl.WSDL2Java $*

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/distribution/src/main/resources/startGUI.sh
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/distribution/src/main/resources/startGUI.sh b/modules/ws-messenger/distribution/src/main/resources/startGUI.sh
deleted file mode 100755
index 928475c..0000000
--- a/modules/ws-messenger/distribution/src/main/resources/startGUI.sh
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/bin/sh
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-DISTRIBUTION_ROOT=$(dirname `pwd`) 
-
-BROKER_CLASS_PATH=""
-
-#broker libraries 
-for f in "$DISTRIBUTION_ROOT"/client-api/lib/airavata-messagebroker*.jar
-do
-  BROKER_CLASS_PATH="$BROKER_CLASS_PATH":$f
-done
-
-
-#axis libraries 
-for f in "$DISTRIBUTION_ROOT"/standalone-server/lib/*.jar
-do
-  BROKER_CLASS_PATH="$BROKER_CLASS_PATH":$f
-done
-
-echo $BROKER_CLASS_PATH
-
-
-java -classpath "$BROKER_CLASS_PATH" org.apache.airavata.wsmg.gui.NotificationViewer
-
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/maven-eclipse.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/maven-eclipse.xml b/modules/ws-messenger/messagebox/maven-eclipse.xml
deleted file mode 100644
index 3f67e06..0000000
--- a/modules/ws-messenger/messagebox/maven-eclipse.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-	distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-	the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-	obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-	in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-	ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-	the License. -->
-
-<project default="copy-resources">
-  <target name="init"/>
-  <target name="copy-resources" depends="init">
-    <copy todir="target/classes/META-INF" filtering="false">
-      <fileset dir="resources" includes="**/*.wsdl|**/*.xml" excludes="**/*.java"/>
-    </copy>
-  </target>
-</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/pom.xml b/modules/ws-messenger/messagebox/pom.xml
deleted file mode 100644
index c1a83e5..0000000
--- a/modules/ws-messenger/messagebox/pom.xml
+++ /dev/null
@@ -1,100 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>airavata-ws-messenger</artifactId>
-        <version>0.12-SNAPSHOT</version>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-message-box</artifactId>
-    <packaging>jar</packaging>
-    <name>Airavata Message Box</name>
-    <url>http://airavata.apache.org/</url>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-messenger-commons</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-client-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-common-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        
-        <!-- Logging -->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-
-        <!-- Test -->
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-messenger-client</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-	<dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-server-configuration</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <!-- Axis2 for test only -->
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-transport-http</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-transport-local</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-	<build>
-		<defaultGoal>install</defaultGoal>
-		<plugins>
-			<plugin>
-				<artifactId>maven-antrun-plugin</artifactId>
-				<version>${antrun.version}</version><!--$NO-MVN-MAN-VER$-->
-				<executions>
-					<execution>
-						<id>restore-persistence</id>
-						<phase>prepare-package</phase>
-						<configuration>
-							<tasks>
-								<copy file="${project.build.outputDirectory}/services.xml" tofile="${project.build.outputDirectory}/META-INF/services.xml" />
-							</tasks>
-						</configuration>
-						<goals>
-							<goal>run</goal>
-						</goals>
-					</execution>
-				</executions>
-			</plugin>
-		</plugins>
-	</build>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
deleted file mode 100644
index f0a62b4..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox;
-
-import java.net.URI;
-
-import org.apache.airavata.client.AiravataAPIFactory;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.client.tools.PeriodicExecutorThread;
-import org.apache.airavata.common.utils.AiravataUtils;
-import org.apache.airavata.common.utils.ServerSettings;
-import org.apache.airavata.common.utils.ServiceUtils;
-import org.apache.airavata.wsmg.commons.config.ConfigurationManager;
-import org.apache.airavata.wsmg.commons.util.Axis2Utils;
-import org.apache.airavata.wsmg.msgbox.Storage.MsgBoxStorage;
-import org.apache.airavata.wsmg.msgbox.Storage.dbpool.DatabaseStorageImpl;
-import org.apache.airavata.wsmg.msgbox.Storage.memory.InMemoryImpl;
-import org.apache.airavata.wsmg.msgbox.util.ConfigKeys;
-import org.apache.airavata.wsmg.msgbox.util.MsgBoxCommonConstants;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.engine.ServiceLifeCycle;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class initialize the messageBox service by setting the messageStore based on the configuration done by the user
- * This is the LifeCycle class
- */
-public class MsgBoxServiceLifeCycle implements ServiceLifeCycle {
-
-    private static final Logger logger = LoggerFactory.getLogger(MsgBoxServiceLifeCycle.class);
-//    private static final String CONFIGURATION_FILE_NAME = "airavata-server.properties";
-    private static final String TRUE = Boolean.toString(true);
-//    public static final String REPOSITORY_PROPERTIES = "airavata-server.properties";
-    public static final int GFAC_URL_UPDATE_INTERVAL = 1000 * 60 * 60 * 3;
-
-    public static final int JCR_AVAIALABILITY_WAIT_INTERVAL = 1000 * 10;
-    public static final String JCR_CLASS = "jcr.class";
-    public static final String JCR_USER = "jcr.user";
-    public static final String JCR_PASS = "jcr.pass";
-    public static final String ORG_APACHE_JACKRABBIT_REPOSITORY_URI = "org.apache.jackrabbit.repository.uri";
-	private static final String MESSAGE_BOX_SERVICE_NAME = "MsgBoxService";
-	private static final String SERVICE_URL = "message_box_service_url";
-	private static final String JCR_REGISTRY = "registry";
-	private Thread thread;
-    
-    public void shutDown(ConfigurationContext configurationcontext, AxisService axisservice) {
-        logger.info("Message box shutting down");
-        AiravataAPI registry = (AiravataAPI) configurationcontext.getProperty(JCR_REGISTRY);
-        if (registry != null && thread != null) {
-            try {
-                registry.getAiravataManager().unsetMessageBoxURI();
-            } catch (AiravataAPIInvocationException e) {
-                e.printStackTrace();
-            }
-            thread.interrupt();
-            try {
-                thread.join();
-            } catch (InterruptedException e) {
-                logger.info("Message box url update thread is interrupted");
-            }
-        }
-        if (configurationcontext.getProperty(MsgBoxCommonConstants.MSGBOX_STORAGE) != null) {
-            MsgBoxStorage msgBoxStorage = (MsgBoxStorage) configurationcontext
-                    .getProperty(MsgBoxCommonConstants.MSGBOX_STORAGE);
-            msgBoxStorage.dispose();
-        }
-    }
-
-    public void startUp(ConfigurationContext configurationcontext, AxisService axisservice) {
-    	AiravataUtils.setExecutionAsServer();
-        Axis2Utils.overrideAddressingPhaseHander(configurationcontext, new StoreMessageHandler());
-
-        // Load the configuration file from the classpath
-        ConfigurationManager confmanager = new ConfigurationManager();
-        initDatabase(configurationcontext, confmanager);
-        configurationcontext.setProperty(ConfigKeys.MSG_PRESV_INTERVAL,getIntervaltoExecuteDelete(confmanager));
-        final ConfigurationContext context=configurationcontext;
-        new Thread(){
-    		@Override
-    		public void run() {
-//    	        Properties properties = new Properties();
-    	        try {
-//    	            URL url = this.getClass().getClassLoader().getResource(REPOSITORY_PROPERTIES);
-//    	            properties.load(url.openStream());
-//    	            Map<String, String> map = new HashMap<String, String>((Map) properties);
-	            	try {
-						Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
-					} catch (InterruptedException e1) {
-						e1.printStackTrace();
-					}
-
-                    String userName = ServerSettings.getSystemUser();
-                    String gateway = ServerSettings.getSystemUserGateway();
-
-                    AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(gateway, userName);
-					String localAddress = ServiceUtils.generateServiceURLFromConfigurationContext(context, MESSAGE_BOX_SERVICE_NAME);
-					logger.debug("MESSAGE BOX SERVICE_ADDRESS:" + localAddress);
-                    context.setProperty(SERVICE_URL,new URI(localAddress));
-					context.setProperty(JCR_REGISTRY,airavataAPI);
-					/*
-					 * Heart beat message to registry
-					 */
-					thread = new MsgBoxURLRegisterThread(airavataAPI, context);
-					thread.start();
-    	        } catch (Exception e) {
-    	            logger.error(e.getMessage(), e);
-    	        }
-    		}
-    	}.start();
-    }
-
-    public void initDatabase(ConfigurationContext configurationcontext, ConfigurationManager confmanager) {
-        /*
-         * Determine Storage
-         */
-        String useDatabase = confmanager.getConfig(ConfigKeys.USE_DATABASE_STORAGE, TRUE);
-        MsgBoxStorage msgBoxStorage = null;
-        long time = getInterval(confmanager);
-        if (useDatabase.equalsIgnoreCase(TRUE)) {
-            String jdbcUrl = confmanager.getConfig(ConfigKeys.MSG_BOX_JDBC_URL);
-            String jdbcDriver = confmanager.getConfig(ConfigKeys.MSG_BOX_JDBC_DRIVER);
-            msgBoxStorage = new DatabaseStorageImpl(jdbcUrl, jdbcDriver, time);
-        } else {
-            msgBoxStorage = new InMemoryImpl(time);
-        }
-        configurationcontext.setProperty(MsgBoxCommonConstants.MSGBOX_STORAGE, msgBoxStorage);
-
-    }
-
-    private long getInterval(ConfigurationManager configs) {
-        int messagePreservationDays = configs.getConfig(ConfigKeys.MSG_PRESV_DAYS, 2);
-        int messagePreservationHours = configs.getConfig(ConfigKeys.MSG_PRESV_HRS, 0);
-        int messagePreservationMinutes = configs.getConfig(ConfigKeys.MSG_PRESV_MINS, 0);
-
-        long interval = messagePreservationDays * 24l;
-        interval = (interval + messagePreservationHours) * 60;
-        interval = (interval + messagePreservationMinutes) * 60;
-        interval = interval * 1000;
-        return interval;
-    }
-
-    private long getIntervaltoExecuteDelete(ConfigurationManager configs) {
-        int messagePreservationDays = configs.getConfig(ConfigKeys.MSG_PRESV_INTERVAL_DAYS, 0);
-        int messagePreservationHours = configs.getConfig(ConfigKeys.MSG_PRESV_INTERVAL_HRS, 0);
-        int messagePreservationMinutes = configs.getConfig(ConfigKeys.MSG_PRESV_INTERVAL_MINS, 5);
-
-        long interval = messagePreservationDays * 24l;
-        interval = (interval + messagePreservationHours) * 60;
-        interval = (interval + messagePreservationMinutes) * 60;
-        interval = interval * 1000;
-        return interval;
-    }
-    
-    class MsgBoxURLRegisterThread extends PeriodicExecutorThread {
-        private ConfigurationContext context = null;
-
-        MsgBoxURLRegisterThread(AiravataAPI registry, ConfigurationContext context) {
-            super(registry);
-            this.context = context;
-        }
-
-        @Override
-        protected void updateRegistry(AiravataAPI registry) throws Exception {
-            URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
-            registry.getAiravataManager().setMessageBoxURI(localAddress);
-            logger.debug("Updated Message box service URL in to Repository");
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceMessageReceiverInOut.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceMessageReceiverInOut.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceMessageReceiverInOut.java
deleted file mode 100644
index cf18f49..0000000
--- a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceMessageReceiverInOut.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.msgbox;
-
-import org.apache.airavata.wsmg.msgbox.util.MsgBoxOperations;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.receivers.AbstractInOutMessageReceiver;
-import org.apache.axis2.transport.http.HTTPConstants;
-import org.apache.axis2.util.JavaUtils;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * MsgBoxServiceMessageReceiverInOut message receiver, this is the actual location where the service operations get
- * invoked.
- */
-
-public class MsgBoxServiceMessageReceiverInOut extends AbstractInOutMessageReceiver {
-
-    private static Logger logger = LoggerFactory.getLogger(MsgBoxServiceMessageReceiverInOut.class);
-
-    public void invokeBusinessLogic(MessageContext inMsgContext, MessageContext outMsgContext) throws AxisFault {
-
-        // get the implementation class for the Web Service
-        MsgBoxServiceSkeleton skel = (MsgBoxServiceSkeleton) getTheImplementationObject(inMsgContext);
-
-        OMElement response = null;
-
-        try {
-
-            String operationName = getOperationName(inMsgContext);
-            MsgBoxOperations msgType = MsgBoxOperations.valueFrom(operationName);
-
-            switch (msgType) {
-
-            case STORE_MSGS: {
-                SOAPEnvelope enlp = inMsgContext.getEnvelope();
-                OMElement message = enlp.getBody().getFirstElement();
-                String msgBoxId = getClientId(inMsgContext);
-                String messageId = inMsgContext.getMessageID();
-                String soapAction = inMsgContext.getSoapAction();
-                response = skel.storeMessages(msgBoxId, messageId, soapAction, message);
-                break;
-            }
-
-            case DESTROY_MSGBOX: {
-                String msgBoxId = getClientId(inMsgContext);
-                response = skel.destroyMsgBox(msgBoxId);
-                break;
-            }
-
-            case TAKE_MSGS: {
-                String msgBoxId = getClientId(inMsgContext);
-                response = skel.takeMessages(msgBoxId);
-                break;
-            }
-
-            case CREATE_MSGBOX: {
-                response = skel.createMsgBox();
-                break;
-            }
-            default:
-                throw new AxisFault("unsupported operation" + msgType.toString());
-            }
-
-        } catch (AxisFault afe) {
-            throw afe;
-        } catch (Exception e) {
-            logger.error("Exception", e);
-            throw new AxisFault("Exception in Message Box ", e);
-        }
-
-        /*
-         * Output
-         */
-        SOAPFactory soapFactory = getSOAPFactory(inMsgContext);
-        SOAPEnvelope envelope = toEnvelope(soapFactory, response);
-        outMsgContext.setEnvelope(envelope);
-        outMsgContext.getOptions().setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
-    }
-
-    private String getClientId(MessageContext inMsg) throws AxisFault {
-        String toAddress = inMsg.getTo().getAddress();
-        int biginIndex = toAddress.indexOf("clientid");
-        if (biginIndex == -1) {
-            throw new AxisFault("clientid cannot be found");
-        }
-        String clientId = toAddress.substring(biginIndex + "clientid".length() + 1);
-        return clientId;
-    }
-
-    private SOAPEnvelope toEnvelope(SOAPFactory factory, OMElement response) {
-        SOAPEnvelope envelop = factory.getDefaultEnvelope();
-        envelop.getBody().addChild(response);
-        return envelop;
-    }
-
-    protected String getOperationName(MessageContext inMsg) throws AxisFault {
-
-        AxisOperation op = inMsg.getOperationContext().getAxisOperation();
-        if (op == null) {
-            throw new AxisFault(
-                    "Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
-        }
-
-        String operationName = null;
-        if ((op.getName() == null) || ((operationName = JavaUtils.xmlNameToJava(op.getName().getLocalPart())) == null)) {
-            throw new AxisFault("invalid operation found");
-        }
-
-        return operationName;
-    }
-
-}


[24/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
deleted file mode 100644
index 60a9705..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
+++ /dev/null
@@ -1,773 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.commons.storage;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.sql.BatchUpdateException;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.sql.Timestamp;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionEntry;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.storage.DatabaseCreator.DatabaseType;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.airavata.wsmg.util.Counter;
-import org.apache.airavata.wsmg.util.TimerThread;
-import org.apache.axiom.om.OMElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WsmgPersistantStorage implements WsmgStorage, WsmgQueue {
-    private static final Logger logger = LoggerFactory.getLogger(WsmgPersistantStorage.class);
-
-    /*
-     * Table name
-     */
-    private static final String TABLE_NAME_TO_CHECK = SubscriptionConstants.TABLE_NAME_EXPIRABLE_SUBCRIPTIONS;
-
-    private Counter storeToDBCounter = new Counter();
-
-    private JdbcStorage db;
-
-    public WsmgPersistantStorage(String jdbcUrl, String jdbcDriver) {
-
-        db = new JdbcStorage(jdbcUrl, jdbcDriver);
-
-        Connection conn = null;
-        try {
-            /*
-             * Check database
-             */
-            conn = db.connect();
-            if (!DatabaseCreator.isDatabaseStructureCreated(TABLE_NAME_TO_CHECK, conn)) {
-                DatabaseCreator.createMsgBrokerDatabase(conn);
-                logger.info("New Database created for Message Broker");
-            } else {
-                logger.debug("Database already created for Message Broker!");
-            }
-
-            if (WSMGParameter.measureMessageRate) {
-                TimerThread timerThread = new TimerThread(storeToDBCounter, " StoreSubScriptionToDBCounter");
-                new Thread(timerThread).start();
-            }
-
-            initMessageQueueStorage();
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RuntimeException("Database failure");
-        } finally {
-            db.closeConnection(conn);
-        }
-    }
-
-    public void dispose() {
-        if (db != null) {
-            db.closeAllConnections();
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.wsmg.commons.storage.WsmgStorage#getAllSubscription()
-     */
-    public List<SubscriptionEntry> getAllSubscription() {
-
-        ArrayList<SubscriptionEntry> ret = new ArrayList<SubscriptionEntry>();
-
-        Connection conn = null;
-        PreparedStatement stmt = null;
-        try {
-
-            // get number of row first and increase the arrayList size for
-            // better performance
-            int size = db.countRow(SubscriptionConstants.TABLE_NAME_EXPIRABLE_SUBCRIPTIONS, "*");
-
-            conn = db.connect();
-            stmt = conn.prepareStatement(SubscriptionConstants.EXP_SELECT_QUERY);
-            ResultSet rs = stmt.executeQuery();
-            ret.ensureCapacity(size);
-
-            if (rs != null) {
-
-                /*
-                 * Buffer data
-                 */
-                int nRead;
-                byte[] buffer = new byte[1024];
-                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
-
-                while (rs.next()) {
-                    SubscriptionEntry subscriptionEntry = new SubscriptionEntry();
-                    subscriptionEntry.setSubscriptionId(rs.getString("SubscriptionId"));
-
-                    /*
-                     * Read Binary Stream
-                     */
-                    InputStream inStream = null;
-
-                    try {
-                        inStream = rs.getBinaryStream("content");
-                        while ((nRead = inStream.read(buffer)) != -1) {
-                            outStream.write(buffer, 0, nRead);
-                        }
-                        outStream.flush();
-
-                        subscriptionEntry.setSubscribeXml(new String(outStream.toByteArray()));
-
-                    } catch (IOException ie) {
-                        logger.error("Unable to read XML from database", ie);
-
-                        // skip this subscription entry
-                        continue;
-                    } finally {
-                        // clear all data in outputStream
-                        outStream.reset();
-
-                        // close database stream
-                        if (inStream != null) {
-                            try {
-                                inStream.close();
-                            } catch (Exception e) {
-                                logger.error("Cannot close database stream", e);
-                            }
-                        }
-                    }
-
-                    ret.add(subscriptionEntry);
-
-                }
-            }
-        } catch (SQLException ex) {
-            logger.error("sql exception occured", ex);
-        } finally {
-            db.quietlyClose(conn, stmt);
-        }
-        return ret;
-    }
-
-    public int insert(SubscriptionState subscription) {
-        String address = subscription.getConsumerReference().getAddress();
-        Map<QName, OMElement> referenceParametersMap = subscription.getConsumerReference().getAllReferenceParameters();
-
-        String consumerReferenceParameters = null;
-        if (referenceParametersMap == null) {
-            consumerReferenceParameters = "";
-        } else {
-
-            StringBuffer buffer = new StringBuffer();
-
-            for (Iterator<OMElement> ite = referenceParametersMap.values().iterator(); ite.hasNext();) {
-                OMElement currentReferenceParameter = ite.next();
-
-                try {
-                    buffer.append(currentReferenceParameter.toStringWithConsume());
-                } catch (XMLStreamException se) {
-                    logger.error("unable to convert reference parameter", se);
-                }
-
-            }
-            consumerReferenceParameters = buffer.toString();
-        }
-
-        int policyValue = WsmgCommonConstants.WSRM_POLICY_FALSE;
-        if (subscription.isWsrmPolicy()) {
-            policyValue = WsmgCommonConstants.WSRM_POLICY_TRUE;
-        }
-
-        Timestamp now = new Timestamp(System.currentTimeMillis());
-
-        int result = 0;
-        Connection connection = null;
-        PreparedStatement stmt = null;
-        try {
-
-            connection = db.connect();
-            stmt = connection.prepareStatement(SubscriptionConstants.EXP_INSERT_SQL_QUERY);
-
-            stmt.setString(1, subscription.getId());
-            stmt.setBinaryStream(2, new ByteArrayInputStream(subscription.getSubscribeXml().getBytes()), subscription
-                    .getSubscribeXml().getBytes().length);
-            stmt.setInt(3, policyValue);
-            stmt.setString(4, subscription.getLocalTopic());
-            stmt.setString(5, subscription.getXpathString());
-            stmt.setString(6, address);
-            stmt.setBinaryStream(7, new ByteArrayInputStream(consumerReferenceParameters.getBytes()),
-                    consumerReferenceParameters.getBytes().length);
-            stmt.setTimestamp(8, now);
-            result = db.executeUpdateAndClose(stmt);
-            db.commitAndFree(connection);
-
-            storeToDBCounter.addCounter();
-
-        } catch (SQLException ex) {
-            logger.error("sql exception occured", ex);
-            db.rollbackAndFree(connection);
-        }
-        return result;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.wsmg.commons.storage.SubscriptionStorage#delete(java .lang.String)
-     */
-    public int delete(String subscriptionId) {
-        int result = 0;
-        Connection connection = null;
-        try {
-            connection = db.connect();
-            PreparedStatement stmt = connection.prepareStatement(SubscriptionConstants.EXP_DELETE_SQL_QUERY);
-            stmt.setString(1, subscriptionId);
-            result = db.executeUpdateAndClose(stmt);
-            db.commitAndFree(connection);
-        } catch (SQLException sql) {
-            db.rollbackAndFree(connection);
-            logger.error("sql exception occured", sql);
-        }
-        return result;
-    }
-
-    public void cleanup() {
-        Connection conn = null;
-        Statement stmt = null;
-        try {
-            conn = db.connect();
-            stmt = conn.createStatement();
-            batchCleanDB(stmt, conn);
-        } catch (SQLException e) {
-            logger.error(e.getMessage(), e);
-        } finally {
-            if (db.isAutoCommit()) {
-                try {
-                    conn.setAutoCommit(true);
-                } catch (SQLException e) {
-                    logger.error(e.getMessage(), e);
-                }
-            }
-            db.quietlyClose(conn, stmt);
-        }
-    }
-
-    public Object blockingDequeue() throws InterruptedException {
-        while (true) {
-            try {
-                return retrive();
-            } catch (SQLException e) {
-                logger.error(e.getMessage(), e);
-                e.printStackTrace();
-            } catch (IOException e) {
-                logger.error(e.getMessage(), e);
-                e.printStackTrace();
-            }
-        }
-    }
-
-    public void enqueue(Object object, String trackId) {
-
-        // Get the Max ID cache and update and unlock the table
-        Connection connection = null;
-        PreparedStatement stmt = null;
-        PreparedStatement stmt2 = null;
-        PreparedStatement stmt3 = null;
-        try {
-            int nextkey;
-
-            connection = db.connect();
-
-            lockMaxMinTables(connection);
-
-            stmt = connection.prepareStatement(QueueContants.SQL_MAX_ID_SEPERATE_TABLE);
-
-            ResultSet result = stmt.executeQuery();
-
-            if (result.next()) {
-                nextkey = result.getInt(1);
-
-                stmt2 = connection.prepareStatement(QueueContants.SQL_MAX_ID_INCREMENT + (nextkey));
-                stmt2.executeUpdate();
-            } else {
-                throw new RuntimeException("MAX_ID Table is not init, redeploy the service !!!");
-            }
-            
-            /**
-             * Before executing the SQL_INSERT_STATEMENT query, we need to unlock 
-             * MaxIDTable and MinIDTable since we are going to insert data to another 
-             * table, disQ. If we do not unlock tables, insert query fails in MySQL. But 
-             * in Derby, this will execute without any issues even without unlocking 
-             * tables. Since it fails with MySQL, we need to unlock the tables 
-             * before executing the insert query.
-             */
-            try{
-            	 unLockTables(connection);
-            }catch (SQLException sql) {
-                logger.error("Cannot Unlock Table", sql);
-            }
-           
-
-            /*
-             * After update MAX_ID put data into queue table
-             */
-            stmt3 = connection.prepareStatement(QueueContants.SQL_INSERT_STATEMENT);
-            stmt3.setInt(1, nextkey);
-            stmt3.setString(2, trackId);
-
-            ByteArrayOutputStream output = new ByteArrayOutputStream();
-            ObjectOutputStream out = new ObjectOutputStream(output);
-            out.writeObject(object);
-            byte[] buffer = output.toByteArray();
-            ByteArrayInputStream in = new ByteArrayInputStream(buffer);
-            stmt3.setBinaryStream(3, in, buffer.length);
-            stmt3.executeUpdate();
-            db.commit(connection);
-        } catch (SQLException sqlEx) {
-            db.rollback(connection);
-            logger.error("unable to enque the message in persistant storage", sqlEx);
-        } catch (IOException ioEx) {
-            db.rollback(connection);
-            logger.error("unable to enque the message in persistant storage", ioEx);
-        } finally {
-            try {
-                unLockTables(connection);
-            } catch (SQLException sql) {
-                logger.error("Cannot Unlock Table", sql);
-            }
-
-            db.quietlyClose(connection, stmt, stmt2, stmt3);
-        }
-    }
-
-    private void initMessageQueueStorage() throws SQLException {
-        Connection connection = null;
-        PreparedStatement stmt = null;
-        PreparedStatement stmt2 = null;
-        PreparedStatement stmt3 = null;
-        PreparedStatement stmt4 = null;
-        try {
-            connection = db.connect();
-
-            lockMaxMinTables(connection);
-
-            /*
-             * Get Max ID
-             */
-            stmt = connection.prepareStatement(QueueContants.SQL_MAX_ID_SEPERATE_TABLE);
-            ResultSet result = stmt.executeQuery();
-            if (!result.next()) {
-                stmt2 = connection.prepareStatement(QueueContants.SQL_MAX_ID_INSERT);
-                stmt2.executeUpdate();
-            }
-
-            /*
-             * Get Min ID
-             */
-            stmt3 = connection.prepareStatement(QueueContants.SQL_MIN_ID_SEPERATE_TABLE);
-            result = stmt3.executeQuery();
-            if (!result.next()) {
-                stmt4 = connection.prepareStatement(QueueContants.SQL_MIN_ID_INSERT);
-                stmt4.executeUpdate();
-            }
-            db.commit(connection);
-        } catch (SQLException sqle) {
-            db.rollback(connection);
-            throw sqle;
-        } finally {
-            try {
-                unLockTables(connection);
-            } catch (SQLException sql) {
-                logger.error("Cannot Unlock Table", sql);
-            }
-
-            db.quietlyClose(connection, stmt, stmt2, stmt3, stmt4);
-        }
-    }
-
-    private Object retrive() throws SQLException, IOException, InterruptedException {
-        long wait = 1000;
-        int nextkey = -1;
-        int maxid = -2;
-        Connection connection = null;
-        PreparedStatement stmt = null;
-        PreparedStatement stmt2 = null;
-        PreparedStatement stmt3 = null;
-        ResultSet result = null;
-        while (true) {
-            try {
-                connection = db.connect();
-
-                lockMaxMinTables(connection);
-
-                /*
-                 * Get Min ID
-                 */
-                stmt = connection.prepareStatement(QueueContants.SQL_MIN_ID_SEPERATE_TABLE);
-                result = stmt.executeQuery();
-                if (result.next()) {
-                    nextkey = result.getInt(1);
-                } else {
-                    throw new RuntimeException("Queue init has failed earlier");
-                }
-
-                /*
-                 * Get Max ID
-                 */
-                stmt2 = connection.prepareStatement(QueueContants.SQL_MAX_ID_SEPERATE_TABLE);
-                result = stmt2.executeQuery();
-                if (result.next()) {
-                    maxid = result.getInt(1);
-                } else {
-                    throw new RuntimeException("Queue init has failed earlier");
-                }
-
-                /*
-                 * Update value and exit the loop
-                 */
-                if (maxid > nextkey) {
-                    stmt3 = connection.prepareStatement(QueueContants.SQL_MIN_ID_INCREMENT + (nextkey));
-                    stmt3.executeUpdate();
-                    logger.debug("Update MIN ID by one");
-                    db.commit(connection);
-                    break;
-                }
-
-                db.commit(connection);
-            } catch (SQLException sql) {
-                db.rollback(connection);
-                throw sql;
-            } finally {
-                try {
-                    unLockTables(connection);
-                } catch (SQLException sql) {
-                    sql.printStackTrace();
-                    logger.error("Cannot Unlock Table", sql);
-                }
-
-                db.quietlyClose(connection, stmt, stmt2, stmt3);
-            }
-
-            /*
-             * Sleep if there is nothing to do
-             */
-            try {
-                wait = Math.min((wait + 1000), QueueContants.FINAL_WAIT_IN_MILI);
-                logger.debug("Wait=" + wait);
-                Thread.sleep(wait);
-            } catch (InterruptedException e) {
-                logger.warn("Queue is interrupted to close");
-                throw e;
-            }
-        }
-
-        /*
-         * Create Subscription Object from MIN_ID and delete data in table
-         */
-        Object resultObj = null;
-        int key = -1;
-        try {
-            connection = db.connect();
-            stmt = connection.prepareStatement(QueueContants.SQL_SELECT_STATEMENT + nextkey);
-            result = stmt.executeQuery();
-            if (result.next()) {
-                key = result.getInt(1);
-                InputStream in = result.getAsciiStream(2);
-                ObjectInputStream s = new ObjectInputStream(in);
-                try {
-                    resultObj = s.readObject();
-                } catch (ClassNotFoundException e) {
-                    logger.error("Cannot Deserialize Object from Database, ClassNotFound. ", e);
-                }
-            } else {
-                throw new RuntimeException(
-                        "MAX_ID and MIN_ID are inconsistent with subscription table, need to reset all data value");
-            }
-
-            try {
-                String query = QueueContants.SQL_DELETE_STATEMENT + key;
-                stmt2 = connection.prepareStatement(query);
-                stmt2.executeUpdate();
-                db.commit(connection);
-            } catch (SQLException sqle) {
-                db.rollback(connection);
-                throw sqle;
-            }
-        } finally {
-            db.quietlyClose(connection, stmt, stmt2);
-        }
-        return resultObj;
-    }
-
-    private void batchCleanDB(Statement stmt, Connection con) throws SQLException {
-        DatabaseType databaseType = DatabaseType.other;
-        int[] aiupdateCounts = new int[0];
-        boolean bError = false;
-        try {
-
-            con.setAutoCommit(false);
-
-            stmt.clearBatch();
-
-            int totalStatement = 0;
-
-            try {
-                databaseType = DatabaseCreator.getDatabaseType(con);
-            } catch (Exception e) {
-                logger.error("Error evaluating database type", e);
-            }
-            // add SQL statements
-            if (DatabaseType.mysql.equals(databaseType)) {
-                stmt.addBatch("lock tables disQ write, MaxIDTable write, MinIDTable write;");
-                totalStatement++;
-            } else if (DatabaseType.derby.equals(databaseType)) {
-                stmt.addBatch("lock table disQ in exclusive mode;");
-                totalStatement++;
-                stmt.addBatch("lock table MaxIDTable in exclusive mode;");
-                totalStatement++;
-                stmt.addBatch("lock table MinIDTable in exclusive mode;");
-                totalStatement++;
-            }
-            stmt.addBatch("Delete from disQ;");
-            totalStatement++;
-            stmt.addBatch("Delete from MaxIDTable;");
-            totalStatement++;
-            stmt.addBatch("Delete from MinIDTable;");
-            totalStatement++;
-
-            aiupdateCounts = new int[totalStatement];
-
-            // execute the statements
-            aiupdateCounts = stmt.executeBatch();
-
-        } catch (BatchUpdateException bue) {
-            bError = true;
-            aiupdateCounts = bue.getUpdateCounts();
-            logger.error("SQLException: " + bue.getMessage());
-            logger.error("SQLState:  " + bue.getSQLState());
-            logger.error("Message:  " + bue.getMessage());
-            logger.error("Vendor:  " + bue.getErrorCode());
-            logger.info("Update counts:  ");
-
-            for (int i = 0; i < aiupdateCounts.length; i++) {
-                logger.error(aiupdateCounts[i] + "   ");
-            }
-
-            SQLException SQLe = bue;
-            while (SQLe != null) {
-                SQLe = SQLe.getNextException();
-                logger.error(SQLe.getMessage(), SQLe);
-            }
-        } catch (SQLException SQLe) {
-            bError = true;
-            throw SQLe;
-        } finally {
-            // determine operation result
-            for (int i = 0; !bError && i < aiupdateCounts.length; i++) {
-                int iProcessed = aiupdateCounts[i];
-                /**
-                 * The int values that can be returned in the update counts array are: <br/>
-                 * -3--Operation error. A driver has the option to stop at the first error and throw a
-                 * BatchUpdateException or to report the error and continue. This value is only seen in the latter case. <br/>
-                 * -2--The operation was successful, but the number of rows affected is unknown. <br/>
-                 * Zero--DDL statement or no rows affected by the operation. Greater than zero--Operation was
-                 * successful, number of rows affected by the operation.
-                 */
-                if (iProcessed < 0 && iProcessed != -2) {
-                    // error on statement
-                    logger.info("Error batch." + iProcessed);
-                    bError = true;
-                }
-            }
-
-            if (bError) {
-                con.rollback();
-            } else {
-                con.commit();
-            }
-
-            /*
-             * Unlock table after rollback and commit, since it is not automatic in MySql
-             */
-
-            if (DatabaseType.mysql.equals(databaseType)) {
-                PreparedStatement prepareStmt = con.prepareCall("unlock tables;");
-                db.executeUpdateAndClose(prepareStmt);
-            }
-        } // end finally
-        logger.info("Queue is cleaned.");
-    }
-
-    private void lockMaxMinTables(Connection connection) throws SQLException {
-        DatabaseType databaseType = DatabaseType.other;
-        try {
-            databaseType = DatabaseCreator.getDatabaseType(connection);
-        } catch (Exception e) {
-            logger.error("Error evaluating database type", e);
-        }
-
-        /*
-         * Must turn off auto commit
-         */
-        connection.setAutoCommit(false);
-        String sql = null;
-        Statement stmt = null;
-        try {
-            switch (databaseType) {
-            case derby:
-                sql = "LOCK TABLE " + QueueContants.TABLE_NAME_MAXID + " IN EXCLUSIVE MODE";
-                String sql2 = "LOCK TABLE " + QueueContants.TABLE_NAME_MINID + " IN EXCLUSIVE MODE";
-                stmt = connection.createStatement();
-                stmt.addBatch(sql);
-                stmt.addBatch(sql2);
-                stmt.executeBatch();
-                break;
-            case mysql:
-                sql = "lock tables " + QueueContants.TABLE_NAME_MAXID + " write" + "," + QueueContants.TABLE_NAME_MINID
-                        + " write";
-                stmt = connection.createStatement();
-                stmt.executeQuery(sql);
-                break;
-            default:
-                return;
-            }
-
-        } finally {
-            if (stmt != null && !stmt.isClosed()) {
-                stmt.close();
-            }
-        }
-    }
-
-    private void unLockTables(Connection connection) throws SQLException {
-        DatabaseType databaseType = DatabaseType.other;
-        try {
-            databaseType = DatabaseCreator.getDatabaseType(connection);
-        } catch (Exception e) {
-            logger.error("Error evaluating database type", e);
-        }
-
-        try {
-            switch (databaseType) {
-            case derby:
-                /*
-                 * Derby doesn't have explicit unlock SQL It uses commit or rollback as a unlock mechanism, so make sure
-                 * that connection is always commited or rollbacked
-                 */
-                break;
-            case mysql:
-                String sql = "unlock tables";
-                PreparedStatement stmt = null;
-                try {
-                    stmt = connection.prepareStatement(sql);
-                    stmt.executeQuery();
-                    db.commit(connection);
-                } finally {
-                    if (stmt != null) {
-                        stmt.close();
-                    }
-                }
-                break;
-            default:
-                return;
-            }
-        } finally {
-            /*
-             * Set auto commit when needed
-             */
-            if (db.isAutoCommit()) {
-                connection.setAutoCommit(true);
-            }
-        }
-    }
-
-    private static class SubscriptionConstants {
-
-        public static final String TABLE_NAME_EXPIRABLE_SUBCRIPTIONS = "subscription";
-
-        public static final String TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS = "specialSubscription";
-
-        public static final String EXP_INSERT_SQL_QUERY = "INSERT INTO " + TABLE_NAME_EXPIRABLE_SUBCRIPTIONS
-                + "(SubscriptionId, content, wsrm, Topics, XPath, ConsumerAddress, ReferenceProperties, CreationTime) "
-                + "VALUES( ? , ? , ? , ? , ? , ? , ? , ?)";
-
-        public static final String EXP_DELETE_SQL_QUERY = "DELETE FROM " + TABLE_NAME_EXPIRABLE_SUBCRIPTIONS
-                + " WHERE SubscriptionId= ?";
-
-        public static final String EXP_SELECT_QUERY = "SELECT * FROM " + TABLE_NAME_EXPIRABLE_SUBCRIPTIONS;
-
-        public static final String NONEXP_INSERT_SQL_QUERY = "INSERT INTO " + TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS
-                + "(SubscriptionId, content, wsrm, Topics, XPath, ConsumerAddress, ReferenceProperties, CreationTime) "
-                + "VALUES( ? , ? , ? , ? , ? , ? , ? , ?)";
-
-        public static final String NONEXP_DELETE_SQL_QUERY = "DELETE FROM " + TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS
-                + " WHERE SubscriptionId= ?";
-
-        public static final String NONEXP_SELECT_QUERY = "SELECT * FROM " + TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS;
-    }
-
-    private static class QueueContants {
-        public static final int FINAL_WAIT_IN_MILI = 5000;
-
-        public static final String TABLE_NAME = "disQ";
-
-        public static final String TABLE_NAME_MAXID = "MaxIDTable";
-
-        public static final String TABLE_NAME_MINID = "MinIDTable";
-
-        public static final int STATUS_OPEN = 0;
-
-        public static final String SQL_INSERT_STATEMENT = "INSERT INTO " + TABLE_NAME
-                + " (id, trackId, message, status) " + "VALUES (?,?,?," + STATUS_OPEN + ")";
-
-        public static String SQL_DELETE_STATEMENT = "DELETE FROM " + TABLE_NAME + " WHERE id=";
-
-        public static String SQL_SELECT_STATEMENT = "SELECT id,message FROM " + TABLE_NAME + " WHERE id=";
-
-        public static String SQL_MAX_ID_SEPERATE_TABLE = "SELECT maxID FROM " + TABLE_NAME_MAXID;
-
-        public static String SQL_MIN_ID_SEPERATE_TABLE = "SELECT minID FROM " + TABLE_NAME_MINID;
-
-        public static String SQL_MAX_ID_INSERT = "INSERT INTO " + TABLE_NAME_MAXID + " (maxID) VALUES (1)";
-
-        public static String SQL_MIN_ID_INSERT = "INSERT INTO " + TABLE_NAME_MINID + " (minID) VALUES (1)";
-
-        public static String SQL_MAX_ID_INCREMENT = "UPDATE " + TABLE_NAME_MAXID + " SET maxID = maxID+1 WHERE maxID =";
-
-        public static String SQL_MIN_ID_INCREMENT = "UPDATE " + TABLE_NAME_MINID + " SET minID = minID+1 WHERE minID =";
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgQueue.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgQueue.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgQueue.java
deleted file mode 100644
index 5430b33..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgQueue.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.commons.storage;
-
-public interface WsmgQueue {
-
-    void cleanup();
-
-    void enqueue(Object object, String trackId);
-
-    Object blockingDequeue() throws InterruptedException;
-
-    void dispose();
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgStorage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgStorage.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgStorage.java
deleted file mode 100644
index 2a1d1cb..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgStorage.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.commons.storage;
-
-import java.util.List;
-
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionEntry;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-
-public interface WsmgStorage {
-
-    List<SubscriptionEntry> getAllSubscription();
-
-    int insert(SubscriptionState subscription);
-
-    int delete(String subscriptionId);
-
-    void dispose();
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/util/OMElementComparator.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/util/OMElementComparator.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/util/OMElementComparator.java
deleted file mode 100644
index d3be422..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/util/OMElementComparator.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.commons.util;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.wsmg.util.BrokerUtil;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMNamespace;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Compare two OMElement with its namespace, attributes, children, and text. Current implementation supports ignore
- * namespace checking i.e. if the namespace is in the list, it is skipped and return as equals.
- */
-public class OMElementComparator {
-
-    private static final Logger log = LoggerFactory.getLogger(OMElementComparator.class);
-
-    private static List<String> ignorableNamespaceList = new ArrayList<String>();
-
-    private OMElementComparator() {
-    }
-
-    public void addIgnorableNamespace(String nsURI) {
-        ignorableNamespaceList.add(nsURI);
-    }
-
-    public void clearIgnorableNamespaces() {
-        ignorableNamespaceList.clear();
-    }
-
-    public static boolean compare(OMElement elementOne, OMElement elementTwo) {
-
-        if (isIgnorable(elementOne) || isIgnorable(elementTwo)) {
-            // ignore if the elements belong to any of the ignorable namespaces
-            // list
-            return true;
-        } else if (elementOne == null && elementTwo == null) {
-            log.debug("Both Elements are null.");
-            return true;
-        } else if (elementOne == null || elementTwo == null) {
-            log.debug("One of item to compare is null");
-            return false;
-        }
-
-        return BrokerUtil.sameStringValue(elementOne.getLocalName(), elementTwo.getLocalName())
-                && compare(elementOne.getNamespace(), elementTwo.getNamespace())
-                && compareAttibutes(elementOne, elementTwo)
-                /*
-                 * Trimming the value of the XMLElement is not correct since this compare method cannot be used to
-                 * compare element contents with trailing and leading whitespaces BUT for the practical side of tests
-                 * and to get the current tests working we have to trim() the contents
-                 */
-                && BrokerUtil.sameStringValue(elementOne.getText().trim(), elementTwo.getText().trim())
-                && compareChildren(elementOne, elementTwo);
-    }
-
-    private static boolean isIgnorable(OMElement elt) {
-        if (elt != null) {
-            OMNamespace namespace = elt.getNamespace();
-            if (namespace != null) {
-                return ignorableNamespaceList.contains(namespace.getNamespaceURI());
-            } else {
-                return false;
-            }
-        } else {
-            return false;
-        }
-    }
-
-    private static boolean compareChildren(OMElement elementOne, OMElement elementTwo) {
-        HashMap<QName, OMElement> map = new HashMap<QName, OMElement>();
-        Iterator oneIter = elementOne.getChildElements();
-        while (oneIter.hasNext()) {
-            OMElement elementOneChild = (OMElement) oneIter.next();
-            OMElement elementTwoChild = elementTwo.getFirstChildWithName(elementOneChild.getQName());
-            if (!compare(elementOneChild, elementTwoChild)) {
-                return false;
-            }
-
-            /*
-             * Cache for later access
-             */
-            map.put(elementOneChild.getQName(), elementOneChild);
-        }
-
-        /*
-         * Case the second element has more elements than the first
-         */
-        Iterator twoIter = elementTwo.getChildElements();
-        while (twoIter.hasNext()) {
-            OMElement elementTwoChild = (OMElement) twoIter.next();
-            if (!isIgnorable(elementTwoChild) && !map.containsKey(elementTwoChild.getQName())) {
-                return false;
-            }
-        }
-
-        return true;
-    }
-
-    private static boolean compareAttibutes(OMElement elementOne, OMElement elementTwo) {
-        int elementOneAtribCount = 0;
-        int elementTwoAtribCount = 0;
-        Iterator oneIter = elementOne.getAllAttributes();
-        while (oneIter.hasNext()) {
-
-            /*
-             * This catches a case where the first one has more items than the second one (one.attributes.size >
-             * two.attributes.size) and a case where the first and the second have a different attributes.
-             * (one.attributes.size == two.attributes.size)
-             */
-            OMAttribute omAttribute = (OMAttribute) oneIter.next();
-            OMAttribute attr = elementTwo.getAttribute(omAttribute.getQName());
-            if (attr == null) {
-                log.debug("Attribute " + omAttribute + " is not found in both elements.");
-                return false;
-            }
-            /*
-             * Count attributes in the first item
-             */
-            elementOneAtribCount++;
-        }
-
-        /*
-         * Count attributes in the second item
-         */
-        Iterator elementTwoIter = elementTwo.getAllAttributes();
-        while (elementTwoIter.hasNext()) {
-            elementTwoIter.next();
-            elementTwoAtribCount++;
-        }
-
-        /*
-         * This catches a case where the second one has more items than the first one. (two.attributes.size >
-         * one.attributes.size)
-         */
-        log.debug("Number of Attributes are equal? : " + (elementOneAtribCount == elementTwoAtribCount));
-        return elementOneAtribCount == elementTwoAtribCount;
-    }
-
-    /*
-     * Compare only URI not prefix
-     */
-    private static boolean compare(OMNamespace x, OMNamespace y) {
-        log.debug("Compare namespace:" + x + " with " + y);
-        return (x == null && y == null)
-                || (x != null && y != null && BrokerUtil.sameStringValue(x.getNamespaceURI(), y.getNamespaceURI()));
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WSMGParameter.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WSMGParameter.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WSMGParameter.java
deleted file mode 100644
index 06d435a..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WSMGParameter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.config;
-
-import org.apache.airavata.wsmg.commons.storage.WsmgQueue;
-
-public class WSMGParameter {
-
-    /**
-     * Global variable for the Out Going queue (contains message to send to subscribers)
-     */
-    public static WsmgQueue OUT_GOING_QUEUE = null; // default=null
-
-    public static final boolean testOutGoingQueueMaxiumLength = false; // default=false
-
-    // enable or disable the TimerThread that displays the message rate
-    public static final boolean measureMessageRate = false; // default=false
-
-    public static final boolean enableAutoCleanSubscriptions = false; // default=true
-
-    public static final boolean debugYFilter = false;
-
-    public static final boolean cleanQueueonStartUp = false; // default=true
-    public static final boolean requireSubscriptionRenew = true;
-    public static final long expirationTime = 1000 * 60 * 60 * 72; // 72 hours
-
-    public static final boolean showTrackId = false;
-    public static final String versionSetUpNote = "Added_Sub_Timeout";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WsmgConfigurationContext.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WsmgConfigurationContext.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WsmgConfigurationContext.java
deleted file mode 100644
index c12f460..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WsmgConfigurationContext.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.config;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-
-import org.apache.airavata.wsmg.broker.NotificationProcessor;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionManager;
-import org.apache.airavata.wsmg.commons.config.ConfigurationManager;
-import org.apache.airavata.wsmg.commons.storage.WsmgQueue;
-import org.apache.airavata.wsmg.commons.storage.WsmgStorage;
-import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
-import org.apache.airavata.wsmg.matching.XPath.YFilterMessageMatcher;
-import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-
-public class WsmgConfigurationContext {
-
-    private OutGoingQueue outgoingQueue = null;
-
-    private List<AbstractMessageMatcher> messageMatchers = new LinkedList<AbstractMessageMatcher>();
-
-    private ReentrantReadWriteLock messegeMatchersLock = new ReentrantReadWriteLock();
-
-    private ConfigurationManager configurationManager;
-
-    private SubscriptionManager subscriptionMan;
-
-    private NotificationProcessor notificationProcessor;
-
-    private WsmgStorage storage;
-
-    private WsmgQueue queue;
-
-    public WsmgConfigurationContext() {
-        outgoingQueue = new OutGoingQueue();
-        setDirectFilter();
-    }
-
-    private void setDirectFilter() {
-        messageMatchers.add(new YFilterMessageMatcher());
-        // messageMatchers.add(new DirectWsntMessageMatcher(subscriptions,
-        // publisherRegistrationDB));
-    }
-
-    public List<AbstractMessageMatcher> getMessageMatchers() {
-        return messageMatchers;
-    }
-
-    public OutGoingQueue getOutgoingQueue() {
-        return outgoingQueue;
-    }
-
-    public ConfigurationManager getConfigurationManager() {
-        return configurationManager;
-    }
-
-    public SubscriptionManager getSubscriptionManager() {
-        return subscriptionMan;
-    }
-
-    public NotificationProcessor getNotificationProcessor() {
-        return notificationProcessor;
-    }
-
-    public void setConfigurationManager(ConfigurationManager configMan) {
-        this.configurationManager = configMan;
-    }
-
-    public void setSubscriptionManager(SubscriptionManager subMan) {
-        this.subscriptionMan = subMan;
-    }
-
-    public void setNotificationProcessor(NotificationProcessor processor) {
-        this.notificationProcessor = processor;
-    }
-
-    public WsmgStorage getStorage() {
-        return storage;
-    }
-
-    public void setStorage(WsmgStorage s) {
-        storage = s;
-    }
-
-    public WsmgQueue getQueue() {
-        return queue;
-    }
-
-    public void setQueue(WsmgQueue s) {
-        queue = s;
-    }
-
-    public ReentrantReadWriteLock getMessegeMatcherLock() {
-        return messegeMatchersLock;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/AbstractMessageMatcher.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/AbstractMessageMatcher.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/AbstractMessageMatcher.java
deleted file mode 100644
index dbd16f6..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/AbstractMessageMatcher.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.matching;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
-import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-
-public abstract class AbstractMessageMatcher {
-
-    protected Map<String, String> currentMessageCache;
-
-    private ReentrantReadWriteLock consumerListLock = new ReentrantReadWriteLock();
-
-    // infer types of
-    // key and value
-    public AbstractMessageMatcher() {
-        this.currentMessageCache = new HashMap<String, String>();
-    }
-
-    public abstract void start(String carrierLocation);
-
-    // Message can be either String or XmlElement. Added XMLElement for
-    // performance consideration so that if not using queue,
-    // we don't need to serialize to String
-    // If we already serialized to String because of the using queue, we don't
-    // have to change back to XMLElement until the delivery to consumers
-
-    public abstract void populateMatches(String wsntMessageConverterClassName,
-            AdditionalMessageContent additionalMessageContent, String message, String topic,
-            List<ConsumerInfo> matchedConsumers);
-
-    public abstract int handleUnsubscribe(String subscriptionId);
-
-    public abstract void handleSubscribe(SubscriptionState subscribeRequest, String subscriptionId);
-
-    public String handleGetCurrentMessage(String topic) {
-        String currentMessage = currentMessageCache.get(topic);
-        return currentMessage;
-    }
-
-    public void readLockUnlockConsumers(boolean lock) {
-        ReadLock readlock = consumerListLock.readLock();
-        lockUnlock(readlock, lock);
-    }
-
-    public void writeLockUnlockConsumers(boolean lock) {
-        WriteLock writeLock = consumerListLock.writeLock();
-        lockUnlock(writeLock, lock);
-    }
-
-    private void lockUnlock(Lock l, boolean lock) {
-
-        if (lock) {
-            l.lock();
-        } else {
-            l.unlock();
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterInfo.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterInfo.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterInfo.java
deleted file mode 100644
index 1881968..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterInfo.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.matching.XPath;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.broker.ConsumerList;
-import org.apache.airavata.wsmg.broker.ConsumerListManager;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import edu.berkeley.cs.db.yfilter.filter.EXfilterBasic;
-import edu.berkeley.cs.db.yfilter.filter.SystemGlobals;
-import edu.berkeley.cs.db.yfilterplus.queryparser.Query;
-import edu.berkeley.cs.db.yfilterplus.queryparser.XPQuery;
-import edu.berkeley.cs.db.yfilterplus.xmltree.XMLTree;
-
-public class YFilterInfo {
-    private static final Logger logger = LoggerFactory.getLogger(YFilterInfo.class);
-
-    private EXfilterBasic yfilter = new EXfilterBasic();
-    private HashMap<Integer, String> yFilterIdToXPath = new HashMap<Integer, String>();
-    private HashMap<Integer, Query> yFilterIdToQuery = new HashMap<Integer, Query>();
-    private HashMap<String, Integer> xPathToYFilterId = new HashMap<String, Integer>();
-    private ConsumerListManager consumerListmanager = new ConsumerListManager();
-    private int index = 0;
-    private int counter = 0;
-
-    public EXfilterBasic getYfilter() {
-        return yfilter;
-    }
-
-    public void setYfilter(EXfilterBasic yfilter) {
-        this.yfilter = yfilter;
-    }
-
-    public HashMap<Integer, String> getYFilterIdToXPath() {
-        return yFilterIdToXPath;
-    }
-
-    public void setYFilterIdToXPath(HashMap<Integer, String> filterIdToXPath) {
-        yFilterIdToXPath = filterIdToXPath;
-    }
-
-    public void addXPathQuery(String xpathExpression, String subscriptionId, SubscriptionState subscribeRequest)
-            throws RuntimeException {
-        index++;
-        counter++;
-        if (WSMGParameter.debugYFilter)
-            logger.debug("QueryExp=" + xpathExpression);
-
-        Integer yFilterIdObj = xPathToYFilterId.get(xpathExpression);
-        int yFilterId = -1;
-        if (yFilterIdObj != null) {
-            yFilterId = yFilterIdObj.intValue();
-        } else {
-            Query query = XPQuery.parseQuery(xpathExpression, index);
-            if (query == null) {
-                throw new RuntimeException("Invalid XPath expression:" + xpathExpression);
-            }
-            if (WSMGParameter.debugYFilter)
-                logger.debug("addSubscription " + xpathExpression + " query :" + query);
-            yFilterId = yfilter.addQuery(query);
-            if (WSMGParameter.debugYFilter)
-                yfilter.printQueryIndex();
-            xPathToYFilterId.put(xpathExpression, Integer.valueOf(yFilterId));
-            yFilterIdToXPath.put(new Integer(yFilterId), xpathExpression);
-            yFilterIdToQuery.put(yFilterId, query);
-        }
-        if (WSMGParameter.debugYFilter)
-            logger.debug("YFilterId=" + yFilterId);
-
-        consumerListmanager.addToConsumerList(xpathExpression, subscribeRequest, subscriptionId);
-    }
-
-    public int removeSubscription(String subscriptionId) {
-
-        String xPath = consumerListmanager.getTokenBySubscriptionId(subscriptionId);
-        int result = consumerListmanager.removeFromConsumerList(subscriptionId, xPath);
-        if (result == 0) {
-            return 0;
-        }
-        int currentConsumerCount = consumerListmanager.getConsumerListByToken(xPath).size();
-        if (currentConsumerCount == 0) {
-            Integer yFilterId = xPathToYFilterId.get(xPath);
-            Query q = yFilterIdToQuery.get(yFilterId);
-            yfilter.deleteQuery(q, q.getQueryId());
-            yFilterIdToQuery.remove(yFilterId);
-        }
-        counter--;
-        return result;
-    }
-
-    public List<ConsumerInfo> getMatchingConsumerList(String messageString) {
-        List<ConsumerInfo> matchingConsumerList = new LinkedList<ConsumerInfo>();
-        XMLTree tree = new XMLTree(new java.io.StringReader(messageString));
-        if (WSMGParameter.debugYFilter)
-            tree.print();
-        yfilter.setEventSequence(tree.getEvents());
-        yfilter.startParsing();
-
-        // print the matched queries //
-        if (SystemGlobals.hasQueries) {
-            if (WSMGParameter.debugYFilter)
-
-                yfilter.printQueryResults(System.out);
-        } else {
-            System.out.println("no match");
-            return matchingConsumerList;
-        }
-
-        Iterator<Integer> it = (Iterator<Integer>) yfilter.getMatchedQueries().iterator();
-        while (it.hasNext()) {
-            Integer qid = it.next();
-
-            String xpath = yFilterIdToXPath.get(qid);
-            ConsumerList consumerList = consumerListmanager.getConsumerListByToken(xpath);
-
-            if (consumerList != null) {// has subscription to this topic
-                matchingConsumerList.addAll(consumerList.getConsumerList());
-            }
-        }
-        yfilter.clear();
-        return matchingConsumerList;
-    }
-
-    public int getCounter() {
-        return counter;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterMessageMatcher.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterMessageMatcher.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterMessageMatcher.java
deleted file mode 100644
index 0f59ec1..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterMessageMatcher.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.matching.XPath;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.broker.ConsumerList;
-import org.apache.airavata.wsmg.broker.ConsumerListManager;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
-import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class YFilterMessageMatcher extends AbstractMessageMatcher {
-
-    private static final Logger logger = LoggerFactory.getLogger(YFilterMessageMatcher.class);
-
-    private OutGoingQueue outGoingQueue = null;
-
-    private HashMap<String, YFilterInfo> topicToYFilterInfo = new HashMap<String, YFilterInfo>();
-    private HashMap<String, String> subIdToTopic = new HashMap<String, String>();
-
-    // used for topic only subscription, so that we don't have to create a
-    // YFilter object
-    private ConsumerListManager consumerListmanager = new ConsumerListManager();
-
-    public YFilterMessageMatcher() {
-        super();
-    }
-
-    public void start(String carrierLocation) {
-        currentMessageCache = new Hashtable<String, String>();
-    }
-
-    @Override
-    public void populateMatches(String wsntMessageConverterClassName,
-            AdditionalMessageContent additionalMessageContent, String message, String topic,
-            List<ConsumerInfo> matchedConsumers) {
-
-        assert (matchedConsumers != null);
-
-        if (WSMGParameter.debugYFilter)
-            logger.info("Message In YFilterAdapter=" + message);
-
-        // Important Get a Read Lock....
-        readLockUnlockConsumers(true);
-        try {
-
-            // 1, Topic only
-            ConsumerList topicConsumerList = consumerListmanager.getConsumerListByToken(topic);
-            if (topicConsumerList != null) {// has subscription to this topic
-
-                ArrayList<ConsumerInfo> list = topicConsumerList.getConsumerList();
-                matchedConsumers.addAll(list);
-            }
-            // 2, wild card topic only
-            ConsumerList wildcardConsumerList = consumerListmanager
-                    .getConsumerListByToken(WsmgCommonConstants.WILDCARD_TOPIC);
-            if (wildcardConsumerList != null) {// has wildcard subscriptions
-                List<ConsumerInfo> wildCardConsumerInfoList = wildcardConsumerList.getConsumerList();
-                if (wildCardConsumerInfoList != null) {
-                    // System.out.println("ConsumerListSize2="+wildCardConsumerInfoList.size());
-                    matchedConsumers.addAll(wildCardConsumerInfoList);
-                }
-            }
-            // 3, topic with Xpath
-            YFilterInfo yfilterInfo = topicToYFilterInfo.get(topic);
-            if (yfilterInfo != null) {
-                List<ConsumerInfo> topicAndXPathConsumerInfoList = yfilterInfo.getMatchingConsumerList(message);
-                if (topicAndXPathConsumerInfoList != null) {
-                    // System.out.println("ConsumerListSize3="+topicAndXPathConsumerInfoList.size());
-                    matchedConsumers.addAll(topicAndXPathConsumerInfoList);
-                }
-            }
-            // 4, wild card topic with Xpath (XPath only)
-            yfilterInfo = topicToYFilterInfo.get(WsmgCommonConstants.WILDCARD_TOPIC);
-            if (yfilterInfo != null) {
-                List<ConsumerInfo> wildcardTopicAndXPathConsumerInfoList = yfilterInfo.getMatchingConsumerList(message);
-                if (wildcardTopicAndXPathConsumerInfoList != null) {
-                    // System.out.println("ConsumerListSize4="+wildcardTopicAndXPathConsumerInfoList.size());
-                    matchedConsumers.addAll(wildcardTopicAndXPathConsumerInfoList);
-                }
-            }
-
-        } finally {
-
-            // Release the Read Lock...
-            readLockUnlockConsumers(false);
-        }
-
-    }
-
-    public int handleUnsubscribe(String subscriptionId) {
-
-        int ret = 1;
-
-        writeLockUnlockConsumers(true);
-        try {
-            String topicExpression = subIdToTopic.get(subscriptionId);
-            if (subscriptionId.startsWith("T")) { // Topic only
-                consumerListmanager.removeFromConsumerList(subscriptionId, topicExpression);
-            } else {
-                YFilterInfo yfilterInfo = topicToYFilterInfo.get(topicExpression);
-                if (yfilterInfo != null) {
-                    yfilterInfo.removeSubscription(subscriptionId);
-                    if (yfilterInfo.getCounter() == 0) {
-                        yfilterInfo = null;
-                        topicToYFilterInfo.remove(topicExpression);
-                    }
-                } else {
-                    System.out.println("ERROR: Cannot find subscription with the subId=" + subscriptionId);
-                    ret = 0;
-                }
-            }
-        } finally {
-            writeLockUnlockConsumers(false);
-        }
-
-        return ret;
-    }
-
-    public void handleSubscribe(SubscriptionState subscribeRequest, String subscriptionId) {
-
-        // Get the write lock
-        writeLockUnlockConsumers(true);
-        try {
-
-            String topicExpression = subscribeRequest.getLocalTopic();
-            subIdToTopic.put(subscriptionId, topicExpression);
-
-            String xpathExpression = subscribeRequest.getXpathString();
-            if (xpathExpression == null || xpathExpression.length() == 0) { // Topic
-                // only
-                consumerListmanager.addToConsumerList(topicExpression, subscribeRequest, subscriptionId);
-            } else {
-                YFilterInfo yfilterInfo = topicToYFilterInfo.get(topicExpression);
-                if (yfilterInfo == null) {
-                    yfilterInfo = new YFilterInfo();
-                    topicToYFilterInfo.put(topicExpression, yfilterInfo);
-                }
-                yfilterInfo.addXPathQuery(xpathExpression, subscriptionId, subscribeRequest);
-            }
-
-            if (outGoingQueue == null) {
-                outGoingQueue = subscribeRequest.getOutGoingQueue();
-            }
-
-        } finally {
-            // release the write lock
-            writeLockUnlockConsumers(false);
-        }
-
-        return;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/simpleTopic/DirectWsntMessageMatcher.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/simpleTopic/DirectWsntMessageMatcher.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/simpleTopic/DirectWsntMessageMatcher.java
deleted file mode 100644
index ba50e45..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/simpleTopic/DirectWsntMessageMatcher.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.matching.simpleTopic;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.broker.ConsumerList;
-import org.apache.airavata.wsmg.broker.ConsumerListManager;
-import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
-import org.apache.airavata.wsmg.messenger.OutGoingQueue;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DirectWsntMessageMatcher extends AbstractMessageMatcher {
-
-    private static final Logger logger = LoggerFactory.getLogger(DirectWsntMessageMatcher.class);
-
-    private ConsumerListManager consumerListmanager = new ConsumerListManager();
-
-    private OutGoingQueue outGoingQueue = null;
-
-    public DirectWsntMessageMatcher() {
-        super();
-    }
-
-    public void start(String carrierLocation) {
-        currentMessageCache = new Hashtable<String, String>();
-    }
-
-    public void handleSubscribe(SubscriptionState subscribeRequest, String subscriptionId) {
-
-        String topicExpression = subscribeRequest.getLocalTopic();
-        if (topicExpression == null || topicExpression.length() == 0) {
-            logger.error("ERROR:WsntAdapterConnection creation failed.");
-            return;
-        }
-
-        writeLockUnlockConsumers(true);
-
-        try {
-            consumerListmanager.addToConsumerList(topicExpression, subscribeRequest, subscriptionId);
-            if (outGoingQueue == null) {
-                outGoingQueue = subscribeRequest.getOutGoingQueue();
-            }
-        } finally {
-            writeLockUnlockConsumers(false);
-        }
-
-        return;
-
-    }
-
-    public int handleUnsubscribe(String subscriptionId) {
-
-        int ret = 0;
-
-        writeLockUnlockConsumers(true);
-        try {
-            ret = consumerListmanager.removeFromConsumerList(subscriptionId, null);
-        } finally {
-            writeLockUnlockConsumers(false);
-        }
-
-        return ret;
-    }
-
-    @Override
-    public void populateMatches(String wsntMessageConverterClassName,
-            AdditionalMessageContent additionalMessageContent, String message, String topic,
-            List<ConsumerInfo> matchedConsumers) {
-
-        assert (matchedConsumers != null);
-
-        readLockUnlockConsumers(true);
-
-        try {
-
-            ConsumerList topicConsumerList = consumerListmanager.getConsumerListByToken(topic);
-            ConsumerList wildcardConsumerList = consumerListmanager
-                    .getConsumerListByToken(WsmgCommonConstants.WILDCARD_TOPIC);
-            if (topicConsumerList != null) {// has subscription to this topic
-
-                ArrayList<ConsumerInfo> list = topicConsumerList.getConsumerList();
-
-                matchedConsumers.addAll(list);
-            }
-            if (wildcardConsumerList != null) {// has wildcard subscriptions
-                List<ConsumerInfo> wildCardConsumerInfoList = wildcardConsumerList.getConsumerList();
-                if (wildCardConsumerInfoList != null) {
-                    matchedConsumers.addAll(wildCardConsumerInfoList);
-                }
-            }
-
-        } finally {
-            readLockUnlockConsumers(false);
-        }
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/ConsumerUrlManager.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/ConsumerUrlManager.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/ConsumerUrlManager.java
deleted file mode 100644
index c9b255f..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/ConsumerUrlManager.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger;
-
-import java.net.NoRouteToHostException;
-import java.net.SocketTimeoutException;
-import java.util.Map.Entry;
-import java.util.Timer;
-import java.util.TimerTask;
-import java.util.concurrent.ConcurrentHashMap;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.airavata.wsmg.commons.config.ConfigurationManager;
-import org.apache.airavata.wsmg.util.RunTimeStatistics;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ConsumerUrlManager {
-
-    private static final Logger logger = LoggerFactory.getLogger(ConsumerUrlManager.class);
-
-    private ConcurrentHashMap<String, FailedConsumerInfo> failedConsumerUrls = new ConcurrentHashMap<String, FailedConsumerInfo>();
-
-    private final int defaultMaxRetry;
-
-    private long expireTimeGap; // milliseconds
-
-    private Timer cleanupTimer;
-
-    public ConsumerUrlManager(ConfigurationManager config) {
-
-        defaultMaxRetry = config.getConfig(WsmgCommonConstants.CONFIG_MAX_MESSAGE_DELIVER_RETRIES, 2);
-
-        // time is in milliseconds
-        expireTimeGap = 1000 * 60 * config.getConfig(WsmgCommonConstants.CONFIG_CONSUMER_URL_EXPIRATION_TIME_GAP, 5l);
-
-        // let minimum time to be 1 minute
-        long timerThreadInterval = Math.max(expireTimeGap / 5, 1000 * 60);
-
-        cleanupTimer = new Timer("Failed consumer url handler", true);
-        cleanupTimer.scheduleAtFixedRate(new URLCleanUpTask(), 0, timerThreadInterval);
-    }
-
-    public void stop() {
-        logger.info("Stop ConsumerUrlManager");
-        if (this.cleanupTimer != null) {
-            this.cleanupTimer.cancel();
-        }
-        logger.info("ConsumerUrlManager Stopped");
-    }
-
-    public void onFailedDelivery(EndpointReference consumerEndpointReference, long timeFinished, long timeTaken,
-            AxisFault exception, AdditionalMessageContent headers) {
-        String url = consumerEndpointReference.getAddress();
-
-        RunTimeStatistics.addNewFailedDeliverTime(timeTaken);
-        RunTimeStatistics.addFailedConsumerURL(url);
-
-        if (isEligibleToBlackList(exception)) {
-
-            synchronized (failedConsumerUrls) {
-                FailedConsumerInfo info = failedConsumerUrls.get(url);
-                if (info == null) {
-                    info = new FailedConsumerInfo();
-                    failedConsumerUrls.put(url, info);
-                }
-                info.incrementNumberOfTimesTried(timeFinished + expireTimeGap);
-            }
-
-        } else {
-
-            String errorMsg = String.format("unable to deliver message: [%s] to consumer: [%s], " + "reason: [%s]",
-                    headers.toString(), url, exception.getMessage());
-
-            logger.error(errorMsg);
-        }
-    }
-
-    public void onSucessfullDelivery(EndpointReference consumerEndpointReference, long timeTaken) {
-
-        RunTimeStatistics.addNewSuccessfulDeliverTime(timeTaken);
-        synchronized (failedConsumerUrls) {
-
-            FailedConsumerInfo info = failedConsumerUrls.remove(consumerEndpointReference.getAddress());
-
-            if (info != null) {
-                logger.debug(String.format("message was delivered to " + "previously %d times failed url : %s",
-                        info.getNumberOfTimesTried(), consumerEndpointReference.getAddress()));
-            }
-        }
-    }
-
-    public boolean isUnavailable(String url) {
-        synchronized (failedConsumerUrls) {
-            FailedConsumerInfo info = failedConsumerUrls.get(url);
-            return (info != null && info.isMaxRetryCountReached());
-        }
-    }
-
-    private boolean isEligibleToBlackList(AxisFault f) {
-
-        Throwable cause = f.getCause();
-
-        if (cause == null) {
-            logger.error("unknown error occured", cause);
-            return false;
-        }
-
-        /*
-         * if timeout because of the set timeout in this class In windows, timeout cause ConnectException with
-         * "Connection timed out" message
-         */
-        if (cause instanceof SocketTimeoutException || cause.getMessage().indexOf("timed out") > 0
-                || cause instanceof NoRouteToHostException) {
-            return true;
-        }
-
-        return false;
-    }
-
-    class FailedConsumerInfo {
-
-        private int numberOfTimesTried;
-        private long expiryTime;
-
-        public void incrementNumberOfTimesTried(long expireTime) {
-            numberOfTimesTried++;
-            expiryTime = expireTime;
-        }
-
-        public void decrementNumberOfTimeTried() {
-            numberOfTimesTried--;
-        }
-
-        public int getNumberOfTimesTried() {
-            return numberOfTimesTried;
-        }
-
-        public boolean isMaxRetryCountReached() {
-            return numberOfTimesTried >= defaultMaxRetry;
-        }
-
-        public long getLastAtteptExpiryTime() {
-            return expiryTime;
-        }
-
-    }
-
-    class URLCleanUpTask extends TimerTask {
-
-        @Override
-        public void run() {
-
-            logger.debug("starting to clean up black listed consumer urls");
-            long currentTime = System.currentTimeMillis();
-
-            synchronized (failedConsumerUrls) {
-                for (Entry<String, FailedConsumerInfo> entry : failedConsumerUrls.entrySet()) {
-                    FailedConsumerInfo info = entry.getValue();
-
-                    if (info.isMaxRetryCountReached() && info.getLastAtteptExpiryTime() >= currentTime) {
-
-                        info.decrementNumberOfTimeTried();
-                        logger.info("decrementing number of times" + " tried for consumer url: " + entry.getKey());
-
-                    }
-                }
-            }
-
-            logger.debug("finished cleaning black listed consumer urls");
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/Deliverable.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/Deliverable.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/Deliverable.java
deleted file mode 100644
index 92b6cfe..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/Deliverable.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.wsmg.messenger;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.messenger.protocol.DeliveryProtocol;
-import org.apache.axiom.om.OMElement;
-
-public interface Deliverable {
-    void setProtocol(DeliveryProtocol protocol);
-
-    void send(ConsumerInfo consumerInfo, OMElement message, AdditionalMessageContent additionalMessageContent);
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/DeliveryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/DeliveryProcessor.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/DeliveryProcessor.java
deleted file mode 100644
index 7eb5b4f..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/DeliveryProcessor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.wsmg.messenger;
-
-import org.apache.airavata.wsmg.commons.OutGoingMessage;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DeliveryProcessor {
-
-    private static final Logger logger = LoggerFactory.getLogger(DeliveryProcessor.class);
-
-    private SendingStrategy strategy;
-    private Deliverable deliverable;
-
-    private boolean running;
-    private Thread t;
-
-    public DeliveryProcessor(Deliverable deliverable, SendingStrategy strategy) {
-        this.strategy = strategy;
-        this.deliverable = deliverable;
-    }
-
-    public void start() {
-        this.running = true;
-        this.t = new Thread(new CheckingAndSending());
-        this.t.start();
-    }
-
-    public void stop() {
-        this.running = false;
-
-        if (this.t != null) {
-            this.t.interrupt();
-
-            try {
-                this.t.join();
-            } catch (InterruptedException ie) {
-                logger.error("Wait for sending thread to finish (join) is interrupted");
-            }
-        }
-
-        WSMGParameter.OUT_GOING_QUEUE.dispose();
-    }
-
-    private class CheckingAndSending implements Runnable {
-
-        public void run() {
-            strategy.init();
-            while (running) {
-                logger.debug("run - delivery thread");
-                try {
-
-                    OutGoingMessage outGoingMessage = (OutGoingMessage) WSMGParameter.OUT_GOING_QUEUE.blockingDequeue();
-
-                    if (WSMGParameter.showTrackId)
-                        logger.debug(outGoingMessage.getAdditionalMessageContent().getTrackId()
-                                + ": dequeued from outgoing queue");
-
-                    strategy.addMessageToSend(outGoingMessage, deliverable);
-
-                } catch (Exception e) {
-                    logger.warn("Unexpected_exception:");
-                }
-            }
-            logger.debug("Shutdown Strategy");
-            strategy.shutdown();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/OutGoingQueue.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/OutGoingQueue.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/OutGoingQueue.java
deleted file mode 100644
index 6764a42..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/OutGoingQueue.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger;
-
-import org.apache.airavata.wsmg.commons.OutGoingMessage;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.airavata.wsmg.util.Counter;
-import org.apache.airavata.wsmg.util.TimerThread;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class OutGoingQueue {
-
-    private static final Logger logger = LoggerFactory.getLogger(OutGoingQueue.class);
-
-    private Counter storeToOutQueueCounter;
-
-    public OutGoingQueue() {
-        if (WSMGParameter.measureMessageRate) {
-            storeToOutQueueCounter = new Counter();
-            TimerThread timerThread = new TimerThread(storeToOutQueueCounter, " StoreToOutQueueCounter");
-            new Thread(timerThread).start();
-        }
-    }
-
-    // need synchronized???
-    public void storeNotification(OutGoingMessage outGoingMessage, long messageId) {
-
-        boolean loop = false;
-        do {
-            // this outgoing Queue is created inside the messenger which is
-            // intended to send the notification message to the consumer.
-            WSMGParameter.OUT_GOING_QUEUE.enqueue(outGoingMessage, outGoingMessage.getAdditionalMessageContent()
-                    .getTrackId());
-            if (WSMGParameter.measureMessageRate) {
-                storeToOutQueueCounter.addCounter();
-            }
-            if (WSMGParameter.testOutGoingQueueMaxiumLength && storeToOutQueueCounter.getCounterValue() < 1000000) {
-                loop = true;
-            }else{
-                loop = false;
-            }
-        } while (loop);
-
-    }
-}


[52/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java
new file mode 100644
index 0000000..6a4ffe6
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleForEachWorkflowTest.java
@@ -0,0 +1,72 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.UUID;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SimpleForEachWorkflowTest {
+    final Logger logger = LoggerFactory.getLogger(ForEachWorkflowTest.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    @Test
+    public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+        logger.info("Running SimpleForEachWorkflowTest...");
+        URL systemResource = this.getClass().getClassLoader().getSystemResource("SimpleForEach.xwf");
+        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+        XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//        AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+                UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+
+        SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+
+        WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+        interpretor.scheduleDynamically();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java
new file mode 100644
index 0000000..69da333
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/SimpleMathWorkflowTest.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpreter;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.UUID;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SimpleMathWorkflowTest {
+    final Logger logger = LoggerFactory.getLogger(SimpleMathWorkflowTest.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    @Test
+    public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+        logger.info("Running SimpleMathWorkflowTest...");
+        URL systemResource = this.getClass().getClassLoader().getSystemResource("SimpleMath.xwf");
+        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+        XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//        AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+                UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+        SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+
+        WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+        interpretor.scheduleDynamically();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java
new file mode 100644
index 0000000..18b944b
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTest.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpreter;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.UUID;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WorkflowTest{
+    final Logger logger = LoggerFactory.getLogger(WorkflowTest.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    @Test
+    public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+        logger.info("Running WorkflowTest...");
+        URL systemResource = this.getClass().getClassLoader().getSystemResource("SimpleEcho.xwf");
+        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+        ((InputNode) workflow.getGraph().getNode("input")).setDefaultValue("1");
+        XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//        AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+                UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+        SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+
+        WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration, ssWorkflowInterpreterInteractorImpl);
+        interpretor.scheduleDynamically();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTrackingTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTrackingTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTrackingTest.java
new file mode 100644
index 0000000..73f73cc
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/WorkflowTrackingTest.java
@@ -0,0 +1,105 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter;
+
+
+import junit.framework.Assert;
+import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
+import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
+import org.apache.airavata.xbaya.interpreter.utils.ConfigKeys;
+import org.apache.airavata.xbaya.interpreter.utils.TestUtilServer;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.Properties;
+
+public class WorkflowTrackingTest implements ConsumerNotificationHandler{
+    final static Logger logger = LoggerFactory.getLogger(ConsumerNotificationHandler.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    public void handleNotification(SOAPEnvelope msgEnvelope) {
+        logger.info("Received " + msgEnvelope);
+        String message = "<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header><wsa:Action xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">http://org.apache.airavata/WseNotification</wsa:Action><wsa:MessageID xmlns:wsa=\"http://www.w3.org/2005/08/addressing\" /><wsa:To xmlns:wsa=\"http://www.w3.org/2005/08/addressing\">http://140.182.151.20:61436/axis2/services/ConsumerService/</wsa:To><wsnt:Topic xmlns:wsnt=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification\" xmlns:ns2=\"http://tutorial.globus.org/auction\" Dialect=\"http://www.ibm.com/xmlns/stdwip/web-services/WS-Topics/TopicExpression/simple\">ns2:abc</wsnt:Topic></soapenv:Header><soapenv:Body><wor:workflowInvoked xmlns:wor=\"http://airavata.apache.org/schemas/wft/2011/08\" infoModelVersion=\"2.6\"><wor:notificationSource wor:serviceID=\"abc\" /><wor:timestamp>2011-12-20T14:47:33.736-05:00</wor:timestamp><wor:description>Workflow Sta
 rted</wor:description><wor:annotation /><wor:initiator wor:serviceID=\"abc\" /></wor:workflowInvoked></soapenv:Body></soapenv:Envelope>";
+        Assert.assertEquals(message,msgEnvelope);
+    }
+
+    private static Properties getDefaults() {
+            Properties defaults = new Properties();
+            defaults.setProperty(ConfigKeys.MSGBOX_SERVICE_URL,
+                    "http://localhost:8080/axis2/services/MsgBoxService");
+            defaults.setProperty(ConfigKeys.MSGBROKER_SERVICE_URL,
+                    "http://localhost:8080/axis2/services/EventingService");
+            defaults.setProperty(ConfigKeys.TOPIC, "abc");
+            return defaults;
+        }
+
+    protected void setUp() throws Exception {
+        TestUtilServer.start(null, null);
+    }
+
+    protected void tearDown() throws Exception {
+            TestUtilServer.stop();
+    }
+
+    @Test
+    public void WorkflowTrackingtest() throws Exception{
+        logger.info("Running WorkflowTrackingTest...");
+        setUp();
+        Properties configurations = new Properties(getDefaults());
+        WseMsgBrokerClient brokerClient = new WseMsgBrokerClient();
+        String brokerLocation = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
+        brokerClient.init(brokerLocation);
+        String topic = configurations.getProperty(ConfigKeys.TOPIC);
+        NotificationSender sender = null;
+        sender = new NotificationSender(brokerLocation, topic);
+
+        int consumerPort = TestUtilServer.getAvailablePort();
+
+            String[] consumerEPRs = brokerClient.startConsumerService(consumerPort, this);
+        // subscribing to the above created messsage box with configured topic
+        String subscriptionID = brokerClient.subscribe(consumerEPRs[0], topic, null);
+
+        sender.workflowStarted("Workflow Started");
+
+        //Here we simply assume the workflow invocation is the invoke of the subscribe operation of EventingService and result
+        // Is considered as the subscriptionID got from subscribe operation
+        try {
+            Thread.sleep(10000L);
+        } catch (InterruptedException e) {
+            e.printStackTrace();
+        }
+        brokerClient.unSubscribe(subscriptionID);
+        Assert.assertEquals(brokerLocation,"http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService");
+        tearDown();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaClientTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaClientTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaClientTest.java
new file mode 100644
index 0000000..f6a7f85
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaClientTest.java
@@ -0,0 +1,80 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.ListenerManager;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class XBayaClientTest {
+    final static Logger logger = LoggerFactory.getLogger(XBayaClientTest.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    @Test
+	public void testInvokeWorkflowString() {
+//		  try {
+//              ListenerManager manager = axis2ServiceStarter();
+//              XBayaClient xBayaClient = new XBayaClient("xbaya1.properties");
+//              xBayaClient.loadWorkflowFromaFile("/Users/lahirugunathilake/localsimplemath.xwf");
+//              NameValue[] nameValues = xBayaClient.setInputs("xbaya1.properties");
+//              String s = xBayaClient.runWorkflow("test",nameValues,"admin");
+//              org.junit.Assert.assertEquals("test",s);
+
+//              manager.stop();*/
+//          }  catch (URISyntaxException e) {
+//			TODO Auto-generated catch block
+//			e.printStackTrace();
+//		} catch (IOException e) {
+//			TODO Auto-generated catch block
+//			e.printStackTrace();
+//		}
+	}
+
+    private ListenerManager axis2ServiceStarter() throws AxisFault {
+        try {
+            ConfigurationContext configContext = ConfigurationContextFactory.createBasicConfigurationContext
+                    ("axis2_default.xml");
+            AxisService service = AxisService.createService(EchoService.class.getName(), configContext.getAxisConfiguration());
+            configContext.deployService(service);
+            ListenerManager manager = new ListenerManager();
+            manager.init(configContext);
+            manager.start();
+            return manager;
+        } catch (Exception e) {
+            throw AxisFault.makeFault(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaConsolidatedTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaConsolidatedTestSuite.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaConsolidatedTestSuite.java
new file mode 100644
index 0000000..7bf285f
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/XBayaConsolidatedTestSuite.java
@@ -0,0 +1,67 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter;
+
+import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.engine.ListenerManager;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Rule;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+@RunWith(Suite.class)
+@Suite.SuiteClasses({XBayaClientTest.class, SimpleMathWorkflowTest.class, WorkflowTest.class,
+        ComplexMathWorkflowTest.class, CrossProductWorkflowTest.class, ForEachWorkflowTest.class,
+        SimpleForEachWorkflowTest.class, ComplexForEachWorkflowTest.class,
+        WorkflowTrackingTest.class, RegistryServiceTest.class})
+public class XBayaConsolidatedTestSuite {
+    private static ListenerManager manager = null;
+
+    final static Logger logger = LoggerFactory.getLogger(XBayaConsolidatedTestSuite.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    @BeforeClass
+    public static void startServer() throws AxisFault {
+        logger.info("Starting simple Axis2 Server...");
+        manager = WorkflowTestUtils.axis2ServiceStarter();
+    }
+
+    @AfterClass
+    public static void stopServer() throws AxisFault {
+        logger.info("Stopping simple Axis2 Server...");
+        manager.stop();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/ConfigKeys.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/ConfigKeys.java
new file mode 100644
index 0000000..77a2722
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/ConfigKeys.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter.utils;
+
+
+public class ConfigKeys {
+
+	public static final String AXIS2_REPO = "axis2.repository";
+	public static final String CONFIG_FILE_NAME = "configuration.properties";
+	public static final String MSGBOX_SERVICE_URL = "msgbox.service.url";
+    public static final String MSGBROKER_SERVICE_URL = "msgbroker.service.url";
+	public static final String MSGBOX_ID = "msgbox.id";
+    public static final String TOPIC = "abc";
+
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/TestUtilServer.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/TestUtilServer.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/TestUtilServer.java
new file mode 100644
index 0000000..b82a2bd
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/TestUtilServer.java
@@ -0,0 +1,243 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter.utils;
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+import org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.InOutAxisOperation;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.engine.ServiceLifeCycle;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+
+import javax.xml.namespace.QName;
+import java.io.IOException;
+import java.net.ServerSocket;
+
+public class TestUtilServer {
+    private static int count = 0;
+
+    private static SimpleHTTPServer receiver;
+
+    public static int TESTING_PORT = 5555;
+
+    public static final String FAILURE_MESSAGE = "Intentional Failure";
+
+    public static synchronized void deployService(AxisService service) throws AxisFault {
+        receiver.getConfigurationContext().getAxisConfiguration().addService(service);
+    }
+
+    public static synchronized void unDeployService(QName service) throws AxisFault {
+        receiver.getConfigurationContext().getAxisConfiguration().removeService(service.getLocalPart());
+    }
+
+    public static synchronized void unDeployClientService() throws AxisFault {
+        if (receiver.getConfigurationContext().getAxisConfiguration() != null) {
+            receiver.getConfigurationContext().getAxisConfiguration().removeService("AnonymousService");
+        }
+    }
+
+    public static synchronized void start(String repository, String axis2xml) throws Exception {
+        if (count == 0) {
+            ConfigurationContext er = getNewConfigurationContext(repository, axis2xml);
+            TESTING_PORT = getAvailablePort();
+            receiver = new SimpleHTTPServer(er, TESTING_PORT);
+
+            try {
+                receiver.start();
+                System.out.print("Server started on port " + TESTING_PORT + ".....");
+            } catch (Exception e) {
+                throw AxisFault.makeFault(e);
+            }
+
+            try {
+                Thread.sleep(2000);
+            } catch (InterruptedException e1) {
+                throw new AxisFault("Thread interuptted", e1);
+            }
+            startBroker();
+        }
+        count++;
+    }
+
+    public static void startBroker() throws Exception {
+
+        ServiceLifeCycle brokerLifeCycle = new BrokerServiceLifeCycle();
+
+        final String configFileParam = "configuration.file.name";
+        final String configFileValue = "airavata-server.properties";
+
+        AxisService notificationService = getNotificationService();
+        notificationService.addParameter(configFileParam, configFileValue);
+        notificationService.setServiceLifeCycle(brokerLifeCycle);
+        TestUtilServer.deployService(notificationService);
+        brokerLifeCycle.startUp(TestUtilServer.getConfigurationContext(), notificationService);
+
+        AxisService eventingService = getEventingService();
+        eventingService.addParameter(configFileParam, configFileValue);
+        eventingService.setServiceLifeCycle(brokerLifeCycle);
+        TestUtilServer.deployService(eventingService);
+        brokerLifeCycle.startUp(TestUtilServer.getConfigurationContext(), eventingService);
+
+    }
+
+    public static AxisService getEventingService() {
+
+        AxisService eventingService = new AxisService("EventingService");
+
+        createOperation(eventingService, "renew",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew",
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse");
+        createOperation(eventingService, "getCurrentStatus",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus",
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse");
+
+        createOperation(eventingService, "subscriptionEnd",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd", null);
+
+        createOperation(eventingService, "subscribe",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe",
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse");
+        createOperation(eventingService, "unsubscribe",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe",
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse");
+        createOperation(eventingService, "publish",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingPublishMsgReceiver(),
+                "http://org.apache.airavata/WseNotification", null);
+
+        return eventingService;
+    }
+
+    public static AxisService getNotificationService() {
+
+        AxisService notificationService = new AxisService("NotificationService");
+
+        createOperation(notificationService, "notify",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/Notify",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/NotifyResponse");
+
+        createOperation(notificationService, "subscribe",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequestResponse");
+
+        createOperation(notificationService, "getCurrentMessage",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageResponse");
+
+        createOperation(notificationService, "pauseSubscription",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubsriptionRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubscriptionResponse");
+
+        createOperation(notificationService, "resumeSubscription",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubsriptionRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubscriptionResponse");
+
+        createOperation(notificationService, "unsubscribe",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubsribeRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubscribeResponse");
+
+        return notificationService;
+
+    }
+
+    public static void createOperation(AxisService axisService, String name, MessageReceiver messageReceiver,
+            String inputAction, String outputAction) {
+        InOutAxisOperation operation1 = new InOutAxisOperation(new QName(name));
+        operation1.setMessageReceiver(messageReceiver);
+        operation1.setOutputAction(outputAction);
+        axisService.addOperation(operation1);
+        if (inputAction != null) {
+            axisService.mapActionToOperation(inputAction, operation1);
+        }
+    }
+
+    public static ConfigurationContext getNewConfigurationContext(String repository, String axis2xml) throws Exception {
+        return ConfigurationContextFactory.createConfigurationContextFromFileSystem(repository, axis2xml);
+    }
+
+    public static synchronized void stop() throws AxisFault {
+        if (count == 1) {
+            receiver.stop();
+            while (receiver.isRunning()) {
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e1) {
+                    // nothing to do here
+                }
+            }
+            count = 0;
+            // tp.doStop();
+            System.out.print("Server stopped .....");
+        } else {
+            count--;
+        }
+        receiver.getConfigurationContext().terminate();
+    }
+
+    public static ConfigurationContext getConfigurationContext() {
+        return receiver.getConfigurationContext();
+    }
+
+    public static int getAvailablePort(){
+        ServerSocket serverSocket = null;
+        try {
+             serverSocket = new ServerSocket(0);
+             serverSocket.close();
+        } catch (IOException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+        return serverSocket.getLocalPort();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/WorkflowTestUtils.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/WorkflowTestUtils.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/WorkflowTestUtils.java
new file mode 100644
index 0000000..a498921
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/utils/WorkflowTestUtils.java
@@ -0,0 +1,97 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter.utils;
+
+import org.apache.airavata.client.stub.interpretor.NameValue;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.interpreter.EchoService;
+import org.apache.airavata.xbaya.interpreter.LevenshteinDistanceService;
+import org.apache.airavata.xbaya.interpreter.ComplexMathService;
+import org.apache.airavata.xbaya.interpretor.HeaderConstants;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.ListenerManager;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+import java.nio.charset.Charset;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class WorkflowTestUtils implements HeaderConstants{
+
+    public static XBayaConfiguration getConfiguration() throws URISyntaxException {
+        Map<String, String> configuration = new HashMap<String, String>();
+        configuration.put(HEADER_ELEMENT_GFAC,XBayaConstants.DEFAULT_GFAC_URL.toString());
+        configuration.put(HEADER_ELEMENT_REGISTRY,XBayaConstants.REGISTRY_URL.toASCIIString());
+        configuration.put(HEADER_ELEMENT_PROXYSERVER,XBayaConstants.DEFAULT_MYPROXY_SERVER);
+        configuration.put(HEADER_ELEMENT_MSGBOX,XBayaConstants.DEFAULT_MESSAGE_BOX_URL.toString());
+        configuration.put(HEADER_ELEMENT_DSC,XBayaConstants.DEFAULT_DSC_URL.toString());
+        configuration.put(HEADER_ELEMENT_BROKER,XBayaConstants.DEFAULT_BROKER_URL.toString());
+        return (new WorkflowInterpretorSkeleton()).getConfiguration(configuration);
+    }
+
+    public static String readWorkflow(URL url) throws IOException, URISyntaxException {
+        FileInputStream stream = new FileInputStream(new File(url.toURI()));
+        try {
+            FileChannel fc = stream.getChannel();
+            MappedByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
+            /* Instead of using default, pass in a decoder. */
+            return Charset.defaultCharset().decode(bb).toString();
+        } finally {
+            stream.close();
+        }
+    }
+
+    public static ListenerManager axis2ServiceStarter() throws AxisFault {
+        try {
+            ConfigurationContext configContext = ConfigurationContextFactory
+                    .createBasicConfigurationContext("axis2_default.xml");
+
+            AxisService echoService = AxisService.createService(EchoService.class.getName(),
+                    configContext.getAxisConfiguration());
+            configContext.deployService(echoService);
+            AxisService distanceService = AxisService.createService(LevenshteinDistanceService.class.getName(),
+                    configContext.getAxisConfiguration());
+            configContext.deployService(distanceService);
+            AxisService mathService = AxisService.createService(ComplexMathService.class.getName(),
+                    configContext.getAxisConfiguration());
+            configContext.deployService(mathService);
+
+            ListenerManager manager = new ListenerManager();
+            manager.init(configContext);
+            manager.start();
+            return manager;
+        } catch (Exception e) {
+            throw AxisFault.makeFault(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/test.xwf
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/test.xwf b/modules/xbaya-gui/src/test/java/test.xwf
new file mode 100644
index 0000000..96eda29
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/test.xwf
@@ -0,0 +1,251 @@
+<?xml version="1.0"?>
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+	distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+	the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
+	obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+	in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+	ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+	the License. -->
+
+<xwf:workflow xwf:version="3.8.8" xmlns:xwf="http://www.extreme.indiana.edu/xbaya/xwf">
+  <xgr:graph xgr:version="3.8.8" xgr:type="ws"
+    xmlns:xgr="http://www.extreme.indiana.edu/xbaya/graph">
+    <xgr:id>test3</xgr:id>
+    <xgr:name>test3</xgr:name>
+    <xgr:description></xgr:description>
+    <xgr:metadata>
+      <appinfo xmlns="http://www.w3.org/2001/XMLSchema">
+
+</appinfo>
+    </xgr:metadata>
+    <xgr:node xgr:type="ws">
+      <xgr:id>TimestampServicePortType_appendTimeStamp</xgr:id>
+      <xgr:name>TimestampServicePortType:appendTimeStamp</xgr:name>
+      <xgr:outputPort>TimestampServicePortType_appendTimeStamp_out_0</xgr:outputPort>
+      <xgr:inputPort>TimestampServicePortType_appendTimeStamp_in_0</xgr:inputPort>
+      <xgr:controlInPort>TimestampServicePortType_appendTimeStamp_ctrl_in_0</xgr:controlInPort>
+      <xgr:controlOutPort>TimestampServicePortType_appendTimeStamp_ctrl_out_0</xgr:controlOutPort>
+      <xgr:x>35</xgr:x>
+      <xgr:y>122</xgr:y>
+      <xgr:wsdl>_</xgr:wsdl>
+      <xgr:portType>{http://indiana.edu}TimestampServicePortType</xgr:portType>
+      <xgr:operation>appendTimeStamp</xgr:operation>
+    </xgr:node>
+    <xgr:node xgr:type="ws">
+      <xgr:id>TimestampServicePortType_appendTimeStamp_2</xgr:id>
+      <xgr:name>TimestampServicePortType:appendTimeStamp</xgr:name>
+      <xgr:outputPort>TimestampServicePortType_appendTimeStamp_2_out_0</xgr:outputPort>
+      <xgr:inputPort>TimestampServicePortType_appendTimeStamp_2_in_0</xgr:inputPort>
+      <xgr:controlInPort>TimestampServicePortType_appendTimeStamp_2_ctrl_in_0</xgr:controlInPort>
+      <xgr:controlOutPort>TimestampServicePortType_appendTimeStamp_2_ctrl_out_0</xgr:controlOutPort>
+      <xgr:x>179</xgr:x>
+      <xgr:y>228</xgr:y>
+      <xgr:wsdl>_</xgr:wsdl>
+      <xgr:portType>{http://indiana.edu}TimestampServicePortType</xgr:portType>
+      <xgr:operation>appendTimeStamp</xgr:operation>
+    </xgr:node>
+    <xgr:node xgr:type="input">
+      <xgr:id>before</xgr:id>
+      <xgr:name>before</xgr:name>
+      <xgr:outputPort>before_out_0</xgr:outputPort>
+      <xgr:x>24</xgr:x>
+      <xgr:y>47</xgr:y>
+      <xgr:config>
+        <xgr:description></xgr:description>
+        <xgr:dataType>{http://www.w3.org/2001/XMLSchema}string</xgr:dataType>
+      </xgr:config>
+    </xgr:node>
+    <xgr:node xgr:type="output">
+      <xgr:id>return</xgr:id>
+      <xgr:name>return</xgr:name>
+      <xgr:inputPort>return_in_0</xgr:inputPort>
+      <xgr:x>552</xgr:x>
+      <xgr:y>216</xgr:y>
+      <xgr:config>
+        <xgr:description></xgr:description>
+        <xgr:dataType>{http://www.w3.org/2001/XMLSchema}string</xgr:dataType>
+      </xgr:config>
+    </xgr:node>
+    <xgr:port xgr:type="ws">
+      <xgr:id>TimestampServicePortType_appendTimeStamp_in_0</xgr:id>
+      <xgr:name>before</xgr:name>
+      <xgr:node>TimestampServicePortType_appendTimeStamp</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="ws">
+      <xgr:id>TimestampServicePortType_appendTimeStamp_out_0</xgr:id>
+      <xgr:name>return</xgr:name>
+      <xgr:node>TimestampServicePortType_appendTimeStamp</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="control">
+      <xgr:id>TimestampServicePortType_appendTimeStamp_ctrl_in_0</xgr:id>
+      <xgr:name>control</xgr:name>
+      <xgr:node>TimestampServicePortType_appendTimeStamp</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="control">
+      <xgr:id>TimestampServicePortType_appendTimeStamp_ctrl_out_0</xgr:id>
+      <xgr:name>control</xgr:name>
+      <xgr:node>TimestampServicePortType_appendTimeStamp</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="ws">
+      <xgr:id>TimestampServicePortType_appendTimeStamp_2_in_0</xgr:id>
+      <xgr:name>before</xgr:name>
+      <xgr:node>TimestampServicePortType_appendTimeStamp_2</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="ws">
+      <xgr:id>TimestampServicePortType_appendTimeStamp_2_out_0</xgr:id>
+      <xgr:name>return</xgr:name>
+      <xgr:node>TimestampServicePortType_appendTimeStamp_2</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="control">
+      <xgr:id>TimestampServicePortType_appendTimeStamp_2_ctrl_in_0</xgr:id>
+      <xgr:name>control</xgr:name>
+      <xgr:node>TimestampServicePortType_appendTimeStamp_2</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="control">
+      <xgr:id>TimestampServicePortType_appendTimeStamp_2_ctrl_out_0</xgr:id>
+      <xgr:name>control</xgr:name>
+      <xgr:node>TimestampServicePortType_appendTimeStamp_2</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="systemData">
+      <xgr:id>before_out_0</xgr:id>
+      <xgr:name>Parameter</xgr:name>
+      <xgr:node>before</xgr:node>
+    </xgr:port>
+    <xgr:port xgr:type="systemData">
+      <xgr:id>return_in_0</xgr:id>
+      <xgr:name>Parameter</xgr:name>
+      <xgr:node>return</xgr:node>
+    </xgr:port>
+    <xgr:edge xgr:type="data">
+      <xgr:fromPort>before_out_0</xgr:fromPort>
+      <xgr:toPort>TimestampServicePortType_appendTimeStamp_in_0</xgr:toPort>
+    </xgr:edge>
+    <xgr:edge xgr:type="data">
+      <xgr:fromPort>TimestampServicePortType_appendTimeStamp_out_0</xgr:fromPort>
+      <xgr:toPort>TimestampServicePortType_appendTimeStamp_2_in_0</xgr:toPort>
+    </xgr:edge>
+    <xgr:edge xgr:type="data">
+      <xgr:fromPort>TimestampServicePortType_appendTimeStamp_2_out_0</xgr:fromPort>
+      <xgr:toPort>return_in_0</xgr:toPort>
+    </xgr:edge>
+  </xgr:graph>
+  <xwf:wsdls>
+    <xwf:wsdl xwf:id="_">&lt;wsdl:definitions targetNamespace="http://indiana.edu" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://indiana.edu"
+  xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+  &lt;wsdl:types>
+    &lt;xs:schema targetNamespace="http://indiana.edu">
+            &lt;xs:element name="appendTimeStamp">
+                &lt;xs:complexType>
+                    &lt;xs:sequence>
+                        &lt;xs:element minOccurs="0" name="before" nillable="true" type="xs:string" />
+                    &lt;/xs:sequence>
+                &lt;/xs:complexType>
+            &lt;/xs:element>
+            &lt;xs:element name="appendTimeStampResponse">
+                &lt;xs:complexType>
+                    &lt;xs:sequence>
+                        &lt;xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
+                    &lt;/xs:sequence>
+                &lt;/xs:complexType>
+            &lt;/xs:element>
+        &lt;/xs:schema>
+  &lt;/wsdl:types>
+  &lt;wsdl:message name="appendTimeStampResponse">
+    &lt;wsdl:part name="parameters" element="ns:appendTimeStampResponse">
+    &lt;/wsdl:part>
+  &lt;/wsdl:message>
+  &lt;wsdl:message name="appendTimeStampRequest">
+    &lt;wsdl:part name="parameters" element="ns:appendTimeStamp">
+    &lt;/wsdl:part>
+  &lt;/wsdl:message>
+  &lt;wsdl:portType name="TimestampServicePortType">
+    &lt;wsdl:operation name="appendTimeStamp">
+      &lt;wsdl:input wsaw:Action="urn:appendTimeStamp" message="ns:appendTimeStampRequest">
+    &lt;/wsdl:input>
+      &lt;wsdl:output wsaw:Action="urn:appendTimeStampResponse" message="ns:appendTimeStampResponse">
+    &lt;/wsdl:output>
+    &lt;/wsdl:operation>
+  &lt;/wsdl:portType>
+  &lt;wsdl:binding name="TimestampServiceSoap11Binding" type="ns:TimestampServicePortType">
+    &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+    &lt;wsdl:operation name="appendTimeStamp">
+      &lt;soap:operation soapAction="urn:appendTimeStamp" style="document" />
+      &lt;wsdl:input>
+        &lt;soap:body use="literal" />
+      &lt;/wsdl:input>
+      &lt;wsdl:output>
+        &lt;soap:body use="literal" />
+      &lt;/wsdl:output>
+    &lt;/wsdl:operation>
+  &lt;/wsdl:binding>
+  &lt;wsdl:service name="TimestampService">
+    &lt;wsdl:port name="TimestampServiceHttpSoap11Endpoint" binding="ns:TimestampServiceSoap11Binding">
+      &lt;soap:address location="http://pagodatree.cs.indiana.edu:8081/axis2/services/TimestampService" />
+    &lt;/wsdl:port>
+  &lt;/wsdl:service>
+&lt;/wsdl:definitions></xwf:wsdl>
+  </xwf:wsdls>
+  <xwf:image>iVBORw0KGgoAAAANSUhEUgAAApYAAAEYCAYAAADmoLY/AAANdklEQVR42u3dy3XbRhiAUfWS1rxL
+L9mnCjeSEniycBneMLZj+dAQBpjHD2BmcMfnLiRKJAS+Pg8efPvy5d8nAAC0erMSAAAQlgAACEsA
+AIQlAAAISwAAhCUAAMISAABhCQAAwhIAAGEJAICwBABAWAIAgLAEAEBYAgAgLAEAQFgCACAsAQAQ
+lgAACEsAABCWAAAISwAAhCUAAMISAACEJQAAwhIAAGEJAICwBAAAYQkAgLAEAEBYAgCAsAQAQFgC
+ACAsAQAQlgAAICwBABCWAAAISwAAhCUAAAhLAACEJQAAwhIAAGEJAADCEgAAYQkAgLAEAABhCQDA
+WGH59vZGZzzwAYBhw/Lvf550QlgCAMISYQkACEtBJywBAGEpLIUlAICwRFgCAMISYQkACEthKSwB
+AGF5Yli2Buf7ORnForAEAIRlUxyJRGEJAAjL3+Lw9RNhUrOSr5elfn7r+2sznFu3KywBAAYLy1QE
+rs1K5l629rMlPy8sAQAm2BR+VFju3bawBACYPCyXIsMydd3CEgBg8hnLkhnH0hlL+1gCANxoH0th
+KSwBAGEZclR4yebtnIi0KRwAYJKwRFgCAMJSWApLAIBrwvLr4xOdEJYAgLBEWAIAwjIyjB6Px60I
+SwBAWApLYQkACEthKSwBAISlsBSWAICwFJb1Yfn285+wBACEpbAMCcu9wBSWAICwFJZFYZkKTGEJ
+AAhLYVkVlsvAFJYAgLDMDMvvt/cqIu5eryvqOs8Oy1//3tI8IQAAYfkSgNFhd3ZIXjljKTgBAGGZ
+GYCpmczX2cjXy9Z+fu13o2dIe9vHUmQCAMJy4/K1gExdtvV7R89u9nZUuLgEAIRlZSCOFpZnnMdS
+XAIAwnLisDzzk3eEJQAgLIWlTeEAgLBsPSr86LC8+uAdYQkACMsTz2O5d1R4zazk0ee47CksRSUA
+cKuwvNLMYSkqAQBheXBIHnkOy17CUlQCAFOGJeeGpagEAIQlzWEpKgGA7sKSvuTeZ54gAEBXYclA
+DwZBCQAISwQlACAsEZQAgLBEUAIACEtBCQAgLBGUAICwRFACAMISQQkAICwFJQCAsERQAgDCEkEJ
+AAhLBCUAgLAUlAAAwhJBCQAIS4JDUlACAMISM5MAgLBEUAIACEtBCQAgLAUlAICwxME4AADCssa3
+OvzAzCQAICythOaofI1LM5MAgLCkOSzFJAAgLGmOyqeoBACEpZUQuSkcAEBYIiwBAITlwStpcUCO
+qAQAEJZVQWldAAAIy+qZSUEJACAszUwCANw1LK/aZ1FQAgAIS0EJACAs96PyudjXESCaNwCAG81Y
+GoZhHDWEJYCwNAzDEJYAwjJ/30fDMAxhCSAshaVhGMISQFgKS8MwhCUAwtIwDENYAghLYWkYhrAE
+EJYnheXWeehef+YOb4Rrf3vk9fe4fDn3v5G+P696/vR+XwlLADOWXbxBXbEMI0TUchlbljn1u2Ky
+bR2etf62bqeX+1BYAgjLrOBYztQsZ1C2Zlb2Lkv97Nb3c5dl6zZy1kvpda79fu51bt3W1te5y7h1
+f5Q8JnL+/ppZtdr13bI8qcfS1mP1qufP3n1y9vNHWAIIy6aw3Ps6J4ZyZ832rqNkWaKXpyQAI26r
+9rLc2c6asKxdrpqZ2Zzbi1pPe7/XEpYzPn+EJcCNwrJkliF3xiU6hkpmDyOWJTcYIq4zMmKPWMba
+5dq77ojN9yV/S8vyRKzDM58/NbF39PNHWAJMHpbvbzxHbAqviaHaN8bcgyKOCKyagzL2YjJnFrBk
+c33PYVlzkEnJOii9vOaxdGVY5qy/nGU98/kjLAEmC8tlUF4Zlq2zUq0zOtEhUPL7NWEZccBGdFiW
+zLy2Hg3d8re0LM8IM5ajPH+EJcAkYZkKSmFZv6+hsNz+myLu/6v2sWx5nN0xLO1jCXCTsNwLyqvC
+cm8zXO4bdGqTYM2b6N6ytGxKrF0vrbeVezBN7Yxbzibx0nVXsil8eX9HHRVesz9j1FHhLc+f0qP7
+j37+CEuAicKy5AX8zucpdI7G+HXYei7NmuB0H4/x/BGWAAOGZemLt7A0Itff2etUWApLAGHZSVS+
+/87XxyeAQwlLgIHCsvZFW1gCwhJAWDZHpbAEhCWAsAyJSmEJCEsAYRkSlcISEJYAwlJYAsISgN7C
+8vmDNz6gKhh//hOWAPax/BWWAhNoCcu9wBSWAAMdFV5/uqHnKm+YQE1YpgJTWAIMeIL0NTVhKTCB
+lrBcBqawBBgsLEuD83/PLN5AgZqw/PWv8D+9AHQalmYsgR5nLMUmwE3C0hsmcMU+liITYKKw9EYJ
+9HJUuLgEGDQsvUECPZ7HUlwCDBWWPnkH6PeTd4QlgLAEEJYAwhKgj7AUlQDCEkBYAghLgD7CUlQC
+CEuA5rAUlQDCEuCDtU9gEJUAwhLg0LAUlQAThCXAEVKfGSsqASYNS4Aj5YSlqAQQlgBNYfk+s2k9
+AQhLgKbdcKwHAGEJ0Lxft3UBICwBBCWAsASw2RtAWAKISgCEJWDTNwDCEkBQAghLAEEJICwBBCUA
+whIQlAAISwBBCSAsAQQlgLAEEJQACEtAUAIgLAEEJYCwBBCUAAhLQFACICwBQQmAsAQQlADCEkBQ
+AiAsAUEJgLAEBCUAwhIQlNYFgLAEEJQACEtAUAIgLAFBCYCwBG4Wk4ISAGEJmJ0EQFgCghIAYQkI
+SgCEJSAoAUBYAoISAGEJCEoAhCUgKAEQlsC4vpXiB4ISAGEJNEfla1wKSgCEJdAcloISAGEJNEfl
+U1QCICyByE3hACAsgayju4UlAMISaArK0qPCAUBYAo7uBkBYAoISAGEJCEoAEJYgKAFAWIKgtC4A
+EJaAoARAWAKCEgCEJYwXk4ISAGEJmJ0EOPg/3vRBWIKgBBj29fKPP/+iE8ISBCWAsERYgqAE8Pop
+6IQlICgBhKWwBAQlgLBEWIKgBBCWCEsQlAAIS2EJghIAYSkshSUISoDZw1KgCkso8u3R/sFRL3LW
+N8C1Yfn+/ff/6L9+P/d7qfBcu+7U7QlLYYmwNEsJMEFYbsVhKhZzf3bt8q3rE5bCksmj8unzXIGB
+P2uZvBnLo8Ky5LqFpbDkLnFpGIbR2RCWx4blkrAUliAsDcMQljTPWJaEobAUlpB8ETIMwxCWwrJ2
+n0phKSxBWBqGISxvHpZrm8P34nB51LewFJYgLA3DEJbOY4mwBGFpGIawRFgKSxCWhmEYwvKE1/Sv
+j090QlgiLH++kKe8/swd3tDW/vbI6+9x+XLufyN9f171/BnlvipdTmEpLIUlTDRj2cMb1BXLMEJE
+LZexZZlTvysm29bhWetv63Z6vw9zXoO8Vl8Xlo/H41aEJVwUlmuzL2uzMnszonuXpX526/u5y7J1
+GznrpfQ6134/9zq3bmvr69xl3Lo/Sh4TOX9/zaxa7fpuWZ7UY2nrsXrV82fvPjn7+SMshaWwFJbc
+9AUoKiz3vs6JodxZs73rKFmW6OUpCcCI26q9LHe2syYsa5erZmY25/ai1tPe77WE5YzPH2EpLIWl
+sORmLz7RM5bRMVTyxhOxLLnBEHGdkRF7xDLWLtfedUeHSOntRcZ5a4RHP39qY+/I50/ELifCUlgK
+SxhglvKITeE1MVT7xph7UMQRgVVzUMZeTObMApZsru85LGsOMilZB6WX1zyWrgzLnPWXs6xnPn9a
+9v0UloUf1/v58w/CUljCqUF5ZVi2zkq1zuhEh0DJ79eEZcQBG9FhWTLz2no0dMvf0rI8I8xYjvL8
+aQ1Qr+HlYRkVmMJSWEJys/fRB++M+MZYs6+hsNz+myLu/6v2sWx5nN0xLCP2mRWWx4Zla2AKS2EJ
+2VF5RVjubYbLfYNObRKseRPdW5aWTYm166X1tnIPpqmdccvZJF667ko2hS/v76ijwmv2Z4w6Krzl
++VN6dP/Rz5+a+1JYHhuWtYEpLIUlZEfl3T95xzka49dh67k0ayLFfdzn8yfqhO13CMutk+qX2gvL
+0sBci6/vt7P3/dTPCEthycRRKSxFR/T6O3udCsv5nz+jhmVJDI42Y5kTlmYshSU3jEof/wXM8pF4
+vYXk7PtYLiMy5+t3tdchLKHzqBSWgLBsD7eelvGso8JLojB1mbAUlkwWlcISEJYxm5nveB7LVCDm
+huXadWxdp7AEYQkgLCf95J2SsFwSlsKSCaNSWALCMuagGGFZd4S4sBSWCEsAM5bCMuzUQz3sWyks
+ISwsnz94AwPOlLsvoLAcPyzXNocLS2HJtPtYPn/jDQ84Myz3ArOXsNw6AXlv7wNnhqVP3hGW3OgT
+HGrCUmACV4RlKjCvCstezkspLIUlDHXC3lRYCkzgirBcBmZ01F3xaTgjhyXCEgpfUJ9ZvEAAZ4bl
+68nHI93hdd7jS1jChS9CghK4z4zlPScQuJKwRFgKSuDm+1jCqe/FVgKzhqU3PMBR4SAswXksAeex
+BGEJdvQGEJYISxCWAMIShCUIS0BYgrAEYQkISxCWICwBhCUIS4QlgLAEYQnCEhjmdEQrn9zgNRth
+CcISQFiCsOQuYQnQk9RnzXrNRlgCAMWEJcISABCWICwBABCWAAAISwAAhKUVAQCAsAQAQFgCACAs
+AQDgd/8B2MLNSngBKtIAAAAASUVORK5CYII=
+</xwf:image>
+</xwf:workflow>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/resources/axis2_default.xml
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/resources/axis2_default.xml b/modules/xbaya-gui/src/test/resources/axis2_default.xml
new file mode 100644
index 0000000..aee2d25
--- /dev/null
+++ b/modules/xbaya-gui/src/test/resources/axis2_default.xml
@@ -0,0 +1,278 @@
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements. See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership. The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License. You may obtain a copy of the License at
+  ~
+  ~ http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied. See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  -->
+
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment">true</parameter>
+    <parameter name="hotupdate">false</parameter>
+    <parameter name="enableMTOM">false</parameter>
+
+    <!--If turned on with use the Accept header of the request to determine the contentType of the
+    response-->
+    <parameter name="httpContentNegotiation">false</parameter>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults">true</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the exception-->
+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
+
+    <!--This is the user name and password of admin console-->
+    <parameter name="userName">admin</parameter>
+    <parameter name="password">axis2</parameter>
+
+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+    <!--ServicesDirectory only works on the following cases-->
+    <!---File based configurator and in that case the value should be a file URL (http:// not allowed)-->
+    <!---When creating URL Based configurator with URL “file://”  -->
+    <!--- War based configurator with expanded case , -->
+
+    <!--All the other scenarios it will be ignored.-->
+    <!--<parameter name="ServicesDirectory">service</parameter>-->
+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+    <!--<parameter name="ModulesDirectory">modules</parameter>-->
+
+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
+    <!--root which can configured using the following contextRoot parameter-->
+    <!--<parameter name="contextRoot">axis2</parameter>-->
+
+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distinguish those endpoints-->
+    <!--<parameter name="servicePath">services</parameter>-->
+    <!--<parameter name="restPath">rest</parameter>-->
+
+    <!-- Following parameter will completely disable REST handling in Axis2-->
+    <parameter name="disableREST" locked="false">false</parameter>
+
+    <!--POJO deployer , this will alow users to drop .class file and make that into a service-->
+    <deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
+    <deployer extension=".jar" directory="transports" class="org.apache.axis2.deployment.TransportDeployer"/>
+
+    <!-- Following parameter will set the host name for the epr-->
+    <!--<parameter name="hostname" locked="true">myhost.com</parameter>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Default Message Receiver for the system , if you want to have MessageReceivers for -->
+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+    <!--any operation -->
+    <!--Note : You can override this for particular service by adding the same element with your requirement-->
+    <messageReceivers>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+    </messageReceivers>
+
+    <!-- ================================================= -->
+    <!-- Message Formatter -->
+    <!-- ================================================= -->
+    <!--Following content type to message formatter mapping can be used to implement support for different message -->
+    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageFormatters>
+        <messageFormatter contentType="application/x-www-form-urlencoded"
+                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
+        <messageFormatter contentType="multipart/form-data"
+                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
+        <messageFormatter contentType="application/xml"
+                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
+        <messageFormatter contentType="text/xml"
+                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+        <messageFormatter contentType="application/soap+xml"
+                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+    </messageFormatters>
+
+    <!-- ================================================= -->
+    <!-- Message Builders -->
+    <!-- ================================================= -->
+    <!--Following content type to builder mapping can be used to implement support for different message -->
+    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageBuilders>
+        <messageBuilder contentType="application/xml"
+                         class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
+        <messageBuilder contentType="application/x-www-form-urlencoded"
+                         class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
+        <!--Left commented because it adds the depandancy of servlet-api to other modules.
+        Please uncomment to Receive messages in multipart/form-data format-->
+        <!--<messageBuilder contentType="multipart/form-data"-->
+                         <!--class="org.apache.axis2.builder.MultipartFormDataBuilder"/>-->
+    </messageBuilders>
+
+    <!-- ================================================= -->
+    <!-- Target Resolvers -->
+    <!-- ================================================= -->
+    <!-- Uncomment the following and specify the class name for your TargetResolver to add -->
+    <!-- a TargetResolver. TargetResolvers are used to process the To EPR for example to -->
+    <!-- choose a server in a cluster -->
+    <!--<targetResolvers>-->
+    <!--<targetResolver class="" />-->
+    <!--</targetResolvers>-->
+
+
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port">8080</parameter>
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncomment following parameter , and set as you required.-->
+        <!--<parameter name="hostname">http://myApp.com/ws</parameter>-->
+    </transportReceiver>
+
+    <!--Uncomment if you want to have TCP transport support-->
+    <!--<transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port">6061</parameter>-->
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncomment following parameter , and set as you required.-->
+        <!--<parameter name="hostname">tcp://myApp.com/ws</parameter>-->
+    <!--</transportReceiver>-->
+    <!--<transportSender name="tcp"-->
+                   <!--class="org.apache.axis2.transport.tcp.TCPTransportSender"/>-->
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+    </transportSender>
+    <transportSender name="https"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+    </transportSender>
+    <!--<transportSender name="java"-->
+                     <!--class="org.apache.axis2.transport.java.JavaTransportSender"/>-->
+
+
+    <!-- ================================================= -->
+    <!--  SOAP Role Configuration                          -->
+    <!-- ================================================= -->
+    <!-- Use the following pattern to configure this axis2
+         instance to act in particular roles. Note that in
+         the absence of any configuration, Axis2 will act
+         only in the ultimate receiver role -->
+    <!--
+    <SOAPRoleConfiguration isUltimateReceiver="true">
+    	<role>http://my/custom/role</role>
+    </SOAPRoleConfiguration>
+	-->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre-defined phases       -->
+         <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+         </phase>
+        <phase name="Addressing">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                <order phase="Addressing"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+        </phase>
+        <phase name="RMPhase"/>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="OperationInPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFlow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationOutPhase"/>
+        <!--system predefined phase-->
+        <!--these phase will run irrespective of the service-->
+        <phase name="RMPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <phase name="Addressing">
+             <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                 <order phase="Addressing"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+        </phase>
+        <phase name="RMPhase"/>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationInFaultPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFaultFlow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="RMPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+</axisconfig>
\ No newline at end of file


[40/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProjectResourceClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProjectResourceClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProjectResourceClient.java
deleted file mode 100644
index 653f664..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ProjectResourceClient.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.registry.api.WorkspaceProject;
-import org.apache.airavata.rest.mappings.resourcemappings.WorkspaceProjectList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.utils.BasicAuthHeaderUtil;
-import org.apache.airavata.rest.utils.ClientConstant;
-import org.apache.airavata.rest.utils.CookieManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-public class ProjectResourceClient {
-    private WebResource webResource;
-    private final static Logger logger = LoggerFactory.getLogger(ProjectResourceClient.class);
-    private String userName;
-    private PasswordCallback callback;
-    private String baseURI;
-    private Cookie cookie;
-    private WebResource.Builder builder;
-    private String gateway;
-//    private CookieManager cookieManager = new CookieManager();
-
-    public ProjectResourceClient(String userName,
-                                 String gateway,
-                                 String serviceURI,
-                                 PasswordCallback callback,
-                                 Cookie cookie) {
-        this.callback = callback;
-        this.userName = userName;
-        this.baseURI = serviceURI;
-        this.gateway = gateway;
-        this.cookie = cookie;
-    }
-
-    private URI getBaseURI() {
-        logger.debug("Creating Base URI");
-        return UriBuilder.fromUri(baseURI).build();
-    }
-
-    private WebResource getProjectRegistryBaseResource() {
-        ClientConfig config = new DefaultClientConfig();
-        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
-                Boolean.TRUE);
-        Client client = Client.create(config);
-        WebResource baseWebResource = client.resource(getBaseURI());
-        webResource = baseWebResource.path(
-                ResourcePathConstants.ProjectResourcePathConstants.REGISTRY_API_PROJECTREGISTRY);
-        return webResource;
-    }
-
-    public boolean isWorkspaceProjectExists(String projectName) {
-        webResource = getProjectRegistryBaseResource().path(
-                ResourcePathConstants.ProjectResourcePathConstants.PROJECT_EXIST);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("projectName", projectName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = webResource.queryParams(queryParams).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public boolean isWorkspaceProjectExists(String projectName, boolean createIfNotExists) {
-        String createStatus = "false";
-        webResource = getProjectRegistryBaseResource().path(
-                ResourcePathConstants.ProjectResourcePathConstants.PROJECT_EXIST);
-        if (createIfNotExists) {
-            createStatus = "true";
-        }
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("projectName", projectName);
-        formParams.add("createIfNotExists", createStatus);
-
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equals("True")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addWorkspaceProject(WorkspaceProject project) {
-        webResource = getProjectRegistryBaseResource().path(
-                ResourcePathConstants.ProjectResourcePathConstants.ADD_PROJECT);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("projectName", project.getProjectName());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void updateWorkspaceProject(WorkspaceProject project) {
-        webResource = getProjectRegistryBaseResource().path(
-                ResourcePathConstants.ProjectResourcePathConstants.UPDATE_PROJECT);
-        MultivaluedMap formParams = new MultivaluedMapImpl();
-        formParams.add("projectName", project.getProjectName());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(
-                    MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void deleteWorkspaceProject(String projectName) {
-        webResource = getProjectRegistryBaseResource().path(
-                ResourcePathConstants.ProjectResourcePathConstants.DELETE_PROJECT);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("projectName", projectName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public WorkspaceProject getWorkspaceProject(String projectName) {
-        webResource = getProjectRegistryBaseResource().path(
-                ResourcePathConstants.ProjectResourcePathConstants.GET_PROJECT);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("projectName", projectName);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        WorkspaceProject workspaceProject = response.getEntity(WorkspaceProject.class);
-        return workspaceProject;
-    }
-
-    public List<WorkspaceProject> getWorkspaceProjects() {
-        List<WorkspaceProject> workspaceProjectsList = new ArrayList<WorkspaceProject>();
-        webResource = getProjectRegistryBaseResource().path(
-                ResourcePathConstants.ProjectResourcePathConstants.GET_PROJECTS);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-        ClientResponse response = builder.get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return workspaceProjectsList;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return workspaceProjectsList;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        WorkspaceProjectList workspaceProjectList = response.getEntity(WorkspaceProjectList.class);
-        WorkspaceProject[] workspaceProjects = workspaceProjectList.getWorkspaceProjects();
-
-        for (WorkspaceProject workspaceProject : workspaceProjects) {
-            workspaceProjectsList.add(workspaceProject);
-        }
-        return workspaceProjectsList;
-    }
-
-}


[84/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
new file mode 100644
index 0000000..60a9705
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgPersistantStorage.java
@@ -0,0 +1,773 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.commons.storage;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.sql.BatchUpdateException;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionEntry;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.storage.DatabaseCreator.DatabaseType;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.apache.airavata.wsmg.util.Counter;
+import org.apache.airavata.wsmg.util.TimerThread;
+import org.apache.axiom.om.OMElement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WsmgPersistantStorage implements WsmgStorage, WsmgQueue {
+    private static final Logger logger = LoggerFactory.getLogger(WsmgPersistantStorage.class);
+
+    /*
+     * Table name
+     */
+    private static final String TABLE_NAME_TO_CHECK = SubscriptionConstants.TABLE_NAME_EXPIRABLE_SUBCRIPTIONS;
+
+    private Counter storeToDBCounter = new Counter();
+
+    private JdbcStorage db;
+
+    public WsmgPersistantStorage(String jdbcUrl, String jdbcDriver) {
+
+        db = new JdbcStorage(jdbcUrl, jdbcDriver);
+
+        Connection conn = null;
+        try {
+            /*
+             * Check database
+             */
+            conn = db.connect();
+            if (!DatabaseCreator.isDatabaseStructureCreated(TABLE_NAME_TO_CHECK, conn)) {
+                DatabaseCreator.createMsgBrokerDatabase(conn);
+                logger.info("New Database created for Message Broker");
+            } else {
+                logger.debug("Database already created for Message Broker!");
+            }
+
+            if (WSMGParameter.measureMessageRate) {
+                TimerThread timerThread = new TimerThread(storeToDBCounter, " StoreSubScriptionToDBCounter");
+                new Thread(timerThread).start();
+            }
+
+            initMessageQueueStorage();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure");
+        } finally {
+            db.closeConnection(conn);
+        }
+    }
+
+    public void dispose() {
+        if (db != null) {
+            db.closeAllConnections();
+        }
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.wsmg.commons.storage.WsmgStorage#getAllSubscription()
+     */
+    public List<SubscriptionEntry> getAllSubscription() {
+
+        ArrayList<SubscriptionEntry> ret = new ArrayList<SubscriptionEntry>();
+
+        Connection conn = null;
+        PreparedStatement stmt = null;
+        try {
+
+            // get number of row first and increase the arrayList size for
+            // better performance
+            int size = db.countRow(SubscriptionConstants.TABLE_NAME_EXPIRABLE_SUBCRIPTIONS, "*");
+
+            conn = db.connect();
+            stmt = conn.prepareStatement(SubscriptionConstants.EXP_SELECT_QUERY);
+            ResultSet rs = stmt.executeQuery();
+            ret.ensureCapacity(size);
+
+            if (rs != null) {
+
+                /*
+                 * Buffer data
+                 */
+                int nRead;
+                byte[] buffer = new byte[1024];
+                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+
+                while (rs.next()) {
+                    SubscriptionEntry subscriptionEntry = new SubscriptionEntry();
+                    subscriptionEntry.setSubscriptionId(rs.getString("SubscriptionId"));
+
+                    /*
+                     * Read Binary Stream
+                     */
+                    InputStream inStream = null;
+
+                    try {
+                        inStream = rs.getBinaryStream("content");
+                        while ((nRead = inStream.read(buffer)) != -1) {
+                            outStream.write(buffer, 0, nRead);
+                        }
+                        outStream.flush();
+
+                        subscriptionEntry.setSubscribeXml(new String(outStream.toByteArray()));
+
+                    } catch (IOException ie) {
+                        logger.error("Unable to read XML from database", ie);
+
+                        // skip this subscription entry
+                        continue;
+                    } finally {
+                        // clear all data in outputStream
+                        outStream.reset();
+
+                        // close database stream
+                        if (inStream != null) {
+                            try {
+                                inStream.close();
+                            } catch (Exception e) {
+                                logger.error("Cannot close database stream", e);
+                            }
+                        }
+                    }
+
+                    ret.add(subscriptionEntry);
+
+                }
+            }
+        } catch (SQLException ex) {
+            logger.error("sql exception occured", ex);
+        } finally {
+            db.quietlyClose(conn, stmt);
+        }
+        return ret;
+    }
+
+    public int insert(SubscriptionState subscription) {
+        String address = subscription.getConsumerReference().getAddress();
+        Map<QName, OMElement> referenceParametersMap = subscription.getConsumerReference().getAllReferenceParameters();
+
+        String consumerReferenceParameters = null;
+        if (referenceParametersMap == null) {
+            consumerReferenceParameters = "";
+        } else {
+
+            StringBuffer buffer = new StringBuffer();
+
+            for (Iterator<OMElement> ite = referenceParametersMap.values().iterator(); ite.hasNext();) {
+                OMElement currentReferenceParameter = ite.next();
+
+                try {
+                    buffer.append(currentReferenceParameter.toStringWithConsume());
+                } catch (XMLStreamException se) {
+                    logger.error("unable to convert reference parameter", se);
+                }
+
+            }
+            consumerReferenceParameters = buffer.toString();
+        }
+
+        int policyValue = WsmgCommonConstants.WSRM_POLICY_FALSE;
+        if (subscription.isWsrmPolicy()) {
+            policyValue = WsmgCommonConstants.WSRM_POLICY_TRUE;
+        }
+
+        Timestamp now = new Timestamp(System.currentTimeMillis());
+
+        int result = 0;
+        Connection connection = null;
+        PreparedStatement stmt = null;
+        try {
+
+            connection = db.connect();
+            stmt = connection.prepareStatement(SubscriptionConstants.EXP_INSERT_SQL_QUERY);
+
+            stmt.setString(1, subscription.getId());
+            stmt.setBinaryStream(2, new ByteArrayInputStream(subscription.getSubscribeXml().getBytes()), subscription
+                    .getSubscribeXml().getBytes().length);
+            stmt.setInt(3, policyValue);
+            stmt.setString(4, subscription.getLocalTopic());
+            stmt.setString(5, subscription.getXpathString());
+            stmt.setString(6, address);
+            stmt.setBinaryStream(7, new ByteArrayInputStream(consumerReferenceParameters.getBytes()),
+                    consumerReferenceParameters.getBytes().length);
+            stmt.setTimestamp(8, now);
+            result = db.executeUpdateAndClose(stmt);
+            db.commitAndFree(connection);
+
+            storeToDBCounter.addCounter();
+
+        } catch (SQLException ex) {
+            logger.error("sql exception occured", ex);
+            db.rollbackAndFree(connection);
+        }
+        return result;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.airavata.wsmg.commons.storage.SubscriptionStorage#delete(java .lang.String)
+     */
+    public int delete(String subscriptionId) {
+        int result = 0;
+        Connection connection = null;
+        try {
+            connection = db.connect();
+            PreparedStatement stmt = connection.prepareStatement(SubscriptionConstants.EXP_DELETE_SQL_QUERY);
+            stmt.setString(1, subscriptionId);
+            result = db.executeUpdateAndClose(stmt);
+            db.commitAndFree(connection);
+        } catch (SQLException sql) {
+            db.rollbackAndFree(connection);
+            logger.error("sql exception occured", sql);
+        }
+        return result;
+    }
+
+    public void cleanup() {
+        Connection conn = null;
+        Statement stmt = null;
+        try {
+            conn = db.connect();
+            stmt = conn.createStatement();
+            batchCleanDB(stmt, conn);
+        } catch (SQLException e) {
+            logger.error(e.getMessage(), e);
+        } finally {
+            if (db.isAutoCommit()) {
+                try {
+                    conn.setAutoCommit(true);
+                } catch (SQLException e) {
+                    logger.error(e.getMessage(), e);
+                }
+            }
+            db.quietlyClose(conn, stmt);
+        }
+    }
+
+    public Object blockingDequeue() throws InterruptedException {
+        while (true) {
+            try {
+                return retrive();
+            } catch (SQLException e) {
+                logger.error(e.getMessage(), e);
+                e.printStackTrace();
+            } catch (IOException e) {
+                logger.error(e.getMessage(), e);
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public void enqueue(Object object, String trackId) {
+
+        // Get the Max ID cache and update and unlock the table
+        Connection connection = null;
+        PreparedStatement stmt = null;
+        PreparedStatement stmt2 = null;
+        PreparedStatement stmt3 = null;
+        try {
+            int nextkey;
+
+            connection = db.connect();
+
+            lockMaxMinTables(connection);
+
+            stmt = connection.prepareStatement(QueueContants.SQL_MAX_ID_SEPERATE_TABLE);
+
+            ResultSet result = stmt.executeQuery();
+
+            if (result.next()) {
+                nextkey = result.getInt(1);
+
+                stmt2 = connection.prepareStatement(QueueContants.SQL_MAX_ID_INCREMENT + (nextkey));
+                stmt2.executeUpdate();
+            } else {
+                throw new RuntimeException("MAX_ID Table is not init, redeploy the service !!!");
+            }
+            
+            /**
+             * Before executing the SQL_INSERT_STATEMENT query, we need to unlock 
+             * MaxIDTable and MinIDTable since we are going to insert data to another 
+             * table, disQ. If we do not unlock tables, insert query fails in MySQL. But 
+             * in Derby, this will execute without any issues even without unlocking 
+             * tables. Since it fails with MySQL, we need to unlock the tables 
+             * before executing the insert query.
+             */
+            try{
+            	 unLockTables(connection);
+            }catch (SQLException sql) {
+                logger.error("Cannot Unlock Table", sql);
+            }
+           
+
+            /*
+             * After update MAX_ID put data into queue table
+             */
+            stmt3 = connection.prepareStatement(QueueContants.SQL_INSERT_STATEMENT);
+            stmt3.setInt(1, nextkey);
+            stmt3.setString(2, trackId);
+
+            ByteArrayOutputStream output = new ByteArrayOutputStream();
+            ObjectOutputStream out = new ObjectOutputStream(output);
+            out.writeObject(object);
+            byte[] buffer = output.toByteArray();
+            ByteArrayInputStream in = new ByteArrayInputStream(buffer);
+            stmt3.setBinaryStream(3, in, buffer.length);
+            stmt3.executeUpdate();
+            db.commit(connection);
+        } catch (SQLException sqlEx) {
+            db.rollback(connection);
+            logger.error("unable to enque the message in persistant storage", sqlEx);
+        } catch (IOException ioEx) {
+            db.rollback(connection);
+            logger.error("unable to enque the message in persistant storage", ioEx);
+        } finally {
+            try {
+                unLockTables(connection);
+            } catch (SQLException sql) {
+                logger.error("Cannot Unlock Table", sql);
+            }
+
+            db.quietlyClose(connection, stmt, stmt2, stmt3);
+        }
+    }
+
+    private void initMessageQueueStorage() throws SQLException {
+        Connection connection = null;
+        PreparedStatement stmt = null;
+        PreparedStatement stmt2 = null;
+        PreparedStatement stmt3 = null;
+        PreparedStatement stmt4 = null;
+        try {
+            connection = db.connect();
+
+            lockMaxMinTables(connection);
+
+            /*
+             * Get Max ID
+             */
+            stmt = connection.prepareStatement(QueueContants.SQL_MAX_ID_SEPERATE_TABLE);
+            ResultSet result = stmt.executeQuery();
+            if (!result.next()) {
+                stmt2 = connection.prepareStatement(QueueContants.SQL_MAX_ID_INSERT);
+                stmt2.executeUpdate();
+            }
+
+            /*
+             * Get Min ID
+             */
+            stmt3 = connection.prepareStatement(QueueContants.SQL_MIN_ID_SEPERATE_TABLE);
+            result = stmt3.executeQuery();
+            if (!result.next()) {
+                stmt4 = connection.prepareStatement(QueueContants.SQL_MIN_ID_INSERT);
+                stmt4.executeUpdate();
+            }
+            db.commit(connection);
+        } catch (SQLException sqle) {
+            db.rollback(connection);
+            throw sqle;
+        } finally {
+            try {
+                unLockTables(connection);
+            } catch (SQLException sql) {
+                logger.error("Cannot Unlock Table", sql);
+            }
+
+            db.quietlyClose(connection, stmt, stmt2, stmt3, stmt4);
+        }
+    }
+
+    private Object retrive() throws SQLException, IOException, InterruptedException {
+        long wait = 1000;
+        int nextkey = -1;
+        int maxid = -2;
+        Connection connection = null;
+        PreparedStatement stmt = null;
+        PreparedStatement stmt2 = null;
+        PreparedStatement stmt3 = null;
+        ResultSet result = null;
+        while (true) {
+            try {
+                connection = db.connect();
+
+                lockMaxMinTables(connection);
+
+                /*
+                 * Get Min ID
+                 */
+                stmt = connection.prepareStatement(QueueContants.SQL_MIN_ID_SEPERATE_TABLE);
+                result = stmt.executeQuery();
+                if (result.next()) {
+                    nextkey = result.getInt(1);
+                } else {
+                    throw new RuntimeException("Queue init has failed earlier");
+                }
+
+                /*
+                 * Get Max ID
+                 */
+                stmt2 = connection.prepareStatement(QueueContants.SQL_MAX_ID_SEPERATE_TABLE);
+                result = stmt2.executeQuery();
+                if (result.next()) {
+                    maxid = result.getInt(1);
+                } else {
+                    throw new RuntimeException("Queue init has failed earlier");
+                }
+
+                /*
+                 * Update value and exit the loop
+                 */
+                if (maxid > nextkey) {
+                    stmt3 = connection.prepareStatement(QueueContants.SQL_MIN_ID_INCREMENT + (nextkey));
+                    stmt3.executeUpdate();
+                    logger.debug("Update MIN ID by one");
+                    db.commit(connection);
+                    break;
+                }
+
+                db.commit(connection);
+            } catch (SQLException sql) {
+                db.rollback(connection);
+                throw sql;
+            } finally {
+                try {
+                    unLockTables(connection);
+                } catch (SQLException sql) {
+                    sql.printStackTrace();
+                    logger.error("Cannot Unlock Table", sql);
+                }
+
+                db.quietlyClose(connection, stmt, stmt2, stmt3);
+            }
+
+            /*
+             * Sleep if there is nothing to do
+             */
+            try {
+                wait = Math.min((wait + 1000), QueueContants.FINAL_WAIT_IN_MILI);
+                logger.debug("Wait=" + wait);
+                Thread.sleep(wait);
+            } catch (InterruptedException e) {
+                logger.warn("Queue is interrupted to close");
+                throw e;
+            }
+        }
+
+        /*
+         * Create Subscription Object from MIN_ID and delete data in table
+         */
+        Object resultObj = null;
+        int key = -1;
+        try {
+            connection = db.connect();
+            stmt = connection.prepareStatement(QueueContants.SQL_SELECT_STATEMENT + nextkey);
+            result = stmt.executeQuery();
+            if (result.next()) {
+                key = result.getInt(1);
+                InputStream in = result.getAsciiStream(2);
+                ObjectInputStream s = new ObjectInputStream(in);
+                try {
+                    resultObj = s.readObject();
+                } catch (ClassNotFoundException e) {
+                    logger.error("Cannot Deserialize Object from Database, ClassNotFound. ", e);
+                }
+            } else {
+                throw new RuntimeException(
+                        "MAX_ID and MIN_ID are inconsistent with subscription table, need to reset all data value");
+            }
+
+            try {
+                String query = QueueContants.SQL_DELETE_STATEMENT + key;
+                stmt2 = connection.prepareStatement(query);
+                stmt2.executeUpdate();
+                db.commit(connection);
+            } catch (SQLException sqle) {
+                db.rollback(connection);
+                throw sqle;
+            }
+        } finally {
+            db.quietlyClose(connection, stmt, stmt2);
+        }
+        return resultObj;
+    }
+
+    private void batchCleanDB(Statement stmt, Connection con) throws SQLException {
+        DatabaseType databaseType = DatabaseType.other;
+        int[] aiupdateCounts = new int[0];
+        boolean bError = false;
+        try {
+
+            con.setAutoCommit(false);
+
+            stmt.clearBatch();
+
+            int totalStatement = 0;
+
+            try {
+                databaseType = DatabaseCreator.getDatabaseType(con);
+            } catch (Exception e) {
+                logger.error("Error evaluating database type", e);
+            }
+            // add SQL statements
+            if (DatabaseType.mysql.equals(databaseType)) {
+                stmt.addBatch("lock tables disQ write, MaxIDTable write, MinIDTable write;");
+                totalStatement++;
+            } else if (DatabaseType.derby.equals(databaseType)) {
+                stmt.addBatch("lock table disQ in exclusive mode;");
+                totalStatement++;
+                stmt.addBatch("lock table MaxIDTable in exclusive mode;");
+                totalStatement++;
+                stmt.addBatch("lock table MinIDTable in exclusive mode;");
+                totalStatement++;
+            }
+            stmt.addBatch("Delete from disQ;");
+            totalStatement++;
+            stmt.addBatch("Delete from MaxIDTable;");
+            totalStatement++;
+            stmt.addBatch("Delete from MinIDTable;");
+            totalStatement++;
+
+            aiupdateCounts = new int[totalStatement];
+
+            // execute the statements
+            aiupdateCounts = stmt.executeBatch();
+
+        } catch (BatchUpdateException bue) {
+            bError = true;
+            aiupdateCounts = bue.getUpdateCounts();
+            logger.error("SQLException: " + bue.getMessage());
+            logger.error("SQLState:  " + bue.getSQLState());
+            logger.error("Message:  " + bue.getMessage());
+            logger.error("Vendor:  " + bue.getErrorCode());
+            logger.info("Update counts:  ");
+
+            for (int i = 0; i < aiupdateCounts.length; i++) {
+                logger.error(aiupdateCounts[i] + "   ");
+            }
+
+            SQLException SQLe = bue;
+            while (SQLe != null) {
+                SQLe = SQLe.getNextException();
+                logger.error(SQLe.getMessage(), SQLe);
+            }
+        } catch (SQLException SQLe) {
+            bError = true;
+            throw SQLe;
+        } finally {
+            // determine operation result
+            for (int i = 0; !bError && i < aiupdateCounts.length; i++) {
+                int iProcessed = aiupdateCounts[i];
+                /**
+                 * The int values that can be returned in the update counts array are: <br/>
+                 * -3--Operation error. A driver has the option to stop at the first error and throw a
+                 * BatchUpdateException or to report the error and continue. This value is only seen in the latter case. <br/>
+                 * -2--The operation was successful, but the number of rows affected is unknown. <br/>
+                 * Zero--DDL statement or no rows affected by the operation. Greater than zero--Operation was
+                 * successful, number of rows affected by the operation.
+                 */
+                if (iProcessed < 0 && iProcessed != -2) {
+                    // error on statement
+                    logger.info("Error batch." + iProcessed);
+                    bError = true;
+                }
+            }
+
+            if (bError) {
+                con.rollback();
+            } else {
+                con.commit();
+            }
+
+            /*
+             * Unlock table after rollback and commit, since it is not automatic in MySql
+             */
+
+            if (DatabaseType.mysql.equals(databaseType)) {
+                PreparedStatement prepareStmt = con.prepareCall("unlock tables;");
+                db.executeUpdateAndClose(prepareStmt);
+            }
+        } // end finally
+        logger.info("Queue is cleaned.");
+    }
+
+    private void lockMaxMinTables(Connection connection) throws SQLException {
+        DatabaseType databaseType = DatabaseType.other;
+        try {
+            databaseType = DatabaseCreator.getDatabaseType(connection);
+        } catch (Exception e) {
+            logger.error("Error evaluating database type", e);
+        }
+
+        /*
+         * Must turn off auto commit
+         */
+        connection.setAutoCommit(false);
+        String sql = null;
+        Statement stmt = null;
+        try {
+            switch (databaseType) {
+            case derby:
+                sql = "LOCK TABLE " + QueueContants.TABLE_NAME_MAXID + " IN EXCLUSIVE MODE";
+                String sql2 = "LOCK TABLE " + QueueContants.TABLE_NAME_MINID + " IN EXCLUSIVE MODE";
+                stmt = connection.createStatement();
+                stmt.addBatch(sql);
+                stmt.addBatch(sql2);
+                stmt.executeBatch();
+                break;
+            case mysql:
+                sql = "lock tables " + QueueContants.TABLE_NAME_MAXID + " write" + "," + QueueContants.TABLE_NAME_MINID
+                        + " write";
+                stmt = connection.createStatement();
+                stmt.executeQuery(sql);
+                break;
+            default:
+                return;
+            }
+
+        } finally {
+            if (stmt != null && !stmt.isClosed()) {
+                stmt.close();
+            }
+        }
+    }
+
+    private void unLockTables(Connection connection) throws SQLException {
+        DatabaseType databaseType = DatabaseType.other;
+        try {
+            databaseType = DatabaseCreator.getDatabaseType(connection);
+        } catch (Exception e) {
+            logger.error("Error evaluating database type", e);
+        }
+
+        try {
+            switch (databaseType) {
+            case derby:
+                /*
+                 * Derby doesn't have explicit unlock SQL It uses commit or rollback as a unlock mechanism, so make sure
+                 * that connection is always commited or rollbacked
+                 */
+                break;
+            case mysql:
+                String sql = "unlock tables";
+                PreparedStatement stmt = null;
+                try {
+                    stmt = connection.prepareStatement(sql);
+                    stmt.executeQuery();
+                    db.commit(connection);
+                } finally {
+                    if (stmt != null) {
+                        stmt.close();
+                    }
+                }
+                break;
+            default:
+                return;
+            }
+        } finally {
+            /*
+             * Set auto commit when needed
+             */
+            if (db.isAutoCommit()) {
+                connection.setAutoCommit(true);
+            }
+        }
+    }
+
+    private static class SubscriptionConstants {
+
+        public static final String TABLE_NAME_EXPIRABLE_SUBCRIPTIONS = "subscription";
+
+        public static final String TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS = "specialSubscription";
+
+        public static final String EXP_INSERT_SQL_QUERY = "INSERT INTO " + TABLE_NAME_EXPIRABLE_SUBCRIPTIONS
+                + "(SubscriptionId, content, wsrm, Topics, XPath, ConsumerAddress, ReferenceProperties, CreationTime) "
+                + "VALUES( ? , ? , ? , ? , ? , ? , ? , ?)";
+
+        public static final String EXP_DELETE_SQL_QUERY = "DELETE FROM " + TABLE_NAME_EXPIRABLE_SUBCRIPTIONS
+                + " WHERE SubscriptionId= ?";
+
+        public static final String EXP_SELECT_QUERY = "SELECT * FROM " + TABLE_NAME_EXPIRABLE_SUBCRIPTIONS;
+
+        public static final String NONEXP_INSERT_SQL_QUERY = "INSERT INTO " + TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS
+                + "(SubscriptionId, content, wsrm, Topics, XPath, ConsumerAddress, ReferenceProperties, CreationTime) "
+                + "VALUES( ? , ? , ? , ? , ? , ? , ? , ?)";
+
+        public static final String NONEXP_DELETE_SQL_QUERY = "DELETE FROM " + TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS
+                + " WHERE SubscriptionId= ?";
+
+        public static final String NONEXP_SELECT_QUERY = "SELECT * FROM " + TABLE_NAME_NON_EXPIRABLE_SUBCRIPTIONS;
+    }
+
+    private static class QueueContants {
+        public static final int FINAL_WAIT_IN_MILI = 5000;
+
+        public static final String TABLE_NAME = "disQ";
+
+        public static final String TABLE_NAME_MAXID = "MaxIDTable";
+
+        public static final String TABLE_NAME_MINID = "MinIDTable";
+
+        public static final int STATUS_OPEN = 0;
+
+        public static final String SQL_INSERT_STATEMENT = "INSERT INTO " + TABLE_NAME
+                + " (id, trackId, message, status) " + "VALUES (?,?,?," + STATUS_OPEN + ")";
+
+        public static String SQL_DELETE_STATEMENT = "DELETE FROM " + TABLE_NAME + " WHERE id=";
+
+        public static String SQL_SELECT_STATEMENT = "SELECT id,message FROM " + TABLE_NAME + " WHERE id=";
+
+        public static String SQL_MAX_ID_SEPERATE_TABLE = "SELECT maxID FROM " + TABLE_NAME_MAXID;
+
+        public static String SQL_MIN_ID_SEPERATE_TABLE = "SELECT minID FROM " + TABLE_NAME_MINID;
+
+        public static String SQL_MAX_ID_INSERT = "INSERT INTO " + TABLE_NAME_MAXID + " (maxID) VALUES (1)";
+
+        public static String SQL_MIN_ID_INSERT = "INSERT INTO " + TABLE_NAME_MINID + " (minID) VALUES (1)";
+
+        public static String SQL_MAX_ID_INCREMENT = "UPDATE " + TABLE_NAME_MAXID + " SET maxID = maxID+1 WHERE maxID =";
+
+        public static String SQL_MIN_ID_INCREMENT = "UPDATE " + TABLE_NAME_MINID + " SET minID = minID+1 WHERE minID =";
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgQueue.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgQueue.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgQueue.java
new file mode 100644
index 0000000..5430b33
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgQueue.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.commons.storage;
+
+public interface WsmgQueue {
+
+    void cleanup();
+
+    void enqueue(Object object, String trackId);
+
+    Object blockingDequeue() throws InterruptedException;
+
+    void dispose();
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgStorage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgStorage.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgStorage.java
new file mode 100644
index 0000000..2a1d1cb
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgStorage.java
@@ -0,0 +1,39 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.commons.storage;
+
+import java.util.List;
+
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionEntry;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+
+public interface WsmgStorage {
+
+    List<SubscriptionEntry> getAllSubscription();
+
+    int insert(SubscriptionState subscription);
+
+    int delete(String subscriptionId);
+
+    void dispose();
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/util/OMElementComparator.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/util/OMElementComparator.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/util/OMElementComparator.java
new file mode 100644
index 0000000..d3be422
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/util/OMElementComparator.java
@@ -0,0 +1,177 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.commons.util;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.wsmg.util.BrokerUtil;
+import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNamespace;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Compare two OMElement with its namespace, attributes, children, and text. Current implementation supports ignore
+ * namespace checking i.e. if the namespace is in the list, it is skipped and return as equals.
+ */
+public class OMElementComparator {
+
+    private static final Logger log = LoggerFactory.getLogger(OMElementComparator.class);
+
+    private static List<String> ignorableNamespaceList = new ArrayList<String>();
+
+    private OMElementComparator() {
+    }
+
+    public void addIgnorableNamespace(String nsURI) {
+        ignorableNamespaceList.add(nsURI);
+    }
+
+    public void clearIgnorableNamespaces() {
+        ignorableNamespaceList.clear();
+    }
+
+    public static boolean compare(OMElement elementOne, OMElement elementTwo) {
+
+        if (isIgnorable(elementOne) || isIgnorable(elementTwo)) {
+            // ignore if the elements belong to any of the ignorable namespaces
+            // list
+            return true;
+        } else if (elementOne == null && elementTwo == null) {
+            log.debug("Both Elements are null.");
+            return true;
+        } else if (elementOne == null || elementTwo == null) {
+            log.debug("One of item to compare is null");
+            return false;
+        }
+
+        return BrokerUtil.sameStringValue(elementOne.getLocalName(), elementTwo.getLocalName())
+                && compare(elementOne.getNamespace(), elementTwo.getNamespace())
+                && compareAttibutes(elementOne, elementTwo)
+                /*
+                 * Trimming the value of the XMLElement is not correct since this compare method cannot be used to
+                 * compare element contents with trailing and leading whitespaces BUT for the practical side of tests
+                 * and to get the current tests working we have to trim() the contents
+                 */
+                && BrokerUtil.sameStringValue(elementOne.getText().trim(), elementTwo.getText().trim())
+                && compareChildren(elementOne, elementTwo);
+    }
+
+    private static boolean isIgnorable(OMElement elt) {
+        if (elt != null) {
+            OMNamespace namespace = elt.getNamespace();
+            if (namespace != null) {
+                return ignorableNamespaceList.contains(namespace.getNamespaceURI());
+            } else {
+                return false;
+            }
+        } else {
+            return false;
+        }
+    }
+
+    private static boolean compareChildren(OMElement elementOne, OMElement elementTwo) {
+        HashMap<QName, OMElement> map = new HashMap<QName, OMElement>();
+        Iterator oneIter = elementOne.getChildElements();
+        while (oneIter.hasNext()) {
+            OMElement elementOneChild = (OMElement) oneIter.next();
+            OMElement elementTwoChild = elementTwo.getFirstChildWithName(elementOneChild.getQName());
+            if (!compare(elementOneChild, elementTwoChild)) {
+                return false;
+            }
+
+            /*
+             * Cache for later access
+             */
+            map.put(elementOneChild.getQName(), elementOneChild);
+        }
+
+        /*
+         * Case the second element has more elements than the first
+         */
+        Iterator twoIter = elementTwo.getChildElements();
+        while (twoIter.hasNext()) {
+            OMElement elementTwoChild = (OMElement) twoIter.next();
+            if (!isIgnorable(elementTwoChild) && !map.containsKey(elementTwoChild.getQName())) {
+                return false;
+            }
+        }
+
+        return true;
+    }
+
+    private static boolean compareAttibutes(OMElement elementOne, OMElement elementTwo) {
+        int elementOneAtribCount = 0;
+        int elementTwoAtribCount = 0;
+        Iterator oneIter = elementOne.getAllAttributes();
+        while (oneIter.hasNext()) {
+
+            /*
+             * This catches a case where the first one has more items than the second one (one.attributes.size >
+             * two.attributes.size) and a case where the first and the second have a different attributes.
+             * (one.attributes.size == two.attributes.size)
+             */
+            OMAttribute omAttribute = (OMAttribute) oneIter.next();
+            OMAttribute attr = elementTwo.getAttribute(omAttribute.getQName());
+            if (attr == null) {
+                log.debug("Attribute " + omAttribute + " is not found in both elements.");
+                return false;
+            }
+            /*
+             * Count attributes in the first item
+             */
+            elementOneAtribCount++;
+        }
+
+        /*
+         * Count attributes in the second item
+         */
+        Iterator elementTwoIter = elementTwo.getAllAttributes();
+        while (elementTwoIter.hasNext()) {
+            elementTwoIter.next();
+            elementTwoAtribCount++;
+        }
+
+        /*
+         * This catches a case where the second one has more items than the first one. (two.attributes.size >
+         * one.attributes.size)
+         */
+        log.debug("Number of Attributes are equal? : " + (elementOneAtribCount == elementTwoAtribCount));
+        return elementOneAtribCount == elementTwoAtribCount;
+    }
+
+    /*
+     * Compare only URI not prefix
+     */
+    private static boolean compare(OMNamespace x, OMNamespace y) {
+        log.debug("Compare namespace:" + x + " with " + y);
+        return (x == null && y == null)
+                || (x != null && y != null && BrokerUtil.sameStringValue(x.getNamespaceURI(), y.getNamespaceURI()));
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WSMGParameter.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WSMGParameter.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WSMGParameter.java
new file mode 100644
index 0000000..06d435a
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WSMGParameter.java
@@ -0,0 +1,48 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.config;
+
+import org.apache.airavata.wsmg.commons.storage.WsmgQueue;
+
+public class WSMGParameter {
+
+    /**
+     * Global variable for the Out Going queue (contains message to send to subscribers)
+     */
+    public static WsmgQueue OUT_GOING_QUEUE = null; // default=null
+
+    public static final boolean testOutGoingQueueMaxiumLength = false; // default=false
+
+    // enable or disable the TimerThread that displays the message rate
+    public static final boolean measureMessageRate = false; // default=false
+
+    public static final boolean enableAutoCleanSubscriptions = false; // default=true
+
+    public static final boolean debugYFilter = false;
+
+    public static final boolean cleanQueueonStartUp = false; // default=true
+    public static final boolean requireSubscriptionRenew = true;
+    public static final long expirationTime = 1000 * 60 * 60 * 72; // 72 hours
+
+    public static final boolean showTrackId = false;
+    public static final String versionSetUpNote = "Added_Sub_Timeout";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WsmgConfigurationContext.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WsmgConfigurationContext.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WsmgConfigurationContext.java
new file mode 100644
index 0000000..c12f460
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/config/WsmgConfigurationContext.java
@@ -0,0 +1,118 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.config;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+
+import org.apache.airavata.wsmg.broker.NotificationProcessor;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionManager;
+import org.apache.airavata.wsmg.commons.config.ConfigurationManager;
+import org.apache.airavata.wsmg.commons.storage.WsmgQueue;
+import org.apache.airavata.wsmg.commons.storage.WsmgStorage;
+import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
+import org.apache.airavata.wsmg.matching.XPath.YFilterMessageMatcher;
+import org.apache.airavata.wsmg.messenger.OutGoingQueue;
+
+public class WsmgConfigurationContext {
+
+    private OutGoingQueue outgoingQueue = null;
+
+    private List<AbstractMessageMatcher> messageMatchers = new LinkedList<AbstractMessageMatcher>();
+
+    private ReentrantReadWriteLock messegeMatchersLock = new ReentrantReadWriteLock();
+
+    private ConfigurationManager configurationManager;
+
+    private SubscriptionManager subscriptionMan;
+
+    private NotificationProcessor notificationProcessor;
+
+    private WsmgStorage storage;
+
+    private WsmgQueue queue;
+
+    public WsmgConfigurationContext() {
+        outgoingQueue = new OutGoingQueue();
+        setDirectFilter();
+    }
+
+    private void setDirectFilter() {
+        messageMatchers.add(new YFilterMessageMatcher());
+        // messageMatchers.add(new DirectWsntMessageMatcher(subscriptions,
+        // publisherRegistrationDB));
+    }
+
+    public List<AbstractMessageMatcher> getMessageMatchers() {
+        return messageMatchers;
+    }
+
+    public OutGoingQueue getOutgoingQueue() {
+        return outgoingQueue;
+    }
+
+    public ConfigurationManager getConfigurationManager() {
+        return configurationManager;
+    }
+
+    public SubscriptionManager getSubscriptionManager() {
+        return subscriptionMan;
+    }
+
+    public NotificationProcessor getNotificationProcessor() {
+        return notificationProcessor;
+    }
+
+    public void setConfigurationManager(ConfigurationManager configMan) {
+        this.configurationManager = configMan;
+    }
+
+    public void setSubscriptionManager(SubscriptionManager subMan) {
+        this.subscriptionMan = subMan;
+    }
+
+    public void setNotificationProcessor(NotificationProcessor processor) {
+        this.notificationProcessor = processor;
+    }
+
+    public WsmgStorage getStorage() {
+        return storage;
+    }
+
+    public void setStorage(WsmgStorage s) {
+        storage = s;
+    }
+
+    public WsmgQueue getQueue() {
+        return queue;
+    }
+
+    public void setQueue(WsmgQueue s) {
+        queue = s;
+    }
+
+    public ReentrantReadWriteLock getMessegeMatcherLock() {
+        return messegeMatchersLock;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/AbstractMessageMatcher.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/AbstractMessageMatcher.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/AbstractMessageMatcher.java
new file mode 100644
index 0000000..dbd16f6
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/AbstractMessageMatcher.java
@@ -0,0 +1,89 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.matching;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantReadWriteLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock.ReadLock;
+import java.util.concurrent.locks.ReentrantReadWriteLock.WriteLock;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+
+public abstract class AbstractMessageMatcher {
+
+    protected Map<String, String> currentMessageCache;
+
+    private ReentrantReadWriteLock consumerListLock = new ReentrantReadWriteLock();
+
+    // infer types of
+    // key and value
+    public AbstractMessageMatcher() {
+        this.currentMessageCache = new HashMap<String, String>();
+    }
+
+    public abstract void start(String carrierLocation);
+
+    // Message can be either String or XmlElement. Added XMLElement for
+    // performance consideration so that if not using queue,
+    // we don't need to serialize to String
+    // If we already serialized to String because of the using queue, we don't
+    // have to change back to XMLElement until the delivery to consumers
+
+    public abstract void populateMatches(String wsntMessageConverterClassName,
+            AdditionalMessageContent additionalMessageContent, String message, String topic,
+            List<ConsumerInfo> matchedConsumers);
+
+    public abstract int handleUnsubscribe(String subscriptionId);
+
+    public abstract void handleSubscribe(SubscriptionState subscribeRequest, String subscriptionId);
+
+    public String handleGetCurrentMessage(String topic) {
+        String currentMessage = currentMessageCache.get(topic);
+        return currentMessage;
+    }
+
+    public void readLockUnlockConsumers(boolean lock) {
+        ReadLock readlock = consumerListLock.readLock();
+        lockUnlock(readlock, lock);
+    }
+
+    public void writeLockUnlockConsumers(boolean lock) {
+        WriteLock writeLock = consumerListLock.writeLock();
+        lockUnlock(writeLock, lock);
+    }
+
+    private void lockUnlock(Lock l, boolean lock) {
+
+        if (lock) {
+            l.lock();
+        } else {
+            l.unlock();
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterInfo.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterInfo.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterInfo.java
new file mode 100644
index 0000000..1881968
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterInfo.java
@@ -0,0 +1,156 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.matching.XPath;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.broker.ConsumerList;
+import org.apache.airavata.wsmg.broker.ConsumerListManager;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import edu.berkeley.cs.db.yfilter.filter.EXfilterBasic;
+import edu.berkeley.cs.db.yfilter.filter.SystemGlobals;
+import edu.berkeley.cs.db.yfilterplus.queryparser.Query;
+import edu.berkeley.cs.db.yfilterplus.queryparser.XPQuery;
+import edu.berkeley.cs.db.yfilterplus.xmltree.XMLTree;
+
+public class YFilterInfo {
+    private static final Logger logger = LoggerFactory.getLogger(YFilterInfo.class);
+
+    private EXfilterBasic yfilter = new EXfilterBasic();
+    private HashMap<Integer, String> yFilterIdToXPath = new HashMap<Integer, String>();
+    private HashMap<Integer, Query> yFilterIdToQuery = new HashMap<Integer, Query>();
+    private HashMap<String, Integer> xPathToYFilterId = new HashMap<String, Integer>();
+    private ConsumerListManager consumerListmanager = new ConsumerListManager();
+    private int index = 0;
+    private int counter = 0;
+
+    public EXfilterBasic getYfilter() {
+        return yfilter;
+    }
+
+    public void setYfilter(EXfilterBasic yfilter) {
+        this.yfilter = yfilter;
+    }
+
+    public HashMap<Integer, String> getYFilterIdToXPath() {
+        return yFilterIdToXPath;
+    }
+
+    public void setYFilterIdToXPath(HashMap<Integer, String> filterIdToXPath) {
+        yFilterIdToXPath = filterIdToXPath;
+    }
+
+    public void addXPathQuery(String xpathExpression, String subscriptionId, SubscriptionState subscribeRequest)
+            throws RuntimeException {
+        index++;
+        counter++;
+        if (WSMGParameter.debugYFilter)
+            logger.debug("QueryExp=" + xpathExpression);
+
+        Integer yFilterIdObj = xPathToYFilterId.get(xpathExpression);
+        int yFilterId = -1;
+        if (yFilterIdObj != null) {
+            yFilterId = yFilterIdObj.intValue();
+        } else {
+            Query query = XPQuery.parseQuery(xpathExpression, index);
+            if (query == null) {
+                throw new RuntimeException("Invalid XPath expression:" + xpathExpression);
+            }
+            if (WSMGParameter.debugYFilter)
+                logger.debug("addSubscription " + xpathExpression + " query :" + query);
+            yFilterId = yfilter.addQuery(query);
+            if (WSMGParameter.debugYFilter)
+                yfilter.printQueryIndex();
+            xPathToYFilterId.put(xpathExpression, Integer.valueOf(yFilterId));
+            yFilterIdToXPath.put(new Integer(yFilterId), xpathExpression);
+            yFilterIdToQuery.put(yFilterId, query);
+        }
+        if (WSMGParameter.debugYFilter)
+            logger.debug("YFilterId=" + yFilterId);
+
+        consumerListmanager.addToConsumerList(xpathExpression, subscribeRequest, subscriptionId);
+    }
+
+    public int removeSubscription(String subscriptionId) {
+
+        String xPath = consumerListmanager.getTokenBySubscriptionId(subscriptionId);
+        int result = consumerListmanager.removeFromConsumerList(subscriptionId, xPath);
+        if (result == 0) {
+            return 0;
+        }
+        int currentConsumerCount = consumerListmanager.getConsumerListByToken(xPath).size();
+        if (currentConsumerCount == 0) {
+            Integer yFilterId = xPathToYFilterId.get(xPath);
+            Query q = yFilterIdToQuery.get(yFilterId);
+            yfilter.deleteQuery(q, q.getQueryId());
+            yFilterIdToQuery.remove(yFilterId);
+        }
+        counter--;
+        return result;
+    }
+
+    public List<ConsumerInfo> getMatchingConsumerList(String messageString) {
+        List<ConsumerInfo> matchingConsumerList = new LinkedList<ConsumerInfo>();
+        XMLTree tree = new XMLTree(new java.io.StringReader(messageString));
+        if (WSMGParameter.debugYFilter)
+            tree.print();
+        yfilter.setEventSequence(tree.getEvents());
+        yfilter.startParsing();
+
+        // print the matched queries //
+        if (SystemGlobals.hasQueries) {
+            if (WSMGParameter.debugYFilter)
+
+                yfilter.printQueryResults(System.out);
+        } else {
+            System.out.println("no match");
+            return matchingConsumerList;
+        }
+
+        Iterator<Integer> it = (Iterator<Integer>) yfilter.getMatchedQueries().iterator();
+        while (it.hasNext()) {
+            Integer qid = it.next();
+
+            String xpath = yFilterIdToXPath.get(qid);
+            ConsumerList consumerList = consumerListmanager.getConsumerListByToken(xpath);
+
+            if (consumerList != null) {// has subscription to this topic
+                matchingConsumerList.addAll(consumerList.getConsumerList());
+            }
+        }
+        yfilter.clear();
+        return matchingConsumerList;
+    }
+
+    public int getCounter() {
+        return counter;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterMessageMatcher.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterMessageMatcher.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterMessageMatcher.java
new file mode 100644
index 0000000..0f59ec1
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/XPath/YFilterMessageMatcher.java
@@ -0,0 +1,183 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.matching.XPath;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.broker.ConsumerList;
+import org.apache.airavata.wsmg.broker.ConsumerListManager;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
+import org.apache.airavata.wsmg.messenger.OutGoingQueue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class YFilterMessageMatcher extends AbstractMessageMatcher {
+
+    private static final Logger logger = LoggerFactory.getLogger(YFilterMessageMatcher.class);
+
+    private OutGoingQueue outGoingQueue = null;
+
+    private HashMap<String, YFilterInfo> topicToYFilterInfo = new HashMap<String, YFilterInfo>();
+    private HashMap<String, String> subIdToTopic = new HashMap<String, String>();
+
+    // used for topic only subscription, so that we don't have to create a
+    // YFilter object
+    private ConsumerListManager consumerListmanager = new ConsumerListManager();
+
+    public YFilterMessageMatcher() {
+        super();
+    }
+
+    public void start(String carrierLocation) {
+        currentMessageCache = new Hashtable<String, String>();
+    }
+
+    @Override
+    public void populateMatches(String wsntMessageConverterClassName,
+            AdditionalMessageContent additionalMessageContent, String message, String topic,
+            List<ConsumerInfo> matchedConsumers) {
+
+        assert (matchedConsumers != null);
+
+        if (WSMGParameter.debugYFilter)
+            logger.info("Message In YFilterAdapter=" + message);
+
+        // Important Get a Read Lock....
+        readLockUnlockConsumers(true);
+        try {
+
+            // 1, Topic only
+            ConsumerList topicConsumerList = consumerListmanager.getConsumerListByToken(topic);
+            if (topicConsumerList != null) {// has subscription to this topic
+
+                ArrayList<ConsumerInfo> list = topicConsumerList.getConsumerList();
+                matchedConsumers.addAll(list);
+            }
+            // 2, wild card topic only
+            ConsumerList wildcardConsumerList = consumerListmanager
+                    .getConsumerListByToken(WsmgCommonConstants.WILDCARD_TOPIC);
+            if (wildcardConsumerList != null) {// has wildcard subscriptions
+                List<ConsumerInfo> wildCardConsumerInfoList = wildcardConsumerList.getConsumerList();
+                if (wildCardConsumerInfoList != null) {
+                    // System.out.println("ConsumerListSize2="+wildCardConsumerInfoList.size());
+                    matchedConsumers.addAll(wildCardConsumerInfoList);
+                }
+            }
+            // 3, topic with Xpath
+            YFilterInfo yfilterInfo = topicToYFilterInfo.get(topic);
+            if (yfilterInfo != null) {
+                List<ConsumerInfo> topicAndXPathConsumerInfoList = yfilterInfo.getMatchingConsumerList(message);
+                if (topicAndXPathConsumerInfoList != null) {
+                    // System.out.println("ConsumerListSize3="+topicAndXPathConsumerInfoList.size());
+                    matchedConsumers.addAll(topicAndXPathConsumerInfoList);
+                }
+            }
+            // 4, wild card topic with Xpath (XPath only)
+            yfilterInfo = topicToYFilterInfo.get(WsmgCommonConstants.WILDCARD_TOPIC);
+            if (yfilterInfo != null) {
+                List<ConsumerInfo> wildcardTopicAndXPathConsumerInfoList = yfilterInfo.getMatchingConsumerList(message);
+                if (wildcardTopicAndXPathConsumerInfoList != null) {
+                    // System.out.println("ConsumerListSize4="+wildcardTopicAndXPathConsumerInfoList.size());
+                    matchedConsumers.addAll(wildcardTopicAndXPathConsumerInfoList);
+                }
+            }
+
+        } finally {
+
+            // Release the Read Lock...
+            readLockUnlockConsumers(false);
+        }
+
+    }
+
+    public int handleUnsubscribe(String subscriptionId) {
+
+        int ret = 1;
+
+        writeLockUnlockConsumers(true);
+        try {
+            String topicExpression = subIdToTopic.get(subscriptionId);
+            if (subscriptionId.startsWith("T")) { // Topic only
+                consumerListmanager.removeFromConsumerList(subscriptionId, topicExpression);
+            } else {
+                YFilterInfo yfilterInfo = topicToYFilterInfo.get(topicExpression);
+                if (yfilterInfo != null) {
+                    yfilterInfo.removeSubscription(subscriptionId);
+                    if (yfilterInfo.getCounter() == 0) {
+                        yfilterInfo = null;
+                        topicToYFilterInfo.remove(topicExpression);
+                    }
+                } else {
+                    System.out.println("ERROR: Cannot find subscription with the subId=" + subscriptionId);
+                    ret = 0;
+                }
+            }
+        } finally {
+            writeLockUnlockConsumers(false);
+        }
+
+        return ret;
+    }
+
+    public void handleSubscribe(SubscriptionState subscribeRequest, String subscriptionId) {
+
+        // Get the write lock
+        writeLockUnlockConsumers(true);
+        try {
+
+            String topicExpression = subscribeRequest.getLocalTopic();
+            subIdToTopic.put(subscriptionId, topicExpression);
+
+            String xpathExpression = subscribeRequest.getXpathString();
+            if (xpathExpression == null || xpathExpression.length() == 0) { // Topic
+                // only
+                consumerListmanager.addToConsumerList(topicExpression, subscribeRequest, subscriptionId);
+            } else {
+                YFilterInfo yfilterInfo = topicToYFilterInfo.get(topicExpression);
+                if (yfilterInfo == null) {
+                    yfilterInfo = new YFilterInfo();
+                    topicToYFilterInfo.put(topicExpression, yfilterInfo);
+                }
+                yfilterInfo.addXPathQuery(xpathExpression, subscriptionId, subscribeRequest);
+            }
+
+            if (outGoingQueue == null) {
+                outGoingQueue = subscribeRequest.getOutGoingQueue();
+            }
+
+        } finally {
+            // release the write lock
+            writeLockUnlockConsumers(false);
+        }
+
+        return;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/simpleTopic/DirectWsntMessageMatcher.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/simpleTopic/DirectWsntMessageMatcher.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/simpleTopic/DirectWsntMessageMatcher.java
new file mode 100644
index 0000000..ba50e45
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/matching/simpleTopic/DirectWsntMessageMatcher.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.matching.simpleTopic;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.broker.ConsumerList;
+import org.apache.airavata.wsmg.broker.ConsumerListManager;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.matching.AbstractMessageMatcher;
+import org.apache.airavata.wsmg.messenger.OutGoingQueue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DirectWsntMessageMatcher extends AbstractMessageMatcher {
+
+    private static final Logger logger = LoggerFactory.getLogger(DirectWsntMessageMatcher.class);
+
+    private ConsumerListManager consumerListmanager = new ConsumerListManager();
+
+    private OutGoingQueue outGoingQueue = null;
+
+    public DirectWsntMessageMatcher() {
+        super();
+    }
+
+    public void start(String carrierLocation) {
+        currentMessageCache = new Hashtable<String, String>();
+    }
+
+    public void handleSubscribe(SubscriptionState subscribeRequest, String subscriptionId) {
+
+        String topicExpression = subscribeRequest.getLocalTopic();
+        if (topicExpression == null || topicExpression.length() == 0) {
+            logger.error("ERROR:WsntAdapterConnection creation failed.");
+            return;
+        }
+
+        writeLockUnlockConsumers(true);
+
+        try {
+            consumerListmanager.addToConsumerList(topicExpression, subscribeRequest, subscriptionId);
+            if (outGoingQueue == null) {
+                outGoingQueue = subscribeRequest.getOutGoingQueue();
+            }
+        } finally {
+            writeLockUnlockConsumers(false);
+        }
+
+        return;
+
+    }
+
+    public int handleUnsubscribe(String subscriptionId) {
+
+        int ret = 0;
+
+        writeLockUnlockConsumers(true);
+        try {
+            ret = consumerListmanager.removeFromConsumerList(subscriptionId, null);
+        } finally {
+            writeLockUnlockConsumers(false);
+        }
+
+        return ret;
+    }
+
+    @Override
+    public void populateMatches(String wsntMessageConverterClassName,
+            AdditionalMessageContent additionalMessageContent, String message, String topic,
+            List<ConsumerInfo> matchedConsumers) {
+
+        assert (matchedConsumers != null);
+
+        readLockUnlockConsumers(true);
+
+        try {
+
+            ConsumerList topicConsumerList = consumerListmanager.getConsumerListByToken(topic);
+            ConsumerList wildcardConsumerList = consumerListmanager
+                    .getConsumerListByToken(WsmgCommonConstants.WILDCARD_TOPIC);
+            if (topicConsumerList != null) {// has subscription to this topic
+
+                ArrayList<ConsumerInfo> list = topicConsumerList.getConsumerList();
+
+                matchedConsumers.addAll(list);
+            }
+            if (wildcardConsumerList != null) {// has wildcard subscriptions
+                List<ConsumerInfo> wildCardConsumerInfoList = wildcardConsumerList.getConsumerList();
+                if (wildCardConsumerInfoList != null) {
+                    matchedConsumers.addAll(wildCardConsumerInfoList);
+                }
+            }
+
+        } finally {
+            readLockUnlockConsumers(false);
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/ConsumerUrlManager.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/ConsumerUrlManager.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/ConsumerUrlManager.java
new file mode 100644
index 0000000..c9b255f
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/ConsumerUrlManager.java
@@ -0,0 +1,195 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger;
+
+import java.net.NoRouteToHostException;
+import java.net.SocketTimeoutException;
+import java.util.Map.Entry;
+import java.util.Timer;
+import java.util.TimerTask;
+import java.util.concurrent.ConcurrentHashMap;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.config.ConfigurationManager;
+import org.apache.airavata.wsmg.util.RunTimeStatistics;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ConsumerUrlManager {
+
+    private static final Logger logger = LoggerFactory.getLogger(ConsumerUrlManager.class);
+
+    private ConcurrentHashMap<String, FailedConsumerInfo> failedConsumerUrls = new ConcurrentHashMap<String, FailedConsumerInfo>();
+
+    private final int defaultMaxRetry;
+
+    private long expireTimeGap; // milliseconds
+
+    private Timer cleanupTimer;
+
+    public ConsumerUrlManager(ConfigurationManager config) {
+
+        defaultMaxRetry = config.getConfig(WsmgCommonConstants.CONFIG_MAX_MESSAGE_DELIVER_RETRIES, 2);
+
+        // time is in milliseconds
+        expireTimeGap = 1000 * 60 * config.getConfig(WsmgCommonConstants.CONFIG_CONSUMER_URL_EXPIRATION_TIME_GAP, 5l);
+
+        // let minimum time to be 1 minute
+        long timerThreadInterval = Math.max(expireTimeGap / 5, 1000 * 60);
+
+        cleanupTimer = new Timer("Failed consumer url handler", true);
+        cleanupTimer.scheduleAtFixedRate(new URLCleanUpTask(), 0, timerThreadInterval);
+    }
+
+    public void stop() {
+        logger.info("Stop ConsumerUrlManager");
+        if (this.cleanupTimer != null) {
+            this.cleanupTimer.cancel();
+        }
+        logger.info("ConsumerUrlManager Stopped");
+    }
+
+    public void onFailedDelivery(EndpointReference consumerEndpointReference, long timeFinished, long timeTaken,
+            AxisFault exception, AdditionalMessageContent headers) {
+        String url = consumerEndpointReference.getAddress();
+
+        RunTimeStatistics.addNewFailedDeliverTime(timeTaken);
+        RunTimeStatistics.addFailedConsumerURL(url);
+
+        if (isEligibleToBlackList(exception)) {
+
+            synchronized (failedConsumerUrls) {
+                FailedConsumerInfo info = failedConsumerUrls.get(url);
+                if (info == null) {
+                    info = new FailedConsumerInfo();
+                    failedConsumerUrls.put(url, info);
+                }
+                info.incrementNumberOfTimesTried(timeFinished + expireTimeGap);
+            }
+
+        } else {
+
+            String errorMsg = String.format("unable to deliver message: [%s] to consumer: [%s], " + "reason: [%s]",
+                    headers.toString(), url, exception.getMessage());
+
+            logger.error(errorMsg);
+        }
+    }
+
+    public void onSucessfullDelivery(EndpointReference consumerEndpointReference, long timeTaken) {
+
+        RunTimeStatistics.addNewSuccessfulDeliverTime(timeTaken);
+        synchronized (failedConsumerUrls) {
+
+            FailedConsumerInfo info = failedConsumerUrls.remove(consumerEndpointReference.getAddress());
+
+            if (info != null) {
+                logger.debug(String.format("message was delivered to " + "previously %d times failed url : %s",
+                        info.getNumberOfTimesTried(), consumerEndpointReference.getAddress()));
+            }
+        }
+    }
+
+    public boolean isUnavailable(String url) {
+        synchronized (failedConsumerUrls) {
+            FailedConsumerInfo info = failedConsumerUrls.get(url);
+            return (info != null && info.isMaxRetryCountReached());
+        }
+    }
+
+    private boolean isEligibleToBlackList(AxisFault f) {
+
+        Throwable cause = f.getCause();
+
+        if (cause == null) {
+            logger.error("unknown error occured", cause);
+            return false;
+        }
+
+        /*
+         * if timeout because of the set timeout in this class In windows, timeout cause ConnectException with
+         * "Connection timed out" message
+         */
+        if (cause instanceof SocketTimeoutException || cause.getMessage().indexOf("timed out") > 0
+                || cause instanceof NoRouteToHostException) {
+            return true;
+        }
+
+        return false;
+    }
+
+    class FailedConsumerInfo {
+
+        private int numberOfTimesTried;
+        private long expiryTime;
+
+        public void incrementNumberOfTimesTried(long expireTime) {
+            numberOfTimesTried++;
+            expiryTime = expireTime;
+        }
+
+        public void decrementNumberOfTimeTried() {
+            numberOfTimesTried--;
+        }
+
+        public int getNumberOfTimesTried() {
+            return numberOfTimesTried;
+        }
+
+        public boolean isMaxRetryCountReached() {
+            return numberOfTimesTried >= defaultMaxRetry;
+        }
+
+        public long getLastAtteptExpiryTime() {
+            return expiryTime;
+        }
+
+    }
+
+    class URLCleanUpTask extends TimerTask {
+
+        @Override
+        public void run() {
+
+            logger.debug("starting to clean up black listed consumer urls");
+            long currentTime = System.currentTimeMillis();
+
+            synchronized (failedConsumerUrls) {
+                for (Entry<String, FailedConsumerInfo> entry : failedConsumerUrls.entrySet()) {
+                    FailedConsumerInfo info = entry.getValue();
+
+                    if (info.isMaxRetryCountReached() && info.getLastAtteptExpiryTime() >= currentTime) {
+
+                        info.decrementNumberOfTimeTried();
+                        logger.info("decrementing number of times" + " tried for consumer url: " + entry.getKey());
+
+                    }
+                }
+            }
+
+            logger.debug("finished cleaning black listed consumer urls");
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/Deliverable.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/Deliverable.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/Deliverable.java
new file mode 100644
index 0000000..92b6cfe
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/Deliverable.java
@@ -0,0 +1,32 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.wsmg.messenger;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.messenger.protocol.DeliveryProtocol;
+import org.apache.axiom.om.OMElement;
+
+public interface Deliverable {
+    void setProtocol(DeliveryProtocol protocol);
+
+    void send(ConsumerInfo consumerInfo, OMElement message, AdditionalMessageContent additionalMessageContent);
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/DeliveryProcessor.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/DeliveryProcessor.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/DeliveryProcessor.java
new file mode 100644
index 0000000..7eb5b4f
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/DeliveryProcessor.java
@@ -0,0 +1,90 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.wsmg.messenger;
+
+import org.apache.airavata.wsmg.commons.OutGoingMessage;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DeliveryProcessor {
+
+    private static final Logger logger = LoggerFactory.getLogger(DeliveryProcessor.class);
+
+    private SendingStrategy strategy;
+    private Deliverable deliverable;
+
+    private boolean running;
+    private Thread t;
+
+    public DeliveryProcessor(Deliverable deliverable, SendingStrategy strategy) {
+        this.strategy = strategy;
+        this.deliverable = deliverable;
+    }
+
+    public void start() {
+        this.running = true;
+        this.t = new Thread(new CheckingAndSending());
+        this.t.start();
+    }
+
+    public void stop() {
+        this.running = false;
+
+        if (this.t != null) {
+            this.t.interrupt();
+
+            try {
+                this.t.join();
+            } catch (InterruptedException ie) {
+                logger.error("Wait for sending thread to finish (join) is interrupted");
+            }
+        }
+
+        WSMGParameter.OUT_GOING_QUEUE.dispose();
+    }
+
+    private class CheckingAndSending implements Runnable {
+
+        public void run() {
+            strategy.init();
+            while (running) {
+                logger.debug("run - delivery thread");
+                try {
+
+                    OutGoingMessage outGoingMessage = (OutGoingMessage) WSMGParameter.OUT_GOING_QUEUE.blockingDequeue();
+
+                    if (WSMGParameter.showTrackId)
+                        logger.debug(outGoingMessage.getAdditionalMessageContent().getTrackId()
+                                + ": dequeued from outgoing queue");
+
+                    strategy.addMessageToSend(outGoingMessage, deliverable);
+
+                } catch (Exception e) {
+                    logger.warn("Unexpected_exception:");
+                }
+            }
+            logger.debug("Shutdown Strategy");
+            strategy.shutdown();
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/OutGoingQueue.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/OutGoingQueue.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/OutGoingQueue.java
new file mode 100644
index 0000000..6764a42
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/OutGoingQueue.java
@@ -0,0 +1,65 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.messenger;
+
+import org.apache.airavata.wsmg.commons.OutGoingMessage;
+import org.apache.airavata.wsmg.config.WSMGParameter;
+import org.apache.airavata.wsmg.util.Counter;
+import org.apache.airavata.wsmg.util.TimerThread;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class OutGoingQueue {
+
+    private static final Logger logger = LoggerFactory.getLogger(OutGoingQueue.class);
+
+    private Counter storeToOutQueueCounter;
+
+    public OutGoingQueue() {
+        if (WSMGParameter.measureMessageRate) {
+            storeToOutQueueCounter = new Counter();
+            TimerThread timerThread = new TimerThread(storeToOutQueueCounter, " StoreToOutQueueCounter");
+            new Thread(timerThread).start();
+        }
+    }
+
+    // need synchronized???
+    public void storeNotification(OutGoingMessage outGoingMessage, long messageId) {
+
+        boolean loop = false;
+        do {
+            // this outgoing Queue is created inside the messenger which is
+            // intended to send the notification message to the consumer.
+            WSMGParameter.OUT_GOING_QUEUE.enqueue(outGoingMessage, outGoingMessage.getAdditionalMessageContent()
+                    .getTrackId());
+            if (WSMGParameter.measureMessageRate) {
+                storeToOutQueueCounter.addCounter();
+            }
+            if (WSMGParameter.testOutGoingQueueMaxiumLength && storeToOutQueueCounter.getCounterValue() < 1000000) {
+                loop = true;
+            }else{
+                loop = false;
+            }
+        } while (loop);
+
+    }
+}


[09/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java
deleted file mode 100644
index 81a5589..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionNode.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptions;
-import org.apache.airavata.xbaya.model.registrybrowser.InputParameters;
-import org.apache.airavata.xbaya.model.registrybrowser.OutputParameters;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.DeploymentDescriptionDialog;
-
-public class ServiceDescriptionNode extends AbstractAiravataTreeNode {
-	private ServiceDescription serviceDescription;
-
-	public ServiceDescriptionNode(ServiceDescription serviceDescription, TreeNode parent) {
-		super(parent);
-		setServiceDescription(serviceDescription);
-	}
-
-	@Override
-	protected List<TreeNode> getChildren() {
-		List<Object> parameterTypeList=new ArrayList<Object>();
-		if (getServiceDescription().getType().getInputParametersArray().length>0){
-			parameterTypeList.add(new InputParameters(getServiceDescription().getType().getInputParametersArray()));
-		}
-		if (getServiceDescription().getType().getOutputParametersArray().length>0){
-			parameterTypeList.add(new OutputParameters(getServiceDescription().getType().getOutputParametersArray()));
-		}
-		parameterTypeList.add(new ApplicationDeploymentDescriptions(getRegistry(),getServiceDescription().getType().getName()));
-		return getTreeNodeList(parameterTypeList.toArray(), this);
-	}
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return getServiceDescription().getType().getName();
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.SERVICE_ICON;
-    }
-
-    public ServiceDescription getServiceDescription() {
-        return serviceDescription;
-    }
-
-    public void setServiceDescription(ServiceDescription serviceDescription) {
-        this.serviceDescription = serviceDescription;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(EditAction.ID, DeleteAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(DeleteAction.ID)) {
-        	return deleteServiceDescription(tree);
-        } else if (action.equals(EditAction.ID)) {
-        	return editServiceDescription(tree);
-        }
-        return super.triggerAction(tree, action);
-    }
-
-	private boolean editServiceDescription(JTree tree) {
-		DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(getRegistry(),false,getServiceDescription(), null);
-    	serviceDescriptionDialog.open();
-//		ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),false,getServiceDescription());
-//		serviceDescriptionDialog.open();
-		if (serviceDescriptionDialog.isServiceCreated()) {
-		    refresh();
-		    reloadTreeNode(tree, this);
-		}
-		return true;
-	}
-
-    private boolean deleteServiceDescription(JTree tree) throws AiravataAPIInvocationException {
-        if (askQuestion("Application", "Are you sure that you want to remove the applications associated with \""
-                + getServiceDescription().getType().getName() + "\"?")) {
-            getRegistry().getApplicationManager().deleteServiceDescription(getServiceDescription().getType().getName());
-            ((AbstractAiravataTreeNode) getParent()).refresh();
-            reloadTreeNode(tree, getParent());
-        }
-        return true;
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(DeleteAction.ID)) {
-            return "Remove";
-        } else if (action.getID().equals(EditAction.ID)) {
-            return "View/Edit";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	@Override
-	public String getDefaultAction() {
-		return EditAction.ID;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java
deleted file mode 100644
index dbfce2e..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ServiceDescriptionsNode.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.xbaya.model.registrybrowser.ServiceDescriptions;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-import org.apache.airavata.xbaya.ui.dialogs.descriptors.DeploymentDescriptionDialog;
-
-public class ServiceDescriptionsNode extends AbstractAiravataTreeNode {
-    private ServiceDescriptions serviceDescriptions;
-
-    public ServiceDescriptionsNode(ServiceDescriptions serviceDescriptions, TreeNode parent) {
-        super(parent);
-        setServiceDescriptions(serviceDescriptions);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        try {
-            return getTreeNodeList(getServiceDescriptions().getDescriptions().toArray(), this);
-        } catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();
-            return emptyList();
-        } catch (RegistryException e) {
-            e.printStackTrace();
-            return emptyList();
-        }
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return "Applications";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.SERVICES_ICON;
-    }
-
-    public ServiceDescriptions getServiceDescriptions() {
-        return serviceDescriptions;
-    }
-
-    public void setServiceDescriptions(ServiceDescriptions serviceDescriptions) {
-        this.serviceDescriptions = serviceDescriptions;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(AddAction.ID, RefreshAction.ID, DeleteAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(DeleteAction.ID)) {
-            deleteServiceDescription(tree);
-            return true;
-        } else if (action.equals(AddAction.ID)) {
-        	DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(null, getRegistry());
-        	serviceDescriptionDialog.open();
-//            ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry());
-//            serviceDescriptionDialog.open();
-            if (serviceDescriptionDialog.isServiceCreated()) {
-                refresh();
-                reloadTreeNode(tree, this);
-            }
-            return true;
-        }
-        return super.triggerAction(tree, action);
-    }
-
-    private void deleteServiceDescription(JTree tree) throws Exception {
-        if (askQuestion("Applications",
-                "Are you sure that you want to remove all applications defined in this registry?")) {
-            AiravataAPI registry = getRegistry();
-            List<ServiceDescription> descriptions = getServiceDescriptions().getDescriptions();
-            for (ServiceDescription descriptionWrap : descriptions) {
-                registry.getApplicationManager().deleteServiceDescription(descriptionWrap.getType().getName());
-            }
-            refresh();
-            reloadTreeNode(tree, this);
-        }
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(DeleteAction.ID)) {
-            return "Remove all Applicatons";
-        } else if (action.getID().equals(AddAction.ID)) {
-            return "Register Application...";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentNode.java
deleted file mode 100644
index d7294db..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentNode.java
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.*;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.workflow.ExperimentName;
-import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiment;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-
-public class XBayaWorkflowExperimentNode extends AbstractAiravataTreeNode {
-	private XBayaWorkflowExperiment experiment;
-	private String workflowExecutionName;
-	
-    public XBayaWorkflowExperimentNode(XBayaWorkflowExperiment experiment, TreeNode parent) {
-        super(parent);
-        setExperiment(experiment);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return getTreeNodeList(getExperiment().getWorkflows().toArray(), this);
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-    	if (workflowExecutionName==null) {
-			try {
-				workflowExecutionName = getRegistry().getProvenanceManager().getExperimentName(getExperiment().getExperimentId()).getInstanceName();
-			} catch (AiravataAPIInvocationException e) {
-				e.printStackTrace();
-			}
-			if (workflowExecutionName==null){
-				workflowExecutionName="["+getExperiment().getExperimentId()+"]";
-			}
-		}
-    	String caption=workflowExecutionName;
-    	try {
-			WorkflowExecutionStatus workflowExecutionStatus = getRegistry().getProvenanceManager().getWorkflowInstanceStatus(getExperiment().getExperimentId(), getExperiment().getExperimentId());
-			if (workflowExecutionStatus!=null && workflowExecutionStatus.getExecutionStatus()!=null){
-				caption += " - <i>" + workflowExecutionStatus.getExecutionStatus().toString()+"</i>";
-				if (workflowExecutionStatus.getStatusUpdateTime()!=null) {
-						caption += "<i> as of " + workflowExecutionStatus.getStatusUpdateTime().toString() + "</i>";
-				}
-			}
-		} catch (AiravataAPIInvocationException e) {
-			e.printStackTrace();
-		}
-		return wrapAsHtml(caption);
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.WORKFLOW_EXPERIMENT_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(CopyAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(CopyAction.ID)) {
-            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getExperimentInfo()), null);
-        }
-        return super.triggerAction(tree, action);
-    }
-
-    private String getExperimentName (){
-        String experimentId = getExperiment().getExperimentId();
-        try {
-            ExperimentName experimentName = getExperiment().getAiravataAPI().getProvenanceManager().getExperimentName(experimentId);
-            return experimentName.getInstanceName();
-        } catch (AiravataAPIInvocationException e) {
-            return null;
-        }
-    }
-
-    private String getExperimentInfo (){
-        String experimetName = getExperimentName();
-        String experimetID = getExperiment().getExperimentId();
-        return "[Experiment Name = " + experimetName + ", Experiment ID = " + experimetID + "]";
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(CopyAction.ID)) {
-            return "Copy Experiment Info to clipboard";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public XBayaWorkflowExperiment getExperiment() {
-		return experiment;
-	}
-
-	public void setExperiment(XBayaWorkflowExperiment experiment) {
-		this.experiment = experiment;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentsNode.java
deleted file mode 100644
index 420dea3..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowExperimentsNode.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiments;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class XBayaWorkflowExperimentsNode extends AbstractAiravataTreeNode {
-	private XBayaWorkflowExperiments experiments;
-	
-    public XBayaWorkflowExperimentsNode(XBayaWorkflowExperiments experiments, TreeNode parent) {
-        super(parent);
-        setExperiments(experiments);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return getTreeNodeList(getExperiments().getAllExperiments().toArray(), this);
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return "Experiments";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.WORKFLOW_EXPERIMENTS_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(RefreshAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        return super.triggerAction(tree, action);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public XBayaWorkflowExperiments getExperiments() {
-		return experiments;
-	}
-
-	public void setExperiments(XBayaWorkflowExperiments experiments) {
-		this.experiments = experiments;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNode.java
deleted file mode 100644
index 1d38b80..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNode.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.*;
-import java.awt.datatransfer.StringSelection;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflow;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
-
-public class XBayaWorkflowNode extends AbstractAiravataTreeNode {
-    private XBayaWorkflow xbayaWorkflow;
-
-    public XBayaWorkflowNode(XBayaWorkflow xbayaWorkflow, TreeNode parent) {
-        super(parent);
-        setXbayaWorkflow(xbayaWorkflow);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return getTreeNodeList(getXbayaWorkflow().getWorkflowServices().toArray(),this);
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-    	String caption=getXbayaWorkflow().getWorkflowId();
-    	if (getXbayaWorkflow().getWorkflowName()!=null){
-    		caption=getXbayaWorkflow().getWorkflowName()+" : "+caption;
-    	}
-        return caption;
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.WORKFLOW_ICON;
-    }
-
-    public XBayaWorkflow getXbayaWorkflow() {
-        return xbayaWorkflow;
-    }
-
-    public void setXbayaWorkflow(XBayaWorkflow xbayaWorkflow) {
-        this.xbayaWorkflow = xbayaWorkflow;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(CopyAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(CopyAction.ID)) {
-            Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getWorkflowInfo()), null);
-        }
-        return super.triggerAction(tree, action);
-    }
-
-    private String getWorkflowInfo (){
-        String workflowName = getXbayaWorkflow().getWorkflowName();
-        String workflowId = getXbayaWorkflow().getWorkflowId();
-        return "[Worklfow Name = " + workflowName + ", Workflow Instance ID = " + workflowId + "]";
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(CopyAction.ID)) {
-            return "Copy Workflow Info to clipboard";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNodeElementNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNodeElementNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNodeElementNode.java
deleted file mode 100644
index 5cf32de..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowNodeElementNode.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.ServiceParameters;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowNodeElement;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-
-public class XBayaWorkflowNodeElementNode extends AbstractAiravataTreeNode {
-    private XBayaWorkflowNodeElement xbayaWorkflowService;
-
-    public XBayaWorkflowNodeElementNode(XBayaWorkflowNodeElement xbayaWorkflowNodeElement, TreeNode parent) {
-        super(parent);
-        setXbayaWorkflowNodeElement(xbayaWorkflowNodeElement);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-		List<ServiceParameters> parameterTypeList=new ArrayList<ServiceParameters>();
-		if (getXbayaWorkflowNodeElement().getInputParameters()!=null && getXbayaWorkflowNodeElement().getInputParameters().getParameters().size()>0){
-			parameterTypeList.add(getXbayaWorkflowNodeElement().getInputParameters());
-		}
-		if (getXbayaWorkflowNodeElement().getOutputParameters()!=null && getXbayaWorkflowNodeElement().getOutputParameters().getParameters().size()>0){
-			parameterTypeList.add(getXbayaWorkflowNodeElement().getOutputParameters());
-		}
-		return getTreeNodeList(parameterTypeList.toArray(), this);
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        String type = getXbayaWorkflowNodeElement().getNodeData().getType().toString();
-//        if (selected) {
-//			type = " <font color=\"#D3D3D3\">Service call</font>";
-//		}
-		return wrapAsHtml(getXbayaWorkflowNodeElement().getNodeId()," [", type, "]");
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.WORKFLOW_SERVICE_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList();
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        return super.triggerAction(tree, action);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public XBayaWorkflowNodeElement getXbayaWorkflowNodeElement() {
-		return xbayaWorkflowService;
-	}
-
-	public void setXbayaWorkflowNodeElement(XBayaWorkflowNodeElement xbayaWorkflowNodeElement) {
-		this.xbayaWorkflowService = xbayaWorkflowNodeElement;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplateNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplateNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplateNode.java
deleted file mode 100644
index 0edc847..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplateNode.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.jcr.PathNotFoundException;
-import javax.swing.Icon;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.registry.api.exception.ServiceDescriptionRetrieveException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplate;
-import org.apache.airavata.xbaya.registry.RegistryAccesser;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.ImportAction;
-import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
-
-public class XBayaWorkflowTemplateNode extends AbstractAiravataTreeNode {
-    private XBayaWorkflowTemplate xbayaWorkflow;
-
-    public XBayaWorkflowTemplateNode(XBayaWorkflowTemplate xbayaWorkflow, TreeNode parent) {
-        super(parent);
-        setXbayaWorkflow(xbayaWorkflow);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return emptyList();
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return getXbayaWorkflow().getWorkflowName();
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.WORKFLOW_TEMPLATE_ICON;
-    }
-
-    public XBayaWorkflowTemplate getXbayaWorkflow() {
-        return xbayaWorkflow;
-    }
-
-    public void setXbayaWorkflow(XBayaWorkflowTemplate xbayaWorkflow) {
-        this.xbayaWorkflow = xbayaWorkflow;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(ImportAction.ID,DeleteAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(DeleteAction.ID)) {
-            deleteHostDescription(tree);
-            return true;
-        } else if (action.equals(ImportAction.ID)) {
-        	Workflow workflow = new RegistryAccesser(getXBayaEngine()).getWorkflow(getXbayaWorkflow().getWorkflowName());
-            GraphCanvas newGraphCanvas = getXBayaEngine().getGUI().newGraphCanvas(true);
-            newGraphCanvas.setWorkflow(workflow);
-            getXBayaEngine().getGUI().getGraphCanvas().setWorkflowFile(null);
-            return true;
-        }
-        return super.triggerAction(tree, action);
-    }
-
-    private void deleteHostDescription(JTree tree) throws PathNotFoundException, ServiceDescriptionRetrieveException {
-        if (askQuestion("XBaya Workflow", "Are you sure that you want to remove the workflow \""
-                + getXbayaWorkflow().getWorkflowName() + "\"?")) {
-            try {
-				getRegistry().getWorkflowManager().removeWorkflow(getXbayaWorkflow().getWorkflowName());
-				((AbstractAiravataTreeNode) getParent()).refresh();
-				reloadTreeNode(tree, getParent());
-			} catch (AiravataAPIInvocationException e) {
-				e.printStackTrace();
-			}
-        }
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(DeleteAction.ID)) {
-            return "Remove";
-        } else if (action.getID().equals(ImportAction.ID)) {
-            return "Import";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-    
-    @Override
-    public String getDefaultAction() {
-    	return ImportAction.ID;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplatesNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplatesNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplatesNode.java
deleted file mode 100644
index f3b0c43..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/XBayaWorkflowTemplatesNode.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JOptionPane;
-import javax.swing.JTree;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplates;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class XBayaWorkflowTemplatesNode extends AbstractAiravataTreeNode {
-    private XBayaWorkflowTemplates xbayaWorkflows;
-
-    public XBayaWorkflowTemplatesNode(XBayaWorkflowTemplates xbayaWorkflows, TreeNode parent) {
-        super(parent);
-        setXbayaWorkflows(xbayaWorkflows);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-        return getTreeNodeList(getXbayaWorkflows().getWorkflows().toArray(), this);
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return "Workflow Templates";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.WORKFLOW_TEMPLATES_ICON;
-    }
-
-    public XBayaWorkflowTemplates getXbayaWorkflows() {
-        return xbayaWorkflows;
-    }
-
-    public void setXbayaWorkflows(XBayaWorkflowTemplates xbayaWorkflows) {
-        this.xbayaWorkflows = xbayaWorkflows;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(RefreshAction.ID);
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        if (action.equals(AddAction.ID)) {
-            JOptionPane.showMessageDialog(null, "TODO");
-            // TODO
-            return true;
-        }
-        return super.triggerAction(tree, action);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        if (action.getID().equals(AddAction.ID)) {
-            return "New workflow...";
-        }
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/scufl/script/ScuflScript.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/scufl/script/ScuflScript.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/scufl/script/ScuflScript.java
deleted file mode 100644
index 27442e4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/scufl/script/ScuflScript.java
+++ /dev/null
@@ -1,539 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.scufl.script;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.UUID;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.workflow.model.component.ws.WSComponent;
-import org.apache.airavata.workflow.model.graph.DataPort;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Port;
-import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
-import org.apache.airavata.workflow.model.graph.system.ConstantNode;
-import org.apache.airavata.workflow.model.graph.system.EndifNode;
-import org.apache.airavata.workflow.model.graph.system.IfNode;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.system.MemoNode;
-import org.apache.airavata.workflow.model.graph.system.OutputNode;
-import org.apache.airavata.workflow.model.graph.util.GraphUtil;
-import org.apache.airavata.workflow.model.graph.ws.WSGraph;
-import org.apache.airavata.workflow.model.graph.ws.WSNode;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.xmlpull.infoset.impl.XmlElementWithViewsImpl;
-import org.xmlpull.v1.builder.XmlBuilderException;
-import org.xmlpull.v1.builder.XmlDocument;
-import org.xmlpull.v1.builder.XmlElement;
-import org.xmlpull.v1.builder.XmlInfosetBuilder;
-import org.xmlpull.v1.builder.XmlNamespace;
-
-import xsul.XmlConstants;
-import xsul5.wsdl.WsdlMessage;
-import xsul5.wsdl.WsdlMessagePart;
-import xsul5.wsdl.WsdlPort;
-import xsul5.wsdl.WsdlPortType;
-import xsul5.wsdl.WsdlPortTypeOperation;
-import xsul5.wsdl.WsdlService;
-
-public class ScuflScript {
-
-    private Workflow workflow;
-
-    private XBayaConfiguration configuration;
-
-    private WSGraph graph;
-
-    private ArrayList<String> arguments;
-
-    private List<InputNode> inputNodes;
-
-    private List<OutputNode> outputNodes;
-
-    private XmlInfosetBuilder builder = XmlConstants.BUILDER;
-
-    private LinkedList<Node> notYetInvokedNodes;
-
-    private LinkedList<Node> executingNodes;
-
-    private XmlNamespace scuflNS = builder.newNamespace("s", "http://org.embl.ebi.escience/xscufl/0.1alpha");
-
-    private Map<String, XmlElement> sources = new HashMap<String, XmlElement>();
-
-    private List<XmlElement> links = new ArrayList<XmlElement>();
-
-    private List<XmlElement> sinks = new ArrayList<XmlElement>();
-
-    private XmlDocument script;
-
-    public ScuflScript(Workflow workflow, XBayaConfiguration configuration) {
-        this.workflow = workflow;
-        this.configuration = configuration;
-        this.graph = this.workflow.getGraph();
-
-        this.arguments = new ArrayList<String>();
-
-        this.notYetInvokedNodes = new LinkedList<Node>();
-        for (Node node : this.graph.getNodes()) {
-            if (!(node instanceof MemoNode)) {
-                this.notYetInvokedNodes.add(node);
-            }
-        }
-        this.executingNodes = new LinkedList<Node>();
-        this.inputNodes = GraphUtil.getInputNodes(this.graph);
-        this.outputNodes = GraphUtil.getOutputNodes(this.graph);
-    }
-
-    public void create() throws GraphException {
-
-        XmlDocument doc = builder.newDocument();
-
-        XmlElement scufl = doc.addDocumentElement(scuflNS, "scufl");
-        scufl.addAttribute("version", "0.2");
-        scufl.addAttribute("log", "0");
-        XmlElement description = scufl.addElement(scuflNS, "workflowdescription");
-        description.addAttribute("lsid", "urn:lsid:net.sf.taverna:wfDefinition:" + UUID.randomUUID());
-        description.addAttribute("author", "");
-        description.addAttribute("title", workflow.getName());
-        writeServices(scufl);
-
-        writeSplitors(scufl);
-
-        // add links
-        for (XmlElement link : this.links) {
-            scufl.addElement(link);
-        }
-
-        // add source
-        for (String key : this.sources.keySet()) {
-            scufl.addElement(this.sources.get(key));
-        }
-
-        // add sinks
-        for (XmlElement sink : this.sinks) {
-            scufl.addElement(sink);
-        }
-
-        this.script = doc;
-
-    }
-
-    public String getScript() {
-        return builder.serializeToString(this.script);
-    }
-
-    /**
-     * @param scufl
-     * @throws GraphException
-     */
-    private void writeSplitors(XmlElement scufl) throws GraphException {
-
-        Collection<Node> nextNodes = getNextNodes();
-        while (nextNodes.size() > 0) {
-            for (Node node : nextNodes) {
-
-                if (node instanceof WSNode) {
-                    WSNode wsNode = (WSNode) node;
-                    node.getInputPorts();
-                    writeSplitorPerService(scufl, wsNode);
-
-                } else {
-                    // TODO conditions, loops might come here.
-                }
-                this.notYetInvokedNodes.remove(node);
-                nextNodes = getNextNodes();
-            }
-        }
-    }
-
-    /**
-     * @param scufl
-     * @param node
-     * @throws GraphException
-     */
-    private void writeSplitorPerService(XmlElement scufl, WSNode node) throws GraphException {
-        List<DataPort> inputPorts = node.getInputPorts();
-        XmlElement processor = scufl.addElement(scuflNS, "processor");
-        processor.addAttribute("name", getValidName(node) + "InputMessagePartXML");
-        XmlElement local = processor.addElement(scuflNS, "local");
-        local.addChild(0, "org.embl.ebi.escience.scuflworkers.java.XMLInputSplitter");
-        XmlElement extensions = local.addElement(scuflNS, "extensions");
-
-        QName inputName = getInputElementName(node);
-        if (null == inputName) {
-            throw new GraphException("No Valid input type found for WS Node" + node.getName());
-        }
-        if (node.getOutputPorts().size() != 1) {
-            throw new GraphException("Number of out ports in WS node " + node.getName() + "is invalid:"
-                    + node.getOutputPorts().size());
-        }
-        DataPort outputPort = node.getOutputPort(0);
-
-        WSComponent component = node.getComponent();
-        String inputPartName = component.getInputPartName();
-        String inputTypeName = component.getInputTypeName();
-
-        XmlElement complexType = extensions.addElement(scuflNS, "complextype");
-        complexType.addAttribute("optional", "false");
-        complexType.addAttribute("unbounded", "false");
-        complexType.addAttribute("typename", inputTypeName);
-
-        String spliterName = inputPartName;
-        complexType.addAttribute("name", spliterName);
-        complexType.addAttribute("qname", inputName.toString());
-
-        XmlElement element = complexType.addElement(scuflNS, "elements");
-        for (DataPort port : inputPorts) {
-            if ("http://www.w3.org/2001/XMLSchema".equals(port.getType().getNamespaceURI())) {
-                XmlElement baseType = element.addElement(scuflNS, "basetype");
-                baseType.addAttribute("optional", "false");
-                baseType.addAttribute("unbounded", "false");
-                baseType.addAttribute("typename", port.getType().getLocalPart());
-                baseType.addAttribute("name", port.getName());
-                baseType.addAttribute("qname", inputTypeName + "&gt;" + port.getName());
-
-            }
-            // all the sources are written here
-            // the links from input nodes to the spiters are done here
-            // links from the from node output splitter to the this service's
-            // inputsplitter is done here
-
-            if (port.getFromNode() instanceof InputNode) {
-                XmlElement source = builder.newFragment(scuflNS, "source");
-                source.addAttribute("name", port.getFromNode().getID());
-                if (!sourceExist(port.getFromNode().getID())) {
-                    this.sources.put(port.getFromNode().getID(), source);
-                }
-                XmlElement link = builder.newFragment(scuflNS, "link");
-                link.addAttribute("source", port.getFromNode().getID());
-                link.addAttribute("sink", getValidName(node) + "InputMessagePartXML:" + port.getName());
-                this.links.add(link);
-
-            } else if (port.getFromNode() instanceof WSNode) {
-                XmlElement link = builder.newFragment(scuflNS, "link");
-                if (port.getFromNode().getOutputPorts().size() != 1) {
-                    throw new GraphException("Number of out ports in from WS node " + port.getFromNode().getName()
-                            + "is invalid:" + node.getOutputPorts().size());
-                }
-                link.addAttribute("source", getValidName((WSNode) port.getFromNode()) + "OutputMessagePartXML:"
-                        + port.getFromNode().getOutputPort(0).getName());
-                link.addAttribute("sink", getValidName(node) + "InputMessagePartXML:" + port.getName());
-                this.links.add(link);
-            } else {
-                throw new GraphException("Unhandled from node type:" + port.getFromNode() + " for node"
-                        + node.getName());
-            }
-        }
-
-        // link from the spliter to the service
-
-        XmlElement link = builder.newFragment(scuflNS, "link");
-        link.addAttribute("source", getValidName(node) + "InputMessagePartXML:output");
-        link.addAttribute("sink", getValidName(node) + ":" + spliterName);
-        this.links.add(link);
-
-        // link from service out to the ouput spliter
-
-        link = builder.newFragment(scuflNS, "link");
-        link.addAttribute("source", getValidName(node) + ":" + node.getComponent().getOutputPartName());
-        link.addAttribute("sink", getValidName(node) + "OutputMessagePartXML:input");
-        this.links.add(link);
-
-        // /outspiltor
-        XmlElement outProcessor = scufl.addElement(scuflNS, "processor");
-        outProcessor.addAttribute("name", getValidName(node) + "OutputMessagePartXML");
-        XmlElement outLocal = outProcessor.addElement(scuflNS, "local");
-        outLocal.addChild(0, "org.embl.ebi.escience.scuflworkers.java.XMLOutputSplitter");
-        XmlElement outExtensions = outLocal.addElement(scuflNS, "extensions");
-        XmlElement outComplextype = outExtensions.addElement(scuflNS, "complextype");
-        outComplextype.addAttribute("optional", "false");
-        outComplextype.addAttribute("unbounded", "false");
-        outComplextype.addAttribute("typename", component.getOutputTypeName());
-        outComplextype.addAttribute("name", component.getOutputPartName());
-        QName outputName = getOutputElementName(node);
-        if (null == outputName) {
-            throw new GraphException("No Valid output type found for WS Node" + node.getName());
-        }
-        outComplextype.addAttribute("qname", outputName.toString());
-        XmlElement elements = outComplextype.addElement(scuflNS, "elements");
-        XmlElement outBaseType = elements.addElement(scuflNS, "basetype");
-        outBaseType.addAttribute("optional", "false");
-        outBaseType.addAttribute("unbounded", "false");
-
-        outBaseType.addAttribute("typename", outputPort.getType().getLocalPart());
-        String Z = component.getOutputPort(0).getName();
-        outBaseType.addAttribute("name", Z);
-
-        outBaseType.addAttribute("qname", component.getOutputTypeName() + "&gt;" + Z);
-
-        List<DataPort> outputPorts = node.getOutputPorts();
-        for (DataPort port : outputPorts) {
-            List<Node> toNodes = port.getToNodes();
-            for (Node toNode : toNodes) {
-                if (toNode instanceof OutputNode) {
-                    if ("http://www.w3.org/2001/XMLSchema".equals(port.getType().getNamespaceURI())) {
-                        XmlElement sink = builder.newFragment(scuflNS, "sink");
-                        sink.addAttribute("name", toNode.getID());
-                        sinks.add(sink);
-                        link = builder.newFragment(scuflNS, "link");
-                        link.addAttribute("source", getValidName(node) + "OutputMessagePartXML:" + outputPort.getName());
-                        link.addAttribute("sink", toNode.getID());
-                        this.links.add(link);
-                    }
-                }
-            }
-        }
-
-    }
-
-    private boolean sourceExist(String name) {
-        Set<String> keys = this.sources.keySet();
-        for (String string : keys) {
-            if (name.equals(string))
-                return true;
-        }
-        return false;
-    }
-
-    /**
-     * @param node
-     * @return
-     * @throws GraphException
-     */
-    private QName getInputElementName(WSNode node) throws GraphException {
-        WSComponent component = node.getComponent();
-        String portTypeName = component.getPortTypeQName().getLocalPart();
-        WsdlPortType portType = component.getWSDL().getPortType(portTypeName);
-        WsdlPortTypeOperation operation = portType.getOperation(component.getOperationName());
-        QName message = operation.getInput().getMessage();
-        WsdlMessage wsdlMessage = component.getWSDL().getMessage(message.getLocalPart());
-        Iterator<WsdlMessagePart> iterator = wsdlMessage.parts().iterator();
-        QName inputName = null;
-        if (iterator.hasNext()) {
-            inputName = iterator.next().getElement();
-        } else {
-            throw new GraphException("No input part found for WS Node" + node.getName());
-        }
-        return inputName;
-    }
-
-    private QName getOutputElementName(WSNode node) throws GraphException {
-        WSComponent component = node.getComponent();
-        String portTypeName = component.getPortTypeQName().getLocalPart();
-        WsdlPortType portType = component.getWSDL().getPortType(portTypeName);
-        WsdlPortTypeOperation operation = portType.getOperation(component.getOperationName());
-        QName message = operation.getOutput().getMessage();
-        WsdlMessage wsdlMessage = component.getWSDL().getMessage(message.getLocalPart());
-        Iterator<WsdlMessagePart> iterator = wsdlMessage.parts().iterator();
-        QName inputName = null;
-        if (iterator.hasNext()) {
-            inputName = iterator.next().getElement();
-        } else {
-            throw new GraphException("No output part found for WS Node" + node.getName());
-        }
-        return inputName;
-    }
-
-    private void writeServices(XmlElement scufl) throws GraphException {
-
-        Collection<NodeImpl> nextNodes = this.graph.getNodes();
-        for (NodeImpl node : nextNodes) {
-            if (node instanceof WSNode) {
-                WSNode wsNode = (WSNode) node;
-                createWSProcess(wsNode, scufl);
-            }
-        }
-    }
-
-    private XmlElement createWSProcess(WSNode node, XmlElement scufl) throws GraphException, XmlBuilderException {
-
-        XmlElement processor = scufl.addElement(scuflNS, "processor");
-        String name = getValidName(node);
-        processor.addAttribute("name", name);
-        XmlElement description = processor.addElement(scuflNS, "description");
-        String txt = node.getComponent().getDescription();
-        if (null == txt) {
-            description.addChild(name);
-        } else {
-            description.addChild(txt);
-        }
-
-        XmlElement arbitrarywsdl = processor.addElement(scuflNS, "arbitrarywsdl");
-        XmlElement wsdl = arbitrarywsdl.addElement(scuflNS, "wsdl");
-
-        String epr = getEPR(node);
-        if (null == epr) {
-            throw new GraphException("EPR not found for the WS-node:" + builder.serializeToString(node));
-        }
-        wsdl.addChild(epr + "?wsdl");
-
-        XmlElement operation = arbitrarywsdl.addElement(scuflNS, "operation");
-        operation.addChild(node.getOperationName());
-
-        return processor;
-
-    }
-
-    /**
-     * @param node
-     * @return
-     */
-    private String getValidName(WSNode node) {
-        return node.getID();
-        // String name = node.getName();
-        // if (name.indexOf(":") != -1) {
-        // name = name.substring(0, name.indexOf(":"));
-        // }
-        // return name;
-    }
-
-    /**
-     * @param wsNode
-     */
-    private String getEPR(WSNode wsNode) {
-        Iterable<WsdlService> services = wsNode.getComponent().getWSDL().services();
-        Iterator<WsdlService> iterator = services.iterator();
-        if (iterator.hasNext()) {
-            Iterable<WsdlPort> ports = iterator.next().ports();
-            Iterator<WsdlPort> portIterator = ports.iterator();
-            if (portIterator.hasNext()) {
-                WsdlPort port = portIterator.next();
-                Iterable children = port.xml().children();
-                Iterator childIterator = children.iterator();
-                while (childIterator.hasNext()) {
-                    Object next = childIterator.next();
-                    if (next instanceof XmlElementWithViewsImpl) {
-                        org.xmlpull.infoset.XmlAttribute epr = ((XmlElementWithViewsImpl) next).attribute("location");
-                        return epr.getValue();
-                    }
-                }
-            }
-        }
-        return null;
-    }
-
-    public boolean validate(List<String> warnings) {
-        // Empty
-        if (this.graph.getNodes().size() == 0) {
-            String message = "The workflow is empty.";
-            warnings.add(message);
-        }
-
-        // Input ports need to be connected.
-        Collection<Port> inputPorts = GraphUtil.getPorts(this.graph, Port.Kind.DATA_IN);
-        for (Port inputPort : inputPorts) {
-            Collection<Port> fromPorts = inputPort.getFromPorts();
-            if (fromPorts.size() == 0) {
-                Node node = inputPort.getNode();
-                String message = node.getID() + " has an unconnected input " + inputPort.getName();
-                warnings.add(message);
-            }
-        }
-
-        // Input nodes need to be connected.
-        for (InputNode inputNode : this.inputNodes) {
-            if (inputNode.getPort().getToPorts().size() == 0) {
-                String message = inputNode.getID() + " is not connected to any service.";
-                warnings.add(message);
-            }
-        }
-
-        // Cycle
-        if (GraphUtil.containsCycle(this.graph)) {
-            String message = "There is a cycle in the workflow.";
-            warnings.add(message);
-        }
-
-        // Constants are not supported.
-        List<ConstantNode> constantNodes = GraphUtil.getNodes(this.graph, ConstantNode.class);
-        if (constantNodes.size() > 0) {
-            String message = "Constants are not supported for Scufl scripts.";
-            warnings.add(message);
-        }
-
-        // If/endif are not supported.
-        List<IfNode> ifNodes = GraphUtil.getNodes(this.graph, IfNode.class);
-        List<EndifNode> endifNodes = GraphUtil.getNodes(this.graph, EndifNode.class);
-        if (ifNodes.size() > 0 || endifNodes.size() > 0) {
-            String message = "If/endif are not supported for Scufl scripts.";
-            warnings.add(message);
-        }
-
-        if (warnings.size() > 0) {
-            return false;
-        } else {
-            // No error.
-            return true;
-        }
-    }
-
-    private Collection<Node> getNextNodes() throws GraphException {
-        Collection<Node> nextNodes = new ArrayList<Node>();
-        for (Node node : this.notYetInvokedNodes) {
-            if (isNextNode(node)) {
-                nextNodes.add(node);
-            }
-        }
-        return nextNodes;
-    }
-
-    private boolean isNextNode(Node node) throws GraphException {
-        if (node instanceof OutputNode) {
-            return false;
-        }
-        for (Port port : node.getInputPorts()) {
-            Collection<Node> fromNodes = port.getFromNodes();
-            if (fromNodes.isEmpty()) {
-                throw new GraphException("There is a port that is not connected to any.");
-            } else {
-                for (Node fromNode : fromNodes) {
-                    if (this.notYetInvokedNodes.contains(fromNode)) {
-                        // There is a node that should be executed before this
-                        // node.
-                        return false;
-                    }
-                }
-            }
-        }
-        Port port = node.getControlInPort();
-        if (port != null) {
-            Collection<Node> fromNodes = port.getFromNodes();
-            for (Node fromNode : fromNodes) {
-                if (this.notYetInvokedNodes.contains(fromNode)) {
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BPELScriptTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BPELScriptTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BPELScriptTestCase.java
deleted file mode 100644
index bcfb604..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BPELScriptTestCase.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.airavata.common.utils.IOUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.gpel.script.BPELScript;
-import org.apache.airavata.workflow.model.gpel.script.BPELScriptType;
-import org.apache.airavata.workflow.model.gpel.script.WorkflowWSDL;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-import org.gpel.model.GpelProcess;
-import org.xmlpull.infoset.XmlElement;
-
-import xsul5.wsdl.WsdlDefinitions;
-
-public class BPELScriptTestCase extends XBayaTestCase {
-
-    // private static final Logger logger = LoggerFactory.getLogger();
-
-    private WorkflowCreator workflowCreator;
-
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-        this.workflowCreator = new WorkflowCreator();
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws IOException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public void testSimpleMath() throws ComponentException, IOException, GraphException, ComponentRegistryException {
-        Workflow workflow = this.workflowCreator.createSimpleMathWorkflow();
-        testWrokflow(workflow, "simple-math");
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws IOException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public void testMath() throws ComponentException, IOException, GraphException, ComponentRegistryException {
-        Workflow workflow = this.workflowCreator.createMathWorkflow();
-        testWrokflow(workflow, "math");
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws IOException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public void testComplexMath() throws ComponentException, IOException, GraphException, ComponentRegistryException {
-        Workflow workflow = this.workflowCreator.createComplexMathWorkflow();
-        testWrokflow(workflow, "complex-math");
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws IOException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public void testMathWithConstant() throws ComponentException, IOException, GraphException,
-            ComponentRegistryException {
-        Workflow workflow = this.workflowCreator.createMathWithConstWorkflow();
-        testWrokflow(workflow, "constant-test");
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testArray() throws ComponentException, GraphException, IOException, ComponentRegistryException {
-        Workflow workflow = this.workflowCreator.createArrayWorkflow();
-        testWrokflow(workflow, "array-test");
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testForEach() throws ComponentException, GraphException, IOException, ComponentRegistryException {
-        Workflow workflow = this.workflowCreator.createForEachWorkflow();
-        testWrokflow(workflow, "foreach-test");
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testIf() throws ComponentException, GraphException, IOException, ComponentRegistryException {
-        Workflow workflow = this.workflowCreator.createIfWorkflow();
-        testWrokflow(workflow, "if-test");
-    }
-
-    /**
-     * @throws GraphException
-     * @throws ComponentException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testReceive() throws GraphException, ComponentException, IOException, ComponentRegistryException {
-        Workflow workflow = this.workflowCreator.createReceiveWorkflow();
-        testWrokflow(workflow, "receive-test");
-    }
-
-    /**
-     * @throws GraphException
-     * @throws ComponentException
-     * @throws IOException
-     * @throws ComponentRegistryException
-     */
-    public void testLoan() throws GraphException, ComponentException, IOException, ComponentRegistryException {
-        Workflow workflow = this.workflowCreator.createLoanWorkflow();
-        testWrokflow(workflow, "loan");
-    }
-
-    private void testWrokflow(Workflow workflow, String filename) throws GraphException, IOException,
-            ComponentException {
-
-        // This one is for debuggin in case something below fails.
-        XMLUtil.saveXML(workflow.toXML(), new File(this.temporalDirectory, filename + "-0.xwf"));
-
-        // Create BPEL
-        BPELScript bpel = new BPELScript(workflow);
-        bpel.create(BPELScriptType.GPEL);
-        GpelProcess gpelProcess = bpel.getGpelProcess();
-        WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL();
-        WsdlDefinitions definitions = workflowWSDL.getWsdlDefinitions();
-
-        File bpelFile = new File(this.temporalDirectory, filename + XBayaConstants.BPEL_SUFFIX);
-        File wsdlFile = new File(this.temporalDirectory, filename + XBayaConstants.WSDL_SUFFIX);
-        XMLUtil.saveXML(gpelProcess.xml(), bpelFile);
-        XMLUtil.saveXML(definitions.xml(), wsdlFile);
-
-        // Save the workflow
-        File workflowFile = new File(this.temporalDirectory, filename + XBayaConstants.WORKFLOW_FILE_SUFFIX);
-        XMLUtil.saveXML(workflow.toXML(), workflowFile);
-
-        // Read the workflow
-        XmlElement workflowElement = XMLUtil.loadXML(workflowFile);
-        workflow = new Workflow(workflowElement);
-
-        // Create BPEL again
-        bpel = new BPELScript(workflow);
-        bpel.create(BPELScriptType.GPEL);
-        gpelProcess = bpel.getGpelProcess();
-        workflowWSDL = bpel.getWorkflowWSDL();
-        definitions = workflowWSDL.getWsdlDefinitions();
-
-        File bpelFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.BPEL_SUFFIX);
-        File wsdlFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.WSDL_SUFFIX);
-        XMLUtil.saveXML(gpelProcess.xml(), bpelFile2);
-        XMLUtil.saveXML(definitions.xml(), wsdlFile2);
-
-        File workflowFile2 = new File(this.temporalDirectory, filename + "-2" + XBayaConstants.WORKFLOW_FILE_SUFFIX);
-        XMLUtil.saveXML(workflow.toXML(), workflowFile2);
-
-        // Compare
-        String workflowString = IOUtil.readFileToString(workflowFile);
-        String workflowString2 = IOUtil.readFileToString(workflowFile2);
-        assertEquals(workflowString, workflowString2);
-
-        String bpelString = IOUtil.readFileToString(bpelFile);
-        String bpelString2 = IOUtil.readFileToString(bpelFile2);
-        assertEquals(bpelString, bpelString2);
-
-        String wsdlString = IOUtil.readFileToString(wsdlFile);
-        String wsdlString2 = IOUtil.readFileToString(wsdlFile2);
-        assertEquals(wsdlString, wsdlString2);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BrowserTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BrowserTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BrowserTestCase.java
deleted file mode 100644
index 3d68557..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/BrowserTestCase.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.common.utils.BrowserLauncher;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-
-public class BrowserTestCase extends TestCase {
-
-    /**
-     * @throws WorkflowException
-     * 
-     */
-    public void testBrowserLauncher() throws Exception {
-        BrowserLauncher.openURL("http://www.google.com");
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCTestCase.java
deleted file mode 100644
index e6ae107..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCTestCase.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.io.File;
-import java.net.URI;
-
-import junit.framework.TestSuite;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.gpel.DSCUtil;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.lead.LeadContextHeader;
-import xsul.util.XsulUtil;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
-import xsul.xwsif_runtime_async_http.XsulSoapHttpWsaResponsesCorrelator;
-import xsul5.wsdl.WsdlDefinitions;
-import xsul5.wsdl.WsdlException;
-import xsul5.wsdl.WsdlResolver;
-
-public class DSCTestCase extends XBayaTestCase {
-
-    private static final String SAMPLE_AWSDL = XBayaPathConstants.WSDL_DIRECTORY + "/test/TestCMD_Example1_AWSDL.xml";
-
-    private static final Logger logger = LoggerFactory.getLogger(DSCTestCase.class);
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        junit.textui.TestRunner.run(new TestSuite(DSCTestCase.class));
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.test.XBayaTestCase#setUp()
-     */
-    @Override
-    protected void setUp() throws Exception {
-        super.setUp();
-    }
-
-    /**
-     * @throws WsdlException
-     */
-    public void test() throws WsdlException {
-        WsdlDefinitions definitions = WsdlResolver.getInstance().loadWsdl(new File(".").toURI(),
-                new File(SAMPLE_AWSDL).toURI());
-        URI dscURL = this.configuration.getDSCURL();
-        logger.info("dscURL: " + dscURL);
-        DSCUtil.convertToCWSDL(definitions, dscURL);
-
-        logger.info(definitions.xmlStringPretty());
-
-        // client
-        int clientPort = 0;
-        WSIFAsyncResponsesCorrelator correlator = new XsulSoapHttpWsaResponsesCorrelator(clientPort);
-        String serverLoc = ((XsulSoapHttpWsaResponsesCorrelator) correlator).getServerLocation();
-        logger.info("client is waiting at " + serverLoc);
-
-        // LEAD Context Header
-        // Create lead context.
-        LeadContextHeaderHelper leadContextHelper = new LeadContextHeaderHelper();
-        leadContextHelper.setXBayaConfiguration(this.configuration);
-        LeadContextHeader leadContext = leadContextHelper.getLeadContextHeader();
-        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
-        leadContext.setNodeId("decoder1");
-        leadContext.setTimeStep("5");
-        leadContext.setServiceInstanceId(URI.create("decoder-instance-10"));
-
-        XmlElement element3 = XMLUtil.xmlElement5ToXmlElement3(definitions.xml());
-        xsul.wsdl.WsdlDefinitions definitions3 = new xsul.wsdl.WsdlDefinitions(element3);
-
-        WSIFClient wclient = WSIFRuntime.getDefault().newClientFor(definitions3, "TestCMD_Example1SoapPort");
-        StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-lead-header", leadContext);
-
-        wclient.addHandler(handler);
-        wclient.useAsyncMessaging(correlator);
-        wclient.setAsyncResponseTimeoutInMs(33000L);
-
-        WSIFPort port = wclient.getPort();
-        WSIFOperation operation = port.createOperation("Run");
-        WSIFMessage inputMessage = operation.createInputMessage();
-        WSIFMessage outputMessage = operation.createOutputMessage();
-        WSIFMessage faultMessage = operation.createFaultMessage();
-
-        // inputMessage.setObjectPart("InputParam1", "Hello");
-        inputMessage.setObjectPart("InputParam1", "100");
-
-        logger.info("inputMessage: " + XsulUtil.safeXmlToString((XmlElement) inputMessage));
-        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
-
-        XmlElement result;
-        if (success) {
-            result = (XmlElement) outputMessage;
-        } else {
-            result = (XmlElement) faultMessage;
-        }
-        logger.info("result:\n" + XsulUtil.safeXmlToString(result));
-
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCUtilTestCase.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCUtilTestCase.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCUtilTestCase.java
deleted file mode 100644
index 866aa6a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/DSCUtilTestCase.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test;
-
-import java.io.File;
-
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.gpel.DSCUtil;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.test.util.WorkflowCreator;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul5.wsdl.WsdlDefinitions;
-import xsul5.wsdl.WsdlException;
-import xsul5.wsdl.WsdlResolver;
-
-public class DSCUtilTestCase extends XBayaTestCase {
-
-    private static final String SAMPLE_AWSDL = XBayaPathConstants.WSDL_DIRECTORY + "/test/adder-awsdl.xml";
-
-    private static final String WSDL_WITH_MULTIPLE_PORT_TYPES = XBayaPathConstants.BPEL_SCRIPT_DIRECTORY
-            + File.separator + "receive-test-wsdl.xml";
-
-    private static final Logger logger = LoggerFactory.getLogger(DSCUtilTestCase.class);
-
-    /**
-     * @throws WsdlException
-     */
-    public void testConvertToCWSDL() throws WsdlException {
-        WsdlDefinitions definitions = WsdlResolver.getInstance().loadWsdl(new File(".").toURI(),
-                new File(SAMPLE_AWSDL).toURI());
-        DSCUtil.convertToCWSDL(definitions, this.configuration.getDSCURL());
-        logger.info(definitions.xmlStringPretty());
-    }
-
-    /**
-     * 
-     */
-    public void testMultiplePortTypes() {
-        WsdlDefinitions definitions = WsdlResolver.getInstance().loadWsdl(new File(".").toURI(),
-                new File(WSDL_WITH_MULTIPLE_PORT_TYPES).toURI());
-        DSCUtil.convertToCWSDL(definitions, this.configuration.getDSCURL());
-        logger.info(definitions.xmlStringPretty());
-    }
-
-    /**
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public void testConvertToCWSDLs() throws ComponentException, GraphException, ComponentRegistryException {
-        WorkflowCreator creator = new WorkflowCreator();
-        Workflow workflow = creator.createComplexMathWorkflow();
-        DSCUtil.createCWSDLs(workflow, this.configuration.getDSCURL());
-    }
-}
\ No newline at end of file


[81/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java
new file mode 100644
index 0000000..29fdbdf
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/util/TestUtilServer.java
@@ -0,0 +1,225 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.util;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.InOutAxisOperation;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.engine.ServiceLifeCycle;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+import java.nio.channels.ServerSocketChannel;
+
+public class TestUtilServer {
+    private static int count = 0;
+
+    private static SimpleHTTPServer receiver;
+
+    public static int TESTING_PORT = 5555;
+
+    public static final String FAILURE_MESSAGE = "Intentional Failure";
+
+    public static synchronized void deployService(AxisService service) throws AxisFault {
+        receiver.getConfigurationContext().getAxisConfiguration().addService(service);
+    }
+
+    public static synchronized void unDeployService(QName service) throws AxisFault {
+        receiver.getConfigurationContext().getAxisConfiguration().removeService(service.getLocalPart());
+    }
+
+    public static synchronized void unDeployClientService() throws AxisFault {
+        if (receiver.getConfigurationContext().getAxisConfiguration() != null) {
+            receiver.getConfigurationContext().getAxisConfiguration().removeService("AnonymousService");
+        }
+    }
+
+    public static synchronized void start(String repository, String axis2xml) throws Exception {
+        if (count == 0) {
+            ConfigurationContext er = getNewConfigurationContext(repository, axis2xml);
+            TESTING_PORT = getAvailablePort();
+            receiver = new SimpleHTTPServer(er, TESTING_PORT);
+
+            try {
+                receiver.start();
+                System.out.print("Server started on port " + TESTING_PORT + ".....");
+            } catch (Exception e) {
+                throw AxisFault.makeFault(e);
+            }
+
+            try {
+                Thread.sleep(2000);
+            } catch (InterruptedException e1) {
+                throw new AxisFault("Thread interuptted", e1);
+            }
+            startBroker();
+        }
+        count++;
+    }
+
+    public static void startBroker() throws Exception {
+
+        ServiceLifeCycle brokerLifeCycle = new BrokerServiceLifeCycle();
+
+        final String configFileParam = "configuration.file.name";
+        final String configFileValue = "airavata-server.properties";
+
+        AxisService notificationService = getNotificationService();
+        notificationService.addParameter(configFileParam, configFileValue);
+        notificationService.setServiceLifeCycle(brokerLifeCycle);
+        TestUtilServer.deployService(notificationService);
+        brokerLifeCycle.startUp(TestUtilServer.getConfigurationContext(), notificationService);
+
+        AxisService eventingService = getEventingService();
+        eventingService.addParameter(configFileParam, configFileValue);
+        eventingService.setServiceLifeCycle(brokerLifeCycle);
+        TestUtilServer.deployService(eventingService);
+        brokerLifeCycle.startUp(TestUtilServer.getConfigurationContext(), eventingService);
+
+    }
+
+    public static AxisService getEventingService() {
+
+        AxisService eventingService = new AxisService("EventingService");
+
+        createOperation(eventingService, "renew",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew",
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse");
+        createOperation(eventingService, "getStatus",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus",
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse");
+
+        createOperation(eventingService, "subscriptionEnd",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd", null);
+
+        createOperation(eventingService, "subscribe",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe",
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse");
+        createOperation(eventingService, "unsubscribe",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver(),
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe",
+                "http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse");
+        createOperation(eventingService, "publish",
+                new org.apache.airavata.wsmg.broker.wseventing.WSEventingPublishMsgReceiver(),
+                "http://org.apache.airavata/WseNotification", null);
+
+        return eventingService;
+    }
+
+    public static AxisService getNotificationService() {
+
+        AxisService notificationService = new AxisService("NotificationService");
+
+        createOperation(notificationService, "notify",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/Notify",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/NotifyResponse");
+
+        createOperation(notificationService, "subscribe",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequestResponse");
+
+        createOperation(notificationService, "getCurrentMessage",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageResponse");
+
+        createOperation(notificationService, "pauseSubscription",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubsriptionRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubscriptionResponse");
+
+        createOperation(notificationService, "resumeSubscription",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubsriptionRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubscriptionResponse");
+
+        createOperation(notificationService, "unsubscribe",
+                new org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver(),
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubsribeRequest",
+                "http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubscribeResponse");
+
+        return notificationService;
+
+    }
+
+    public static void createOperation(AxisService axisService, String name, MessageReceiver messageReceiver,
+            String inputAction, String outputAction) {
+        InOutAxisOperation operation1 = new InOutAxisOperation(new QName(name));
+        operation1.setMessageReceiver(messageReceiver);
+        operation1.setOutputAction(outputAction);
+        axisService.addOperation(operation1);
+        if (inputAction != null) {
+            axisService.mapActionToOperation(inputAction, operation1);
+        }
+    }
+
+    public static ConfigurationContext getNewConfigurationContext(String repository, String axis2xml) throws Exception {
+        return ConfigurationContextFactory.createConfigurationContextFromFileSystem(repository, axis2xml);
+    }
+
+    public static synchronized void stop() throws AxisFault {
+        if (count == 1) {
+            receiver.stop();
+            while (receiver.isRunning()) {
+                try {
+                    Thread.sleep(1000);
+                } catch (InterruptedException e1) {
+                    // nothing to do here
+                }
+            }
+            count = 0;
+            // tp.doStop();
+            System.out.print("Server stopped .....");
+        } else {
+            count--;
+        }
+        receiver.getConfigurationContext().terminate();
+    }
+
+    public static ConfigurationContext getConfigurationContext() {
+        return receiver.getConfigurationContext();
+    }
+
+    public static int getAvailablePort(){
+        ServerSocket serverSocket = null;
+        try {
+             serverSocket = new ServerSocket(0);
+             serverSocket.close();
+        } catch (IOException e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+        return serverSocket.getLocalPort();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties b/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties
new file mode 100644
index 0000000..33b6161
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/test/resources/unit_tests.properties
@@ -0,0 +1,24 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+#
+consumer.port=2222
+consumer.location=http://localhost:2222
+topic.simple=MySimpleTestTopic
+topic.xpath=MyXpathTextTopic

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/pom.xml
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/pom.xml b/modules/xbaya-gui/pom.xml
new file mode 100644
index 0000000..b62feff
--- /dev/null
+++ b/modules/xbaya-gui/pom.xml
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
+    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+    the License. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>airavata</artifactId>
+        <version>0.12-SNAPSHOT</version>
+        <relativePath>../../pom.xml</relativePath>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>airavata-xbaya-gui</artifactId>
+    <packaging>jar</packaging>
+    <name>Airavata XBaya</name>
+    <url>http://airavata.apache.org/</url>
+
+    <build>
+        <plugins>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>restore-persistence</id>
+                        <phase>prepare-package</phase>
+                        <configuration>
+                            <tasks>
+                                <copy file="${project.build.outputDirectory}/services.xml" tofile="${project.build.outputDirectory}/META-INF/services.xml" />
+                                <copy file="src/main/resources/WorkflowInterpretor.wsdl" tofile="${project.build.outputDirectory}/META-INF/service.wsdl" />
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>copy-dependencies</id>
+                        <phase>process-resources</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <outputDirectory>${basedir}/target/jnlp/lib</outputDirectory>
+                            <overWriteReleases>false</overWriteReleases>
+                            <overWriteSnapshots>true</overWriteSnapshots>
+                            <excludeTransitive>false</excludeTransitive>
+                        </configuration>
+                    </execution>
+                    <!--execution>
+                        <id>unpack-dependencies</id>
+                        <phase>compile</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.apache.airavata</groupId>
+                                    <artifactId>apache-airavata-samples</artifactId>
+                                    <type>zip</type>
+                                    <outputDirectory>${project.build.directory}/samples</outputDirectory>
+                                </artifactItem>
+	                        </artifactItems>
+                        </configuration>
+                    </execution-->
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <dependencies>
+        <!--dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>apache-airavata-samples</artifactId>
+            <version>${project.version}</version>
+	    <type>zip</type>
+	    <optional>true</optional>
+        </dependency-->
+
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>xpp3</artifactId>
+            <version>${xpp3.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>xpp5</artifactId>
+            <version>${xpp5.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>xsul</artifactId>
+            <version>${xsul.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>gpel-client</artifactId>
+            <version>${gpel.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.ogce</groupId>
+            <artifactId>atomixmiser</artifactId>
+            <version>${atomixmiser.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-httpclient</groupId>
+            <artifactId>commons-httpclient</artifactId>
+            <version>3.1</version>
+        </dependency>
+        <dependency>
+            <groupId>commons-codec</groupId>
+            <artifactId>commons-codec</artifactId>
+            <version>1.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.python</groupId>
+            <artifactId>jython</artifactId>
+            <version>${jython.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.xmlbeans</groupId>
+            <artifactId>xmlbeans</artifactId>
+            <version>${xmlbeans.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-adb</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-kernel</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-api</artifactId>
+            <version>1.2.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-impl</artifactId>
+            <version>1.2.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.axiom</groupId>
+            <artifactId>axiom-dom</artifactId>
+            <version>1.2.8</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.ws.commons.schema</groupId>
+            <artifactId>XmlSchema</artifactId>
+            <version>1.4.2</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.neethi</groupId>
+            <artifactId>neethi</artifactId>
+            <version>2.0.4</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-local</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-http</artifactId>
+            <version>${axis2.version}</version>
+        </dependency>
+
+        <!-- AMAZON STUFFS -->
+        <dependency>
+            <groupId>com.amazonaws</groupId>
+            <artifactId>aws-java-sdk</artifactId>
+            <version>1.3.20</version>
+        </dependency>
+        <dependency>
+            <groupId>net.java.dev.jets3t</groupId>
+            <artifactId>jets3t</artifactId>
+            <version>0.8.0</version>
+        </dependency>
+
+        <!-- AIRAVATA modules -->
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-model-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-model-component</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-message-monitor</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-client-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-message-broker</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-common-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-tracking</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-jpa-registry</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-registry-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+        <!-- JCR Support -->
+        <!-- TODO need clean up -->
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-gfac-schema-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-gfac-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-gfac-ec2</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-log4j12</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+            <version>${jcr.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-workflow-execution-context</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <!--dependency> <groupId>org.apache.airavata</groupId> <artifactId>airavata-jpa-registry</artifactId> <version>${project.version}</version> 
+            </dependency -->
+        <dependency>
+            <groupId>org.apache.derby</groupId>
+            <artifactId>derbyclient</artifactId>
+            <version>${derby.version}</version>
+        </dependency>
+        <!--<dependency>-->
+            <!--<groupId>org.globusonline</groupId>-->
+            <!--<artifactId>transfer-api-client-java</artifactId>-->
+            <!--<version>0.10.8</version>-->
+        <!--</dependency>-->
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpclient</artifactId>
+            <version>4.3</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.httpcomponents</groupId>
+            <artifactId>httpcore</artifactId>
+            <version>4.3</version>
+        </dependency>
+	<dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-client-configuration</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+	<dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-server-configuration</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
new file mode 100644
index 0000000..6f4d2db
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBaya.java
@@ -0,0 +1,315 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class XBaya {
+
+    private static final Logger logger = LoggerFactory.getLogger(XBaya.class);
+
+    private XBayaConfiguration config;
+
+    private XBayaEngine engine;
+
+    public static int preservice = 0;
+
+    /**
+     * Constructs an XBayaEngine.
+     * 
+     * @param args
+     */
+    public XBaya(String[] args) {
+        parseArguments(args);
+        try {
+            this.engine = new XBayaEngine(this.config);
+
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            try {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Throwable t) {
+                // Cannot do anything
+                e.printStackTrace();
+            }
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            try {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Throwable t) {
+                // Cannot do anything
+                System.out.println(e);
+
+            }
+        }
+    }
+
+    /**
+     * Returns the XBayaEngine.
+     * 
+     * @return The XBayaEngine
+     */
+    public XBayaEngine getEngine() {
+        return this.engine;
+    }
+
+    private void printUsage() {
+        System.err.println("Usage: java " + XBaya.class.getName() + " [-help]" + "[-config file]" + " [-title title]"
+                + " [-workflow workflow]" + " [-enableLocalRegistry]" + " [-localRegistry dir]"
+                + " [-gpelEngineURL url]" + " [-templateID templateID]" + " [-instanceID instanceID]"
+                + " [-gfacURL url]" + " [-dscURL url" + " [-startMonitor {true,false}]" + " [-brokerURL url]"
+                + " [-topic topic]" + " [-pullMode {true,false}]" + " [-myProxyServer host]" + " [-karmaURL url]"
+                + " [-karmaWorkflowInstanceID]" + " [-myProxyPort port]" + " [-myProxyUsername username]"
+                + " [-myProxyLifetime sec]" + " [-loadMyProxy {true,false}]" + " [-messageBoxURL url]"
+                + " [-width width]" + " [-height height]" + " [-exitOnClose false/true]" + "[-enableProvenance false/true]"
+                + "[-enableProvenanceSmartRun false/true]" + "[-runWithCrossProduct true/false]"+"[-mode ide/monitor]" + "[--x x-coordinates of left top corner] " +
+                "+ [--y y-coordinate of left top corner]");
+    }
+
+    private void parseArguments(String[] args) {
+        try {
+            this.config = new XBayaConfiguration();
+
+            int index = 0;
+            while (index < args.length) {
+                String arg = args[index];
+                String possibleValue = "";
+                if ((index + 1) < args.length) {
+                    possibleValue = args[index + 1];
+                }
+                logger.debug("arg: " + arg + " " + possibleValue);
+                if ("-help".equalsIgnoreCase(arg)) {
+                    printUsage();
+                    System.exit(0);
+                } else if ("-config".equalsIgnoreCase(arg)) {
+                    index++;
+                    String configPath = args[index];
+                    try {
+                        this.config.loadConfiguration(configPath);
+                    } catch (RuntimeException e) {
+                        String message = "Error while reading config file, " + configPath;
+                        logger.warn(message, e);
+                        this.config.addError(new WorkflowException(message, e));
+                    }
+                } else if ("-title".equalsIgnoreCase(arg)) {
+                    index++;
+                    this.config.setTitle(args[index]);
+                } else if ("-workflow".equalsIgnoreCase(arg)) {
+                    index++;
+                    this.config.setWorkflow(args[index]);
+                } else if ("-gfacURL".equalsIgnoreCase(arg)) {
+                    index++;
+                    String url = args[index];
+                    try {
+                        this.config.setGFacURL(parseURL(url));
+                    } catch (URISyntaxException e) {
+                        String message = "The GFac URL is in wrong format: " + url;
+                        logger.warn(message, e);
+                        this.config.addError(new WorkflowException(message, e));
+                    }
+                } else if ("-dscURL".equalsIgnoreCase(arg)) {
+                    index++;
+                    String url = args[index];
+                    try {
+                        this.config.setDSCURL(parseURL(url));
+                    } catch (URISyntaxException e) {
+                        String message = "The DSC URL is in wrong format: " + url;
+                        logger.warn(message, e);
+                        this.config.addError(new WorkflowException(message, e));
+                    }
+                } else if ("-startMonitor".equalsIgnoreCase(arg)) {
+                    this.config.setStartMonitor(true);
+                } else if ("-brokerURL".equalsIgnoreCase(arg)) {
+                    index++;
+                    String brokerURL = args[index];
+                    try {
+                        this.config.setBrokerURL(parseURL(brokerURL));
+                    } catch (URISyntaxException e) {
+                        String message = "The broker URL is in wrong format: " + brokerURL;
+                        logger.warn(message, e);
+                        this.config.addError(new WorkflowException(message, e));
+                    }
+                } else if ("-odeEngine".equalsIgnoreCase(arg)) {
+                    index++;
+                    this.config.setOdeURL(args[index]);
+
+                } else if ("-templateID".equalsIgnoreCase(arg)) {
+                    index++;
+                    this.config.setWorkflow(args[index]);
+
+                } else if ("-topic".equalsIgnoreCase(arg)) {
+
+                    index++;
+                    this.config.setTopic(args[index]);
+                } else if ("-pullMode".equalsIgnoreCase(arg)) {
+                    if (index < args.length - 1) {
+                        String nextArg = args[index + 1];
+                        if (nextArg.startsWith("-")) {
+                            this.config.setPullMode(true);
+                        } else if ("true".equalsIgnoreCase(nextArg)) {
+                            index++;
+                            this.config.setPullMode(true);
+                        } else if ("false".equalsIgnoreCase(nextArg)) {
+                            index++;
+                            this.config.setPullMode(false);
+                        } else {
+                            String message = "-pullMode has to be either true or false, not " + nextArg;
+                            logger.warn(message);
+                            this.config.addError(new WorkflowException(message));
+                        }
+                    } else {
+                        // This is the last arg
+                        this.config.setPullMode(true);
+                    }
+                } else if ("-messageBoxURL".equalsIgnoreCase(arg) || "-msgBoxURL".equalsIgnoreCase(arg)) {
+                    index++;
+                    String messageBoxURL = args[index];
+                    try {
+                        this.config.setMessageBoxURL(parseURL(messageBoxURL));
+                    } catch (URISyntaxException e) {
+                        String message = "The message box URL is in wrong format: " + messageBoxURL;
+                        logger.warn(message, e);
+                        this.config.addError(new WorkflowException(message, e));
+                    }
+                } else if ("-registryURL".equalsIgnoreCase(arg)) {
+                    index++;
+                    String registryURL = args[index];
+                    try {
+                        this.config.setRegistryURL(parseURL(registryURL));
+                        // we need to give preference when a user set registry url from the
+                        // command line
+                        this.config.setRegURLSetByCMD(true);
+                    } catch (URISyntaxException e) {
+                        String message = "The message box URL is in wrong format: " + registryURL;
+                        logger.warn(message, e);
+                        this.config.addError(new WorkflowException(message, e));
+                    }
+                    } else if ("-registryUserName".equalsIgnoreCase(arg)) {
+
+                    index++;
+                    this.config.setRegigstryUserName(args[index]);
+                } else if ("-registryPassphrase".equalsIgnoreCase(arg)) {
+
+                    index++;
+                    this.config.setRegistryPassphrase(args[index]);
+                } else if ("-width".equalsIgnoreCase(arg)) {
+                    index++;
+                    String width = args[index];
+                    try {
+                        this.config.setWidth(Integer.parseInt(width));
+                    } catch (NumberFormatException e) {
+                        String message = "The width must be an integer: " + width;
+                        logger.warn(message, e);
+                        this.config.addError(new WorkflowException(message, e));
+                    }
+                } else if ("-height".equalsIgnoreCase(arg)) {
+                    index++;
+                    String height = args[index];
+                    try {
+                        this.config.setHeight(Integer.parseInt(height));
+                    } catch (NumberFormatException e) {
+                        String message = "The height must be an integer: " + height;
+                        logger.warn(message, e);
+                        this.config.addError(new WorkflowException(message, e));
+                    }
+                } else if ("-exitOnClose".equalsIgnoreCase(arg)) {
+                    index++;
+                    String exit = args[index];
+                    if ("false".equalsIgnoreCase(exit)) {
+                        this.config.setCloseOnExit(false);
+                    }
+                }  else if ("-enableProvenance".equalsIgnoreCase(arg)) {
+                    index++;
+                    String exit = args[index];
+                    if ("true".equalsIgnoreCase(exit)) {
+                        this.config.setCollectProvenance(true);
+                    }
+                }  else if ("-enableProvenanceSmartRun".equalsIgnoreCase(arg)) {
+                    index++;
+                    String exit = args[index];
+                    if ("true".equalsIgnoreCase(exit)) {
+                        this.config.setProvenanceSmartRun(true);
+                    }
+                }  else if ("-runWithCrossProduct".equalsIgnoreCase(arg)) {
+                    index++;
+                    String exit = args[index];
+                    if ("false".equalsIgnoreCase(exit)) {
+                        this.config.setRunWithCrossProduct(false);
+                    }
+                }  else if ("-mode".equalsIgnoreCase(arg)) {
+                	index++;
+                	String modeValue = args[index].toUpperCase();
+                	this.config.setXbayaExecutionMode(XBayaExecutionMode.valueOf(modeValue));
+                } else if ("-x".equalsIgnoreCase(arg)) {
+                    index++;
+                    this.config.setX(Integer.parseInt(args[index]));
+                } else if ("-y".equalsIgnoreCase(arg)) {
+                    index++;
+                    this.config.setY(Integer.parseInt(args[index]));
+                } else {
+                    String message = "Unknown option: " + arg;
+                    logger.error(message);
+                    this.config.addError(new WorkflowException(message));
+                }
+                this.config.setAiravataAPI(this.config.getAiravataAPI());
+                index++;
+            }
+        } catch (ArrayIndexOutOfBoundsException e) {
+            String message = "Argument is missing after " + args[args.length - 1];
+            logger.error(message, e);
+            this.config.addError(new WorkflowException(message));
+        } catch (Throwable e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unknown error while parsing the arguments";
+            this.config.addError(new WorkflowException(message, e));
+        }
+        
+    }
+
+    private URI parseURL(String urlString) throws URISyntaxException {
+        if (urlString.trim().length() == 0) {
+            // This makes it possible to not use some of our default services.
+            return null;
+        } else if ("null".equalsIgnoreCase(urlString)) {
+            // This is a workaround that JNLP doesn't take empty string as an
+            // argument.
+            return null;
+        } else {
+            return new URI(urlString).parseServerAuthority();
+        }
+    }
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        new XBaya(args);
+    }
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
new file mode 100644
index 0000000..4aae6b4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConfiguration.java
@@ -0,0 +1,974 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya;
+
+import java.io.File;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Observable;
+import java.util.Observer;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.gfac.ec2.AmazonSecurityContext;
+import org.apache.airavata.schemas.wec.ContextHeaderDocument;
+import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
+import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.lead.LeadDeploymentConfig;
+
+public class XBayaConfiguration extends Observable implements Observer {
+
+    private static final Logger logger = LoggerFactory.getLogger(XBayaConfiguration.class);
+
+    private String title = XBayaConstants.APPLICATION_NAME;
+
+    private String workflow = null;
+
+    private String ogceWorkflow = null;
+
+    private List<String> localRegistris = new ArrayList<String>();
+
+    // GPEL Engine related
+
+    private URI gpelEngineURL = XBayaConstants.DEFAULT_GPEL_ENGINE_URL;
+
+    private URI gpelTemplateID = null;
+
+    private URI gpelInstanceID = null;
+
+    private AiravataAPI airavataAPI = null;
+    // ODE
+    private String odeURL = XBayaConstants.DEFAULT_ODE_URL;
+
+    // WorkflowInterpreter
+    private URI workflowInterpreterURL = XBayaConstants.DEFAULT_WORKFLOW_INTERPRETER_URL;
+
+    // Proxy Service
+
+    private URI proxyURI = XBayaConstants.DEFAULT_PROXY_URI;
+
+    private URI gfacURL = XBayaConstants.DEFAULT_GFAC_URL;
+
+    private URI registryURL = XBayaConstants.REGISTRY_URL;
+
+    private String regigstryUserName = XBayaConstants.REGISTRY_USERNAME;
+
+    private String registryPassphrase = XBayaConstants.REGISTRY_PASSPHRASE;
+
+    private String defaultGateway = XBayaConstants.DEFAULT_GATEWAY;
+
+    private URI dscURL = XBayaConstants.DEFAULT_DSC_URL;
+
+    // Monitor related
+
+    private boolean startMonitor = false;
+
+    private URI brokerURL = XBayaConstants.DEFAULT_BROKER_URL;
+
+    private String topic = null;
+
+    private boolean pullMode = true;
+
+    private URI messageBoxURL = XBayaConstants.DEFAULT_MESSAGE_BOX_URL;
+
+    // Kerma
+
+    private URI karmaURL = null;
+
+    private URI karmaWorkflowInstanceID = null;
+
+    // MyProxy
+
+    private String myProxyServer = XBayaConstants.DEFAULT_MYPROXY_SERVER;
+
+    private int myProxyPort = XBayaConstants.DEFAULT_MYPROXY_PORT;
+
+    private int myProxyLifetime = XBayaConstants.DEFAULT_MYPROXY_LIFTTIME;
+
+    private String myProxyUsername = null;
+
+    private String myProxyPassphrase = null;
+
+    private boolean loadMyProxy = false;
+
+    private boolean loadRunJythonWorkflow = false;
+
+    // Size
+
+    private int width;
+
+    private int height;
+
+    private int x = 50;
+
+    private int y= 50;
+
+    // Errors
+
+    private List<Throwable> errors;
+
+    private boolean closeOnExit = true;
+
+    private boolean collectProvenance = false;
+
+    private boolean provenanceSmartRun = false;
+
+    private boolean runWithCrossProduct = true;
+
+    private String trustedCertLocation = "";
+
+    private JCRComponentRegistry jcrComponentRegistry=null;
+
+    private XBayaExecutionMode xbayaExecutionMode=XBayaExecutionMode.IDE;
+    
+    private List<XBayaExecutionModeListener> xbayaExecutionModeChangeListners=new ArrayList<XBayaExecutionModeListener>();
+
+    private boolean regURLSetByCMD = false;
+
+    private AmazonSecurityContext amazonSecurityContext = null;
+
+    private ContextHeaderDocument.ContextHeader contextHeader;
+
+    public enum XBayaExecutionMode{
+    	IDE,
+    	MONITOR
+    }
+    /**
+     * Constructs an XwfConfiguration.
+     */
+    public XBayaConfiguration() {
+        this.errors = new ArrayList<Throwable>();
+
+        // Read from system properties first.
+        String systemConfig = System.getProperty("xbaya.config");
+        try {
+            if (systemConfig != null) {
+                loadConfiguration(systemConfig);
+            }
+        } catch (RuntimeException e) {
+            String message = "Error while reading a configuration file, " + systemConfig;
+            logger.warn(message, e);
+        }
+    }
+
+    /**
+     * @param configFilePath
+     */
+    public void loadConfiguration(String configFilePath) {
+        File configFile = new File(configFilePath);
+        URI uri = configFile.toURI();
+        loadConfiguration(uri);
+    }
+
+    private void loadConfiguration(URI uri) {
+        LeadDeploymentConfig config = LeadDeploymentConfig.loadConfig(null, uri);
+        URI gpel = config.getGpelUrl();
+        if (gpel != null) {
+            this.gpelEngineURL = config.getGpelUrl();
+        }
+        URI gfac = config.getGfacUrl();
+        if (gfac != null) {
+            this.gfacURL = gfac;
+        }
+        URI dsc = config.getDscUrl();
+        if (dsc != null) {
+            this.dscURL = dsc;
+        }
+        URI broker = config.getBrokerUrl();
+        if (broker != null) {
+            this.brokerURL = broker;
+        }
+        URI msgBox = config.getMsgBoxUrl();
+        if (msgBox != null) {
+            this.messageBoxURL = msgBox;
+        }
+    }
+
+    /**
+     * Returns the title.
+     * 
+     * @return The title
+     */
+    public String getTitle() {
+        return this.title;
+    }
+
+    /**
+     * Sets title.
+     * 
+     * @param title
+     *            The title to set.
+     */
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    /**
+     * Returns the defaultWorkflow.
+     * 
+     * @return The defaultWorkflow
+     */
+    public String getWorkflow() {
+        return this.workflow;
+    }
+
+    /**
+     * Sets defaultWorkflow.
+     * 
+     * @param defaultWorkflow
+     *            The defaultWorkflow to set.
+     */
+    public void setWorkflow(String defaultWorkflow) {
+        this.workflow = defaultWorkflow;
+    }
+
+    /**
+     * Sets ogceWorkflow.
+     * 
+     * @param ogceWorkflow
+     *            The ogceWorkflow to set.
+     */
+    public void setOGCEWorkflow(String ogceWorkflow) {
+        this.ogceWorkflow = ogceWorkflow;
+    }
+
+    /**
+     * Returns the ogceWorkflow.
+     * 
+     * @return The ogceWorkflow
+     */
+    public String getOGCEWorkflow() {
+        return this.ogceWorkflow;
+    }
+
+    /**
+     * Enable the system default local registry.
+     */
+    public void enableLocalRegistry() {
+        addLocalRegistry(XBayaPathConstants.WSDL_DIRECTORY);
+    }
+
+    /**
+     * @param path
+     *            The path of local registry.
+     */
+    public void addLocalRegistry(String path) {
+        this.localRegistris.add(path);
+    }
+
+    /**
+     * @return The list of pathes of local registries.
+     */
+    public List<String> getLocalRegistry() {
+        return this.localRegistris;
+    }
+
+    /**
+     * Returns the gpelEngineUrl.
+     * 
+     * @return The gpelEngineUrl
+     */
+    public URI getGPELEngineURL() {
+        return this.gpelEngineURL;
+    }
+
+    /**
+     * Sets gpelEngineUrl.
+     * 
+     * @param gpelEngineURL
+     *            The gpelEngineUrl to set.
+     */
+    public void setGPELEngineURL(URI gpelEngineURL) {
+        this.gpelEngineURL = gpelEngineURL;
+    }
+
+    /**
+     * @param templateID
+     */
+    public void setGPELTemplateID(URI templateID) {
+        this.gpelTemplateID = templateID;
+    }
+
+    /**
+     * @return The GPEL template ID.
+     */
+    public URI getGPELTemplateID() {
+        return this.gpelTemplateID;
+    }
+
+    /**
+     * Returns the gpelInstanceID.
+     * 
+     * @return The gpelInstanceID
+     */
+    public URI getGPELInstanceID() {
+        return this.gpelInstanceID;
+    }
+
+    /**
+     * Sets gpelInstanceID.
+     * 
+     * @param gpelInstanceID
+     *            The gpelInstanceID to set.
+     */
+    public void setGPELInstanceID(URI gpelInstanceID) {
+        this.gpelInstanceID = gpelInstanceID;
+    }
+
+    /**
+     * Get the AmazonSecurityContext needed for cloud job submission.
+     * @return AmazonSecurityContext
+     */
+    public AmazonSecurityContext getAmazonSecurityContext() {
+        return amazonSecurityContext;
+    }
+
+    /**
+     * Set the AmazonSecurityContext needed for cloud job submission.
+     * @param amazonSecurityContext amazon security context.
+     */
+    public void setAmazonSecurityContext(AmazonSecurityContext amazonSecurityContext) {
+        this.amazonSecurityContext = amazonSecurityContext;
+    }
+
+    /**
+     * @return The GFac URL
+     */
+    public URI getGFacURL() {
+        return this.gfacURL;
+    }
+
+    /**
+     * @param gfacURL
+     */
+    public void setGFacURL(URI gfacURL) {
+        this.gfacURL = gfacURL;
+    }
+
+    /**
+     * @return The DSC URL
+     */
+    public URI getDSCURL() {
+        return this.dscURL;
+    }
+
+    /**
+     * @param dscURL
+     */
+    public void setDSCURL(URI dscURL) {
+        this.dscURL = dscURL;
+    }
+
+    /**
+     * Returns the topic.
+     * 
+     * @return The topic
+     */
+    public String getTopic() {
+        return this.topic;
+    }
+
+    /**
+     * Sets topic.
+     * 
+     * @param topic
+     *            The topic to set.
+     */
+    public void setTopic(String topic) {
+        this.topic = topic;
+    }
+
+    /**
+     * Returns the messageBoxUrl.
+     * 
+     * @return The messageBoxUrl
+     */
+    public URI getMessageBoxURL() {
+        return this.messageBoxURL;
+    }
+
+    /**
+     * Sets messageBoxUrl.
+     * 
+     * @param messageBoxURL
+     *            The messageBoxUrl to set.
+     */
+    public void setMessageBoxURL(URI messageBoxURL) {
+        this.messageBoxURL = messageBoxURL;
+    }
+
+    /**
+     * Returns the pullMode.
+     * 
+     * @return The pullMode
+     */
+    public boolean isPullMode() {
+        return this.pullMode;
+    }
+
+    /**
+     * Sets pullMode.
+     * 
+     * @param pullMode
+     *            The pullMode to set.
+     */
+    public void setPullMode(boolean pullMode) {
+        this.pullMode = pullMode;
+    }
+
+    /**
+     * Returns the brokerLocation.
+     * 
+     * @return The brokerLocation
+     */
+    public URI getBrokerURL() {
+        return this.brokerURL;
+    }
+
+    /**
+     * Sets brokerLocation.
+     * 
+     * @param brokerURL
+     *            The brokerLocation to set.
+     */
+    public void setBrokerURL(URI brokerURL) {
+        this.brokerURL = brokerURL;
+    }
+
+    /**
+     * Returns the startMonitor.
+     * 
+     * @return The startMonitor
+     */
+    public boolean isStartMonitor() {
+        return this.startMonitor;
+    }
+
+    /**
+     * Sets startMonitor.
+     * 
+     * @param startMonitor
+     *            The startMonitor to set.
+     */
+    public void setStartMonitor(boolean startMonitor) {
+        this.startMonitor = startMonitor;
+    }
+
+    /**
+     * Returns the kermaURI.
+     * 
+     * @return The kermaURI
+     */
+    public URI getKarmaURL() {
+        return this.karmaURL;
+    }
+
+    /**
+     * Sets kermaURI.
+     * 
+     * @param kermaURI
+     *            The kermaURI to set.
+     */
+    public void setKarmaURL(URI kermaURI) {
+        this.karmaURL = kermaURI;
+    }
+
+    /**
+     * Returns the kermaWorkflowInstanceID.
+     * 
+     * @return The kermaWorkflowInstanceID
+     */
+    public URI getKarmaWorkflowInstanceID() {
+        return this.karmaWorkflowInstanceID;
+    }
+
+    /**
+     * Sets kermaWorkflowInstanceID.
+     * 
+     * @param karmaWorkflowInstanceID
+     *            The kermaWorkflowInstanceID to set.
+     */
+    public void setKarmaWorkflowInstanceID(URI karmaWorkflowInstanceID) {
+        this.karmaWorkflowInstanceID = karmaWorkflowInstanceID;
+    }
+
+    /**
+     * Returns the myProxyServer.
+     * 
+     * @return The myProxyServer
+     */
+    public String getMyProxyServer() {
+        return this.myProxyServer;
+    }
+
+    /**
+     * Sets myProxyServer.
+     * 
+     * @param myProxyServer
+     *            The myProxyServer to set.
+     */
+    public void setMyProxyServer(String myProxyServer) {
+        this.myProxyServer = myProxyServer;
+    }
+
+    /**
+     * Returns the myProxyPort.
+     * 
+     * @return The myProxyPort
+     */
+    public int getMyProxyPort() {
+        return this.myProxyPort;
+    }
+
+    /**
+     * Sets myProxyPort.
+     * 
+     * @param myProxyPort
+     *            The myProxyPort to set.
+     */
+    public void setMyProxyPort(int myProxyPort) {
+        this.myProxyPort = myProxyPort;
+    }
+
+    /**
+     * Returns the myProxyLifetime.
+     * 
+     * @return The myProxyLifetime
+     */
+    public int getMyProxyLifetime() {
+        return this.myProxyLifetime;
+    }
+
+    /**
+     * Sets myProxyLifetime.
+     * 
+     * @param myProxyLifetime
+     *            The myProxyLifetime to set.
+     */
+    public void setMyProxyLifetime(int myProxyLifetime) {
+        this.myProxyLifetime = myProxyLifetime;
+    }
+
+    /**
+     * Returns the myProxyUsername.
+     * 
+     * @return The myProxyUsername
+     */
+    public String getMyProxyUsername() {
+        return this.myProxyUsername;
+    }
+
+    /**
+     * Sets myProxyUsername.
+     * 
+     * @param myProxyUsername
+     *            The myProxyUsername to set.
+     */
+    public void setMyProxyUsername(String myProxyUsername) {
+        this.myProxyUsername = myProxyUsername;
+    }
+
+    /**
+     * Returns the odeURL.
+     * 
+     * @return The odeURL
+     */
+    public String getOdeURL() {
+        return this.odeURL;
+    }
+
+    /**
+     * Sets odeURL.
+     * 
+     * @param odeURL
+     *            The odeURL to set.
+     */
+    public void setOdeURL(String odeURL) {
+        this.odeURL = odeURL;
+    }
+
+    /**
+     * Returns the workflowInterpreterURL.
+     * 
+     * @return The workflowInterpreterURL
+     */
+    public URI getWorkflowInterpreterURL() {
+        return this.workflowInterpreterURL;
+    }
+
+    /**
+     * Sets workflowInterpreterURL.
+     * 
+     * @param workflowInterpreterURL
+     *            The workflowInterpreterURL to set.
+     */
+    public void setWorkflowInterpreterURL(URI workflowInterpreterURL) {
+        this.workflowInterpreterURL = workflowInterpreterURL;
+    }
+
+    /**
+     * Sets proxyURI.
+     * 
+     * @param proxyURI
+     *            The proxyURI to set.
+     */
+    public void setProxyURI(URI proxyURI) {
+        this.proxyURI = proxyURI;
+    }
+
+    /**
+     * Returns the myProxyPassphrase.
+     * 
+     * @return The myProxyPassphrase
+     */
+    public String getMyProxyPassphrase() {
+        return this.myProxyPassphrase;
+    }
+
+    /**
+     * Sets myProxyPassphrase.
+     * 
+     * @param myProxyPassphrase
+     *            The myProxyPassphrase to set.
+     */
+    public void setMyProxyPassphrase(String myProxyPassphrase) {
+        this.myProxyPassphrase = myProxyPassphrase;
+    }
+
+    /**
+     * Returns the loadMyProxy.
+     * 
+     * @return The loadMyProxy
+     */
+    public boolean isLoadMyProxy() {
+        return this.loadMyProxy;
+    }
+
+    /**
+     * Sets loadMyProxy.
+     * 
+     * @param loadMyProxy
+     *            The loadMyProxy to set.
+     */
+    public void setLoadMyProxy(boolean loadMyProxy) {
+        this.loadMyProxy = loadMyProxy;
+    }
+
+    /**
+     * Returns the loadRunJythonWorkflow.
+     * 
+     * @return The loadRunJythonWorkflow
+     */
+    public boolean isLoadRunJythonWorkflow() {
+        return this.loadRunJythonWorkflow;
+    }
+
+    /**
+     * Sets loadRunJythonWorkflow.
+     * 
+     * @param loadRunJythonWorkflow
+     *            The loadRunJythonWorkflow to set.
+     */
+    public void setLoadRunJythonWorkflow(boolean loadRunJythonWorkflow) {
+        this.loadRunJythonWorkflow = loadRunJythonWorkflow;
+    }
+
+    /**
+     * Returns the height.
+     * 
+     * @return The height
+     */
+    public int getHeight() {
+        return this.height;
+    }
+
+    /**
+     * Sets height.
+     * 
+     * @param height
+     *            The height to set.
+     */
+    public void setHeight(int height) {
+        this.height = height;
+    }
+
+    /**
+     * Returns the width.
+     * 
+     * @return The width
+     */
+    public int getWidth() {
+        return this.width;
+    }
+
+    /**
+     * Sets width.
+     * 
+     * @param width
+     *            The width to set.
+     */
+    public void setWidth(int width) {
+        this.width = width;
+    }
+
+    /**
+     * Add an error.
+     * 
+     * @param e
+     */
+    public void addError(Throwable e) {
+        this.errors.add(e);
+    }
+
+    /**
+     * Returns errors.
+     * 
+     * @return Errors.
+     */
+    public Iterable<Throwable> getErrors() {
+        return this.errors;
+    }
+
+    /**
+     * @return
+     */
+    public String getODEURL() {
+        // TODO Auto-generated method stub
+        return this.odeURL;
+    }
+
+    //
+
+    /**
+     * Returns current proxy URI
+     * 
+     * @return
+     */
+    public URI getProxyURI() {
+        return this.proxyURI;
+    }
+
+    /**
+     * @param b
+     */
+    public void setCloseOnExit(boolean b) {
+        this.closeOnExit = b;
+    }
+
+    /**
+     * @return
+     */
+    public boolean isCloseOnExit() {
+        return this.closeOnExit;
+    }
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        if (this.airavataAPI != null && this.airavataAPI instanceof Observable) {
+            ((Observable) this.airavataAPI).deleteObserver(this);
+        }
+        this.airavataAPI = airavataAPI;
+        if (airavataAPI != null && airavataAPI instanceof Observable) {
+            ((Observable) airavataAPI).addObserver(this);
+        }
+        if (getJcrComponentRegistry()==null){
+        	setJcrComponentRegistry(new JCRComponentRegistry(airavataAPI));
+        }else{
+        	getJcrComponentRegistry().setAiravataAPI(airavataAPI);
+        }
+        triggerObservers(getJcrComponentRegistry());
+    }
+
+    public URI getRegistryURL() {
+        return registryURL;
+    }
+
+    public void setRegistryURL(URI registryURL) {
+        this.registryURL = registryURL;
+    }
+
+    public void setRegigstryUserName(String regigstryUserName) {
+        this.regigstryUserName = regigstryUserName;
+    }
+
+    public void setRegistryPassphrase(String registryPassphrase) {
+        this.registryPassphrase = registryPassphrase;
+    }
+
+    public String getRegistryUserName() {
+        return regigstryUserName;
+    }
+
+    public String getRegistryPassphrase() {
+        return registryPassphrase;
+    }
+
+    protected void triggerObservers(Object o) {
+        setChanged();
+        notifyObservers(o);
+    }
+
+    public void update(Observable observable, Object o) {
+        triggerObservers(observable);
+    }
+
+    public boolean isCollectProvenance() {
+        return collectProvenance;
+    }
+
+    public boolean isProvenanceSmartRun() {
+        return provenanceSmartRun;
+    }
+
+    public void setCollectProvenance(boolean collectProvenance) {
+        this.collectProvenance = collectProvenance;
+    }
+
+    public void setProvenanceSmartRun(boolean provenanceSmartRun) {
+        this.provenanceSmartRun = provenanceSmartRun;
+    }
+
+    public void setRunWithCrossProduct(boolean runWithCrossProduct) {
+        this.runWithCrossProduct = runWithCrossProduct;
+    }
+
+    public boolean isRunWithCrossProduct() {
+        return runWithCrossProduct;
+    }
+
+    public String getTrustedCertLocation() {
+        return trustedCertLocation;
+    }
+
+    public void setTrustedCertLocation(String trustedCertLocation) {
+        this.trustedCertLocation = trustedCertLocation;
+    }
+
+	public XBayaExecutionMode getXbayaExecutionMode() {
+		return xbayaExecutionMode;
+	}
+
+	public void setXbayaExecutionMode(XBayaExecutionMode xbayaExecutionMode) {
+		boolean modeChanged=(this.xbayaExecutionMode != xbayaExecutionMode);
+		this.xbayaExecutionMode = xbayaExecutionMode;
+		if (modeChanged) {
+			for (XBayaExecutionModeListener listner : xbayaExecutionModeChangeListners) {
+				try {
+					listner.executionModeChanged(this);
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+	
+	public void registerExecutionModeChangeListener(XBayaExecutionModeListener listner){
+		xbayaExecutionModeChangeListners.add(listner);
+	}
+	
+	public void unregisterExecutionModeChangeListener(XBayaExecutionModeListener listner){
+		if (xbayaExecutionModeChangeListners.contains(listner)) {
+			xbayaExecutionModeChangeListners.remove(listner);
+		}
+	}
+
+    public int getX() {
+        return x;
+    }
+
+    public void setX(int x) {
+        this.x = x;
+    }
+
+    public int getY() {
+        return y;
+    }
+
+    public void setY(int y) {
+        this.y = y;
+    }
+
+//    public AiravataAPI getAiravataAPI() {
+//        return airavataAPI;
+//    }
+//
+//    public void setAiravataAPI(AiravataAPI airavataAPI) {
+//        this.airavataAPI = airavataAPI;
+//    }
+
+    public String getDefaultGateway() {
+        return defaultGateway;
+    }
+
+    public void setDefaultGateway(String defaultGateway) {
+        this.defaultGateway = defaultGateway;
+    }
+
+	public JCRComponentRegistry getJcrComponentRegistry() {
+		return jcrComponentRegistry;
+	}
+
+	public void setJcrComponentRegistry(JCRComponentRegistry jcrComponentRegistry) {
+		this.jcrComponentRegistry = jcrComponentRegistry;
+	}
+
+    public boolean isRegURLSetByCMD() {
+        return regURLSetByCMD;
+    }
+
+    public void setRegURLSetByCMD(boolean regURLSetByCMD) {
+        this.regURLSetByCMD = regURLSetByCMD;
+    }
+
+    //    public AiravataAPI setAiravataAPI() {
+//        try{
+//            URI baseUri = new URI(ResourcePathConstants.BASE_URL);
+//            PasswordCallbackImpl passwordCallback = new PasswordCallbackImpl(getRegistryUserName(), getRegistryPassphrase());
+//            airavataAPI = AiravataClientUtils.getAPI(baseUri,
+//                    getRegistryUserName(), passwordCallback);
+//        } catch (RepositoryException e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//        } catch (MalformedURLException e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//        } catch (RegistryException e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//        } catch (URISyntaxException e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//        }
+//        return airavataAPI;
+//    }
+
+    public ContextHeaderDocument.ContextHeader getContextHeader() {
+        return contextHeader;
+    }
+
+    public void setContextHeader(ContextHeaderDocument.ContextHeader contextHeader) {
+        this.contextHeader = contextHeader;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java
new file mode 100644
index 0000000..d754450
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaConstants.java
@@ -0,0 +1,205 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya;
+
+import java.net.URI;
+
+public class XBayaConstants {
+
+    /**
+     * XBaya
+     */
+    public static final String APPLICATION_SHORT_NAME = "XBaya";
+
+    /**
+     * The name of the project
+     */
+    public static final String PROJECT_NAME = "Apache Airavata";
+    
+    /**
+     * The name of the application
+     */
+    public static final String APPLICATION_NAME = "XBaya Dashboard";
+
+    /**
+     * The URL of the web page of the application
+     */
+    public static final URI WEB_URL = URI.create("http://airavata.apache.org/");
+
+    // Default values
+
+    /**
+     * Default URL of the GPEL Engine
+     */
+    public static final URI DEFAULT_GPEL_ENGINE_URL = URI.create("https://tyr13.cs.indiana.edu:7443/gpel/");
+
+    /**
+     * DEFAULT_GFAC_URL
+     */
+    public static final URI DEFAULT_GFAC_URL = URI.create("http://localhost:8080/axis2/services/GFacService");
+
+    /**
+     * DEFAULT_TOPIC
+     */
+    public static final String DEFAULT_TOPIC = "xbaya-topic";
+
+    /**
+     * Default notification broker URL.
+     */
+    public static final URI DEFAULT_BROKER_URL = URI.create("http://localhost:8080/axis2/services/EventingService");
+
+    /**
+     * Default message box URL.
+     */
+    public static final URI DEFAULT_MESSAGE_BOX_URL = URI.create("http://localhost:8080/axis2/services/MsgBoxService");
+
+    /**
+     * DEFAULT_DSC_URL
+     */
+    public static final URI DEFAULT_DSC_URL = URI.create("https://silktree.cs.indiana.edu:52520/");
+
+    /**
+     * DEFAULT_MYPROXY_SERVER
+     */
+    public static final String DEFAULT_MYPROXY_SERVER = "myproxy.teragrid.org";
+
+    /**
+     * DEFAULT_MYPROXY_PORT
+     */
+    public static final int DEFAULT_MYPROXY_PORT = 7512;
+
+    /**
+     * DEFAULT_MYPROXY_LIFTTIME
+     */
+    public static final int DEFAULT_MYPROXY_LIFTTIME = 3600;
+
+    /**
+     * DEFAULT_WEB_REGISTRY
+     */
+    public static final URI DEFAULT_WEB_REGISTRY = URI.create("http://www.extreme.indiana.edu/xgws/wsdl/");
+
+    // File suffixes
+
+    /**
+     * File suffix for XML
+     */
+    public static final String XML_SUFFIX = ".xml";
+
+    /**
+     * File suffix for WSDL
+     */
+    public static final String WSDL_SUFFIX = ".wsdl";
+
+    /**
+     * File suffix for WSDL
+     */
+    public static final String WSDL_SUFFIX2 = "-wsdl.xml";
+
+    /**
+     * Suffix of a graph file
+     */
+    public static final String GRAPH_FILE_SUFFIX = ".xgr";
+
+    /**
+     * Suffix of a workflow file
+     */
+    public static final String WORKFLOW_FILE_SUFFIX = ".xwf";
+
+    /**
+     * File suffix for Jython scripts
+     */
+    public static final String JYTHON_SCRIPT_SUFFIX = ".py";
+
+    /**
+     * File suffix for BPEL
+     */
+    public static final String BPEL_SUFFIX = ".bpel";
+
+    /**
+     * File suffix for SCUFL
+     */
+    public static final String SCUFL_SCRIPT_SUFFIX = ".xml";
+
+    /**
+     * File suffix for PNG
+     */
+    public static final String PNG_SUFFIX = ".png";
+
+    /**
+     * Format name for png image
+     */
+    public static final String PNG_FORMAT_NAME = "PNG";
+
+    /**
+     * ODE URL
+     */
+    public static final String DEFAULT_ODE_URL = "https://pagodatree.cs.indiana.edu:17443";
+
+    /**
+     * WorkflowInterpreter URL
+     */
+    public static final URI DEFAULT_WORKFLOW_INTERPRETER_URL = URI
+            .create("http://localhost:8080/axis2/services/WorkflowInterpretor?wsdl");
+
+    /**
+     * 
+     * PROXY URL
+     */
+
+    public static final URI DEFAULT_PROXY_URI = URI
+            .create("http://silktree.cs.indiana.edu:18080/axis2/services/WEPSService?wsdl");
+
+    /**
+     * WORKFLOW Namespace
+     */
+    public static final String LEAD_NS = "http://extreme.indiana.edu/lead/workflow";
+
+    /**
+     * OGCE WORKFLOW Namespace
+     */
+    public static final String OGCE_WORKFLOW_NS = "http://workflow.ogce.org/";
+
+    public static final String STREAM_SERVER = "http://pagodatree.cs.indiana.edu:8081/axis2/services/StreamService?wsdl";
+
+    public static final String STATIC_LABEL = "STATIC";
+    public static final URI REGISTRY_URL = URI.create("http://localhost:8080/airavata-registry/api");
+    public static final String DEFAULT_GATEWAY = "default";
+    public static final String REGISTRY_USERNAME = "admin";
+    public static final String REGISTRY_PASSPHRASE = "admin";
+    public static final String REGISTRY_TYPE_HOST_DESC = "HostDesc";
+    public static final String REGISTRY_TYPE_APPLICATION_DESC = "ApplicationDesc";
+    public static final String REGISTRY_TYPE_SERVICE_DESC = "ServiceDesc";
+    public static final String REGISTRY_TYPE_WORKFLOW = "workflow";
+    public static final String HTTP_SCHEMAS_AIRAVATA_APACHE_ORG_GFAC_TYPE = "http://airavata.apache.org/schemas/gfac/2012/12";
+
+    public static final String XBAYA_REGISTRY_USER = "xbaya.registry.user";
+    public static final String XBAYA_REGISTRY_URL = "xbaya.registry.url";
+    public static final String XBAYA_DEFAULT_GATEWAY = "xbaya.default.gateway";
+
+    /**
+     * XRegistry Resource Types for OGCE Resource
+     */
+    public static enum XR_Resource_Types {
+        Project, Experiment, WorkflowTemplate, WorkflowInstance, WorkflowInput, WorkflowOutput
+    };
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
new file mode 100644
index 0000000..1973172
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaEngine.java
@@ -0,0 +1,302 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya;
+
+import java.net.URI;
+import java.util.List;
+
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.AiravataManager;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.amazon.AmazonComponentRegistry;
+import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
+import org.apache.airavata.workflow.model.component.system.SystemComponentRegistry;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.ws.monitor.MonitorConfiguration;
+import org.apache.airavata.xbaya.component.registry.ComponentController;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.registry.PasswordCallbackImpl;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.monitor.MonitorStarter;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelector;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
+import org.apache.airavata.xbaya.workflow.WorkflowClient;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class XBayaEngine {
+
+    private static final Logger logger = LoggerFactory.getLogger(XBayaEngine.class);
+
+    private XBayaConfiguration configuration;
+
+    private XBayaGUI gui;
+
+    private WorkflowClient workflowClient;
+
+    private Monitor monitor;
+
+    private boolean exitOnClose = true;
+
+    private ComponentTreeNode systemComponentTree;
+
+    private SystemComponentRegistry componentRegistry;
+
+    private WorkflowInterpreter workflowInterpreter;
+
+    private AiravataAPI airavataAPI;
+    
+    private ComponentSelector componentTreeViewer; 
+
+    /**
+     * Constructs a ApplicationClient.
+     *
+     * @param configuration
+     */
+    public XBayaEngine(XBayaConfiguration configuration) {
+        this.configuration = configuration;
+
+        // Creates some essential objects.
+
+        MonitorConfiguration monitorConfiguration = new MonitorConfiguration(configuration.getBrokerURL(),
+                configuration.getTopic(), configuration.isPullMode(), configuration.getMessageBoxURL());
+        this.monitor = new Monitor(monitorConfiguration);
+
+        if (configuration.getAiravataAPI() == null && airavataAPI == null) {
+            try {
+                airavataAPI =  AiravataAPIFactory.getAPI(configuration.getRegistryURL(),
+                        configuration.getDefaultGateway(), configuration.getRegistryUserName(),
+                        new PasswordCallbackImpl(configuration.getRegistryUserName(), configuration.getRegistryPassphrase()));
+                configuration.setAiravataAPI(airavataAPI);
+            } catch (AiravataAPIInvocationException e) {
+                logger.error("Unable to instantiate airavata api instance", e);
+            }
+
+        }
+
+        // MyProxy
+        // this.myProxyClient = new MyProxyClient(this.configuration.getMyProxyServer(),
+        // this.configuration.getMyProxyPort(), this.configuration.getMyProxyUsername(),
+        // this.configuration.getMyProxyPassphrase(), this.configuration.getMyProxyLifetime());
+        //
+        // // These have to be before the GUI setup.
+        // this.workflowClient = WorkflowEngineManager.getWorkflowClient();
+        // this.workflowClient.setXBayaEngine(this);
+
+
+        // Set up the GUI.
+        updateXBayaConfigurationServiceURLs();
+        XBayaEngine.this.gui = new XBayaGUI(XBayaEngine.this);
+
+        // Arguments errors.
+        for (Throwable e : this.configuration.getErrors()) {
+            getGUI().getErrorWindow().error(e.getMessage(), e);
+        }
+
+        // Initialization after the GUI setup.
+        initAfterGUI();
+    }
+
+    /**
+     * Returns the configuration.
+     *
+     * @return The configuration
+     */
+    public XBayaConfiguration getConfiguration() {
+        return this.configuration;
+    }
+
+    /**
+     * Returns the XwfGui. The XwfGui is either XwfAppletGui in case of the applet, or XwfApplicationGui in case of the
+     * application.
+     *
+     * @return the XwfGui
+     */
+    public XBayaGUI getGUI() {
+        return this.gui;
+    }
+
+    /**
+     * Returns the Workflow Client.
+     *
+     * @return the Workflow Client
+     */
+    public WorkflowClient getWorkflowClient() {
+        return this.workflowClient;
+    }
+
+
+    /**
+     * Returns the monitor.
+     *
+     * @return The monitor
+     */
+    public Monitor getMonitor() {
+        return this.monitor;
+    }
+
+    /**
+     * Disposes on exit.
+     *
+     * @throws WorkflowException
+     */
+    public void dispose() throws WorkflowException {
+        this.monitor.stop();
+    }
+
+    /**
+     * Initialization process. This method is called after the GUI is initialized.
+     */
+    private void initAfterGUI() {
+
+        initRegistry();
+
+        initMonitor();
+
+    }
+
+    /**
+     * Initializes registris.
+     */
+    private void initRegistry() {
+
+        componentTreeViewer = this.gui.getComponentSelector();
+        try {
+            this.componentRegistry = new SystemComponentRegistry();
+            // This does not take time, so we can do it in the same thread.
+            this.systemComponentTree = ComponentController.getComponentTree(this.componentRegistry);
+            componentTreeViewer.addComponentTree(0, this.systemComponentTree);
+
+            componentTreeViewer.addComponentTree(1, ComponentController.getComponentTree(new AmazonComponentRegistry()));
+
+        } catch (RuntimeException e) {
+            // This should not happen
+            e.printStackTrace();
+            getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        } catch (ComponentRegistryException e) {
+        	e.printStackTrace();
+            getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+		}
+
+        List<String> localRegistryPaths = this.configuration.getLocalRegistry();
+        for (String path : localRegistryPaths) {
+            try {
+                LocalComponentRegistry registry = new LocalComponentRegistry(path);
+                // XXX This might take time, so it's better to move to another
+                // thread.
+                ComponentTreeNode componentTree = ComponentController.getComponentTree(registry);
+                componentTreeViewer.addComponentTree(componentTree);
+            } catch (ComponentRegistryException e) {
+                getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
+            } catch (RuntimeException e) {
+                getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            }
+        }
+    }
+
+    /**
+     * Initializes monitor.
+     */
+    private void initMonitor() {
+        try {
+            if (this.configuration.isStartMonitor()) {
+                MonitorStarter starter = new MonitorStarter(this);
+                starter.start();
+            }
+        } catch (RuntimeException e) {
+            getGUI().getErrorWindow().error(ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
+        } catch (Error e) {
+            getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        }
+    }
+
+    public void resetWorkflowInterpreter() {
+		this.workflowInterpreter = null;
+	}
+    
+    
+	public WorkflowInterpreter getWorkflowInterpreter() {
+		return workflowInterpreter;
+	}
+
+	public void registerWorkflowInterpreter(WorkflowInterpreter workflowInterpreter) {
+		if (getWorkflowInterpreter()!=null){
+			throw new WorkflowRuntimeException("Critical Error!!! Workflow interpretter already running. Cleanup first");
+		}
+		this.workflowInterpreter = workflowInterpreter;
+	}
+
+	
+	public void updateXBayaConfigurationServiceURLs() {
+		try {
+			if (this.getConfiguration().getAiravataAPI()!=null){
+                airavataAPI = getConfiguration().getAiravataAPI();
+                AiravataManager airavataManager = airavataAPI.getAiravataManager();
+//                AiravataRegistry2 registry=this.getConfiguration().getJcrComponentRegistry().getRegistry();
+	        	URI eventingServiceURL = airavataManager.getEventingServiceURL();
+				if (eventingServiceURL!=null) {
+					this.getConfiguration().setBrokerURL(eventingServiceURL);
+					this.getMonitor()
+							.getConfiguration()
+							.setBrokerURL(eventingServiceURL);
+				}
+				URI messageBoxServiceURL = airavataManager.getMessageBoxServiceURL();
+				if (messageBoxServiceURL!=null) {
+					this.getConfiguration()
+					.setMessageBoxURL(messageBoxServiceURL);
+					this.getMonitor()
+							.getConfiguration()
+							.setMessageBoxURL(messageBoxServiceURL);
+				}
+				List<URI> interpreterServiceURLList = airavataManager.getWorkflowInterpreterServiceURLs();
+				if (interpreterServiceURLList.size()>0) {
+					this.getConfiguration()
+							.setWorkflowInterpreterURL(interpreterServiceURLList.get(0));
+				}
+//				List<URI> gfacURLList = airavataManager.getGFaCURLs();
+//				if (gfacURLList.size()>0) {
+//					this.getConfiguration().setGFacURL(gfacURLList.get(0));
+//				}
+			}
+        } catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+    public AiravataAPI getAiravataAPI() {
+        return airavataAPI;
+    }
+
+    public void setAiravataAPI(AiravataAPI airavataAPI) {
+        this.airavataAPI = airavataAPI;
+    }
+    
+    public void reloadRegistry(){
+    	componentTreeViewer.refresh();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
new file mode 100644
index 0000000..5e34672
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/XBayaVersion.java
@@ -0,0 +1,42 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya;
+
+import org.apache.airavata.common.utils.Version;
+
+public class XBayaVersion {
+
+    /**
+     * Version number
+     */
+    public final static Version VERSION = new Version("Airavata XBaya", 0, 11,
+			null, null, null);;
+
+    /**
+     * Prints the version
+     * 
+     * @param args
+     */
+    public static void main(String[] args) {
+        System.out.println(VERSION);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentController.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentController.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentController.java
new file mode 100644
index 0000000..adeaa92
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentController.java
@@ -0,0 +1,50 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.component.registry;
+
+import java.util.List;
+
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistry;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
+
+public class ComponentController {
+
+	public static ComponentTreeNode getComponentTree(ComponentRegistry registry) throws ComponentRegistryException {
+		ComponentTreeNode tree = new ComponentTreeNode(registry);
+		addComponentReferencesToTree(tree, registry.getComponentReferenceList());
+		return tree;
+	}
+
+	private static void addComponentReferencesToTree(ComponentTreeNode tree,
+			List<ComponentReference> componentReferenceList) {
+		for (ComponentReference componentReference : componentReferenceList) {
+			ComponentTreeNode componentTreeNode = new ComponentTreeNode(componentReference);
+			if (componentReference.isParentComponent()){
+				addComponentReferencesToTree(componentTreeNode, componentReference.getChildComponentReferences());
+			}
+			tree.add(componentTreeNode);
+		}
+	}
+	
+}


[11/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/NodeParameter.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/NodeParameter.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/NodeParameter.java
deleted file mode 100644
index acaa398..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/NodeParameter.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.schemas.gfac.Parameter;
-
-
-public class NodeParameter {
-	private Parameter parameter;
-	private Object value;
-	
-	public NodeParameter(Parameter parameter) {
-		this(parameter,null);
-	}
-	
-	public NodeParameter(Parameter parameter, Object value) {
-		setParameter(parameter);
-		setValue(value);
-	}
-	public Parameter getParameter() {
-		return parameter;
-	}
-	public void setParameter(Parameter parameter) {
-		this.parameter = parameter;
-	}
-	public Object getValue() {
-		return value;
-	}
-	public void setValue(Object value) {
-		this.value = value;
-	}
-	
-	public String getName(){
-		return getParameter().getParameterName();
-	}
-	
-	public String getDescription(){
-		return getParameter().getParameterDescription();
-	}
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/OutputParameters.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/OutputParameters.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/OutputParameters.java
deleted file mode 100644
index f3067e5..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/OutputParameters.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.schemas.gfac.Parameter;
-
-public class OutputParameters extends ServiceParameters {
-
-	public OutputParameters(NodeParameter[] parameters) {
-		super(parameters);
-	}
-	
-	public OutputParameters(Parameter[] parameters) {
-		super(parameters);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceDescriptions.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceDescriptions.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceDescriptions.java
deleted file mode 100644
index dcef41f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceDescriptions.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import java.util.List;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class ServiceDescriptions {
-    private AiravataAPI airavataAPI;
-
-    public ServiceDescriptions(AiravataAPI airavataAPI) {
-        setAiravataAPI(airavataAPI);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public List<ServiceDescription> getDescriptions() throws RegistryException, AiravataAPIInvocationException {
-        return getAiravataAPI().getApplicationManager().getAllServiceDescriptions();
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceParameters.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceParameters.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceParameters.java
deleted file mode 100644
index a3ea981..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ServiceParameters.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import org.apache.airavata.schemas.gfac.Parameter;
-
-public class ServiceParameters {
-	private List<NodeParameter> parameters;
-	
-	public ServiceParameters(Parameter[] parameters) {
-		if (parameters!=null) {
-			List<NodeParameter> serviceParaList = new ArrayList<NodeParameter>();
-			for (Parameter parameter : parameters) {
-				serviceParaList.add(new NodeParameter(parameter));
-			}
-			setParameters(serviceParaList);
-		}
-	}
-	
-	public ServiceParameters(NodeParameter[] parameters) {
-		if (parameters!=null) {
-			setParameters(Arrays.asList(parameters));
-		}
-	}
-	public List<NodeParameter> getParameters() {
-		if (parameters==null){
-			parameters=new ArrayList<NodeParameter>();
-		}
-		return parameters;
-	}
-	public void setParameters(List<NodeParameter> parameters) {
-		this.parameters = parameters;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflow.java
deleted file mode 100644
index 4b619b3..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflow.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.exception.worker.ExperimentLazyLoadedException;
-import org.apache.airavata.registry.api.workflow.NodeExecutionData;
-import org.apache.airavata.registry.api.workflow.WorkflowExecution;
-import org.apache.airavata.registry.api.workflow.WorkflowExecutionData;
-
-public class XBayaWorkflow {
-	private List<XBayaWorkflowNodeElement> workflowServices;
-	private WorkflowExecution workflowInstance;
-	private AiravataAPI airavataAPI;
-	
-	public XBayaWorkflow(WorkflowExecution workflowInstance, AiravataAPI airavataAPI) {
-		setWorkflowInstance(workflowInstance);
-		setAiravataAPI(airavataAPI);
-	}
-
-	public List<XBayaWorkflowNodeElement> getWorkflowServices() {
-		if (workflowServices==null){
-			workflowServices=new ArrayList<XBayaWorkflowNodeElement>();
-			try {
-				WorkflowExecutionData workflowInstanceData = getAiravataAPI().getProvenanceManager().getWorkflowInstanceData(getWorkflowId(), getWorkflowId());
-				List<NodeExecutionData> nodeDataList = workflowInstanceData.getNodeDataList();
-				for (NodeExecutionData nodeData : nodeDataList) {
-					workflowServices.add(new XBayaWorkflowNodeElement(nodeData.getWorkflowInstanceNode().getNodeId(), nodeData));
-				}
-			} catch (AiravataAPIInvocationException e) {
-				e.printStackTrace();
-			} catch (ExperimentLazyLoadedException e) {
-                e.printStackTrace();
-            }
-        }
-		return workflowServices;
-	}
-
-	public void setWorkflowNodes(List<XBayaWorkflowNodeElement> workflowServices) {
-		this.workflowServices = workflowServices;
-	}
-	
-	public void add(XBayaWorkflowNodeElement workflowService){
-		getWorkflowServices().add(workflowService);
-	}
-
-	public String getWorkflowName() {
-		return getWorkflowInstance().getTemplateName();
-	}
-
-	public String getWorkflowId() {
-		return getWorkflowInstance().getWorkflowExecutionId();
-	}
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public WorkflowExecution getWorkflowInstance() {
-		return workflowInstance;
-	}
-
-	public void setWorkflowInstance(WorkflowExecution workflowInstance) {
-		this.workflowInstance = workflowInstance;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiment.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiment.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiment.java
deleted file mode 100644
index 04f6fae..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiment.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.workflow.WorkflowExecution;
-
-public class XBayaWorkflowExperiment {
-	private List<XBayaWorkflow> workflows;
-	private String experimentId;
-	private AiravataAPI airavataAPI;
-	
-	public XBayaWorkflowExperiment(String experimentId, AiravataAPI airavataAPI) {
-		setExperimentId(experimentId);
-		setAiravataAPI(airavataAPI);
-	}
-
-	public List<XBayaWorkflow> getWorkflows() {
-		if (workflows==null){
-			workflows=new ArrayList<XBayaWorkflow>();
-			try {
-				List<WorkflowExecution> experimentWorkflowInstances = getAiravataAPI().getProvenanceManager().getExperimentWorkflowInstances(getExperimentId());
-				for (WorkflowExecution workflowInstance : experimentWorkflowInstances) {
-					workflows.add(new XBayaWorkflow(workflowInstance, getAiravataAPI()));
-				}
-			}  catch (AiravataAPIInvocationException e) {
-                e.printStackTrace();
-            }
-        }
-		return workflows;
-	}
-
-	public void setWorkflows(List<XBayaWorkflow> workflows) {
-		this.workflows = workflows;
-	}
-	
-	public void add(XBayaWorkflow workflow){
-		getWorkflows().add(workflow);
-	}
-
-	public String getExperimentId() {
-		return experimentId;
-	}
-
-	public void setExperimentId(String experimentId) {
-		this.experimentId = experimentId;
-	}
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiments.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiments.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiments.java
deleted file mode 100644
index 555aaf2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowExperiments.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class XBayaWorkflowExperiments {
-	private AiravataAPI airavataAPI;
-	
-	public XBayaWorkflowExperiments(AiravataAPI airavataAPI) {
-		setAiravataAPI(airavataAPI);
-	}
-	
-	public List<XBayaWorkflowExperiment> getAllExperiments(){
-		Map<String, XBayaWorkflowExperiment> experiments=new HashMap<String,XBayaWorkflowExperiment>();
-    	try {
-    		initializeExperimentMap(experiments);
-		} catch (AiravataAPIInvocationException e) {
-			e.printStackTrace();
-		}
-    	return Arrays.asList(experiments.values().toArray(new XBayaWorkflowExperiment[]{}));
-	}
-	
-	public void initializeExperimentMap(Map<String, XBayaWorkflowExperiment> experiments) throws AiravataAPIInvocationException {
-		List<String> experimentIdByUser = getAiravataAPI().getProvenanceManager().getExperimentIdList();
-		for (String id : experimentIdByUser) {
-			experiments.put(id, new XBayaWorkflowExperiment(id, getAiravataAPI()));
-		}
-	}
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowNodeElement.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowNodeElement.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowNodeElement.java
deleted file mode 100644
index a3072e0..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowNodeElement.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.airavata.registry.api.workflow.NodeExecutionData;
-import org.apache.airavata.registry.api.workflow.InputData;
-import org.apache.airavata.registry.api.workflow.OutputData;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceNodePortData;
-import org.apache.airavata.schemas.gfac.Parameter;
-
-public class XBayaWorkflowNodeElement {
-	private InputParameters inputParameters;
-	private OutputParameters outputParameters;
-	private NodeExecutionData nodeData;
-	private String nodeId;
-	
-	public XBayaWorkflowNodeElement(String nodeId, NodeExecutionData nodeData) {
-		setNodeId(nodeId);
-		setNodeData(nodeData);
-	}
-
-	public OutputParameters getOutputParameters() {
-		if (outputParameters==null){
-			outputParameters=new OutputParameters((NodeParameter[])null);
-			outputParameters.getParameters().addAll(generateParameterListForOutput(nodeData.getOutputData()));
-		}
-		return outputParameters;
-	}
-
-	private List<NodeParameter> generateParameterListForInput(
-			List<InputData> list) {
-		List<NodeParameter> params=new ArrayList<NodeParameter>();
-		for (WorkflowInstanceNodePortData portData : list) {
-			Parameter parameter = Parameter.Factory.newInstance();
-			parameter.setParameterName(portData.getName());
-			NodeParameter serviceParameter = new NodeParameter(parameter, portData.getValue());
-			params.add(serviceParameter);
-		}
-		return params;
-	}
-	
-	private List<NodeParameter> generateParameterListForOutput(
-			List<OutputData> list) {
-		List<NodeParameter> params=new ArrayList<NodeParameter>();
-		for (WorkflowInstanceNodePortData portData : list) {
-			Parameter parameter = Parameter.Factory.newInstance();
-			parameter.setParameterName(portData.getName());
-			NodeParameter serviceParameter = new NodeParameter(parameter, portData.getValue());
-			params.add(serviceParameter);
-		}
-		return params;
-	}
-
-	public void setOutputParameters(OutputParameters outputParameters) {
-		this.outputParameters = outputParameters;
-	}
-
-	public InputParameters getInputParameters() {
-		if (inputParameters==null){
-			inputParameters=new InputParameters((NodeParameter[])null);
-			inputParameters.getParameters().addAll(generateParameterListForInput(nodeData.getInputData()));
-		}
-		return inputParameters;
-	}
-
-	public void setInputParameters(InputParameters inputParameters) {
-		this.inputParameters = inputParameters;
-	}
-
-	public String getNodeId() {
-		return nodeId;
-	}
-
-	public void setNodeId(String nodeId) {
-		this.nodeId = nodeId;
-	}
-
-	public NodeExecutionData getNodeData() {
-		return nodeData;
-	}
-
-	public void setNodeData(NodeExecutionData nodeData) {
-		this.nodeData = nodeData;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplate.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplate.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplate.java
deleted file mode 100644
index 63af7ac..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplate.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-
-public class XBayaWorkflowTemplate {
-    private String workflowGraph;
-    private String workflowName;
-
-    public XBayaWorkflowTemplate(String workflowName, String workflowGraph) {
-        setWorkflowGraph(workflowGraph);
-        setWorkflowName(workflowName);
-    }
-
-    public String getWorkflowGraph() {
-        return workflowGraph;
-    }
-
-    public void setWorkflowGraph(String workflowGraph) {
-        this.workflowGraph = workflowGraph;
-    }
-
-	public String getWorkflowName() {
-		return workflowName;
-	}
-
-	public void setWorkflowName(String workflowName) {
-		this.workflowName = workflowName;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplates.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplates.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplates.java
deleted file mode 100644
index 318c3ac..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/XBayaWorkflowTemplates.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class XBayaWorkflowTemplates {
-    private AiravataAPI airavataAPI;
-
-    public XBayaWorkflowTemplates(AiravataAPI airavataAPI) {
-        setAiravataAPI(airavataAPI);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public List<XBayaWorkflowTemplate> getWorkflows() {
-        List<XBayaWorkflowTemplate> workflows = new ArrayList<XBayaWorkflowTemplate>();
-        try {
-            List<Workflow> list = getAiravataAPI().getWorkflowManager().getWorkflows();
-
-            for (Workflow workflow : list){
-                String workflowAsString = getAiravataAPI().getWorkflowManager().getWorkflowAsString(workflow.getName());
-                workflows.add(new XBayaWorkflowTemplate(workflow.getName(), workflowAsString));
-            }
-		} catch (AiravataAPIInvocationException e) {
-			e.printStackTrace();
-		}
-        return workflows;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java
deleted file mode 100644
index 5a0746c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/modifier/WorkflowModifier.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.modifier;
-
-import java.awt.Color;
-import java.awt.Point;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.airavata.common.exception.UtilsException;
-import org.apache.airavata.common.utils.WSDLUtil;
-import org.apache.airavata.workflow.model.component.system.InputComponent;
-import org.apache.airavata.workflow.model.component.ws.WSComponent;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Port;
-import org.apache.airavata.workflow.model.graph.impl.PortImpl;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.util.GraphUtil;
-import org.apache.airavata.workflow.model.graph.ws.WSGraph;
-import org.apache.airavata.workflow.model.graph.ws.WSNode;
-import org.apache.airavata.workflow.model.graph.ws.WSPort;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.ws.monitor.EventData;
-import org.apache.airavata.ws.monitor.EventDataRepository;
-import org.apache.airavata.ws.monitor.MonitorException;
-import org.apache.airavata.ws.monitor.MonitorUtil;
-import org.apache.airavata.ws.monitor.MonitorUtil.EventType;
-import org.apache.airavata.xbaya.graph.controller.NodeController;
-import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
-
-import xsul.XmlConstants;
-import xsul5.wsdl.WsdlPortTypeOperation;
-
-public class WorkflowModifier {
-
-    private static final Logger logger = LoggerFactory.getLogger(WorkflowModifier.class);
-
-    private Workflow modifiedWorkflow;
-
-    private EventDataRepository eventData;
-
-    /**
-     * Constructs a WorkflowModifier.
-     * 
-     * @param modifiedWorkflow
-     * @param eventData
-     */
-    public WorkflowModifier(Workflow modifiedWorkflow, EventDataRepository eventData) {
-        this.modifiedWorkflow = modifiedWorkflow;
-        this.eventData = eventData;
-    }
-
-    /**
-     * @return The workflow that needs to be executed.
-     * @throws GraphException
-     * @throws MonitorException
-     */
-    public Workflow createDifference() throws GraphException, MonitorException {
-        WSGraph originalGraph = this.modifiedWorkflow.getGraph();
-        Workflow workflow = this.modifiedWorkflow.clone();
-        String name = workflow.getName();
-        name += " (diff)";
-        workflow.setName(name);
-        WSGraph graph = workflow.getGraph();
-
-        // Remove the finished node.
-        removeFinishedNodes(originalGraph, graph);
-
-        Set<WSPort> originalFromPorts = getFinalOutputPorts(originalGraph, graph);
-
-        // Create input nodes for unconnected input ports.
-        createInputNodes(graph, originalFromPorts);
-
-        // Set default values.
-        for (WSPort originalFromPort : originalFromPorts) {
-            // TODO handle the case that node is not WSNode.
-            Node originalFromNode = originalFromPort.getNode();
-            String fromNodeID = originalFromNode.getID();
-            String output;
-            if (originalFromNode instanceof InputNode) {
-                // notification that includes the input of the workflow.
-                output = getWorkflowInput(fromNodeID);
-            } else if (originalFromNode instanceof WSNode) {
-                // Retrieve input value from notification.
-                WSComponent component = ((WSNode) originalFromNode).getComponent();
-                String messageName = component.getOutputTypeName();
-                String parameterName = originalFromPort.getComponentPort().getName();
-                output = getOutput(fromNodeID, messageName, parameterName);
-            } else {
-                // This should not happen.
-                throw new WorkflowRuntimeException(originalFromNode.getClass().getName());
-            }
-            Port originalToPort = originalFromPort.getToPorts().get(0);
-            PortImpl toPort = graph.getPort(originalToPort.getID());
-            InputNode inputNode = (InputNode) toPort.getFromNode();
-            inputNode.setDefaultValue(output);
-        }
-
-        return workflow;
-    }
-
-    /**
-     * @param originalGraph
-     * @param graph
-     * @throws GraphException
-     */
-    private void removeFinishedNodes(WSGraph originalGraph, WSGraph graph) throws GraphException {
-        ArrayList<Node> finishedNodes = new ArrayList<Node>();
-        for (Node node : originalGraph.getNodes()) {
-            Color color = NodeController.getGUI(node).getBodyColor();
-            if (NodeState.FINISHED.color.equals(color)) {
-                finishedNodes.add(node);
-            }
-        }
-        for (Node finishedNode : finishedNodes) {
-            Node node = graph.getNode(finishedNode.getID());
-            graph.removeNode(node);
-        }
-    }
-
-    /**
-     * @param originalGraph
-     * @param graph
-     * @return The final output ports.
-     */
-    private Set<WSPort> getFinalOutputPorts(WSGraph originalGraph, WSGraph graph) {
-        Collection<Port> inputPorts = GraphUtil.getPorts(graph, Port.Kind.DATA_IN);
-        Set<WSPort> originalFromPorts = new HashSet<WSPort>();
-        for (Port inputPort : inputPorts) {
-            Port fromPort = inputPort.getFromPort();
-            if (fromPort == null) {
-                // This input port is not connected.
-                String inputPortID = inputPort.getID();
-                logger.debug("id: " + inputPortID);
-                Port originalInputPort = originalGraph.getPort(inputPortID);
-                // No duplicate in set.
-                Port originalFromPort = originalInputPort.getFromPort();
-                originalFromPorts.add((WSPort) originalFromPort);
-            }
-        }
-        return originalFromPorts;
-    }
-
-    /**
-     * @param graph
-     * @param originalFromPorts
-     * @throws GraphException
-     */
-    private void createInputNodes(WSGraph graph, Set<WSPort> originalFromPorts) throws GraphException {
-        InputComponent inputComponent = new InputComponent();
-        for (WSPort originalFromPort : originalFromPorts) {
-            InputNode inputNode = inputComponent.createNode(graph);
-            List<Port> originalToPorts = originalFromPort.getToPorts();
-            boolean first = true;
-            for (Port originalToPort : originalToPorts) {
-                String toPortID = originalToPort.getID();
-                Port toPort = graph.getPort(toPortID);
-                graph.addEdge(inputNode.getPort(), toPort);
-                if (first) {
-                    first = false;
-                    Point position = NodeController.getGUI(originalToPort).getPosition();
-                    Point inputNodePosition = new Point(0, position.y);
-                    inputNode.setPosition(inputNodePosition);
-                }
-            }
-        }
-    }
-
-    private String getWorkflowInput(String nodeID) throws MonitorException {
-        logger.debug("Node:" + nodeID);
-        List<EventData> events = this.eventData.getEvents();
-        for (EventData event : events) {
-            EventType type = event.getType();
-            // TODO change this to read from the notification from GPEL.
-            if (type != EventType.INVOKING_SERVICE) {
-                continue;
-            }
-            String id = event.getNodeID();
-            if (!"".equals(id)) {
-                continue;
-            }
-            // TODO null check
-            XmlElement eventElement = event.getEvent();
-            XmlElement result = eventElement.element(MonitorUtil.REQUEST);
-            XmlElement body = result.element(MonitorUtil.BODY);
-            XmlElement soapBody = body.element(XmlConstants.S_BODY);
-            WsdlPortTypeOperation wsdlPortTypeOperation;
-            try {
-                wsdlPortTypeOperation = WSDLUtil.getFirstOperation(this.modifiedWorkflow.getWorkflowWSDL());
-            } catch (UtilsException e) {
-                throw new MonitorException(e);
-            }
-            XmlElement part = soapBody.element(wsdlPortTypeOperation.getName());
-            XmlElement parameter = part.element(nodeID);
-            // TODO support complex type.
-            String value = parameter.requiredText();
-            return value;
-        }
-        // TODO
-        String message = "Couldn't find a notification of about the input with nodeID, " + nodeID;
-        throw new MonitorException(message);
-    }
-
-    private String getOutput(String nodeID, String messageName, String parameterName) throws MonitorException {
-        List<EventData> events = this.eventData.getEvents();
-        for (EventData event : events) {
-            // We need to find the notification that contains the output of the
-            // service invocation.
-            EventType type = event.getType();
-            if (!(type == EventType.SENDING_RESULT || type == EventType.RECEIVED_RESULT)) {
-                continue;
-            }
-            String id = event.getNodeID();
-            if (!nodeID.equals(id)) {
-                continue;
-            }
-            // TODO null check
-            XmlElement eventElement = event.getEvent();
-            XmlElement result = eventElement.element(MonitorUtil.RESULT);
-            XmlElement body = result.element(MonitorUtil.BODY);
-            XmlElement soapBody = body.element(XmlConstants.S_BODY);
-            XmlElement part = soapBody.element(messageName);
-            XmlElement parameter = part.element(parameterName);
-            // TODO support complex type.
-            String value = parameter.requiredText();
-            return value;
-        }
-        // TODO
-        String message = "Couldn't find a notification of the output from the service with nodeID, " + nodeID;
-        throw new MonitorException(message);
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java
deleted file mode 100644
index cf6ce0c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceReader.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.xbaya.provenance;
-
-import java.util.List;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.registry.api.workflow.ExperimentData;
-import org.apache.airavata.registry.api.workflow.NodeExecutionData;
-import org.apache.airavata.workflow.model.graph.Node;
-
-public class ProvenanceReader {
-
-    public String DEFAULT_LIBRARY_FOLDER_NAME = "provenance";
-
-    private String experimentId;
-
-    private AiravataAPI airavataAPI;
-
-    private Node node;
-
-    public ProvenanceReader(Node node,String experimentId,AiravataAPI airavataAPI) {
-       this.experimentId = experimentId;
-        this.airavataAPI = airavataAPI;
-        this.node = node;
-	}
-
-    public Object read() throws Exception {
-        try {
-            ExperimentData workflowExecution = airavataAPI.getProvenanceManager().getExperimentData(experimentId);
-            List<NodeExecutionData> nodeDataList = workflowExecution.getWorkflowExecutionDataList().get(0).getNodeDataList();
-            if (nodeDataList.size() == 0) {
-                return null;
-            }
-            for (NodeExecutionData data : nodeDataList) {
-                if (this.node.getID().equals(data.getWorkflowInstanceNode().getNodeId())) {
-                    return data.getOutputData().get(0).getValue();
-                }
-            }
-            return null;
-        } catch (Exception e) {
-            return null;
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
deleted file mode 100644
index 25401dc..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/ProvenanceWrite.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.xbaya.provenance;
-
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.common.utils.XMLUtil;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.workflow.WorkflowExecution;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.graph.DataPort;
-import org.apache.airavata.workflow.model.graph.ForEachExecutableNode;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
-import org.apache.airavata.workflow.model.graph.system.ForEachNode;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.ws.WSNode;
-import org.apache.airavata.xbaya.concurrent.PredicatedExecutable;
-import org.apache.airavata.xbaya.graph.controller.NodeController;
-import org.apache.airavata.xbaya.invoker.Invoker;
-import org.apache.airavata.xbaya.util.XBayaUtil;
-import org.xmlpull.infoset.XmlElement;
-
-import xsul5.XmlConstants;
-
-/**
- * @author Chathura Herath
- */
-public final class ProvenanceWrite implements PredicatedExecutable {
-
-	private static final String PROVENANCE_DIR = "provenance";
-
-	private Node node;
-
-	private String workflowName;
-
-	private Map<Node, Invoker> invokerMap;
-
-    private String experimentId;
-
-    private AiravataAPI airavataAPI;
-
-	public ProvenanceWrite(Node node, String workflowName,
-                           Map<Node, Invoker> invokerMap, String experimentId,AiravataAPI airavataAPI) {
-		this.node = node;
-		this.workflowName = workflowName;
-		this.invokerMap = invokerMap;
-        this.experimentId = experimentId;
-        this.airavataAPI = airavataAPI;
-	}
-
-	public void run() {
-
-		try {
-			saveNodeOutputs(node, invokerMap, workflowName);
-		} catch (WorkflowException e) {
-			// do nothing its a failure but go on
-			e.printStackTrace();
-		}
-
-	}
-
-	public boolean isReady() {
-		return NodeController.isFinished(this.node) && invokerMap.get(node) != null;
-	}
-
-	private void saveNodeOutputs(Node node,
-			Map<Node, Invoker> invokerMap, String workflowName)
-			throws WorkflowException {
-
-		if (null != node && !(node instanceof InputNode)) {
-			XmlElement elem = XmlConstants.BUILDER.newFragment("previousdat");
-			XmlElement inputs = null;
-			if (node instanceof WSNode) {
-				String nodeID = node.getComponent().getName();
-				XmlElement nodeElement = elem.newElement("wsnode");
-				elem.addChild(nodeElement);
-				nodeElement.addChild(nodeID);
-				inputs = elem.newElement("inputs");
-				elem.addChild(inputs);
-
-				List<DataPort> portsToBeSaved = node.getInputPorts();
-				for (DataPort savePort : portsToBeSaved) {
-
-					String portID = savePort.getName();
-					XmlElement portElem = inputs.newElement(portID);
-					inputs.addChild(portElem);
-					Object portInput = XBayaUtil.findInputFromPort(
-                            savePort, invokerMap);
-					if (portInput instanceof org.xmlpull.v1.builder.XmlElement) {
-						portInput = XMLUtil
-								.xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) portInput);
-					}
-					portElem.addChild(portInput);
-
-				}
-
-			} else if (node instanceof EndForEachNode) {
-				// here we save the inputs for the entire foreach block
-				Node middleNode = node.getInputPort(0).getFromNode();
-				String nodeID = middleNode.getComponent().getName();
-				XmlElement nodeElement = elem.newElement("foreach");
-				elem.addChild(nodeElement);
-				nodeElement.addChild(nodeID);
-				inputs = elem.newElement("inputs");
-				elem.addChild(inputs);
-				XmlConstants.BUILDER.serializeToString(elem);
-				if (middleNode instanceof ForEachExecutableNode) {
-					List<DataPort> portsToBeSaved = middleNode.getInputPorts();
-					for (DataPort savePort : portsToBeSaved) {
-						// we will save all the inputs
-						// these are static inputs and
-						// input to the foreach node
-
-						if (savePort.getFromNode() instanceof ForEachNode) {
-							// this is the foreach node rest are simple
-							// inputs
-							Object value = XBayaUtil
-									.getInputsForForEachNode(
-											(ForEachNode) savePort
-													.getFromNode(),
-											new LinkedList<String>(),
-											invokerMap);
-							if (value instanceof org.xmlpull.v1.builder.XmlElement) {
-								value = XMLUtil
-										.xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) value);
-							}
-
-							XmlElement portElement = inputs.newElement(savePort
-									.getName());
-							inputs.addChild(portElement);
-							portElement.addChild(value);
-						} else {
-							String portID = savePort.getName();
-							XmlElement portElem = inputs.newElement(portID);
-							inputs.addChild(portElem);
-							Object portInput = XBayaUtil
-									.findInputFromPort(savePort, invokerMap);
-							if (portInput instanceof org.xmlpull.v1.builder.XmlElement) {
-								portInput = XMLUtil
-										.xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) portInput);
-							}
-
-							portElem.addChild(portInput);
-						}
-
-					}
-
-				} else {
-					// error but we will let it pass because it will be
-					// caught at higher level
-				}
-
-			}
-            if (inputs!=null) {
-				try {
-					this.airavataAPI.getProvenanceManager().setWorkflowInstanceNodeInput(new WorkflowInstanceNode(new WorkflowExecution(experimentId, experimentId), node.getID()), xsul5.XmlConstants.BUILDER.serializeToString(inputs));
-                } catch (AiravataAPIInvocationException e) {
-					throw new WorkflowException(e);
-				}
-				// deal with the outputs
-			}
-			XmlElement outputs = elem.newElement("outputs");
-			elem.addChild(outputs);
-
-			List<DataPort> outputPorts = node.getOutputPorts();
-			for (DataPort outputPort : outputPorts) {
-				String outputName = outputPort.getName();
-
-				XmlElement outputParamElement = outputs.newElement(outputName);
-				outputs.addChild(outputParamElement);
-				Object ouputParamValue = invokerMap.get(node).getOutput(
-						outputName);
-
-				if (ouputParamValue instanceof org.xmlpull.v1.builder.XmlElement) {
-					ouputParamValue = XMLUtil
-							.xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) ouputParamValue);
-				}
-
-				if (ouputParamValue != null) {
-					outputParamElement.addChild(ouputParamValue);
-				} else {
-					outputParamElement.addChild("null");
-				}
-			}
-            try {
-				this.airavataAPI.getProvenanceManager().setWorkflowInstanceNodeOutput(new WorkflowInstanceNode(new WorkflowExecution(experimentId,experimentId),node.getID()),xsul5.XmlConstants.BUILDER.serializeToString(outputs));
-            } catch (AiravataAPIInvocationException e) {
-				throw new WorkflowException(e);
-			}
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
deleted file mode 100644
index de2d836..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowNodeStatusUpdater.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.xbaya.provenance;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.workflow.WorkflowExecution;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
-import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WorkflowNodeStatusUpdater {
-       private static Logger logger = LoggerFactory.getLogger(WorkflowNodeStatusUpdater.class);
-
-    private AiravataAPI airavataAPI;
-
-    public WorkflowNodeStatusUpdater(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public boolean workflowNodeStarted(String workflowInstanceID,String nodeID,String inputs,String workflowID){
-        try {
-            //todo we currently save only service nodes
-            WorkflowNodeType workflowNodeType = new WorkflowNodeType();
-            workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
-            WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowExecution(workflowInstanceID,workflowInstanceID), nodeID);
-			airavataAPI.getProvenanceManager().setWorkflowInstanceNodeInput(node, inputs);
-            airavataAPI.getProvenanceManager().setWorkflowNodeType(node, workflowNodeType);
-            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.STARTED);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-    public boolean workflowNodeFailed(String workflowInstanceID,String nodeID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.FAILED);
-            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(workflowInstanceID, workflowInstanceID, WorkflowExecutionStatus.State.FAILED);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-    public boolean workflowNodeFinished(String workflowInstanceID,String nodeID,String inputs,String workflowID){
-        try {
-        	WorkflowNodeType workflowNodeType = new WorkflowNodeType();
-            workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
-            WorkflowInstanceNode node = new WorkflowInstanceNode(new WorkflowExecution(workflowInstanceID,workflowInstanceID), nodeID);
-            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeOutput(node, inputs);
-            airavataAPI.getProvenanceManager().setWorkflowNodeType(node,workflowNodeType);
-            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.FINISHED);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-    public boolean workflowNodeRunning(String workflowInstanceID,String nodeID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.RUNNING);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-     public boolean workflowNodePaused(String workflowInstanceID,String nodeID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.PAUSED);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-    public boolean workflowNodeStatusPending(String workflowInstanceID,String nodeID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.PENDING);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-       public boolean workflowNodeStatusActive(String workflowInstanceID,String nodeID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.ACTIVE);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-       public boolean workflowNodeStatusDone(String workflowInstanceID,String nodeID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceNodeStatus(workflowInstanceID, workflowInstanceID, nodeID, WorkflowExecutionStatus.State.DONE);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowStatusUpdater.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowStatusUpdater.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowStatusUpdater.java
deleted file mode 100644
index cc444b0..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/provenance/WorkflowStatusUpdater.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.xbaya.provenance;
-
-import java.sql.Timestamp;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.workflow.WorkflowExecution;
-import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WorkflowStatusUpdater {
-    private static Logger logger = LoggerFactory.getLogger(WorkflowStatusUpdater.class);
-
-    private AiravataAPI airavataAPI;
-
-    public WorkflowStatusUpdater(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public boolean workflowStarted(String experimentID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.STARTED);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-    public boolean workflowFailed(String experimentID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.FAILED);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-    public boolean workflowFinished(String experimentID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.FINISHED);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-    public boolean workflowRunning(String experimentID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.RUNNING);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-     public boolean workflowPaused(String experimentID){
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(experimentID, experimentID, WorkflowExecutionStatus.State.PAUSED);
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error updating Wokflow Node status !!");
-            return false;
-        }
-        return true;
-    }
-
-    public boolean saveWorkflowData(String experimentID,String workflowInstanceID,String workflowTemplateID) {
-        Timestamp currentTime = new Timestamp((new java.util.Date()).getTime());
-        try {
-            airavataAPI.getProvenanceManager().setWorkflowInstanceTemplateName(workflowInstanceID, workflowTemplateID);
-            airavataAPI.getProvenanceManager().setWorkflowInstanceStatus(new WorkflowExecutionStatus(new WorkflowExecution(experimentID, workflowInstanceID), WorkflowExecutionStatus.State.STARTED,currentTime));
-        } catch (AiravataAPIInvocationException e) {
-            logger.error("Error saving Workflow Data !!");
-        }
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/PasswordCallbackImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/PasswordCallbackImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/PasswordCallbackImpl.java
deleted file mode 100644
index da83cb2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/PasswordCallbackImpl.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registry;
-
-import org.apache.airavata.registry.api.PasswordCallback;
-
-public class PasswordCallbackImpl implements PasswordCallback {
-    private String username;
-    private String password;
-
-    public PasswordCallbackImpl(String username, String password) {
-        this.username = username;
-        this.password = password;
-    }
-
-    @Override
-    public String getPassword(String username) {
-       return password;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
deleted file mode 100644
index 63c6948..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registry/RegistryAccesser.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registry;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.RepositoryException;
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.jython.script.JythonScript;
-import org.apache.airavata.xbaya.ui.experiment.RegistryWorkflowPublisherWindow;
-import org.apache.airavata.xbaya.util.XBayaUtil;
-import org.ietf.jgss.GSSCredential;
-import org.xmlpull.infoset.XmlElement;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class RegistryAccesser {
-
-    /**
-     * PUBLIC_ACTOR
-     */
-    public static final String PUBLIC_ACTOR = "public";
-
-    private XBayaEngine engine;
-
-    private GSSCredential gssCredential;
-
-    /**
-     * Constructs a RegistryAccesser.
-     * 
-     * @param engine
-     */
-    public RegistryAccesser(XBayaEngine engine) {
-        this.engine = engine;
-    }
-
-    private AiravataAPI connectToRegistry() {
-        return this.engine.getConfiguration().getAiravataAPI();
-    }
-
-    /**
-     * 
-     * @return
-     * @throws RepositoryException
-     */
-    public Map<String, String> getOGCEWorkflowTemplateList() throws AiravataAPIInvocationException {
-        AiravataAPI airavataAPI = connectToRegistry();
-        List<Workflow> workflows = airavataAPI.getWorkflowManager().getWorkflows();
-        Map<String, String> workflowMap = new HashMap<String, String>();
-        for(Workflow workflow : workflows){
-            workflowMap.put(workflow.getName(), airavataAPI.getWorkflowManager().getWorkflowAsString(workflow.getName()));
-        }
-        return workflowMap;
-    }
-
-    /**
-     * 
-     * @param workflowTemplateId
-     * @return
-     * @throws RepositoryException
-     * @throws GraphException
-     * @throws ComponentException
-     * @throws Exception
-     */
-    public Workflow getOGCEWorkflow(QName workflowTemplateId) throws RepositoryException, GraphException,
-            ComponentException, Exception {
-        AiravataAPI registry = connectToRegistry();
-        String xml = registry.getWorkflowManager().getWorkflowAsString(workflowTemplateId.getLocalPart());
-        XmlElement xwf = XMLUtil.stringToXmlElement(xml);
-        Workflow workflow = new Workflow(xwf);
-        return workflow;
-    }
-
-    /**
-     * Save workflow in to Registry
-     */
-    public boolean saveWorkflow() {
-        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
-            try {
-
-                Workflow workflow = this.engine.getGUI().getWorkflow();
-                JythonScript script = new JythonScript(workflow, this.engine.getConfiguration());
-
-                // Check if there is any errors in the workflow first.
-                ArrayList<String> warnings = new ArrayList<String>();
-                if (!script.validate(warnings)) {
-                    StringBuilder buf = new StringBuilder();
-                    for (String warning : warnings) {
-                        buf.append("- ");
-                        buf.append(warning);
-                        buf.append("\n");
-                    }
-                    this.engine.getGUI().getErrorWindow().warning(buf.toString());
-                    return false;
-                }
-                RegistryWorkflowPublisherWindow registryPublishingWindow = new RegistryWorkflowPublisherWindow(
-                        this.engine);
-                registryPublishingWindow.show();
-
-                String workflowId = workflow.getName();
-
-                workflowId = StringUtil.convertToJavaIdentifier(workflowId);
-
-                QName workflowQName = new QName(XBayaConstants.OGCE_WORKFLOW_NS, workflowId);
-
-                String workflowAsString = XMLUtil.xmlElementToString(workflow.toXML());
-                String owner = this.engine.getConfiguration().getRegistryUserName();
-
-                AiravataAPI registry = this.connectToRegistry();
-                if (registry.getWorkflowManager().isWorkflowExists(workflow.getName())){
-            		registry.getWorkflowManager().updateWorkflow(workflow.getName(), workflowAsString);
-            	}else{
-            		registry.getWorkflowManager().saveWorkflow(workflowAsString);
-            	}
-                if (registryPublishingWindow.isMakePublic()){
-                	
-                	registry.getWorkflowManager().publishWorkflow(workflow.getName());
-                }
-                registryPublishingWindow.hide();
-                return true;
-            } catch (Exception e) {
-                this.engine.getGUI().getErrorWindow().error(e.getMessage(), e);
-            }
-        }
-		return false;
-    }
-
-    /**
-     * 
-     * @param workflowTemplateId
-     * @throws RepositoryException
-     */
-    public void deleteOGCEWorkflow(QName workflowTemplateId) throws AiravataAPIInvocationException {
-        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
-            AiravataAPI registry = connectToRegistry();
-            registry.getWorkflowManager().removeWorkflow(workflowTemplateId.getLocalPart());
-        }
-    }
-
-    /**
-     * 
-     * @param qname
-     * @return
-     */
-    public Workflow getWorkflow(QName qname) throws AiravataAPIInvocationException {
-        AiravataAPI registry = connectToRegistry();
-        String xml = registry.getWorkflowManager().getWorkflowAsString(qname.getLocalPart());
-        Workflow workflow = null;
-        try {
-            XmlElement xwf = XMLUtil.stringToXmlElement(xml);
-            workflow = new Workflow(xwf);
-        } catch (GraphException e) {
-            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
-        } catch (ComponentException e) {
-            e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
-        }
-        return workflow;
-    }
-
-    /**
-     * 
-     * @param name
-     * @return
-     * @throws RegistryException 
-     */
-    public Workflow getWorkflow(String name) throws AiravataAPIInvocationException {
-        return getWorkflow(new QName(XBayaConstants.LEAD_NS, name));
-    }
-
-    public void main() {
-
-        XBayaConfiguration config = new XBayaConfiguration();
-        config.setMyProxyServer("myproxy.teragrid.org");
-        config.setMyProxyUsername("USER");
-        config.setMyProxyPassphrase("PASSWORD");
-
-        new XBayaEngine(config);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
deleted file mode 100644
index 9203e01..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AbstractAiravataTreeNode.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Enumeration;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JTree;
-import javax.swing.tree.DefaultTreeCellRenderer;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public abstract class AbstractAiravataTreeNode implements TreeNode {
-
-    private TreeNode parent;
-    private Color backgroundSelectionColor;
-    private DefaultTreeCellRenderer defaultCellRenderer = new DefaultTreeCellRenderer();
-    private List<TreeNode> children;
-
-    public AbstractAiravataTreeNode(TreeNode parent) {
-        setParent(parent);
-    }
-
-    protected XBayaEngine getXBayaEngine(){
-        TreeNode root=getRootNode();
-        if (root instanceof RegistryNode){
-            return ((RegistryNode)root).getEngine();
-        }
-        return null;
-    }
-
-    @SuppressWarnings("rawtypes")
-	@Override
-    public Enumeration children() {
-        this.children = listOfChildren();
-        Collections.enumeration(children);
-        return Collections.enumeration(children);
-    }
-
-    protected abstract List<TreeNode> getChildren();
-
-    private List<TreeNode> listOfChildren() {
-        children = (children == null) ? getChildren() : children;
-        return children;
-    }
-
-    @Override
-    public boolean getAllowsChildren() {
-        return listOfChildren().size() > 0;
-    }
-
-    @Override
-    public TreeNode getChildAt(int index) {
-        return listOfChildren().get(index);
-    }
-
-    @Override
-    public int getChildCount() {
-        return listOfChildren().size();
-    }
-
-    @Override
-    public int getIndex(TreeNode node) {
-        return listOfChildren().indexOf(node);
-    }
-
-    @Override
-    public TreeNode getParent() {
-        return parent;
-    }
-
-    @Override
-    public boolean isLeaf() {
-        return listOfChildren().size() == 0;
-    }
-
-    public void setParent(TreeNode parent) {
-        this.parent = parent;
-    }
-
-    public abstract String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus);
-
-    public abstract Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus);
-
-    public void setBackgroundSelectionColor(Color c) {
-        backgroundSelectionColor = c;
-    }
-
-    public Color getBackgroundSelectionColor() {
-        return backgroundSelectionColor;
-    }
-
-    public Component getNodeComponent(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return null;
-    }
-
-    public Component getNodeComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf,
-            int row, boolean hasFocus) {
-        Component nodeComponent = getNodeComponent(selected, expanded, leaf, hasFocus);
-        if (nodeComponent == null) {
-            nodeComponent = getDefaultCellRenderer().getTreeCellRendererComponent(tree, value, selected, expanded,
-                    leaf, row, hasFocus);
-            if (nodeComponent instanceof JLabel) {
-                JLabel lbl = (JLabel) nodeComponent;
-                lbl.setText(getCaption(selected, expanded, leaf, hasFocus));
-                lbl.setIcon(getIcon(selected, expanded, leaf, hasFocus));
-            }
-        }
-        return nodeComponent;
-    }
-
-    protected DefaultTreeCellRenderer getDefaultCellRenderer() {
-        return defaultCellRenderer;
-    }
-
-    protected List<TreeNode> getTreeNodeList(Object[] list, TreeNode parent) {
-        List<TreeNode> nodes = new ArrayList<TreeNode>();
-        for (Object o : list) {
-            nodes.add(AiravataTreeNodeFactory.getTreeNode(o, parent));
-        }
-        return nodes;
-    }
-
-    protected List<TreeNode> emptyList() {
-        return new ArrayList<TreeNode>();
-    }
-
-    public void refresh() {
-        this.children = null;
-    }
-
-    public abstract List<String> getSupportedActions();
-    
-	public String getDefaultAction() {
-		return null;
-	}
-
-    public boolean isActionSupported(AbstractBrowserActionItem action) {
-        return getSupportedActions().contains(action.getID());
-    }
-
-    public boolean triggerAction(JTree tree, String action) throws Exception {
-        return triggerAction(tree, action, false);
-    }
-
-    public boolean triggerAction(JTree tree, String action, boolean force) throws Exception {
-        if (action.equals(RefreshAction.ID)) {
-            refresh();
-            ((DefaultTreeModel) tree.getModel()).reload(this);
-            return true;
-        }
-        return false;
-    }
-
-    protected TreeNode getRootNode() {
-        TreeNode rootNode = this;
-        while (rootNode.getParent() != null) {
-            rootNode = rootNode.getParent();
-        }
-        return rootNode;
-    }
-
-    public AiravataAPI getRegistry() {
-        TreeNode rootNode = getRootNode();
-        if (rootNode instanceof RegistryNode) {
-            return ((RegistryNode) rootNode).getRegistry();
-        }
-        return null;
-    }
-
-    protected boolean askQuestion(String title, String question) {
-        return JOptionPane.showConfirmDialog(null, question, title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
-    }
-
-    protected void reloadTreeNode(JTree tree, TreeNode node) {
-        TreePath selectionPath = tree.getSelectionPath();
-        ((DefaultTreeModel) tree.getModel()).nodeChanged(node);
-        ((DefaultTreeModel) tree.getModel()).reload(node);
-        tree.expandPath(selectionPath);
-    }
-
-    public abstract String getActionCaption(AbstractBrowserActionItem action);
-
-    public abstract Icon getActionIcon(AbstractBrowserActionItem action);
-
-    public abstract String getActionDescription(AbstractBrowserActionItem action);
-    
-    protected String wrapAsHtml(String...data){
-    	String result="<html>";
-    	for (String item : data) {
-			result+=item;
-		}
-    	result+="</html>";
-    	return result;
-    }
-    
-    public String createHTMLUrlTaggedString(String value) {
-		String urledString = "";
-		int lastIndex=0,index=0;
-		while(index!=-1){
-			index=value.toLowerCase().indexOf("://",lastIndex);
-			if (index!=-1){
-				int beginIndex=value.lastIndexOf(" ",index);
-				urledString+=value.substring(lastIndex,beginIndex+1);
-				int endIndex=value.indexOf(" ",index);
-				if (beginIndex==-1){
-					beginIndex=0;
-				}else{
-					beginIndex++;
-				}
-				if (endIndex==-1){
-					endIndex=value.length();
-				}
-				String url=value.substring(beginIndex, endIndex);
-				urledString+="<a href='"+url+"'>"+url+"</a>";
-				lastIndex=endIndex;
-			}
-		}
-		urledString+=value.substring(lastIndex, value.length());
-		return urledString;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
deleted file mode 100644
index 6a3bf87..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataConfigurationsNode.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.registrybrowser.nodes;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.swing.Icon;
-import javax.swing.tree.TreeNode;
-
-import org.apache.airavata.xbaya.model.registrybrowser.AiravataConfigurations;
-import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.GFacURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
-import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURLs;
-import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
-import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
-
-public class AiravataConfigurationsNode extends AbstractAiravataTreeNode {
-	private AiravataConfigurations airavataConfigurations;
-
-    public AiravataConfigurationsNode(AiravataConfigurations airavataConfigurations, TreeNode parent) {
-        super(parent);
-        setAiravataConfigurations(airavataConfigurations);
-    }
-
-    @Override
-    protected List<TreeNode> getChildren() {
-    	List<Object> children=new ArrayList<Object>();
-//    	children.add(new GFacURLs(getRegistry()));
-    	children.add(new InterpreterServiceURLs(getRegistry()));
-    	children.add(new MessageBoxURLs(getRegistry()));
-    	children.add(new EventingServiceURLs(getRegistry()));
-        return getTreeNodeList(children.toArray(), this);
-    }
-
-    @Override
-    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return "Airavata Configuration";
-    }
-
-    @Override
-    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
-        return JCRBrowserIcons.AIRAVATA_CONFIG_ICON;
-    }
-
-    @Override
-    public List<String> getSupportedActions() {
-        return Arrays.asList(RefreshAction.ID);
-    }
-
-    @Override
-    public String getActionCaption(AbstractBrowserActionItem action) {
-        return action.getDefaultCaption();
-    }
-
-    @Override
-    public Icon getActionIcon(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-    @Override
-    public String getActionDescription(AbstractBrowserActionItem action) {
-        return null;
-    }
-
-	public AiravataConfigurations getAiravataConfigurations() {
-		return airavataConfigurations;
-	}
-
-	public void setAiravataConfigurations(AiravataConfigurations airavataConfigurations) {
-		this.airavataConfigurations = airavataConfigurations;
-	}
-}


[13/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInvokerWrapperForGFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInvokerWrapperForGFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInvokerWrapperForGFacInvoker.java
deleted file mode 100644
index 9ca5669..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInvokerWrapperForGFacInvoker.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker;
-
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsif.WSIFMessage;
-
-public class WorkflowInvokerWrapperForGFacInvoker extends GFacInvoker {
-
-    private static final Logger logger = LoggerFactory.getLogger(WorkflowInvokerWrapperForGFacInvoker.class);
-
-    private ServiceNotifiable notifier;
-
-    private String serviceInformation;
-
-    private Future<Boolean> result;
-
-    protected boolean failerSent = false;
-
-    public WorkflowInvokerWrapperForGFacInvoker(QName portTypeQName, String gfacURL, String messageBoxURL,
-            LeadContextHeader leadcontext, ServiceNotifiable serviceNotificationSender) {
-        super(portTypeQName, gfacURL, messageBoxURL, leadcontext);
-        this.notifier = serviceNotificationSender;
-        this.serviceInformation = portTypeQName.toString();
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#invoke()
-     */
-    public synchronized boolean invoke() throws WorkflowException {
-
-        try {
-            WSIFMessage inputMessage = super.getInputs();
-            logger.debug("inputMessage: " + XMLUtil.xmlElementToString((XmlElement) inputMessage));
-            this.notifier.invokingService(inputMessage);
-
-            ExecutorService executor = Executors.newSingleThreadExecutor();
-            this.result = executor.submit(new Callable<Boolean>() {
-                @SuppressWarnings("boxing")
-                public Boolean call() {
-                    try {
-                        boolean success = WorkflowInvokerWrapperForGFacInvoker.super.invoke();
-                        if (success) {
-                            // Send notification
-                            WSIFMessage outputMessage = WorkflowInvokerWrapperForGFacInvoker.super.getOutputs();
-                            // An implementation of WSIFMessage,
-                            // WSIFMessageElement, implements toString(), which
-                            // serialize the message XML.
-                            logger.debug("outputMessage: " + outputMessage);
-                            WorkflowInvokerWrapperForGFacInvoker.this.notifier.serviceFinished(outputMessage);
-                        } else {
-                            WSIFMessage faultMessage = WorkflowInvokerWrapperForGFacInvoker.super.getFault();
-                            // An implementation of WSIFMessage,
-                            // WSIFMessageElement, implements toString(), which
-                            // serialize the message XML.
-                            logger.debug("received fault: " + faultMessage);
-                            WorkflowInvokerWrapperForGFacInvoker.this.notifier.receivedFault(faultMessage);
-                            WorkflowInvokerWrapperForGFacInvoker.this.failerSent = true;
-                        }
-                        return success;
-                    } catch (WorkflowException e) {
-                        logger.error(e.getMessage(), e);
-                        // An appropriate message has been set in the exception.
-                        WorkflowInvokerWrapperForGFacInvoker.this.notifier.invocationFailed(e.getMessage(), e);
-                        WorkflowInvokerWrapperForGFacInvoker.this.failerSent = true;
-                        throw new WorkflowRuntimeException(e);
-                    } catch (RuntimeException e) {
-                        logger.error(e.getMessage(), e);
-                        String message = "Error in invoking a service: "
-                                + WorkflowInvokerWrapperForGFacInvoker.this.serviceInformation;
-                        WorkflowInvokerWrapperForGFacInvoker.this.notifier.invocationFailed(message, e);
-                        WorkflowInvokerWrapperForGFacInvoker.this.failerSent = true;
-                        throw e;
-                    }
-                }
-            });
-
-            // Kill the thread inside of executor. This is necessary for Jython
-            // script to finish.
-            executor.shutdown();
-
-            // Let other threads know that job has been submitted.
-            notifyAll();
-
-            // Check if the invocation itself fails. This happens immediately.
-            try {
-                this.result.get(100, TimeUnit.MILLISECONDS);
-            } catch (InterruptedException e) {
-                logger.error(e.getMessage(), e);
-            } catch (TimeoutException e) {
-                // The job is probably running fine.
-                // The normal case.
-                return true;
-            } catch (ExecutionException e) {
-                // The service-failed notification should have been sent
-                // already.
-                logger.error(e.getMessage(), e);
-                String message = "Error in invoking a service: " + this.serviceInformation;
-                throw new WorkflowException(message, e);
-            }
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error in invoking a service: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-
-        boolean success = super.invoke();
-        if (!success) {
-            try {
-                throw new Exception("Failed invoking GFac");
-            } catch (Exception e) {
-                notifier.invocationFailed(super.getFault().toString(), e);
-            }
-
-        } else {
-            notifier.serviceFinished(super.getOutputs());
-        }
-        return success;
-    }
-
-    public synchronized void waitToFinish() throws WorkflowException {
-        try {
-            while (this.result == null) {
-                // The job is not submitted yet.
-                try {
-                    wait();
-                } catch (InterruptedException e) {
-                    logger.error(e.getMessage(), e);
-                }
-            }
-            // Wait for the job to finish.
-            Boolean success = this.result.get();
-            if (success == false) {
-                WSIFMessage faultMessage = super.getFault();
-                String message = "Error in a service: ";
-                // An implementation of WSIFMessage,
-                // WSIFMessageElement, implements toString(), which
-                // serialize the message XML.
-                message += faultMessage.toString();
-                throw new WorkflowException(message);
-            }
-        } catch (InterruptedException e) {
-            logger.error(e.getMessage(), e);
-        } catch (ExecutionException e) {
-            // The service-failed notification should have been sent already.
-            logger.error(e.getMessage(), e);
-            String message = "Error in invoking a service: " + this.serviceInformation;
-            throw new WorkflowException(message, e);
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error while waiting for a service to finish: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    public Object getOutput(String name) throws WorkflowException {
-        try {
-            waitToFinish();
-            Object output = super.getOutput(name);
-            if (output instanceof XmlElement) {
-                logger.debug("output: " + XMLUtil.xmlElementToString((XmlElement) output));
-            }
-            return output;
-        } catch (WorkflowException e) {
-            logger.error(e.getMessage(), e);
-            // An appropriate message has been set in the exception.
-            if (!this.failerSent) {
-                this.notifier.invocationFailed(e.getMessage(), e);
-            }
-            throw e;
-        } catch (RuntimeException e) {
-            logger.error(e.getMessage(), e);
-            String message = "Error while waiting for a output: " + name;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        } catch (Error e) {
-            logger.error(e.getMessage(), e);
-            String message = "Unexpected error: " + this.serviceInformation;
-            this.notifier.invocationFailed(message, e);
-            throw new WorkflowException(message, e);
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java
deleted file mode 100644
index 75d5677..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/factory/InvokerFactory.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.invoker.factory;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
-import org.apache.airavata.common.utils.WSDLUtil;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.invoker.AsynchronousInvoker;
-import org.apache.airavata.xbaya.invoker.GFacInvoker;
-import org.apache.airavata.xbaya.invoker.Invoker;
-import org.apache.airavata.xbaya.invoker.SimpleInvoker;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-
-public class InvokerFactory {
-
-    /**
-     * @param portTypeQName
-     * @param definitions
-     * @param gfacURL
-     * @param messageBoxURL
-     * @return The invoker
-     * @throws WorkflowException
-     */
-    public static Invoker createInvoker(QName portTypeQName, WsdlDefinitions definitions, String gfacURL,
-            String messageBoxURL, LeadContextHeader leadContext) throws WorkflowException {
-        Invoker invoker = null;
-
-        if (definitions != null && definitions.getServices().iterator().hasNext()) {
-            // check if this web service supports asynchronous invocation
-            if (WSDLUtil.isAsynchronousSupported(WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(definitions))) {
-                invoker = new AsynchronousInvoker(definitions, messageBoxURL);
-            } else {
-                invoker = new SimpleInvoker(definitions);
-            }
-        } else if (gfacURL != null && gfacURL.length() != 0) {
-            invoker = new GFacInvoker(portTypeQName, gfacURL, messageBoxURL, leadContext);
-        }
-
-        if (invoker == null) {
-            String message = "Cannot find an appropriate way to invoke the service";
-            throw new WorkflowException(message);
-        }
-        return invoker;
-    }
-
-    public static Invoker createInvoker(QName portTypeQName, WsdlDefinitions definitions, String gfacURL,
-            String messageBoxURL, WorkflowContextHeaderBuilder builder, boolean differ) throws WorkflowException {
-        Invoker invoker = null;
-
-        if (definitions != null && definitions.getServices().iterator().hasNext()) {
-            // check if this web service supports asynchronous invocation
-            if (WSDLUtil.isAsynchronousSupported(WSDLUtil.wsdlDefinitions3ToWsdlDefintions5(definitions))) {
-                invoker = new AsynchronousInvoker(definitions, messageBoxURL);
-            } else {
-                invoker = new SimpleInvoker(definitions);
-            }
-        } else if (gfacURL != null && gfacURL.length() != 0) {
-            invoker = new GFacInvoker(portTypeQName, gfacURL, messageBoxURL, builder);
-        }
-
-        if (invoker == null) {
-            String message = "Cannot find an appropriate way to invoke the service";
-            throw new WorkflowException(message);
-        }
-        return invoker;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/GFacServiceCreator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/GFacServiceCreator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/GFacServiceCreator.java
deleted file mode 100644
index 66685ba..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/GFacServiceCreator.java
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.lib;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.wsdl.WsdlDefinitions;
-import xsul.wsdl.WsdlResolver;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.wsif.WSIFService;
-import xsul.wsif.WSIFServiceFactory;
-import xsul.wsif.spi.WSIFProviderManager;
-
-public class GFacServiceCreator {
-
-    private static final String CREATE_SERVICE_OPERATION = "CreateService";
-
-    private static final String SHUTDOWN_OPERATION = "Shutdown";
-
-    private static final String SERVICE_QNAME_PART = "serviceQName";
-
-    private static final String SECURITY_PART = "security";
-
-    private static final String WSDL_PART = "WSDL";
-
-    private static final String SECURITY_NONE = "None";
-
-    private static final Logger logger = LoggerFactory.getLogger(GFacServiceCreator.class);
-
-    private WSIFOperation gFacOperation;
-
-    private WsdlDefinitions serviceDefinitions;
-
-    static {
-        WSIFProviderManager.getInstance().addProvider(new xsul.wsif_xsul_soap_http.Provider());
-    }
-
-    /**
-     * Constructs a GFacServiceCreater.
-     * 
-     * @param wsdlURL
-     *            The URL of the GFac service
-     * @throws URISyntaxException
-     * @throws WorkflowException
-     */
-    public GFacServiceCreator(String wsdlURL) throws URISyntaxException, WorkflowException {
-        this(new URI(wsdlURL));
-    }
-
-    /**
-     * Constructs a GFacServiceCreater.
-     * 
-     * @param wsdlURI
-     *            The URI of the GFac service
-     * @throws WorkflowException
-     */
-    public GFacServiceCreator(URI wsdlURI) throws WorkflowException {
-        try {
-            WsdlDefinitions definitions = WsdlResolver.getInstance().loadWsdl(wsdlURI);
-            WSIFService service = WSIFServiceFactory.newInstance().getService(definitions);
-            WSIFPort port = service.getPort();
-            this.gFacOperation = port.createOperation(CREATE_SERVICE_OPERATION);
-        } catch (RuntimeException e) {
-            String message = "Failed to connect to the Generic Factory: " + wsdlURI;
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     * @param serviceQName
-     * @return The WSDL definitions of the service created.
-     * @throws WorkflowException
-     */
-    public WsdlDefinitions createService(QName serviceQName) throws WorkflowException {
-        return createService(serviceQName.toString());
-    }
-
-    /**
-     * @param serviceQName
-     * @return The WSDL definitions of the service created.
-     * @throws WorkflowException
-     */
-    public WsdlDefinitions createService(String serviceQName) throws WorkflowException {
-        logger.debug(serviceQName);
-        try {
-            WSIFMessage inputMessage = this.gFacOperation.createInputMessage();
-            WSIFMessage outputMessage = this.gFacOperation.createOutputMessage();
-            WSIFMessage faultMessage = this.gFacOperation.createFaultMessage();
-
-            inputMessage.setObjectPart(SERVICE_QNAME_PART, serviceQName);
-            inputMessage.setObjectPart(SECURITY_PART, SECURITY_NONE);
-
-            logger.debug("inputMessage: " + inputMessage);
-            boolean success = this.gFacOperation.executeRequestResponseOperation(inputMessage, outputMessage,
-                    faultMessage);
-            if (!success) {
-                // An implementation of WSIFMessage, WSIFMessageElement,
-                // implements toString(), which serialize the message XML.
-                String message = "Failed to create a service: " + faultMessage.toString();
-                throw new WorkflowException(message);
-            }
-
-            String wsdl = (String) outputMessage.getObjectPart(WSDL_PART);
-            logger.debug("WSDL: " + wsdl);
-
-            XmlElement definitionsElement = XMLUtil.stringToXmlElement3(wsdl);
-
-            this.serviceDefinitions = new WsdlDefinitions(definitionsElement);
-            return this.serviceDefinitions;
-        } catch (RuntimeException e) {
-            String message = "Failed to create a service";
-            throw new WorkflowException(message, e);
-        }
-    }
-
-    /**
-     * Shutdowns the service created.
-     * 
-     * @throws WorkflowException
-     */
-    public void shutdownService() throws WorkflowException {
-        WSIFService service = WSIFServiceFactory.newInstance().getService(this.serviceDefinitions);
-        WSIFPort port = service.getPort();
-        WSIFOperation operation = port.createOperation(SHUTDOWN_OPERATION);
-
-        WSIFMessage inputMessage = operation.createInputMessage();
-        WSIFMessage outputMessage = operation.createOutputMessage();
-        WSIFMessage faultMessage = operation.createFaultMessage();
-
-        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
-        if (!success) {
-            // An implementation of WSIFMessage, WSIFMessageElement,
-            // implements toString(), which serialize the message XML.
-            String message = "Failed to shutdown the service: " + faultMessage.toString();
-            throw new WorkflowException(message);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
deleted file mode 100644
index f478e18..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/NotificationSender.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.lib;
-
-import java.net.URI;
-import java.util.Properties;
-
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-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.axis2.addressing.EndpointReference;
-import org.python.core.PyObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
-
-public class NotificationSender implements WorkflowNotifiable {
-
-    protected static final Logger logger = LoggerFactory.getLogger(NotificationSender.class);
-
-    protected WorkflowNotifier notifier;
-
-    protected String brokerURL;
-
-    protected String topic;
-
-    protected URI workflowID;
-
-    protected InvocationEntity initiator;
-
-    protected InvocationEntity receiver;
-
-    protected InvocationContext invocationContext;
-
-    protected EndpointReference eventSink;
-
-    protected WorkflowTrackingContext context;
-
-    /**
-     * Constructs a NotificationSender.
-     * 
-     * @param brokerURL
-     * @param topic
-     */
-    public NotificationSender(URI brokerURL, String topic) {
-        this(brokerURL.toString(), topic);
-    }
-
-    /**
-     * Creates a NotificationSender.
-     * 
-     * @param brokerURL
-     *            The location of notification brokerUrl.
-     * @param topic
-     *            The notification topic.
-     */
-    public NotificationSender(String brokerURL, String topic) {
-        logger.debug("brokerURL:" + brokerURL + "topic:" + topic);
-        this.topic = topic;
-        this.brokerURL = brokerURL;
-        this.workflowID = URI.create(StringUtil.convertToJavaIdentifier(this.topic));
-        this.eventSink = new EndpointReference(this.brokerURL);
-        Properties props = new Properties();
-
-        this.notifier = NotifierFactory.createNotifier();
-        URI initiatorWorkflowID = null;
-        URI initiatorServiceID = URI.create(StringUtil.convertToJavaIdentifier(topic));
-        String initiatorWorkflowNodeID = null;
-        Integer initiatorWorkflowTimeStep = null;
-        this.context = this.notifier.createTrackingContext(props, brokerURL, initiatorWorkflowID, initiatorServiceID,
-                initiatorWorkflowNodeID, initiatorWorkflowTimeStep);
-        this.context.setTopic(topic);
-        this.initiator = this.notifier.createEntity(initiatorWorkflowID, initiatorServiceID, initiatorWorkflowNodeID,
-                initiatorWorkflowTimeStep);
-
-        URI receiverWorkflowID = this.workflowID;
-        URI receiverServiceID = this.workflowID;
-        String receiverWorkflowNodeID = null;
-        Integer receiverWorkflowTimeStep = null;
-        this.receiver = this.notifier.createEntity(receiverWorkflowID, receiverServiceID, receiverWorkflowNodeID,
-                receiverWorkflowTimeStep);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#getEventSink()
-     */
-    @Override
-    public EndpointReference getEventSink() {
-        return this.eventSink;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowStarted(org.python.core.PyObject[],
-     * java.lang.String[])
-     */
-    @Override
-    public void workflowStarted(PyObject[] args, String[] keywords) {
-        String message = "";
-        for (int i = 0; i < args.length; i++) {
-            if (i != 0) {
-                message += ", ";
-            }
-            message += keywords[i] + "=" + args[i];
-        }
-        this.invocationContext = this.notifier.workflowInvoked(this.context, this.initiator, message);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowStarted(java.lang.Object[],
-     * java.lang.String[])
-     */
-    @Override
-    public void workflowStarted(Object[] args, String[] keywords) {
-        String message = "";
-        for (int i = 0; i < args.length; i++) {
-            if (i != 0) {
-                message += ", ";
-            }
-            message += keywords[i] + "=" + args[i];
-        }
-        this.invocationContext = this.notifier.workflowInvoked(this.context, this.initiator, message);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFinished(java.lang.Object[],
-     * java.lang.String[])
-     */
-    @Override
-    public void workflowFinished(Object[] args, String[] keywords) {
-        String message = "";
-        for (int i = 0; i < args.length; i++) {
-            if (i != 0) {
-                message += ", ";
-            }
-            message += keywords[i] + "=" + args[i];
-        }
-        this.notifier.sendingResult(context, this.invocationContext, message);
-        this.notifier.workflowTerminated(context, this.workflowID, "Workflow finished successfully.");
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#sendingPartialResults(java.lang.Object[],
-     * java.lang.String[])
-     */
-    @Override
-    public void sendingPartialResults(Object[] args, String[] keywords) {
-        String message = "";
-        for (int i = 0; i < args.length; i++) {
-            if (i != 0) {
-                message += ", ";
-            }
-            message += keywords[i] + "=" + args[i];
-        }
-        this.notifier.sendingResult(context, this.invocationContext, message);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFinished(org.python.core.PyObject[],
-     * java.lang.String[])
-     */
-    @Override
-    public void workflowFinished(PyObject[] args, String[] keywords) {
-        String message = "";
-        for (int i = 0; i < args.length; i++) {
-            if (i != 0) {
-                message += ", ";
-            }
-            message += keywords[i] + "=" + args[i];
-        }
-        this.notifier.sendingResult(context, this.invocationContext, message);
-        this.notifier.workflowTerminated(context, this.workflowID, "Workflow Execution Finished.");
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowTerminated()
-     */
-    @Override
-    public void workflowTerminated() {
-        this.notifier.workflowTerminated(context, this.workflowID, "Workflow Execution Finished.");
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFailed(java.lang.String)
-     */
-    @Override
-    public void workflowFailed(String message) {
-        workflowFailed(message, null);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFailed(java.lang.Throwable)
-     */
-    @Override
-    public void workflowFailed(Throwable e) {
-        workflowFailed(null, e);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#workflowFailed(java.lang.String,
-     * java.lang.Throwable)
-     */
-    @Override
-    public void workflowFailed(String message, Throwable e) {
-        if(e != null)
-            logger.error(e.getMessage(), e);
-        if (message == null || "".equals(message)) {
-            message = "Error";
-        }
-        if (e != null) {
-            message += ": " + e.toString();
-        }
-        if (e != null) {
-            String stackTrace = StringUtil.getStackTraceInString(e);
-            XmlElement stackTraceElement = XMLUtil.BUILDER.newFragment("stackTrace");
-            stackTraceElement.addChild(stackTrace);
-            this.notifier.sendingFault(context, this.invocationContext, message,
-                    XMLUtil.xmlElementToString(stackTraceElement));
-        } else {
-            this.notifier.sendingFault(context, this.invocationContext, message);
-        }
-    }
-
-    public void info(String message) {
-        this.notifier.info(context, message);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable#createServiceNotificationSender(java.lang.String)
-     */
-    @Override
-    public ServiceNotifiable createServiceNotificationSender(String nodeID) {
-        return new ServiceNotificationSender(this.notifier, this.eventSink, this.initiator, this.workflowID, nodeID,
-                this.context,this.invocationContext);
-    }
-
-    @Override
-    public void cleanup(){
-        this.notifier.delete();
-    }
-
-    public String getTopic() {
-        return topic;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotifiable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotifiable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotifiable.java
deleted file mode 100644
index 1865d9c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotifiable.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.lib;
-
-import java.net.URI;
-
-import org.apache.axis2.addressing.EndpointReference;
-
-import xsul.wsif.WSIFMessage;
-
-public interface ServiceNotifiable {
-
-    /**
-     * @param serviceID
-     */
-    public abstract void setServiceID(String serviceID);
-
-    /**
-     * @return The event sink.
-     */
-    public abstract EndpointReference getEventSink();
-
-    /**
-     * @return The workflow ID.
-     */
-    public abstract URI getWorkflowID();
-
-    /**
-     * @param inputs
-     */
-    public abstract void invokingService(WSIFMessage inputs);
-
-    /**
-     * @param outputs
-     */
-    public abstract void serviceFinished(WSIFMessage outputs);
-
-    /**
-     * Sends an InvokeServiceFinishedFailed notification message.
-     * 
-     * @param message
-     *            The message to send
-     * @param e
-     */
-    public abstract void invocationFailed(String message, Throwable e);
-
-    /**
-     * Sends a receivedFault notification message.
-     * 
-     * @param message
-     *            The message to send
-     */
-    @Deprecated
-    public abstract void receivedFault(String message);
-
-    /**
-     * Sends a receivedFault notification message.
-     * 
-     * @param fault
-     */
-    public abstract void receivedFault(WSIFMessage fault);
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java
deleted file mode 100644
index 36b79bf..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/ServiceNotificationSender.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.lib;
-
-import java.net.URI;
-import java.util.Iterator;
-
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-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.workflow.tracking.impl.state.InvocationContextImpl;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
-
-import xsul.wsif.WSIFMessage;
-
-public class ServiceNotificationSender implements ServiceNotifiable {
-
-    private static final Logger logger = LoggerFactory.getLogger(ServiceNotificationSender.class);
-
-    private WorkflowNotifier notifier;
-
-    private URI workflowID;
-
-    private String nodeID;
-
-    private String serviceID;
-
-    private InvocationEntity receiver;
-
-    private InvocationEntity initiator;
-
-    private InvocationContext invocationContext;
-
-    private WorkflowTrackingContext context;
-
-    private EndpointReference eventSink;
-
-    /**
-     * Constructs a ServiceNotificationSender.
-     * 
-     * @param notifier
-     * @param eventSink
-     * @param initiator
-     * @param workflowID
-     * @param nodeID
-     */
-    protected ServiceNotificationSender(WorkflowNotifier notifier, EndpointReference eventSink,
-            InvocationEntity initiator, URI workflowID, String nodeID, WorkflowTrackingContext context, InvocationContext invocationContext) {
-        this.notifier = notifier;
-        this.eventSink = eventSink;
-        this.initiator = initiator;
-        this.workflowID = workflowID;
-        this.nodeID = nodeID;
-        this.context = context;
-        // In case of creating a service on the fly, there is no serviceID at
-        // the beginning.
-        this.serviceID = "";
-        this.invocationContext = invocationContext;
-        URI receiverWorkflowID = this.workflowID;
-        URI receiverServiceID = URI.create(this.serviceID);
-        String receiverWorkflowNodeID = this.nodeID;
-        Integer workflowTimeStep = new Integer(0);
-        this.receiver = this.notifier.createEntity(receiverWorkflowID, receiverServiceID, receiverWorkflowNodeID,
-                workflowTimeStep);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#setServiceID(java.lang.String)
-     */
-    @Override
-    public void setServiceID(String serviceID) {
-        logger.debug("SerivceID:" + serviceID);
-        this.serviceID = serviceID;
-
-        URI receiverWorkflowID = this.workflowID;
-        URI receiverServiceID = URI.create(this.serviceID);
-        String receiverWorkflowNodeID = this.nodeID;
-        Integer workflowTimeStep = new Integer(0);
-        this.receiver = this.notifier.createEntity(receiverWorkflowID, receiverServiceID, receiverWorkflowNodeID,
-                workflowTimeStep);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#getEventSink()
-     */
-    @Override
-    public EndpointReference getEventSink() {
-        return this.eventSink;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#getWorkflowID()
-     */
-    @Override
-    public URI getWorkflowID() {
-        return this.workflowID;
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#invokingService(xsul.wsif.WSIFMessage)
-     */
-    @Override
-    public void invokingService(WSIFMessage inputs) {
-        String message = "";
-        Iterator partIt = inputs.partNames().iterator();
-        boolean first = true;
-        while (partIt.hasNext()) {
-            if (first) {
-                first = false;
-            } else {
-                message += ", ";
-            }
-
-            String name = (String) partIt.next();
-            Object value = inputs.getObjectPart(name);
-            if(value instanceof org.xmlpull.v1.builder.XmlElement){
-                message += name + "=";
-                Iterator children = ((org.xmlpull.v1.builder.XmlElement) value).children();
-                while (children.hasNext()){
-                    message += children.next();
-                }
-            }else{
-                message += name + "=" + value;
-            }
-        }
-        XmlObject header = null;
-        XmlObject body;
-        try {
-            body = XmlObject.Factory.parse(inputs.toString());
-        } catch (XmlException e) {
-            logger.warn("Failed to parse " + inputs.toString(), e);
-            body = null; // Send notification anyway.
-        }
-        this.invocationContext = this.notifier.invokingService(this.context, this.receiver, header, body, message);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#serviceFinished(xsul.wsif.WSIFMessage)
-     */
-    @Override
-    public void serviceFinished(WSIFMessage outputs) {
-        String message = "";
-        Iterator partIt = outputs.partNames().iterator();
-        boolean first = true;
-        while (partIt.hasNext()) {
-            if (first) {
-                first = false;
-            } else {
-                message += ", ";
-            }
-            String name = (String) partIt.next();
-            Object value = outputs.getObjectPart(name);
-            if(value instanceof org.xmlpull.v1.builder.XmlElement){
-                message += name + "=";
-                Iterator children = ((org.xmlpull.v1.builder.XmlElement) value).children();
-                while (children.hasNext()){
-                    message += children.next();
-                }
-            }else{
-             message += name + "=" + value;
-            }
-        }
-        XmlObject header = null;
-        XmlObject body;
-        try {
-            body = XmlObject.Factory.parse(outputs.toString());
-        } catch (XmlException e) {
-            logger.warn("Failed to parse " + outputs.toString(), e);
-            body = null; // Send notification anyway.
-        }
-        this.notifier.receivedResult(this.context, this.invocationContext, header, body, message);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#invocationFailed(java.lang.String,
-     * java.lang.Throwable)
-     */
-    @Override
-    public void invocationFailed(String message, Throwable e) {
-
-        // TODO there are two types of error messages.
-        // The first one is while creating a service. (No API)
-        // The second is while invoking a service.
-        // e.g. notifier.invokingServiceFailed().
-
-        // XXX If error occurs before invoking a service, create a fake
-        // invocation context.
-        if (this.invocationContext == null) {
-            this.invocationContext = new InvocationContextImpl(this.initiator, this.receiver);
-        }
-
-        logger.error(e.getMessage(), e);
-        if (message == null || "".equals(message)) {
-            message = "Error";
-        }
-        if (e != null) {
-            message += ": " + e.toString();
-        }
-        if (e != null) {
-            String stackTrace = StringUtil.getStackTraceInString(e);
-            XmlElement stackTraceElement = XMLUtil.BUILDER.newFragment("stackTrace");
-            stackTraceElement.addChild(stackTrace);
-            String annotation = XMLUtil.xmlElementToString(stackTraceElement);
-            this.notifier.invokingServiceFailed(this.context, this.invocationContext, e, message, annotation);
-        } else {
-            this.notifier.invokingServiceFailed(this.context, this.invocationContext, message);
-        }
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#receivedFault(java.lang.String)
-     */
-    @Override
-    @Deprecated
-    public void receivedFault(String message) {
-        // XXX If error occurs before invoking a service, create a fake
-        // invocation context.
-        if (this.invocationContext == null) {
-            this.invocationContext = new InvocationContextImpl(this.initiator, this.receiver);
-        }
-
-        if (message == null || "".equals(message)) {
-            message = "Error";
-        }
-        this.notifier.receivedFault(this.context, this.invocationContext, message);
-    }
-
-    /*
-     * (non-Javadoc)
-     * 
-     * @see org.apache.airavata.xbaya.jython.lib.ServiceNotifiable#receivedFault(xsul.wsif.WSIFMessage)
-     */
-    @Override
-    public void receivedFault(WSIFMessage fault) {
-        // XXX If error occurs before invoking a service, create a fake
-        // invocation context.
-        if (this.invocationContext == null) {
-            this.invocationContext = new InvocationContextImpl(this.initiator, this.receiver);
-        }
-
-        String message = "Received a fault message from the service";
-        XmlObject header = null;
-        XmlObject body;
-        try {
-            body = XmlObject.Factory.parse(fault.toString());
-        } catch (XmlException e) {
-            logger.warn("Failed to parse " + fault.toString(), e);
-            body = null; // Send notification anyway.
-        }
-        this.notifier.receivedFault(this.context, this.invocationContext, header, body, message);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/StandaloneServiceNotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/StandaloneServiceNotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/StandaloneServiceNotificationSender.java
deleted file mode 100644
index 8e9248d..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/StandaloneServiceNotificationSender.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.lib;
-
-import java.net.URI;
-
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.axis2.addressing.EndpointReference;
-
-import xsul.wsif.WSIFMessage;
-
-public class StandaloneServiceNotificationSender implements ServiceNotifiable {
-
-    private Workflow workflow;
-    private String serviceID;
-    private URI workflowID;
-
-    public StandaloneServiceNotificationSender(Workflow workflow, URI workflowID) {
-        this.workflow = workflow;
-        this.workflowID = workflowID;
-    }
-
-    @Override
-    public void setServiceID(String serviceID) {
-        this.serviceID = serviceID;
-        System.out.println(serviceID);
-
-    }
-
-    @Override
-    public EndpointReference getEventSink() {
-        return new EndpointReference(XBayaConstants.DEFAULT_BROKER_URL.toString());
-    }
-
-    @Override
-    public URI getWorkflowID() {
-        return this.workflowID;
-    }
-
-    @Override
-    public void invokingService(WSIFMessage inputs) {
-        getNode().setState(NodeExecutionState.EXECUTING);
-    }
-
-    @Override
-    public void serviceFinished(WSIFMessage outputs) {
-    	getNode().setState(NodeExecutionState.FINISHED);
-
-    }
-
-    @Override
-    public void invocationFailed(String message, Throwable e) {
-    	getNode().setState(NodeExecutionState.FAILED);
-
-    }
-
-    @Override
-    public void receivedFault(String message) {
-    	getNode().setState(NodeExecutionState.FAILED);
-
-    }
-
-    @Override
-    public void receivedFault(WSIFMessage fault) {
-    	getNode().setState(NodeExecutionState.FAILED);
-
-    }
-
-	private Node getNode() {
-		return this.workflow.getGraph().getNode(this.serviceID);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java
deleted file mode 100644
index c44fa55..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/lib/WorkflowNotifiable.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.lib;
-
-import org.apache.axis2.addressing.EndpointReference;
-import org.python.core.PyObject;
-
-public interface WorkflowNotifiable {
-
-    /**
-     * @return The event sink EPR.
-     */
-    public abstract EndpointReference getEventSink();
-
-    /**
-     * @param args
-     * @param keywords
-     */
-    public abstract void workflowStarted(PyObject[] args, String[] keywords);
-
-    public abstract void workflowStarted(Object[] args, String[] keywords);
-
-    /**
-     * @param args
-     * @param keywords
-     */
-    public abstract void workflowFinished(Object[] args, String[] keywords);
-
-    public abstract void sendingPartialResults(Object[] args, String[] keywords);
-
-    /**
-     * @param args
-     * @param keywords
-     */
-    public abstract void workflowFinished(PyObject[] args, String[] keywords);
-
-    public abstract void workflowTerminated();
-
-    /**
-     * Sends a START_INCOMPLETED notification message.
-     * 
-     * @param message
-     *            The message to send
-     */
-    public abstract void workflowFailed(String message);
-
-    /**
-     * Sends a START_INCOMPLETED notification message.
-     * 
-     * @param e
-     */
-    public abstract void workflowFailed(Throwable e);
-
-    /**
-     * Sends a START_INCOMPLETED notification message.
-     * 
-     * @param message
-     *            The message to send
-     * @param e
-     */
-    public abstract void workflowFailed(String message, Throwable e);
-
-    /**
-     * @param nodeID
-     * @return The ServiceNoficationSender created.
-     */
-    public abstract ServiceNotifiable createServiceNotificationSender(String nodeID);
-
-    public String getTopic();
-
-    public abstract void cleanup();
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/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
deleted file mode 100644
index 135e331..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonClassLoader.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.runner;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLDecoder;
-import java.security.AllPermission;
-import java.security.CodeSigner;
-import java.security.CodeSource;
-import java.security.PermissionCollection;
-import java.security.Permissions;
-import java.security.SecureClassLoader;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.jar.JarEntry;
-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;
-
-/**
- * This class loader loads jython related classes without counting on parent class loader. This is because jython
- * related classes use a lot of static fields and cannot be used to invoke Jython scripts multiple times.
- * 
- */
-public class JythonClassLoader extends SecureClassLoader {
-
-    private final static Logger logger = LoggerFactory.getLogger(JythonClassLoader.class);
-
-    private ClassLoader parent;
-
-    private Map<String, Class> classes = new HashMap<String, Class>();
-
-    private URL jythonURL;
-
-    private URL xbayaURL;
-
-    private JarFile jythonJarFile;
-
-    private JarFile xbayaJarFile;
-
-    private File tmpJarDirectory;
-
-    /**
-     * Constructs a JythonClassLoader.
-     * 
-     * @param parent
-     *            the parent class loader.
-     * 
-     *            This has to be explicitly passed because WebStart applications use user-level class loader. The
-     *            default system loader cannot load classes in the downloaded jar files.
-     */
-    public JythonClassLoader(ClassLoader parent) {
-        super(parent);
-        this.parent = parent;
-
-        this.jythonURL = getBaseURL(PythonInterpreter.class);
-        this.xbayaURL = getBaseURL(XBayaVersion.class);
-    }
-
-    /**
-     * @return XBaya jar file.
-     */
-    public JarFile getXBayaJarFile() {
-        if (this.xbayaJarFile == null)
-            this.xbayaJarFile = maybeGetJarFile(this.xbayaURL);
-        return this.xbayaJarFile;
-    }
-
-    /**
-     * Cleans up temporary files.
-     */
-    public void cleanUp() {
-        this.jythonJarFile = null;
-        this.xbayaJarFile = null;
-        if (this.tmpJarDirectory != null) {
-            try {
-                IOUtil.deleteDirectory(this.tmpJarDirectory);
-            } catch (RuntimeException e) {
-                logger.error(e.getMessage(), e);
-            }
-        }
-    }
-
-    /**
-     * @see java.lang.ClassLoader#loadClass(java.lang.String)
-     */
-    @Override
-    public Class<?> loadClass(String className) throws ClassNotFoundException {
-        return (loadClass(className, false));
-    }
-
-    /**
-     * @see java.lang.ClassLoader#loadClass(java.lang.String, boolean)
-     */
-    @Override
-    public synchronized Class<?> loadClass(String name, boolean resolveIt) throws ClassNotFoundException {
-
-        Class klass = null;
-        try {
-            klass = findClass(name);
-        } catch (ClassNotFoundException e) {
-            try {
-                klass = super.loadClass(name, false);
-            } catch (ClassNotFoundException e2) {
-                klass = this.parent.loadClass(name);
-                logger.debug("found from parent, klass: " + klass);
-            }
-        }
-
-        if (resolveIt) {
-            resolveClass(klass);
-        }
-
-        // logger.exiting(klass);
-        return klass;
-    }
-
-    @Override
-    protected Class<?> findClass(final String name) throws ClassNotFoundException {
-
-        // find jar location first
-        if (this.jythonJarFile == null)
-            this.jythonJarFile = maybeGetJarFile(this.jythonURL);
-        if (this.jythonJarFile == null)
-            this.xbayaJarFile = maybeGetJarFile(this.xbayaURL);
-
-        Class klass;
-
-        // Check if the class has been loaded by this class loader.
-        klass = this.classes.get(name);
-        if (klass != null) {
-            return klass;
-        }
-
-        // If the class is python, load separatly. NotificationSender also uses
-        // PyObject, so it has to be read from this class loader.
-        // 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);
-        }
-
-        if (klass != null) {
-            this.classes.put(name, klass);
-            return klass;
-        } else {
-            throw new ClassNotFoundException();
-        }
-    }
-
-    /**
-     * @see java.security.SecureClassLoader#getPermissions(java.security.CodeSource)
-     */
-    @Override
-    protected PermissionCollection getPermissions(CodeSource codesource) {
-        // Grant all perission. This could be avoided if code signers were
-        // extracted correctly.
-        Permissions permissions = new Permissions();
-        AllPermission permission = new AllPermission();
-        permissions.add(permission);
-        return permissions;
-    }
-
-    private URL getBaseURL(Class klass) {
-        String path = klass.getName().replace('.', '/').concat(".class"); // /d/e/f.class
-        URL classURL = this.parent.getResource(path);
-
-        String jarURLString;
-        if ("jar".equals(classURL.getProtocol())) {
-            // classURL = jar:file/a/b/c.jar!/d/e/f.class
-            // or jar:http://example.org/a/b/c.jar!/d/e/f.class
-            String file = classURL.getFile();
-            // file = file:/a/b/c.jar!d/e/f.class
-            // or http://example.org/a/b/c.jar!d/e/f.class
-            logger.debug("file: " + file);
-            jarURLString = file.substring(0, file.lastIndexOf('!'));
-            // jarURLString = file:/a/b/c.jar
-            // or http://example.org/a/b/c.jar
-        } else {
-            // file:/a/b/c/d/e/f.class
-            String file = classURL.getFile(); // /a/b/c/d/e/f.class
-            int index = file.lastIndexOf(path);
-            jarURLString = "file:" + file.substring(0, index); // /a/b/c/
-        }
-        try {
-            URL jarURL = new URL(jarURLString);
-            return jarURL;
-        } catch (MalformedURLException e) {
-            throw new WorkflowRuntimeException(e);
-        }
-    }
-
-    private JarFile maybeGetJarFile(URL url) {
-        String path;
-        try {
-            path = URLDecoder.decode(url.getPath(), "UTF-8");
-        } catch (UnsupportedEncodingException e) {
-            throw new WorkflowRuntimeException(e);
-        }
-        logger.debug("path: " + path);
-        if (path.endsWith("/")) {
-            // url = file:/a/b/c/
-            // It's a local directory
-            return null;
-        } else if ("file".equals(url.getProtocol())) {
-            // url = file:/a/b/c.jar
-            // Jar file
-            try {
-                JarFile jarFile = new JarFile(path);
-                return jarFile;
-            } catch (IOException e) {
-                throw new WorkflowRuntimeException(e);
-            }
-        } else {
-            // url = http://example.com/a/b/c.jar
-            // A Jar file
-            try {
-                if (this.tmpJarDirectory == null) {
-                    Date date = new Date();
-                    SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd-HHmmss-S");
-                    String time = format.format(date);
-                    String fileName = ".xbaya-jars-" + time;
-                    String tmpdir = System.getProperty("java.io.tmpdir");
-                    this.tmpJarDirectory = new File(tmpdir, fileName);
-                    this.tmpJarDirectory.mkdir();
-                }
-
-                int i = path.lastIndexOf('/');
-                File file = new File(this.tmpJarDirectory, path.substring(i + 1));
-                logger.debug("file: " + file);
-                InputStream stream = url.openStream();
-                IOUtil.writeToFile(stream, file);
-                JarFile jarFile = new JarFile(file);
-                return jarFile;
-            } catch (IOException e) {
-                throw new WorkflowRuntimeException(e);
-            }
-        }
-    }
-
-    private Class findClassFromURL(String name, URL url, JarFile jarFile) throws ClassNotFoundException {
-        // logger.entering(new Object[] { name, url, jarFile });
-
-        String classPath = name.replace('.', '/').concat(".class");
-        // logger.info("classPath: " + classPath);
-
-        try {
-            byte[] classBytes;
-            CodeSource codeSource = null;
-            if (jarFile == null) {
-                // It's a local directory
-                String dirPath = URLDecoder.decode(url.getPath(), "UTF-8");
-                File classFile = new File(dirPath, classPath);
-                classBytes = IOUtil.readToByteArray(classFile);
-
-            } else {
-                // A Jar file
-                JarEntry jarEntry = jarFile.getJarEntry(classPath);
-                CodeSigner[] codeSigners = jarEntry.getCodeSigners();
-                // logger.info("codeSigners: " + codeSigners);
-                if (codeSigners != null) {
-                    // Somehow it's null.
-                    for (CodeSigner signer : codeSigners) {
-                        logger.debug("signer: " + signer);
-                    }
-                }
-                codeSource = new CodeSource(this.xbayaURL, codeSigners);
-                InputStream classInputStream = jarFile.getInputStream(jarEntry);
-                classBytes = IOUtil.readToByteArray(classInputStream);
-            }
-
-            Class<?> klass = defineClass(name, classBytes, 0, classBytes.length, codeSource);
-            this.classes.put(name, klass);
-            return klass;
-        } catch (IOException e) {
-            logger.error(e.getMessage(), e);
-            throw new ClassNotFoundException();
-        }
-    }
-
-    /**
-     * @see java.lang.ClassLoader#clearAssertionStatus()
-     */
-    @Override
-    public synchronized void clearAssertionStatus() {
-        super.clearAssertionStatus();
-    }
-
-    /**
-     * @see java.lang.ClassLoader#definePackage(java.lang.String, java.lang.String, java.lang.String, java.lang.String,
-     *      java.lang.String, java.lang.String, java.lang.String, java.net.URL)
-     */
-    @Override
-    protected Package definePackage(String name, String specTitle, String specVersion, String specVendor,
-            String implTitle, String implVersion, String implVendor, URL sealBase) throws IllegalArgumentException {
-        return super.definePackage(name, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor,
-                sealBase);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#findLibrary(java.lang.String)
-     */
-    @Override
-    protected String findLibrary(String libname) {
-        return super.findLibrary(libname);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#findResource(java.lang.String)
-     */
-    @Override
-    protected URL findResource(String name) {
-        return super.findResource(name);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#findResources(java.lang.String)
-     */
-    @Override
-    protected Enumeration<URL> findResources(String name) throws IOException {
-        return super.findResources(name);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#getPackage(java.lang.String)
-     */
-    @Override
-    protected Package getPackage(String name) {
-        return super.getPackage(name);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#getPackages()
-     */
-    @Override
-    protected Package[] getPackages() {
-        return super.getPackages();
-    }
-
-    /**
-     * @see java.lang.ClassLoader#getResource(java.lang.String)
-     */
-    @Override
-    public URL getResource(String name) {
-        return super.getResource(name);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#getResourceAsStream(java.lang.String)
-     */
-    @Override
-    public InputStream getResourceAsStream(String name) {
-        return super.getResourceAsStream(name);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#getResources(java.lang.String)
-     */
-    @Override
-    public Enumeration<URL> getResources(String name) throws IOException {
-        return super.getResources(name);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#setClassAssertionStatus(java.lang.String, boolean)
-     */
-    @Override
-    public synchronized void setClassAssertionStatus(String className, boolean enabled) {
-        super.setClassAssertionStatus(className, enabled);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#setDefaultAssertionStatus(boolean)
-     */
-    @Override
-    public synchronized void setDefaultAssertionStatus(boolean enabled) {
-        super.setDefaultAssertionStatus(enabled);
-    }
-
-    /**
-     * @see java.lang.ClassLoader#setPackageAssertionStatus(java.lang.String, boolean)
-     */
-    @Override
-    public synchronized void setPackageAssertionStatus(String packageName, boolean enabled) {
-        super.setPackageAssertionStatus(packageName, enabled);
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunner.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunner.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunner.java
deleted file mode 100644
index 2ebd2ff..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunner.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.runner;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-
-public interface JythonOneTimeRunner {
-
-    /**
-     * @param script
-     * @param arguments
-     * @throws WorkflowException
-     */
-    public void run(String script, String[] arguments) throws WorkflowException;
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunnerImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunnerImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunnerImpl.java
deleted file mode 100644
index 6a4c532..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonOneTimeRunnerImpl.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.runner;
-
-import java.io.File;
-import java.security.AccessController;
-import java.security.PrivilegedActionException;
-import java.security.PrivilegedExceptionAction;
-import java.util.jar.JarFile;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.python.core.PySystemState;
-import org.python.util.PythonInterpreter;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JythonOneTimeRunnerImpl implements JythonOneTimeRunner {
-
-    private static final Logger logger = LoggerFactory.getLogger(JythonOneTimeRunnerImpl.class);
-
-    /**
-     * @throws WorkflowException
-     * @see org.apache.airavata.xbaya.jython.runner.JythonOneTimeRunner#run(java.lang.String, java.lang.String[])
-     */
-    public void run(final String script, final String[] arguments) throws WorkflowException {
-
-        try {
-            AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
-                public Void run() {
-                    ClassLoader loader = this.getClass().getClassLoader();
-
-                    PySystemState.initialize(System.getProperties(), null, arguments, loader);
-
-                    if (loader instanceof JythonClassLoader) {
-                        logger.debug("jythonClassLoader");
-                        JythonClassLoader jythonLoader = (JythonClassLoader) loader;
-
-                        JarFile xbayaJarFile = jythonLoader.getXBayaJarFile();
-                        if (xbayaJarFile != null) {
-                            String jarPath = xbayaJarFile.getName();
-                            logger.debug("jarPath: " + jarPath);
-                            // String jarDir = jarPath.substring(0,
-                            // jarPath.lastIndexOf());
-                            File jarFile = new File(jarPath);
-                            String jarDir = jarFile.getParent();
-                            logger.debug("jarDir: " + jarDir);
-
-                            // This is for the Jython interpreter to
-                            // solve import statements.
-                            PySystemState.add_extdir(jarDir);
-                        }
-                    }
-
-                    PythonInterpreter interpreter = new PythonInterpreter();
-                    interpreter.exec(script);
-                    return null;
-                }
-            });
-        } catch (PrivilegedActionException e) {
-            logger.error(e.getMessage(), e);
-            throw new WorkflowException(e.getCause());
-        }
-
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonRunner.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonRunner.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonRunner.java
deleted file mode 100644
index 7fe1f93..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/runner/JythonRunner.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.runner;
-
-import java.util.List;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-
-public class JythonRunner {
-
-    private JythonClassLoader loader;
-
-    /**
-     * 
-     * Constructs a JythonRunner.
-     * 
-     */
-    public JythonRunner() {
-        this.loader = new JythonClassLoader(this.getClass().getClassLoader());
-    }
-
-    /**
-     * @param script
-     * @param arguments
-     * @throws WorkflowException
-     */
-    public void run(String script, List<String> arguments) throws WorkflowException {
-        run(script, arguments.toArray(new String[arguments.size()]));
-    }
-
-    /**
-     * @param script
-     * @param arguments
-     * @throws WorkflowException
-     */
-    public void run(final String script, final String[] arguments) throws WorkflowException {
-        try {
-            Class<?> runnerClass = this.loader.loadClass(JythonOneTimeRunnerImpl.class.getName(), true);
-            JythonOneTimeRunner runner = (JythonOneTimeRunner) runnerClass.newInstance();
-            runner.run(script, arguments);
-
-        } catch (ClassNotFoundException e) {
-            throw new WorkflowRuntimeException(ErrorMessages.UNEXPECTED_ERROR, e);
-        } catch (InstantiationException e) {
-            throw new WorkflowRuntimeException(ErrorMessages.UNEXPECTED_ERROR, e);
-        } catch (IllegalAccessException e) {
-            throw new WorkflowRuntimeException(ErrorMessages.UNEXPECTED_ERROR, e);
-        } finally {
-            loader.cleanUp();
-        }
-    }
-}
\ No newline at end of file


[53/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowProxyException.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowProxyException.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowProxyException.java
new file mode 100644
index 0000000..cf215cc
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/workflow/proxy/WorkflowProxyException.java
@@ -0,0 +1,64 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.workflow.proxy;
+
+import org.apache.airavata.xbaya.workflow.WorkflowEngineException;
+
+public class WorkflowProxyException extends WorkflowEngineException {
+
+    /**
+     * Constructs a WorkflowProxyException.
+     * 
+     */
+    public WorkflowProxyException() {
+        super();
+    }
+
+    /**
+     * Constructs a WorkflowProxyException.
+     * 
+     * @param message
+     */
+    public WorkflowProxyException(String message) {
+        super(message);
+    }
+
+    /**
+     * Constructs a WorkflowProxyException.
+     * 
+     * @param cause
+     */
+    public WorkflowProxyException(Throwable cause) {
+        super(cause);
+    }
+
+    /**
+     * Constructs a WorkflowProxyException.
+     * 
+     * @param message
+     * @param cause
+     */
+    public WorkflowProxyException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/WorkflowInterpretor.wsdl
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/WorkflowInterpretor.wsdl b/modules/xbaya-gui/src/main/resources/WorkflowInterpretor.wsdl
new file mode 100644
index 0000000..a46d107
--- /dev/null
+++ b/modules/xbaya-gui/src/main/resources/WorkflowInterpretor.wsdl
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
+	distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under
+	the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may
+	obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to
+	in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
+	ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under
+	the License. -->
+
+<wsdl:definitions targetNamespace="http://xbaya.extreme.indiana.edu" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://xbaya.extreme.indiana.edu" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax21="http://xbaya.extreme.indiana.edu/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/">
+  <wsdl:types>
+    <xs:schema targetNamespace="http://gui.component.xbaya.airavata.apache.org/xsd">
+            <xs:import namespace="http://registry.component.xbaya.airavata.apache.org/xsd"/>
+            <xs:element name="launchWorkflow">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="workflowAsString" nillable="true" type="xs:string"/>
+                        <xs:element minOccurs="0" name="topic" nillable="true" type="xs:string"/>
+                        <xs:element maxOccurs="unbounded" minOccurs="0" name="inputs" nillable="true" type="ns:NameValue"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:element name="launchWorkflowResponse">
+                <xs:complexType>
+                    <xs:sequence>
+                        <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/>
+                    </xs:sequence>
+                </xs:complexType>
+            </xs:element>
+            <xs:complexType name="NameValue">
+                <xs:sequence>
+                    <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/>
+                    <xs:element minOccurs="0" name="value" nillable="true" type="xs:string"/>
+                </xs:sequence>
+            </xs:complexType>
+        </xs:schema>
+  </wsdl:types>
+  <wsdl:message name="launchWorkflowRequest">
+    <wsdl:part name="parameters" element="ns:launchWorkflow">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:message name="launchWorkflowResponse">
+    <wsdl:part name="parameters" element="ns:launchWorkflowResponse">
+    </wsdl:part>
+  </wsdl:message>
+  <wsdl:portType name="WorkflowInterpretorPortType">
+    <wsdl:operation name="launchWorkflow">
+      <wsdl:input message="ns:launchWorkflowRequest" wsaw:Action="urn:launchWorkflow">
+    </wsdl:input>
+      <wsdl:output message="ns:launchWorkflowResponse" wsaw:Action="urn:launchWorkflowResponse">
+    </wsdl:output>
+    </wsdl:operation>
+  </wsdl:portType>
+  <wsdl:binding name="WorkflowInterpretorSoap11Binding" type="ns:WorkflowInterpretorPortType">
+    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+    <wsdl:operation name="launchWorkflow">
+      <soap:operation soapAction="urn:launchWorkflow" style="document"/>
+      <wsdl:input>
+        <soap:body use="literal"/>
+      </wsdl:input>
+      <wsdl:output>
+        <soap:body use="literal"/>
+      </wsdl:output>
+    </wsdl:operation>
+  </wsdl:binding>
+  <wsdl:service name="WorkflowInterpretor">
+    <wsdl:port name="WorkflowInterpretorHttpSoap11Endpoint" binding="ns:WorkflowInterpretorSoap11Binding">
+      <soap:address location="http://ogceportal.iu.teragrid.org:19444/axis2/services/WorkflowInterpretor"/>
+    </wsdl:port>
+  </wsdl:service>
+</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/airavata-2.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/airavata-2.png b/modules/xbaya-gui/src/main/resources/images/airavata-2.png
new file mode 100644
index 0000000..28bca82
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/airavata-2.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/airavata-config.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/airavata-config.png b/modules/xbaya-gui/src/main/resources/images/airavata-config.png
new file mode 100644
index 0000000..2b42807
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/airavata-config.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/airavata-icon.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/airavata-icon.png b/modules/xbaya-gui/src/main/resources/images/airavata-icon.png
new file mode 100644
index 0000000..28cf91a
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/airavata-icon.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/airavata-icon2.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/airavata-icon2.png b/modules/xbaya-gui/src/main/resources/images/airavata-icon2.png
new file mode 100644
index 0000000..d00e112
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/airavata-icon2.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/airavata-name.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/airavata-name.png b/modules/xbaya-gui/src/main/resources/images/airavata-name.png
new file mode 100644
index 0000000..5c29ec9
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/airavata-name.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/airavata-title-text.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/airavata-title-text.png b/modules/xbaya-gui/src/main/resources/images/airavata-title-text.png
new file mode 100644
index 0000000..3b737f4
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/airavata-title-text.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/airavata.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/airavata.png b/modules/xbaya-gui/src/main/resources/images/airavata.png
new file mode 100644
index 0000000..7713189
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/airavata.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/application.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/application.png b/modules/xbaya-gui/src/main/resources/images/application.png
new file mode 100644
index 0000000..66ae19c
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/application.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/applications.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/applications.png b/modules/xbaya-gui/src/main/resources/images/applications.png
new file mode 100644
index 0000000..f40985e
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/applications.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/closed.gif
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/closed.gif b/modules/xbaya-gui/src/main/resources/images/closed.gif
new file mode 100644
index 0000000..83ee32c
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/closed.gif differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/cloud.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/cloud.png b/modules/xbaya-gui/src/main/resources/images/cloud.png
new file mode 100644
index 0000000..ac7284f
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/cloud.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/experiment.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/experiment.png b/modules/xbaya-gui/src/main/resources/images/experiment.png
new file mode 100644
index 0000000..48fe90b
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/experiment.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/experiments.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/experiments.png b/modules/xbaya-gui/src/main/resources/images/experiments.png
new file mode 100644
index 0000000..ed993e0
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/experiments.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/gfac_url.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/gfac_url.png b/modules/xbaya-gui/src/main/resources/images/gfac_url.png
new file mode 100644
index 0000000..f4c1b7a
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/gfac_url.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/gfac_urls.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/gfac_urls.png b/modules/xbaya-gui/src/main/resources/images/gfac_urls.png
new file mode 100644
index 0000000..9245910
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/gfac_urls.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/host.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/host.png b/modules/xbaya-gui/src/main/resources/images/host.png
new file mode 100644
index 0000000..e76e671
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/host.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/hosts.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/hosts.png b/modules/xbaya-gui/src/main/resources/images/hosts.png
new file mode 100644
index 0000000..cf0356d
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/hosts.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/input_para.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/input_para.png b/modules/xbaya-gui/src/main/resources/images/input_para.png
new file mode 100644
index 0000000..d20c003
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/input_para.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/jcr-repo.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/jcr-repo.png b/modules/xbaya-gui/src/main/resources/images/jcr-repo.png
new file mode 100644
index 0000000..6aa8545
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/jcr-repo.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/leaf.gif
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/leaf.gif b/modules/xbaya-gui/src/main/resources/images/leaf.gif
new file mode 100644
index 0000000..b18a22f
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/leaf.gif differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/jcr.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/jcr.png b/modules/xbaya-gui/src/main/resources/images/menu/jcr.png
new file mode 100644
index 0000000..ba6e116
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/jcr.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/new2.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/new2.png b/modules/xbaya-gui/src/main/resources/images/menu/new2.png
new file mode 100644
index 0000000..2e56f58
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/new2.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/open1.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/open1.png b/modules/xbaya-gui/src/main/resources/images/menu/open1.png
new file mode 100644
index 0000000..c706198
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/open1.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/open2.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/open2.png b/modules/xbaya-gui/src/main/resources/images/menu/open2.png
new file mode 100644
index 0000000..d2ce8de
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/open2.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/open_dir.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/open_dir.png b/modules/xbaya-gui/src/main/resources/images/menu/open_dir.png
new file mode 100644
index 0000000..936737e
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/open_dir.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/pause1.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/pause1.png b/modules/xbaya-gui/src/main/resources/images/menu/pause1.png
new file mode 100644
index 0000000..254767a
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/pause1.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/pause_monitor1.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/pause_monitor1.png b/modules/xbaya-gui/src/main/resources/images/menu/pause_monitor1.png
new file mode 100644
index 0000000..dfe320d
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/pause_monitor1.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/play3.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/play3.png b/modules/xbaya-gui/src/main/resources/images/menu/play3.png
new file mode 100644
index 0000000..88aee76
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/play3.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/play4.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/play4.png b/modules/xbaya-gui/src/main/resources/images/menu/play4.png
new file mode 100644
index 0000000..084250c
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/play4.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/resume_monitoring1.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/resume_monitoring1.png b/modules/xbaya-gui/src/main/resources/images/menu/resume_monitoring1.png
new file mode 100644
index 0000000..84be025
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/resume_monitoring1.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/save1.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/save1.png b/modules/xbaya-gui/src/main/resources/images/menu/save1.png
new file mode 100644
index 0000000..bf46fd1
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/save1.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/menu/stop.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/menu/stop.png b/modules/xbaya-gui/src/main/resources/images/menu/stop.png
new file mode 100644
index 0000000..60eb108
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/menu/stop.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/opened.gif
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/opened.gif b/modules/xbaya-gui/src/main/resources/images/opened.gif
new file mode 100644
index 0000000..2d06b25
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/opened.gif differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/output_para.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/output_para.png b/modules/xbaya-gui/src/main/resources/images/output_para.png
new file mode 100644
index 0000000..d09a694
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/output_para.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/parameter.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/parameter.png b/modules/xbaya-gui/src/main/resources/images/parameter.png
new file mode 100644
index 0000000..8f9b90a
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/parameter.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/pause.jpeg
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/pause.jpeg b/modules/xbaya-gui/src/main/resources/images/pause.jpeg
new file mode 100644
index 0000000..0c04b2f
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/pause.jpeg differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/play.jpeg
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/play.jpeg b/modules/xbaya-gui/src/main/resources/images/play.jpeg
new file mode 100644
index 0000000..db2dd7e
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/play.jpeg differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/registry.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/registry.png b/modules/xbaya-gui/src/main/resources/images/registry.png
new file mode 100644
index 0000000..168dec6
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/registry.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/service.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/service.png b/modules/xbaya-gui/src/main/resources/images/service.png
new file mode 100644
index 0000000..2c02fa7
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/service.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/services.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/services.png b/modules/xbaya-gui/src/main/resources/images/services.png
new file mode 100644
index 0000000..762544c
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/services.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/step.gif
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/step.gif b/modules/xbaya-gui/src/main/resources/images/step.gif
new file mode 100644
index 0000000..1ec36ae
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/step.gif differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/stop.jpeg
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/stop.jpeg b/modules/xbaya-gui/src/main/resources/images/stop.jpeg
new file mode 100644
index 0000000..57e8693
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/stop.jpeg differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/workflow.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/workflow.png b/modules/xbaya-gui/src/main/resources/images/workflow.png
new file mode 100644
index 0000000..0efcc44
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/workflow.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/workflow_templates.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/workflow_templates.png b/modules/xbaya-gui/src/main/resources/images/workflow_templates.png
new file mode 100644
index 0000000..53bd023
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/workflow_templates.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/images/workflows.png
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/images/workflows.png b/modules/xbaya-gui/src/main/resources/images/workflows.png
new file mode 100644
index 0000000..16fa3f1
Binary files /dev/null and b/modules/xbaya-gui/src/main/resources/images/workflows.png differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/services.xml
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/services.xml b/modules/xbaya-gui/src/main/resources/services.xml
new file mode 100644
index 0000000..429b159
--- /dev/null
+++ b/modules/xbaya-gui/src/main/resources/services.xml
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor
+	license agreements. See the NOTICE file distributed with this work for additional 
+	information regarding copyright ownership. The ASF licenses this file to 
+	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
+	this file except in compliance with the License. You may obtain a copy of 
+	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
+	by applicable law or agreed to in writing, software distributed under the 
+	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
+	OF ANY ~ KIND, either express or implied. See the License for the specific 
+	language governing permissions and limitations under the License. -->
+
+
+<!-- This file was auto-generated from WSDL -->
+<!-- by the Apache Axis2 version: 1.4  Built on : Apr 26, 2008 (06:24:30 EDT) -->
+<serviceGroup>
+    <service name="WorkflowInterpretor" class="org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton">
+        <messageReceivers>
+            <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="org.apache.airavata.xbaya.interpretor.WorkflowInterpretorMessageReceiverInOut"/>
+        </messageReceivers>
+        <parameter name="ServiceClass">org.apache.airavata.xbaya.interpretor.WorkflowInterpretorSkeleton</parameter>
+        <parameter name="useOriginalwsdl">true</parameter>
+        <parameter name="modifyUserWSDLPortAddress">true</parameter>
+        <operation name="launchWorkflow" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://xbaya.extreme.indiana.edu">
+            <actionMapping>urn:launchWorkflow</actionMapping>
+            <outputActionMapping>urn:launchWorkflowResponse</outputActionMapping>
+        </operation>
+    </service>
+</serviceGroup>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/wsdls/TestCMD_Example1_AWSDL.xml
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/wsdls/TestCMD_Example1_AWSDL.xml b/modules/xbaya-gui/src/main/resources/wsdls/TestCMD_Example1_AWSDL.xml
new file mode 100644
index 0000000..0964447
--- /dev/null
+++ b/modules/xbaya-gui/src/main/resources/wsdls/TestCMD_Example1_AWSDL.xml
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+	distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+	the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
+	obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+	in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+	ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+	the License. -->
+
+<wsdl:definitions name="TestCMD_Example1" targetNamespace="http://www.extreme.indiana.edu/lead"
+	xmlns:typens="http://www.extreme.indiana.edu/lead/TestCMD_Example1/xsd" xmlns:wsdlns="http://www.extreme.indiana.edu/lead"
+	xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+	<wsdl:types>
+		<schema elementFormDefault="unqualified" targetNamespace="http://www.extreme.indiana.edu/lead/TestCMD_Example1/xsd"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<element name="Run_InputParams" type="typens:Run_InputParamsType" />
+			<complexType name="Run_InputParamsType">
+				<sequence>
+					<element name="InputParam1" type="xsd:int">
+						<annotation>
+							<documentation>An input parameter</documentation>
+						</annotation>
+					</element>
+				</sequence>
+			</complexType>
+			<element name="Run_OutputParams" type="typens:Run_OutputParamsType" />
+			<complexType name="Run_OutputParamsType">
+				<sequence>
+					<element name="OutputParam1" type="xsd:string">
+						<annotation>
+							<documentation>An output parameter</documentation>
+						</annotation>
+					</element>
+				</sequence>
+			</complexType>
+		</schema>
+	</wsdl:types>
+	<wsdl:message name="Run_RequestMessage">
+		<wsdl:part name="parameters" element="typens:Run_InputParams" />
+	</wsdl:message>
+	<wsdl:message name="Run_ResponseMessage">
+		<wsdl:part name="parameters" element="typens:Run_OutputParams" />
+	</wsdl:message>
+	<wsdl:portType name="TestCMD_Example1">
+		<wsdl:documentation />
+		<wsdl:operation name="Run">
+			<wsdl:documentation>Run the service</wsdl:documentation>
+			<wsdl:input name="Run_RequestMessage" message="wsdlns:Run_RequestMessage" />
+			<wsdl:output name="Run_ResponseMessage" message="wsdlns:Run_ResponseMessage" />
+		</wsdl:operation>
+	</wsdl:portType>
+	<n:factoryServices xmlns:n="http://www.extreme.indiana.edu/namespaces/2004/01/gFac">
+		<n:factoryService location="http://rainier.extreme.indiana.edu:12345" operation="n:CreateService"
+			portType="n:GenericFactory" />
+	</n:factoryServices>
+</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/wsdls/adder-awsdl.xml
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/wsdls/adder-awsdl.xml b/modules/xbaya-gui/src/main/resources/wsdls/adder-awsdl.xml
new file mode 100644
index 0000000..08e3577
--- /dev/null
+++ b/modules/xbaya-gui/src/main/resources/wsdls/adder-awsdl.xml
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+	distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+	the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
+	obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+	in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+	ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+	the License. -->
+
+<definitions name="Adder" targetNamespace="http://www.extreme.indiana.edu/math/" xmlns:tns="http://www.extreme.indiana.edu/math/"
+	xmlns:typens="http://www.extreme.indiana.edu/math/adder/xsd/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+	xmlns="http://schemas.xmlsoap.org/wsdl/">
+
+	<documentation xml:lang="en">A service for adding two numbers</documentation>
+
+	<types>
+		<schema elementFormDefault="unqualified" targetNamespace="http://www.extreme.indiana.edu/math/adder/xsd/"
+			xmlns="http://www.w3.org/2001/XMLSchema">
+			<element name="AddInput" type="typens:AddInputType" />
+			<complexType name="AddInputType">
+				<sequence>
+					<element name="x" type="xsd:int">
+						<annotation>
+							<documentation xml:lang="en">This is the first input</documentation>
+						</annotation>
+					</element>
+					<element name="y" type="xsd:int">
+						<annotation>
+							<documentation xml:lang="en">This is the second input</documentation>
+						</annotation>
+					</element>
+				</sequence>
+			</complexType>
+			<element name="AddOutput" type="typens:AddOutputType" />
+			<complexType name="AddOutputType">
+				<sequence>
+					<element name="z" type="xsd:int">
+						<annotation>
+							<documentation xml:lang="en">This is the result</documentation>
+						</annotation>
+					</element>
+				</sequence>
+			</complexType>
+		</schema>
+	</types>
+
+	<message name="AddInputMessage">
+		<part name="AddInputMessagePart" element="typens:AddInput" />
+	</message>
+	<message name="AddOutputMessage">
+		<part name="AddOutputMessagePart" element="typens:AddOutput" />
+	</message>
+
+	<portType name="Adder">
+		<documentation xml:lang="en" />
+		<operation name="add">
+			<documentation = en ">Run the adder</documentation>
+			<input name="AddInput" message="tns:AddInputMessage" />
+			<output name="AddOutput" message="tns:AddOutputMessage" />
+		</operation>
+	</portType>
+</definitions>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/resources/wsdls/eventing.wsdl
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/resources/wsdls/eventing.wsdl b/modules/xbaya-gui/src/main/resources/wsdls/eventing.wsdl
new file mode 100644
index 0000000..ac33777
--- /dev/null
+++ b/modules/xbaya-gui/src/main/resources/wsdls/eventing.wsdl
@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+	distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+	the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
+	obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+	in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+	ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+	the License. -->
+
+<wsdl:definitions targetNamespace='http://schemas.xmlsoap.org/ws/2004/08/eventing' xmlns:wse='http://schemas.xmlsoap.org/ws/2004/08/eventing'
+	xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' xmlns:xs='http://www.w3.org/2001/XMLSchema'>
+
+	<wsdl:types>
+
+		<xs:schema targetNamespace="http://schemas.xmlsoap.org/ws/2004/08/eventing" xmlns:tns="http://schemas.xmlsoap.org/ws/2004/08/eventing"
+			xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+			elementFormDefault="qualified" blockDefault="#all">
+
+			<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd" />
+
+			<xs:import namespace="http://schemas.xmlsoap.org/ws/2004/08/addressing" schemaLocation="http://schemas.xmlsoap.org/ws/2004/08/addressing" />
+
+			<!-- Types and global elements -->
+			<xs:complexType name="DeliveryType" mixed="true">
+				<xs:sequence>
+					<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+				</xs:sequence>
+				<xs:attribute name="Mode" type="xs:anyURI" use="optional" />
+				<xs:anyAttribute namespace="##other" processContents="lax" />
+			</xs:complexType>
+
+			<xs:element name="NotifyTo" type="wsa:EndpointReferenceType" />
+
+			<xs:simpleType name="NonNegativeDurationType">
+				<xs:restriction base="xs:duration">
+					<xs:minInclusive value="P0Y0M0DT0H0M0S" />
+				</xs:restriction>
+			</xs:simpleType>
+
+			<xs:simpleType name="ExpirationType">
+				<xs:union memberTypes="xs:dateTime tns:NonNegativeDurationType" />
+			</xs:simpleType>
+
+			<xs:complexType name="FilterType" mixed="true">
+				<xs:sequence>
+					<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+				</xs:sequence>
+				<xs:attribute name="Dialect" type="xs:anyURI" use="optional" />
+				<xs:anyAttribute namespace="##other" processContents="lax" />
+			</xs:complexType>
+
+			<xs:complexType name="LanguageSpecificStringType">
+				<xs:simpleContent>
+					<xs:extension base="xs:string">
+						<xs:attribute ref="xml:lang" />
+						<xs:anyAttribute namespace="##other" processContents="lax" />
+					</xs:extension>
+				</xs:simpleContent>
+			</xs:complexType>
+
+			<!-- Subscribe request -->
+			<xs:element name="Subscribe">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="EndTo" type="wsa:EndpointReferenceType" minOccurs="0" />
+						<xs:element name="Delivery" type="tns:DeliveryType" />
+						<xs:element name="Expires" type="tns:ExpirationType" minOccurs="0" />
+						<xs:element name="Filter" type="tns:FilterType" minOccurs="0" />
+						<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+					</xs:sequence>
+					<xs:anyAttribute namespace="##other" processContents="lax" />
+				</xs:complexType>
+			</xs:element>
+
+			<xs:element name="Identifier" type="xs:anyURI" />
+
+			<!-- Subscribe response -->
+			<xs:element name="SubscribeResponse">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="SubscriptionManager" type="wsa:EndpointReferenceType" />
+						<xs:element name="Expires" type="tns:ExpirationType" />
+						<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+					</xs:sequence>
+					<xs:anyAttribute namespace="##other" processContents="lax" />
+				</xs:complexType>
+			</xs:element>
+
+			<!-- Used in a fault if there's an unsupported dialect -->
+			<xs:element name="SupportedDialect" type="xs:anyURI" />
+
+			<!-- Used in a fault if there's an unsupported delivery mode -->
+			<xs:element name="SupportedDeliveryMode" type="xs:anyURI" />
+
+			<!-- Renew request -->
+			<xs:element name="Renew">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="Expires" type="tns:ExpirationType" minOccurs="0" />
+						<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+					</xs:sequence>
+					<xs:anyAttribute namespace="##other" processContents="lax" />
+				</xs:complexType>
+			</xs:element>
+
+			<!-- Renew response -->
+			<xs:element name="RenewResponse">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="Expires" type="tns:ExpirationType" minOccurs="0" />
+						<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+					</xs:sequence>
+					<xs:anyAttribute namespace="##other" processContents="lax" />
+				</xs:complexType>
+			</xs:element>
+
+			<!-- GetStatus request -->
+			<xs:element name="GetStatus">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+					</xs:sequence>
+					<xs:anyAttribute namespace="##other" processContents="lax" />
+				</xs:complexType>
+			</xs:element>
+
+			<!-- GetStatus response -->
+			<xs:element name="GetStatusResponse">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="Expires" type="tns:ExpirationType" minOccurs="0" />
+						<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+					</xs:sequence>
+					<xs:anyAttribute namespace="##other" processContents="lax" />
+				</xs:complexType>
+			</xs:element>
+
+			<!-- Unsubscribe request -->
+			<xs:element name="Unsubscribe">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+					</xs:sequence>
+					<xs:anyAttribute namespace="##other" processContents="lax" />
+				</xs:complexType>
+			</xs:element>
+
+			<!-- count(/s:Envelope/s:Body/*) = 0 for Unsubscribe response -->
+
+			<!-- SubscriptionEnd message -->
+			<xs:element name="SubscriptionEnd">
+				<xs:complexType>
+					<xs:sequence>
+						<xs:element name="SubscriptionManager" type="wsa:EndpointReferenceType" />
+						<xs:element name="Status" type="tns:OpenSubscriptionEndCodeType" />
+						<xs:element name="Reason" type="tns:LanguageSpecificStringType" minOccurs="0" maxOccurs="unbounded" />
+						<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+					</xs:sequence>
+					<xs:anyAttribute namespace="##other" processContents="lax" />
+				</xs:complexType>
+			</xs:element>
+
+			<xs:simpleType name="SubscriptionEndCodeType">
+				<xs:restriction base="xs:anyURI">
+					<xs:enumeration value="http://schemas.xmlsoap.org/ws/2004/08/eventing/DeliveryFailure" />
+					<xs:enumeration value="http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceShuttingDown" />
+					<xs:enumeration value="http://schemas.xmlsoap.org/ws/2004/08/eventing/SourceCancelling" />
+				</xs:restriction>
+			</xs:simpleType>
+
+			<xs:simpleType name="OpenSubscriptionEndCodeType">
+				<xs:union memberTypes="tns:SubscriptionEndCodeType xs:anyURI" />
+			</xs:simpleType>
+
+			<xs:attribute name="EventSource" type="xs:boolean" />
+
+		</xs:schema>
+
+		<xs:schema targetNamespace="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:xs="http://www.w3.org/2001/XMLSchema"
+			xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" elementFormDefault="qualified" blockDefault="#all">
+			<!-- //////////////////// WS-Addressing //////////////////// -->
+			<!-- Endpoint reference -->
+			<xs:element name="EndpointReference" type="wsa:EndpointReferenceType" />
+			<xs:complexType name="EndpointReferenceType">
+				<xs:sequence>
+					<xs:element name="Address" type="wsa:AttributedURI" />
+					<xs:element name="ReferenceProperties" type="wsa:ReferencePropertiesType" minOccurs="0" />
+					<xs:element name="ReferenceParameters" type="wsa:ReferenceParametersType" minOccurs="0" />
+					<xs:element name="PortType" type="wsa:AttributedQName" minOccurs="0" />
+					<xs:element name="ServiceName" type="wsa:ServiceNameType" minOccurs="0" />
+					<xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded">
+						<xs:annotation>
+							<xs:documentation>
+								If "Policy" elements from namespace "http://schemas.xmlsoap.org/ws/2002/12/policy#policy" are used, they must
+								appear first (before any extensibility elements).
+							</xs:documentation>
+						</xs:annotation>
+					</xs:any>
+				</xs:sequence>
+				<xs:anyAttribute namespace="##other" processContents="lax" />
+			</xs:complexType>
+			<xs:complexType name="ReferencePropertiesType">
+				<xs:sequence>
+					<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+				</xs:sequence>
+			</xs:complexType>
+			<xs:complexType name="ReferenceParametersType">
+				<xs:sequence>
+					<xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded" />
+				</xs:sequence>
+			</xs:complexType>
+			<xs:complexType name="ServiceNameType">
+				<xs:simpleContent>
+					<xs:extension base="xs:QName">
+						<xs:attribute name="PortName" type="xs:NCName" />
+						<xs:anyAttribute namespace="##other" processContents="lax" />
+					</xs:extension>
+				</xs:simpleContent>
+			</xs:complexType>
+			<!-- Message information header blocks -->
+			<xs:element name="MessageID" type="wsa:AttributedURI" />
+			<xs:element name="RelatesTo" type="wsa:Relationship" />
+			<xs:element name="To" type="wsa:AttributedURI" />
+			<xs:element name="Action" type="wsa:AttributedURI" />
+			<xs:element name="From" type="wsa:EndpointReferenceType" />
+			<xs:element name="ReplyTo" type="wsa:EndpointReferenceType" />
+			<xs:element name="FaultTo" type="wsa:EndpointReferenceType" />
+			<xs:complexType name="Relationship">
+				<xs:simpleContent>
+					<xs:extension base="xs:anyURI">
+						<xs:attribute name="RelationshipType" type="xs:QName" use="optional" />
+						<xs:anyAttribute namespace="##other" processContents="lax" />
+					</xs:extension>
+				</xs:simpleContent>
+			</xs:complexType>
+			<xs:simpleType name="RelationshipTypeValues">
+				<xs:restriction base="xs:QName">
+					<xs:enumeration value="wsa:Reply" />
+				</xs:restriction>
+			</xs:simpleType>
+			<xs:element name="ReplyAfter" type="wsa:ReplyAfterType" />
+			<xs:complexType name="ReplyAfterType">
+				<xs:simpleContent>
+					<xs:extension base="xs:nonNegativeInteger">
+						<xs:anyAttribute namespace="##other" />
+					</xs:extension>
+				</xs:simpleContent>
+			</xs:complexType>
+			<xs:simpleType name="FaultSubcodeValues">
+				<xs:restriction base="xs:QName">
+					<xs:enumeration value="wsa:InvalidMessageInformationHeader" />
+					<xs:enumeration value="wsa:MessageInformationHeaderRequired" />
+					<xs:enumeration value="wsa:DestinationUnreachable" />
+					<xs:enumeration value="wsa:ActionNotSupported" />
+					<xs:enumeration value="wsa:EndpointUnavailable" />
+				</xs:restriction>
+			</xs:simpleType>
+			<xs:attribute name="Action" type="xs:anyURI" />
+			<!-- Common declarations and definitions -->
+			<xs:complexType name="AttributedQName">
+				<xs:simpleContent>
+					<xs:extension base="xs:QName">
+						<xs:anyAttribute namespace="##other" processContents="lax" />
+					</xs:extension>
+				</xs:simpleContent>
+			</xs:complexType>
+			<xs:complexType name="AttributedURI">
+				<xs:simpleContent>
+					<xs:extension base="xs:anyURI">
+						<xs:anyAttribute namespace="##other" processContents="lax" />
+					</xs:extension>
+				</xs:simpleContent>
+			</xs:complexType>
+		</xs:schema>
+
+	</wsdl:types>
+
+	<wsdl:message name='SubscribeMsg'>
+		<wsdl:part name='body' element='wse:Subscribe' />
+	</wsdl:message>
+	<wsdl:message name='SubscribeResponseMsg'>
+		<wsdl:part name='body' element='wse:SubscribeResponse' />
+	</wsdl:message>
+
+	<wsdl:message name='RenewMsg'>
+		<wsdl:part name='body' element='wse:Renew' />
+	</wsdl:message>
+	<wsdl:message name='RenewResponseMsg'>
+		<wsdl:part name='body' element='wse:RenewResponse' />
+	</wsdl:message>
+
+	<wsdl:message name='GetStatusMsg'>
+		<wsdl:part name='body' element='wse:GetStatus' />
+	</wsdl:message>
+	<wsdl:message name='GetStatusResponseMsg'>
+		<wsdl:part name='body' element='wse:GetStatusResponse' />
+	</wsdl:message>
+
+	<wsdl:message name='UnsubscribeMsg'>
+		<wsdl:part name='body' element='wse:Unsubscribe' />
+	</wsdl:message>
+	<wsdl:message name='UnsubscribeResponseMsg' />
+
+	<wsdl:message name='SubscriptionEnd'>
+		<wsdl:part name='body' element='wse:SubscriptionEnd' />
+	</wsdl:message>
+
+	<wsdl:portType name='EventSource'>
+		<wsdl:operation name='SubscribeOp'>
+			<wsdl:input message='wse:SubscribeMsg' />
+			<wsdl:output message='wse:SubscribeResponseMsg' />
+		</wsdl:operation>
+		<wsdl:operation name='SubscriptionEnd'>
+			<wsdl:output message='wse:SubscriptionEnd' />
+		</wsdl:operation>
+	</wsdl:portType>
+
+	<wsdl:portType name='SubscriptionManager'>
+		<wsdl:operation name='RenewOp'>
+			<wsdl:input message='wse:RenewMsg' />
+			<wsdl:output message='wse:RenewResponseMsg' />
+		</wsdl:operation>
+		<wsdl:operation name='GetStatusOp'>
+			<wsdl:input message='wse:GetStatusMsg' />
+			<wsdl:output message='wse:GetStatusResponseMsg' />
+		</wsdl:operation>
+		<wsdl:operation name='UnsubscribeOp'>
+			<wsdl:input message='wse:UnsubscribeMsg' />
+			<wsdl:output message='wse:UnsubscribeResponseMsg' />
+		</wsdl:operation>
+	</wsdl:portType>
+</wsdl:definitions>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java
new file mode 100644
index 0000000..bb876df
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexForEachWorkflowTest.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.UUID;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ComplexForEachWorkflowTest {
+    final Logger logger = LoggerFactory.getLogger(ForEachWorkflowTest.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    @Test
+    public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+        logger.info("Running ComplexForEachWorkflowTest...");
+        URL systemResource = this.getClass().getClassLoader().getSystemResource("ComplexForEach.xwf");
+        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+//        ((InputNode) workflow.getGraph().getNode("input")).setDefaultValue("1");
+        XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//        AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf,null,null,true);
+        WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+                UUID.randomUUID().toString(), conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf,null,null,true);
+
+        workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+        SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+
+        WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+        interpretor.scheduleDynamically();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathService.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathService.java
new file mode 100644
index 0000000..ce50e50
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathService.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpreter;
+
+public class ComplexMathService {
+    public int adder(int param1, int param2) {
+        return param1 + param2;
+    }
+
+    public int multiplier(int param1, int param2) {
+        return param1 * param2;
+    }
+
+    public String echo(String str) {
+        return str;
+    }
+
+    public String concatenate(String str1, String str2) {
+        return str1 + str2;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java
new file mode 100644
index 0000000..d6c718e
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ComplexMathWorkflowTest.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpreter;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.UUID;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ComplexMathWorkflowTest {
+    final Logger logger = LoggerFactory.getLogger(ComplexMathWorkflowTest.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    @Test
+    public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+        logger.info("Running ComplexMathWorkflowTest...");
+        URL systemResource = this.getClass().getClassLoader().getSystemResource("ComplexMath.xwf");
+        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+        XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//        AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+                UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+        SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+        WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+        interpretor.scheduleDynamically();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java
new file mode 100644
index 0000000..5c7d30e
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/CrossProductWorkflowTest.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+package org.apache.airavata.xbaya.interpreter;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.UUID;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class CrossProductWorkflowTest {
+    final Logger logger = LoggerFactory.getLogger(CrossProductWorkflowTest.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    @Test
+    public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+        logger.info("Running CrossProductWorkflowTest...");
+        URL systemResource = this.getClass().getClassLoader().getSystemResource("LevenshteinDistance.xwf");
+        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+        XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//        AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+                UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+
+        WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,new SSWorkflowInterpreterInteractorImpl());
+        interpretor.scheduleDynamically();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/EchoService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/EchoService.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/EchoService.java
new file mode 100644
index 0000000..0e76399
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/EchoService.java
@@ -0,0 +1,28 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.xbaya.interpreter;
+
+public class EchoService {
+
+    public String echo(String input) {
+        return input;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java
new file mode 100644
index 0000000..84ef616
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/ForEachWorkflowTest.java
@@ -0,0 +1,73 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter;
+
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.UUID;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.interpreter.utils.WorkflowTestUtils;
+import org.apache.airavata.xbaya.interpretor.SSWorkflowInterpreterInteractorImpl;
+import org.apache.airavata.xbaya.interpretor.StandaloneNotificationSender;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreter;
+import org.apache.airavata.xbaya.interpretor.WorkflowInterpreterConfiguration;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ForEachWorkflowTest {
+    final Logger logger = LoggerFactory.getLogger(ForEachWorkflowTest.class);
+
+    @Rule
+    public MethodRule watchman = new TestWatchman() {
+        public void starting(FrameworkMethod method) {
+            logger.info("{} being run...", method.getName());
+        }
+    };
+
+    @Test
+    public void testScheduleDynamically() throws IOException, URISyntaxException, WorkflowException {
+        logger.info("Running ForEachWorkflowTest...");
+        URL systemResource = this.getClass().getClassLoader().getSystemResource("SimpleEcho.xwf");
+        Workflow workflow = new Workflow(WorkflowTestUtils.readWorkflow(systemResource));
+        ((InputNode) workflow.getGraph().getNode("input")).setDefaultValue("1");
+        XBayaConfiguration conf = WorkflowTestUtils.getConfiguration();
+//        AiravataRegistry2 registry = conf.getJcrComponentRegistry()==null? null:conf.getJcrComponentRegistry().getRegistry();
+//		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow, UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null,null,true);
+		WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,
+                UUID.randomUUID().toString(),conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, null,null,true);
+		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+		SSWorkflowInterpreterInteractorImpl ssWorkflowInterpreterInteractorImpl = new SSWorkflowInterpreterInteractorImpl();
+
+        WorkflowInterpreter interpretor = new WorkflowInterpreter(workflowInterpreterConfiguration,ssWorkflowInterpreterInteractorImpl);
+        interpretor.scheduleDynamically();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/LevenshteinDistanceService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/LevenshteinDistanceService.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/LevenshteinDistanceService.java
new file mode 100644
index 0000000..3a65729
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/LevenshteinDistanceService.java
@@ -0,0 +1,48 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpreter;
+
+public class LevenshteinDistanceService {
+    public int computeDistance(String sequence1, String sequence2) {
+        int[][] distance = new int[sequence1.length() + 1][sequence2.length() + 1];
+
+        for (int i = 0; i <= sequence1.length(); i++) {
+            distance[i][0] = i;
+        }
+        for (int j = 0; j <= sequence2.length(); j++) {
+            distance[0][j] = j;
+        }
+
+        for (int i = 1; i <= sequence1.length(); i++) {
+            for (int j = 1; j <= sequence2.length(); j++) {
+                distance[i][j] = min(distance[i - 1][j] + 1, distance[i][j - 1] + 1, distance[i - 1][j - 1] + ((sequence1.charAt(i - 1) == sequence2.charAt(j - 1)) ? 0 : 1));
+            }
+        }
+
+         return distance[sequence1.length()][sequence2.length()];
+    }
+
+    private int min(int a, int b, int c) {
+        return Math.min(Math.min(a, b), c);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/Listener.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/Listener.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/Listener.java
new file mode 100644
index 0000000..6443828
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/Listener.java
@@ -0,0 +1,31 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter;
+
+import org.apache.airavata.wsmg.client.NotificationHandler;
+
+public class Listener implements NotificationHandler {
+
+    public void handleNotification(String message) {
+       System.out.println("MessageRecieved: " + message);
+   }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/NotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/NotificationSender.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/NotificationSender.java
new file mode 100644
index 0000000..261b07f
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/NotificationSender.java
@@ -0,0 +1,204 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.interpreter;
+
+
+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.axis2.addressing.EndpointReference;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.net.URI;
+import java.util.Properties;
+
+public class NotificationSender {
+
+    protected WorkflowNotifier notifier;
+
+    protected String brokerURL;
+
+    protected String topic;
+
+    protected URI workflowID;
+
+    protected InvocationEntity initiator;
+
+    protected InvocationEntity receiver;
+
+    protected InvocationContext invocationContext;
+
+    protected EndpointReference eventSink;
+
+    protected WorkflowTrackingContext context;
+
+    /**
+     * Constructs a NotificationSender.
+     *
+     * @param brokerURL
+     * @param topic
+     */
+    public NotificationSender(URI brokerURL, String topic) {
+        this(brokerURL.toString(), topic);
+    }
+
+    /**
+     * Creates a NotificationSender.
+     *
+     * @param brokerURL The location of notification brokerUrl.
+     * @param topic     The notification topic.
+     */
+    public NotificationSender(String brokerURL, String topic) {
+        this.topic = topic;
+        this.brokerURL = brokerURL;
+        this.workflowID = URI.create(this.convertToJavaIdentifier(this.topic));
+        this.eventSink = new EndpointReference(this.brokerURL);
+        Properties props = new Properties();
+
+        this.notifier = NotifierFactory.createNotifier();
+        URI initiatorWorkflowID = null;
+        URI initiatorServiceID = URI.create(this.convertToJavaIdentifier(topic));
+        String initiatorWorkflowNodeID = null;
+        Integer initiatorWorkflowTimeStep = null;
+        this.context = this.notifier.createTrackingContext(props, brokerURL, initiatorWorkflowID,
+                initiatorServiceID, initiatorWorkflowNodeID, initiatorWorkflowTimeStep);
+        this.context.setTopic(topic);
+        this.initiator = this.notifier.createEntity(initiatorWorkflowID, initiatorServiceID, initiatorWorkflowNodeID,
+                initiatorWorkflowTimeStep);
+
+        URI receiverWorkflowID = this.workflowID;
+        URI receiverServiceID = this.workflowID;
+        String receiverWorkflowNodeID = null;
+        Integer receiverWorkflowTimeStep = null;
+        this.receiver = this.notifier.createEntity(receiverWorkflowID, receiverServiceID, receiverWorkflowNodeID,
+                receiverWorkflowTimeStep);
+    }
+
+    /**
+     * @return The event sink EPR.
+     */
+    public EndpointReference getEventSink() {
+        return this.eventSink;
+    }
+
+
+    public void workflowStarted(String message) {
+        this.invocationContext = this.notifier.workflowInvoked(this.context, this.initiator, message);
+    }
+
+
+    public void workflowFinished(String message) {
+        this.notifier.sendingResult(context, this.invocationContext, message);
+        this.notifier.workflowTerminated(context, this.workflowID, "Workflow finished successfully.");
+    }
+
+    public void sendingPartialResults(Object[] args, String[] keywords) {
+        String message = "";
+        for (int i = 0; i < args.length; i++) {
+            if (i != 0) {
+                message += ", ";
+            }
+            message += keywords[i] + "=" + args[i];
+        }
+        this.notifier.sendingResult(context, this.invocationContext, message);
+    }
+
+
+    public void workflowTerminated() {
+        this.notifier.workflowTerminated(context, this.workflowID, "Workflow finished successfully.");
+    }
+
+    /**
+     * Sends a START_INCOMPLETED notification message.
+     *
+     * @param message The message to send
+     */
+    public void workflowFailed(String message) {
+        workflowFailed(message, null);
+    }
+
+    /**
+     * Sends a START_INCOMPLETED notification message.
+     *
+     * @param e
+     */
+    public void workflowFailed(Throwable e) {
+        workflowFailed(null, e);
+    }
+
+    /**
+     * Sends a START_INCOMPLETED notification message.
+     *
+     * @param message The message to send
+     * @param e
+     */
+    public void workflowFailed(String message, Throwable e) {
+        this.notifier.sendingFault(context, this.invocationContext, message);
+    }
+
+    public void info(String message) {
+        this.notifier.info(context, message);
+    }
+
+    /**
+     * @param throwable
+     * @return The stackTrace in String
+     */
+    public static String getStackTraceInString(Throwable throwable) {
+        ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+        PrintStream printStream = new PrintStream(byteArrayOutputStream);
+        throwable.printStackTrace(printStream);
+        printStream.flush();
+        return byteArrayOutputStream.toString();
+    }
+
+    public static String convertToJavaIdentifier(String name) {
+
+        final char REPLACE_CHAR = '_';
+
+        if (name == null || name.length() == 0) {
+            return "" + REPLACE_CHAR;
+        }
+
+        StringBuilder buf = new StringBuilder();
+
+        char c = name.charAt(0);
+        if (!Character.isJavaIdentifierStart(c)) {
+            // Add _ at the beggining instead of replacing it to _. This is
+            // more readable if the name is like 3D_Model.
+            buf.append(REPLACE_CHAR);
+        }
+
+        for (int i = 0; i < name.length(); i++) {
+            c = name.charAt(i);
+            if (Character.isJavaIdentifierPart(c)) {
+                buf.append(c);
+            } else {
+                buf.append(REPLACE_CHAR);
+            }
+        }
+
+        return buf.toString();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/RegistryServiceTest.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/RegistryServiceTest.java b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/RegistryServiceTest.java
new file mode 100644
index 0000000..1361a44
--- /dev/null
+++ b/modules/xbaya-gui/src/test/java/org/apache/airavata/xbaya/interpreter/RegistryServiceTest.java
@@ -0,0 +1,105 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpreter;
+
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.schemas.gfac.ApplicationDeploymentDescriptionType;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.rules.MethodRule;
+import org.junit.rules.TestWatchman;
+import org.junit.runners.model.FrameworkMethod;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+//FIXME: Add tests for new registry. Airavata-592
+public class RegistryServiceTest {
+	@Rule
+	public ExpectedException exception = ExpectedException.none();
+
+	@Rule
+	public MethodRule watchman = new TestWatchman() {
+		public void starting(FrameworkMethod method) {
+			logger.info("{} being run...", method.getName());
+		}
+	};
+
+	final Logger logger = LoggerFactory.getLogger(RegistryServiceTest.class);
+
+	@Before
+	public void testExecute() throws RegistryException {
+
+	}
+
+	@After
+	public void cleanup() throws RegistryException {
+	}
+
+	private HostDescription createHostDescription() {
+		HostDescription host = new HostDescription();
+		host.getType().setHostName("localhost");
+		host.getType().setHostAddress("localhost");
+		return host;
+	}
+
+	private ServiceDescription createServiceDescription() {
+		ServiceDescription serv = new ServiceDescription();
+		serv.getType().setName("SimpleEcho");
+		return serv;
+	}
+
+	private ApplicationDescription createAppDeploymentDescription() {
+		ApplicationDescription appDesc = new ApplicationDescription();
+		ApplicationDeploymentDescriptionType app = appDesc.getType();
+		ApplicationDeploymentDescriptionType.ApplicationName name = ApplicationDeploymentDescriptionType.ApplicationName.Factory
+				.newInstance();
+		name.setStringValue("EchoLocal");
+		app.setApplicationName(name);
+		app.setExecutableLocation("/bin/echo");
+		app.setScratchWorkingDirectory("/tmp");
+		app.setStaticWorkingDirectory("/tmp");
+		app.setInputDataDirectory("/tmp/input");
+		app.setOutputDataDirectory("/tmp/output");
+		app.setStandardOutput("/tmp/echo.stdout");
+		app.setStandardError("/tmp/echo.stdout");
+		return appDesc;
+	}
+
+	@Test
+	public void getFromRegistry() throws RegistryException {
+	}
+
+	@Test
+	public void searchRegistry() throws RegistryException {
+	}
+
+	@Test
+	public void deleteFromRegistry() throws RegistryException {
+
+	}
+
+}


[72/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
new file mode 100644
index 0000000..f62f538
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/AiravataTreeNodeFactory.java
@@ -0,0 +1,112 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import javax.swing.tree.DefaultMutableTreeNode;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.model.registrybrowser.AiravataConfigurations;
+import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
+import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptions;
+import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURL;
+import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURLs;
+import org.apache.airavata.xbaya.model.registrybrowser.GFacURL;
+import org.apache.airavata.xbaya.model.registrybrowser.GFacURLs;
+import org.apache.airavata.xbaya.model.registrybrowser.HostDescriptions;
+import org.apache.airavata.xbaya.model.registrybrowser.InputParameters;
+import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURL;
+import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
+import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURL;
+import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURLs;
+import org.apache.airavata.xbaya.model.registrybrowser.OutputParameters;
+import org.apache.airavata.xbaya.model.registrybrowser.ServiceDescriptions;
+import org.apache.airavata.xbaya.model.registrybrowser.NodeParameter;
+import org.apache.airavata.xbaya.model.registrybrowser.ServiceParameters;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflow;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiment;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiments;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowNodeElement;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplate;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplates;
+
+public class AiravataTreeNodeFactory {
+	public static TreeNode getTreeNode(Object o,TreeNode parent){
+		if (o instanceof XBayaEngine){
+            return new RegistryNode((XBayaEngine)o,parent);
+        }else if (o instanceof AiravataConfigurations){
+			return new AiravataConfigurationsNode((AiravataConfigurations)o,parent);
+//		}else if (o instanceof GFacURLs){
+//			return new GFacURLsNode((GFacURLs)o,parent);
+		}else if (o instanceof GFacURL){
+			return new GFacURLNode((GFacURL)o,parent);
+		}else if (o instanceof InterpreterServiceURLs){
+			return new InterpreterServiceURLsNode((InterpreterServiceURLs)o,parent);
+		}else if (o instanceof InterpreterServiceURL){
+			return new InterpreterServiceURLNode((InterpreterServiceURL)o,parent);
+		}else if (o instanceof MessageBoxURLs){
+			return new MessageBoxURLsNode((MessageBoxURLs)o,parent);
+		}else if (o instanceof MessageBoxURL){
+			return new MessageBoxURLNode((MessageBoxURL)o,parent);
+		}else if (o instanceof EventingServiceURLs){
+			return new EventingServiceURLsNode((EventingServiceURLs)o,parent);
+		}else if (o instanceof EventingServiceURL){
+			return new EventingServiceURLNode((EventingServiceURL)o,parent);
+		}else if (o instanceof HostDescriptions){
+			return new HostDescriptionsNode((HostDescriptions)o,parent);
+		}else if (o instanceof HostDescription){
+			return new HostDescriptionNode((HostDescription)o,parent);
+		}else if (o instanceof ServiceDescriptions){
+			return new ServiceDescriptionsNode((ServiceDescriptions)o,parent);
+		}else if (o instanceof ServiceDescription){
+			return new ServiceDescriptionNode((ServiceDescription)o,parent);
+		}else if (o instanceof ApplicationDeploymentDescriptions){
+			return new ApplicationDeploymentDescriptionsNode((ApplicationDeploymentDescriptions)o,parent);
+		}else if (o instanceof ApplicationDeploymentDescriptionWrap){
+			return new ApplicationDeploymentDescriptionNode((ApplicationDeploymentDescriptionWrap)o,parent);
+		}else if (o instanceof XBayaWorkflowTemplates){
+			return new XBayaWorkflowTemplatesNode((XBayaWorkflowTemplates)o,parent);
+		}else if (o instanceof XBayaWorkflowTemplate){
+			return new XBayaWorkflowTemplateNode((XBayaWorkflowTemplate)o,parent);
+		}else if (o instanceof NodeParameter){
+			return new ParameterNode((NodeParameter)o,parent);
+		}else if (o instanceof InputParameters){
+			return new InputParametersNode((InputParameters)o,parent);
+		}else if (o instanceof OutputParameters){
+			return new OutputParametersNode((OutputParameters)o,parent);
+		}else if (o instanceof ServiceParameters){
+			return new ParametersNode((ServiceParameters)o,parent);
+		}else if (o instanceof XBayaWorkflowExperiments){
+			return new XBayaWorkflowExperimentsNode((XBayaWorkflowExperiments)o,parent);
+		}else if (o instanceof XBayaWorkflowExperiment){
+			return new XBayaWorkflowExperimentNode((XBayaWorkflowExperiment)o,parent);
+		}else if (o instanceof XBayaWorkflow){
+			return new XBayaWorkflowNode((XBayaWorkflow)o,parent);
+		}else if (o instanceof XBayaWorkflowNodeElement){
+			return new XBayaWorkflowNodeElementNode((XBayaWorkflowNodeElement)o,parent);
+		}else{
+			return new DefaultMutableTreeNode(o);
+		}
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
new file mode 100644
index 0000000..8a3d82a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionNode.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.ApplicationDescriptionDialog;
+
+public class ApplicationDeploymentDescriptionNode extends AbstractAiravataTreeNode {
+    private ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap;
+
+    public ApplicationDeploymentDescriptionNode(
+            ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap, TreeNode parent) {
+        super(parent);
+        setApplicationDeploymentDescriptionWrap(applicationDeploymentDescriptionWrap);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return emptyList();
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return getApplicationDeploymentDescriptionWrap().getDescription().getType().getApplicationName().getStringValue();
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.APPLICATION_ICON;
+    }
+
+    public ApplicationDeploymentDescriptionWrap getApplicationDeploymentDescriptionWrap() {
+        return applicationDeploymentDescriptionWrap;
+    }
+
+    public void setApplicationDeploymentDescriptionWrap(
+            ApplicationDeploymentDescriptionWrap applicationDeploymentDescriptionWrap) {
+        this.applicationDeploymentDescriptionWrap = applicationDeploymentDescriptionWrap;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(DeleteAction.ID);
+    }
+
+//    @Override
+//    public String getDefaultAction() {
+//    	return EditAction.ID;
+//    }
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(DeleteAction.ID)) {
+        	return deleteApplicationDescription(tree);
+        } else if (action.equals(EditAction.ID)) {
+        	return editDescriptor(tree);
+        }
+        return super.triggerAction(tree, action);
+    }
+
+	private boolean editDescriptor(JTree tree) {
+		ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(getXBayaEngine(),false,getApplicationDeploymentDescriptionWrap().getDescription(),getApplicationDeploymentDescriptionWrap().getHost(),getApplicationDeploymentDescriptionWrap().getService());
+		applicationDescriptionDialog.open();
+		if (applicationDescriptionDialog.isApplicationDescCreated()) {
+		    refresh();
+		    reloadTreeNode(tree, this);
+		}
+		return true;
+	}
+
+    private boolean deleteApplicationDescription(JTree tree) throws AiravataAPIInvocationException {
+        if (askQuestion("Application description",
+                "Are you sure that you want to remove the application description \""
+                        + getApplicationDeploymentDescriptionWrap().getDescription().getType().getApplicationName().getStringValue() + "\"?")) {
+            getRegistry().getApplicationManager().deleteApplicationDescription(getApplicationDeploymentDescriptionWrap().getService(),
+                    getApplicationDeploymentDescriptionWrap().getHost(),
+                    getApplicationDeploymentDescriptionWrap().getDescription().getType().getApplicationName().getStringValue());
+            ((AbstractAiravataTreeNode) getParent()).refresh();
+            reloadTreeNode(tree, getParent());
+        }
+        return true;
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(DeleteAction.ID)) {
+            return "Remove";
+        } else if (action.getID().equals(EditAction.ID)) {
+            return "View/Edit";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
new file mode 100644
index 0000000..5d58fe9
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ApplicationDeploymentDescriptionsNode.java
@@ -0,0 +1,139 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptionWrap;
+import org.apache.airavata.xbaya.model.registrybrowser.ApplicationDeploymentDescriptions;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.ApplicationDescriptionDialog;
+
+public class ApplicationDeploymentDescriptionsNode extends AbstractAiravataTreeNode {
+    private ApplicationDeploymentDescriptions applicationDeploymentDescriptions;
+
+    public ApplicationDeploymentDescriptionsNode(ApplicationDeploymentDescriptions applicationDeploymentDescriptions,
+            TreeNode parent) {
+        super(parent);
+        setApplicationDeploymentDescriptions(applicationDeploymentDescriptions);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        try {
+            return getTreeNodeList(getApplicationDeploymentDescriptions().getDescriptions().toArray(), this);
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();
+            return emptyList();
+        } catch (RegistryException e) {
+            e.printStackTrace();
+            return emptyList();
+        }
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return "Deployments";
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.APPLICATIONS_ICON;
+    }
+
+    public ApplicationDeploymentDescriptions getApplicationDeploymentDescriptions() {
+        return applicationDeploymentDescriptions;
+    }
+
+    public void setApplicationDeploymentDescriptions(ApplicationDeploymentDescriptions applicationDeploymentDescriptions) {
+        this.applicationDeploymentDescriptions = applicationDeploymentDescriptions;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(RefreshAction.ID, DeleteAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(DeleteAction.ID)) {
+            deleteApplicationDescription(tree);
+            return true;
+        } else if (action.equals(AddAction.ID)) {
+            ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(getXBayaEngine());
+            applicationDescriptionDialog.open();
+            if (applicationDescriptionDialog.isApplicationDescCreated()) {
+                refresh();
+                reloadTreeNode(tree, this);
+            }
+            return true;
+        }
+        return super.triggerAction(tree, action);
+    }
+
+    private void deleteApplicationDescription(JTree tree) throws Exception {
+        if (askQuestion("Application descriptions",
+                "Are you sure that you want to remove all application descriptions in this registry?")) {
+            AiravataAPI airavataAPI = getRegistry();
+            List<ApplicationDeploymentDescriptionWrap> descriptions = getApplicationDeploymentDescriptions()
+                    .getDescriptions();
+            for (ApplicationDeploymentDescriptionWrap descriptionWrap : descriptions) {
+                airavataAPI.getApplicationManager().removeApplicationDescriptor(descriptionWrap.getService(), descriptionWrap.getHost(),
+                        descriptionWrap.getDescription().getType().getApplicationName().getStringValue());
+            }
+            refresh();
+            reloadTreeNode(tree, this);
+        }
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(DeleteAction.ID)) {
+            return "Remove all applications";
+        } else if (action.getID().equals(AddAction.ID)) {
+            return "New application...";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java
new file mode 100644
index 0000000..f762efe
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLNode.java
@@ -0,0 +1,98 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURL;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
+
+public class EventingServiceURLNode extends AbstractAiravataTreeNode {
+    private EventingServiceURL eventingServiceURL;
+
+    public EventingServiceURLNode(EventingServiceURL eventingServiceURL, TreeNode parent) {
+        super(parent);
+        setEventingServiceURL(eventingServiceURL);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return emptyList();
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return getEventingServiceURL().getEventingServiceURL().toString();
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.GFAC_URL_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(CopyAction.ID);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+    	if (action.getID().equals(CopyAction.ID)) {
+            return "Copy to clipboard";
+        }
+    	return null;
+    }
+
+    @Override
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(CopyAction.ID)) {
+        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getEventingServiceURL().getEventingServiceURL().toString()), null);
+        }
+        return super.triggerAction(tree, action);
+    }
+    
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public EventingServiceURL getEventingServiceURL() {
+		return eventingServiceURL;
+	}
+
+	public void setEventingServiceURL(EventingServiceURL eventingServiceURL) {
+		this.eventingServiceURL = eventingServiceURL;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java
new file mode 100644
index 0000000..336e817
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/EventingServiceURLsNode.java
@@ -0,0 +1,91 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.xbaya.model.registrybrowser.EventingServiceURLs;
+import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+
+public class EventingServiceURLsNode extends AbstractAiravataTreeNode {
+    private EventingServiceURLs eventingServiceURLs;
+
+    public EventingServiceURLsNode(EventingServiceURLs eventingServiceURLs, TreeNode parent) {
+        super(parent);
+        setEventingServiceURLs(eventingServiceURLs);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        try {
+            return getTreeNodeList(getEventingServiceURLs().getURLS().toArray(), this);
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return "Eventing Services";
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.GFAC_URLS_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(RefreshAction.ID);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public EventingServiceURLs getEventingServiceURLs() {
+		return eventingServiceURLs;
+	}
+
+	public void setEventingServiceURLs(EventingServiceURLs eventingServiceURLs) {
+		this.eventingServiceURLs = eventingServiceURLs;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java
new file mode 100644
index 0000000..4270c29
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLNode.java
@@ -0,0 +1,98 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.GFacURL;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
+
+public class GFacURLNode extends AbstractAiravataTreeNode {
+    private GFacURL gfacURL;
+
+    public GFacURLNode(GFacURL gfacURL, TreeNode parent) {
+        super(parent);
+        setGfacURL(gfacURL);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return emptyList();
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return getGfacURL().getGfacURL().toString();
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.GFAC_URL_ICON;
+    }
+
+    public GFacURL getGfacURL() {
+        return gfacURL;
+    }
+
+    public void setGfacURL(GFacURL gfacURL) {
+        this.gfacURL = gfacURL;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(CopyAction.ID);
+    }
+
+    @Override
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(CopyAction.ID)) {
+        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getGfacURL().getGfacURL().toString()), null);
+        }
+        return super.triggerAction(tree, action);
+    }
+    
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+    	if (action.getID().equals(CopyAction.ID)) {
+            return "Copy to clipboard";
+        }
+    	return null;
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
new file mode 100644
index 0000000..97b18c7
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/GFacURLsNode.java
@@ -0,0 +1,91 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.xbaya.model.registrybrowser.GFacURLs;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+
+public class GFacURLsNode{
+//        extends AbstractAiravataTreeNode {
+//    private GFacURLs gfacURLs;
+//
+//    public GFacURLsNode(GFacURLs gfacURLs, TreeNode parent) {
+//        super(parent);
+//        setGfacURLs(gfacURLs);
+//    }
+//
+//    @Override
+//    protected List<TreeNode> getChildren() {
+//        try {
+//            return getTreeNodeList(getGfacURLs().getURLS().toArray(), this);
+//        } catch (AiravataAPIInvocationException e) {
+//            e.printStackTrace();
+//        }
+//        return null;
+//    }
+//
+//    @Override
+//    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+//        return "GFac Locations";
+//    }
+//
+//    @Override
+//    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+//        return JCRBrowserIcons.GFAC_URLS_ICON;
+//    }
+//
+//    public GFacURLs getGfacURLs() {
+//        return gfacURLs;
+//    }
+//
+//    public void setGfacURLs(GFacURLs gfacURLs) {
+//        this.gfacURLs = gfacURLs;
+//    }
+//
+//    @Override
+//    public List<String> getSupportedActions() {
+//        return Arrays.asList(RefreshAction.ID);
+//    }
+//
+//    @Override
+//    public String getActionCaption(AbstractBrowserActionItem action) {
+//        return action.getDefaultCaption();
+//    }
+//
+//    @Override
+//    public Icon getActionIcon(AbstractBrowserActionItem action) {
+//        return null;
+//    }
+//
+//    @Override
+//    public String getActionDescription(AbstractBrowserActionItem action) {
+//        return null;
+//    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
new file mode 100644
index 0000000..2fba319
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionNode.java
@@ -0,0 +1,127 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.EditAction;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.HostDescriptionDialog;
+
+public class HostDescriptionNode extends AbstractAiravataTreeNode {
+    private HostDescription hostDescription;
+
+    public HostDescriptionNode(HostDescription hostDescription, TreeNode parent) {
+        super(parent);
+        setHostDescription(hostDescription);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return emptyList();
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return getHostDescription().getType().getHostName();
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.HOST_ICON;
+    }
+
+    public HostDescription getHostDescription() {
+        return hostDescription;
+    }
+
+    public void setHostDescription(HostDescription hostDescription) {
+        this.hostDescription = hostDescription;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(EditAction.ID, DeleteAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(DeleteAction.ID)) {
+        	return deleteHostDescription(tree);
+        } else if (action.equals(EditAction.ID)) {
+            return editHostDescription(tree);
+        }
+        return super.triggerAction(tree, action);
+    }
+    
+    @Override
+    public String getDefaultAction() {
+    	return EditAction.ID;
+    }
+    
+	private boolean editHostDescription(JTree tree) {
+		HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getXBayaEngine().getConfiguration().getAiravataAPI(),false,getHostDescription(), null);
+		hostDescriptionDialog.open();
+		if (hostDescriptionDialog.isHostCreated()) {
+		    refresh();
+		    reloadTreeNode(tree, this);
+		}
+		return true;
+	}
+
+    private boolean deleteHostDescription(JTree tree) throws AiravataAPIInvocationException {
+        if (askQuestion("Host description", "Are you sure that you want to remove the host description \""
+                + getHostDescription().getType().getHostName() + "\"?")) {
+            getRegistry().getApplicationManager().deleteHostDescription(getHostDescription().getType().getHostName());
+            ((AbstractAiravataTreeNode) getParent()).refresh();
+            reloadTreeNode(tree, getParent());
+        }
+        return true;
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(DeleteAction.ID)) {
+            return "Remove";
+        } else if (action.getID().equals(EditAction.ID)) {
+            return "View/Edit";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
new file mode 100644
index 0000000..525c15b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/HostDescriptionsNode.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.xbaya.model.registrybrowser.HostDescriptions;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.AddAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.DeleteAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+import org.apache.airavata.xbaya.ui.dialogs.descriptors.HostDescriptionDialog;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+public class HostDescriptionsNode extends AbstractAiravataTreeNode {
+    private HostDescriptions hostDescriptions;
+
+    public HostDescriptionsNode(HostDescriptions hostDescriptions, TreeNode parent) {
+        super(parent);
+        setHostDescriptions(hostDescriptions);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        try {
+            return getTreeNodeList(getHostDescriptions().getDescriptions().toArray(), this);
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();
+            return emptyList();
+        }
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return "Hosts";
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.HOSTS_ICON;
+    }
+
+    public HostDescriptions getHostDescriptions() {
+        return hostDescriptions;
+    }
+
+    public void setHostDescriptions(HostDescriptions hostDescriptions) {
+        this.hostDescriptions = hostDescriptions;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(AddAction.ID, RefreshAction.ID, DeleteAction.ID);
+    }
+
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(DeleteAction.ID)) {
+            deleteHostDescription(tree);
+            return true;
+        } else if (action.equals(AddAction.ID)) {
+            HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getXBayaEngine().getConfiguration().getAiravataAPI(), null);
+            hostDescriptionDialog.open();
+            if (hostDescriptionDialog.isHostCreated()) {
+                refresh();
+                reloadTreeNode(tree, this);
+            }
+            return true;
+        }
+        return super.triggerAction(tree, action);
+    }
+
+    private void deleteHostDescription(JTree tree) throws Exception {
+        if (askQuestion("Host descriptions",
+                "Are you sure that you want to remove all host descriptions in this registry?")) {
+            AiravataAPI registry = getRegistry();
+            List<HostDescription> descriptions = getHostDescriptions().getDescriptions();
+            for (HostDescription descriptionWrap : descriptions) {
+                registry.getApplicationManager().removeHostDescriptor(descriptionWrap.getType().getHostName());
+            }
+            refresh();
+            reloadTreeNode(tree, this);
+        }
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        if (action.getID().equals(DeleteAction.ID)) {
+            return "Remove all hosts";
+        } else if (action.getID().equals(AddAction.ID)) {
+            return "New host...";
+        }
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java
new file mode 100644
index 0000000..4116fcb
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InputParametersNode.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import javax.swing.Icon;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.InputParameters;
+
+public class InputParametersNode extends ParametersNode {
+
+	public InputParametersNode(InputParameters parameters, TreeNode parent) {
+		super(parameters, parent);
+	}
+
+	@Override
+	public String getCaption(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		return "Input";
+	}
+	
+	@Override
+	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		return JCRBrowserIcons.INPUT_PARAMETERS_ICON;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java
new file mode 100644
index 0000000..eb595e7
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLNode.java
@@ -0,0 +1,98 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURL;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
+
+public class InterpreterServiceURLNode extends AbstractAiravataTreeNode {
+    private InterpreterServiceURL interpreterServiceURL;
+
+    public InterpreterServiceURLNode(InterpreterServiceURL interpreterServiceURL, TreeNode parent) {
+        super(parent);
+        setInterpreterServiceURL(interpreterServiceURL);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return emptyList();
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return getInterpreterServiceURL().getInterpreterServiceURL().toString();
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.GFAC_URL_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(CopyAction.ID);
+    }
+
+    @Override
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(CopyAction.ID)) {
+        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getInterpreterServiceURL().getInterpreterServiceURL().toString()), null);
+        }
+        return super.triggerAction(tree, action);
+    }
+    
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+    	if (action.getID().equals(CopyAction.ID)) {
+            return "Copy to clipboard";
+        }
+    	return null;
+	}
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public InterpreterServiceURL getInterpreterServiceURL() {
+		return interpreterServiceURL;
+	}
+
+	public void setInterpreterServiceURL(InterpreterServiceURL interpreterServiceURL) {
+		this.interpreterServiceURL = interpreterServiceURL;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java
new file mode 100644
index 0000000..1835dde
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/InterpreterServiceURLsNode.java
@@ -0,0 +1,90 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.xbaya.model.registrybrowser.InterpreterServiceURLs;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+
+public class InterpreterServiceURLsNode extends AbstractAiravataTreeNode {
+    private InterpreterServiceURLs interpreterServiceURLs;
+
+    public InterpreterServiceURLsNode(InterpreterServiceURLs interpreterServiceURLs, TreeNode parent) {
+        super(parent);
+        setInterpreterServiceURLs(interpreterServiceURLs);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        try {
+            return getTreeNodeList(getInterpreterServiceURLs().getURLS().toArray(), this);
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return "Interpreter Servers";
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.GFAC_URLS_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(RefreshAction.ID);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public InterpreterServiceURLs getInterpreterServiceURLs() {
+		return interpreterServiceURLs;
+	}
+
+	public void setInterpreterServiceURLs(InterpreterServiceURLs interpreterServiceURLs) {
+		this.interpreterServiceURLs = interpreterServiceURLs;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java
new file mode 100644
index 0000000..17b7be2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/JCRBrowserIcons.java
@@ -0,0 +1,50 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import javax.swing.Icon;
+
+import org.apache.airavata.common.utils.SwingUtil;
+
+public class JCRBrowserIcons {
+	public static final Icon APPLICATION_ICON=SwingUtil.createImageIcon("application.png");
+	public static final Icon APPLICATIONS_ICON=SwingUtil.createImageIcon("applications.png");
+	public static final Icon REGISTRY_ICON=SwingUtil.createImageIcon("jcr-repo.png");
+	public static final Icon AIRAVATA_CONFIG_ICON=SwingUtil.createImageIcon("airavata-config.png");
+	public static final Icon GFAC_URLS_ICON=SwingUtil.createImageIcon("gfac_urls.png");
+	public static final Icon GFAC_URL_ICON=SwingUtil.createImageIcon("gfac_url.png");
+	public static final Icon HOST_ICON=SwingUtil.createImageIcon("host.png");
+	public static final Icon HOSTS_ICON=SwingUtil.createImageIcon("hosts.png");
+	public static final Icon INPUT_PARAMETERS_ICON=SwingUtil.createImageIcon("input_para.png");
+	public static final Icon OUTPUT_PARAMETERS_ICON=SwingUtil.createImageIcon("output_para.png");
+	public static final Icon PARAMETER_ICON=SwingUtil.createImageIcon("parameter.png");
+	public static final Icon PARAMETERS_ICON=SwingUtil.createImageIcon("parameter.png");
+	public static final Icon PARAMETER_VALUE_ICON=SwingUtil.createImageIcon("parameter.png");
+	public static final Icon SERVICE_ICON=SwingUtil.createImageIcon("service.png");
+	public static final Icon SERVICES_ICON=SwingUtil.createImageIcon("services.png");
+	public static final Icon WORKFLOW_EXPERIMENT_ICON=SwingUtil.createImageIcon("experiment.png");
+	public static final Icon WORKFLOW_EXPERIMENTS_ICON=SwingUtil.createImageIcon("experiments.png");
+	public static final Icon WORKFLOW_ICON=SwingUtil.createImageIcon("workflow.png");
+	public static final Icon WORKFLOW_SERVICE_ICON=SwingUtil.createImageIcon("service.png");
+	public static final Icon WORKFLOW_TEMPLATE_ICON=SwingUtil.createImageIcon("workflow.png");
+	public static final Icon WORKFLOW_TEMPLATES_ICON=SwingUtil.createImageIcon("workflow_templates.png");
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java
new file mode 100644
index 0000000..23a9c37
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLNode.java
@@ -0,0 +1,98 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURL;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
+
+public class MessageBoxURLNode extends AbstractAiravataTreeNode {
+    private MessageBoxURL messageBoxURL;
+
+    public MessageBoxURLNode(MessageBoxURL messageBoxURL, TreeNode parent) {
+        super(parent);
+        setMessageBoxURL(messageBoxURL);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        return emptyList();
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return getMessageBoxURL().getMessageBoxURL().toString();
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.GFAC_URL_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(CopyAction.ID);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+    	if (action.getID().equals(CopyAction.ID)) {
+            return "Copy to clipboard";
+        }
+    	return null;
+    }
+
+    @Override
+    public boolean triggerAction(JTree tree, String action) throws Exception {
+        if (action.equals(CopyAction.ID)) {
+        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(getMessageBoxURL().getMessageBoxURL().toString()), null);
+        }
+        return super.triggerAction(tree, action);
+    }
+    
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public MessageBoxURL getMessageBoxURL() {
+		return messageBoxURL;
+	}
+
+	public void setMessageBoxURL(MessageBoxURL messageBoxURL) {
+		this.messageBoxURL = messageBoxURL;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java
new file mode 100644
index 0000000..5f521d3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/MessageBoxURLsNode.java
@@ -0,0 +1,90 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.xbaya.model.registrybrowser.MessageBoxURLs;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+
+public class MessageBoxURLsNode extends AbstractAiravataTreeNode {
+    private MessageBoxURLs messageBoxURLs;
+
+    public MessageBoxURLsNode(MessageBoxURLs messageBoxURLs, TreeNode parent) {
+        super(parent);
+        setMessageBoxURLs(messageBoxURLs);
+    }
+
+    @Override
+    protected List<TreeNode> getChildren() {
+        try {
+            return getTreeNodeList(getMessageBoxURLs().getURLS().toArray(), this);
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return "Message Boxes";
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.GFAC_URLS_ICON;
+    }
+
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(RefreshAction.ID);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+	public MessageBoxURLs getMessageBoxURLs() {
+		return messageBoxURLs;
+	}
+
+	public void setMessageBoxURLs(MessageBoxURLs messageBoxURLs) {
+		this.messageBoxURLs = messageBoxURLs;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java
new file mode 100644
index 0000000..bed1a70
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/OutputParametersNode.java
@@ -0,0 +1,46 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import javax.swing.Icon;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.OutputParameters;
+
+public class OutputParametersNode extends ParametersNode {
+
+	public OutputParametersNode(OutputParameters parameters, TreeNode parent) {
+		super(parameters, parent);
+	}
+
+	@Override
+	public String getCaption(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		return "Output";
+	}
+	
+	@Override
+	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		return JCRBrowserIcons.OUTPUT_PARAMETERS_ICON;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
new file mode 100644
index 0000000..5ce637f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterNode.java
@@ -0,0 +1,136 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.awt.Toolkit;
+import java.awt.datatransfer.StringSelection;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.common.utils.BrowserLauncher;
+import org.apache.airavata.xbaya.model.registrybrowser.NodeParameter;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.BrowserAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.CopyAction;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.ViewAction;
+import org.apache.airavata.xbaya.ui.dialogs.TextWindow;
+
+public class ParameterNode extends AbstractAiravataTreeNode {
+	private NodeParameter parameter;
+	
+	public ParameterNode(NodeParameter parameter, TreeNode parent) {
+		super(parent);
+		setParameter(parameter);
+	}
+
+	@Override
+	protected List<TreeNode> getChildren() {
+		return emptyList();
+	}
+
+	@Override
+	public String getCaption(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		if (getParameter().getValue()!=null){
+			String parameterValue = getParameter().getValue().toString();
+			if (parameterValue.length()>200){
+				parameterValue=parameterValue.substring(0, 200)+"...";
+			}
+			return wrapAsHtml("<b>"+getParameter().getName()+"</b>",": ",""+parameterValue+"");
+		}else{
+			return getParameter().getName();
+		}
+	}
+
+	@Override
+	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		return JCRBrowserIcons.PARAMETER_ICON;
+	}
+
+	@Override
+	public String getDefaultAction() {
+		return ViewAction.ID;
+	}
+	
+    @Override
+    public List<String> getSupportedActions() {
+        try {
+			new URL(getParameter().getValue().toString());
+			return Arrays.asList(ViewAction.ID,CopyAction.ID,BrowserAction.ID);
+		} catch (MalformedURLException e) {
+			//the content is not a proper url
+			return Arrays.asList(ViewAction.ID,CopyAction.ID);
+		}
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+    	if (action.getID().equals(ViewAction.ID)) {
+    		return "View";
+    	} else if (action.getID().equals(CopyAction.ID)) {
+            return "Copy to clipboard";
+    	} else if (action.getID().equals(BrowserAction.ID)) {
+            return "Open in web browser...";
+        }
+    	return null;
+    }
+    
+	public boolean triggerAction(JTree tree,String action) throws Exception{
+		String value = getParameter().getValue().toString();
+		if (action.equals(ViewAction.ID)) {
+			TextWindow textWindow = new TextWindow(getXBayaEngine(), getParameter().getName(), value,"Parameter Content");
+			textWindow.show();
+		} else if (action.equals(CopyAction.ID)) {
+        	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(value), null);
+		} else if (action.equals(BrowserAction.ID)) {
+			BrowserLauncher.openURL(getParameter().getValue().toString());
+        } 
+		return super.triggerAction(tree, action);
+	}
+
+	@Override
+	public Icon getActionIcon(AbstractBrowserActionItem action) {
+		return null;
+	}
+
+	@Override
+	public String getActionDescription(AbstractBrowserActionItem action) {
+		return null;
+	}
+
+	public NodeParameter getParameter() {
+		return parameter;
+	}
+
+	public void setParameter(NodeParameter parameter) {
+		this.parameter = parameter;
+	}
+}
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterValueNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterValueNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterValueNode.java
new file mode 100644
index 0000000..38a7d16
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParameterValueNode.java
@@ -0,0 +1,90 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.schemas.gfac.Parameter;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class ParameterValueNode extends AbstractAiravataTreeNode {
+	private Parameter parameter;
+	
+	public ParameterValueNode(Parameter parameter, TreeNode parent) {
+		super(parent);
+		setParameter(parameter);
+	}
+
+	@Override
+	protected List<TreeNode> getChildren() {
+		return emptyList();
+	}
+
+	@Override
+	public String getCaption(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		return getParameter().getParameterName();
+	}
+
+	@Override
+	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		return JCRBrowserIcons.PARAMETER_VALUE_ICON;
+	}
+
+	@Override
+	public List<String> getSupportedActions() {
+		return Arrays.asList();
+	}
+
+	public boolean triggerAction(JTree tree,String action) throws Exception{
+		return super.triggerAction(tree, action);
+	}
+
+	@Override
+	public String getActionCaption(AbstractBrowserActionItem action) {
+		return action.getDefaultCaption();
+	}
+
+	@Override
+	public Icon getActionIcon(AbstractBrowserActionItem action) {
+		return null;
+	}
+
+	@Override
+	public String getActionDescription(AbstractBrowserActionItem action) {
+		return null;
+	}
+
+	public Parameter getParameter() {
+		return parameter;
+	}
+
+	public void setParameter(Parameter parameter) {
+		this.parameter = parameter;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParametersNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParametersNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParametersNode.java
new file mode 100644
index 0000000..33e409a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/ParametersNode.java
@@ -0,0 +1,90 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.JTree;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.xbaya.model.registrybrowser.ServiceParameters;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+
+public class ParametersNode extends AbstractAiravataTreeNode {
+	private ServiceParameters parametersList;
+	public ParametersNode(ServiceParameters parameters,TreeNode parent) {
+		super(parent);
+		setParametersList(parameters);
+	}
+
+	@Override
+	protected List<TreeNode> getChildren() {
+		return getTreeNodeList(getParametersList().getParameters().toArray(), this);
+	}
+
+	@Override
+	public String getCaption(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		return "Parameters";
+	}
+
+	@Override
+	public Icon getIcon(boolean selected, boolean expanded, boolean leaf,
+			boolean hasFocus) {
+		return JCRBrowserIcons.PARAMETERS_ICON;
+	}
+
+	@Override
+	public List<String> getSupportedActions() {
+		return Arrays.asList();
+	}
+	
+	public boolean triggerAction(JTree tree,String action) throws Exception{
+		return super.triggerAction(tree, action);
+	}
+
+	@Override
+	public String getActionCaption(AbstractBrowserActionItem action) {
+		return action.getDefaultCaption();
+	}
+
+	@Override
+	public Icon getActionIcon(AbstractBrowserActionItem action) {
+		return null;
+	}
+
+	@Override
+	public String getActionDescription(AbstractBrowserActionItem action) {
+		return null;
+	}
+
+	public ServiceParameters getParametersList() {
+		return parametersList;
+	}
+
+	public void setParametersList(ServiceParameters parametersList) {
+		this.parametersList = parametersList;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java
new file mode 100644
index 0000000..09af7c8
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryNode.java
@@ -0,0 +1,130 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.swing.Icon;
+import javax.swing.tree.TreeNode;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.model.registrybrowser.AiravataConfigurations;
+import org.apache.airavata.xbaya.model.registrybrowser.HostDescriptions;
+import org.apache.airavata.xbaya.model.registrybrowser.ServiceDescriptions;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowExperiments;
+import org.apache.airavata.xbaya.model.registrybrowser.XBayaWorkflowTemplates;
+import org.apache.airavata.xbaya.ui.actions.AbstractBrowserActionItem;
+import org.apache.airavata.xbaya.ui.actions.registry.browser.RefreshAction;
+
+public class RegistryNode extends AbstractAiravataTreeNode {
+    private AiravataAPI registry;
+    private XBayaEngine engine;
+
+    public RegistryNode(XBayaEngine engine, TreeNode parent) {
+        super(parent);
+        setRegistry(engine.getConfiguration().getAiravataAPI());
+        this.engine=engine;
+    }
+
+    protected List<TreeNode> getChildren() {
+        List<Object> children = new ArrayList<Object>();
+        AiravataConfigurations airavataConfigurations = new AiravataConfigurations(getRegistry());
+        children.add(airavataConfigurations);
+        HostDescriptions hostDescriptions = new HostDescriptions(getRegistry());
+        children.add(hostDescriptions);
+        ServiceDescriptions serviceDescriptions = new ServiceDescriptions(getRegistry());
+        children.add(serviceDescriptions);
+//        ApplicationDeploymentDescriptions applicationDeploymentDescriptions = new ApplicationDeploymentDescriptions(
+//                getRegistry());
+//        children.add(applicationDeploymentDescriptions);
+        XBayaWorkflowTemplates xBayaWorkflows = new XBayaWorkflowTemplates(getRegistry());
+        children.add(xBayaWorkflows);
+        XBayaWorkflowExperiments xBayaWorkflowExperiments = new XBayaWorkflowExperiments(getRegistry());
+        children.add(xBayaWorkflowExperiments);
+        return getTreeNodeList(children.toArray(), this);
+    }
+
+    public AiravataAPI getRegistry() {
+        return registry;
+    }
+
+    public void setRegistry(AiravataAPI registry) {
+        this.registry = registry;
+    }
+
+    @Override
+    public String getCaption(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        try {
+            return getRegistry().getAiravataManager().getGateway().getGatewayName() + " - " + getRegistry().getAiravataManager().getUser().getUserName();
+        } catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    @Override
+    public Icon getIcon(boolean selected, boolean expanded, boolean leaf, boolean hasFocus) {
+        return JCRBrowserIcons.REGISTRY_ICON;
+    }
+
+    // @Override
+    // public void refresh() {
+    // List<TreeNode> children = getChildren();
+    // for (TreeNode node : children) {
+    // if (node instanceof AbstractAiravataTreeNode){
+    // ((AbstractAiravataTreeNode)node).refresh();
+    // }
+    // }
+    // }
+    @Override
+    public List<String> getSupportedActions() {
+        return Arrays.asList(RefreshAction.ID);
+    }
+
+    @Override
+    public String getActionCaption(AbstractBrowserActionItem action) {
+        return action.getDefaultCaption();
+    }
+
+    @Override
+    public Icon getActionIcon(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    @Override
+    public String getActionDescription(AbstractBrowserActionItem action) {
+        return null;
+    }
+
+    public XBayaEngine getEngine() {
+        return engine;
+    }
+
+    public void setEngine(XBayaEngine engine) {
+        this.engine = engine;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryTreeCellRenderer.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryTreeCellRenderer.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryTreeCellRenderer.java
new file mode 100644
index 0000000..fe3baac
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/registrybrowser/nodes/RegistryTreeCellRenderer.java
@@ -0,0 +1,43 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.registrybrowser.nodes;
+
+import java.awt.Component;
+
+import javax.swing.JTree;
+import javax.swing.tree.DefaultTreeCellRenderer;
+import javax.swing.tree.TreeCellRenderer;
+
+public class RegistryTreeCellRenderer implements TreeCellRenderer {
+
+    @Override
+    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded,
+            boolean leaf, int row, boolean hasFocus) {
+        if (value instanceof AbstractAiravataTreeNode) {
+            AbstractAiravataTreeNode node = (AbstractAiravataTreeNode) value;
+            return node.getNodeComponent(tree, value, selected, expanded, leaf, row, hasFocus);
+        }
+        return new DefaultTreeCellRenderer().getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row,
+                hasFocus);
+    }
+
+}


[31/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/MyHttpServletRequest.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/MyHttpServletRequest.java b/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/MyHttpServletRequest.java
deleted file mode 100644
index 4c800f6..0000000
--- a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/MyHttpServletRequest.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security;
-
-import javax.servlet.*;
-import javax.servlet.http.*;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.security.Principal;
-import java.util.*;
-
-/**
- * Test servlet implementation. For test cases only.
- */
-public class MyHttpServletRequest implements HttpServletRequest {
-
-    private Map<String, String> headers = new HashMap<String, String>();
-
-    public void addHeader(String name, String value) {
-        headers.put(name, value);
-    }
-
-    @Override
-    public String getAuthType() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Cookie[] getCookies() {
-        return new Cookie[0]; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public long getDateHeader(String s) {
-        return 0; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getHeader(String s) {
-        return headers.get(s);
-    }
-
-    @Override
-    public Enumeration<String> getHeaders(String s) {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Enumeration<String> getHeaderNames() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public int getIntHeader(String s) {
-        return 0; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getMethod() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getPathInfo() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getPathTranslated() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getContextPath() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getQueryString() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getRemoteUser() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isUserInRole(String s) {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Principal getUserPrincipal() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getRequestedSessionId() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getRequestURI() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public StringBuffer getRequestURL() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getServletPath() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public HttpSession getSession(boolean b) {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public HttpSession getSession() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isRequestedSessionIdValid() {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isRequestedSessionIdFromCookie() {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isRequestedSessionIdFromURL() {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isRequestedSessionIdFromUrl() {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean authenticate(HttpServletResponse httpServletResponse) throws IOException, ServletException {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void login(String s, String s1) throws ServletException {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void logout() throws ServletException {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Collection<Part> getParts() throws IOException, ServletException {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Part getPart(String s) throws IOException, ServletException {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Object getAttribute(String s) {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Enumeration<String> getAttributeNames() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getCharacterEncoding() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void setCharacterEncoding(String s) throws UnsupportedEncodingException {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public int getContentLength() {
-        return 0; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getContentType() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public ServletInputStream getInputStream() throws IOException {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getParameter(String s) {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Enumeration<String> getParameterNames() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String[] getParameterValues(String s) {
-        return new String[0]; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Map<String, String[]> getParameterMap() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getProtocol() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getScheme() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getServerName() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public int getServerPort() {
-        return 0; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public BufferedReader getReader() throws IOException {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getRemoteAddr() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getRemoteHost() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void setAttribute(String s, Object o) {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public void removeAttribute(String s) {
-        // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Locale getLocale() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public Enumeration<Locale> getLocales() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isSecure() {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public RequestDispatcher getRequestDispatcher(String s) {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getRealPath(String s) {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public int getRemotePort() {
-        return 0; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getLocalName() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public String getLocalAddr() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public int getLocalPort() {
-        return 0; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public ServletContext getServletContext() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public AsyncContext startAsync() throws IllegalStateException {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public AsyncContext startAsync(ServletRequest servletRequest, ServletResponse servletResponse)
-            throws IllegalStateException {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isAsyncStarted() {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public boolean isAsyncSupported() {
-        return false; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public AsyncContext getAsyncContext() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-
-    @Override
-    public DispatcherType getDispatcherType() {
-        return null; // To change body of implemented methods use File | Settings | File Templates.
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticatorTest.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticatorTest.java b/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticatorTest.java
deleted file mode 100644
index 597894d..0000000
--- a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/basic/BasicAccessAuthenticatorTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security.basic;
-
-import org.apache.airavata.common.utils.Constants;
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.apache.airavata.security.configurations.AuthenticatorConfigurationReader;
-import org.apache.airavata.services.registry.rest.security.AbstractAuthenticatorTest;
-import org.apache.airavata.services.registry.rest.security.MyHttpServletRequest;
-import org.apache.airavata.services.registry.rest.security.session.SessionAuthenticator;
-import org.apache.commons.codec.binary.Base64;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Test class for basic access authenticator.
- */
-public class BasicAccessAuthenticatorTest extends AbstractAuthenticatorTest {
-
-    private SessionAuthenticator sessionAuthenticator;
-
-    private AuthenticatorConfigurationReader authenticatorConfigurationReader;
-
-    public BasicAccessAuthenticatorTest() throws Exception {
-        super("basicAccessAuthenticator");
-    }
-
-    @BeforeClass
-    public static void setUpDatabase() throws Exception {
-        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
-
-        waitTillServerStarts();
-
-        String createTable = "create table AIRAVATA_USER ( USERID varchar(255), PASSWORD varchar(255) )";
-        executeSQL(createTable);
-
-        String insertSQL = "INSERT INTO AIRAVATA_USER VALUES('amilaj', 'secret')";
-        executeSQL(insertSQL);
-
-    }
-
-    @AfterClass
-    public static void shutDownDatabase() throws Exception {
-        DerbyUtil.stopDerbyServer();
-    }
-
-    @Override
-    public void testAuthenticateSuccess() throws Exception {
-
-        Assert.assertTrue(authenticator.authenticate(getRequest("amilaj:secret")));
-    }
-
-    @Override
-    public void testAuthenticateFail() throws Exception {
-        Assert.assertFalse(authenticator.authenticate(getRequest("amilaj:secret1")));
-    }
-
-    @Test
-    public void testAuthenticateFailUserName() throws Exception {
-        Assert.assertFalse(authenticator.authenticate(getRequest("amila:secret1")));
-    }
-
-    @Override
-    public void testCanProcess() throws Exception {
-
-        Assert.assertTrue(authenticator.canProcess(getRequest("amilaj:secret")));
-    }
-
-    private MyHttpServletRequest getRequest(String userPassword) {
-        MyHttpServletRequest myHttpServletRequest = new MyHttpServletRequest();
-
-        String authHeader = "Basic " + new String(Base64.encodeBase64(userPassword.getBytes()));
-
-        myHttpServletRequest.addHeader("Authorization", authHeader);
-        myHttpServletRequest.addHeader(Constants.GATEWAY_NAME, "default");
-
-        return myHttpServletRequest;
-
-    }
-
-    public void tearDown() throws Exception {
-
-    }
-
-    /*
-     * public void testConfigure() throws Exception {
-     * 
-     * BasicAccessAuthenticator basicAccessAuthenticator = (BasicAccessAuthenticator)authenticator;
-     * 
-     * assertEquals("AIRAVATA_USER", basicAccessAuthenticator.getUserTable()); assertEquals("USERID",
-     * basicAccessAuthenticator.getUserNameColumn()); assertEquals("PASSWORD",
-     * basicAccessAuthenticator.getPasswordColumn()); }
-     */
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/local/LocalUserStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/local/LocalUserStoreTest.java b/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/local/LocalUserStoreTest.java
deleted file mode 100644
index a371c7b..0000000
--- a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/local/LocalUserStoreTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security.local;
-
-import org.apache.airavata.common.utils.DBUtil;
-import org.apache.airavata.common.utils.DatabaseTestCases;
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.junit.*;
-
-import java.util.List;
-
-/**
- * A test class for local user store.
- */
-public class LocalUserStoreTest extends DatabaseTestCases {
-
-    private LocalUserStore localUserStore;
-
-    private static final String createTableScript = "create table Users\n" + "(\n"
-            + "        user_name varchar(255),\n" + "        password varchar(255),\n"
-            + "        PRIMARY KEY(user_name)\n" + ")";
-
-    @BeforeClass
-    public static void setUpDatabase() throws Exception {
-        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
-
-        waitTillServerStarts();
-
-        executeSQL(createTableScript);
-
-    }
-
-    @AfterClass
-    public static void shutDownDatabase() throws Exception {
-        DerbyUtil.stopDerbyServer();
-    }
-
-    @Before
-    public void setUp() throws Exception {
-
-        DBUtil dbUtil = new DBUtil(getJDBCUrl(), getUserName(), getPassword(), getDriver());
-
-        localUserStore = new LocalUserStore(dbUtil);
-    }
-
-    @Test
-    public void testAddUser() throws Exception {
-
-        localUserStore.addUser("thejaka", "qwqwqw");
-
-        List<String> users = localUserStore.getUsers();
-        Assert.assertEquals(1, users.size());
-        Assert.assertEquals("thejaka", users.get(0));
-
-        localUserStore.deleteUser("thejaka");
-
-    }
-
-    @Test
-    public void testChangePassword() throws Exception {
-
-        localUserStore.addUser("thejaka", "qwqwqw");
-
-        localUserStore.changePassword("thejaka", "qwqwqw", "sadsad");
-
-        localUserStore.deleteUser("thejaka");
-    }
-
-    @Test
-    public void testChangePasswordByAdmin() throws Exception {
-
-        localUserStore.addUser("thejaka", "qwqwqw");
-
-        localUserStore.changePasswordByAdmin("thejaka", "sadsad");
-
-        localUserStore.deleteUser("thejaka");
-    }
-
-    @Test
-    public void testDeleteUser() throws Exception {
-
-        localUserStore.addUser("thejaka", "qwqwqw");
-
-        List<String> users = localUserStore.getUsers();
-        Assert.assertEquals(1, users.size());
-        Assert.assertEquals("thejaka", users.get(0));
-
-        localUserStore.deleteUser("thejaka");
-
-        users = localUserStore.getUsers();
-        Assert.assertEquals(0, users.size());
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/session/SessionAuthenticatorTest.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/session/SessionAuthenticatorTest.java b/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/session/SessionAuthenticatorTest.java
deleted file mode 100644
index 6be81b4..0000000
--- a/modules/rest/service/src/test/java/org/apache/airavata/services/registry/rest/security/session/SessionAuthenticatorTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.security.session;
-
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.apache.airavata.services.registry.rest.security.AbstractAuthenticatorTest;
-import org.apache.airavata.services.registry.rest.security.MyHttpServletRequest;
-import org.junit.AfterClass;
-import org.junit.Assert;
-import org.junit.BeforeClass;
-
-/**
- * Session authenticator test.
- */
-public class SessionAuthenticatorTest extends AbstractAuthenticatorTest {
-
-    public SessionAuthenticatorTest() throws Exception {
-        super("sessionAuthenticator");
-    }
-
-    @BeforeClass
-    public static void setUpDatabase() throws Exception {
-        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
-
-        waitTillServerStarts();
-
-        String createSessionTable = "create table Persons ( sessionId varchar(255) )";
-        executeSQL(createSessionTable);
-
-        String insertSessionSQL = "INSERT INTO Persons VALUES('1234')";
-        executeSQL(insertSessionSQL);
-    }
-
-    @AfterClass
-    public static void shutDownDatabase() throws Exception {
-        DerbyUtil.stopDerbyServer();
-    }
-
-    public void testAuthenticateSuccess() throws Exception {
-
-        MyHttpServletRequest servletRequestRequest = new MyHttpServletRequest();
-        servletRequestRequest.addHeader("sessionTicket", "1234");
-
-        Assert.assertTrue(authenticator.authenticate(servletRequestRequest));
-
-    }
-
-    public void testAuthenticateFail() throws Exception {
-
-        MyHttpServletRequest servletRequestRequest = new MyHttpServletRequest();
-        servletRequestRequest.addHeader("sessionTicket", "12345");
-
-        Assert.assertFalse(authenticator.authenticate(servletRequestRequest));
-
-    }
-
-    public void testCanProcess() throws Exception {
-
-        MyHttpServletRequest servletRequestRequest = new MyHttpServletRequest();
-        servletRequestRequest.addHeader("sessionTicket", "12345");
-
-        Assert.assertTrue(authenticator.canProcess(servletRequestRequest));
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/test/resources/authenticators.xml
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/test/resources/authenticators.xml b/modules/rest/service/src/test/resources/authenticators.xml
deleted file mode 100644
index 7d9d2bd..0000000
--- a/modules/rest/service/src/test/resources/authenticators.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
-    contributor license agreements. See the NOTICE file ~ distributed with this
-    work for additional information ~ regarding copyright ownership. The ASF
-    licenses this file ~ to you under the Apache License, Version 2.0 (the ~
-    "License"); you may not use this file except in compliance ~ with the License.
-    You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
-    ~ ~ Unless required by applicable law or agreed to in writing, ~ software
-    distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
-    WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
-    License for the ~ specific language governing permissions and limitations
-    ~ under the License. -->
-
-<!--
-This file contains a sample authenticator configuration. We can define all authenticators in this file. Each authenticator
-configuration has to start with tag "authenticator". The name is the name given to the authenticator. The actual
-authenticator implementation is implemented in the class. There are configurations specific to authenticators.
-Those configurations are reside inside &lt;specificConfigurations&gt; tags.
--->
-
-<authenticators>
-    <authenticator name="sessionAuthenticator" class="org.apache.airavata.services.registry.rest.security.session.SessionAuthenticator"
-                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.SessionDBUserStore">
-        <specificConfigurations>
-            <database>
-                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
-                <jdbcUrl>jdbc:derby://localhost:20000/persistent_data;create=true</jdbcUrl>
-                <userName>admin</userName>
-                <password>admin</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Persons</sessionTable>
-                <sessionColumn>sessionId</sessionColumn>
-                <comparingColumn>sessionId</comparingColumn>
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-    <authenticator name="basicAccessAuthenticator" class="org.apache.airavata.services.registry.rest.security.basic.BasicAccessAuthenticator"
-                   enabled="true" priority="7" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
-                <jdbcUrl>jdbc:derby://localhost:20000/persistent_data;create=true</jdbcUrl>
-                <userName>admin</userName>
-                <password>admin</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <userTableName>AIRAVATA_USER</userTableName>
-                <userNameColumnName>USERID</userNameColumnName>
-                <passwordColumnName>PASSWORD</passwordColumnName>
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-</authenticators>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/README.txt
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/README.txt b/modules/rest/webapp/README.txt
deleted file mode 100644
index dec3a08..0000000
--- a/modules/rest/webapp/README.txt
+++ /dev/null
@@ -1,164 +0,0 @@
-To build
-mvn clean install
-
-For development run
-mvn cargo:start
-
-To test
-* Start database according what you specified in the airavata-server.properties
-* for simple methods you can use curl for testing.
-
-**************For Configuration releated methods********************
-   curl -v 'http://localhost:9080/airavata-registry/registry/api/configuration?key=key1'
-   curl -v 'http://localhost:9080/airavata-registry/registry/api/configurationlist?key=key1'
-   curl -H "Accept: text/plain" -X POST -d "key=key1&value=value4&date=2012-09-21 04:09:56" http://localhost:9080/airavata-registry/registry/api/save/configuration
-   curl -H "Accept: text/plain" -X POST -d "key=key1&value=value5&date=2012-09-23 04:09:56" http://localhost:9080/airavata-registry/registry/api/update/configuration
-   curl --request DELETE http://localhost:9080/airavata-registry/registry/api/delete/allconfiguration?key=key1
-   curl --request DELETE 'http://localhost:9080/airavata-registry/registry/api/delete/configuration?key=key2&value=value2'
-   curl --request GET http://localhost:9080/airavata-registry/registry/api/gfac/urilist
-   curl --request GET http://localhost:9080/airavata-registry/registry/api/workflowinterpreter/urilist
-   curl --request GET http://localhost:9080/airavata-registry/registry/api/eventingservice/uri
-   curl --request GET http://localhost:9080/airavata-registry/registry/api/messagebox/uri
-   curl -H "Accept: text/plain" -X POST -d "uri=http://192.168.17.1:9080/axis2/services/GFacService2" http://localhost:9080/airavata-registry/registry/api/add/gfacuri
-   curl -H "Accept: text/plain" -X POST -d "uri=http://192.168.17.1:9080/axis2/services/WorkflowInterpretor2" http://localhost:9080/airavata-registry/registry/api/add/workflowinterpreteruri
-   curl -H "Accept: text/plain" -X POST -d "uri=http://192.168.17.1:9080/axis2/services/EventingService2" http://localhost:9080/airavata-registry/registry/api/add/eventinguri
-   curl -H "Accept: text/plain" -X POST -d "uri=http://192.168.17.1:9080/axis2/services/MsgBoxService2" http://localhost:9080/airavata-registry/registry/api/add/msgboxuri
-   curl -H "Accept: text/plain" -X POST -d "uri=http://192.168.17.1:9080/axis2/services/GFacService2&date=2012-10-18 00:00:00" http://localhost:9080/airavata-registry/registry/api/add/gfacuri/date
-   curl -H "Accept: text/plain" -X POST -d "uri=http://192.168.17.1:9080/axis2/services/WorkflowInterpretor2&date=2012-10-18 00:00:00" http://localhost:9080/airavata-registry/registry/api/add/workflowinterpreteruri/date
-   curl -H "Accept: text/plain" -X POST -d "uri=http://192.168.17.1:9080/axis2/services/MsgBoxService2&date=2012-10-18 00:00:00" http://localhost:9080/airavata-registry/registry/api/add/msgboxuri/date
-   curl --request DELETE http://localhost:9080/airavata-registry/registry/api/delete/gfacuri?uri=http://192.168.17.1:9080/axis2/services/GFacService2
-   curl --request DELETE http://localhost:9080/airavata-registry/registry/api/delete/allgfacuris
-   curl --request DELETE http://localhost:9080/airavata-registry/registry/api/delete/workflowinterpreteruri?uri=http://192.168.17.1:9080/axis2/services/WorkflowInterpretor2
-   curl --request DELETE http://localhost:9080/airavata-registry/registry/api/delete/allworkflowinterpreteruris
-   curl --request DELETE http://localhost:9080/airavata-registry/registry/api/delete/eventinguri
-   curl --request DELETE http://localhost:9080/airavata-registry/registry/api/delete/msgboxuri
-
-************For descriptiors*********************************
-    ############## Host descriptrors ##########################
-
-    curl --request GET http://localhost:9080/airavata-registry/registry/api/hostdescriptor/exist?descriptorName=ember
-    curl -H "Accept:application/json"  -X POST -H "Content-Type:application/json" -d '{"hostname":"testHost1", "hostAddress":"testHostAddress" }' http://localhost:9080/airavata-registry/registry/api/hostdescriptor/save
-    curl -H "Accept:application/json"  -X POST -H "Content-Type:application/json" -d '{"hostname":"testHost1", "hostAddress":"testHostAddress2" }' http://localhost:9080/airavata-registry/registry/api/hostdescriptor/update
-    curl --request GET http://localhost:9080/airavata-registry/registry/api/host/description?hostName=testHost1
-    curl --request DELETE http://localhost:9080/airavata-registry/registry/api/hostdescriptor/delete?hostName=testHost1
-    curl --request GET http://localhost:9080/airavata-registry/registry/api/get/hostdescriptors
-
-    ############## Service descriptrors ##########################
-    curl --request GET http://localhost:9080/airavata-registry/registry/api/servicedescriptor/exist?descriptorName=echo
-    curl -H "Accept:application/json"  -X POST -H "Content-Type:application/json" -d '{"serviceName":"testService1", "description":"test description","inputParams":{"dataType":"input", "description":"myinput","name":"myinput","type":"String"},"outputParams":{"dataType":"output","description":"myoutput","name":"myoutput","type":"String"}}' http://localhost:9080/airavata-registry/registry/api/servicedescriptor/save
-    curl -H "Accept:application/json"  -X POST -H "Content-Type:application/json" -d '{"serviceName":"testService2", "description":"test description2","inputParams":{"dataType":"input", "description":"myinput2","name":"myinput2","type":"String"},"outputParams":{"dataType":"output","description":"myoutput2","name":"myoutput2","type":"String"}}' http://localhost:9080/airavata-registry/registry/api/servicedescriptor/update
-    curl --request GET http://localhost:9080/airavata-registry/registry/api/servicedescriptor/description?serviceName=echo1
-    curl --request DELETE http://localhost:9080/airavata-registry/registry/api/servicedescriptor/delete?serviceName=echo1
-    curl --request GET http://localhost:9080/airavata-registry/registry/api/get/servicedescriptors
-
-    ############## Application descriptrors ##########################
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/applicationdescriptor/exist?serviceName=echo&hostName=LocalHost&descriptorName=LocalHost_application'
-    curl -H "Accept:application/json"  -X POST -H "Content-Type:application/json" -d '{"name":"abc1", "hostdescName":"LocalHost", "executablePath":"cccc", "workingDir":"dddd" , "serviceDescriptor":{"inputParams":{"dataType":"input", "description":"myinput","name":"myinput","type":"String"},"outputParams":{"dataType":"output","description":"myoutput","name":"myoutput","type":"String"}}}' http://localhost:9080/airavata-registry/registry/api/applicationdescriptor/build/save
-     curl -H "Accept:application/json"  -X POST -H "Content-Type:application/json" -d '{"name":"abc1", "hostdescName":"LocalHost", "executablePath":"cccc111", "workingDir":"dddd1111" , "serviceDescriptor":{"inputParams":{"dataType":"input", "description":"myinput11","name":"myinput11","type":"String"},"outputParams":{"dataType":"output","description":"myoutput11","name":"myoutput11","type":"String"}}}' http://localhost:9080/airavata-registry/registry/api/applicationdescriptor/update
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/applicationdescriptor/description?serviceName=echo&hostName=LocalHost&applicationName=LocalHost_application2'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/applicationdescriptors/alldescriptors/host/service?serviceName=echo&hostName=LocalHost'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/applicationdescriptor/alldescriptors/service?serviceName=echo'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/applicationdescriptor/alldescriptors'
-    curl --request DELETE 'http://localhost:9080/airavata-registry/registry/api/applicationdescriptor/delete?serviceName=echo&hostName=LocalHost&appName=LocalHost_application2'
-
-************ Project Registry *********************************
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/project/exist?projectName=default'
-    curl -H "Accept: text/plain" -X POST -d 'projectName=project1' http://localhost:9080/airavata-registry/registry/api/add/project
-    curl -H "Accept: text/plain" -X POST -d 'projectName=project1' http://localhost:9080/airavata-registry/registry/api/update/project
-    curl --request DELETE 'http://localhost:9080/airavata-registry/registry/api/delete/project?projectName=project1'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/project?projectName=project1'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/projects'
-
-************* Experiments *************************************
-    curl --request DELETE 'http://localhost:9080/airavata-registry/registry/api/delete/experiment?experimentId=eb9e67cf-6fe3-46f1-b50b-7b42936d347d
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experiments/all'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experiments/project?projectName=default'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experiments/date?fromDate=2012-10-16%2000:00:00&toDate=2012-10-18%2000:00:00'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experiments/project/date?projectName=default&fromDate=2012-10-16%2000:00:00&toDate=2012-10-18%2000:00:00'
-    curl -H "Accept: text/plain" -X POST -d 'projectName=project1&experimentID=testexpID1&submittedDate=2012-10-18 00:00:00' http://localhost:9080/airavata-registry/registry/api/add/experiment
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/experiment/exist?experimentId=testexpID1'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/experiment/notexist/create?experimentId=testExpID2&createIfNotPresent=true'
-    curl -H "Accept: text/plain" -X POST -d 'experimentId=testExpID2&user=abc' http://localhost:9080/airavata-registry/registry/api/update/experiment
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experiment/executionuser?experimentId=testExpID2'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experiment/name?experimentId=testExpID2'
-    curl -H "Accept: text/plain" -X POST -d 'experimentId=testExpID2&experimentName=ddscsddsss111' http://localhost:9080/airavata-registry/registry/api/update/experimentname
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experimentmetadata?experimentId=testExpID2'
-    curl -H "Accept: text/plain" -X POST -d 'experimentId=testExpID2&metadata=aaaaaaa' http://localhost:9080/airavata-registry/registry/api/update/experimentmetadata
-
-************* Workflow Execution *************************************
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/workflowtemplatename?workflowInstanceId=e00ddc5e-f8d5-4492-9eb2-10372efb103c'
-    curl -H "Accept: text/plain" -X POST -d 'workflowInstanceId=e00ddc5e-f8d5-4492-9eb2-10372efb103c&templateName=wftemplate1' http://localhost:9080/airavata-registry/registry/api/update/workflowinstancetemplatename
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experimentworkflowinstances?experimentId=ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/workflowinstance/exist/check?instanceId=e00ddc5e-f8d5-4492-9eb2-10372efb103c'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/workflowinstance/exist/create?instanceId=testWFInstanceID&createIfNotPresent=true'
-    curl -H "Accept: text/plain" -X POST -d 'instanceId=testWFInstanceID&executionStatus=FINISHED' http://localhost:9080/airavata-registry/registry/api/update/workflowinstancestatus/instanceid
-    curl -H "Accept: text/plain" -X POST -d 'experimentId=testWFInstanceID&workflowInstanceId=testWFInstanceID&executionStatus=STARTED&statusUpdateTime=2012-10-23 00:00:00' http://localhost:9080/airavata-registry/registry/api/update/workflowinstancestatus/experimentid
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/workflowinstancestatus?instanceId=testWFInstanceID'
-    curl -H "Accept: text/plain" -X POST -d 'nodeID=TempConvertSoap_FahrenheitToCelsius&workflowInstanceId=ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4&data=testInputdata' http://localhost:9080/airavata-registry/registry/api/update/workflownodeinput
-    curl -H "Accept: text/plain" -X POST -d 'nodeID=TempConvertSoap_FahrenheitToCelsius&workflowInstanceId=ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4&data=testOutputdata' http://localhost:9080/airavata-registry/registry/api/update/workflownodeoutput
-
-
-****************** Experiment Data *************************************
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experiment?experimentId=ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experimentId/user?username=admin'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/experiment/user?username=admin'
-    curl -H "Accept: text/plain" -X POST -d 'workflowInstanceId=ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4&nodeId=TempConvertSoap_FahrenheitToCelsius&executionStatus=STARTED' http://localhost:9080/airavata-registry/registry/api/update/workflownode/status
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/workflownode/status?workflowInstanceId=ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4&nodeId=TempConvertSoap_FahrenheitToCelsius'
-    curl --request GET 'http://localhost:9080/airavata-registry/registry/api/get/workflownode/starttime?workflowInstanceId=ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4&nodeId=TempConvertSoap_FahrenheitToCelsius'
-
-
-
-********* Sample JSON message for Application and service *****************
-
-{
-   "name":"Tesing",
-   "cpuCount":"12",
-   "hostdescName":"localhost",
-   "executablePath":"cccc",
-   "workingDir":"dddd"
-   "maxMemory":"0",
-   "maxWallTime":"0",
-   "minMemory":"0",
-   "nodeCount":"1",
-   "processorsPerNode":"12",
-   "serviceDescriptor":{
-      "serviceName":"service1",
-      "inputParams":[
-         {
-            "dataType":"input",
-            "description":"myinput",
-            "name":"myinput",
-            "type":"String"
-         },
-         {
-            "dataType":"input",
-            "description":"myinput",
-            "name":"myinput",
-            "type":"String"
-         }
-      ],
-      "outputParams":[
-         {
-            "dataType":"output",
-            "description":"myoutput",
-            "name":"myoutput",
-            "type":"String"
-         },
-         {
-            "dataType":"output",
-            "description":"my output",
-            "name":"myoutput",
-            "type":"String"
-         }
-      ]
-   }
-}
-
-*** Sample XML message to create application and service
-
-<?xml version="1.0" encoding="UTF-8" standalone="yes"?><application><applicationName>Testing</applicationName><cpuCount>0</cpuCount><hostdescName>localhost</hostdescName><maxMemory>0</maxMemory><maxWallTime>0</maxWallTime><minMemory>0</minMemory><nodeCount>0</nodeCount><processorsPerNode>0</processorsPerNode><serviceDesc><inputParams><dataType>input</dataType><description>my input</description><name>myinput</name><type>String</type></inputParams><inputParams><dataType>input</dataType><description>my input</description><name>myinput</name><type>String</type></inputParams><outputParams><dataType>output</dataType><description>my output</description><name>myoutput</name><type>String</type></outputParams><outputParams><dataType>output</dataType><description>my output</description><name>myoutput</name><type>String</type></outputParams></serviceDesc></application>
-
-
-
-
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/pom.xml b/modules/rest/webapp/pom.xml
deleted file mode 100644
index 4f3fb4f..0000000
--- a/modules/rest/webapp/pom.xml
+++ /dev/null
@@ -1,257 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY ~ KIND, either express or implied. See the License for the specific 
-	language governing permissions and limitations under the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	
-	<parent>
-		<groupId>org.apache.airavata</groupId>
-		<artifactId>rest</artifactId>
-		<version>0.12-SNAPSHOT</version>
-		<relativePath>../pom.xml</relativePath>
-	</parent>
-
-	<modelVersion>4.0.0</modelVersion>
-	<artifactId>airavata-rest-service-webapp</artifactId>
-	<packaging>war</packaging>
-	<name>airavata-rest-service-webapp</name>
-	<build>
-		<finalName>airavata-rest-service-webapp</finalName>
-		<plugins>
-			<plugin>
-				<groupId>org.codehaus.cargo</groupId>
-				<artifactId>cargo-maven2-plugin</artifactId>
-				<version>${cargo.version}</version>
-				<configuration>
-					<wait>true</wait>
-					<configuration>
-						<properties>
-							<cargo.servlet.port>9080</cargo.servlet.port>
-							<cargo.tomcat.ajp.port>9009</cargo.tomcat.ajp.port>
-							<cargo.rmi.port>9099</cargo.rmi.port>
-							<cargo.jvmargs>
-                                <![CDATA[-Xdebug -Xrunjdwp:transport=dt_socket,address=${cargo.debug.address},server=y,suspend=${cargo.debug.suspend} -noverify ${javaagent}]]>
-							</cargo.jvmargs>
-							<cargo.tomcat.context.reloadable>true</cargo.tomcat.context.reloadable>
-						</properties>
-						<home>${project.build.directory}/tomcat6x</home>
-						<deployables>
-							<deployable>
-								<groupId>org.apache.airavata</groupId>
-								<artifactId>airavata-rest-service-webapp</artifactId>
-								<type>war</type>
-								<properties>
-									<context>/airavata</context>
-								</properties>
-							</deployable>
-						</deployables>
-					</configuration>
-					<container>
-						<containerId>tomcat6x</containerId>
-						<timeout>180000</timeout>
-						<zipUrlInstaller>
-							<url>
-								http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.32/bin/apache-tomcat-6.0.32.tar.gz
-							</url>
-						</zipUrlInstaller>
-						<systemProperties>
-
-						</systemProperties>
-					</container>
-				</configuration>
-			</plugin>
-		</plugins>
-
-	</build>
-	<dependencies>
-		<dependency>
-			<groupId>org.apache.derby</groupId>
-			<artifactId>derbyclient</artifactId>
-			<version>${derby.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-servlet</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-json</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.sun.jersey.contribs</groupId>
-			<artifactId>jersey-multipart</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<!--dependency>
-			<groupId>com.sun.jersey.jersey-test-framework</groupId>
-			<artifactId>jersey-test-framework-grizzly2</artifactId>
-			<version>${jersey.version}</version>
-			<scope>test</scope>
-		</dependency-->
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-server</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<!--dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-client</artifactId>
-			<version>${jersey.version}</version>
-		</dependency-->
-		<dependency>
-			<groupId>org.apache.shiro</groupId>
-			<artifactId>shiro-core</artifactId>
-			<version>1.2.1</version>
-		</dependency>
-		<dependency>
-			<groupId>com.h2database</groupId>
-			<artifactId>h2</artifactId>
-			<version>1.3.168</version>
-			<scope>test</scope>
-		</dependency>
-        <dependency>
-            <groupId>com.sun.xml.bind</groupId>
-            <artifactId>jaxb-impl</artifactId>
-            <version>2.2.3-1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-mapper-asl</artifactId>
-            <version>1.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>javax.xml.bind</groupId>
-            <artifactId>jaxb-api</artifactId>
-            <version>2.2.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-xc</artifactId>
-            <version>1.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-jaxrs</artifactId>
-            <version>1.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-core-asl</artifactId>
-            <version>1.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ebaysf.web</groupId>
-            <artifactId>cors-filter</artifactId>
-            <version>${ebay.cors.filter}</version>
-        </dependency>
-
-        <!-- Airavata -->
-		<!--dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-gfac-schema-utils</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-registry-api</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-security</artifactId>
-			<version>${project.version}</version>
-		</dependency-->
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-jpa-registry</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-credential-store</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-		<dependency>
-			<groupId>edu.uiuc.ncsa.myproxy</groupId>
-			<artifactId>oa4mp-client-oauth1</artifactId>
-			<version>${oa4mp.version}</version>
-			<exclusions>
-				<exclusion>
-					<groupId>mysql</groupId>
-					<artifactId>mysql-connector-java</artifactId>
-				</exclusion>
-				<exclusion>
-					<groupId>postgresql</groupId>
-					<artifactId>postgresql</artifactId>
-				</exclusion>
-			</exclusions>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-rest-mappings</artifactId>
-			<version>${project.version}</version>
-            <exclusions>
-                <exclusion>  <!-- declare the exclusion here -->
-                    <groupId>commons-codec</groupId>
-                    <artifactId>commons-codec</artifactId>
-                </exclusion>
-            </exclusions>
-		</dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-rest-services</artifactId>
-            <version>${project.version}</version>
-            <exclusions>
-                <exclusion>  <!-- declare the exclusion here -->
-                    <groupId>commons-codec</groupId>
-                    <artifactId>commons-codec</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-		<!-- Logging -->
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-            <version>${org.slf4j.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-simple</artifactId>
-            <version>${org.slf4j.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>jcl-over-slf4j</artifactId>
-            <version>${org.slf4j.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-log4j12</artifactId>
-            <version>${org.slf4j.version}</version>
-		</dependency>
-	</dependencies>
-	<properties>
-		<jersey.version>1.13</jersey.version>
-		<grizzly.version>2.0.0-M3</grizzly.version>
-		<!--project.build.sourceEncoding>UTF-8</project.build.sourceEncoding-->
-		<cargo.version>1.2.1</cargo.version>
-		<!-- if you want a remote debugging on a different a address override on 
-			command line with -Dcargo.debug.addres=xxxx -->
-		<cargo.debug.address>5000</cargo.debug.address>
-		<!-- if you want to start remote debugging session suspended override on 
-			command line with -Dcargo.debug.suspend=y -->
-		<cargo.debug.suspend>n</cargo.debug.suspend>
-		<javaagent />
-	</properties>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/resources/authenticators.xml
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/resources/authenticators.xml b/modules/rest/webapp/src/main/resources/authenticators.xml
deleted file mode 100644
index b0523ff..0000000
--- a/modules/rest/webapp/src/main/resources/authenticators.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
-    contributor license agreements. See the NOTICE file ~ distributed with this
-    work for additional information ~ regarding copyright ownership. The ASF
-    licenses this file ~ to you under the Apache License, Version 2.0 (the ~
-    "License"); you may not use this file except in compliance ~ with the License.
-    You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
-    ~ ~ Unless required by applicable law or agreed to in writing, ~ software
-    distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
-    WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
-    License for the ~ specific language governing permissions and limitations
-    ~ under the License. -->
-
-
-<!--
-This file contains a sample authenticator configuration. We can define all authenticators in this file. Each authenticator
-configuration has to start with tag "authenticator". The name is the name given to the authenticator. The actual
-authenticator implementation is implemented in the class. There are configurations specific to authenticators.
-Those configurations are reside inside &lt;specificConfigurations&gt; tags.
-
-The "enabled parameter at root level will say whether authenticators are enabled or not.
--->
-
-<authenticators enabled="true">
-    <authenticator name="sessionAuthenticator" class="org.apache.airavata.services.registry.rest.security.session.SessionAuthenticator"
-                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.SessionDBUserStore">
-        <specificConfigurations>
-            <database>
-                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
-                <!-- Points to /Users/thejaka/development/apache/airavata/trunk/modules/commons/airavata-registry-rest/target/tomcat6x/. -->
-                <jdbcUrl>jdbc:derby://localhost:1527/persistent_data;create=false</jdbcUrl>
-                <userName>airavata</userName>
-                <password>airavata</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <sessionTable>Persons</sessionTable>
-                <sessionColumn>sessionId</sessionColumn>
-                <comparingColumn>sessionId</comparingColumn>
-            </database>
-        </specificConfigurations>
-    </authenticator>
-
-    <authenticator name="basicAccessAuthenticator" class="org.apache.airavata.services.registry.rest.security.basic.BasicAccessAuthenticator"
-                   enabled="true" priority="8" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
-        <specificConfigurations>
-            <database>
-                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
-                <jdbcUrl>jdbc:derby://localhost:1527/persistent_data;create=false</jdbcUrl>
-                <userName>airavata</userName>
-                <password>airavata</password>
-                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
-                <userTableName>Users</userTableName>
-                <passwordHashMethod>SHA</passwordHashMethod>
-                <userNameColumnName>user_name</userNameColumnName>
-                <passwordColumnName>password</passwordColumnName>
-            </database>
-            <!--For MySQL-->
-            <!--database>
-                <jdbcUrl>jdbc:mysql://localhost:3306/persistent_data</jdbcUrl>
-                <userName>airavata</userName>
-                <password>airavata</password>
-                <databaseDriver>com.mysql.jdbc.Driver</databaseDriver>
-                <userTableName>Users</userTableName>
-                <passwordHashMethod>SHA</passwordHashMethod>
-                <userNameColumnName>user_name</userNameColumnName>
-                <passwordColumnName>password</passwordColumnName>
-            </database-->
-        </specificConfigurations>
-    </authenticator>
-
-    <authenticator name="basicAccessAuthenticatorLdap" class="org.apache.airavata.services.registry.rest.security.basic.BasicAccessAuthenticator"
-                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.LDAPUserStore">
-        <specificConfigurations>
-            <ldap>
-                <!--
-                url - The URL which LDAP server is listening for requests
-                systemUser - The DN of the LDAP server connection user
-                systemUserPassword - The password of the LDAP server connection user
-                userDNTemplate - The DN structure of the users in LDAP
-            -->
-                <url>ldap://localhost:10389</url>
-                <systemUser>admin</systemUser>
-                <systemUserPassword>secret</systemUserPassword>
-                <userDNTemplate>uid={0},ou=users,ou=system</userDNTemplate>
-            </ldap>
-        </specificConfigurations>
-    </authenticator>
-
-</authenticators>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/resources/credential-store/airavata.jks
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/resources/credential-store/airavata.jks b/modules/rest/webapp/src/main/resources/credential-store/airavata.jks
deleted file mode 100644
index bd6d8fe..0000000
Binary files a/modules/rest/webapp/src/main/resources/credential-store/airavata.jks and /dev/null differ

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/resources/credential-store/client.xml
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/resources/credential-store/client.xml b/modules/rest/webapp/src/main/resources/credential-store/client.xml
deleted file mode 100644
index f7cc328..0000000
--- a/modules/rest/webapp/src/main/resources/credential-store/client.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--Licensed to the Apache Software
-	Foundation (ASF) under one or more contributor license agreements. See the
-	NOTICE file distributed with this work for additional information regarding
-	copyright ownership. The ASF licenses this file to you under the Apache License,
-	Version 2.0 (theÏ "License"); you may not use this file except in compliance
-	with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
-	Unless required by applicable law or agreed to in writing, software distributed
-	under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
-	OR CONDITIONS OF ANY ~ KIND, either express or implied. See the License for
-	the specific language governing permissions and limitations under the License. -->
-
-<config>
-    <client name="acs">
-        <logging
-                logFileName="../logs/oa4mp.log"
-                logName="oa4mp"
-                logSize="1000000"
-                logFileCount="2"
-                debug="true"/>
-        <id>myproxy:oa4mp,2012:/client/24c45c2eb65d93231d02d423e94d0362</id>
-        <serviceUri>https://portal.xsede.org/oauth</serviceUri>
-        <!--callbackUri>https://156.56.179.104:8443/client/pages/client-success.jsp</callbackUri-->
-        <callbackUri>https://192.168.0.13:8443/airavata/callback</callbackUri>
-        <lifetime>864000</lifetime>
-        <!--publicKeyFile>/Users/thejaka/manager-server/webapps/airavata-registry/WEB-INF/classes/credential-store/oauth-pubkey.pem</publicKeyFile-->
-        <publicKeyFile>../webapps/airavata/WEB-INF/classes/credential-store/oauth-pubkey.pem</publicKeyFile>
-        <!--privateKeyFile>/Users/thejaka/manager-server/webapps/airavata-registry/WEB-INF/classes/credential-store/oauth-privkey.pk8</privateKeyFile-->
-        <privateKeyFile>../webapps/airavata/WEB-INF/classes/credential-store/oauth-privkey.pk8</privateKeyFile>
-    </client>
-
-    <credential-store>
-        <successUri>/credential-store/success.jsp</successUri>
-        <errorUri>/credential-store/error.jsp</errorUri>
-        <redirectUri>/credential-store/show-redirect.jsp</redirectUri>
-    </credential-store>
-
-</config>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/resources/credential-store/oauth-privkey.pk8
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/resources/credential-store/oauth-privkey.pk8 b/modules/rest/webapp/src/main/resources/credential-store/oauth-privkey.pk8
deleted file mode 100644
index 551e2be..0000000
--- a/modules/rest/webapp/src/main/resources/credential-store/oauth-privkey.pk8
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJAc14swfpUZOb
-T9VFGIgSGfBBnfJXcf/Pa9s6igXQBevRohJ1FdQ9y3kaLDXngVh6/xIKAgfCu10O
-7o2ZNi7K5NS37LDYehw+fzrRlOVHLOkHQ/XVvJfMENPv8emMmAkiFK1WxeITKBC8
-GkrbQGy3k7kfo8om2op7Tc0wAUZOcOrd0VQE5yUeF7ODmg7YwYgILlNSHTrK9rmz
-5WvJRwAnouAWQZxir/+Zzb9ynMK/2AraOWaHHO7V41B/JU55lqLI8DZOrLk5ZAAN
-OXEMIFAoeSyRbQMDDJ0QzMjRovuz15IaEMpn83p4q7pAwPK7UkK3yO5bWP15qiM2
-daWVJv55AgMBAAECggEAEzcZ5lTvB63lt24tTBqpP1m9bvhjZ1qdgr2jynfRUG6Q
-eYzNyOWaUYH3BLp/OK9TvwZNOimxhjsVDU1euevFE15Gu4Jj8X3S32KYQ9rBBEnV
-yP0FLjaGKFrfd8ufcPJDxT9GxsnJ79zfpKu6xjTlb7MuekjVFVvE6z6nw9QLXYog
-bdjPFgPKWynl5ALNjenZMDFgCSIvdVcjgwdOLpDuPYdfD+JBZVFg+YCXaEQKkpXZ
-AHTuDO4Zq5JuUkHr3I+MwhCvIwgImQ/yfw0Vn+kj+WIrY6lyyO58NmAA7FXefPmC
-B0IKsdWFqXDzJMm15Kn4h4IeudR55UmRSIgk17N60QKBgQDuDlvxHBUUJI/7OkFB
-/bvqF8K+11PUpOIBxhgOw/76tgX4penYGmqVDDpYBO+ae+kKfASQIp91uOJc3JeH
-itm7k6HIzHqSJFSTXkRO3KxHgkyYo8o2IWXWYPhPt93edC3AKqOUMlrNXdyfuAPx
-Nh4xCvhgOZDxrQoNldzzjaHuHQKBgQDYKIcfiQuVsjc4Opu1fn57fagrPUfNOM/p
-u5chh+mOb2GhTzDa0I4OiWz05fSho/uakYgiXE/D0oIe4S9sCTMai+pjtp1jt6sg
-ZO7QLPhj6ct1VF6VYButHOwpKS70MFcdihYOIP49Gonw/P8Xu+HY0Qhc760rjwcI
-ga/4r5zTDQKBgAgERcZd2rvd61dbg90UDWL5v94rZDBSCSZkJGVC5nBM9vCDrddQ
-NGymh8R1DhiWuadXu9OaxuHxAvZ7m0K+Q0zU0OrxL+OCA7MexpAdUFPsKGYvhdzC
-zSomA9aza25VXUEObonMFFC8K3TZfpB98RBXvTuIVMA+worolBNDnsNlAoGBAI4B
-uhvGnfy/czWWk1sd+hxJBiU6AiTZ0QW9/uDBeHfhxqMB8peeceUs9Y7CT/+tSotW
-Vrg0Kxb8Ag4lZFE2jgM/rkHJ5AZx0JPcm2PaV2jUXJz9S5IY7LXDDYdRDg7Qfzrh
-z/GCTWR5Pew7WZ8PCKW3ViYwM3UtZrJ4+NGJFZ81AoGBAIPOt5Ge30dEGLh0UUBg
-y60MUR6jcUDmIl8x88h+O97qMjf5fsVshOR+GhFKSYQdibDo3HO+sRKS6pii9v5e
-IXZD0wUr2HznpGXrAn7CmHEM7ms0TBfy4IOkewrYAhlK/yilfkmjyS8tjLlRB2Kv
-xHv7LOgh04rFHhYdztDWPj3z
------END PRIVATE KEY-----

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/resources/credential-store/oauth-pubkey.pem
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/resources/credential-store/oauth-pubkey.pem b/modules/rest/webapp/src/main/resources/credential-store/oauth-pubkey.pem
deleted file mode 100644
index 1c18768..0000000
--- a/modules/rest/webapp/src/main/resources/credential-store/oauth-pubkey.pem
+++ /dev/null
@@ -1,9 +0,0 @@
------BEGIN PUBLIC KEY-----
-MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyQHNeLMH6VGTm0/VRRiI
-EhnwQZ3yV3H/z2vbOooF0AXr0aISdRXUPct5Giw154FYev8SCgIHwrtdDu6NmTYu
-yuTUt+yw2HocPn860ZTlRyzpB0P11byXzBDT7/HpjJgJIhStVsXiEygQvBpK20Bs
-t5O5H6PKJtqKe03NMAFGTnDq3dFUBOclHhezg5oO2MGICC5TUh06yva5s+VryUcA
-J6LgFkGcYq//mc2/cpzCv9gK2jlmhxzu1eNQfyVOeZaiyPA2Tqy5OWQADTlxDCBQ
-KHkskW0DAwydEMzI0aL7s9eSGhDKZ/N6eKu6QMDyu1JCt8juW1j9eaojNnWllSb+
-eQIDAQAB
------END PUBLIC KEY-----

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/resources/log4j.xml
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/resources/log4j.xml b/modules/rest/webapp/src/main/resources/log4j.xml
deleted file mode 100644
index 4cd38c8..0000000
--- a/modules/rest/webapp/src/main/resources/log4j.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-      http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
-
-  $Id$
--->
-<!DOCTYPE log4j:configuration PUBLIC "-//LOGGER" "log4j.dtd">
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
-
-  <!-- Appenders -->
-  <appender name="console" class="org.apache.log4j.ConsoleAppender">
-    <param name="Target" value="System.out" />
-    <layout class="org.apache.log4j.PatternLayout">
-      <param name="ConversionPattern" value="%-5p: %c - %m%n" />
-    </layout>
-  </appender>
-
-  <!-- Jersey logger -->
-  <logger name="com.sun.jersey">
-    <level value="info" />
-  </logger>
-
-  <!-- Airavata logger -->
-  <logger name="org.apache.airavata">
-    <level value="info" />
-  </logger>
-
-  <!-- Root Logger -->
-  <root>
-    <priority value="info" />
-    <appender-ref ref="console" />
-  </root>
-
-</log4j:configuration>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml b/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml
deleted file mode 100644
index 0d446ec..0000000
--- a/modules/rest/webapp/src/main/webapp/WEB-INF/web.xml
+++ /dev/null
@@ -1,200 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
-    contributor license agreements. See the NOTICE file ~ distributed with this
-    work for additional information ~ regarding copyright ownership. The ASF
-    licenses this file ~ to you under the Apache License, Version 2.0 (the ~
-    "License"); you may not use this file except in compliance ~ with the License.
-    You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
-    ~ ~ Unless required by applicable law or agreed to in writing, ~ software
-    distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
-    WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
-    License for the ~ specific language governing permissions and limitations
-    ~ under the License. -->
-
-<!-- This web.xml file is not required when using Servlet 3.0 container,
-     see implementation details http://jersey.java.net/nonav/documentation/latest/jax-rs.html#d4e194 -->
-<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xmlns="http://java.sun.com/xml/ns/javaee"
-         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
-         id="WebApp_ID" version="2.5">
-    <listener>
-      <listener-class>org.apache.airavata.rest.mappings.utils.RegistryListener</listener-class>
-    </listener>
-    <listener>
-        <listener-class>org.apache.airavata.credential.store.servlet.CredentialBootstrapper</listener-class>
-    </listener>
-
-    <context-param>
-        <param-name>oa4mp:client.config.file</param-name>
-        <param-value>${catalina.home}/webapps/airavata/WEB-INF/classes/credential-store/client.xml</param-value>
-        <!--param-value>
-            /home/amila/development/tools/apache-tomcat-7.0.29/webapps/airavata/WEB-INF/classes/credential-store/client.xml
-        </param-value-->
-
-    </context-param>
-
-    <!-- Credential store parameters -->
-    <context-param>
-        <param-name>credential-store-jdbc-url</param-name>
-        <param-value>jdbc:mysql://localhost/airavata</param-value>
-    </context-param>
-
-    <context-param>
-        <param-name>credential-store-db-user</param-name>
-        <param-value>root</param-value>
-    </context-param>
-
-    <context-param>
-        <param-name>credential-store-db-password</param-name>
-        <param-value>root123</param-value>
-    </context-param>
-
-    <context-param>
-        <param-name>credential-store-db-driver</param-name>
-        <param-value>com.mysql.jdbc.Driver</param-value>
-    </context-param>
-
-    <servlet>
-        <servlet-name>Airavata Registry Service</servlet-name>
-        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
-        <init-param>
-            <param-name>com.sun.jersey.config.property.packages</param-name>
-            <param-value>org.apache.airavata.services.registry.rest;org.apache.airavata.services.experiment;org.codehaus.jackson.jaxrs</param-value>
-        </init-param>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-    
-    <servlet>
-        <servlet-name>Airavata Experiment Service</servlet-name>
-        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
-        <init-param>
-            <param-name>com.sun.jersey.config.property.packages</param-name>
-            <param-value>org.apache.airavata.services.experiment;org.codehaus.jackson.jaxrs</param-value>
-        </init-param>
-        <load-on-startup>1</load-on-startup>
-    </servlet>
-	<servlet>
-        <servlet-name>Airavata Server Configuration Service</servlet-name>
-        <servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
-        <init-param>
-            <param-name>com.sun.jersey.config.property.packages</param-name>
-            <param-value>org.apache.airavata.services.server;org.codehaus.jackson.jaxrs</param-value>
-        </init-param>
-        <load-on-startup>1</load-on-startup>
-    </servlet>	
-	
-    <!-- ========================= Security Related Configurations go here ================================== -->
-    
-    <filter>
-		<filter-name>CORS Filter</filter-name>
-		<filter-class>org.ebaysf.web.cors.CORSFilter</filter-class>
-		<init-param>
-			<description>A comma separated list of allowed origins. Note: An '*' cannot be used for an allowed origin when using credentials.</description>
-			<param-name>cors.allowed.origins</param-name>
-			<param-value>*</param-value>
-		</init-param>
-		<init-param>
-			<param-name>cors.allowed.methods</param-name>
-			<param-value>GET,POST,HEAD,OPTIONS,PUT</param-value>
-		</init-param>
-		<init-param>
-			<param-name>cors.allowed.headers</param-name>
-			<param-value>Content-Type,X-Requested-With,accept,Origin,Access-Control-Request-Method,Access-Control-Request-Headers,Authorization</param-value>
-		</init-param>
-		<init-param>
-			<param-name>cors.exposed.headers</param-name>
-			<param-value></param-value>
-		</init-param>
-		<init-param>
-			<param-name>cors.support.credentials</param-name>
-			<param-value>true</param-value>
-		</init-param>
-		<init-param>
-			<param-name>cors.logging.enabled</param-name>
-			<param-value>false</param-value>
-		</init-param>
-		<init-param>
-			<param-name>cors.preflight.maxage</param-name>
-			<param-value>1800</param-value>
-		</init-param>
-		<init-param>
-			<param-name>cors.request.decorate</param-name>
-			<param-value>true</param-value>
-		</init-param>
-	</filter>
-	
-    <filter>
-        <filter-name>AuthenticationFilter</filter-name>
-        <filter-class>org.apache.airavata.services.registry.rest.security.HttpAuthenticatorFilter</filter-class>
-        <init-param>
-            <param-name>authenticatorConfigurations</param-name>
-            <param-value>authenticators.xml</param-value>
-        </init-param>
-    </filter>
-    
-	<filter-mapping>
-		<filter-name>CORS Filter</filter-name>
-		<url-pattern>/user-store/*</url-pattern>
-		<url-pattern>/services/registry/*</url-pattern>
-		<url-pattern>/services/experiment/*</url-pattern>
-		<url-pattern>/services/server/*</url-pattern>
-	</filter-mapping>
-	
-	<filter-mapping>
-		<filter-name>AuthenticationFilter</filter-name>
-		<url-pattern>/user-store/*</url-pattern>
-		<url-pattern>/services/registry/*</url-pattern>
-		<url-pattern>/services/experiment/*</url-pattern>
-		<url-pattern>/services/server/*</url-pattern>
-	</filter-mapping>
-
-    <!-- ================================ End Security Related Configurations =============================== -->
-
-    <servlet-mapping>
-        <servlet-name>Airavata Registry Service</servlet-name>
-        <url-pattern>/services/registry/*</url-pattern>
-    </servlet-mapping>
-    
-    <servlet-mapping>
-        <servlet-name>Airavata Experiment Service</servlet-name>
-        <url-pattern>/services/experiment/*</url-pattern>
-    </servlet-mapping>
-
-    <servlet-mapping>
-        <servlet-name>Airavata Server Configuration Service</servlet-name>
-        <url-pattern>/services/server/*</url-pattern>
-    </servlet-mapping>
-
-    <!-- Credential Store Configurations -->
-    <servlet>
-        <servlet-name>credential-store-start</servlet-name>
-        <!--internal name of the servlet-->
-        <servlet-class>org.apache.airavata.credential.store.servlet.CredentialStoreStartServlet</servlet-class>
-
-        <load-on-startup>1</load-on-startup>
-        <!--load as soon as tomcat starts?-->
-    </servlet>
-
-    <servlet-mapping>
-        <servlet-name>credential-store-start</servlet-name>
-        <!--the servlet-name above-->
-        <url-pattern>/acs-start-servlet</url-pattern>
-        <!--what needs to be in the url, so http://foo.org/client/simple-->
-    </servlet-mapping>
-
-    <servlet>
-        <servlet-name>callback</servlet-name>
-        <!--internal name of the servlet-->
-        <servlet-class>org.apache.airavata.credential.store.servlet.CredentialStoreCallbackServlet</servlet-class>
-        <load-on-startup>1</load-on-startup>
-        <!--load as soon as tomcat starts?-->
-    </servlet>
-
-    <servlet-mapping>
-        <servlet-name>callback</servlet-name>
-        <!--the servlet-name above-->
-        <url-pattern>/callback</url-pattern>
-        <!--what needs to be in the url, so http://foo.org/client/simple-->
-    </servlet-mapping>
-</web-app>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/acs/index.jsp
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/acs/index.jsp b/modules/rest/webapp/src/main/webapp/acs/index.jsp
deleted file mode 100644
index e7626fa..0000000
--- a/modules/rest/webapp/src/main/webapp/acs/index.jsp
+++ /dev/null
@@ -1,44 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-  
-<html>
-<body>
-<h2>Sample Portal</h2>
-<p>This demonstrates how portal can use Credential Store to obtain community credentials ...</p>
-<form name="input" action="../acs-start-servlet" method="post">
-
-    <table border="0">
-        <tr>
-            <td>Gateway Name</td>
-            <td><input type="text" name="gatewayName"></td>
-        </tr>
-        <tr>
-            <td>Portal Username</td>
-            <td><input type="text" name="portalUserName"></td>
-        </tr>
-        <tr>
-            <td>Contact Email</td>
-            <td><input type="text" name="email"></td>
-        </tr>
-    </table>
-
-    <input type="submit" value="Submit">
-</form>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/credential-store/error.jsp
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/credential-store/error.jsp b/modules/rest/webapp/src/main/webapp/credential-store/error.jsp
deleted file mode 100644
index adc430d..0000000
--- a/modules/rest/webapp/src/main/webapp/credential-store/error.jsp
+++ /dev/null
@@ -1,53 +0,0 @@
-<%@ page import="org.apache.airavata.credential.store.util.CredentialStoreConstants" %>
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-  
-
-<%
-    String gatewayName = request.getParameter(CredentialStoreConstants.GATEWAY_NAME_QUERY_PARAMETER);
-    String portalUserName = request.getParameter(CredentialStoreConstants.PORTAL_USER_QUERY_PARAMETER);
-    Throwable exception = (Throwable) request.getAttribute("exception");
-
-%>
-
-<html>
-<body>
-<h1>Credential Store</h1>
-<p>An error occurred while processing</p>
-<p>
-    Gateway Name - <%=gatewayName%>. Portal user name - <%=portalUserName%>.
-    Exception -
-
-</p>
-
-<p>
-    <%
-
-        out.println("Exception - " + exception.getMessage());
-        out.println();
-        StackTraceElement[] elements = exception.getStackTrace();
-        for (StackTraceElement element : elements) {
-            out.print("         ");
-            out.println(element.toString());
-        }
-
-    %>
-</p>
-</body>
-</html>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/credential-store/password-credentials.jsp
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/credential-store/password-credentials.jsp b/modules/rest/webapp/src/main/webapp/credential-store/password-credentials.jsp
deleted file mode 100644
index 59a1e04..0000000
--- a/modules/rest/webapp/src/main/webapp/credential-store/password-credentials.jsp
+++ /dev/null
@@ -1,33 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-
-<html>
-<body>
-<h2>Store Passwords</h2>
-<p>This demonstrates how portal can use Credential Store to obtain community credentials ...</p>
-<form name="input" action="../airavata-registry-rest-services/credential-store" method="post">
-
-    Gateway Name   : <input type="text" name="gatewayName"><br>
-    Portal Username: <input type="text" name="portalUserName"><br>
-    Contact Email: <input type="text" name="email">
-
-    <input type="submit" value="Submit">
-</form>
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/credential-store/show-redirect.jsp
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/credential-store/show-redirect.jsp b/modules/rest/webapp/src/main/webapp/credential-store/show-redirect.jsp
deleted file mode 100644
index 84b54cf..0000000
--- a/modules/rest/webapp/src/main/webapp/credential-store/show-redirect.jsp
+++ /dev/null
@@ -1,44 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-  
-<%@ page contentType="text/html;charset=UTF-8" language="java" %>
-
-<%
-    String redirectUrlInRequest = (String) request.getAttribute("redirectUrl");
-%>
-
-<html>
-<head>
-    <script type="text/javascript">
-        <!--
-        function redirect(){
-            window.location = "<%=redirectUrlInRequest%>"
-        }
-        //-->
-    </script>
-</head>
-<body onLoad="setTimeout('redirect()', 1000)">
-<h2>You will be now redirect to MyProxy portal !</h2>
-<p>
-    If your browser didn't redirect to MyProxy Portal within 1 minute click following link,
-    <br><br> <a href="<%=redirectUrlInRequest%>"><%=redirectUrlInRequest%></a>
-</p>
-
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/credential-store/success.jsp
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/credential-store/success.jsp b/modules/rest/webapp/src/main/webapp/credential-store/success.jsp
deleted file mode 100644
index f2964d0..0000000
--- a/modules/rest/webapp/src/main/webapp/credential-store/success.jsp
+++ /dev/null
@@ -1,25 +0,0 @@
-<%--
-  ~ Licensed to the Apache Software Foundation (ASF) under one
-  ~ or more contributor license agreements. See the NOTICE file
-  ~ distributed with this work for additional information
-  ~ regarding copyright ownership. The ASF licenses this file
-  ~ to you under the Apache License, Version 2.0 (the
-  ~ "License"); you may not use this file except in compliance
-  ~ with the License. You may obtain a copy of the License at
-  ~
-  ~ http://www.apache.org/licenses/LICENSE-2.0
-  ~
-  ~ Unless required by applicable law or agreed to in writing,
-  ~ software distributed under the License is distributed on an
-  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  ~ KIND, either express or implied. See the License for the
-  ~ specific language governing permissions and limitations
-  ~ under the License.
-  --%>
-  
-<html>
-<body>
-<h1>Credential Store</h1>
-<p>Certificate Successfully Stored !</p>
-</body>
-</html>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/webapp/src/main/webapp/images/airavata-logo-2.png
----------------------------------------------------------------------
diff --git a/modules/rest/webapp/src/main/webapp/images/airavata-logo-2.png b/modules/rest/webapp/src/main/webapp/images/airavata-logo-2.png
deleted file mode 100644
index 4baf51b..0000000
Binary files a/modules/rest/webapp/src/main/webapp/images/airavata-logo-2.png and /dev/null differ


[17/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/GridFTPFileTransferClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/GridFTPFileTransferClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/GridFTPFileTransferClient.java
deleted file mode 100644
index 7d6530b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/GridFTPFileTransferClient.java
+++ /dev/null
@@ -1,238 +0,0 @@
-///*
-// *
-// * Licensed to the Apache Software Foundation (ASF) under one
-// * or more contributor license agreements.  See the NOTICE file
-// * distributed with this work for additional information
-// * regarding copyright ownership.  The ASF licenses this file
-// * to you under the Apache License, Version 2.0 (the
-// * "License"); you may not use this file except in compliance
-// * with the License.  You may obtain a copy of the License at
-// *
-// *   http://www.apache.org/licenses/LICENSE-2.0
-// *
-// * Unless required by applicable law or agreed to in writing,
-// * software distributed under the License is distributed on an
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// * KIND, either express or implied.  See the License for the
-// * specific language governing permissions and limitations
-// * under the License.
-// *
-// */
-//
-//package org.apache.airavata.xbaya.globus;
-//
-//import org.globusonline.transfer.APIError;
-//import org.globusonline.transfer.BaseTransferAPIClient;
-//import org.globusonline.transfer.JSONTransferAPIClient;
-//import org.json.JSONArray;
-//import org.json.JSONException;
-//import org.json.JSONObject;
-//
-//import java.io.IOException;
-//import java.security.GeneralSecurityException;
-//import java.text.DateFormat;
-//import java.text.SimpleDateFormat;
-//import java.util.Date;
-//import java.util.HashMap;
-//import java.util.Iterator;
-//import java.util.Map;
-//
-//public class GridFTPFileTransferClient {
-//    private JSONTransferAPIClient client;
-//    private static DateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
-//
-//    public GridFTPFileTransferClient(JSONTransferAPIClient client) {
-//        this.client = client;
-//    }
-//
-//    public static void main(String args[]) {
-//        String username = "heshan";
-//        String caFile = "/home/heshan/Dev/globusonline/transfer-api-client-java.git/trunk/ca/gd-bundle_ca.cert";
-//        String certFile = "/tmp/x509up_u780936";
-//        String keyFile = "/tmp/x509up_u780936";
-//        String baseUrl = null;
-//
-//        String sourceEndpoint = "xsede#ranger";
-//        String sourceFilePath = "~/tmp.log";
-//        String destEndpoint = "xsede#trestles";
-//        String destFilePath = "~/tmp.log.copy";
-//
-//        // String destEndpoint = "heshan#my_testEndpoint";
-//        // String sourceFilePath = "~/var_tables.mod";
-//        try {
-//            JSONTransferAPIClient c = new JSONTransferAPIClient(username, caFile, certFile, keyFile, baseUrl);
-//            System.out.println("base url: " + c.getBaseUrl());
-//            GridFTPFileTransferClient e = new GridFTPFileTransferClient(c);
-//            e.transfer(sourceEndpoint, sourceFilePath, destEndpoint, destFilePath);
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-//    }
-//
-//    /**
-//     * Transfers a file from source endpoint to destination endpoint.
-//     * 
-//     * @param sourceEndpoint
-//     *            Source endpoint
-//     * @param sourceFilePath
-//     *            Source file path
-//     * @param destEndpoint
-//     *            Destination endpoint
-//     * @param destFilePath
-//     *            Destination file path
-//     * @throws IOException
-//     *             IOException
-//     * @throws JSONException
-//     *             JSONException
-//     * @throws GeneralSecurityException
-//     *             GeneralSecurityException
-//     * @throws APIError
-//     *             APIError
-//     */
-//    public void transfer(String sourceEndpoint, String sourceFilePath, String destEndpoint, String destFilePath)
-//            throws IOException, JSONException, GeneralSecurityException, APIError {
-//        System.out.println("Starting transfer...");
-//
-//        // displayTasksummary();
-//        // displayTaskList(60 * 60 * 24 * 7); // tasks at most a week old
-//        // displayEndpointList();
-//
-//        if (!autoActivate(sourceEndpoint) || !autoActivate(destEndpoint)) {
-//            System.err.println("Unable to auto activate go tutorial endpoints, " + " exiting");
-//            return;
-//        }
-//
-//        // displayLs(sourceEndpoint, "~");
-//        // displayLs(destEndpoint, "~");
-//
-//        JSONTransferAPIClient.Result r = client.getResult(FileTransferConstants.SUBMISSION_ID_ENDPOINT);
-//        String submissionId = r.document.getString(FileTransferConstants.VALUE);
-//        JSONObject transfer = new JSONObject();
-//        transfer.put(FileTransferConstants.DATA_TYPE, FileTransferConstants.TRANSFER);
-//        transfer.put(FileTransferConstants.SUBMISSION_ID, submissionId);
-//        JSONObject item = new JSONObject();
-//        item.put(FileTransferConstants.DATA_TYPE, FileTransferConstants.TRANSFER_ITEM);
-//        item.put(FileTransferConstants.SOURCE_ENDPOINT, sourceEndpoint);
-//        item.put(FileTransferConstants.SOURCE_PATH, sourceFilePath);
-//        item.put(FileTransferConstants.DESTINATION_ENDPOINT, destEndpoint);
-//        item.put(FileTransferConstants.DESTINATION_PATH, destFilePath);
-//        transfer.append(FileTransferConstants.DATA, item);
-//
-//        r = client.postResult(FileTransferConstants.TRANSFER_ENDPOINT, transfer.toString(), null);
-//        String taskId = r.document.getString(FileTransferConstants.TASK_ID);
-//        if (!waitForTask(taskId, 120)) {
-//            System.out.println("Transfer not complete after 2 minutes, exiting");
-//            return;
-//        }
-//
-//        System.out.println("Transfer completed...");
-//
-//        // displayTasksummary();
-//        // displayLs(destEndpoint, "~");
-//    }
-//
-//    public void displayTasksummary() throws IOException, JSONException, GeneralSecurityException, APIError {
-//        JSONTransferAPIClient.Result r = client.getResult("/tasksummary");
-//        System.out.println("Task Summary for " + client.getUsername() + ": ");
-//        Iterator keysIter = r.document.sortedKeys();
-//        while (keysIter.hasNext()) {
-//            String key = (String) keysIter.next();
-//            if (!key.equals("DATA_TYPE"))
-//                System.out.println("  " + key + ": " + r.document.getString(key));
-//        }
-//    }
-//
-//    public void displayTaskList(long maxAge) throws IOException, JSONException, GeneralSecurityException, APIError {
-//        Map<String, String> params = new HashMap<String, String>();
-//        if (maxAge > 0) {
-//            long minTime = System.currentTimeMillis() - 1000 * maxAge;
-//            params.put("filter", "request_time:" + isoDateFormat.format(new Date(minTime)) + ",");
-//        }
-//        JSONTransferAPIClient.Result r = client.getResult("/task_list", params);
-//
-//        int length = r.document.getInt("length");
-//        if (length == 0) {
-//            System.out.println("No tasks were submitted in the last " + maxAge + " seconds");
-//            return;
-//        }
-//        JSONArray tasksArray = r.document.getJSONArray("DATA");
-//        for (int i = 0; i < tasksArray.length(); i++) {
-//            JSONObject taskObject = tasksArray.getJSONObject(i);
-//            System.out.println("Task " + taskObject.getString("task_id") + ":");
-//            displayTask(taskObject);
-//        }
-//    }
-//
-//    private static void displayTask(JSONObject taskObject) throws JSONException {
-//        Iterator keysIter = taskObject.sortedKeys();
-//        while (keysIter.hasNext()) {
-//            String key = (String) keysIter.next();
-//            if (!key.equals("DATA_TYPE") && !key.equals("LINKS") && !key.endsWith("_link")) {
-//                System.out.println("  " + key + ": " + taskObject.getString(key));
-//            }
-//        }
-//    }
-//
-//    public boolean autoActivate(String endpointName) throws IOException, JSONException, GeneralSecurityException,
-//            APIError {
-//        // Note: in a later release, auto-activation will be done at
-//        // /autoactivate instead.
-//        String resource = BaseTransferAPIClient.endpointPath(endpointName) + "/autoactivate";
-//        JSONTransferAPIClient.Result r = client.postResult(resource, null, null);
-//        String code = r.document.getString("code");
-//        if (code.startsWith("AutoActivationFailed")) {
-//            return false;
-//        }
-//        return true;
-//    }
-//
-//    public void displayLs(String endpointName, String path) throws IOException, JSONException,
-//            GeneralSecurityException, APIError {
-//        Map<String, String> params = new HashMap<String, String>();
-//        if (path != null) {
-//            params.put("path", path);
-//        }
-//        String resource = BaseTransferAPIClient.endpointPath(endpointName) + "/ls";
-//        JSONTransferAPIClient.Result r = client.getResult(resource, params);
-//        System.out.println("Contents of " + path + " on " + endpointName + ":");
-//
-//        JSONArray fileArray = r.document.getJSONArray("DATA");
-//        for (int i = 0; i < fileArray.length(); i++) {
-//            JSONObject fileObject = fileArray.getJSONObject(i);
-//            System.out.println("  " + fileObject.getString("name"));
-//            Iterator keysIter = fileObject.sortedKeys();
-//            while (keysIter.hasNext()) {
-//                String key = (String) keysIter.next();
-//                if (!key.equals("DATA_TYPE") && !key.equals("LINKS") && !key.endsWith("_link") && !key.equals("name")) {
-//                    System.out.println("    " + key + ": " + fileObject.getString(key));
-//                }
-//            }
-//        }
-//
-//    }
-//
-//    public boolean waitForTask(String taskId, int timeout) throws IOException, JSONException, GeneralSecurityException,
-//            APIError {
-//        String status = "ACTIVE";
-//        JSONTransferAPIClient.Result r;
-//
-//        String resource = "/task/" + taskId;
-//        Map<String, String> params = new HashMap<String, String>();
-//        params.put("fields", "status");
-//
-//        while (timeout > 0 && status.equals("ACTIVE")) {
-//            r = client.getResult(resource, params);
-//            status = r.document.getString("status");
-//            try {
-//                Thread.sleep(10000);
-//            } catch (InterruptedException e) {
-//                return false;
-//            }
-//            timeout -= 10;
-//        }
-//
-//        if (status.equals("ACTIVE"))
-//            return false;
-//        return true;
-//    }
-//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
deleted file mode 100644
index 3ecf54c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.graph.controller;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.airavata.workflow.model.graph.Edge;
-import org.apache.airavata.workflow.model.graph.Graph;
-import org.apache.airavata.workflow.model.graph.GraphPiece;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
-import org.apache.airavata.workflow.model.graph.Port;
-import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
-import org.apache.airavata.workflow.model.graph.amazon.TerminateInstanceNode;
-import org.apache.airavata.workflow.model.graph.dynamic.DynamicNode;
-import org.apache.airavata.workflow.model.graph.subworkflow.SubWorkflowNode;
-import org.apache.airavata.workflow.model.graph.system.BlockNode;
-import org.apache.airavata.workflow.model.graph.system.ConstantNode;
-import org.apache.airavata.workflow.model.graph.system.DifferedInputNode;
-import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
-import org.apache.airavata.workflow.model.graph.system.EndBlockNode;
-import org.apache.airavata.workflow.model.graph.system.EndDoWhileNode;
-import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
-import org.apache.airavata.workflow.model.graph.system.EndifNode;
-import org.apache.airavata.workflow.model.graph.system.ExitNode;
-import org.apache.airavata.workflow.model.graph.system.ForEachNode;
-import org.apache.airavata.workflow.model.graph.system.IfNode;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.system.MemoNode;
-import org.apache.airavata.workflow.model.graph.system.OutputNode;
-import org.apache.airavata.workflow.model.graph.system.ReceiveNode;
-import org.apache.airavata.workflow.model.graph.system.S3InputNode;
-import org.apache.airavata.workflow.model.graph.system.StreamSourceNode;
-import org.apache.airavata.workflow.model.graph.ws.WSNode;
-import org.apache.airavata.workflow.model.graph.ws.WorkflowNode;
-import org.apache.airavata.xbaya.ui.graph.EdgeGUI;
-import org.apache.airavata.xbaya.ui.graph.GraphGUI;
-import org.apache.airavata.xbaya.ui.graph.GraphPieceGUI;
-import org.apache.airavata.xbaya.ui.graph.NodeGUI;
-import org.apache.airavata.xbaya.ui.graph.PortGUI;
-import org.apache.airavata.xbaya.ui.graph.amazon.InstanceNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.amazon.TerminateInstanceNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.dynamic.DynamicNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.subworkflow.SubWorkflowNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.BlockNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.ConstantNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.DifferedInputNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.DoWhileNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.EndBlockNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.EndDoWhileNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.EndForEachNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.EndifNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.ExitNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.ForEachNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.IfNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.InputNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.MemoNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.OutputNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.ReceiveNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.S3InputNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.StreamSourceNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.ws.WSNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.ws.WorkflowNodeGUI;
-
-public class NodeController {
-	private static Map<GraphPiece,GraphPieceGUI> nodeMap=new HashMap<GraphPiece, GraphPieceGUI>();
-//	private static Map<Port,PortGUI> portMap=new HashMap<Port, PortGUI>();
-
-	public static GraphPieceGUI getGUI(GraphPiece node){
-		if (!nodeMap.containsKey(node)){
-			nodeMap.put(node,createNodeGUI(node));
-		}
-		return nodeMap.get(node);
-	}
-
-	public static GraphGUI getGUI(Graph node){
-		return (GraphGUI)getGUI((GraphPiece)node);
-	}
-
-	public static NodeGUI getGUI(Node node){
-		return (NodeGUI)getGUI((GraphPiece)node);
-	}
-
-	public static EdgeGUI getGUI(Edge port){
-		return (EdgeGUI)getGUI((GraphPiece)port);
-	}
-
-	public static PortGUI getGUI(Port port){
-		return (PortGUI)getGUI((GraphPiece)port);
-	}
-
-//	public static PortGUI getGUI(Port node){
-//		if (!portMap.containsKey(node)){
-//			portMap.put(node,createPortGUI(node));
-//		}
-//		return portMap.get(node);
-//	}
-//
-//	private static PortGUI createPortGUI(Port port){
-//		PortGUI portGUI=new PortGUI(port);
-//		return portGUI;
-//	}
-
-	private static GraphPieceGUI createNodeGUI(GraphPiece node){
-		GraphPieceGUI nodeGUI=null;
-		if (node instanceof SubWorkflowNode){
-		    nodeGUI=new SubWorkflowNodeGUI((SubWorkflowNode)node);
-		} else if (node instanceof DynamicNode){
-		    nodeGUI=new DynamicNodeGUI((DynamicNode)node);
-		} else if (node instanceof ConstantNode){
-		    nodeGUI=new ConstantNodeGUI((ConstantNode)node);
-		} else if (node instanceof IfNode){
-		    nodeGUI=new IfNodeGUI((IfNode)node);
-		} else if (node instanceof ExitNode){
-		    nodeGUI=new ExitNodeGUI((ExitNode)node);
-		} else if (node instanceof OutputNode){
-		    nodeGUI=new OutputNodeGUI((OutputNode)node);
-		} else if (node instanceof DifferedInputNode){
-		    nodeGUI=new DifferedInputNodeGUI((DifferedInputNode)node);
-		} else if (node instanceof BlockNode){
-		    nodeGUI=new BlockNodeGUI((BlockNode)node);
-		} else if (node instanceof EndForEachNode){
-		    nodeGUI=new EndForEachNodeGUI((EndForEachNode)node);
-		} else if (node instanceof S3InputNode){
-		    nodeGUI=new S3InputNodeGUI((S3InputNode)node);
-		} else if (node instanceof ForEachNode){
-		    nodeGUI=new ForEachNodeGUI((ForEachNode)node);
-		}else if (node instanceof DoWhileNode){
-		    nodeGUI=new DoWhileNodeGUI((DoWhileNode)node);
-		} else if (node instanceof EndDoWhileNode){
-		    nodeGUI=new EndDoWhileNodeGUI((EndDoWhileNode)node);
-		}  else if (node instanceof MemoNode){
-		    nodeGUI=new MemoNodeGUI((MemoNode)node);
-		} else if (node instanceof ReceiveNode){
-		    nodeGUI=new ReceiveNodeGUI((ReceiveNode)node);
-		} else if (node instanceof InputNode){
-		    nodeGUI=new InputNodeGUI((InputNode)node);
-		} else if (node instanceof EndifNode){
-		    nodeGUI=new EndifNodeGUI((EndifNode)node);
-		} else if (node instanceof EndBlockNode){
-		    nodeGUI=new EndBlockNodeGUI((EndBlockNode)node);
-		} else if (node instanceof WorkflowNode){
-		    nodeGUI=new WorkflowNodeGUI((WorkflowNode)node);
-		} else if (node instanceof WSNode){
-		    nodeGUI=new WSNodeGUI((WSNode)node);
-//		} else if (node instanceof Graph){
-//		    nodeGUI=new GraphGUI((Graph)node);
-//		} else if (node instanceof GraphPiece){
-//		    nodeGUI=new GraphPieceGUI((GraphPiece)node);
-		} else if (node instanceof Port){
-		    nodeGUI=new PortGUI((Port)node);
-		} else if (node instanceof Edge){
-		    nodeGUI=new EdgeGUI((Edge)node);
-		} else if (node instanceof TerminateInstanceNode){
-		    nodeGUI=new TerminateInstanceNodeGUI((TerminateInstanceNode)node);
-		} else if (node instanceof InstanceNode){
-		    nodeGUI=new InstanceNodeGUI((InstanceNode)node);
-		} else if (node instanceof StreamSourceNode){
-		    nodeGUI=new StreamSourceNodeGUI((StreamSourceNode)node);
-		} else if (node instanceof Graph){
-		    nodeGUI=new GraphGUI((Graph)node);
-		}
-
-		return nodeGUI;
-	}
-
-	public static boolean isFinished(Node node){
-		return node.getState() == NodeExecutionState.FINISHED;
-	}
-	public static boolean isWaiting(Node node){
-		return node.getState() == NodeExecutionState.WAITING;
-	}
-	public static boolean isRunning(Node node){
-		return node.getState() == NodeExecutionState.EXECUTING;
-	}
-	public static boolean isFailed(Node node){
-		return node.getState() == NodeExecutionState.FAILED;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java
deleted file mode 100644
index a9b1027..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-package org.apache.airavata.xbaya.interpretor;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutorService;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.airavata.workflow.model.component.Component;
-import org.apache.airavata.workflow.model.component.ws.WSComponent;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.workflow.model.graph.ControlPort;
-import org.apache.airavata.workflow.model.graph.DataPort;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
-import org.apache.airavata.workflow.model.graph.impl.EdgeImpl;
-import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
-import org.apache.airavata.workflow.model.graph.system.EndDoWhileNode;
-import org.apache.airavata.xbaya.graph.controller.NodeController;
-import org.apache.airavata.xbaya.invoker.Invoker;
-import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
-import org.apache.airavata.xbaya.util.InterpreterUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class DoWhileHandler implements Callable<Boolean> {
-	private static Logger log = LoggerFactory.getLogger(DoWhileHandler.class);
-	private DoWhileNode dowhilenode;
-	private Map<Node, Invoker> invokerMap;
-	private ArrayList<Node> waitingNode;
-	private ArrayList<Node> finishedNodes;
-	private WorkflowInterpreter interpreter;
-	private ExecutorService threadExecutor;
-
-	/**
-	 *
-	 * Constructs a DoWhileHandler.
-	 *
-	 * @param node
-	 * @param invokerMap
-	 * @param waitingNode
-	 * @param finishedNodes
-	 * @param interpreter
-	 */
-
-	public DoWhileHandler(DoWhileNode node, Map<Node, Invoker> invokerMap, ArrayList<Node> waitingNode, ArrayList<Node> finishedNodes,
-			WorkflowInterpreter interpreter, ExecutorService threadExecutor) {
-		this.dowhilenode = node;
-		this.invokerMap = invokerMap;
-		this.waitingNode = waitingNode;
-		this.finishedNodes = finishedNodes;
-		this.interpreter = interpreter;
-		this.threadExecutor = threadExecutor;
-	}
-
-	/**
-	 * To evaluate dowhile condition with the input values
-	 *
-	 * @param doWhileNode
-	 * @param inputPorts
-	 * @param invokerMap
-	 * @return boolean value
-	 * @throws WorkFlowInterpreterException
-	 * @throws XBayaException
-	 */
-	private boolean evaluate(DoWhileNode doWhileNode, List<DataPort> inputPorts, Map<Node, Invoker> invokerMap) throws WorkFlowInterpreterException,
-			WorkflowException {
-		String booleanExpression = doWhileNode.getXpath();
-		if (booleanExpression == null) {
-			throw new WorkFlowInterpreterException("XPath for if cannot be null");
-		}
-
-		int i = 0;
-		for (DataPort port : inputPorts) {
-			Object inputVal1 = InterpreterUtil.findInputFromPort(port, invokerMap);
-			if (null == inputVal1) {
-				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + doWhileNode.getID());
-			}
-		    booleanExpression = booleanExpression.replaceAll("\\$" + i, "'" + inputVal1 + "'");
-			i++;
-		}
-		Boolean result = new Boolean(false);
-		// Now the XPath expression
-		try {
-			XPathFactory xpathFact = XPathFactory.newInstance();
-			XPath xpath = xpathFact.newXPath();
-			result = (Boolean) xpath.evaluate(booleanExpression, booleanExpression, XPathConstants.BOOLEAN);
-		} catch (XPathExpressionException e) {
-			throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
-		}
-		return result.booleanValue();
-	}
-
-	/**
-	 * To get only web service components attached to dowhile
-	 *
-	 * @param waitingNode
-	 * @return list
-	 */
-	private ArrayList<Node> handleDowhile(ArrayList<Node> waitingNode, ArrayList<Node> finishedNodes) {
-		ArrayList<Node> list = new ArrayList<Node>();
-		for (Node node : waitingNode) {
-			Component component = node.getComponent();
-			if (component instanceof WSComponent) {
-				ControlPort control = node.getControlInPort();
-				boolean controlDone = true;
-				if (control != null) {
-					for (EdgeImpl edge : control.getEdges()) {
-						controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode())
-								|| ((ControlPort) edge.getFromPort()).isConditionMet());
-					}
-				}
-
-				/*
-				 * Check for input ports
-				 */
-				List<DataPort> inputPorts = node.getInputPorts();
-				boolean inputsDone = true;
-				for (DataPort dataPort : inputPorts) {
-					inputsDone = inputsDone && finishedNodes.contains(dataPort.getFromNode());
-				}
-				if (inputsDone && controlDone) {
-					list.add(node);
-				}
-			}
-		}
-
-		return list;
-	}
-
-	/**
-	 * @see java.util.concurrent.Callable#call()
-	 */
-	@Override
-	public Boolean call() throws Exception {
-		log.debug("Invoked Dowhile node");
-		SystemComponentInvoker dowhileinvoker = new SystemComponentInvoker();
-		// TODO check for multiple input case
-		Object inputVal1 = InterpreterUtil.findInputFromPort(this.dowhilenode.getInputPort(0), this.invokerMap);
-		dowhileinvoker.addOutput(this.dowhilenode.getOutputPort(0).getID(), inputVal1);
-		this.invokerMap.put(this.dowhilenode, dowhileinvoker);
-		this.finishedNodes.add(this.dowhilenode);
-
-		ArrayList<Node> readyNodes = this.handleDowhile(this.waitingNode, this.finishedNodes);
-
-		// When you are starting 1st time its getting input from 1st node and
-		// invoking all the webservice components
-		if (readyNodes.size() != 1) {
-			throw new WorkflowRuntimeException("More than one dowhile execution not supported");
-		}
-		Node donode = readyNodes.get(0);
-		this.interpreter.handleWSComponent(donode);
-		log.debug("Invoked service " + donode.getName());
-
-		List<DataPort> inputPorts = this.dowhilenode.getInputPorts();
-		boolean runflag = true;
-		while (runflag) {
-			while (true) {
-				if (NodeController.isRunning(donode) || NodeController.isWaiting(donode)) {
-					Thread.sleep(500);
-					log.debug("Service " + donode.getName() + " waiting");
-				} else if (NodeController.isFinished(donode)) {
-					log.debug("Service " + donode.getName() + " Finished");
-					List<DataPort> ports = this.dowhilenode.getOutputPorts();
-					for (int outputPortIndex = 0, inputPortIndex = 1; outputPortIndex < ports.size(); outputPortIndex++) {
-						Object inputValue = InterpreterUtil.findInputFromPort(this.dowhilenode.getInputPort(inputPortIndex), this.invokerMap);
-						dowhileinvoker.addOutput(this.dowhilenode.getOutputPort(outputPortIndex).getID(), inputValue);
-					}
-					break;
-				} else if (NodeController.isFailed(donode)) {
-					log.debug("Service " + donode.getName() + " Failed");
-					runflag = false;
-					dowhilenode.setState(NodeExecutionState.FAILED);
-					this.threadExecutor.shutdown();
-					return false;
-				} else if (donode.isBreak()) {
-					log.debug("Service " + donode.getName() + " set to break");
-					runflag = false;
-					break;
-				} else {
-					log.error("Service " + donode.getName() + " have unknow status");
-					throw new WorkFlowInterpreterException("Unknow status of the node");
-				}
-			}
-
-			this.invokerMap.put(this.dowhilenode, dowhileinvoker);
-			log.debug("Going to evaluate do while expression for " + donode.getName());
-			if (!evaluate(this.dowhilenode, inputPorts, this.invokerMap)) {
-				log.debug("Expression evaluation is false so calling EndDoWhile");
-				runflag = false;
-			} else {
-				if (readyNodes.size() != 1) {
-					throw new WorkFlowInterpreterException("More than one dowhile execution not supported");
-				}
-
-				Node whileNode = readyNodes.get(0);
-				log.debug("Expression evaluation is true so invoking service again " + whileNode.getName());
-
-				this.interpreter.handleWSComponent(whileNode);
-			}
-		}
-		// WS node should be done
-		dowhilenode.setState(NodeExecutionState.FINISHED);
-		EndDoWhileNode endDoWhileNode = this.dowhilenode.getEndDoWhileNode();
-
-		// /////////////////////////////////////////////////////////
-		// // Do WHile finished execution thus we can set the //////
-		// //inputs to the EndDOWHile and resume the executions/////
-		SystemComponentInvoker invoker = new SystemComponentInvoker();
-
-		List<DataPort> inputports = endDoWhileNode.getInputPorts();
-
-		for (int inputPortIndex = 0; inputPortIndex < inputports.size(); inputPortIndex++) {
-			Object inputVal = dowhileinvoker.getOutput(inputports.get(inputPortIndex).getFromPort().getID());
-			invoker.addOutput(endDoWhileNode.getOutputPort(inputPortIndex).getID(), inputVal);
-		}
-
-		this.invokerMap.put(endDoWhileNode, invoker);
-		// TODO send mail once the iterations have converged
-
-		endDoWhileNode.setState(NodeExecutionState.FINISHED);
-		this.threadExecutor.shutdown();
-		return true;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
deleted file mode 100644
index c08ee34..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import java.util.List;
-
-public class ExperimentTemplate {
-	private List<WorkflowExecutionTemplate> workflowExecutionTemplates;
-
-	public List<WorkflowExecutionTemplate> getWorkflowExecutionTemplates() {
-		return workflowExecutionTemplates;
-	}
-
-	public void setWorkflowExecutionTemplates(
-			List<WorkflowExecutionTemplate> workflowExecutionTemplates) {
-		this.workflowExecutionTemplates = workflowExecutionTemplates;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java
deleted file mode 100644
index 526610d..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.ws.WSGraph;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
-import org.apache.airavata.ws.monitor.MonitorException;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.graph.controller.NodeController;
-import org.apache.airavata.xbaya.ui.XBayaGUI;
-import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
-import org.apache.airavata.xbaya.ui.graph.subworkflow.SubWorkflowNodeGUI;
-import org.apache.airavata.xbaya.ui.graph.system.DifferedInputHandler;
-import org.apache.airavata.xbaya.ui.utils.Cancelable;
-import org.apache.airavata.xbaya.util.InterpreterUtil;
-
-public class GUIWorkflowInterpreterInteractorImpl implements
-		WorkflowInterpreterInteractor {
-	private XBayaGUI xbayaGUI;
-	private Workflow workflow;
-	private XBayaEngine engine;
-	
-	private Map<String, WaitDialog> taskDialogs = new HashMap<String, WaitDialog>();
-
-	public GUIWorkflowInterpreterInteractorImpl(XBayaEngine engine,
-			Workflow workflow) {
-		this.engine = engine;
-		this.xbayaGUI = engine.getGUI();
-		this.setWorkflow(workflow);
-	}
-
-	@Override
-	public boolean notify(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data) {
-		switch (messageType) {
-		case NODE_STATE_CHANGED:
-			xbayaGUI.getGraphCanvas().repaint();
-			break;
-		case EXECUTION_STATE_CHANGED:
-			WorkflowExecutionState state = (WorkflowExecutionState) data;
-			// if (state==WorkflowExecutionState.PAUSED ||
-			// state==WorkflowExecutionState.STOPPED) {
-			// if (getWorkflow().getExecutionState() ==
-			// WorkflowExecutionState.RUNNING
-			// || getWorkflow().getExecutionState() ==
-			// WorkflowExecutionState.STEP) {
-			// } else {
-			// throw new WorkflowRuntimeException(
-			// "Cannot pause when not running");
-			// }
-			// }
-			getWorkflow().setExecutionState(state);
-			if (state==WorkflowExecutionState.PAUSED){
-				if (config.getWorkflow().getExecutionState() == WorkflowExecutionState.RUNNING
-						|| config.getWorkflow().getExecutionState() == WorkflowExecutionState.STEP) {
-					config.getGUI().getToolbar().getPlayAction()
-							.actionPerformed(null);
-				}
-			}
-			break;
-		case EXECUTION_TASK_START:
-			TaskNotification task = (TaskNotification) data;
-			final WaitDialog waitDialog = new WaitDialog(new Cancelable() {
-				@Override
-				public void cancel() {
-					// Do nothing
-				}
-			}, task.messageTitle, task.message, this.xbayaGUI);
-			new Thread(new Runnable() {
-				@Override
-				public void run() {
-					waitDialog.show();
-				}
-			}).start();
-			taskDialogs.put(task.messageId, waitDialog);
-			break;
-		case EXECUTION_TASK_END:
-			task = (TaskNotification) data;
-			if (taskDialogs.containsKey(task.messageId)) {
-				taskDialogs.get(task.messageId).hide();
-				taskDialogs.remove(task.messageId);
-			}
-			break;
-		case EXECUTION_ERROR:
-			xbayaGUI.getErrorWindow().error((Exception) data);
-			break;
-		case OPEN_SUBWORKFLOW:
-			((SubWorkflowNodeGUI) NodeController.getGUI((Node) data))
-					.openWorkflowTab(config.getGUI());
-			break;
-		case EXECUTION_CLEANUP:
-			this.engine.resetWorkflowInterpreter();
-			try {
-				config.getMonitor().stop();
-			} catch (MonitorException e) {
-				e.printStackTrace();
-			} finally {
-				this.engine.getMonitor().resetEventData();
-			}
-			break;
-		case HANDLE_DEPENDENT_NODES_DIFFERED_INPUTS:
-			ArrayList<Node> waitingNodes = InterpreterUtil.getWaitingNodesDynamically((WSGraph)data);
-			for (Node readyNode : waitingNodes) {
-				DifferedInputHandler.handleDifferredInputsofDependentNodes(
-						readyNode, config.getGUI());
-			}
-			break;
-		default:
-			return false;	
-		}
-		return true;
-	}
-
-	@Override
-	public Object retrieveData(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data)
-			throws Exception {
-		Object result = null;
-		switch (messageType) {
-		case INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW:
-			Workflow subWorkflow= (Workflow) data;
-            WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(subWorkflow,config.getTopic(),config.getMessageBoxURL(), config.getMessageBrokerURL(), config.getRegistry(), config.getConfiguration(), config.getGUI(), this.engine.getMonitor());
-            workflowInterpreterConfiguration.setActOnProvenance(config.isActOnProvenance());
-            workflowInterpreterConfiguration.setSubWorkflow(true);
-            if (config.isTestMode()){
-        		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
-            }
-			result = new WorkflowInterpreter(workflowInterpreterConfiguration, 
-					new GUIWorkflowInterpreterInteractorImpl(engine,
-							config.getWorkflow()));
-			this.engine.registerWorkflowInterpreter((WorkflowInterpreter)result);
-			break;
-//		case INPUT_GSS_CREDENTIAL:
-//			MyProxyChecker myProxyChecker = new MyProxyChecker(this.engine);
-//			myProxyChecker.loadIfNecessary();
-//			MyProxyClient myProxyClient = this.engine.getMyProxyClient();
-//			result = myProxyClient.getProxy();
-//			break;
-//		case INPUT_LEAD_CONTEXT_HEADER:
-//			Node node = (Node) data;
-//			result = XBayaUtil.buildLeadContextHeader(this.getWorkflow(),
-//					config.getConfiguration(),
-//					new MonitorConfiguration(config.getMessageBrokerURL(),
-//							config.getTopic(), true,
-//							config
-//									.getMessageBoxURL()), node.getID(),
-//					null);
-//			break;
-		default:
-			break;
-		}
-		return result;
-	}
-
-	public Workflow getWorkflow() {
-		return workflow;
-	}
-
-	public void setWorkflow(Workflow workflow) {
-		this.workflow = workflow;
-	}
-
-	@Override
-	public void pauseExecution(WorkflowInterpreterConfiguration config) {
-		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.PAUSED);
-	}
-
-	@Override
-	public void resumeExecution(WorkflowInterpreterConfiguration config) {
-		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.RUNNING);
-	}
-
-	@Override
-	public void terminateExecution(WorkflowInterpreterConfiguration config) {
-		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.STOPPED);
-	}
-
-	@Override
-	public boolean isExecutionPaused(WorkflowInterpreterConfiguration config) {
-		return config.getWorkflow().getExecutionState()==WorkflowExecutionState.PAUSED;
-	}
-
-	@Override
-	public boolean isExecutionTerminated(WorkflowInterpreterConfiguration config) {
-		return config.getWorkflow().getExecutionState()==WorkflowExecutionState.STOPPED;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/HeaderConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/HeaderConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/HeaderConstants.java
deleted file mode 100644
index 1e0bf7c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/HeaderConstants.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-public interface HeaderConstants {
-
-    public static final String HEADER_ELEMENT_GFAC = "gfac";
-    public static final String HEADER_ELEMENT_REGISTRY = "registry";
-    public static final String HEADER_ELEMENT_PROXYSERVER = "proxyserver";
-    public static final String HEADER_ELEMENT_MSGBOX = "msgbox";
-    public static final String HEADER_ELEMENT_DSC = "dsc";
-    public static final String HEADER_ELEMENT_BROKER = "broker";
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java
deleted file mode 100644
index 32bd66b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
-
-public class SSWorkflowInterpreterInteractorImpl implements
-		WorkflowInterpreterInteractor {
-	
-	@Override
-	public boolean notify(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data) {
-		switch (messageType) {
-		case NODE_STATE_CHANGED:
-			break;
-		case EXECUTION_STATE_CHANGED:
-			WorkflowExecutionState state = (WorkflowExecutionState) data;
-			config.getWorkflow().setExecutionState(state);
-//			if (state == WorkflowExecutionState.PAUSED
-//					|| state == WorkflowExecutionState.STOPPED) {
-//				config.getWorkflow().setExecutionState(WorkflowExecutionState.STOPPED);
-//			}else if (state == WorkflowExecutionState.RUNNING) {
-//				config.getWorkflow().setExecutionState(WorkflowExecutionState.RUNNING);
-//			}
-			break;
-		case EXECUTION_TASK_START:
-			break;
-		case EXECUTION_TASK_END:
-			break;
-		case OPEN_SUBWORKFLOW:
-			break;
-		case HANDLE_DEPENDENT_NODES_DIFFERED_INPUTS:
-				break;
-		default:
-			return false;	
-		}
-		return true;
-	}
-
-	@Override
-	public Object retrieveData(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data)
-			throws Exception {
-		Object result = null;
-		switch (messageType) {
-		case INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW:
-			Workflow subWorkflow= (Workflow) data;
-            WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(subWorkflow,config.getTopic(),config.getMessageBoxURL(), config.getMessageBrokerURL(), config.getRegistry(), config.getConfiguration(), config.getGUI(), config.getMonitor());
-            if (config.isTestMode()){
-        		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
-            }
-			result = new WorkflowInterpreter(workflowInterpreterConfiguration
-					, 
-					new SSWorkflowInterpreterInteractorImpl());
-			break;
-//		case INPUT_GSS_CREDENTIAL:
-//			WorkflowInterpreter w = (WorkflowInterpreter) data;
-//			result = SecurityUtil.getGSSCredential(w.getUsername(),
-//					w.getPassword(), w.getConfig().getConfiguration().getMyProxyServer());
-//			break;
-//		case INPUT_LEAD_CONTEXT_HEADER:
-//			Node node = (Node) data;
-//			result = XBayaUtil.buildLeadContextHeader(config.getWorkflow(), config.getConfiguration(),
-//					new MonitorConfiguration(config.getMessageBrokerURL(),
-//							config.getTopic(), true,
-//							config.getMessageBoxURL()), node.getID(),
-//					null);
-//			break;
-		default:
-			break;
-		}
-		return result;
-	}
-
-	@Override
-	public void pauseExecution(WorkflowInterpreterConfiguration config) {
-		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.PAUSED);
-	}
-
-	@Override
-	public void resumeExecution(WorkflowInterpreterConfiguration config) {
-		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.RUNNING);
-	}
-
-	@Override
-	public void terminateExecution(WorkflowInterpreterConfiguration config) {
-		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.STOPPED);
-	}
-
-	@Override
-	public boolean isExecutionPaused(WorkflowInterpreterConfiguration config) {
-		return config.getWorkflow().getExecutionState()==WorkflowExecutionState.PAUSED;
-	}
-
-	@Override
-	public boolean isExecutionTerminated(WorkflowInterpreterConfiguration config) {
-		return config.getWorkflow().getExecutionState()==WorkflowExecutionState.STOPPED;
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java
deleted file mode 100644
index 432bc56..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import java.net.URI;
-import java.util.List;
-
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.system.OutputNode;
-import org.apache.airavata.workflow.model.graph.util.GraphUtil;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.graph.controller.NodeController;
-import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
-import org.apache.airavata.xbaya.jython.lib.StandaloneServiceNotificationSender;
-import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
-import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
-import org.apache.axis2.addressing.EndpointReference;
-import org.python.core.PyObject;
-
-public class StandaloneNotificationSender implements WorkflowNotifiable {
-
-    private Workflow workflow;
-    private URI workflowID;
-
-    public StandaloneNotificationSender(String topic, Workflow workflow) {
-        this.workflow = workflow;
-        this.workflowID = URI.create(StringUtil.convertToJavaIdentifier(topic));
-    }
-
-    @Override
-    public EndpointReference getEventSink() {
-        return new EndpointReference(XBayaConstants.DEFAULT_BROKER_URL.toString());
-    }
-
-    @Override
-    public void workflowStarted(PyObject[] args, String[] keywords) {
-        List<InputNode> inputs = GraphUtil.getInputNodes(this.workflow.getGraph());
-        for (InputNode inputNode : inputs) {
-            inputNode.setState(NodeExecutionState.FINISHED);
-        }
-
-    }
-
-    @Override
-    public void workflowStarted(Object[] args, String[] keywords) {
-        List<InputNode> inputs = GraphUtil.getInputNodes(this.workflow.getGraph());
-        for (InputNode inputNode : inputs) {
-            inputNode.setState(NodeExecutionState.FINISHED);
-        }
-    }
-
-    @Override
-    public void workflowFinished(Object[] args, String[] keywords) {
-        List<OutputNode> outputs = GraphUtil.getOutputNodes(this.workflow.getGraph());
-        for (OutputNode outputNode : outputs) {
-        	outputNode.setState(NodeExecutionState.EXECUTING);
-        }
-
-    }
-
-    @Override
-    public void sendingPartialResults(Object[] args, String[] keywords) {
-        // noop
-
-    }
-
-    @Override
-    public void workflowFinished(PyObject[] args, String[] keywords) {
-        List<OutputNode> outputs = GraphUtil.getOutputNodes(this.workflow.getGraph());
-        for (OutputNode outputNode : outputs) {
-        	outputNode.setState(NodeExecutionState.EXECUTING);
-        }
-
-    }
-
-    @Override
-    public void workflowTerminated() {
-        // noop
-
-    }
-
-    @Override
-    public void workflowFailed(String message) {
-        // noop
-
-    }
-
-    @Override
-    public void workflowFailed(Throwable e) {
-        // noop
-
-    }
-
-    @Override
-    public void workflowFailed(String message, Throwable e) {
-        // noop
-
-    }
-
-    @Override
-    public ServiceNotifiable createServiceNotificationSender(String nodeID) {
-        return new StandaloneServiceNotificationSender(this.workflow, this.workflowID);
-    }
-
-    @Override
-    public void cleanup(){
-
-    }
-
-    public String getTopic() {
-        return this.workflowID.toASCIIString();
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java
deleted file mode 100644
index d6a075a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.xbaya.invoker.Invoker;
-
-import xsul.wsif.WSIFMessage;
-import xsul.xwsif_runtime.WSIFClient;
-
-public class SystemComponentInvoker implements Invoker {
-
-    private Map<String, Object> outputs = new Hashtable<String, Object>();
-
-    /**
-     * 
-     * @param key
-     * @param value
-     */
-    public void addOutput(String key, Object value) {
-        outputs.put(key, value);
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutput(java.lang.String)
-     */
-    @Override
-    public Object getOutput(String name) {
-        Object out = null;
-        while (out == null) {
-            try {
-                out = this.outputs.get(name);
-                Thread.sleep(200);
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-        }
-        return out;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutputs()
-     */
-    @Override
-    public WSIFMessage getOutputs() {
-        return null;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#invoke()
-     */
-    @Override
-    public boolean invoke() {
-        return true;
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
-     */
-    @Override
-    public void setInput(String name, Object value) {
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.wXPath Operatorsorkflow.Invoker#setOperation(java.lang.String)
-     */
-    @Override
-    public void setOperation(String operationName) {
-    }
-
-    /**
-     * @see org.apache.airavata.xbaya.invoker.Invoker#setup()
-     */
-    @Override
-    public void setup() {
-    }
-
-    @Override
-    public WSIFClient getClient() {
-        return null;
-    }
-
-    @Override
-    public WSIFMessage getInputs() throws WorkflowException {
-        return null;
-    }
-
-    @Override
-    public WSIFMessage getFault() throws WorkflowException {
-        return null;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkFlowInterpreterException.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkFlowInterpreterException.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkFlowInterpreterException.java
deleted file mode 100644
index 7ec87e5..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkFlowInterpreterException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-public class WorkFlowInterpreterException extends RuntimeException {
-
-    public WorkFlowInterpreterException() {
-        super();
-    }
-
-    public WorkFlowInterpreterException(String message) {
-        super(message);
-    }
-
-    public WorkFlowInterpreterException(Throwable e) {
-        super(e);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java
deleted file mode 100644
index 98743a4..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-public enum WorkflowExecutionMessage {
-	NODE_STATE_CHANGED, 
-	//this.engine.getGUI().getGraphCanvas().repaint();
-	EXECUTION_STATE_CHANGED,
-	EXECUTION_RESUME,
-	EXECUTION_TASK_START,
-	EXECUTION_TASK_END,
-	EXECUTION_ERROR,
-	EXECUTION_CLEANUP,
-	OPEN_SUBWORKFLOW,
-	HANDLE_DEPENDENT_NODES_DIFFERED_INPUTS,
-	INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW,
-	INPUT_GSS_CREDENTIAL,
-	INPUT_LEAD_CONTEXT_HEADER,
-	INPUT_GFAC_INVOKER,
-	
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
deleted file mode 100644
index 4c34032..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import java.util.List;
-
-import org.apache.airavata.client.api.ExperimentAdvanceOptions;
-import org.apache.airavata.workflow.model.wf.WorkflowInput;
-
-public class WorkflowExecutionTemplate {
-	private String workflowTemplateName;
-	private List<WorkflowInput> input;
-	private ExperimentAdvanceOptions advanceOptions;
-	public String getWorkflowTemplateName() {
-		return workflowTemplateName;
-	}
-	public void setWorkflowTemplateName(String workflowTemplateName) {
-		this.workflowTemplateName = workflowTemplateName;
-	}
-	public List<WorkflowInput> getInput() {
-		return input;
-	}
-	public void setInput(List<WorkflowInput> input) {
-		this.input = input;
-	}
-	public ExperimentAdvanceOptions getAdvanceOptions() {
-		return advanceOptions;
-	}
-	public void setAdvanceOptions(ExperimentAdvanceOptions advanceOptions) {
-		this.advanceOptions = advanceOptions;
-	}
-}


[43/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/util/Initialize.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/util/Initialize.java b/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/util/Initialize.java
deleted file mode 100644
index 9a0a0ce..0000000
--- a/modules/registry/airavata-registry-test/src/test/java/org/apache/airavata/registry/api/test/util/Initialize.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied.  See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*
-*/
-
-package org.apache.airavata.registry.api.test.util;
-
-import org.apache.airavata.common.utils.DerbyUtil;
-import org.apache.airavata.persistance.registry.jpa.ResourceType;
-import org.apache.airavata.persistance.registry.jpa.resources.*;
-import org.apache.airavata.registry.api.exception.RegistrySettingsException;
-import org.apache.airavata.registry.api.util.RegistrySettings;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.sql.*;
-import java.util.StringTokenizer;
-
-public class Initialize {
-    private static final Logger logger = LoggerFactory.getLogger(Initialize.class);
-    private static final String delimiter = ";";
-    public static final String PERSISTANT_DATA = "Configuration";
-
-    public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
-        if (suffix.length() > buffer.length()) {
-            return false;
-        }
-        // this loop is done on purpose to avoid memory allocation performance
-        // problems on various JDKs
-        // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
-        // implementation is ok though does allocation/copying
-        // StringBuffer.toString().endsWith() does massive memory
-        // allocation/copying on JDK 1.5
-        // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
-        int endIndex = suffix.length() - 1;
-        int bufferIndex = buffer.length() - 1;
-        while (endIndex >= 0) {
-            if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
-                return false;
-            }
-            bufferIndex--;
-            endIndex--;
-        }
-        return true;
-    }
-
-    public void initializeDB() {
-        String jdbcUrl = null;
-        String jdbcDriver = null;
-        String jdbcUser = null;
-        String jdbcPassword = null;
-        try{
-            jdbcDriver = RegistrySettings.getSetting("registry.jdbc.driver");
-            jdbcUrl = RegistrySettings.getSetting("registry.jdbc.url");
-            jdbcUser = RegistrySettings.getSetting("registry.jdbc.user");
-            jdbcPassword = RegistrySettings.getSetting("registry.jdbc.password");
-            jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
-        } catch (RegistrySettingsException e) {
-            logger.error("Unable to read properties" , e);
-        }
-
-
-        startDerbyInServerMode();
-//      startDerbyInEmbeddedMode();
-
-        Connection conn = null;
-        try {
-            Class.forName(Utils.getJDBCDriver()).newInstance();
-            conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword);
-            if (!isDatabaseStructureCreated(PERSISTANT_DATA, conn)) {
-                executeSQLScript(conn);
-                logger.info("New Database created for Registry");
-            } else {
-                logger.debug("Database already created for Registry!");
-            }
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-            throw new RuntimeException("Database failure");
-        } finally {
-            try {
-                if (!conn.getAutoCommit()) {
-                    conn.commit();
-                }
-                conn.close();
-            } catch (SQLException e) {
-                logger.error(e.getMessage(), e);
-                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-            }
-        }
-
-        try{
-            GatewayResource gatewayResource = new GatewayResource();
-            gatewayResource.setGatewayName(RegistrySettings.getSetting("default.registry.gateway"));
-            gatewayResource.setOwner(RegistrySettings.getSetting("default.registry.gateway"));
-            gatewayResource.save();
-
-            UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER);
-            userResource.setUserName(RegistrySettings.getSetting("default.registry.user"));
-            userResource.setPassword(RegistrySettings.getSetting("default.registry.password"));
-            userResource.save();
-
-            WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
-            workerResource.setUser(userResource.getUserName());
-            workerResource.save();
-
-            ProjectResource projectResource = workerResource.createProject("default");
-            projectResource.setGateway(gatewayResource);
-            projectResource.save();
-        } catch (RegistrySettingsException e) {
-            logger.error("Unable to read properties", e);
-        }
-
-
-    }
-
-    public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
-        try {
-            System.out.println("Running a query to test the database tables existence.");
-            // check whether the tables are already created with a query
-            Statement statement = null;
-            try {
-                statement = conn.createStatement();
-                ResultSet rs = statement.executeQuery("select * from " + tableName);
-                if (rs != null) {
-                    rs.close();
-                }
-            } finally {
-                try {
-                    if (statement != null) {
-                        statement.close();
-                    }
-                } catch (SQLException e) {
-                    return false;
-                }
-            }
-        } catch (SQLException e) {
-            return false;
-        }
-
-        return true;
-    }
-
-    private void executeSQLScript(Connection conn) throws Exception {
-        StringBuffer sql = new StringBuffer();
-        BufferedReader reader = null;
-        try{
-
-            InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("registry-derby.sql");
-            reader = new BufferedReader(new InputStreamReader(inputStream));
-            String line;
-            while ((line = reader.readLine()) != null) {
-                line = line.trim();
-                if (line.startsWith("//")) {
-                    continue;
-                }
-                if (line.startsWith("--")) {
-                    continue;
-                }
-                StringTokenizer st = new StringTokenizer(line);
-                if (st.hasMoreTokens()) {
-                    String token = st.nextToken();
-                    if ("REM".equalsIgnoreCase(token)) {
-                        continue;
-                    }
-                }
-                sql.append(" ").append(line);
-
-                // SQL defines "--" as a comment to EOL
-                // and in Oracle it may contain a hint
-                // so we cannot just remove it, instead we must end it
-                if (line.indexOf("--") >= 0) {
-                    sql.append("\n");
-                }
-                if ((checkStringBufferEndsWith(sql, delimiter))) {
-                    executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
-                    sql.replace(0, sql.length(), "");
-                }
-            }
-            // Catch any statements not followed by ;
-            if (sql.length() > 0) {
-                executeSQL(sql.toString(), conn);
-            }
-        }catch (IOException e){
-            logger.error("Error occurred while executing SQL script for creating Airavata database", e);
-            throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
-        }finally {
-            if (reader != null) {
-                reader.close();
-            }
-
-        }
-
-    }
-
-    private static void executeSQL(String sql, Connection conn) throws Exception {
-        // Check and ignore empty statements
-        if ("".equals(sql.trim())) {
-            return;
-        }
-
-        Statement statement = null;
-        try {
-            logger.debug("SQL : " + sql);
-
-            boolean ret;
-            int updateCount = 0, updateCountTotal = 0;
-            statement = conn.createStatement();
-            ret = statement.execute(sql);
-            updateCount = statement.getUpdateCount();
-            do {
-                if (!ret) {
-                    if (updateCount != -1) {
-                        updateCountTotal += updateCount;
-                    }
-                }
-                ret = statement.getMoreResults();
-                if (ret) {
-                    updateCount = statement.getUpdateCount();
-                }
-            } while (ret);
-
-            logger.debug(sql + " : " + updateCountTotal + " rows affected");
-
-            SQLWarning warning = conn.getWarnings();
-            while (warning != null) {
-                logger.warn(warning + " sql warning");
-                warning = warning.getNextWarning();
-            }
-            conn.clearWarnings();
-        } catch (SQLException e) {
-            if (e.getSQLState().equals("X0Y32")) {
-                // eliminating the table already exception for the derby
-                // database
-                logger.info("Table Already Exists", e);
-            } else {
-                throw new Exception("Error occurred while executing : " + sql, e);
-            }
-        } finally {
-            if (statement != null) {
-                try {
-                    statement.close();
-                } catch (SQLException e) {
-                    logger.error("Error occurred while closing result set.", e);
-                }
-            }
-        }
-    }
-
-    private void startDerbyInServerMode() {
-
-        try {
-            DerbyUtil.startDerbyInServerMode(Utils.getHost(), 20000, Utils.getJDBCUser(), Utils.getJDBCUser());
-        } catch (Exception e) {
-            logger.error("Unable to start Apache derby in the server mode! Check whether " +
-                    "specified port is available", e);
-        }
-
-    }
-
-    private void startDerbyInEmbeddedMode(){
-        try {
-            DerbyUtil.startDerbyInEmbeddedMode();
-        } catch (Exception e) {
-            logger.error("Error occurred while starting Derby in embedded mode", e);
-        }
-    }
-
-    public void stopDerbyServer() {
-        try {
-            DerbyUtil.stopDerbyServer();
-        } catch (Exception e) {
-            logger.error("Error occurred while stopping Derby", e);
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-test/src/test/resources/registry-derby.sql
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-test/src/test/resources/registry-derby.sql b/modules/registry/airavata-registry-test/src/test/resources/registry-derby.sql
deleted file mode 100644
index 7b8fb39..0000000
--- a/modules/registry/airavata-registry-test/src/test/resources/registry-derby.sql
+++ /dev/null
@@ -1,380 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-CREATE TABLE GATEWAY
-(
-        GATEWAY_NAME VARCHAR(255),
-	    OWNER VARCHAR(255),
-        PRIMARY KEY (GATEWAY_NAME)
-);
-
-CREATE TABLE CONFIGURATION
-(
-        CONFIG_KEY VARCHAR(255),
-        CONFIG_VAL VARCHAR(255),
-        EXPIRE_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        CATEGORY_ID VARCHAR (255),
-        PRIMARY KEY(CONFIG_KEY, CONFIG_VAL, CATEGORY_ID)
-);
-
-INSERT INTO CONFIGURATION (CONFIG_KEY, CONFIG_VAL, EXPIRE_DATE, CATEGORY_ID) VALUES('registry.version', '0.12', CURRENT_TIMESTAMP ,'SYSTEM');
-
-CREATE TABLE USERS
-(
-        USER_NAME VARCHAR(255),
-        PASSWORD VARCHAR(255),
-        PRIMARY KEY(USER_NAME)
-);
-
-CREATE TABLE GATEWAY_WORKER
-(
-        GATEWAY_NAME VARCHAR(255),
-        USER_NAME VARCHAR(255),
-        PRIMARY KEY (GATEWAY_NAME, USER_NAME),
-        FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-        FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE PROJECT
-(
-         GATEWAY_NAME VARCHAR(255),
-         USER_NAME VARCHAR(255),
-         PROJECT_NAME VARCHAR(255),
-         PRIMARY KEY (PROJECT_NAME),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (USER_NAME) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE PUBLISHED_WORKFLOW
-(
-         GATEWAY_NAME VARCHAR(255),
-         CREATED_USER VARCHAR(255),
-         PUBLISH_WORKFLOW_NAME VARCHAR(255),
-         VERSION VARCHAR(255),
-         PUBLISHED_DATE TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-         PATH VARCHAR (255),
-         WORKFLOW_CONTENT BLOB,
-         PRIMARY KEY(GATEWAY_NAME, PUBLISH_WORKFLOW_NAME),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (CREATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE USER_WORKFLOW
-(
-         GATEWAY_NAME VARCHAR(255),
-         OWNER VARCHAR(255),
-         TEMPLATE_NAME VARCHAR(255),
-         LAST_UPDATED_TIME TIMESTAMP DEFAULT CURRENT TIMESTAMP,
-         PATH VARCHAR (255),
-         WORKFLOW_GRAPH BLOB,
-         PRIMARY KEY(GATEWAY_NAME, OWNER, TEMPLATE_NAME),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (OWNER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE HOST_DESCRIPTOR
-(
-         GATEWAY_NAME VARCHAR(255),
-         UPDATED_USER VARCHAR(255),
-         HOST_DESCRIPTOR_ID VARCHAR(255),
-         HOST_DESCRIPTOR_XML BLOB,
-         PRIMARY KEY(GATEWAY_NAME, HOST_DESCRIPTOR_ID),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE SERVICE_DESCRIPTOR
-(
-         GATEWAY_NAME VARCHAR(255),
-         UPDATED_USER VARCHAR(255),
-         SERVICE_DESCRIPTOR_ID VARCHAR(255),
-         SERVICE_DESCRIPTOR_XML BLOB,
-         PRIMARY KEY(GATEWAY_NAME,SERVICE_DESCRIPTOR_ID),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE APPLICATION_DESCRIPTOR
-(
-         GATEWAY_NAME VARCHAR(255),
-         UPDATED_USER VARCHAR(255),
-         APPLICATION_DESCRIPTOR_ID VARCHAR(255),
-         HOST_DESCRIPTOR_ID VARCHAR(255),
-         SERVICE_DESCRIPTOR_ID VARCHAR(255),
-         APPLICATION_DESCRIPTOR_XML BLOB,
-         PRIMARY KEY(GATEWAY_NAME,APPLICATION_DESCRIPTOR_ID),
-         FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-         FOREIGN KEY (UPDATED_USER) REFERENCES USERS(USER_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT
-(
-        EXPERIMENT_ID VARCHAR(255),
-        GATEWAY_NAME VARCHAR(255),
-        EXECUTION_USER VARCHAR(255),
-        PROJECT_NAME VARCHAR(255),
-        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        EXPERIMENT_NAME VARCHAR(255),
-        EXPERIMENT_DESCRIPTION VARCHAR(255),
-        APPLICATION_ID VARCHAR(255),
-        APPLICATION_VERSION VARCHAR(255),
-        WORKFLOW_TEMPLATE_ID VARCHAR(255),
-        WORKFLOW_TEMPLATE_VERSION VARCHAR(255),
-        WORKFLOW_EXECUTION_ID VARCHAR(255),
-        PRIMARY KEY(EXPERIMENT_ID),
-        FOREIGN KEY (GATEWAY_NAME) REFERENCES GATEWAY(GATEWAY_NAME) ON DELETE CASCADE,
-        FOREIGN KEY (PROJECT_NAME) REFERENCES PROJECT(PROJECT_NAME) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_INPUT
-(
-        EXPERIMENT_ID VARCHAR(255),
-        INPUT_KEY VARCHAR(255),
-        INPUT_TYPE VARCHAR(255),
-        METADATA VARCHAR(255),
-        VALUE VARCHAR(255),
-        PRIMARY KEY(EXPERIMENT_ID,INPUT_KEY),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE EXPERIMENT_OUTPUT
-(
-        EXPERIMENT_ID VARCHAR(255),
-        OUTPUT_KEY VARCHAR(255),
-        OUTPUT_KEY_TYPE VARCHAR(255),
-        METADATA VARCHAR(255),
-        VALUE VARCHAR(255),
-        PRIMARY KEY(EXPERIMENT_ID,OUTPUT_KEY),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-
-CREATE TABLE WORKFLOW_NODE_DETAIL
-(
-        EXPERIMENT_ID VARCHAR(255),
-        NODE_INSTANCE_ID VARCHAR(255),
-        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        NODE_NAME VARCHAR(255),
-        PRIMARY KEY(NODE_INSTANCE_ID),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE TASK_DETAIL
-(
-        TASK_ID VARCHAR(255),
-        NODE_INSTANCE_ID VARCHAR(255),
-        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        APPLICATION_ID VARCHAR(255),
-        APPLICATION_VERSION VARCHAR(255),
-        PRIMARY KEY(TASK_ID),
-        FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE ERROR_DETAIL
-(
-         ERROR_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
-         EXPERIMENT_ID VARCHAR(255),
-         TASK_ID VARCHAR(255),
-         NODE_INSTANCE_ID VARCHAR(255),
-         JOB_ID VARCHAR(255),
-         CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-         ACTUAL_ERROR_MESSAGE CLOB,
-         USER_FRIEDNLY_ERROR_MSG VARCHAR(255),
-         TRANSIENT_OR_PERSISTENT SMALLINT,
-         ERROR_CATEGORY VARCHAR(255),
-         CORRECTIVE_ACTION VARCHAR(255),
-         ACTIONABLE_GROUP VARCHAR(255),
-         PRIMARY KEY(ERROR_ID),
-         FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
-         FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
-         FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE APPLICATION_INPUT
-(
-        TASK_ID VARCHAR(255),
-        INPUT_KEY VARCHAR(255),
-        INPUT_KEY_TYPE VARCHAR(255),
-        METADATA VARCHAR(255),
-        VALUE VARCHAR(255),
-        PRIMARY KEY(TASK_ID,INPUT_KEY),
-        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE APPLICATION_OUTPUT
-(
-        TASK_ID VARCHAR(255),
-        OUTPUT_KEY VARCHAR(255),
-        OUTPUT_KEY_TYPE VARCHAR(255),
-        METADATA VARCHAR(255),
-        VALUE VARCHAR(255),
-        PRIMARY KEY(TASK_ID,OUTPUT_KEY),
-        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE NODE_INPUT
-(
-       NODE_INSTANCE_ID VARCHAR(255),
-       INPUT_KEY VARCHAR(255),
-       INPUT_KEY_TYPE VARCHAR(255),
-       METADATA VARCHAR(255),
-       VALUE VARCHAR(255),
-       PRIMARY KEY(NODE_INSTANCE_ID,INPUT_KEY),
-       FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE NODE_OUTPUT
-(
-       NODE_INSTANCE_ID VARCHAR(255),
-       OUTPUT_KEY VARCHAR(255),
-       OUTPUT_KEY_TYPE VARCHAR(255),
-       METADATA VARCHAR(255),
-       VALUE VARCHAR(255),
-       PRIMARY KEY(NODE_INSTANCE_ID,OUTPUT_KEY),
-       FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE JOB_DETAIL
-(
-        JOB_ID VARCHAR(255),
-        TASK_ID VARCHAR(255),
-        JOB_DESCRIPTION VARCHAR(255),
-        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        COMPUTE_RESOURCE_CONSUMED VARCHAR(255),
-        PRIMARY KEY (TASK_ID, JOB_ID),
-        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE DATA_TRANSFER_DETAIL
-(
-        TRANSFER_ID VARCHAR(255),
-        TASK_ID VARCHAR(255),
-        CREATION_TIME TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        TRANSFER_DESC VARCHAR(255),
-        PRIMARY KEY(TRANSFER_ID),
-        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE STATUS
-(
-        STATUS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
-        EXPERIMENT_ID VARCHAR(255),
-        NODE_INSTANCE_ID VARCHAR(255),
-        TRANSFER_ID VARCHAR(255),
-        TASK_ID VARCHAR(255),
-        JOB_ID VARCHAR(255),
-        STATE VARCHAR(255),
-        STATUS_UPDATE_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        STATUS_TYPE VARCHAR(255),
-        PRIMARY KEY(STATUS_ID),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
-        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE,
-        FOREIGN KEY (NODE_INSTANCE_ID) REFERENCES WORKFLOW_NODE_DETAIL(NODE_INSTANCE_ID) ON DELETE CASCADE,
-        FOREIGN KEY (TRANSFER_ID) REFERENCES DATA_TRANSFER_DETAIL(TRANSFER_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE CONFIG_DATA
-(
-        EXPERIMENT_ID VARCHAR(255),
-        AIRAVATA_AUTO_SCHEDULE SMALLINT,
-        OVERRIDE_MANUAL_SCHEDULE_PARAMS SMALLINT,
-        SHARE_EXPERIMENT SMALLINT,
-        PRIMARY KEY(EXPERIMENT_ID)
-);
-
-CREATE TABLE COMPUTATIONAL_RESOURCE_SCHEDULING
-(
-        RESOURCE_SCHEDULING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
-        EXPERIMENT_ID VARCHAR(255),
-        TASK_ID VARCHAR(255),
-        RESOURCE_HOST_ID VARCHAR(255),
-        CPU_COUNT INTEGER,
-        NODE_COUNT INTEGER,
-        NO_OF_THREADS INTEGER,
-        QUEUE_NAME VARCHAR(255),
-        WALLTIME_LIMIT INTEGER,
-        JOB_START_TIME TIMESTAMP DEFAULT '0000-00-00 00:00:00',
-        TOTAL_PHYSICAL_MEMORY INTEGER,
-        COMPUTATIONAL_PROJECT_ACCOUNT VARCHAR(255),
-        PRIMARY KEY(RESOURCE_SCHEDULING_ID),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
-        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE ADVANCE_INPUT_DATA_HANDLING
-(
-       INPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
-       EXPERIMENT_ID VARCHAR(255),
-       TASK_ID VARCHAR(255),
-       WORKING_DIR_PARENT VARCHAR(255),
-       UNIQUE_WORKING_DIR VARCHAR(255),
-       STAGE_INPUT_FILES_TO_WORKING_DIR SMALLINT,
-       CLEAN_AFTER_JOB SMALLINT,
-       PRIMARY KEY(INPUT_DATA_HANDLING_ID),
-       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
-       FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE ADVANCE_OUTPUT_DATA_HANDLING
-(
-       OUTPUT_DATA_HANDLING_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
-       EXPERIMENT_ID VARCHAR(255),
-       TASK_ID VARCHAR(255),
-       OUTPUT_DATA_DIR VARCHAR(255),
-       DATA_REG_URL VARCHAR (255),
-       PERSIST_OUTPUT_DATA SMALLINT,
-       PRIMARY KEY(OUTPUT_DATA_HANDLING_ID),
-       FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
-       FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE QOS_PARAM
-(
-        QOS_ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY,
-        EXPERIMENT_ID VARCHAR(255),
-        TASK_ID VARCHAR(255),
-        START_EXECUTION_AT VARCHAR(255),
-        EXECUTE_BEFORE VARCHAR(255),
-        NO_OF_RETRIES INTEGER,
-        PRIMARY KEY(QOS_ID),
-        FOREIGN KEY (EXPERIMENT_ID) REFERENCES EXPERIMENT(EXPERIMENT_ID) ON DELETE CASCADE,
-        FOREIGN KEY (TASK_ID) REFERENCES TASK_DETAIL(TASK_ID) ON DELETE CASCADE
-);
-
-CREATE TABLE COMMUNITY_USER
-(
-        GATEWAY_NAME VARCHAR(256) NOT NULL,
-        COMMUNITY_USER_NAME VARCHAR(256) NOT NULL,
-        TOKEN_ID VARCHAR(256) NOT NULL,
-        COMMUNITY_USER_EMAIL VARCHAR(256) NOT NULL,
-        PRIMARY KEY (GATEWAY_NAME, COMMUNITY_USER_NAME, TOKEN_ID)
-);
-
-CREATE TABLE CREDENTIALS
-(
-        GATEWAY_ID VARCHAR(256) NOT NULL,
-        TOKEN_ID VARCHAR(256) NOT NULL,
-        CREDENTIAL BLOB NOT NULL,
-        PORTAL_USER_ID VARCHAR(256) NOT NULL,
-        TIME_PERSISTED TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
-        PRIMARY KEY (GATEWAY_ID, TOKEN_ID)
-);
-
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/pom.xml b/modules/registry/pom.xml
index 6c52e41..02c1603 100644
--- a/modules/registry/pom.xml
+++ b/modules/registry/pom.xml
@@ -33,8 +33,6 @@
                 <module>registry-api</module>
                 <module>registry-cpi</module>
                 <module>airavata-jpa-registry</module>
-                <module>airavata-registry-service</module>
-                <!--<module>airavata-registry-test</module>-->
             </modules>
         </profile>
     </profiles>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/pom.xml
----------------------------------------------------------------------
diff --git a/modules/rest/client/pom.xml b/modules/rest/client/pom.xml
deleted file mode 100644
index 38056a9..0000000
--- a/modules/rest/client/pom.xml
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY ~ KIND, either express or implied. See the License for the specific 
-	language governing permissions and limitations under the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-	
-	<parent>
-		<groupId>org.apache.airavata</groupId>
-		<artifactId>rest</artifactId>
-		<version>0.12-SNAPSHOT</version>
-		<relativePath>../pom.xml</relativePath>
-	</parent>
-
-	<modelVersion>4.0.0</modelVersion>
-	<artifactId>airavata-rest-client</artifactId>
-	<packaging>jar</packaging>
-	<name>airavata-rest-client</name>
-	<dependencies>
-
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-json</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>com.sun.jersey</groupId>
-			<artifactId>jersey-client</artifactId>
-			<version>${jersey.version}</version>
-		</dependency>
-
-		<!-- Airavata -->
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-gfac-schema-utils</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-registry-api</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-		<dependency>
-			<groupId>org.apache.airavata</groupId>
-			<artifactId>airavata-rest-mappings</artifactId>
-			<version>${project.version}</version>
-		</dependency>
-
-		<!-- Logging -->
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-api</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-simple</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>jcl-over-slf4j</artifactId>
-		</dependency>
-		<dependency>
-			<groupId>org.slf4j</groupId>
-			<artifactId>slf4j-log4j12</artifactId>
-		</dependency>
-	</dependencies>
-
-	<properties>
-		<jersey.version>1.13</jersey.version>
-		<org.slf4j.version>1.6.1</org.slf4j.version>
-		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-		<javaagent />
-	</properties>
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/Test.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/Test.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/Test.java
deleted file mode 100644
index 0d9b6b1..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/Test.java
+++ /dev/null
@@ -1,542 +0,0 @@
-/*
-*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements.  See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership.  The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License.  You may obtain a copy of the License at
-*
-*   http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied.  See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*
-*/
-
-package org.apache.airavata.rest;
-
-
-import org.apache.airavata.rest.client.*;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-public class Test {
-    public static void main(String[] args) {
-//        configurationResourceClientTest();
-//        hostDescriptorClientTest();
-//        serviceDescriptorClientTest();
-//          appDescriptorClientTest();
-//        projectRegistryClientTest();
-//        experimentRegistryClient();
-//        userWFClientTest();
-//        publishWFClientTest();
-//        provenanceClientTest();
-    }
-
-
-    public static void configurationResourceClientTest(){
-        //configuration resource test
-//        ConfigurationResourceClient configurationResourceClient = new ConfigurationResourceClient("admin",
-//                "http://localhost:8080/airavata-registry/", new PasswordCallbackImpl("admin", "admin"));
-
-//        System.out.println("###############getConfiguration###############");
-//        Object configuration = configurationResourceClient.getConfiguration("gfac.url");
-//        System.out.println(configuration.toString());
-
-
-//        System.out.println("###############getConfiguration###############");
-//        Object configuration = configurationResourceClient.getConfiguration("key3");
-//        System.out.println(configuration.toString());
-//
-//        System.out.println("###############getConfigurationList###############");
-//        try {
-//            configurationResourceClient.addWFInterpreterURI(new URI("http://192.168.17.1:8080/axis2/services/WorkflowInterpretor2"));
-//        } catch (URISyntaxException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        }
-//        List<Object> configurationList = configurationResourceClient.getConfigurationList("testKey1");
-//        for(Object object : configurationList){
-//            System.out.println(object.toString());
-//        }
-//
-//        System.out.println("###############setConfiguration###############");
-//        configurationResourceClient.setConfiguration("testKey1", "testVal1", "2012-11-12 00:12:31");
-//
-//        System.out.println("###############addConfiguration###############");
-//        configurationResourceClient.addConfiguration("testKey1", "testVal2", "2012-11-12 05:12:31");
-
-//        System.out.println("###############remove all configuration ###############");
-//        configurationResourceClient.removeAllConfiguration("testKey1");
-//
-//        System.out.println("###############remove configuration ###############");
-//        configurationResourceClient.setConfiguration("testKey2", "testVal2", "2012-11-12 00:12:31");
-//        configurationResourceClient.removeAllConfiguration("testKey2");
-//
-//        System.out.println("###############get GFAC URI ###############");
-//        configurationResourceClient.addGFacURI("http://192.168.17.1:8080/axis2/services/GFacService2");
-//        List<URI> gFacURIs = configurationResourceClient.getGFacURIs();
-//        for (URI uri : gFacURIs){
-//            System.out.println(uri.toString());
-//        }
-
-//        System.out.println("###############get WF interpreter URIs ###############");
-//        List<URI> workflowInterpreterURIs = configurationResourceClient.getWorkflowInterpreterURIs();
-//        for (URI uri : workflowInterpreterURIs){
-//            System.out.println(uri.toString());
-//        }
-//
-//        System.out.println("###############get eventing URI ###############");
-//        URI eventingURI = configurationResourceClient.getEventingURI();
-//        System.out.println(eventingURI.toString());
-//
-//        System.out.println("###############get message Box URI ###############");
-//        URI mesgBoxUri = configurationResourceClient.getMsgBoxURI();
-//        System.out.println(mesgBoxUri.toString());
-//
-//        System.out.println("###############Set eventing URI ###############");
-//        configurationResourceClient.setEventingURI("http://192.168.17.1:8080/axis2/services/EventingService2");
-//
-//        System.out.println("###############Set MSGBox URI ###############");
-//        configurationResourceClient.setEventingURI("http://192.168.17.1:8080/axis2/services/MsgBoxService2");
-//
-//        System.out.println("###############Add GFAC URI by date ###############");
-//        configurationResourceClient.addGFacURIByDate("http://192.168.17.1:8080/axis2/services/GFacService3", "2012-11-12 00:12:27");
-//
-//        System.out.println("###############Add WF interpreter URI by date ###############");
-//        configurationResourceClient.addWorkflowInterpreterURI("http://192.168.17.1:8080/axis2/services/WorkflowInterpretor3", "2012-11-12 00:12:27");
-
-//        System.out.println("###############Set eventing URI by date ###############");
-//        configurationResourceClient.setEventingURIByDate("http://192.168.17.1:8080/axis2/services/EventingService3", "2012-11-12 00:12:27");
-//
-//        System.out.println("###############Set MsgBox URI by date ###############");
-//        configurationResourceClient.setMessageBoxURIByDate("http://192.168.17.1:8080/axis2/services/MsgBoxService3", "2012-11-12 00:12:27");
-
-//        System.out.println("############### Remove GFac URI ###############");
-//        configurationResourceClient.removeGFacURI("http://192.168.17.1:8080/axis2/services/GFacService3");
-//
-//        System.out.println("############### Remove all GFac URI ###############");
-//        configurationResourceClient.removeAllGFacURI();
-//
-//        System.out.println("############### Remove removeWorkflowInterpreter URI ###############");
-//        configurationResourceClient.removeWorkflowInterpreterURI("http://192.168.17.1:8080/axis2/services/WorkflowInterpretor3");
-
-//        System.out.println("############### Remove removeAllWorkflowInterpreterURI ###############");
-//        configurationResourceClient.removeAllWorkflowInterpreterURI();
-//
-//        System.out.println("############### Remove eventing URI ###############");
-//        configurationResourceClient.unsetEventingURI();
-//
-//        System.out.println("############### unsetMessageBoxURI ###############");
-//        configurationResourceClient.unsetMessageBoxURI();
-    }
-
-    public static void hostDescriptorClientTest(){
-//        DescriptorResourceClient descriptorResourceClient = new DescriptorResourceClient();
-
-//        boolean localHost = descriptorResourceClient.isHostDescriptorExists("LocalHost");
-//        System.out.println(localHost);
-
-//        HostDescription descriptor = new HostDescription(GlobusHostType.type);
-//        descriptor.getType().setHostName("testHost");
-//        descriptor.getType().setHostAddress("testHostAddress2");
-//        descriptorResourceClient.addHostDescriptor(descriptor);
-
-//        HostDescription localHost = descriptorResourceClient.getHostDescriptor("purdue.teragrid.org");
-//        List<HostDescription> hostDescriptors = descriptorResourceClient.getHostDescriptors();
-//        for(HostDescription hostDescription : hostDescriptors){
-//            System.out.println(hostDescription.getType().getHostName());
-//            System.out.println(hostDescription.getType().getHostAddress());
-//        }
-//
-//        List<String> hostDescriptorNames = descriptorResourceClient.getHostDescriptorNames();
-//        for (String hostName : hostDescriptorNames){
-//            System.out.println(hostName);
-//        }
-
-//        descriptorResourceClient.removeHostDescriptor("testHost");
-
-//        System.out.println(localHost.getType().getHostName());
-//        System.out.println(localHost.getType().getHostAddress());
-
-    }
-
-    public static void serviceDescriptorClientTest (){
-
-//        DescriptorResourceClient descriptorResourceClient = new DescriptorResourceClient("admin",
-//                "http://localhost:9080/airavata-services/api", new PasswordCallbackImpl("admin", "admin"));
-//        //service descriptor exists
-//        boolean exists = descriptorResourceClient.isServiceDescriptorExists("echo");
-//        System.out.println(exists);
-
-        //service descriptor save
-//        ServiceDescription serviceDescription = new ServiceDescription();
-//        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-//        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-//        serviceDescription.getType().setName("testServiceDesc");
-//        serviceDescription.getType().setDescription("testDescription");
-//        InputParameterType parameter = InputParameterType.Factory.newInstance();
-//        parameter.setParameterName("input1");
-//        parameter.setParameterDescription("testDesc");
-//        ParameterType parameterType = parameter.addNewParameterType();
-//        parameterType.setType(DataType.STRING);
-//        parameterType.setName("testParamtype");
-//        inputParameters.add(parameter);
-//
-//        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-//        outputParameter.setParameterName("output1");
-//        outputParameter.setParameterDescription("testDesc");
-//        ParameterType outputParaType = outputParameter.addNewParameterType();
-//        outputParaType.setType(DataType.STRING);
-//        outputParaType.setName("testParamtype");
-//        outputParameters.add(outputParameter);
-//
-//        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-//        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-//
-//        descriptorResourceClient.saveServiceDescriptor(serviceDescription);
-
-        // Service descriptor update
-//        ServiceDescription testServiceDesc = descriptorResourceClient.getServiceDescriptor("testServiceDesc");
-//        testServiceDesc.getType().setDescription("testDescription2");
-//        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-//        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-//        InputParameterType parameter = InputParameterType.Factory.newInstance();
-//        parameter.setParameterName("input2");
-//        parameter.setParameterDescription("testDesc2");
-//        ParameterType parameterType = parameter.addNewParameterType();
-//        parameterType.setType(DataType.STRING);
-//        parameterType.setName("testParamtype2");
-//        inputParameters.add(parameter);
-//
-//        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-//        outputParameter.setParameterName("output2");
-//        outputParameter.setParameterDescription("testDesc2");
-//        ParameterType outputParaType = outputParameter.addNewParameterType();
-//        outputParaType.setType(DataType.STRING);
-//        outputParaType.setName("testParamtype2");
-//        outputParameters.add(outputParameter);
-//
-//        testServiceDesc.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-//        testServiceDesc.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-//
-//        descriptorResourceClient.updateServiceDescriptor(testServiceDesc);
-
-         //getServiceDescriptor
-//        ServiceDescription testServiceDesc = descriptorResourceClient.getServiceDescriptor("testServiceDesc");
-//        System.out.println(testServiceDesc.getType().getName());
-//        System.out.println(testServiceDesc.getType().getDescription());
-
-        //removeServiceDescriptor
-//        descriptorResourceClient.removeServiceDescriptor("testServiceDesc");
-
-        //getServiceDescriptors
-//        List<ServiceDescription> serviceDescriptors = descriptorResourceClient.getServiceDescriptors();
-//        for (ServiceDescription serviceDescription : serviceDescriptors){
-//            System.out.println(serviceDescription.getType().getName());
-//            System.out.println(serviceDescription.getType().getDescription());
-//        }
-    }
-
-    public static void appDescriptorClientTest (){
-//        DescriptorResourceClient descriptorResourceClient = new DescriptorResourceClient();
-
-        //isApplicationDescriptorExist
-//        boolean descriptorExist = descriptorResourceClient.isApplicationDescriptorExist("echo", "LocalHost", "LocalHost_application");
-//        System.out.println(descriptorExist);
-
-        // addApplicationDescriptor
-//        ServiceDescription serviceDescription = new ServiceDescription();
-//        List<InputParameterType> inputParameters = new ArrayList<InputParameterType>();
-//        List<OutputParameterType> outputParameters = new ArrayList<OutputParameterType>();
-//        serviceDescription.getType().setName("testServiceDesc");
-//        serviceDescription.getType().setDescription("testDescription");
-//        InputParameterType parameter = InputParameterType.Factory.newInstance();
-//        parameter.setParameterName("input1");
-//        parameter.setParameterDescription("testDesc");
-//        ParameterType parameterType = parameter.addNewParameterType();
-//        parameterType.setType(DataType.STRING);
-//        parameterType.setName("testParamtype");
-//        inputParameters.add(parameter);
-//
-//        OutputParameterType outputParameter = OutputParameterType.Factory.newInstance();
-//        outputParameter.setParameterName("output1");
-//        outputParameter.setParameterDescription("testDesc");
-//        ParameterType outputParaType = outputParameter.addNewParameterType();
-//        outputParaType.setType(DataType.STRING);
-//        outputParaType.setName("testParamtype");
-//        outputParameters.add(outputParameter);
-//
-//        serviceDescription.getType().setInputParametersArray(inputParameters.toArray(new InputParameterType[]{}));
-//        serviceDescription.getType().setOutputParametersArray(outputParameters.toArray(new OutputParameterType[]{}));
-//
-//        HostDescription hostDescription = new HostDescription(GlobusHostType.type);
-//        hostDescription.getType().setHostName("testHost");
-//        hostDescription.getType().setHostAddress("testHostAddress");
-//        descriptorResourceClient.addHostDescriptor(hostDescription);
-//
-//        ApplicationDeploymentDescription applicationDeploymentDescription = new ApplicationDeploymentDescription(ApplicationDeploymentDescriptionType.type);
-//        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDeploymentDescription.getType().addNewApplicationName();
-//        applicationName.setStringValue("testApplication");
-//        applicationDeploymentDescription.getType().setApplicationName(applicationName);
-//        applicationDeploymentDescription.getType().setInputDataDirectory("/bin");
-//        applicationDeploymentDescription.getType().setExecutableLocation("/bin/echo");
-//        applicationDeploymentDescription.getType().setOutputDataDirectory("/tmp");
-//
-//        descriptorResourceClient.addApplicationDescriptor(serviceDescription, hostDescription, applicationDeploymentDescription);
-
-        //addApplicationDescriptor(String serviceName, String hostName, ApplicationDeploymentDescription descriptor)
-//        ApplicationDeploymentDescription applicationDeploymentDescription = new ApplicationDeploymentDescription(ApplicationDeploymentDescriptionType.type);
-//        ApplicationDeploymentDescriptionType.ApplicationName applicationName = applicationDeploymentDescription.getType().addNewApplicationName();
-//        applicationName.setStringValue("testApplication2");
-//        applicationDeploymentDescription.getType().setApplicationName(applicationName);
-//        applicationDeploymentDescription.getType().setInputDataDirectory("/bin");
-//        applicationDeploymentDescription.getType().setExecutableLocation("/bin/echo");
-//        applicationDeploymentDescription.getType().setOutputDataDirectory("/tmp");
-//        descriptorResourceClient.addApplicationDescriptor("testServiceDesc", "testHost", applicationDeploymentDescription);
-
-        //udpateApplicationDescriptor
-//        ApplicationDeploymentDescription applicationDescriptor = descriptorResourceClient.getApplicationDescriptor("testServiceDesc", "testHost", "testApplication2");
-//        applicationDescriptor.getType().setInputDataDirectory("/bin1");
-//        applicationDescriptor.getType().setExecutableLocation("/bin/echo1");
-//        applicationDescriptor.getType().setOutputDataDirectory("/tmp1");
-//        descriptorResourceClient.updateApplicationDescriptor("testServiceDesc", "testHost", applicationDescriptor);
-
-        //getApplicationDescriptors(String serviceName, String hostname)
-//        ApplicationDeploymentDescription applicationDescriptors = descriptorResourceClient.getApplicationDescriptors("testServiceDesc", "testHost");
-//        System.out.println(applicationDescriptors.getType().getApplicationName().getStringValue());
-//        System.out.println(applicationDescriptors.getType().getExecutableLocation());
-//        System.out.println(applicationDescriptors.getType().getOutputDataDirectory());
-
-        //getApplicationDescriptors(String serviceName)
-//        Map<String,ApplicationDeploymentDescription> testServiceDesc = descriptorResourceClient.getApplicationDescriptors("testServiceDesc");
-//        for (String host : testServiceDesc.keySet()){
-//            System.out.println(host);
-//            ApplicationDeploymentDescription applicationDeploymentDescription = testServiceDesc.get(host);
-//            System.out.println(applicationDeploymentDescription.getType().getApplicationName().getStringValue());
-//        }
-         //getApplicationDescriptors()
-//        Map<String[], ApplicationDeploymentDescription> applicationDescriptors = descriptorResourceClient.getApplicationDescriptors();
-//        for (String[] desc : applicationDescriptors.keySet()){
-//            System.out.println(desc[0]);
-//            System.out.println(desc[1]);
-//            ApplicationDeploymentDescription applicationDeploymentDescription = applicationDescriptors.get(desc);
-//            System.out.println(applicationDeploymentDescription.getType().getApplicationName().getStringValue());
-//        }
-
-        //getApplicationDescriptorNames ()
-//        List<String> applicationDescriptorNames = descriptorResourceClient.getApplicationDescriptorNames();
-//        for (String appName : applicationDescriptorNames){
-//            System.out.println(appName);
-//        }
-    }
-
-    public static void projectRegistryClientTest(){
-//        ProjectResourceClient projectResourceClient = new ProjectResourceClient();
-        //isWorkspaceProjectExists
-//        boolean projectExists = projectResourceClient.isWorkspaceProjectExists("default");
-//        System.out.println(projectExists);
-       //isWorkspaceProjectExists(String projectName, boolean createIfNotExists)
-//        projectResourceClient.isWorkspaceProjectExists("testproject", true);
-        // addWorkspaceProject
-//        projectResourceClient.addWorkspaceProject("testproject2");
-
-        //updateWorkspaceProject(String projectName)
-//        projectResourceClient.updateWorkspaceProject("testproject");
-
-        // deleteWorkspaceProject
-//        projectResourceClient.deleteWorkspaceProject("testproject");
-
-        //getWorkspaceProject
-//        WorkspaceProject project = projectResourceClient.getWorkspaceProject("default");
-//        System.out.println(project.getGateway().getGatewayName());
-
-        //getWorkspaceProjects
-//        List<WorkspaceProject> workspaceProjects = projectResourceClient.getWorkspaceProjects();
-//        for (WorkspaceProject workspaceProject : workspaceProjects){
-//            System.out.println(workspaceProject.getProjectName());
-//        }
-
-    }
-
-    public static void experimentRegistryClient(){
-//        ExperimentResourceClient experimentResourceClient = new ExperimentResourceClient();
-        //add experiment
-//        try {
-//            AiravataExperiment experiment = new AiravataExperiment();
-//            experiment.setExperimentId("testExperiment2");
-//            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//            Date formattedDate = dateFormat.parse("2012-11-13 11:50:32");
-//            experiment.setSubmittedDate(formattedDate);
-//            experimentResourceClient.addExperiment("default", experiment);
-//        } catch (ParseException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        }
-
-        //remove experiment
-//        experimentResourceClient.removeExperiment("testExperiment");
-
-//        List<AiravataExperiment> experiments = experimentResourceClient.getExperiments();
-//        System.out.println(experiments.size());
-        //getExperiments(Date from, Date to)
-//        try{
-//            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//            Date date1 = dateFormat.parse("2012-11-01 11:50:32");
-//            Date date2 = dateFormat.parse("2012-11-15 11:50:32");
-//            List<AiravataExperiment> experiments = experimentResourceClient.getExperiments(date1, date2);
-//            System.out.println(experiments.size());
-//        } catch (ParseException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        }
-
-        //getExperiments(String projectName, Date from, Date to)
-//        try{
-//            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//            Date date1 = dateFormat.parse("2012-11-01 11:50:32");
-//            Date date2 = dateFormat.parse("2012-11-15 11:50:32");
-//            List<AiravataExperiment> experiments = experimentResourceClient.getExperiments("default",date1, date2);
-//            System.out.println(experiments.size());
-//        } catch (ParseException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        }
-
-          //isExperimentExists(String experimentId)
-//        boolean exists = experimentResourceClient.isExperimentExists("testExperiment");
-//        System.out.println(exists);
-
-
-        //isExperimentExists(String experimentId, boolean createIfNotPresent)
-//        experimentResourceClient.isExperimentExists("testExp", true);
-
-
-    }
-
-    public static void userWFClientTest (){
-//        UserWorkflowResourceClient userWorkflowResourceClient = new UserWorkflowResourceClient();
-//        boolean exists = userWorkflowResourceClient.isWorkflowExists("Workflow1");
-//        System.out.println(exists);
-//         userWorkflowResourceClient.addWorkflow("workflow5", "testworlflowcontent");
-//         userWorkflowResourceClient.updateWorkflow("worklfow5", "updatedtestworlflowcontent");
-//        String workflow2 = userWorkflowResourceClient.getWorkflowGraphXML("workflow2");
-//        System.out.println(workflow2);
-//        Map<String, String> workflows = userWorkflowResourceClient.getWorkflows();
-//        System.out.println(workflows.size());
-//        userWorkflowResourceClient.removeWorkflow("workflow5");
-    }
-
-    public static void publishWFClientTest () {
-//        PublishedWorkflowResourceClient publishedWorkflowResourceClient = new PublishedWorkflowResourceClient();
-//        boolean exists = publishedWorkflowResourceClient.isPublishedWorkflowExists("Workflow2");
-//        System.out.println(exists);
-
-//        publishedWorkflowResourceClient.publishWorkflow("workflow3", "publishedWF3");
-//        publishedWorkflowResourceClient.publishWorkflow("workflow4");
-//        String workflow1 = publishedWorkflowResourceClient.getPublishedWorkflowGraphXML("Workflow2");
-//        System.out.println(workflow1);
-//        List<String> publishedWorkflowNames = publishedWorkflowResourceClient.getPublishedWorkflowNames();
-//        System.out.println(publishedWorkflowNames.size());
-
-//        publishedWorkflowResourceClient.removePublishedWorkflow("workflow4");
-
-    }
-
-    public static void provenanceClientTest()  {
-//        ProvenanceResourceClient provenanceResourceClient = new ProvenanceResourceClient();
-//        provenanceResourceClient.updateExperimentExecutionUser("eb9e67cf-6fe3-46f1-b50b-7b42936d347d", "aaa");
-//        String experimentExecutionUser = provenanceResourceClient.getExperimentExecutionUser("eb9e67cf-6fe3-46f1-b50b-7b42936d347d");
-//        System.out.println(experimentExecutionUser);
-//        boolean nameExist = provenanceResourceClient.isExperimentNameExist("exp1");
-//        System.out.println(nameExist);
-//        String experimentName = provenanceResourceClient.getExperimentName("eb9e67cf-6fe3-46f1-b50b-7b42936d347d");
-//        System.out.println(experimentName);
-//        String workflowExecutionTemplateName = provenanceResourceClient.getWorkflowExecutionTemplateName("e00ddc5e-f8d5-4492-9eb2-10372efb103c");
-//        System.out.println(workflowExecutionTemplateName);
-//        provenanceResourceClient.setWorkflowInstanceTemplateName("eb9e67cf-6fe3-46f1-b50b-7b42936d347d", "wftemplate2");
-//        List<WorkflowInstance> experimentWorkflowInstances = provenanceResourceClient.getExperimentWorkflowInstances("e00ddc5e-f8d5-4492-9eb2-10372efb103c");
-//        System.out.println(experimentWorkflowInstances.size());
-//        System.out.println(provenanceResourceClient.isWorkflowInstanceExists("e00ddc5e-f8d5-4492-9eb2-10372efb103c"));
-//        provenanceResourceClient.isWorkflowInstanceExists("testInstance", true);
-
-//        try {
-//            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-//            Date date = dateFormat.parse("2012-11-01 11:50:32");
-//            WorkflowInstanceStatus workflowInstanceStatus = new WorkflowInstanceStatus(new WorkflowInstance("testInstance", "testInstance"), WorkflowInstanceStatus.ExecutionStatus.FINISHED, date);
-//            provenanceResourceClient.updateWorkflowInstanceStatus(workflowInstanceStatus);
-//        } catch (ParseException e) {
-//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-//        }
-
-//        System.out.println(provenanceResourceClient.getWorkflowInstanceStatus("testInstance").getExecutionStatus().name());
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(provenanceResourceClient.getWorkflowInstanceData("TempConvertSoap_FahrenheitToCelsius").getWorkflowInstance(), "TempConvertSoap_FahrenheitToCelsius");
-//        provenanceResourceClient.updateWorkflowNodeInput(workflowInstanceNode, "testInput2");
-
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(provenanceResourceClient.getWorkflowInstanceData("TempConvertSoap_FahrenheitToCelsius").getWorkflowInstance(), "TempConvertSoap_FahrenheitToCelsius");
-//        provenanceResourceClient.updateWorkflowNodeOutput(workflowInstanceNode, "testOutput");
-
-//        ExperimentData experiment = provenanceResourceClient.getExperiment("ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4");
-//        String experimentName = experiment.getExperimentName();
-//        System.out.println(experimentName);
-
-//        ExperimentData experiment = provenanceResourceClient.getExperimentMetaInformation("ff7338c9-f9ad-4d86-b486-1e8e9c3a9cc4");
-//        String experimentName = experiment.getExperimentName();
-//        System.out.println(experimentName);
-
-//        List<ExperimentData> admin = provenanceResourceClient.getAllExperimentMetaInformation("admin");
-//        System.out.println(admin.size());
-
-//        List<ExperimentData> experimentDataList = provenanceResourceClient.searchExperiments("admin", "exp");
-//        System.out.println(experimentDataList.size());
-
-//        List<String> admin = provenanceResourceClient.getExperimentIdByUser("admin");
-//        for (String exp : admin){
-//            System.out.println(exp);
-//        }
-//        List<ExperimentData> experimentByUser = provenanceResourceClient.getExperimentByUser("admin");
-//        System.out.println(experimentByUser.size());
-
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(provenanceResourceClient.getWorkflowInstanceData("TempConvertSoap_FahrenheitToCelsius").getWorkflowInstance(), "TempConvertSoap_FahrenheitToCelsius");
-//        WorkflowInstanceNodeStatus workflowInstanceNodeStatus = new WorkflowInstanceNodeStatus(workflowInstanceNode, WorkflowInstanceStatus.ExecutionStatus.STARTED);
-//        provenanceResourceClient.updateWorkflowNodeStatus(workflowInstanceNodeStatus);
-
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(provenanceResourceClient.getWorkflowInstanceData("TempConvertSoap_FahrenheitToCelsius").getWorkflowInstance(), "TempConvertSoap_FahrenheitToCelsius");
-//        provenanceResourceClient.updateWorkflowNodeStatus(workflowInstanceNode, WorkflowInstanceStatus.ExecutionStatus.FINISHED);
-
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(provenanceResourceClient.getWorkflowInstanceData("TempConvertSoap_FahrenheitToCelsius").getWorkflowInstance(), "TempConvertSoap_FahrenheitToCelsius");
-//        WorkflowInstanceNodeStatus workflowNodeStatus = provenanceResourceClient.getWorkflowNodeStatus(workflowInstanceNode);
-//        System.out.println(workflowNodeStatus.getExecutionStatus().name());
-
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(provenanceResourceClient.getWorkflowInstanceData("TempConvertSoap_FahrenheitToCelsius").getWorkflowInstance(), "TempConvertSoap_FahrenheitToCelsius");
-//        Date workflowNodeStartTime = provenanceResourceClient.getWorkflowNodeStartTime(workflowInstanceNode);
-//        System.out.println(workflowNodeStartTime.toString());
-
-//        WorkflowInstance tempConvertSoap_fahrenheitToCelsius = provenanceResourceClient.getWorkflowInstanceData("TempConvertSoap_FahrenheitToCelsius").getWorkflowInstance();
-//        Date workflowStartTime = provenanceResourceClient.getWorkflowStartTime(tempConvertSoap_fahrenheitToCelsius);
-//        System.out.println(workflowStartTime.toString());
-
-//        WorkflowNodeGramData workflowNodeGramData = new WorkflowNodeGramData("TempConvertSoap_FahrenheitToCelsius", "TempConvertSoap_FahrenheitToCelsius", "rsl", "invokedHost", "jobID");
-//        provenanceResourceClient.updateWorkflowNodeGramData(workflowNodeGramData);
-
-//        WorkflowInstanceData instanceData = provenanceResourceClient.getWorkflowInstanceData("TempConvertSoap_FahrenheitToCelsius");
-//        System.out.println(instanceData.getWorkflowInstance().getExperimentId());
-
-//        System.out.println(provenanceResourceClient.isWorkflowInstanceNodePresent("TempConvertSoap_FahrenheitToCelsius", "TempConvertSoap_FahrenheitToCelsius"));
-
-//        provenanceResourceClient.isWorkflowInstanceNodePresent("TempConvertSoap_FahrenheitToCelsius", "TempConvertSoap_FahrenheitToCelsius1", true);
-
-//        provenanceResourceClient.addWorkflowInstance("testInstance", "testWF", "testWotrfklow");
-//        WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(provenanceResourceClient.getWorkflowInstanceData("TempConvertSoap_FahrenheitToCelsius").getWorkflowInstance(), "TempConvertSoap_FahrenheitToCelsius");
-//        WorkflowNodeType workflowNodeType = new WorkflowNodeType();
-//        workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.SERVICENODE);
-//        provenanceResourceClient.updateWorkflowNodeType(workflowInstanceNode, workflowNodeType);
-
-//         provenanceResourceClient.addWorkflowInstanceNode("TempConvertSoap_FahrenheitToCelsius", "testNode");
-    }
-
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/BasicRegistryResourceClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/BasicRegistryResourceClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/BasicRegistryResourceClient.java
deleted file mode 100644
index 5458e09..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/BasicRegistryResourceClient.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import org.apache.airavata.common.utils.Version;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.registry.api.Gateway;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.utils.BasicAuthHeaderUtil;
-import org.apache.airavata.rest.utils.ClientConstant;
-import org.apache.airavata.rest.utils.CookieManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-/**
- * This is the client class for all the basic registry operations. This class is being
- * instantiated by <code>AiravataClient</code>. Users of Airavata can also call this
- * client class if he wants to use REST service
- */
-public class BasicRegistryResourceClient {
-    private WebResource webResource;
-    private final static Logger logger = LoggerFactory.getLogger(BasicRegistryResourceClient.class);
-    private String userName;
-    private PasswordCallback callback;
-    private String baseURI;
-    private Cookie cookie;
-    private WebResource.Builder builder;
-    private String gatewayName;
-//    private CookieManager cookieManager = new CookieManager();
-
-    /**
-     * Creates a BasicRegistryResourceClient
-     *
-     * @param userName  registry user
-     * @param seriveURI REST service URL
-     * @param callback  implementation of the <code>PasswordCallback</code>
-     */
-    public BasicRegistryResourceClient(String userName,
-                                       String gateway,
-                                       String seriveURI,
-                                       PasswordCallback callback,
-                                       Cookie cookie) {
-        this.userName = userName;
-        this.callback = callback;
-        this.baseURI = seriveURI;
-        this.gatewayName = gateway;
-        this.cookie = cookie;
-    }
-
-    /**
-     * Get base URL of the REST service
-     *
-     * @return REST url
-     */
-    private URI getBaseURI() {
-        logger.debug("Creating Base URI");
-        return UriBuilder.fromUri(baseURI).build();
-    }
-
-    /**
-     * Creating the web resource for base url
-     *
-     * @return web resource related to the base url
-     */
-    private WebResource getBasicRegistryBaseResource() {
-        ClientConfig config = new DefaultClientConfig();
-        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
-                Boolean.TRUE);
-        Client client = Client.create(config);
-        WebResource baseWebResource = client.resource(getBaseURI());
-        webResource = baseWebResource.path(
-                ResourcePathConstants.BasicRegistryConstants.REGISTRY_API_BASICREGISTRY);
-        return webResource;
-    }
-
-    /**
-     * Get gateway related to the instance
-     *
-     * @return gateway
-     */
-    public Gateway getGateway() {
-        webResource = getBasicRegistryBaseResource().path(
-                ResourcePathConstants.BasicRegistryConstants.GET_GATEWAY);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gatewayName);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gatewayName);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-        return response.getEntity(Gateway.class);
-    }
-
-    /**
-     * Get executing user for the instance
-     *
-     * @return airavata user
-     */
-    public AiravataUser getUser() {
-        webResource = getBasicRegistryBaseResource().path(
-                ResourcePathConstants.BasicRegistryConstants.GET_USER);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gatewayName);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gatewayName);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-        return response.getEntity(AiravataUser.class);
-    }
-
-    /**
-     * setting the gateway
-     *
-     * @param gateway gateway
-     */
-    public void setGateway(Gateway gateway) {
-        webResource = getBasicRegistryBaseResource().path(
-                ResourcePathConstants.BasicRegistryConstants.SET_GATEWAY);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gatewayName);
-
-        ClientResponse response = builder.accept(MediaType.TEXT_PLAIN).type(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, gateway);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gatewayName);
-            response = builder.accept(MediaType.TEXT_PLAIN).type(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, gateway);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK && status != ClientConstant.HTTP_UNAUTHORIZED) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    /**
-     * Setting the airavata user
-     *
-     * @param user airavata user
-     */
-    public void setUser(AiravataUser user) {
-        webResource = getBasicRegistryBaseResource().path(
-                ResourcePathConstants.BasicRegistryConstants.SET_USER);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gatewayName);
-
-        ClientResponse response = builder.accept(MediaType.TEXT_PLAIN).type(
-                MediaType.APPLICATION_JSON).post(ClientResponse.class, user);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gatewayName);
-            response = builder.accept(MediaType.TEXT_PLAIN).type(
-                    MediaType.APPLICATION_JSON).post(ClientResponse.class, user);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK && status != ClientConstant.HTTP_UNAUTHORIZED) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    /**
-     * Get service API version
-     *
-     * @return API version
-     */
-    public Version getVersion() {
-        webResource = getBasicRegistryBaseResource().path(
-                ResourcePathConstants.BasicRegistryConstants.VERSION);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gatewayName);
-
-        ClientResponse response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gatewayName);
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-        return response.getEntity(Version.class);
-    }
-
-    /**
-     * Get registry REST service connection URL
-     *
-     * @return service URL
-     */
-    public URI getConnectionURI() {
-        try {
-            webResource = getBasicRegistryBaseResource().path(
-                    ResourcePathConstants.BasicRegistryConstants.GET_SERVICE_URL);
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, null, cookie, gatewayName);
-
-            ClientResponse response = builder.accept(
-                    MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            int status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-                builder = BasicAuthHeaderUtil.getBuilder(
-                        webResource, null, userName, callback.getPassword(userName), null, gatewayName);
-                response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-
-                status = response.getStatus();
-
-                if (status != ClientConstant.HTTP_OK) {
-                    logger.error(response.getEntity(String.class));
-                    throw new RuntimeException("Failed : HTTP error code : "
-                            + status);
-                } else {
-                    if (response.getCookies().size() > 0) {
-                        cookie = response.getCookies().get(0).toCookie();
-                        CookieManager.setCookie(cookie);
-                    }
-                }
-            } else {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            }
-
-            String uri = response.getEntity(String.class);
-            return new URI(uri);
-        } catch (URISyntaxException e) {
-            logger.error("URI syntax is not correct...");
-        }
-        return null;
-    }
-
-    /**
-     * set service connection URL
-     *
-     * @param connectionURI service connection URL
-     */
-    public void setConnectionURI(URI connectionURI) {
-        webResource = getBasicRegistryBaseResource().path(
-                ResourcePathConstants.BasicRegistryConstants.SET_SERVICE_URL);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("connectionurl", connectionURI.toString());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gatewayName);
-
-        ClientResponse response = builder.type(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gatewayName);
-            response = builder.type(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK && status != ClientConstant.HTTP_UNAUTHORIZED) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-}


[35/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java
deleted file mode 100644
index 81db28e..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/BasicRegistryResouce.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-import org.apache.airavata.common.utils.Version;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.registry.api.AiravataUser;
-import org.apache.airavata.registry.api.Gateway;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.net.URI;
-
-@Path(ResourcePathConstants.BasicRegistryConstants.REGISTRY_API_BASICREGISTRY)
-public class BasicRegistryResouce {
-    @Context
-    ServletContext context;
-
-    @GET
-    @Path(ResourcePathConstants.BasicRegistryConstants.GET_GATEWAY)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getGateway() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Gateway gateway = airavataRegistry.getGateway();
-            if (gateway != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(gateway);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.GET_GATEWAY, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @GET
-    @Path(ResourcePathConstants.BasicRegistryConstants.GET_USER)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getAiravataUser() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            AiravataUser airavataUser = airavataRegistry.getAiravataUser();
-            if (airavataUser != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(airavataUser);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.GET_USER, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.BasicRegistryConstants.SET_GATEWAY)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response setGateway(Gateway gateway) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.setGateway(gateway);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Gateway added successfully");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.SET_GATEWAY, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.BasicRegistryConstants.SET_USER)
-    @Consumes({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response setAiravataUser(AiravataUser user) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.setAiravataUser(user);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Airavata user added successfully");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.SET_USER, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @GET
-    @Path(ResourcePathConstants.BasicRegistryConstants.VERSION)
-    @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
-    public Response getVersion() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Version version = airavataRegistry.getVersion();
-            if (version != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(version);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.VERSION, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @GET
-    @Path(ResourcePathConstants.BasicRegistryConstants.GET_SERVICE_URL)
-    @Produces({MediaType.TEXT_PLAIN,MediaType.APPLICATION_JSON})
-    public Response getConnectionURL (){
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try{
-            String connectionURL = airavataRegistry.getConnectionURI().toString();
-            if (connectionURL != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(connectionURL);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.GET_SERVICE_URL, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    @POST
-    @Path(ResourcePathConstants.BasicRegistryConstants.SET_SERVICE_URL)
-    @Produces({MediaType.TEXT_PLAIN,MediaType.APPLICATION_JSON})
-    public Response setConnectionURL (@FormParam("connectionurl") String connectionURL){
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try{
-            URI uri = new URI(connectionURL);
-            airavataRegistry.setConnectionURI(uri);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Connection URL updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.BasicRegistryConstants.SET_SERVICE_URL, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
deleted file mode 100644
index bd1f8c0..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/ConfigurationRegistryResource.java
+++ /dev/null
@@ -1,732 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.rest.mappings.resourcemappings.ConfigurationList;
-import org.apache.airavata.rest.mappings.resourcemappings.URLList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.*;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import java.net.URI;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-/**
- * This class is a REST interface to all the methods related to Configuration which are exposed by
- * Airavata Registry API
- */
-@Path(ResourcePathConstants.ConfigResourcePathConstants.CONFIGURATION_REGISTRY_RESOURCE)
-public class ConfigurationRegistryResource {
-
-    @Context
-    ServletContext context;
-
-    /**
-     * This method will return the configuration value corrosponding to given config key
-     *
-     * @param key configuration key
-     * @return HTTP Response
-     */
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.GET_CONFIGURATION)
-    @GET
-    @Produces({MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON})
-    public Response getConfiguration(@QueryParam("key") String key) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            Object configuration = airavataRegistry.getConfiguration(key);
-            if (configuration != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(configuration);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_CONFIGURATION, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-
-    }
-
-    /**
-     * This method will return configuration list for given configuration key
-     *
-     * @param key configuration key
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.GET_CONFIGURATION_LIST)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getConfigurationList(@QueryParam("key") String key) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-
-            List<Object> configurationList = airavataRegistry.getConfigurationList(key);
-            ConfigurationList list = new ConfigurationList();
-            Object[] configValList = new Object[configurationList.size()];
-            for (int i = 0; i < configurationList.size(); i++) {
-                configValList[i] = configurationList.get(i);
-            }
-            list.setConfigValList(configValList);
-            if (configurationList.size() != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(list);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_CONFIGURATION_LIST, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will add a configuration with given config key, config value and expiration date
-     *
-     * @param key   configuration key
-     * @param value configuration value
-     * @param date  configuration expire data
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.SAVE_CONFIGURATION)
-    @Produces(MediaType.TEXT_PLAIN)
-    @Consumes({MediaType.APPLICATION_FORM_URLENCODED, MediaType.APPLICATION_JSON})
-    public Response setConfiguration(@FormParam("key") String key,
-                                     @FormParam("value") String value,
-                                     @FormParam("date") String date) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(date);
-            airavataRegistry.setConfiguration(key, value, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Configuration saved successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.SAVE_CONFIGURATION, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update the configuration according to the given config value and expire
-     * date
-     *
-     * @param key   config key
-     * @param value config value
-     * @param date  expiration date
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.UPDATE_CONFIGURATION)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addConfiguration(@FormParam("key") String key,
-                                     @FormParam("value") String value,
-                                     @FormParam("date") String date) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(date);
-            airavataRegistry.addConfiguration(key, value, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Configuration updated successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.UPDATE_CONFIGURATION, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will delete all configuration of the given config key
-     *
-     * @param key configuration key
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_CONFIGURATION)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removeAllConfiguration(@QueryParam("key") String key) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removeAllConfiguration(key);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("All configurations with given config key removed successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_CONFIGURATION, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will delete the configuration with the given config key and config value
-     *
-     * @param key   configuration key
-     * @param value configuration value
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.DELETE_CONFIGURATION)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removeConfiguration(@QueryParam("key") String key, @QueryParam("value") String value) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removeConfiguration(key, value);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Configuration removed successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_CONFIGURATION, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve all the GFac URIs
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.GET_GFAC_URI_LIST)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getGFacURIs() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<URI> uris = airavataRegistry.getGFacURIs();
-            URLList list = new URLList();
-            String[] urs = new String[uris.size()];
-            for (int i = 0; i < uris.size(); i++) {
-                urs[i] = uris.get(i).toString();
-            }
-            list.setUris(urs);
-            if (urs.length != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(list);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_GFAC_URI_LIST, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve all the workflow interpreter URIs
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.GET_WFINTERPRETER_URI_LIST)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getWorkflowInterpreterURIs() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            List<URI> uris = airavataRegistry.getWorkflowInterpreterURIs();
-            URLList list = new URLList();
-            String[] urs = new String[uris.size()];
-            for (int i = 0; i < uris.size(); i++) {
-                urs[i] = uris.get(i).toString();
-            }
-            list.setUris(urs);
-            if (urs.length != 0) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(list);
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_WFINTERPRETER_URI_LIST, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve eventing URI
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.GET_EVENTING_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response getEventingServiceURI() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            URI eventingServiceURI = airavataRegistry.getEventingServiceURI();
-            if (eventingServiceURI != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(eventingServiceURI.toString());
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_EVENTING_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will retrieve messagebox URI
-     *
-     * @return HTTP response
-     */
-    @GET
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.GET_MESSAGE_BOX_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response getMessageBoxURI() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            URI eventingServiceURI = airavataRegistry.getMessageBoxURI();
-            if (eventingServiceURI != null) {
-                Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-                builder.entity(eventingServiceURI.toString());
-                return builder.build();
-            } else {
-                Response.ResponseBuilder builder = Response.status(Response.Status.NO_CONTENT);
-                return builder.build();
-            }
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.GET_MESSAGE_BOX_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will add new GFac URI
-     *
-     * @param uri gfac URI
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.ADD_GFAC_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addGFacURI(@FormParam("uri") String uri) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            URI gfacURI = new URI(uri);
-            airavataRegistry.addGFacURI(gfacURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("GFac URI added successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_GFAC_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will add new workflow interpreter URI
-     *
-     * @param uri workflow interpreter URI
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.ADD_WFINTERPRETER_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addWorkflowInterpreterURI(@FormParam("uri") String uri) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            URI interpreterURI = new URI(uri);
-            airavataRegistry.addWorkflowInterpreterURI(interpreterURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow interpreter URI added successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_WFINTERPRETER_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will set a new eventing URI
-     *
-     * @param uri eventing URI
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.ADD_EVENTING_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response setEventingURI(@FormParam("uri") String uri) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            URI eventingURI = new URI(uri);
-            airavataRegistry.setEventingURI(eventingURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Eventing URI set successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_EVENTING_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will set message box URI
-     *
-     * @param uri message box URI
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.ADD_MESSAGE_BOX_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response setMessageBoxURI(@FormParam("uri") String uri) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            URI msgBoxURI = new URI(uri);
-            airavataRegistry.setMessageBoxURI(msgBoxURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("MessageBox URI set successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_MESSAGE_BOX_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update GFac URI expiring date
-     *
-     * @param uri  GFac URI
-     * @param date Expiration date
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.ADD_GFAC_URI_DATE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addGFacURIByDate(@FormParam("uri") String uri, @FormParam("date") String date) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(date);
-            URI gfacURI = new URI(uri);
-            airavataRegistry.addGFacURI(gfacURI, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("GFac URI added successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_GFAC_URI_DATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update workflow interpreter URI expiration date
-     *
-     * @param uri  workflow interpreter URI
-     * @param date workflow interpreter expiration date
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.ADD_WFINTERPRETER_URI_DATE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response addWorkflowInterpreterURI(@FormParam("uri") String uri, @FormParam("date") String date) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(date);
-            URI interpreterURI = new URI(uri);
-            airavataRegistry.addWorkflowInterpreterURI(interpreterURI, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow interpreter URI added successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_WFINTERPRETER_URI_DATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update Eventing URI expiration date
-     *
-     * @param uri  eventing URI
-     * @param date eventing URI expiration date
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.ADD_EVENTING_URI_DATE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response setEventingURIByDate(@FormParam("uri") String uri, @FormParam("date") String date) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(date);
-            URI eventingURI = new URI(uri);
-            airavataRegistry.setEventingURI(eventingURI, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Eventing URI added successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_EVENTING_URI_DATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will update expiration date of Message box URI
-     *
-     * @param uri  message box URI
-     * @param date message box expiration date
-     * @return HTTP response
-     */
-    @POST
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.ADD_MSG_BOX_URI_DATE)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response setMessageBoxURIByDate(@FormParam("uri") String uri, @FormParam("date") String date) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-            Date formattedDate = dateFormat.parse(date);
-            URI msgBoxURI = new URI(uri);
-            airavataRegistry.setMessageBoxURI(msgBoxURI, formattedDate);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Message box URI retrieved successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.ADD_MSG_BOX_URI_DATE, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will remove GFac URI
-     *
-     * @param uri GFac URI
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.DELETE_GFAC_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removeGFacURI(@QueryParam("uri") String uri) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            URI gfacURI = new URI(uri);
-            airavataRegistry.removeGFacURI(gfacURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("GFac URI deleted successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_GFAC_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will remove all the GFac URIs
-     *
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_GFAC_URIS)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removeAllGFacURI() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removeAllGFacURI();
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("All GFac URIs deleted successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_GFAC_URIS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will remove workflow interpreter URI
-     *
-     * @param uri workflow interpreter URI
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.DELETE_WFINTERPRETER_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removeWorkflowInterpreterURI(@QueryParam("uri") String uri) {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            URI intURI = new URI(uri);
-            airavataRegistry.removeWorkflowInterpreterURI(intURI);
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Workflow Interpreter URI deleted successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_WFINTERPRETER_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will remove all the workflow interpreter URIs
-     *
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_WFINTERPRETER_URIS)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response removeAllWorkflowInterpreterURI() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.removeAllWorkflowInterpreterURI();
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("All workflow interpreter URIs deleted successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_WFINTERPRETER_URIS, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will remove eventing URI
-     *
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.DELETE_EVENTING_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response unsetEventingURI() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.unsetEventingURI();
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("Eventing URI deleted successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_EVENTING_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-    /**
-     * This method will remove message box URI
-     *
-     * @return HTTP response
-     */
-    @DELETE
-    @Path(ResourcePathConstants.ConfigResourcePathConstants.DELETE_MSG_BOX_URI)
-    @Produces(MediaType.TEXT_PLAIN)
-    public Response unsetMessageBoxURI() {
-        AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-        try {
-            airavataRegistry.unsetMessageBoxURI();
-            Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-            builder.entity("MessageBox URI deleted successfully...");
-            return builder.build();
-        } catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.ConfigResourcePathConstants.DELETE_MSG_BOX_URI, e);
-        } finally {
-            if (airavataRegistry != null) {
-                RegPoolUtils.releaseRegistry(context, airavataRegistry);
-            }
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/CredentialRegistryResource.java
----------------------------------------------------------------------
diff --git a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/CredentialRegistryResource.java b/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/CredentialRegistryResource.java
deleted file mode 100644
index a149cc0..0000000
--- a/modules/rest/service/src/main/java/org/apache/airavata/services/registry/rest/resources/CredentialRegistryResource.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.services.registry.rest.resources;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.rest.mappings.utils.RegPoolUtils;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.services.registry.rest.utils.WebAppUtil;
-
-/**
- * This class provides a REST interface to all the operations related to credential store
- */
-@Path(ResourcePathConstants.CredentialResourceConstants.REGISTRY_API_CREDENTIALREGISTRY)
-public class CredentialRegistryResource {
-    
-	@Context
-    ServletContext context;
-
-    /**
-     * This method will check whether a credential exists for a given tokenId and gateway
-     *
-     * @param String gatewayId
-     * @param String tokenId
-     * @return HTTP response boolean
-     */
-    @GET
-    @Path(ResourcePathConstants.CredentialResourceConstants.SSH_CREDENTIAL_EXIST)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response isCredentialExist(@QueryParam("gatewayId") String gatewayId, @QueryParam("tokenId") String tokenId) {
-    	if(gatewayId==null || gatewayId.isEmpty() || tokenId == null || tokenId.isEmpty()) {
-    		Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-    		builder.entity("gatewayId or username can't be null");
-    		return builder.build();
-    	}
-    	
-    	AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-    	try {
-         	String publicKey = airavataRegistry.getCredentialPublicKey(gatewayId,tokenId);
-	    	if (publicKey!=null && publicKey.isEmpty()) {
-	    		Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-	    		builder.entity("true");
-	    		return builder.build();
-	    	} else {
-	    		Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-	    		builder.entity("false");
-	    		return builder.build();
-	    	}
-    	} catch (Throwable e) {
-    		return WebAppUtil.reportInternalServerError(ResourcePathConstants.CredentialResourceConstants.SSH_CREDENTIAL, e);
-    	}
-    }
-    
-    
-    /**
-     * This method will get the public key of the ssh credential exists for a given user and gateway
-     *
-     * @param String gatewayId
-     * @param String tokenId
-     * @return HTTP response - The public key of the credential 
-     */
-    @GET
-    @Path(ResourcePathConstants.CredentialResourceConstants.SSH_CREDENTIAL)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response getCredentialPublicKey(@QueryParam("gatewayId") String gatewayId, @QueryParam("tokenId") String tokenId) {
-    	if(gatewayId==null || gatewayId.isEmpty() || tokenId == null || tokenId.isEmpty()) {
-    		Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-    		builder.entity("gatewayId or username can't be null");
-    		return builder.build();
-    	}
-    	
-    	AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-    	try {
-         	String publicKey = airavataRegistry.getCredentialPublicKey(gatewayId,tokenId);
-	    	if (publicKey!=null && publicKey.isEmpty()) {
-	    		Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-	    		builder.entity(publicKey);
-	    		return builder.build();
-	    	} else {
-	    		Response.ResponseBuilder builder = Response.status(Response.Status.NOT_FOUND);
-	    		return builder.build();
-	    	}
-		} catch (Throwable e) {
-			return WebAppUtil.reportInternalServerError(ResourcePathConstants.CredentialResourceConstants.SSH_CREDENTIAL, e);
-		}
-    }
-    
-    
-    /**
-     * This method will create a new ssh credential for a given user, gateway and return the public key of the keypair
-     *
-     * @param String gatewayId
-     * @param String tokenId
-     * @return HTTP response - The public key of the credential 
-     */
-    @POST
-    @Path(ResourcePathConstants.CredentialResourceConstants.SSH_CREDENTIAL)
-    @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
-    public Response createCredential(@QueryParam("gatewayId") String gatewayId, @QueryParam("tokenId") String tokenId) {
-    	if(gatewayId==null || gatewayId.isEmpty() || tokenId == null || tokenId.isEmpty()) {
-    		Response.ResponseBuilder builder = Response.status(Response.Status.BAD_REQUEST);
-    		builder.entity("gatewayId or username can't be null");
-    		return builder.build();
-    	}
-    	AiravataRegistry2 airavataRegistry = RegPoolUtils.acquireRegistry(context);
-    	try {
-         	String publicKey = airavataRegistry.createCredential(gatewayId, tokenId);
-	    	if (publicKey!=null && publicKey.isEmpty()) {
-	    		Response.ResponseBuilder builder = Response.status(Response.Status.OK);
-	    		builder.entity(publicKey);
-	    		return builder.build();
-	    	} else {
-	    		Response.ResponseBuilder builder = Response.status(Response.Status.INTERNAL_SERVER_ERROR);
-	    		builder.entity("Error creating credential");
-	    		return builder.build();
-	    	}
-    	} catch (Throwable e) {
-            return WebAppUtil.reportInternalServerError(ResourcePathConstants.CredentialResourceConstants.SSH_CREDENTIAL, e);
-        }
-    }
-    
-    
-
-}


[76/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
new file mode 100644
index 0000000..267b838
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/EmbeddedGFacInvoker.java
@@ -0,0 +1,686 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) und= nuer one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.invoker;
+
+import java.io.File;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.*;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
+import org.apache.airavata.commons.gfac.type.ActualParameter;
+import org.apache.airavata.commons.gfac.type.ApplicationDescription;
+import org.apache.airavata.commons.gfac.type.HostDescription;
+import org.apache.airavata.commons.gfac.type.ServiceDescription;
+import org.apache.airavata.credential.store.store.CredentialReaderFactory;
+import org.apache.airavata.gfac.Constants;
+import org.apache.airavata.gfac.GFacConfiguration;
+import org.apache.airavata.gfac.RequestData;
+import org.apache.airavata.gfac.context.ApplicationContext;
+import org.apache.airavata.gfac.context.JobExecutionContext;
+import org.apache.airavata.gfac.context.MessageContext;
+import org.apache.airavata.gfac.context.security.GSISecurityContext;
+import org.apache.airavata.gfac.context.security.SSHSecurityContext;
+import org.apache.airavata.gfac.cpi.GFacImpl;
+import org.apache.airavata.gfac.ec2.AmazonSecurityContext;
+import org.apache.airavata.gfac.scheduler.HostScheduler;
+import org.apache.airavata.gfac.utils.GFacUtils;
+import org.apache.airavata.gsi.ssh.api.Cluster;
+import org.apache.airavata.gsi.ssh.api.SSHApiException;
+import org.apache.airavata.gsi.ssh.api.ServerInfo;
+import org.apache.airavata.gsi.ssh.api.authentication.AuthenticationInfo;
+import org.apache.airavata.gsi.ssh.api.authentication.GSIAuthenticationInfo;
+import org.apache.airavata.gsi.ssh.impl.PBSCluster;
+import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPasswordAuthenticationInfo;
+import org.apache.airavata.gsi.ssh.impl.authentication.DefaultPublicKeyFileAuthentication;
+import org.apache.airavata.gsi.ssh.impl.authentication.MyProxyAuthenticationInfo;
+import org.apache.airavata.gsi.ssh.util.CommonUtils;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.schemas.gfac.*;
+import org.apache.airavata.schemas.wec.ContextHeaderDocument;
+import org.apache.airavata.schemas.wec.SecurityContextDocument;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
+import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMNamespace;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.wsdl.WsdlDefinitions;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.impl.WSIFMessageElement;
+import xsul.xwsif_runtime.WSIFClient;
+
+public class EmbeddedGFacInvoker implements Invoker {
+
+    private static final Logger logger = LoggerFactory.getLogger(EmbeddedGFacInvoker.class);
+
+    private String nodeID;
+
+    private QName portTypeQName;
+
+    private String wsdlLocation;
+
+    private String serviceInformation;
+
+    private String messageBoxURL;
+
+    private String gfacURL;
+
+    private Invoker invoker;
+
+    private XBayaConfiguration configuration;
+
+
+    private Boolean result;
+
+    private ServiceNotifiable notifier;
+
+//    private AiravataRegistry2 registry;
+
+    private String topic;
+
+    private String serviceName;
+
+    private AiravataAPI airavataAPI;
+    /**
+     * used for notification
+     */
+    private List<Object> inputValues = new ArrayList<Object>();
+
+    /**
+     * used for notification
+     */
+    private List<String> inputNames = new ArrayList<String>();
+
+    boolean failerSent;
+
+    private WsdlDefinitions wsdlDefinitionObject;
+
+    private Object outPut;
+
+    Map<String, Object> actualParameters = new LinkedHashMap<String, Object>();
+
+    /**
+     * Creates an InvokerWithNotification.
+     *
+     * @param portTypeQName
+     * @param wsdlLocation  The URL of WSDL of the service to invoke
+     * @param nodeID        The ID of the service
+     * @param notifier      The notification sender
+     */
+    public EmbeddedGFacInvoker(QName portTypeQName, String wsdlLocation, String nodeID, WorkflowNotifiable notifier) {
+        this(portTypeQName, wsdlLocation, nodeID, null, notifier);
+    }
+
+    /**
+     * Creates an InvokerWithNotification.
+     *
+     * @param portTypeQName
+     * @param wsdlLocation  The URL of WSDL of the service to invoke
+     * @param nodeID        The ID of the service
+     * @param gfacURL       The URL of GFac service.
+     * @param notifier      The notification sender
+     */
+    public EmbeddedGFacInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String gfacURL,
+                               WorkflowNotifiable notifier) {
+        this(portTypeQName, wsdlLocation, nodeID, null, gfacURL, notifier);
+    }
+
+    /**
+     * Creates an InvokerWithNotification.
+     *
+     * @param portTypeQName
+     * @param wsdlLocation  The URL of WSDL of the service to invoke
+     * @param nodeID        The ID of the service
+     * @param messageBoxURL
+     * @param gfacURL       The URL of GFac service.
+     * @param notifier      The notification sender
+     */
+    public EmbeddedGFacInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String messageBoxURL,
+                               String gfacURL, WorkflowNotifiable notifier) {
+        this.nodeID = nodeID;
+        this.portTypeQName = portTypeQName;
+        this.wsdlLocation = wsdlLocation;
+        this.serviceInformation = wsdlLocation;
+        this.messageBoxURL = messageBoxURL;
+        this.gfacURL = gfacURL;
+        this.notifier = notifier.createServiceNotificationSender(nodeID);
+
+        this.failerSent = false;
+    }
+
+    /**
+     * @param portTypeQName
+     * @param wsdl
+     * @param nodeID
+     * @param messageBoxURL
+     * @param gfacURL
+     * @param notifier
+     */
+    public EmbeddedGFacInvoker(QName portTypeQName,
+                               WsdlDefinitions wsdl,
+                               String nodeID,
+                               String messageBoxURL,
+                               String gfacURL,
+                               WorkflowNotifiable notifier,
+                               String topic,
+                               AiravataAPI airavataAPI,
+                               String serviceName,
+                               XBayaConfiguration config) {
+        final String wsdlStr = xsul.XmlConstants.BUILDER.serializeToString(wsdl);
+        this.nodeID = nodeID;
+        this.portTypeQName = portTypeQName;
+        this.wsdlDefinitionObject = wsdl;
+        this.messageBoxURL = messageBoxURL;
+        this.serviceInformation = wsdlStr;
+        this.gfacURL = gfacURL;
+        this.notifier = notifier.createServiceNotificationSender(nodeID);
+        this.airavataAPI = airavataAPI;
+        this.topic = topic;
+        this.serviceName = serviceName;
+        this.failerSent = false;
+        this.configuration = config;
+    }
+
+    /**
+     * @throws WorkflowException
+     */
+    public void setup() throws WorkflowException {
+        this.notifier.setServiceID(this.nodeID);
+    }
+
+    private void setup(WsdlDefinitions definitions) throws WorkflowException {
+    }
+
+    /**
+     * @param operationName The name of the operation
+     * @throws WorkflowException
+     */
+    public void setOperation(String operationName) throws WorkflowException {
+    }
+
+    /**
+     * @param name  The name of the input parameter
+     * @param value The value of the input parameter
+     * @throws WorkflowException
+     */
+    public void setInput(String name, Object value) throws WorkflowException {
+        try {
+            if (value instanceof XmlElement) {
+                logger.debug("value: " + XMLUtil.xmlElementToString((XmlElement) value));
+            }
+            this.inputNames.add(name);
+            this.inputValues.add(value);
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error in setting an input. name: " + name + " value: " + value;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Exception e) {
+            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+        }
+    }
+
+    /**
+     * @return
+     * @throws WorkflowException
+     */
+    public synchronized boolean invoke() throws WorkflowException {
+        try {
+            ContextHeaderDocument.ContextHeader contextHeader =
+                    WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID, this.configuration.getContextHeader());
+            String hostName = null;
+            HostDescription registeredHost;
+            if (contextHeader != null) {
+                if (contextHeader.getWorkflowSchedulingContext() != null &&
+                        contextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray().length > 0 &&
+                        contextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray(0).getHostName() != null) {
+                    hostName = contextHeader.getWorkflowSchedulingContext().getApplicationSchedulingContextArray(0).getHostName();
+                }
+            }
+            //todo This is the basic scheduling, have to do proper scheduling implementation by implementing HostScheduler interface
+            ServiceDescription serviceDescription = airavataAPI.getApplicationManager().getServiceDescription(serviceName);
+            if (hostName == null) {
+                List<HostDescription> registeredHosts = new ArrayList<HostDescription>();
+                Map<String, ApplicationDescription> applicationDescriptors = airavataAPI.getApplicationManager().getApplicationDescriptors(serviceName);
+                for (String hostDescName : applicationDescriptors.keySet()) {
+                    registeredHosts.add(airavataAPI.getApplicationManager().getHostDescription(hostDescName));
+                }
+                Class<? extends HostScheduler> aClass = Class.forName(ServerSettings.getHostScheduler()).asSubclass(HostScheduler.class);
+                HostScheduler hostScheduler = aClass.newInstance();
+                registeredHost = hostScheduler.schedule(registeredHosts);
+            } else {
+                // if user specify a host, no matter what we pick that host for all the nodes, todo: allow users to specify node specific host
+                registeredHost = airavataAPI.getApplicationManager().getHostDescription(hostName);
+            }
+            ApplicationDescription applicationDescription =
+                    airavataAPI.getApplicationManager().getApplicationDescription(serviceName, registeredHost.getType().getHostName());
+
+            // When we run getInParameters we set the actualParameter object, this has to be fixed
+            URL resource = EmbeddedGFacInvoker.class.getClassLoader().getResource(org.apache.airavata.common.utils.Constants.GFAC_CONFIG_XML);
+            OMElement inputMessage = getInParameters();
+            Object wsifMessageElement = new WSIFMessageElement(XMLUtil.stringToXmlElement3(inputMessage.toStringWithConsume()));
+            this.notifier.invokingService(new WSIFMessageElement((XmlElement) wsifMessageElement));
+            Properties configurationProperties = ServerSettings.getProperties();
+            GFacConfiguration gFacConfiguration = GFacConfiguration.create(new File(resource.getPath()), airavataAPI, configurationProperties);
+
+            JobExecutionContext jobExecutionContext = new JobExecutionContext(gFacConfiguration, serviceName);
+            //Here we get only the contextheader information sent specific for this node
+            //Add security context
+
+            //FIXME - We no longer using job execution context
+//            jobExecutionContext.setContextHeader(WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID, configuration.getContextHeader()));
+
+
+            jobExecutionContext.setProperty(Constants.PROP_WORKFLOW_NODE_ID, this.nodeID);
+            jobExecutionContext.setProperty(Constants.PROP_TOPIC, this.configuration.getTopic());
+            jobExecutionContext.setProperty(Constants.PROP_BROKER_URL, this.configuration.getBrokerURL().toASCIIString());
+            jobExecutionContext.setProperty(Constants.PROP_WORKFLOW_INSTANCE_ID, this.configuration.getTopic());
+
+
+            ApplicationContext applicationContext = new ApplicationContext();
+            applicationContext.setApplicationDeploymentDescription(applicationDescription);
+            applicationContext.setHostDescription(registeredHost);
+            applicationContext.setServiceDescription(serviceDescription);
+
+            jobExecutionContext.setApplicationContext(applicationContext);
+
+            jobExecutionContext.setOutMessageContext(getOutParameters(serviceDescription));
+            jobExecutionContext.setInMessageContext(new MessageContext(actualParameters));
+
+            addSecurityContext(registeredHost, configurationProperties, jobExecutionContext,
+                    configuration.getContextHeader());
+            GFacImpl gfacAPI1 = new GFacImpl();
+            gfacAPI1.submitJob(jobExecutionContext);
+
+            OMFactory fac = OMAbstractFactory.getOMFactory();
+            OMNamespace omNs = fac.createOMNamespace("http://ws.apache.org/axis2/xsd", "ns1");
+            OMElement outputElement = fac.createOMElement("invokeResponse", omNs);
+            MessageContext outMessageContext = jobExecutionContext.getOutMessageContext();
+            Set<String> paramNames = outMessageContext.getParameters().keySet();
+            for (String paramName : paramNames) {
+                /*
+                * Process Output
+                */
+                String outputString = ((ActualParameter) outMessageContext.getParameter(paramName)).toXML().replaceAll("GFacParameter", paramName);
+                XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(outputString));
+                StAXOMBuilder builder = new StAXOMBuilder(reader);
+                outputElement.addChild(builder.getDocumentElement());
+            }
+            // Send notification
+            logger.debug("outputMessage: " + outputElement.toString());
+            outPut = new WSIFMessageElement(XMLUtil.stringToXmlElement3(outputElement.toStringWithConsume()));
+            this.result = true;
+            EmbeddedGFacInvoker.this.notifier.serviceFinished(new WSIFMessageElement((XmlElement) outPut));
+            //todo check whether ActualParameter values are set or not, if they are null have to through an error or handle this in gfac level.
+//             {
+//                // An implementation of WSIFMessage,
+//                // WSIFMessageElement, implements toString(), which
+//                // serialize the message XML.
+//                EmbeddedGFacInvoker.this.notifier.receivedFault(new WSIFMessageElement(XMLUtil.stringToXmlElement3("<Message>Invocation Failed</Message>")));
+//                EmbeddedGFacInvoker.this.failerSent = true;
+//            }
+
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error in invoking a service: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Exception e) {
+            this.notifier.invocationFailed(e.getMessage(), e);
+            throw new WorkflowException(e.getMessage(), e);
+        }
+        return true;
+    }
+
+    private SecurityContextDocument.SecurityContext.CredentialManagementService getCredentialManagementService(
+            ContextHeaderDocument.ContextHeader contextHeader) {
+
+        if (contextHeader != null) {
+
+            SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
+                    = contextHeader.getSecurityContext().getCredentialManagementService();
+
+            if (credentialManagementService != null) {
+                // Make sure token id and portal user id is properly populated
+                if (credentialManagementService.getTokenId() != null &&
+                        credentialManagementService.getPortalUser() != null) {
+
+                    return credentialManagementService;
+                } else {
+                    return null;
+                }
+            } else {
+                return null;
+            }
+        }
+
+        return null;
+    }
+
+    private void addSecurityContext(HostDescription registeredHost, Properties configurationProperties,
+                                    JobExecutionContext jobExecutionContext, ContextHeaderDocument.ContextHeader contextHeader) throws WorkflowException {
+        RequestData requestData;
+            /* todo fix the credential store and uncomment following code block
+            SecurityContextDocument.SecurityContext.CredentialManagementService credentialManagementService
+                    = getCredentialManagementService(contextHeader);
+
+            GSISecurityContext context;
+
+
+            if (credentialManagementService != null) {
+                String gatewayId = credentialManagementService.getGatewayId();
+                String tokenId
+                        = credentialManagementService.getTokenId();
+                String portalUser = credentialManagementService.getPortalUser();
+
+                requestData = new RequestData(tokenId, portalUser, gatewayId);
+            } else {
+                requestData = new RequestData("default");
+            }
+
+            try {
+                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
+            } catch (Exception e) {
+                throw new WorkflowException("An error occurred while creating GSI security context", e);
+            }
+            if (registeredHost.getType() instanceof GsisshHostType) {
+                GSIAuthenticationInfo authenticationInfo
+                        = new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
+                        requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
+                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());
+
+                Cluster pbsCluster = null;
+                try {
+                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
+                            (((HpcApplicationDeploymentType) jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath()));
+                } catch (SSHApiException e) {
+                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                }
+
+                context.setPbsCluster(pbsCluster);
+            }
+            */
+            requestData = new RequestData("default");
+            GSISecurityContext context;
+            try {
+                context = new GSISecurityContext(CredentialReaderFactory.createCredentialStoreReader(), requestData);
+            } catch (Exception e) {
+                throw new WorkflowException("An error occurred while creating GSI security context", e);
+            }
+
+            if (registeredHost.getType() instanceof GsisshHostType) {
+                GSIAuthenticationInfo authenticationInfo
+                        = new MyProxyAuthenticationInfo(requestData.getMyProxyUserName(), requestData.getMyProxyPassword(), requestData.getMyProxyServerUrl(),
+                        requestData.getMyProxyPort(), requestData.getMyProxyLifeTime(), System.getProperty(Constants.TRUSTED_CERTIFICATE_SYSTEM_PROPERTY));
+                ServerInfo serverInfo = new ServerInfo(requestData.getMyProxyUserName(), registeredHost.getType().getHostAddress());
+
+                Cluster pbsCluster = null;
+                try {
+                    String installedParentPath = ((HpcApplicationDeploymentType)
+                            jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
+                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
+                            (CommonUtils.getPBSJobManager(installedParentPath)));
+                } catch (SSHApiException e) {
+                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                }
+
+                context.setPbsCluster(pbsCluster);
+            }
+
+            jobExecutionContext.addSecurityContext(GSISecurityContext.GSI_SECURITY_CONTEXT, context);
+        //Adding Amanzon Keys
+            if (this.configuration.getAmazonSecurityContext() != null) {
+                jobExecutionContext.addSecurityContext(AmazonSecurityContext.AMAZON_SECURITY_CONTEXT,
+                        this.configuration.getAmazonSecurityContext());
+         }
+      //Adding SSH security
+            String sshUserName = configurationProperties.getProperty(Constants.SSH_USER_NAME);
+            String sshPrivateKey = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY);
+            String sshPrivateKeyPass = configurationProperties.getProperty(Constants.SSH_PRIVATE_KEY_PASS);
+            String sshPassword = configurationProperties.getProperty(Constants.SSH_PASSWORD);
+            String sshPublicKey = configurationProperties.getProperty(Constants.SSH_PUBLIC_KEY);
+            SSHSecurityContext sshSecurityContext = new SSHSecurityContext();
+            if (((SSHHostType) registeredHost.getType()).getHpcResource()) {
+                AuthenticationInfo authenticationInfo = null;
+                // we give higher preference to the password over keypair ssh authentication
+                if (sshPassword != null) {
+                    authenticationInfo = new DefaultPasswordAuthenticationInfo(sshPassword);
+                } else {
+                    authenticationInfo = new DefaultPublicKeyFileAuthentication(sshPublicKey, sshPrivateKey, sshPrivateKeyPass);
+                }
+                ServerInfo serverInfo = new ServerInfo(sshUserName, registeredHost.getType().getHostAddress());
+
+                Cluster pbsCluster = null;
+                try {
+                    String installedParentPath = ((HpcApplicationDeploymentType)
+                            jobExecutionContext.getApplicationContext().getApplicationDeploymentDescription().getType()).getInstalledParentPath();
+                    pbsCluster = new PBSCluster(serverInfo, authenticationInfo,
+                            (CommonUtils.getPBSJobManager(installedParentPath)));
+                } catch (SSHApiException e) {
+                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                }
+                sshSecurityContext.setPbsCluster(pbsCluster);
+                sshSecurityContext.setUsername(sshUserName);
+            } else {
+                sshSecurityContext = new SSHSecurityContext();
+                sshSecurityContext.setUsername(sshUserName);
+                sshSecurityContext.setPrivateKeyLoc(sshPrivateKey);
+                sshSecurityContext.setKeyPass(sshPrivateKeyPass);
+            }
+            jobExecutionContext.addSecurityContext(SSHSecurityContext.SSH_SECURITY_CONTEXT, sshSecurityContext);
+    }
+
+    /**
+     * @throws WorkflowException
+     */
+    @SuppressWarnings("boxing")
+    public synchronized void waitToFinish() throws WorkflowException {
+        try {
+            while (this.result == null) {
+                // The job is not submitted yet.
+                try {
+                    wait();
+                } catch (InterruptedException e) {
+                    logger.error(e.getMessage(), e);
+                }
+            }
+            // Wait for the job to finish.
+            Boolean success = this.result;
+            if (success == false) {
+                WSIFMessage faultMessage = this.invoker.getFault();
+                String message = "Error in a service: ";
+                // An implementation of WSIFMessage,
+                // WSIFMessageElement, implements toString(), which
+                // serialize the message XML.
+                message += faultMessage.toString();
+                throw new WorkflowException(message);
+            }
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error while waiting for a service to finish: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     * @param name The name of the output parameter
+     * @return
+     * @throws WorkflowException
+     */
+    public Object getOutput(String name) throws WorkflowException {
+        try {
+            waitToFinish();
+            if (outPut instanceof XmlElement) {
+                Iterator children = ((XmlElement) outPut).children();
+                while (children.hasNext()) {
+                    Object next = children.next();
+                    if (((XmlElement) next).getName().equals(name)) {
+                        return ((XmlElement) ((XmlElement) next).children().next()).children().next();
+                    }
+                }
+            } else {
+                return outPut;
+            }
+        } catch (WorkflowException e) {
+            logger.error(e.getMessage(), e);
+            // An appropriate message has been set in the exception.
+            if (!this.failerSent) {
+                this.notifier.invocationFailed(e.getMessage(), e);
+            }
+            throw e;
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error while waiting for a output: " + name;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+        throw new WorkflowException("Output could not be found");
+    }
+
+    /**
+     * @return
+     * @throws WorkflowException
+     */
+    public WSIFMessage getOutputs() throws WorkflowException {
+        return this.invoker.getOutputs();
+    }
+
+    public WSIFClient getClient() {
+        return null;
+    }
+
+    public WSIFMessage getInputs() throws WorkflowException {
+        return null;
+    }
+
+    public WSIFMessage getFault() throws WorkflowException {
+        return null;
+    }
+
+    private OMElement getInParameters() throws AiravataAPIInvocationException, RegistryException, XMLStreamException {
+        OMFactory omFactory = OMAbstractFactory.getOMFactory();
+        OMElement invoke_inputParams = omFactory.createOMElement(new QName("invoke_InputParams"));
+        ServiceDescription serviceDescription = airavataAPI.getApplicationManager().getServiceDescription(this.serviceName);
+        if (serviceDescription == null) {
+            throw new RegistryException(new Exception("Service Description not found in registry."));
+        }
+        ServiceDescriptionType serviceDescriptionType = serviceDescription.getType();
+        for (String inputName : this.inputNames) {
+            OMElement omElement = omFactory.createOMElement(new QName(inputName));
+            int index = this.inputNames.indexOf(inputName);
+            Object value = this.inputValues.get(index);
+            InputParameterType parameter = serviceDescriptionType.getInputParametersArray(index);
+            if (value instanceof XmlElement) {
+                omElement.setText((String) ((XmlElement) ((XmlElement) ((XmlElement) value).children().next()).children().next()).children().next());
+                XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(XMLUtil.xmlElementToString((XmlElement) value)));
+                StAXOMBuilder builder = new StAXOMBuilder(reader);
+                OMElement input = builder.getDocumentElement();
+//                actualParameters.put(parameter.getParameterName(), GFacUtils.getInputActualParameter(parameter, input));
+            } else if (value instanceof String) {
+                omElement.setText((String) value);
+//                actualParameters.put(parameter.getParameterName(), GFacUtils.getInputActualParameter(parameter, AXIOMUtil.stringToOM("<value>" + value + "</value>")));
+            }
+            invoke_inputParams.addChild(omElement);
+        }
+        return invoke_inputParams;
+    }
+
+    private MessageContext getOutParameters(ServiceDescription serviceDescription) {
+        MessageContext outContext = new MessageContext();
+        for (OutputParameterType parameter : serviceDescription.getType().getOutputParametersArray()) {
+            ActualParameter actualParameter = new ActualParameter();
+            if ("String".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(StringParameterType.type);
+            } else if ("Double".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(DoubleParameterType.type);
+            } else if ("Integer".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(IntegerParameterType.type);
+            } else if ("Float".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(FloatParameterType.type);
+            } else if ("Boolean".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(BooleanParameterType.type);
+            } else if ("File".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(FileParameterType.type);
+            } else if ("URI".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(URIParameterType.type);
+            } else if ("StringArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(StringArrayType.type);
+            } else if ("DoubleArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(DoubleArrayType.type);
+            } else if ("IntegerArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(IntegerArrayType.type);
+            } else if ("FloatArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(FloatArrayType.type);
+            } else if ("BooleanArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(BooleanArrayType.type);
+            } else if ("FileArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(FileArrayType.type);
+            } else if ("URIArray".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(URIArrayType.type);
+            } else if ("StdOut".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(StdOutParameterType.type);
+            } else if ("StdErr".equals(parameter.getParameterType().getName())) {
+                actualParameter.getType().changeType(StdErrParameterType.type);
+            }
+            outContext.addParameter(parameter.getParameterName(), actualParameter);
+        }
+        return outContext;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java
new file mode 100644
index 0000000..10edbd9
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GFacInvoker.java
@@ -0,0 +1,199 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.invoker;
+
+import java.net.URI;
+import java.util.UUID;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.xbaya.invoker.factory.InvokerFactory;
+import org.apache.airavata.xbaya.lead.NotificationHandler;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import xsul.lead.LeadContextHeader;
+import xsul.wsdl.WsdlDefinitions;
+import xsul.wsdl.WsdlResolver;
+import xsul.wsif.WSIFMessage;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xwsif_runtime.WSIFClient;
+
+public class GFacInvoker implements Invoker {
+
+    private final static Logger logger = LoggerFactory.getLogger(GFacInvoker.class);
+
+    private String gfacURL;
+
+    private String messageBoxURL;
+
+    private QName portTypeQName;
+
+    private Invoker invoker;
+
+    private LeadContextHeader leadContext;
+
+    private WorkflowContextHeaderBuilder builder;
+
+    /**
+     * Constructs a GFacInvoker.
+     * 
+     * @param portTypeQName
+     * @param gfacURL
+     * @param messageBoxURL
+     * @param context
+     */
+    public GFacInvoker(QName portTypeQName, String gfacURL, String messageBoxURL, LeadContextHeader context) {
+        this.portTypeQName = portTypeQName;
+        this.gfacURL = gfacURL;
+        this.messageBoxURL = messageBoxURL;
+        this.leadContext = context;
+    }
+
+    public GFacInvoker(QName portTypeQName, String gfacURL, String messageBoxURL, WorkflowContextHeaderBuilder context) {
+        this.portTypeQName = portTypeQName;
+        this.gfacURL = gfacURL;
+        this.messageBoxURL = messageBoxURL;
+        this.builder = context;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#setup()
+     */
+    public void setup() throws WorkflowException {
+
+        if (this.gfacURL == null) {
+            String message = "The location of the Generic Factory is not specified.";
+            throw new WorkflowException(message);
+        }
+
+        if (this.portTypeQName == null) {
+            String message = "Error in finding the service name";
+            throw new WorkflowException(message);
+        }
+
+        try {
+
+            URI uri = new URI(this.gfacURL);
+
+            /*
+             * Substring to remove GfacService
+             */
+            String gfacPath = uri.getPath();
+            if (gfacPath != null && gfacPath.contains("/")) {
+                gfacPath = gfacPath.substring(0, gfacPath.lastIndexOf('/') + 1) + portTypeQName.getLocalPart();
+            }
+            URI getWsdlURI = new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), gfacPath
+                    + "/getWSDL", uri.getQuery(), uri.getFragment());
+
+            logger.debug("getWSDL service:" + getWsdlURI.toString());
+
+            WsdlDefinitions concreteWSDL = WsdlResolver.getInstance().loadWsdl(getWsdlURI);
+
+            this.invoker = InvokerFactory.createInvoker(this.portTypeQName, concreteWSDL, null, this.messageBoxURL,
+                    null, true);
+            this.invoker.setup();
+        } catch (WorkflowException xe) {
+            throw xe;
+        } catch (Exception e) {
+            throw new WorkflowException(e.getMessage(), e);
+        }
+
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getClient()
+     */
+    public WSIFClient getClient() {
+        return this.invoker.getClient();
+    }
+
+    /**
+     * @throws WorkflowException
+     * @see org.apache.airavata.xbaya.invoker.Invoker#setOperation(java.lang.String)
+     */
+    public void setOperation(String operationName) throws WorkflowException {
+        this.invoker.setOperation(operationName);
+    }
+
+    /**
+     * @throws WorkflowException
+     * @see org.apache.airavata.xbaya.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
+     */
+    public void setInput(String name, Object value) throws WorkflowException {
+        this.invoker.setInput(name, value);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getInputs()
+     */
+    public WSIFMessage getInputs() throws WorkflowException {
+        return this.invoker.getInputs();
+    }
+
+    /**
+     * @throws WorkflowException
+     * @see org.apache.airavata.xbaya.invoker.Invoker#invoke()
+     */
+    public boolean invoke() throws WorkflowException {
+
+        WSIFClient client = invoker.getClient();
+        // FIXME: Temporary fix
+        // if (this.leadContext == null) {
+        // LeadContextHeader lh = new LeadContextHeader(UUID.randomUUID().toString(), "XBaya-User");
+        // this.leadContext = lh;
+        // }
+        // StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-lead-header", this.leadContext);
+        // client.addHandler(handler);
+
+        // This handler has to be end to get the entire soap message.
+        NotificationHandler notificationHandler = new NotificationHandler(this.builder);
+        client.addHandler(notificationHandler);
+        return this.invoker.invoke();
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutputs()
+     */
+    public WSIFMessage getOutputs() throws WorkflowException {
+        return this.invoker.getOutputs();
+    }
+
+    /**
+     * @throws WorkflowException
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutput(java.lang.String)
+     */
+    public Object getOutput(String name) throws WorkflowException {
+        return this.invoker.getOutput(name);
+    }
+
+    /**
+     * @throws WorkflowException
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getFault()
+     */
+    public WSIFMessage getFault() throws WorkflowException {
+        return this.invoker.getFault();
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GenericInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GenericInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GenericInvoker.java
new file mode 100644
index 0000000..e59c150
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/GenericInvoker.java
@@ -0,0 +1,529 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.invoker;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.TimeoutException;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.schemas.wec.ContextHeaderDocument;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.xbaya.invoker.factory.InvokerFactory;
+import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
+import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.wsdl.WsdlDefinitions;
+import xsul.wsdl.WsdlException;
+import xsul.wsdl.WsdlResolver;
+import xsul.wsif.WSIFMessage;
+import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
+import xsul.xwsif_runtime.WSIFClient;
+
+public class GenericInvoker implements Invoker {
+
+    private static final Logger logger = LoggerFactory.getLogger(GenericInvoker.class);
+
+    private String nodeID;
+
+    private QName portTypeQName;
+
+    private String wsdlLocation;
+
+    private String serviceInformation;
+
+    private String messageBoxURL;
+
+    private String gfacURL;
+
+    private Invoker invoker;
+
+    private Future<Boolean> result;
+
+    private ServiceNotifiable notifier;
+
+    private ContextHeaderDocument.ContextHeader contextHeader;
+
+    private String topic;
+
+    /**
+     * used for notification
+     */
+    private List<Object> inputValues = new ArrayList<Object>();
+
+    /**
+     * used for notification
+     */
+    private List<String> inputNames = new ArrayList<String>();
+
+    boolean failerSent;
+
+    private WsdlDefinitions wsdlDefinitionObject;
+
+    /**
+     * Creates an InvokerWithNotification.
+     * 
+     * @param portTypeQName
+     * 
+     * @param wsdlLocation
+     *            The URL of WSDL of the service to invoke
+     * @param nodeID
+     *            The ID of the service
+     * @param notifier
+     *            The notification sender
+     */
+    public GenericInvoker(QName portTypeQName, String wsdlLocation, String nodeID, WorkflowNotifiable notifier) {
+        this(portTypeQName, wsdlLocation, nodeID, null, notifier);
+    }
+
+    /**
+     * Creates an InvokerWithNotification.
+     * 
+     * @param portTypeQName
+     * 
+     * @param wsdlLocation
+     *            The URL of WSDL of the service to invoke
+     * @param nodeID
+     *            The ID of the service
+     * @param gfacURL
+     *            The URL of GFac service.
+     * @param notifier
+     *            The notification sender
+     */
+    public GenericInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String gfacURL,
+            WorkflowNotifiable notifier) {
+        this(portTypeQName, wsdlLocation, nodeID, null, gfacURL, notifier);
+    }
+
+    /**
+     * Creates an InvokerWithNotification.
+     * 
+     * @param portTypeQName
+     * 
+     * @param wsdlLocation
+     *            The URL of WSDL of the service to invoke
+     * @param nodeID
+     *            The ID of the service
+     * @param messageBoxURL
+     * @param gfacURL
+     *            The URL of GFac service.
+     * @param notifier
+     *            The notification sender
+     */
+    public GenericInvoker(QName portTypeQName, String wsdlLocation, String nodeID, String messageBoxURL,
+            String gfacURL, WorkflowNotifiable notifier) {
+        this.nodeID = nodeID;
+        this.portTypeQName = portTypeQName;
+        this.wsdlLocation = wsdlLocation;
+        this.serviceInformation = wsdlLocation;
+        this.messageBoxURL = messageBoxURL;
+        this.gfacURL = gfacURL;
+        this.notifier = notifier.createServiceNotificationSender(nodeID);
+        this.failerSent = false;
+        this.contextHeader = WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID,WorkflowContextHeaderBuilder.getCurrentContextHeader());
+        this.topic = notifier.getTopic();
+    }
+
+    /**
+     *
+     * @param portTypeQName
+     * @param wsdl
+     * @param nodeID
+     * @param messageBoxURL
+     * @param gfacURL
+     * @param notifier
+     */
+    public GenericInvoker(QName portTypeQName, WsdlDefinitions wsdl, String nodeID, String messageBoxURL,
+            String gfacURL, WorkflowNotifiable notifier) {
+        final String wsdlStr = xsul.XmlConstants.BUILDER.serializeToString(wsdl);
+        this.nodeID = nodeID;
+        this.portTypeQName = portTypeQName;
+        this.wsdlDefinitionObject = wsdl;
+        this.messageBoxURL = messageBoxURL;
+        this.serviceInformation = wsdlStr;
+        this.gfacURL = gfacURL;
+        this.notifier = notifier.createServiceNotificationSender(nodeID);
+        this.failerSent = false;
+        this.contextHeader = WorkflowContextHeaderBuilder.removeOtherSchedulingConfig(nodeID,WorkflowContextHeaderBuilder.getCurrentContextHeader());
+        this.topic = notifier.getTopic();
+    }
+
+    /**
+     *
+     * @throws WorkflowException
+     */
+    public void setup() throws WorkflowException {
+        try {
+            WsdlDefinitions definitions = null;
+            if (this.wsdlLocation != null && !this.wsdlLocation.equals("")) {
+                WsdlResolver resolver = WsdlResolver.getInstance();
+                definitions = resolver.loadWsdl(new File(".").toURI(), new URI(this.wsdlLocation));
+            } else {
+                definitions = this.wsdlDefinitionObject;
+            }
+
+            setup(definitions);
+
+        } catch (WorkflowException e) {
+            logger.error(e.getMessage(), e);
+            // An appropriate message has been set in the exception.
+            this.notifier.invocationFailed(e.getMessage(), e);
+            throw e;
+        } catch (URISyntaxException e) {
+            logger.error(e.getMessage(), e);
+            String message = "The location of the WSDL has to be a valid URL or file path: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (WsdlException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error in processing the WSDL: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error in processing the WSDL: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    private void setup(WsdlDefinitions definitions) throws WorkflowException {
+
+        // Set LEAD context header.
+        WorkflowContextHeaderBuilder builder;
+        if(contextHeader == null){
+            builder = new WorkflowContextHeaderBuilder(this.notifier.getEventSink()
+                .getAddress(), this.gfacURL, null, this.topic,
+                "xbaya-experiment", this.messageBoxURL);
+        }else{
+             builder = new WorkflowContextHeaderBuilder(contextHeader);
+        }
+        if(builder.getWorkflowMonitoringContext() == null){
+            builder.addWorkflowMonitoringContext(this.notifier.getEventSink().getAddress(),
+                    this.topic,this.nodeID,this.messageBoxURL);
+        } else {
+            builder.getWorkflowMonitoringContext().setWorkflowInstanceId(this.notifier.getWorkflowID().toASCIIString());
+        }
+        builder.getWorkflowMonitoringContext().setWorkflowNodeId(this.nodeID);
+        builder.getWorkflowMonitoringContext().setServiceInstanceId(this.nodeID);
+        builder.getWorkflowMonitoringContext().setWorkflowTimeStep(1);
+        builder.setUserIdentifier("xbaya-user");
+        //todo write a UI component to collect this information and pass it through Header
+//        builder.setGridMyProxyRepository("myproxy.nersc.gov","$user","$passwd",14000);
+        StickySoapHeaderHandler handler = new StickySoapHeaderHandler("use-workflowcontext-header", builder.getXml());
+        // Create Invoker
+        this.invoker = InvokerFactory.createInvoker(this.portTypeQName, definitions, this.gfacURL, this.messageBoxURL,
+                builder, true);
+        this.invoker.setup();
+
+        WSIFClient client = this.invoker.getClient();
+        client.addHandler(handler);
+
+        WsdlResolver resolver = WsdlResolver.getInstance();
+        // Get the concrete WSDL from invoker.setup() and set it to the
+        // notifier.
+
+        this.notifier.setServiceID(this.nodeID);
+        // if (this.wsdlLocation != null) {
+        // this.notifier.setServiceID(this.nodeID);
+        // } else {
+        // String name = this.portTypeQName.getLocalPart();
+        // this.notifier.setServiceID(name);
+        // }
+    }
+
+    /**
+     *
+     * @param operationName
+     *            The name of the operation
+     * @throws WorkflowException
+     */
+    public void setOperation(String operationName) throws WorkflowException {
+        try {
+            this.invoker.setOperation(operationName);
+        } catch (WorkflowException e) {
+            logger.error(e.getMessage(), e);
+            // An appropriate message has been set in the exception.
+            this.notifier.invocationFailed(e.getMessage(), e);
+            throw e;
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "The WSDL does not conform to the invoking service: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     *
+     * @param name
+     *            The name of the input parameter
+     * @param value
+     *            The value of the input parameter
+     * @throws WorkflowException
+     */
+    public void setInput(String name, Object value) throws WorkflowException {
+        try {
+            if (value instanceof XmlElement) {
+                logger.debug("value: " + XMLUtil.xmlElementToString((XmlElement) value));
+            }
+            this.inputNames.add(name);
+            this.inputValues.add(value);
+            this.invoker.setInput(name, value);
+        } catch (WorkflowException e) {
+            logger.error(e.getMessage(), e);
+            // An appropriate message has been set in the exception.
+            this.notifier.invocationFailed(e.getMessage(), e);
+            throw e;
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error in setting an input. name: " + name + " value: " + value;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     *
+     * @return
+     * @throws WorkflowException
+     */
+    public synchronized boolean invoke() throws WorkflowException {
+        try {
+            WSIFMessage inputMessage = this.invoker.getInputs();
+            logger.debug("inputMessage: " + XMLUtil.xmlElementToString((XmlElement) inputMessage));
+            this.notifier.invokingService(inputMessage);
+
+            ExecutorService executor = Executors.newSingleThreadExecutor();
+            this.result = executor.submit(new Callable<Boolean>() {
+                @SuppressWarnings("boxing")
+                public Boolean call() {
+                    try {
+                        boolean success = GenericInvoker.this.invoker.invoke();
+                        if (success) {
+                            // Send notification
+                            WSIFMessage outputMessage = GenericInvoker.this.invoker.getOutputs();
+                            // An implementation of WSIFMessage,
+                            // WSIFMessageElement, implements toString(), which
+                            // serialize the message XML.
+                            logger.debug("outputMessage: " + outputMessage);
+                            GenericInvoker.this.notifier.serviceFinished(outputMessage);
+                        } else {
+                            //if error occurse gfac-axis2 write the error in to output not to the fault
+                            WSIFMessage faultMessage = GenericInvoker.this.invoker.getOutputs();
+                            // An implementation of WSIFMessage,
+                            // WSIFMessageElement, implements toString(), which
+                            // serialize the message XML.
+                            logger.debug("received fault: " + faultMessage);
+                            GenericInvoker.this.notifier.receivedFault(faultMessage);
+                            GenericInvoker.this.failerSent = true;
+                        }
+                        return success;
+                    } catch (WorkflowException e) {
+                        logger.error(e.getMessage(), e);
+                        // An appropriate message has been set in the exception.
+                        GenericInvoker.this.notifier.invocationFailed(e.getMessage(), e);
+                        GenericInvoker.this.failerSent = true;
+                        throw new WorkflowRuntimeException(e);
+                    } catch (RuntimeException e) {
+                        logger.error(e.getMessage(), e);
+                        String message = "Error in invoking a service: " + GenericInvoker.this.serviceInformation;
+                        GenericInvoker.this.notifier.invocationFailed(message, e);
+                        GenericInvoker.this.failerSent = true;
+                        throw e;
+                    }
+                }
+            });
+
+            // Kill the thread inside of executor. This is necessary for Jython
+            // script to finish.
+            executor.shutdown();
+
+            // Let other threads know that job has been submitted.
+            notifyAll();
+
+            // Check if the invocation itself fails. This happens immediately.
+            try {
+                this.result.get(100, TimeUnit.MILLISECONDS);
+            } catch (InterruptedException e) {
+                logger.error(e.getMessage(), e);
+            } catch (TimeoutException e) {
+                // The job is probably running fine.
+                // The normal case.
+                return true;
+            } catch (ExecutionException e) {
+                // The service-failed notification should have been sent
+                // already.
+                logger.error(e.getMessage(), e);
+                String message = "Error in invoking a service: " + this.serviceInformation;
+                throw new WorkflowException(message, e);
+            }
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error in invoking a service: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+        return true;
+    }
+
+    /**
+     *
+     * @throws WorkflowException
+     */
+    @SuppressWarnings("boxing")
+    public synchronized void waitToFinish() throws WorkflowException {
+        try {
+            while (this.result == null) {
+                // The job is not submitted yet.
+                try {
+                    wait();
+                } catch (InterruptedException e) {
+                    logger.error(e.getMessage(), e);
+                }
+            }
+            // Wait for the job to finish.
+            Boolean success = this.result.get();
+            if (success == false) {
+                WSIFMessage faultMessage = this.invoker.getFault();
+                String message = "Error in a service: ";
+                // An implementation of WSIFMessage,
+                // WSIFMessageElement, implements toString(), which
+                // serialize the message XML.
+                message += faultMessage.toString();
+                throw new WorkflowException(message);
+            }
+        } catch (InterruptedException e) {
+            logger.error(e.getMessage(), e);
+        } catch (ExecutionException e) {
+            // The service-failed notification should have been sent already.
+            logger.error(e.getMessage(), e);
+            String message = "Error in invoking a service: " + this.serviceInformation;
+            throw new WorkflowException(message, e);
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error while waiting for a service to finish: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     *
+     * @param name
+     *            The name of the output parameter
+     * @return
+     * @throws WorkflowException
+     */
+    public Object getOutput(String name) throws WorkflowException {
+        try {
+            waitToFinish();
+            Object output = this.invoker.getOutput(name);
+            if (output instanceof XmlElement) {
+                logger.debug("output: " + XMLUtil.xmlElementToString((XmlElement) output));
+            }
+            return output;
+        } catch (WorkflowException e) {
+            logger.error(e.getMessage(), e);
+            // An appropriate message has been set in the exception.
+            if (!this.failerSent) {
+                this.notifier.invocationFailed(e.getMessage(), e);
+            }
+            throw e;
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            String message = "Error while waiting for a output: " + name;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            String message = "Unexpected error: " + this.serviceInformation;
+            this.notifier.invocationFailed(message, e);
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     *
+     * @return
+     * @throws WorkflowException
+     */
+    public WSIFMessage getOutputs() throws WorkflowException {
+        return this.invoker.getOutputs();
+    }
+
+    @Override
+    public WSIFClient getClient() {
+        return null;
+    }
+
+    @Override
+    public WSIFMessage getInputs() throws WorkflowException {
+        return null;
+    }
+
+    @Override
+    public WSIFMessage getFault() throws WorkflowException {
+        return null;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/Invoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/Invoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/Invoker.java
new file mode 100644
index 0000000..4580587
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/Invoker.java
@@ -0,0 +1,105 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.invoker;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+
+import xsul.wsif.WSIFMessage;
+import xsul.xwsif_runtime.WSIFClient;
+
+public interface Invoker {
+
+    /**
+     * Sets up the service.
+     * 
+     * @throws WorkflowException
+     */
+    public void setup() throws WorkflowException;
+
+    /**
+     * @return The WSIFClient.
+     */
+    public WSIFClient getClient();
+
+    /**
+     * Sets the operation name to invoke.
+     * 
+     * @param operationName
+     *            The name of the operation
+     * @throws WorkflowException
+     */
+    public void setOperation(String operationName) throws WorkflowException;
+
+    /**
+     * Sets an input parameter
+     * 
+     * @param name
+     *            The name of the input parameter
+     * @param value
+     *            The value of the input parameter
+     * @throws WorkflowException
+     */
+    public void setInput(String name, Object value) throws WorkflowException;
+
+    /**
+     * Returns the all input parameters
+     * 
+     * @return The input parameters
+     * @throws WorkflowException
+     */
+    public WSIFMessage getInputs() throws WorkflowException;
+
+    /**
+     * Invokes the service.
+     * 
+     * @return true if the invocation succeeds; fase otherwise
+     * @throws WorkflowException
+     */
+    public boolean invoke() throws WorkflowException;
+
+    /**
+     * Returns the all output parameters
+     * 
+     * @return The output parameters
+     * @throws WorkflowException
+     */
+    public WSIFMessage getOutputs() throws WorkflowException;
+
+    /**
+     * Returns the output of a specified name.
+     * 
+     * @param name
+     *            The name of the output parameter
+     * @return The value of the output
+     * @throws WorkflowException
+     */
+    public Object getOutput(String name) throws WorkflowException;
+
+    /**
+     * Returns the fault message.
+     * 
+     * @return The fault message
+     * @throws WorkflowException
+     */
+    public WSIFMessage getFault() throws WorkflowException;
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/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
new file mode 100644
index 0000000..5fee29f
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/MsgBoxWsaResponsesCorrelator.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+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;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlDocument;
+import org.xmlpull.v1.builder.XmlElement;
+import org.xmlpull.v1.builder.XmlInfosetBuilder;
+import xsul.MLogger;
+import xsul.XmlConstants;
+import xsul.XsulException;
+import xsul.processor.DynamicInfosetProcessorException;
+import xsul.ws_addressing.WsaEndpointReference;
+import xsul.ws_addressing.WsaMessageInformationHeaders;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.impl.WSIFMessageElement;
+import xsul.xwsif_runtime_async.WSIFAsyncResponseListener;
+import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
+import xsul.xwsif_runtime_async.WSIFAsyncWsaResponsesCorrelatorBase;
+
+import javax.xml.stream.XMLStreamException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+public class MsgBoxWsaResponsesCorrelator extends WSIFAsyncWsaResponsesCorrelatorBase
+    implements WSIFAsyncResponsesCorrelator, Runnable
+{
+    private static final Logger logger = LoggerFactory.getLogger(MsgBoxWsaResponsesCorrelator.class);
+    private final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
+
+    private String msgBoxServiceLoc;
+    private MsgBoxClient msgBoxClient;
+    EndpointReference msgBoxAddr;
+    private Thread messageBoxDonwloader;
+
+    private AsynchronousInvoker invoker;
+
+    public MsgBoxWsaResponsesCorrelator(String msgBoxServiceLoc,AsynchronousInvoker output)
+        throws DynamicInfosetProcessorException
+    {
+        this.invoker = output;
+        this.msgBoxServiceLoc = msgBoxServiceLoc;
+        msgBoxClient = new MsgBoxClient();
+        try {
+            msgBoxAddr = msgBoxClient.createMessageBox(msgBoxServiceLoc,5000L);
+            try {
+                setReplyTo(new WsaEndpointReference(new URI(msgBoxAddr.getAddress())));
+            } catch (URISyntaxException e) {
+            	logger.error(e.getLocalizedMessage(),e);  //To change body of catch statement use File | Settings | File Templates.
+            }
+            messageBoxDonwloader = new Thread(this, Thread.currentThread().getName()+"-async-msgbox-correlator");
+            messageBoxDonwloader.setDaemon(true);
+            messageBoxDonwloader.start();
+        } catch (RemoteException e) {
+        	logger.error(e.getLocalizedMessage(),e);  //To change body of catch statement use File | Settings | File Templates.
+        }
+    }
+
+//    public void setMsgBoxAddr(WsaEndpointReference msgBoxAddr) {
+//      this.msgBoxAddr = msgBoxAddr;
+//    }
+
+
+
+    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;
+            }
+        }
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java
new file mode 100644
index 0000000..54cb7f4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/SimpleInvoker.java
@@ -0,0 +1,260 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.invoker;
+
+import java.util.Iterator;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.wsdl.WsdlDefinitions;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.wsif.WSIFService;
+import xsul.wsif.WSIFServiceFactory;
+import xsul.wsif.spi.WSIFProviderManager;
+import xsul.xwsif_runtime.WSIFClient;
+import xsul.xwsif_runtime.WSIFRuntime;
+
+public class SimpleInvoker implements Invoker {
+
+    private static final Logger log = LoggerFactory.getLogger(GenericInvoker.class);
+
+    protected WSIFClient client;
+
+    private WsdlDefinitions definitions;
+
+    private WSIFOperation operation;
+
+    private WSIFMessage inputMessage;
+
+    private volatile WSIFMessage outputMessage;
+
+    private WSIFMessage faultMessage;
+
+    private boolean lock = false;
+
+    static {
+        WSIFProviderManager.getInstance().addProvider(new xsul.wsif_xsul_soap_http.Provider());
+    }
+
+    /**
+     * Constructs a SimpleInvoker.
+     *
+     * @param definitions
+     */
+    public SimpleInvoker(WsdlDefinitions definitions) {
+        this.definitions = definitions;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#setup()
+     */
+    public void setup() throws WorkflowException {
+        try {
+            WSIFService service = WSIFServiceFactory.newInstance().getService(this.definitions);
+            WSIFPort port = service.getPort();
+            this.client = WSIFRuntime.getDefault().newClientFor(port);
+            this.client.setAsyncResponseTimeoutInMs(999999999);
+        } catch (RuntimeException e) {
+            String message = "The WSDL is in the wrong format";
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getClient()
+     */
+    public WSIFClient getClient() {
+        return this.client;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#setOperation(java.lang.String)
+     */
+    public void setOperation(String operationName) throws WorkflowException {
+        try {
+            WSIFPort port = this.client.getPort();
+            this.operation = port.createOperation(operationName);
+            this.inputMessage = this.operation.createInputMessage();
+            this.outputMessage = this.operation.createOutputMessage();
+            this.faultMessage = this.operation.createFaultMessage();
+        } catch (RuntimeException e) {
+            String message = "The WSDL does not conform to the invoking service.";
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
+     */
+    public void setInput(String name, Object value) throws WorkflowException {
+        try {
+            if (value instanceof XmlElement) {
+                // If the value is a complex type, change the name of the
+                // element to the correct one.
+                XmlElement valueElement = (XmlElement) value;
+                valueElement.setName(name);
+            } else if (value instanceof String) {
+                    if(XMLUtil.isXML((String)value)){
+                     XmlElement valueElement = XMLUtil.stringToXmlElement3((String) value);
+                     valueElement.setName(name);
+                        value = valueElement;
+                }
+                // Simple case.
+            } else {
+                // convert int, doule to string.
+                value = "" + value;
+            }
+            this.inputMessage.setObjectPart(name, value);
+        } catch (RuntimeException e) {
+            String message = "Error in setting an input. name: " + name + " value: " + value;
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getInputs()
+     */
+    public WSIFMessage getInputs() {
+        return this.inputMessage;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#invoke()
+     */
+    public boolean invoke() throws WorkflowException {
+        try {
+            boolean success = this.operation.executeRequestResponseOperation(this.inputMessage, this.outputMessage,
+                    this.faultMessage);
+            while(this.outputMessage == null){
+
+            }
+            return success;
+        } catch (RuntimeException e) {
+            String message = "Error in invoking a service.";
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutputs()
+     */
+    public WSIFMessage getOutputs() {
+         if (lock) {
+            try {
+                wait();
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+        return this.outputMessage;
+    }
+
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutput(java.lang.String)
+     */
+    public Object getOutput(String name) throws WorkflowException {
+        try {
+            // This code doesn't work when the output is a complex type.
+            // Object output = this.outputMessage.getObjectPart(name);
+            // return output;
+
+            XmlElement outputElement = (XmlElement) this.outputMessage;
+            XmlElement valueElement = outputElement.element(null, name);
+            Iterator childIt = valueElement.children();
+            int numberOfChildren = 0;
+            while (childIt.hasNext()) {
+                childIt.next();
+                numberOfChildren++;
+            }
+            if (numberOfChildren == 1) {
+                Object child = valueElement.children().next();
+                if (child instanceof String) {
+                    // Value is a simple type. Return the string.
+                    String value = (String) child;
+                    return value;
+                }
+                if (child instanceof XmlElement) {
+                	log.debug("output: " + XMLUtil.xmlElementToString((XmlElement) child));
+                	Object child1 = ((XmlElement) child).children().next();
+                	if (child1 instanceof String) {
+                        // Value is a simple type. Return the string.
+                        String value = (String) child1;
+                        return value;
+                    }
+                }
+            }
+            // Value is a complex type. Return the whole XmlElement so that we
+            // can set it to the next service as it is.
+            return valueElement;
+        } catch (RuntimeException e) {
+            String message = "Error in getting output. name: " + name;
+            throw new WorkflowException(message, e);
+        }
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getFault()
+     */
+    public WSIFMessage getFault() {
+        return this.faultMessage;
+    }
+
+    public WsdlDefinitions getDefinitions() {
+        return definitions;
+    }
+
+    public WSIFOperation getOperation() {
+        return operation;
+    }
+
+    public WSIFMessage getInputMessage() {
+        return inputMessage;
+    }
+
+    public synchronized WSIFMessage getOutputMessage() {
+        return outputMessage;
+    }
+
+    public WSIFMessage getFaultMessage() {
+        return faultMessage;
+    }
+
+    public synchronized void setOutputMessage(WSIFMessage outputMessage) {
+        log.debug("Setting output message");
+        this.outputMessage = outputMessage;
+    }
+
+    public void setLock(boolean lock) {
+        this.lock = lock;
+    }
+
+    public boolean isLock() {
+        return lock;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInputUtil.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInputUtil.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInputUtil.java
new file mode 100644
index 0000000..2d892f0
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/invoker/WorkflowInputUtil.java
@@ -0,0 +1,84 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.invoker;
+
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.ws.WSComponentPort;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.lead.LEADTypes;
+
+import javax.xml.namespace.QName;
+
+public class WorkflowInputUtil {
+
+    public static String createInputForGFacService(WSComponentPort port,String input){
+        String paramType = port.getType().getLocalPart();
+        StringBuffer inputString = new StringBuffer("<");
+        if("StringParameterType".equals(paramType) || "URIParameterType".equals(paramType) ||
+                "DoubleParameterType".equals(paramType) || "IntegerParameterType".equals(paramType)
+                || "FloatParameterType".equals(paramType)|| "BooleanParameterType".equals(paramType)
+                || "FileParameterType".equals(paramType)){
+            inputString.append(port.getName()).append(">").
+                    append(getValueElement(input)).append("</").append(port.getName()).append(">");
+        }else if(paramType.endsWith("ArrayType")){
+            inputString.append(port.getName()).append(">");
+            String[] valueList = StringUtil.getElementsFromString(input);
+            for(String inputValue:valueList){
+                inputString.append(getValueElement(inputValue));
+            }
+            inputString.append(getValueElement(port.getName()));
+        }
+        inputString.append(">");
+        return inputString.toString();
+    }
+
+    private static String getValueElement(String value){
+       return "<value>" + value + "</value>";
+    }
+    public static Object parseValue(WSComponentPort input, String valueString) {
+        String name = input.getName();
+        if (false) {
+            // Some user wants to pass empty strings, so this check is disabled.
+            if (valueString.length() == 0) {
+                throw new WorkflowRuntimeException("Input parameter, " + name + ", cannot be empty");
+            }
+        }
+        QName type = input.getType();
+        Object value;
+        if (LEADTypes.isKnownType(type)) {
+            // TODO check the type.
+            value = valueString;
+        } else {
+            try {
+                if(XBayaConstants.HTTP_SCHEMAS_AIRAVATA_APACHE_ORG_GFAC_TYPE.equals(input.getType().getNamespaceURI())){
+                    value = XMLUtil.stringToXmlElement3(WorkflowInputUtil.createInputForGFacService(input, valueString));
+                }else {
+                    throw new WorkflowRuntimeException("Input parameter, " + name + ", Unkown Type");
+                }
+            } catch (RuntimeException e) {
+                throw new WorkflowRuntimeException("Input parameter, " + name + ", is not valid XML", e);
+            }
+        }
+        return value;
+    }
+}


[20/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumers.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumers.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumers.java
deleted file mode 100644
index 61a4bf7..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumers.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-import java.io.*;
-
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class MultipleProducersConsumers {
-
-	private static Properties getDefaults() {
-
-		Properties defaults = new Properties();
-		defaults.setProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR,
-				"http://localhost:8080/axis2/services/EventingService");
-		defaults.setProperty(ConfigKeys.TOPIC_XPATH, "/msg/src");
-		defaults.setProperty(ConfigKeys.CONSUMER_PORT_OFFSET, "2222");
-
-		defaults.setProperty(ConfigKeys.PUBLISH_TIME_INTERVAL, "5");
-		defaults.setProperty(ConfigKeys.PRODUCER_COUNT, "2");
-		defaults.setProperty(ConfigKeys.CONSUMER_COUNT, "3");
-
-		return defaults;
-	}
-
-	public static void main(String[] args) throws InterruptedException {
-
-		Properties configurations = new Properties(getDefaults());
-		try {
-            InputStream ioStream = new FileInputStream(ConfigKeys.CONFIG_FILE_NAME);
-            configurations.load(ioStream);
-        } catch (IOException ioe) {
-
-			System.out
-					.println("unable to load configuration file, default settings will be used");
-		}
-
-		int numberOfProducers = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.PRODUCER_COUNT));
-
-		int numberOfConsumers = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.CONSUMER_COUNT));
-
-		Consumer[] consumers = new Consumer[numberOfConsumers];
-		int portOffset = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.CONSUMER_PORT_OFFSET));
-		for (int i = 0; i < consumers.length; i++) {
-			consumers[i] = new Consumer("consumer_" + i, portOffset + i,
-					configurations);
-			consumers[i].start();
-		}
-
-		Producer[] producers = new Producer[numberOfProducers];
-		for (int i = 0; i < producers.length; i++) {
-			producers[i] = new Producer("producer_" + i, configurations);
-			producers[i].start();
-		}
-
-		for (Consumer c : consumers) {
-			c.join();
-		}
-
-		for (Producer p : producers) {
-			p.join();
-		}
-
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/Producer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/Producer.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/Producer.java
deleted file mode 100644
index 0a68a82..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers-xpath/src/org/apache/airavata/wsmg/samples/wse/Producer.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.io.StringReader;
-import java.util.Properties;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class Producer extends Thread {
-
-	private Properties configurations;
-
-	private XMLInputFactory xmlFactory = XMLInputFactory.newInstance();
-
-	public Producer(String producerId, Properties config) {
-		super(producerId);
-		configurations = config;
-	}
-
-	private OMElement buildMsg(String msg) {
-
-		XMLStreamReader inflow = null;
-		try {
-			inflow = xmlFactory.createXMLStreamReader(new StringReader(msg));
-		} catch (XMLStreamException e) {
-			throw new RuntimeException(e);
-		}
-
-		StAXOMBuilder builder = new StAXOMBuilder(inflow);
-		OMElement omElement = builder.getDocumentElement();
-		return omElement;
-	}
-
-	public void run() {
-
-		System.out.println(String
-				.format("producer [%s] starting...", getName()));
-
-		String brokerLocation = configurations
-				.getProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR);
-		String topicExpression = configurations
-				.getProperty(ConfigKeys.TOPIC_SIMPLE);
-
-		int timeInterval = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.PUBLISH_TIME_INTERVAL));
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-
-		String msgFormat = "<msg><seq>%d</seq><src>%s</src><uuid>%s</uuid></msg>";
-
-		try {
-
-			int count = 0;
-			while (true) {
-				UUID uuid = UUID.randomUUID();
-				count++;
-				String msg = String.format(msgFormat, count, getName(), uuid
-						.toString());
-				System.out.println(String.format(
-						"producer [%s] sending msg: %s", getName(), msg));
-				client.publish(topicExpression, buildMsg(msg));
-				TimeUnit.SECONDS.sleep(timeInterval);
-			}
-
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-			System.out.println("interruped");
-		} catch (MsgBrokerClientException f) {
-			f.printStackTrace();
-			System.out
-					.println("unable to publish messages - producer will stop.");
-
-		}
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/README.txt
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/README.txt b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/README.txt
deleted file mode 100644
index 8c166bb..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/README.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-OGCE-WS messenger Quick Start Guide- Sample 1 
-=================================
-
-This sample demonstrates a scenarios where multiple producers publish messages under a topic, while multiple consumers receive them.
-
-
-Pre-Requisites
-==============
-
-Apache Ant 1.7.1 or later
-Apache Axis2 1.5 or later
-
-
-
-Steps:
-======
-
-1) configure and run ws-messenger in any mode. please refer ws-messenger user guide to know how to run the ws-messenger.
-
-2) configure 'build.properties' located in the sample directory.
-
-3) set configurations in './conf/configuration.properties' file.
-
-4) run following command:
-      ant run

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/build.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/build.properties b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/build.properties
deleted file mode 100644
index 66397b8..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-axis2.home=../../../standalone-server/

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/build.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/build.xml b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/build.xml
deleted file mode 100644
index 7b7a347..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/build.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-
-
-<project name="wse-multi-sample" default="run" basedir=".">
-
-	<property file="build.properties" />
-	<property name="lib.path" value="../../../lib" />
-	<property name="dest.dir" value="bin" />
-	<property name="src.dir" value="src" />
-	<property name="conf.dir" location="conf" />
-
-	<path id="broker.libs.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-	</path>
-
-
-	<path id="broker.class.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-		
-		<path location="${conf.dir}" />
-		
-		<pathelement location="${dest.dir}" />
-	</path>
-
-	<target name="clean">
-		<delete dir="${dest.dir}" />
-	</target>
-
-	<target name="build" depends="makeDest">
-		<antcall target="compile" />
-	</target>
-
-	<target name="makeDest">
-		<mkdir dir="${dest.dir}" />
-	</target>
-
-
-	<target name="compile" depends="makeDest">
-		<javac debug="true" srcdir="${src.dir}" destdir="${dest.dir}">
-			<classpath refid="broker.libs.path" />
-		</javac>
-	</target>
-
-
-	<target name="run" depends="build">
-
-		<java classname="org.apache.airavata.wsmg.samples.wse.MultipleProducersConsumers" fork="true">
-			<classpath refid="broker.class.path" />
-		</java>
-
-	</target>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/conf/configurations.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/conf/configurations.properties b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/conf/configurations.properties
deleted file mode 100644
index cd2821b..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/conf/configurations.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-broker.eventing.service.epr=http://localhost:8080/axis2/services/EventingService
-broker.notification.service.epr=http://localhost:8080/axis2/services/NotificationService
-consumer.port=6060
-topic.xpath=/msg/src
-publish.time.interval=5
-producer.count=2
-consumer.count=3

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
deleted file mode 100644
index 4ed6566..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.util;
-
-public interface ConfigKeys {
-
-	String CONFIG_FILE_NAME = "configurations.properties";
-
-	String BROKER_EVENTING_SERVICE_EPR = "broker.eventing.service.epr";
-	String BROKER_NOTIFICATIONS_SERVICE_EPR = "broker.notification.service.epr";
-
-	String CONSUMER_EPR = "consumer.location";
-	String CONSUMER_PORT_OFFSET = "consumer.port";
-	String TOPIC_SIMPLE = "topic.simple";
-	String TOPIC_XPATH = "topic.xpath";
-	String AXIS2_REPO = "axis2.repo";
-	String PUBLISH_TIME_INTERVAL = "publish.time.interval";
-	String PRODUCER_COUNT = "producer.count";
-	String CONSUMER_COUNT = "consumer.count";
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/Consumer.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
deleted file mode 100644
index c253993..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.util.Properties;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class Consumer extends Thread {
-
-	class NotificationMsgReciever implements ConsumerNotificationHandler {
-
-		private BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
-
-		public void handleNotification(SOAPEnvelope msgEnvelope) {
-
-			queue.add(msgEnvelope);
-		}
-
-		public BlockingQueue<SOAPEnvelope> getQueue() {
-			return queue;
-		}
-
-	}
-
-	private Properties configurations;
-	private int consumerPort;
-
-	public Consumer(String consumerName, int port, Properties config) {
-		super(consumerName);
-		consumerPort = port;
-		configurations = config;
-	}
-
-	public void run() {
-
-		String brokerLocation = configurations
-				.getProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR);
-		String xpathExpression = configurations
-				.getProperty(ConfigKeys.TOPIC_XPATH);
-
-		System.out.println("subscribing with xpath expression: "
-				+ xpathExpression);
-
-		NotificationMsgReciever msgReciever = new NotificationMsgReciever();
-
-		String[] consumerEprs = null;
-
-		String subscriptionId = null;
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-		try {
-			consumerEprs = client.startConsumerService(consumerPort,
-					msgReciever);
-
-		} catch (MsgBrokerClientException e) {
-
-			e.printStackTrace();
-
-			System.out.println("unable to start consumer service, exiting");
-			return;
-		}
-
-		try {
-
-			subscriptionId = client.subscribe(consumerEprs[0], null,
-					xpathExpression);
-			System.out.println(getName() + "got the subscription id :"
-					+ subscriptionId);
-
-		} catch (MsgBrokerClientException e) {
-
-			e.printStackTrace();
-
-			System.out
-					.println("unable to subscribe for the xpath consumer exiting");
-			return;
-		}
-
-		try {
-
-			do {
-
-				SOAPEnvelope env = msgReciever.getQueue().take();
-
-				String msg;
-				try {
-					msg = env.getBody().getFirstElement().toStringWithConsume();
-					System.out.println(String.format(
-							"consumer [%s] recieved: %s", getName(), msg));
-
-				} catch (Exception e) {
-					System.err.print("invalid msg recieved");
-				}
-
-			} while (true);
-
-		} catch (InterruptedException ie) {
-
-			try {
-				// unsubscribe from the topic.
-				client.unSubscribe(subscriptionId);
-				
-			} catch (MsgBrokerClientException e) {
-
-				e.printStackTrace();
-				System.out.println("unable to unsubscribe, ignoring");
-			}
-
-			// shutdown the consumer service.
-			client.shutdownConsumerService();
-
-			System.out.println("interrupted");
-
-		}
-
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumers.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumers.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumers.java
deleted file mode 100644
index 9181cad..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/MultipleProducersConsumers.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.Properties;
-
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class MultipleProducersConsumers {
-
-	private static Properties getDefaults() {
-
-		Properties defaults = new Properties();
-		defaults.setProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR,
-				"http://localhost:8080/axis2/services/EventingService");
-		defaults.setProperty(ConfigKeys.TOPIC_XPATH, "/msg/src");
-		defaults.setProperty(ConfigKeys.CONSUMER_PORT_OFFSET, "2222");
-
-		defaults.setProperty(ConfigKeys.PUBLISH_TIME_INTERVAL, "5");
-		defaults.setProperty(ConfigKeys.PRODUCER_COUNT, "2");
-		defaults.setProperty(ConfigKeys.CONSUMER_COUNT, "3");
-
-		return defaults;
-	}
-
-	public static void main(String[] args) throws IOException,
-			InterruptedException {
-
-		Properties configurations = new Properties(getDefaults());
-		try {
-
-			InputStream ioStream = new FileInputStream(ConfigKeys.CONFIG_FILE_NAME);
-			configurations.load(ioStream);
-		} catch (IOException ioe) {
-			
-			System.out.println("unable to load configuration file, default settings will be used");
-		}
-
-		int numberOfProducers = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.PRODUCER_COUNT));
-
-		int numberOfConsumers = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.CONSUMER_COUNT));
-
-		Consumer[] consumers = new Consumer[numberOfConsumers];
-		int portOffset = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.CONSUMER_PORT_OFFSET));
-		for (int i = 0; i < consumers.length; i++) {
-			consumers[i] = new Consumer("consumer_" + i, portOffset + i,
-					configurations);
-			consumers[i].start();
-		}
-
-		Producer[] producers = new Producer[numberOfProducers];
-		for (int i = 0; i < producers.length; i++) {
-			producers[i] = new Producer("producer_" + i, configurations);
-			producers[i].start();
-		}
-
-		for (Consumer c : consumers) {
-			c.join();
-		}
-
-		for (Producer p : producers) {
-			p.join();
-		}
-
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/Producer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/Producer.java b/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/Producer.java
deleted file mode 100644
index 30b2577..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-multiple-producers-consumers/src/org/apache/airavata/wsmg/samples/wse/Producer.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.util.Properties;
-import java.util.UUID;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class Producer extends Thread {
-
-	private Properties configurations;
-
-	public Producer(String producerId, Properties config) {
-		super(producerId);
-		configurations = config;
-	}
-
-	private OMElement createMsg(int seq, String src, String uuid) {
-
-		// "<msg><seq>%d</seq><src>%s</src><uuid>%s</uuid></msg>"
-
-		OMFactory factory = OMAbstractFactory.getOMFactory();
-
-		OMElement omMsg = factory.createOMElement("msg", null);
-
-		OMElement omSeq = factory.createOMElement("seq", null, omMsg);
-		omSeq.setText("" + seq);
-
-		OMElement omSrc = factory.createOMElement("src", null, omMsg);
-		omSrc.setText(src);
-
-		OMElement omUUID = factory.createOMElement("uuid", null, omMsg);
-		omUUID.setText(uuid);
-
-		return omMsg;
-	}
-
-	public void run() {
-
-		System.out.println(String
-				.format("producer [%s] starting...", getName()));
-
-		String brokerLocation = configurations
-				.getProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR);
-		String topicExpression = configurations
-				.getProperty(ConfigKeys.TOPIC_SIMPLE);
-
-		int timeInterval = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.PUBLISH_TIME_INTERVAL));
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-
-		try {
-
-			int count = 0;
-			while (true) {
-				UUID uuid = UUID.randomUUID();
-				count++;
-				OMElement omMsg = createMsg(count, getName(), uuid.toString());
-				System.out.println(String.format(
-						"producer [%s] sending msg: %s", getName(), omMsg
-								.toString()));
-
-				client.publish(topicExpression, omMsg);
-
-				TimeUnit.SECONDS.sleep(timeInterval);
-			}
-
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-			System.out.println("interruped");
-		} catch (MsgBrokerClientException f) {
-			f.printStackTrace();
-			System.out
-					.println("unable to publish messages - producer will stop.");
-
-		}
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-round-trip/README.txt
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-round-trip/README.txt b/modules/ws-messenger/samples/messagebroker/wse-round-trip/README.txt
deleted file mode 100644
index 4226c4b..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-round-trip/README.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-OGCE-WS messenger Quick Start Guide- Sample 1 
-=================================
-
-This sample demonstrate how publish messages under a given topic and how to receive them.
-
-
-Pre-Requisites
-==============
-
-Apache Ant 1.7.1 or later
-Apache Axis2 1.5 or later
-
-
-
-Steps:
-======
-
-1) configure and run ws-messenger in any mode. please refer ws-messenger user guide to know how to run the ws-messenger.
-
-2) configure 'build.properties' located in the sample directory.
-
-3) set configurations in './conf/configuration.properties' file.
-
-4) run following command:
-      ant run
-      

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-round-trip/build.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-round-trip/build.properties b/modules/ws-messenger/samples/messagebroker/wse-round-trip/build.properties
deleted file mode 100644
index 3919fd5..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-round-trip/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-
-axis2.home=../../../standalone-server/

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-round-trip/build.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-round-trip/build.xml b/modules/ws-messenger/samples/messagebroker/wse-round-trip/build.xml
deleted file mode 100644
index 0cce306..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-round-trip/build.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-
-
-<project name="wse-round-trip-sample" default="run" basedir=".">
-
-	<property file="build.properties" />
-	<property name="lib.path" value="../../../lib" />
-	<property name="dest.dir" value="bin" />
-	<property name="src.dir" value="src" />
-	<property name="conf.dir" location="conf" />
-
-	<path id="broker.libs.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-	</path>
-
-
-	<path id="broker.class.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-		<path location="${conf.dir}" />
-		
-		<pathelement location="${dest.dir}" />
-	</path>
-
-	<target name="clean">
-		<delete dir="${dest.dir}" />
-	</target>
-
-	<target name="build" depends="makeDest">
-		<antcall target="compile" />
-	</target>
-
-	<target name="makeDest">
-		<mkdir dir="${dest.dir}" />
-	</target>
-
-
-	<target name="compile" depends="makeDest">
-		<javac debug="true" srcdir="${src.dir}" destdir="${dest.dir}">
-			<classpath refid="broker.libs.path" />
-		</javac>
-	</target>
-
-
-	<target name="run" depends="build">
-
-		<echo message="broker.class.path" />
-
-		<java classname="org.apache.airavata.wsmg.samples.wse.WSERoundTrip" fork="true">
-			<classpath refid="broker.class.path" />
-		</java>
-
-	</target>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-round-trip/conf/configurations.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-round-trip/conf/configurations.properties b/modules/ws-messenger/samples/messagebroker/wse-round-trip/conf/configurations.properties
deleted file mode 100644
index 129d742..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-round-trip/conf/configurations.properties
+++ /dev/null
@@ -1,27 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-broker.eventing.service.epr=http://localhost:8080/axis2/services/EventingService
-broker.notification.service.epr=http://localhost:8080/axis2/services/NotificationService
-consumer.port=6060
-topic.simple=SampleSimpleTopic
-topic.xpath=/c/b/a
-publish.time.interval=5

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java b/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
deleted file mode 100644
index 7bedaad..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.util;
-
-public interface ConfigKeys {
-
-	String CONFIG_FILE_NAME = "configurations.properties";
-	
-	String BROKER_EVENTING_SERVICE_EPR = "broker.eventing.service.epr";
-	String BROKER_NOTIFICATIONS_SERVICE_EPR = "broker.notification.service.epr";
-
-	String CONSUMER_EPR = "consumer.location";
-	String CONSUMER_PORT = "consumer.port";
-	String TOPIC_SIMPLE = "topic.simple";
-	String TOPIC_XPATH = "topic.xpath";
-	String AXIS2_REPO = "axis2.repo";
-	String PUBLISH_TIME_INTERVAL = "publish.time.interval";
-	
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/Consumer.java b/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
deleted file mode 100644
index 12ec0e4..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/Consumer.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.util.Properties;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.apache.axiom.soap.SOAPEnvelope;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class Consumer extends Thread {
-
-	class NotificationMsgReciever implements ConsumerNotificationHandler {
-
-		private BlockingQueue<SOAPEnvelope> queue = new LinkedBlockingQueue<SOAPEnvelope>();
-
-		public void handleNotification(SOAPEnvelope msgEnvelope) {
-
-			queue.add(msgEnvelope);
-		}
-
-		public BlockingQueue<SOAPEnvelope> getQueue() {
-			return queue;
-		}
-
-	}
-
-	private Properties configurations;
-	private int consumerPort;
-
-	public Consumer(String consumerName, int port, Properties config) {
-		super(consumerName);
-		consumerPort = port;
-		configurations = config;
-	}
-
-	public void run() {
-
-		String brokerLocation = configurations
-				.getProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR);
-		String topicExpression = configurations
-				.getProperty(ConfigKeys.TOPIC_SIMPLE);
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-
-		System.out.println("subscribing with topic expression: "
-				+ topicExpression);
-
-		NotificationMsgReciever msgReciever = new NotificationMsgReciever();
-
-		String[] consumerEprs = null;
-
-		String subscriptionId = null;
-
-		try {
-			consumerEprs = client.startConsumerService(consumerPort,
-					msgReciever);
-
-		} catch (MsgBrokerClientException e) {
-
-			e.printStackTrace();
-
-			System.out.println("unable to start consumer service, exiting");
-			return;
-		}
-
-		try {
-
-			subscriptionId = client.subscribe(consumerEprs[0], topicExpression,
-					null);
-		} catch (MsgBrokerClientException e) {
-
-			e.printStackTrace();
-
-			System.out
-					.println("unable to subscribe for the topic consumer exiting");
-			return;
-		}
-
-		try {
-
-			do {
-
-				SOAPEnvelope env = msgReciever.getQueue().take();
-
-				String msg;
-				try {
-					msg = env.getBody().getFirstElement().toStringWithConsume();
-					System.out.println(String.format(
-							"consumer [%s] recieved: %s", getName(), msg));
-
-				} catch (Exception e) {
-					System.err.print("invalid msg recieved");
-				}
-
-			} while (true);
-
-		} catch (InterruptedException ie) {
-
-			try {
-				// unsubscribe from the topic.
-				client.unSubscribe(subscriptionId);
-			} catch (MsgBrokerClientException e) {
-
-				e.printStackTrace();
-				System.out.println("unable to unsubscribe, ignoring");
-			}
-
-			// shutdown the consumer service.
-			client.shutdownConsumerService();
-
-			System.out.println("interrupted");
-
-		}
-
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/Producer.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/Producer.java b/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/Producer.java
deleted file mode 100644
index 5b212d6..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/Producer.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.util.Properties;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class Producer extends Thread {
-
-	private Properties configurations;
-
-	public Producer(String producerId, Properties config) {
-		super(producerId);
-		configurations = config;
-	}
-
-	public void run() {
-
-		System.out.println(String
-				.format("producer [%s] starting...", getName()));
-
-		String brokerLocation = configurations
-				.getProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR);
-		String topicExpression = configurations
-				.getProperty(ConfigKeys.TOPIC_SIMPLE);
-
-		int timeInterval = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.PUBLISH_TIME_INTERVAL));
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-
-		OMElement omMsg = OMAbstractFactory.getOMFactory().createOMElement(
-				"msg", null);
-		int sequence = 1;
-
-		try {
-
-			while (true) {
-
-				omMsg.setText("" + (sequence++));
-
-				System.out.println(String.format(
-						"producer [%s] sending msg: %s", getName(), omMsg
-								.toString()));
-				client.publish(topicExpression, omMsg);
-				TimeUnit.SECONDS.sleep(timeInterval);
-			}
-
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-			System.out.println("interruped");
-		} catch (MsgBrokerClientException f) {
-			f.printStackTrace();
-			System.out
-					.println("unable to publish messages - producer will stop.");
-
-		}
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/WSERoundTrip.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/WSERoundTrip.java b/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/WSERoundTrip.java
deleted file mode 100644
index 6af7f2a..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-round-trip/src/org/apache/airavata/wsmg/samples/wse/WSERoundTrip.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-import java.io.*;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class WSERoundTrip {
-
-	private static Properties getDefaults() {
-
-		Properties defaults = new Properties();
-		defaults.setProperty(ConfigKeys.BROKER_EVENTING_SERVICE_EPR,
-				"http://localhost:8080/axis2/services/EventingService");
-		defaults.setProperty(ConfigKeys.TOPIC_SIMPLE, "simpleSampleTopic");
-		defaults.setProperty(ConfigKeys.CONSUMER_PORT, "2222");
-		defaults.setProperty(ConfigKeys.PUBLISH_TIME_INTERVAL, "5");
-		return defaults;
-	}
-
-	public static void main(String[] args) throws InterruptedException {
-
-		Properties configurations = new Properties(getDefaults());
-		try {
-            InputStream ioStream = new FileInputStream(ConfigKeys.CONFIG_FILE_NAME);
-            configurations.load(ioStream);
-
-		} catch (IOException ioe) {
-
-			System.out
-					.println("unable to load configuration file, default will be used.");
-		}
-
-		Producer producer = new Producer("simple topic", configurations);
-
-		int consumerPort = Integer.parseInt(configurations
-				.getProperty(ConfigKeys.CONSUMER_PORT));
-		Consumer consumer = new Consumer("topic consumer", consumerPort,
-				configurations);
-
-		consumer.start();
-		producer.start();
-
-		consumer.join();
-		producer.join();
-
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/README.txt
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/README.txt b/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/README.txt
deleted file mode 100644
index ee6cb8e..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/README.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-OGCE-WS messenger Quick Start Guide- Sample 1 
-=================================
-
-This sample demonstrate how to subscribe to a topic using ws eventing protocol.
-
-
-Pre-Requisites
-==============
-
-Apache Ant 1.7.1 or later
-Apache Axis2 1.5 or later
-
-
-
-Steps:
-======
-
-1) configure and run ws-messenger in any mode. please refer ws-messenger user guide to know how to run the ws-messenger.
-
-2) configure 'build.properties' located in the sample directory.
-
-3) set configurations in './conf/configuration.properties' file.
-
-4) run following command:
-      ant run

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/build.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/build.properties b/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/build.properties
deleted file mode 100644
index 3919fd5..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-
-axis2.home=../../../standalone-server/

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/build.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/build.xml b/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/build.xml
deleted file mode 100644
index 968baa4..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/build.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-
-
-<project name="wse-topic-sub-sample" default="run" basedir=".">
-
-	<property file="build.properties" />
-	<property name="lib.path" value="../../../lib" />
-	<property name="dest.dir" value="bin" />
-	<property name="src.dir" value="src" />
-	<property name="conf.dir" location="conf" />
-
-	<path id="broker.libs.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-	</path>
-
-
-	<path id="broker.class.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-
-		<path location="${conf.dir}" />
-
-		<pathelement location="${dest.dir}" />
-	</path>
-
-	<target name="clean">
-		<delete dir="${dest.dir}" />
-	</target>
-
-	<target name="build" depends="makeDest">
-		<antcall target="compile" />
-	</target>
-
-	<target name="makeDest">
-		<mkdir dir="${dest.dir}" />
-	</target>
-
-
-	<target name="compile" depends="makeDest">
-		<javac debug="true" srcdir="${src.dir}" destdir="${dest.dir}">
-			<classpath refid="broker.libs.path" />
-		</javac>
-	</target>
-
-
-	<target name="run" depends="build">
-
-		<java classname="org.apache.airavata.wsmg.samples.wse.TopicSubscribe" fork="true">
-			<classpath refid="broker.class.path" />
-		</java>
-
-	</target>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/conf/configurations.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/conf/configurations.properties b/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/conf/configurations.properties
deleted file mode 100644
index f1834f2..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/conf/configurations.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-broker.eventing.service.epr=http://localhost:8080/axis2/services/EventingService
-broker.notification.service.epr=http://localhost:8080/axis2/services/NotificationService
-consumer.location=http://localhost:6060/axis2/services/ConsumerService
-consumer.port=6060
-topic.simple=SampleSimpleTopic
-topic.xpath=
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java b/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
deleted file mode 100644
index 939e04a..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.util;
-
-public interface ConfigKeys {
-
-	String CONFIG_FILE_NAME = "configurations.properties";
-	
-	String BROKER_EVENTING_SERVICE_EPR = "broker.eventing.service.epr";
-	String BROKER_NOTIFICATIONS_SERVICE_EPR = "broker.notification.service.epr";
-
-	String CONSUMER_EPR = "consumer.location";
-	String CONSUMER_PORT = "consumer.port";
-	String TOPIC_SIME = "topic.simple";
-	String TOPIC_XPATH = "topic.xpath";
-	String AXIS2_REPO = "axis2.repo";
-	
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/src/org/apache/airavata/wsmg/samples/wse/TopicSubscribe.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/src/org/apache/airavata/wsmg/samples/wse/TopicSubscribe.java b/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/src/org/apache/airavata/wsmg/samples/wse/TopicSubscribe.java
deleted file mode 100644
index 0d686e4..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-topic-subscription/src/org/apache/airavata/wsmg/samples/wse/TopicSubscribe.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-import java.io.*;
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-import java.io.FileInputStream;
-import java.io.InputStream;
-
-public class TopicSubscribe {
-
-	public static void main(String[] args) throws MsgBrokerClientException {
-
-		Properties configurations = new Properties();
-
-		try {
-            InputStream ioStream = new FileInputStream(ConfigKeys.CONFIG_FILE_NAME);
-            configurations.load(ioStream);
-		} catch (IOException ioe) {
-
-			System.out
-					.println("unable to load configuration file, default will be used.");
-		}
-
-		String brokerLocation = configurations.getProperty(
-				ConfigKeys.BROKER_EVENTING_SERVICE_EPR,
-				"http://localhost:8080/axis2/services/EventingService");
-		String topicExpression = configurations.getProperty(
-				ConfigKeys.TOPIC_SIME, "SampleSimpleTopic");
-		String consumerLocation = configurations.getProperty(
-				ConfigKeys.CONSUMER_EPR,
-				"http://localhost:2222/axis2/services/ConsumerService");
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-		// create a topic subscription.
-		String subscriptionId = client.subscribe(consumerLocation,
-				topicExpression, null);
-
-		System.out.println("subscription id : " + subscriptionId);
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/README.txt
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/README.txt b/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/README.txt
deleted file mode 100644
index 942dc91..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/README.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-OGCE-WS messenger Quick Start Guide- Sample 1 
-=================================
-
-This sample demonstrate how to subscribe using ws eventing protocol with a Xpath expression.
-
-
-Pre-Requisites
-==============
-
-Apache Ant 1.7.1 or later
-Apache Axis2 1.5 or later
-
-
-
-Steps:
-======
-1) configure and run ws-messenger in any mode. please refer ws-messenger user guide to know how to run the ws-messenger.
-
-2) configure 'build.properties' located in the sample directory.
-
-3) set configurations in './conf/configuration.properties' file.
-
-4) run following command:
-      ant run

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/build.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/build.properties b/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/build.properties
deleted file mode 100644
index 3919fd5..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-
-axis2.home=../../../standalone-server/

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/build.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/build.xml b/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/build.xml
deleted file mode 100644
index 23dc2a7..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/build.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-
-
-<project name="wse-xpath-sub-sample" default="run" basedir=".">
-
-	<property file="build.properties" />
-	<property name="lib.path" value="../../../lib" />
-	<property name="dest.dir" value="bin" />
-	<property name="src.dir" value="src" />
-	<property name="conf.dir" location="conf" />
-
-	<path id="broker.libs.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-	</path>
-
-
-	<path id="broker.class.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-
-		<path location="${conf.dir}" />
-
-		<pathelement location="${dest.dir}" />
-	</path>
-
-	<target name="clean">
-		<delete dir="${dest.dir}" />
-	</target>
-
-	<target name="build" depends="makeDest">
-		<antcall target="compile" />
-	</target>
-
-	<target name="makeDest">
-		<mkdir dir="${dest.dir}" />
-	</target>
-
-
-	<target name="compile" depends="makeDest">
-		<javac debug="true" srcdir="${src.dir}" destdir="${dest.dir}">
-			<classpath refid="broker.libs.path" />
-		</javac>
-	</target>
-
-
-	<target name="run" depends="build">
-
-		<java classname="org.apache.airavata.wsmg.samples.wse.XpathSubscribe" fork="true">
-			<classpath refid="broker.class.path" />
-		</java>
-
-	</target>
-
-
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/conf/configurations.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/conf/configurations.properties b/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/conf/configurations.properties
deleted file mode 100644
index 410029b..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/conf/configurations.properties
+++ /dev/null
@@ -1,28 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-broker.eventing.service.epr=http://localhost:8080/axis2/services/EventingService
-broker.notification.service.epr=http://localhost:8080/axis2/services/NotificationService
-consumer.location=http://localhost:6060/axis2/services/ConsumerService
-consumer.port=6060
-topic.simple=SampleSimpleTopic
-topic.xpath=/c/b/a
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java b/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
deleted file mode 100644
index dda7e92..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/src/org/apache/airavata/wsmg/samples/util/ConfigKeys.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.util;
-
-public interface ConfigKeys {
-
-	String CONFIG_FILE_NAME = "configurations.properties";
-	
-	String BROKER_EVENTING_SERVICE_EPR = "broker.eventing.service.epr";
-	String BROKER_NOTIFICATIONS_SERVICE_EPR = "broker.notification.service.epr";
-
-	String CONSUMER_EPR = "consumer.location";
-	String CONSUMER_PORT = "consumer.port";
-	String TOPIC_SIMPLE = "topic.simple";
-	String TOPIC_XPATH = "topic.xpath";
-	String AXIS2_REPO = "axis2.repo";
-	
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/src/org/apache/airavata/wsmg/samples/wse/XpathSubscribe.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/src/org/apache/airavata/wsmg/samples/wse/XpathSubscribe.java b/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/src/org/apache/airavata/wsmg/samples/wse/XpathSubscribe.java
deleted file mode 100644
index 8fab158..0000000
--- a/modules/ws-messenger/samples/messagebroker/wse-xpath-subscription/src/org/apache/airavata/wsmg/samples/wse/XpathSubscribe.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-package org.apache.airavata.wsmg.samples.wse;
-
-import java.io.IOException;
-import java.net.URL;
-import java.util.Properties;
-import java.io.*;
-import org.apache.airavata.wsmg.client.MsgBrokerClientException;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.samples.util.ConfigKeys;
-
-public class XpathSubscribe {
-
-	public static void main(String[] args) throws MsgBrokerClientException{
-
-		Properties configurations = new Properties();
-
-		try {
-            InputStream ioStream = new FileInputStream(ConfigKeys.CONFIG_FILE_NAME);
-            configurations.load(ioStream);
-		} catch (IOException ioe) {
-
-			System.out
-					.println("unable to load configuration file, default will be used.");
-		}
-
-		String brokerLocation = configurations.getProperty(
-				ConfigKeys.BROKER_EVENTING_SERVICE_EPR,
-				"http://localhost:8080/axis2/services/EventingService");
-		String xpathExpression = configurations.getProperty(
-				ConfigKeys.TOPIC_XPATH, "/c/b/a");
-		String consumerLocation = configurations.getProperty(
-				ConfigKeys.CONSUMER_EPR,
-				"http://localhost:2222/axis2/services/ConsumerService");
-
-		WseMsgBrokerClient client = new WseMsgBrokerClient();
-		client.init(brokerLocation);
-		System.out.println("subscribing with xpath expression: "
-				+ xpathExpression);
-
-		// create a topic subscription.
-		String subscriptionId = client.subscribe(consumerLocation, null,
-				xpathExpression);
-
-		System.out.println("xpath subscription id : " + subscriptionId);
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wsmg-gui/README.txt
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wsmg-gui/README.txt b/modules/ws-messenger/samples/messagebroker/wsmg-gui/README.txt
deleted file mode 100644
index 429dd6b..0000000
--- a/modules/ws-messenger/samples/messagebroker/wsmg-gui/README.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-OGCE-WS messenger Quick Start Guide- Sample 1 
-=================================
-
-This sample demonstrate how to run ws-notification listener.
-
-
-Pre-Requisites
-==============
-
-Apache Ant 1.7.1 or later
-Apache Axis2 1.5 or later
-
-
-
-Steps:
-======
-1) configure and run ws-messenger in any mode. please refer ws-messenger user guide to know how to run the ws-messenger.
-
-2) configure 'build.properties' located in the sample directory.
-
-3) run following command:
-      ant run

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wsmg-gui/build.properties
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wsmg-gui/build.properties b/modules/ws-messenger/samples/messagebroker/wsmg-gui/build.properties
deleted file mode 100644
index 3919fd5..0000000
--- a/modules/ws-messenger/samples/messagebroker/wsmg-gui/build.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-#
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-
-
-axis2.home=../../../standalone-server/

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/samples/messagebroker/wsmg-gui/build.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/samples/messagebroker/wsmg-gui/build.xml b/modules/ws-messenger/samples/messagebroker/wsmg-gui/build.xml
deleted file mode 100644
index 744fa1a..0000000
--- a/modules/ws-messenger/samples/messagebroker/wsmg-gui/build.xml
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-
-
-
-<project name="wsmg-gui" default="run" basedir=".">
-
-	<property file="build.properties" />
-	<property name="lib.path" value="../../../lib" />
-	<path id="broker.class.path">
-		<fileset dir="${lib.path}">
-			<include name="*.jar" />
-		</fileset>
-
-		<fileset dir="${axis2.home}/lib">
-			<include name="*.jar" />
-		</fileset>
-
-		<path location="${conf.dir}" />
-
-		<pathelement location="${dest.dir}" />
-	</path>
-
-	<target name="run">
-
-		<java classname="org.apache.airavata.wsmg.gui.NotificationViewer" fork="true">
-			<classpath refid="broker.class.path" />
-		</java>
-
-	</target>
-
-</project>


[45/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/DatabaseCreator.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/DatabaseCreator.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/DatabaseCreator.java
deleted file mode 100644
index 7782964..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/DatabaseCreator.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.services.utils;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.SQLWarning;
-import java.sql.Statement;
-import java.util.StringTokenizer;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * This class creates the database tables required for messagebox and messagebroker with default configuration this
- * class creates embedded derby database in local file system. User can specify required database in appropriate
- * properties files.
- */
-public class DatabaseCreator {
-
-    public enum DatabaseType {
-        derby("(?i).*derby.*"), mysql("(?i).*mysql.*"), other("");
-
-        private String pattern;
-
-        private DatabaseType(String matchingPattern) {
-            this.pattern = matchingPattern;
-        }
-
-        public String getMatchingPattern() {
-            return this.pattern;
-        }
-    }
-
-    private static DatabaseType[] supportedDatabase = new DatabaseType[] { DatabaseType.derby, DatabaseType.mysql };
-
-    private static Logger log = LoggerFactory.getLogger(DatabaseCreator.class);
-    private static final String delimiter = ";";
-
-    /**
-     * Creates database
-     *
-     * @throws Exception
-     */
-    public static void createRegistryDatabase(Connection conn) throws Exception {
-        createDatabase("data", conn);
-    }
-
-
-
-    /**
-     * Checks whether database tables are created by using select * on given table name
-     *
-     * @param tableName
-     *            Table which should be existed
-     * @return <code>true</core> if checkSQL is success, else <code>false</code> .
-     */
-    public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
-        try {
-
-            log.debug("Running a query to test the database tables existence.");
-
-            // check whether the tables are already created with a query
-            Statement statement = null;
-            try {
-                statement = conn.createStatement();
-                ResultSet rs = statement.executeQuery("select * from " + tableName);
-                if (rs != null) {
-                    rs.close();
-                }
-            } finally {
-                try {
-                    if (statement != null) {
-                        statement.close();
-                    }
-                } catch (SQLException e) {
-                    return false;
-                }
-            }
-        } catch (SQLException e) {
-            return false;
-        }
-
-        return true;
-    }
-
-    /**
-     * executes given sql
-     *
-     * @param sql
-     * @throws Exception
-     */
-    private static void executeSQL(String sql, Connection conn) throws Exception {
-        // Check and ignore empty statements
-        if ("".equals(sql.trim())) {
-            return;
-        }
-
-        Statement statement = null;
-        try {
-            log.debug("SQL : " + sql);
-
-            boolean ret;
-            int updateCount = 0, updateCountTotal = 0;
-            statement = conn.createStatement();
-            ret = statement.execute(sql);
-            updateCount = statement.getUpdateCount();
-            do {
-                if (!ret) {
-                    if (updateCount != -1) {
-                        updateCountTotal += updateCount;
-                    }
-                }
-                ret = statement.getMoreResults();
-                if (ret) {
-                    updateCount = statement.getUpdateCount();
-                }
-            } while (ret);
-
-            log.debug(sql + " : " + updateCountTotal + " rows affected");
-
-            SQLWarning warning = conn.getWarnings();
-            while (warning != null) {
-                log.info(warning + " sql warning");
-                warning = warning.getNextWarning();
-            }
-            conn.clearWarnings();
-        } catch (SQLException e) {
-            if (e.getSQLState().equals("X0Y32")) {
-                // eliminating the table already exception for the derby
-                // database
-                log.info("Table Already Exists", e);
-            } else {
-                throw new Exception("Error occurred while executing : " + sql, e);
-            }
-        } finally {
-            if (statement != null) {
-                try {
-                    statement.close();
-                } catch (SQLException e) {
-                    log.error("Error occurred while closing result set.", e);
-                }
-            }
-        }
-    }
-
-    /**
-     * computes relatational database type using database name
-     *
-     * @return DatabaseType
-     * @throws Exception
-     *
-     */
-    public static DatabaseType getDatabaseType(Connection conn) throws Exception {
-        try {
-            if (conn != null && (!conn.isClosed())) {
-                DatabaseMetaData metaData = conn.getMetaData();
-                String databaseProductName = metaData.getDatabaseProductName();
-                return checkType(databaseProductName);
-            }
-        } catch (SQLException e) {
-            String msg = "Failed to create Airavatadatabase." + e.getMessage();
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-        return DatabaseType.other;
-    }
-
-    /**
-     * Overloaded method with String input
-     *
-     * @return DatabaseType
-     * @throws Exception
-     *
-     */
-    public static DatabaseType getDatabaseType(String dbUrl) throws Exception {
-        return checkType(dbUrl);
-    }
-
-    private static DatabaseType checkType(String text) throws Exception {
-        try {
-            if (text != null) {
-                for (DatabaseType type : supportedDatabase) {
-                    if (text.matches(type.getMatchingPattern()))
-                        return type;
-                }
-            }
-            String msg = "Unsupported database: " + text
-                    + ". Database will not be created automatically by the Airavata. "
-                    + "Please create the database using appropriate database scripts for " + "the database.";
-            throw new Exception(msg);
-
-        } catch (SQLException e) {
-            String msg = "Failed to create Airavatadatabase." + e.getMessage();
-            log.error(msg, e);
-            throw new Exception(msg, e);
-        }
-    }
-
-    /**
-     * Get scripts location which is prefix + "-" + databaseType + ".sql"
-     *
-     * @param prefix
-     * @param databaseType
-     * @return script location
-     */
-    private static String getScriptLocation(String prefix, DatabaseType databaseType) {
-        String scriptName = prefix + "-" + databaseType + ".sql";
-        log.debug("Loading database script from :" + scriptName);
-        return "database_scripts" + File.separator + scriptName;
-    }
-
-    private static void createDatabase(String prefix, Connection conn) throws Exception {
-        Statement statement = null;
-        try {
-            conn.setAutoCommit(false);
-            statement = conn.createStatement();
-            executeSQLScript(getScriptLocation(prefix, DatabaseCreator.getDatabaseType(conn)), conn);
-            conn.commit();
-            log.debug("Tables are created successfully.");
-        } catch (SQLException e) {
-            String msg = "Failed to create database tables for Airavata resource store. " + e.getMessage();
-            log.error(msg, e);
-            conn.rollback();
-            throw new Exception(msg, e);
-        } finally {
-            conn.setAutoCommit(true);
-            try {
-                if (statement != null) {
-                    statement.close();
-                }
-            } catch (SQLException e) {
-                log.error("Failed to close statement.", e);
-            }
-        }
-    }
-
-    private static void executeSQLScript(String dbscriptName, Connection conn) throws Exception {
-        StringBuffer sql = new StringBuffer();
-        BufferedReader reader = null;
-
-        try {
-            InputStream is = DatabaseCreator.class.getClassLoader().getResourceAsStream(dbscriptName);
-            reader = new BufferedReader(new InputStreamReader(is));
-            String line;
-            while ((line = reader.readLine()) != null) {
-                line = line.trim();
-                if (line.startsWith("//")) {
-                    continue;
-                }
-                if (line.startsWith("--")) {
-                    continue;
-                }
-                StringTokenizer st = new StringTokenizer(line);
-                if (st.hasMoreTokens()) {
-                    String token = st.nextToken();
-                    if ("REM".equalsIgnoreCase(token)) {
-                        continue;
-                    }
-                }
-                sql.append(" ").append(line);
-
-                // SQL defines "--" as a comment to EOL
-                // and in Oracle it may contain a hint
-                // so we cannot just remove it, instead we must end it
-                if (line.indexOf("--") >= 0) {
-                    sql.append("\n");
-                }
-                if ((checkStringBufferEndsWith(sql, delimiter))) {
-                    executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
-                    sql.replace(0, sql.length(), "");
-                }
-            }
-            // Catch any statements not followed by ;
-            if (sql.length() > 0) {
-                executeSQL(sql.toString(), conn);
-            }
-        } catch (IOException e) {
-            log.error("Error occurred while executing SQL script for creating Airavata database", e);
-            throw new Exception("Error occurred while executing SQL script for creating Airavata database", e);
-
-        } finally {
-            if (reader != null) {
-                reader.close();
-            }
-        }
-    }
-
-    /**
-     * Checks that a string buffer ends up with a given string. It may sound trivial with the existing JDK API but the
-     * various implementation among JDKs can make those methods extremely resource intensive and perform poorly due to
-     * massive memory allocation and copying. See
-     *
-     * @param buffer
-     *            the buffer to perform the check on
-     * @param suffix
-     *            the suffix
-     * @return <code>true</code> if the character sequence represented by the argument is a suffix of the character
-     *         sequence represented by the StringBuffer object; <code>false</code> otherwise. Note that the result will
-     *         be <code>true</code> if the argument is the empty string.
-     */
-    public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
-        if (suffix.length() > buffer.length()) {
-            return false;
-        }
-        // this loop is done on purpose to avoid memory allocation performance
-        // problems on various JDKs
-        // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
-        // implementation is ok though does allocation/copying
-        // StringBuffer.toString().endsWith() does massive memory
-        // allocation/copying on JDK 1.5
-        // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
-        int endIndex = suffix.length() - 1;
-        int bufferIndex = buffer.length() - 1;
-        while (endIndex >= 0) {
-            if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
-                return false;
-            }
-            bufferIndex--;
-            endIndex--;
-        }
-        return true;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/JdbcStorage.java
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/JdbcStorage.java b/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/JdbcStorage.java
deleted file mode 100644
index ff97f31..0000000
--- a/modules/registry/airavata-registry-service/src/main/java/org/apache/airavata/registry/services/utils/JdbcStorage.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.services.utils;
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class JdbcStorage {
-    private static Logger log = LoggerFactory.getLogger(JdbcStorage.class);
-
-    private ConnectionPool connectionPool;
-
-    public JdbcStorage(String jdbcUrl, String jdbcDriver) {
-        // default init connection and max connection
-        this(3, 50, jdbcUrl, jdbcDriver, true);
-    }
-
-    public JdbcStorage(int initCon, int maxCon, String url, String driver, boolean enableTransactions) {
-        try {
-            if (enableTransactions) {
-                connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true, false,
-                        Connection.TRANSACTION_SERIALIZABLE);
-            } else {
-                connectionPool = new ConnectionPool(driver, url, initCon, maxCon, true);
-            }
-        } catch (Exception e) {
-            throw new RuntimeException("Failed to create database connection pool.", e);
-        }
-    }
-
-    /**
-     * Check if this connection pool is auto commit or not
-     *
-     * @return
-     */
-    public boolean isAutoCommit() {
-        return connectionPool.isAutoCommit();
-    }
-
-    public void commit(Connection conn) {
-        try {
-            if (conn != null && !conn.getAutoCommit()) {
-                conn.commit();
-            }
-        } catch (SQLException sqle) {
-            log.error("Cannot commit data", sqle);
-        }
-    }
-
-    public void commitAndFree(Connection conn) {
-        commit(conn);
-        closeConnection(conn);
-    }
-
-    public void rollback(Connection conn) {
-        try {
-            if (conn != null && !conn.getAutoCommit()) {
-                conn.rollback();
-            }
-        } catch (SQLException sqle) {
-            log.error("Cannot Rollback data", sqle);
-        }
-    }
-
-    public void rollbackAndFree(Connection conn) {
-        rollback(conn);
-        closeConnection(conn);
-    }
-
-    public Connection connect() {
-
-        Connection conn = null;
-        try {
-            conn = connectionPool.getConnection();
-        } catch (SQLException e) {
-            e.printStackTrace();
-            log.error(e.getMessage(), e);
-        }
-        return conn;
-    }
-
-    /**
-     * This method is provided so that you can have better control over the statement. For example: You can use
-     * stmt.setString to convert quotation mark automatically in an UPDATE statement
-     *
-     * NOTE: Statement is closed after execution
-     */
-    public int executeUpdateAndClose(PreparedStatement stmt) throws SQLException {
-        int rows = 0;
-        try {
-            rows = stmt.executeUpdate();
-            if (rows == 0) {
-                log.info("Problem: 0 rows affected by insert/update/delete statement.");
-            }
-        } finally {
-            stmt.close();
-        }
-        return rows;
-    }
-
-    public int countRow(String tableName, String columnName) throws SQLException {
-        String query = new String("SELECT COUNT(" + columnName + ") FROM " + tableName);
-        int count = -1;
-        Connection conn = null;
-        PreparedStatement stmt = null;
-        try {
-            conn = connectionPool.getConnection();
-            stmt = conn.prepareStatement(query);
-            ResultSet rs = stmt.executeQuery();
-            rs.next();
-            count = rs.getInt(1);
-            commit(conn);
-        } catch (SQLException sql) {
-            rollback(conn);
-            throw sql;
-        } finally {
-            try {
-                if (stmt != null && !stmt.isClosed()) {
-                    stmt.close();
-                }
-            } finally {
-                closeConnection(conn);
-            }
-        }
-        return count;
-    }
-
-    public void quietlyClose(Connection conn, Statement... stmts) {
-        if (stmts != null) {
-            for (Statement stmt : stmts) {
-                try {
-                    if (stmt != null && !stmt.isClosed()) {
-                        stmt.close();
-                    }
-                } catch (SQLException sql) {
-                    log.error(sql.getMessage(), sql);
-                }
-            }
-        }
-        closeConnection(conn);
-    }
-
-    public void closeConnection(Connection conn) {
-        if (conn != null) {
-            connectionPool.free(conn);
-        }
-    }
-
-    public void closeAllConnections() {
-        if (connectionPool != null)
-            connectionPool.dispose();
-    }
-
-    public void shutdown() {
-        connectionPool.shutdown();
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-service/src/main/resources/services.xml
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-service/src/main/resources/services.xml b/modules/registry/airavata-registry-service/src/main/resources/services.xml
deleted file mode 100644
index 4b7102b..0000000
--- a/modules/registry/airavata-registry-service/src/main/resources/services.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor 
-	license agreements. See the NOTICE file distributed with this work for additional 
-	information regarding copyright ownership. The ASF licenses this file to 
-	you under the Apache License, Version 2.0 (theÏ "License"); you may not use 
-	this file except in compliance with the License. You may obtain a copy of 
-	the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required 
-	by applicable law or agreed to in writing, software distributed under the 
-	License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS 
-	OF ANY ~ KIND, either express or implied. See the License for the specific 
-	language governing permissions and limitations under the License. -->
-<service name="RegistryService" class="org.apache.airavata.registry.services.RegistryService" >
-	<Description>
-		Provide Simple Service for Testing Purpose including addition, subtraction, multiplication, array-generator
-	</Description>
-	<messageReceivers>
-		<messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
-		<messageReceiver  mep="http://www.w3.org/2004/08/wsdl/in-out"  class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
-	</messageReceivers>
-	<parameter name="ServiceClass" locked="false">org.apache.airavata.registry.services.RegistryService</parameter>
-</service>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/registry/airavata-registry-test/pom.xml
----------------------------------------------------------------------
diff --git a/modules/registry/airavata-registry-test/pom.xml b/modules/registry/airavata-registry-test/pom.xml
deleted file mode 100644
index 7abac97..0000000
--- a/modules/registry/airavata-registry-test/pom.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>registry</artifactId>
-        <version>0.12-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>airavata-registry-test</artifactId>
-    <packaging>jar</packaging>
-    <name>Airavata Registry Test</name>
-    <url>http://airavata.apache.org/</url>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-gfac-schema-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <!--dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-common-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency-->
-        <!-- Test -->
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <scope>test</scope>
-        </dependency>
-        <!--<dependency>-->
-        	<!--<groupId>org.apache.openjpa</groupId>-->
-        	<!--<artifactId>openjpa-all</artifactId>-->
-        	<!--<version>2.2.0</version>-->
-        <!--</dependency>-->
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-registry-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <!--dependency>
-            <groupId>mysql</groupId>
-            <artifactId>mysql-connector-java</artifactId>
-            <version>5.1.6</version>
-        </dependency-->
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derby</artifactId>
-            <version>${derby.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbyclient</artifactId>
-            <version>${derby.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbynet</artifactId>
-            <version>${derby.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbytools</artifactId>
-            <version>${derby.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-jpa-registry</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-data-models</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency>
-        <!--dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-model-core</artifactId>
-            <version>${project.version}</version>
-            <scope>test</scope>
-        </dependency-->
-        <!--dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-registry-service</artifactId>
-            <version>${project.version}</version>
-        </dependency-->
-	<dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-client-configuration</artifactId>
-            <scope>test</scope>
-        </dependency>
-    </dependencies>
-
-</project>


[60/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistrySearchResult.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistrySearchResult.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistrySearchResult.java
new file mode 100644
index 0000000..c17eb4e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistrySearchResult.java
@@ -0,0 +1,131 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.experiment;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.ui.widgets.TableRenderable;
+
+public class RegistrySearchResult implements TableRenderable {
+
+    private static String[] columnName = { "Name", "Description" };
+
+    private QName qname;
+
+    private QName resourceID;
+
+    private String resourceName;
+
+    private String description;
+
+    /**
+     * Constructs a RegistrySearchResult.
+     * 
+     * @param node
+     */
+
+    public RegistrySearchResult(Workflow workflow) {
+        //Never user so far during the project lifetime, thus assumption will never need
+//            String property = node.getProperty("Type").getString();
+//            if (property.equals(XBayaConstants.REGISTRY_TYPE_HOST_DESC)) {
+//                // todo
+//            } else if (property.equals(XBayaConstants.REGISTRY_TYPE_APPLICATION_DESC)) {
+//                // todo
+//            } else if (property.equals(XBayaConstants.REGISTRY_TYPE_SERVICE_DESC)) {
+//                // todo
+//            } else if (property.equals(XBayaConstants.REGISTRY_TYPE_WORKFLOW)) {
+		    // this.qname = new ;
+		    this.resourceID = workflow.getQname();
+		    this.description = workflow.getDescription();
+		    this.resourceName = workflow.getName();
+//            }
+    }
+
+    /**
+     * Returns the qname.
+     * 
+     * @return The resourceID
+     */
+    public QName getQname() {
+        return this.qname;
+    }
+
+    /**
+     * Returns the resourceId.
+     * 
+     * @return The resourceID
+     */
+    public QName getResourceId() {
+        return this.resourceID;
+    }
+
+    /**
+     * Returns the description.
+     * 
+     * @return The description
+     */
+    public String getDescription() {
+        return this.description;
+    }
+
+    /**
+     * Returns the resourceName.
+     * 
+     * @return The resourceName
+     */
+    public String getResourceName() {
+        return this.resourceName;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getColumnCount()
+     */
+    @Override
+    public int getColumnCount() {
+        return 2;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getColumnTitle(int)
+     */
+    @Override
+    public String getColumnTitle(int index) {
+        return columnName[index];
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getValue(int)
+     */
+    @Override
+    public Object getValue(int index) {
+        switch (index) {
+        case 0:
+            return getResourceName();
+        case 1:
+            return getDescription();
+        default:
+            return null;
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryWorkflowPublisherWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryWorkflowPublisherWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryWorkflowPublisherWindow.java
new file mode 100644
index 0000000..8835be0
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryWorkflowPublisherWindow.java
@@ -0,0 +1,144 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.experiment;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JPanel;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class RegistryWorkflowPublisherWindow {
+
+    private XBayaEngine engine;
+
+    private XBayaDialog dialog;
+
+    private JButton okButton;
+
+    private boolean makePublic = false;
+
+    private JCheckBox chkMakePublic;
+
+    private XBayaTextArea descriptionTextArea;
+
+    private XBayaTextField nameTextField;
+
+    private Workflow workflow;
+
+    /**
+     * Constructs a OGCEXRegistryWorkflowPublisherWindow.
+     * 
+     * @param engine
+     */
+    public RegistryWorkflowPublisherWindow(XBayaEngine engine) {
+        this.engine = engine;
+        initGUI();
+    }
+
+    private void ok() {
+        String name = this.nameTextField.getText();
+        String description = this.descriptionTextArea.getText();
+
+        GraphCanvas graphCanvas = this.engine.getGUI().getGraphCanvas();
+        graphCanvas.setNameAndDescription(name, description);
+        hide();
+    }
+
+    /**
+     * Show the workflow name and description
+     */
+    public void show() {
+        this.workflow = this.engine.getGUI().getWorkflow();
+        String name = this.workflow.getName();
+        this.nameTextField.setText(name);
+
+        String description = this.workflow.getDescription();
+        this.descriptionTextArea.setText(description);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hide the workflow name and description
+     */
+    public void hide() {
+        this.dialog.hide();
+    }
+
+    /**
+     * Intialize UI
+     */
+    private void initGUI() {
+
+        this.nameTextField = new XBayaTextField();
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.descriptionTextArea = new XBayaTextArea();
+        XBayaLabel descriptionLabel = new XBayaLabel("Description", this.descriptionTextArea);
+
+        JPanel buttonPanel = new JPanel();
+        this.okButton = new JButton("OK");
+        this.okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                ok();
+            }
+
+        });
+        buttonPanel.add(this.okButton);
+
+        GridPanel mainPanel = new GridPanel();
+        TitledBorder border = new TitledBorder(new EtchedBorder(), "Save Workflow to Registry");
+        mainPanel.getSwingComponent().setBorder(border);
+        mainPanel.add(nameLabel);
+        mainPanel.add(this.nameTextField);
+        mainPanel.add(descriptionLabel);
+        mainPanel.add(this.descriptionTextArea);
+        chkMakePublic = new JCheckBox("Make public");
+        mainPanel.add(chkMakePublic);
+        mainPanel.layout(2, 2, 0, 0);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Save Workflow to Registry", mainPanel, buttonPanel);
+        this.dialog.setDefaultButton(this.okButton);
+    }
+
+    /**
+     * Verify if the public checkbox is selected or not
+     * 
+     * @return true or false
+     */
+    public boolean isMakePublic() {
+        return this.chkMakePublic.isSelected();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
new file mode 100644
index 0000000..68fc482
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/WorkflowInterpreterLaunchWindow.java
@@ -0,0 +1,350 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.experiment;
+
+import java.awt.event.ActionEvent;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.UUID;
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+
+import javax.swing.AbstractAction;
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.border.EtchedBorder;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.ExperimentAdvanceOptions;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.ode.ODEClient;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowInput;
+import org.apache.airavata.ws.monitor.MonitorConfiguration;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.core.amazon.AmazonCredential;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.graph.ws.WSNodeGUI;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+import org.xmlpull.v1.builder.XmlInfosetBuilder;
+
+import xsul.XmlConstants;
+
+public class WorkflowInterpreterLaunchWindow {
+
+    private static final Logger logger = LoggerFactory.getLogger(WorkflowInterpreterLaunchWindow.class);
+
+    private XBayaEngine engine;
+
+    private Workflow workflow;
+
+    private XBayaDialog dialog;
+
+    private GridPanel parameterPanel;
+
+//    private XBayaTextField topicTextField;
+
+    private List<XBayaTextField> parameterTextFields = new ArrayList<XBayaTextField>();
+
+//    private XBayaTextField workflowInterpreterTextField;
+
+//    private XBayaTextField RegistryTextField;
+
+//    private XBayaTextField gfacTextField;
+
+	private XBayaTextField instanceNameTextField;
+
+    protected final static XmlInfosetBuilder builder = XmlConstants.BUILDER;
+
+    /**
+     * Constructs a WorkflowInterpreterLaunchWindow.
+     * 
+     * @param engine
+     * 
+     */
+    public WorkflowInterpreterLaunchWindow(XBayaEngine engine) {
+        this.engine = engine;
+        if (XBayaUtil.acquireJCRRegistry(engine)) {
+            initGUI();
+        }
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        this.workflow = this.engine.getGUI().getWorkflow();
+
+        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
+        if (notifConfig.getBrokerURL() == null) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.BROKER_URL_NOT_SET_ERROR);
+            return;
+        }
+
+        // Create input fields
+        Collection<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
+        for (InputNode node : inputNodes) {
+            String id = node.getID();
+            QName parameterType = node.getParameterType();
+            JLabel nameLabel = new JLabel(id);
+            JLabel typeField = new JLabel(parameterType.getLocalPart());
+            XBayaTextField paramField = new XBayaTextField();
+            Object value = node.getDefaultValue();
+
+            String valueString;
+            if (value == null) {
+                valueString = "";
+            } else {
+                if (value instanceof XmlElement) {
+                    XmlElement valueElement = (XmlElement) value;
+                    valueString = XMLUtil.xmlElementToString(valueElement);
+                } else {
+                    // Only string comes here for now.
+                    valueString = value.toString();
+                }
+            }
+            paramField.setText(valueString);
+            this.parameterPanel.add(nameLabel);
+            this.parameterPanel.add(typeField);
+            this.parameterPanel.add(paramField);
+            this.parameterTextFields.add(paramField);
+        }
+        this.parameterPanel.layout(inputNodes.size(), 3, GridPanel.WEIGHT_NONE, 2);
+//        this.instanceNameTextField.setText(workflow.getName()+"_"+Calendar.getInstance().getTime().toString());
+//        this.topicTextField.setText(UUID.randomUUID().toString());
+
+//        XBayaConfiguration config = this.engine.getConfiguration();
+//        this.gfacTextField.setText(config.getGFacURL().toString());
+//        URI workflowInterpreterURL = config.getWorkflowInterpreterURL();
+//        if (null != workflowInterpreterURL) {
+//            this.workflowInterpreterTextField.setText(workflowInterpreterURL.toString());
+//        } else {
+//            this.workflowInterpreterTextField.setText(XBayaConstants.DEFAULT_WORKFLOW_INTERPRETER_URL);
+//        }
+
+//        AiravataAPI airavataAPI = config.getAiravataAPI();
+//        if (null != airavataAPI) {
+//            this.RegistryTextField.setText(config.getRegistryURL());
+//        } else {
+//            this.RegistryTextField.setText(XBayaConstants.REGISTRY_URL.toASCIIString());
+//        }
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    public void hide() {
+        this.dialog.hide();
+
+        this.parameterPanel.getContentPanel().removeAll();
+        this.parameterTextFields.clear();
+    }
+
+    private void initGUI() {
+        this.parameterPanel = new GridPanel(true);
+
+        this.instanceNameTextField = new XBayaTextField();
+        XBayaLabel instanceNameLabel = new XBayaLabel("Experiment name", this.instanceNameTextField);
+        
+//        this.topicTextField = new XBayaTextField();
+//        XBayaLabel topicLabel = new XBayaLabel("Notification topic", this.topicTextField);
+//        this.workflowInterpreterTextField = new XBayaTextField();
+//        XBayaLabel workflowInterpreterLabel = new XBayaLabel("Workflow Interpreter URL",
+//                this.workflowInterpreterTextField);
+//        this.RegistryTextField = new XBayaTextField();
+//        XBayaLabel RegistryLabel = new XBayaLabel("Registry URL", this.RegistryTextField);
+//        this.gfacTextField = new XBayaTextField();
+//        XBayaLabel gfacLabel = new XBayaLabel("GFac URL", this.gfacTextField);
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(instanceNameLabel);
+        infoPanel.add(this.instanceNameTextField);
+//        infoPanel.add(topicLabel);
+//        infoPanel.add(this.topicTextField);
+//        infoPanel.add(workflowInterpreterLabel);
+//        infoPanel.add(this.workflowInterpreterTextField);
+//        infoPanel.add(gfacLabel);
+//        infoPanel.add(this.gfacTextField);
+//        infoPanel.add(RegistryLabel);
+//        infoPanel.add(this.RegistryTextField);
+
+        infoPanel.layout(1, 2, GridPanel.WEIGHT_NONE, 1);
+
+        GridPanel mainPanel = new GridPanel();
+        mainPanel.getContentPanel().setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
+        mainPanel.add(infoPanel);
+        mainPanel.add(this.parameterPanel);
+        mainPanel.layout(2, 1, 0, 0);
+
+        JButton okButton = new JButton("Run");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                execute();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+        buttonPanel.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Launch  workflow", mainPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+    private void execute() {
+        final List<String> arguments = new ArrayList<String>();
+
+        String topic = UUID.randomUUID().toString();//this.topicTextField.getText();
+        String instanceName = this.instanceNameTextField.getText();
+        if (instanceName.trim().equals("")){
+        	JOptionPane.showMessageDialog(engine.getGUI().getFrame(),
+        		    "Experiment name cannot be empty",
+        		    "Experiment Name",
+        		    JOptionPane.ERROR_MESSAGE);
+        	return;
+        }
+
+        //previous instance name
+        if (!instanceNameTextField.getText().equals("")){
+            this.instanceNameTextField.setText("");
+        }
+        final String instanceNameFinal=instanceName;
+        if (topic.length() == 0) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.TOPIC_EMPTY_ERROR);
+            return;
+        }
+
+        // Use topic as a base of workflow instance ID so that the monitor can
+        // find it.
+        URI workfowInstanceID = URI.create(StringUtil.convertToJavaIdentifier(topic));
+        this.workflow.setGPELInstanceID(workfowInstanceID);
+
+        MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
+        engine.getMonitor().resetEventData();
+        notifConfig.setTopic(topic);
+        arguments.add("-" + JythonScript.TOPIC_VARIABLE);
+        arguments.add(topic);
+        Collection<WSNode> wsNodes = GraphUtil.getWSNodes(this.engine.getGUI().getWorkflow().getGraph());
+        for (WSNode node : wsNodes) {
+            ((WSNodeGUI) NodeController.getGUI(node)).setInteractiveMode(false);
+        }
+
+        // TODO error check for user inputs
+
+        final List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
+        builder.newFragment("inputs");
+        new ODEClient();
+        for (int i = 0; i < inputNodes.size(); i++) {
+            InputNode inputNode = inputNodes.get(i);
+            XBayaTextField parameterTextField = this.parameterTextFields.get(i);
+            inputNode.getID();
+            String value = parameterTextField.getText();
+            inputNode.setDefaultValue(value);
+        }
+
+//        final String workflowInterpreterUrl = this.workflowInterpreterTextField.getText();
+//        if (null != workflowInterpreterUrl && !"".equals(workflowInterpreterUrl)) {
+//            try {
+//                this.engine.getConfiguration().setWorkflowInterpreterURL(new URI(workflowInterpreterUrl));
+//            } catch (URISyntaxException e) {
+//                this.engine.getGUI().getErrorWindow().error(e);
+//            }
+//        }
+
+//        final String gFacUrl = this.gfacTextField.getText();
+//        if (null != gFacUrl && !"".equals(gFacUrl)) {
+//            try {
+//                this.engine.getConfiguration().setGFacURL(new URI(gFacUrl));
+//            } catch (URISyntaxException e) {
+//                this.engine.getGUI().getErrorWindow().error(e);
+//            }
+//        }
+        this.engine.getConfiguration().setTopic(topic);
+
+        new Thread() {
+            @Override
+            public void run() {
+
+                try {
+                    List<WorkflowInput> workflowInputs=new ArrayList<WorkflowInput>();
+                    for (int i = 0; i < inputNodes.size(); i++) {
+                    	InputNode inputNode = inputNodes.get(i);
+                    	workflowInputs.add(new WorkflowInput(inputNode.getID(), inputNode.getDefaultValue().toString()));
+                    }
+                    AiravataAPI api = engine.getConfiguration().getAiravataAPI();
+                    
+                    ExperimentAdvanceOptions options = api.getExecutionManager().createExperimentAdvanceOptions(instanceNameFinal, api.getCurrentUser(), null);
+                    if (AmazonCredential.getInstance().getAwsAccessKeyId() != null) {
+                        options.getCustomSecuritySettings().getAmazonWSSettings().setAccessKeyId(AmazonCredential.getInstance().getAwsAccessKeyId());
+                        options.getCustomSecuritySettings().getAmazonWSSettings().setSecretAccessKey(AmazonCredential.getInstance().getAwsSecretAccessKey());
+                    }
+
+                    //TODO get the token id from UI
+                    // For the moment hard code it
+                    // TODO Build UI to get the token id
+                    //options.getCustomSecuritySettings().getCredentialStoreSecuritySettings().setTokenId("1234");
+
+
+                    String experimentId = api.getExecutionManager().runExperiment(api.getWorkflowManager().getWorkflowAsString(workflow), workflowInputs,options);
+                    try {
+                        WorkflowInterpreterLaunchWindow.this.engine.getMonitor().getConfiguration().setTopic(experimentId);
+                        WorkflowInterpreterLaunchWindow.this.engine.getMonitor().start();
+                    } catch (MonitorException e1) {
+                        WorkflowInterpreterLaunchWindow.this.engine.getGUI().getErrorWindow().error(e1);
+                    }
+                } catch (Exception e) {
+                    WorkflowInterpreterLaunchWindow.this.engine.getGUI().getErrorWindow().error(e);
+                }
+            }
+        }.start();
+
+        hide();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/EdgeGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/EdgeGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/EdgeGUI.java
new file mode 100644
index 0000000..1c94620
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/EdgeGUI.java
@@ -0,0 +1,142 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Stroke;
+import java.awt.event.MouseEvent;
+import java.awt.geom.CubicCurve2D;
+
+import org.apache.airavata.workflow.model.graph.ControlEdge;
+import org.apache.airavata.workflow.model.graph.Edge;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.utils.DrawUtils;
+
+public class EdgeGUI implements GraphPieceGUI {
+
+    /**
+     * CONTROL_EDGE_STROKE
+     */
+    public static final Stroke CONTROL_EDGE_STROKE = new BasicStroke(1.0f, BasicStroke.CAP_SQUARE,
+            BasicStroke.JOIN_MITER, 10.0f, new float[] { 5.0f }, 0.0f);
+
+    public static final Stroke STREAM_EDGE_STROKE = new BasicStroke(4.0f, BasicStroke.CAP_SQUARE,
+            BasicStroke.JOIN_MITER, 10.0f, new float[] { 5.0f }, 0.0f);
+
+    private static final Color lineColor = Color.black;
+
+    private static final Color pointColor = Color.pink;
+
+    private static final Color selectedPointColor = Color.red;
+
+    private static final int POINT_SIZE = 8;
+
+    private Edge edge;
+
+    private boolean selected = false;
+
+    private static Color STREAM_EDGE_COLOR = new Color(51, 255, 204);
+
+    /**
+     * @param edge
+     * 
+     */
+    public EdgeGUI(Edge edge) {
+        this.edge = edge;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.graph.GraphPieceGUI#mouseClicked(java.awt.event.MouseEvent,
+     *      org.apache.airavata.xbaya.XBayaEngine)
+     */
+    public void mouseClicked(MouseEvent event, XBayaEngine engine) {
+        // Nothing
+    }
+
+    /**
+     * @param bool
+     */
+    protected void setSelectedFlag(boolean bool) {
+        this.selected = bool;
+    }
+
+    /**
+     * @return the middle point of the edge
+     */
+    protected Point getMiddlePosition() {
+        Point point1 = getFromPosition();
+        Point point2 = getToPosition();
+
+        Point midPoint = new Point((point1.x + point2.x) / 2, (point1.y + point2.y) / 2);
+        return midPoint;
+    }
+
+    /**
+     * @param g
+     */
+    protected void paint(Graphics2D g) {
+    	DrawUtils.initializeGraphics2D(g);
+        Point point1 = getFromPosition();
+        Point point2 = getToPosition();
+
+            g.setColor(lineColor);
+
+        Stroke originalStroke = g.getStroke();
+        if (this.edge instanceof ControlEdge) {
+            g.setStroke(EdgeGUI.CONTROL_EDGE_STROKE);
+        } 
+        paintLine(point1, point2, g);
+        g.setStroke(originalStroke);
+
+        g.setColor(this.selected ? pointColor : selectedPointColor);
+
+        Point midPoint = getMiddlePosition();
+        g.fillArc(midPoint.x - POINT_SIZE / 2, midPoint.y - POINT_SIZE / 2, POINT_SIZE, POINT_SIZE, 0, 360);
+    }
+
+
+    protected static void paintLine(Point point1, Point point2, Graphics2D g) {
+        int d = 100;
+        int dist = (int) point1.distance(point2);
+        if (dist < d) {
+            d = dist;
+        }
+        CubicCurve2D line = new CubicCurve2D.Double(point1.x, point1.y, point1.x + d, point1.y, point2.x - d, point2.y,
+                point2.x, point2.y);
+        g.draw(line);
+    }
+
+    private Point getFromPosition() {
+        Port port = this.edge.getFromPort();
+        return NodeController.getGUI(port).getPosition();
+    }
+
+    private Point getToPosition() {
+        Port port = this.edge.getToPort();
+        return NodeController.getGUI(port).getPosition();
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvas.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvas.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvas.java
new file mode 100644
index 0000000..de960c2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvas.java
@@ -0,0 +1,1375 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.Stroke;
+import java.awt.datatransfer.Transferable;
+import java.awt.datatransfer.UnsupportedFlavorException;
+import java.awt.dnd.DnDConstants;
+import java.awt.dnd.DropTarget;
+import java.awt.dnd.DropTargetAdapter;
+import java.awt.dnd.DropTargetDropEvent;
+import java.awt.dnd.DropTargetListener;
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseMotionListener;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.JComponent;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.JScrollPane;
+
+import org.apache.airavata.common.utils.SwingUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.component.ComponentReference;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.system.InputComponent;
+import org.apache.airavata.workflow.model.component.system.OutputComponent;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.Edge;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.GraphPiece;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.Port.Kind;
+import org.apache.airavata.workflow.model.graph.dynamic.DynamicNode;
+import org.apache.airavata.workflow.model.graph.dynamic.PortAddable;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.StreamSourceNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentSourceTransferable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+
+/**
+ * A canvas to display a graph (workflow).
+ * 
+ */
+public class GraphCanvas implements XBayaExecutionModeListener{
+
+    private static final Logger logger = LoggerFactory.getLogger(GraphCanvas.class);
+
+    private XBayaEngine engine;
+
+    private JPanel panel;
+
+    private JScrollPane scrollPane;
+
+    private List<GraphCanvasListener> listeners;
+
+    private Workflow workflow;
+
+    private Graph graph;
+
+    private Node selectedNode;
+
+    private Node draggedNode;
+
+    private Port selectedOutputPort;
+
+    private Port selectedInputPort;
+
+    private Edge selectedEdge;
+
+    private Port draggedPort;
+
+    private Dimension graphDimention;
+
+    private JPopupMenu edgePopup;
+
+    private JPopupMenu nodePopup;
+
+    private Point mousePoint;
+
+    private JMenuItem rerunItem;
+
+    private JMenuItem breakPointItem;
+
+    private PortAddable dynamicNodeWithFreePort;
+
+    private File workflowFile;
+    
+    /*
+     * For multiple selection
+     */
+    private boolean crtlPressed;
+
+    private Point mousePointForSelection;
+
+    private List<Node> multipleSelectedNodes;
+
+    private XmlElement originalWorkflowElement;
+    
+    boolean editable=false;
+    /**
+     * Creates a GraphPanel.
+     * 
+     * @param engine
+     *            The XBayaEngine
+     */
+    public GraphCanvas(XBayaEngine engine) {
+
+        this.engine = engine;
+
+        this.listeners = new LinkedList<GraphCanvasListener>();
+
+        // To avoid null check. Do not call newWorkflow() here because something
+        // are not initialized yet at this point.
+        this.workflow = new Workflow();
+        this.graph = this.workflow.getGraph();
+        engine.getConfiguration().registerExecutionModeChangeListener(this);
+        graph.setName(generateNewWorkflowName());
+        initGUI();
+        executionModeChanged(engine.getConfiguration());
+    }
+
+	private String generateNewWorkflowName() {
+		String baseName="Workflow";
+        List<String> existingNames=new ArrayList<String>();
+        if (this.engine.getGUI() != null) {
+            List<GraphCanvas> graphCanvases = this.engine.getGUI().getGraphCanvases();
+            for (GraphCanvas graphCanvas : graphCanvases) {
+                existingNames.add(graphCanvas.getWorkflow().getName());
+            }
+        }
+        int i=1;
+        String newName=baseName+i;
+        while(existingNames.contains(newName)){
+        	i++;
+        	newName=baseName+i;
+        }
+		return newName;
+	}
+
+    /**
+     * @return The panel.
+     */
+    public JComponent getSwingComponent() {
+        return this.scrollPane;
+    }
+
+    /**
+     * @return The workflow
+     */
+    public Workflow getWorkflow() {
+        return this.workflow;
+    }
+
+    /**
+     * Returns the workflow.
+     * 
+     * @return The workflow
+     */
+    public synchronized Workflow getWorkflowWithImage() {
+        BufferedImage image = createImage();
+        this.workflow.setImage(image);
+        return this.workflow;
+    }
+
+    /**
+     * @return the current graph
+     */
+    public synchronized Graph getGraph() {
+        return this.graph;
+    }
+
+    /**
+     * Sets workflow.
+     * 
+     * @param workflow
+     *            The workflow to set.
+     */
+    public synchronized void setWorkflow(Workflow workflow) {
+        reset();
+        this.workflow = workflow;
+        this.graph = this.workflow.getGraph();
+        notifyListeners(new GraphCanvasEvent(GraphCanvasEvent.GraphCanvasEventType.GRAPH_LOADED, this, this.workflow));
+        updateSize();
+        this.panel.repaint();
+        updateOriginalWorkflowElement();
+        executionModeChanged(engine.getConfiguration());
+    }
+
+    /**
+     * Creates a new graph.
+     */
+    public synchronized void newWorkflow() {
+        Workflow newWorkflow = new Workflow();
+        setWorkflow(newWorkflow);
+    }
+
+    /**
+     * @param name
+     * @param description
+     */
+    public void setNameAndDescription(String name, String description) {
+        this.workflow.setName(name);
+        this.workflow.setDescription(description);
+        notifyListeners(new GraphCanvasEvent(GraphCanvasEvent.GraphCanvasEventType.NAME_CHANGED, this, this.workflow));
+    }
+
+    /**
+     * Creates a new Node from a specified Component and adds it.
+     * 
+     * @param component
+     *            The Component to add.
+     * @param location
+     *            The location to add the node.
+     */
+    public synchronized Node addNode(Component component, Point location) {
+        if (component != null) {
+            Node node = this.workflow.addNode(component);
+            node.setPosition(location);
+            selectNode(node);
+            updateSize();
+            this.panel.repaint();
+            return node;
+        }
+        return null;
+    }
+
+    /**
+     * Creates a new Node from a specified Component and adds it.
+     * 
+     * @param component
+     *            The Component to add.
+     */
+    public Node addNode(Component component) {
+        Point location = getRandomPosition();
+        return addNode(component, location);
+    }
+
+    /**
+     * Removes the selected graph piece if any.
+     * 
+     * @throws GraphException
+     */
+    public synchronized void removeSelected() throws GraphException {
+        removeSelectedEdge();
+        removeSelectedNode();
+    }
+
+    /**
+     * Removes the selected Node if any
+     * 
+     * @throws GraphException
+     */
+    public synchronized void removeSelectedNode() throws GraphException {
+        if (this.selectedNode != null) {
+
+            // deselect ports if they belong to this node.
+            if (this.selectedNode.containsPort(this.selectedInputPort)) {
+                deselectInputPort();
+            }
+            if (this.selectedNode.containsPort(this.selectedOutputPort)) {
+                deselectOutputPort();
+            }
+
+            this.workflow.removeNode(this.selectedNode);
+            deselectNode();
+
+            updateSize();
+            this.panel.repaint();
+        }
+
+        /*
+         * Delete multiple nodes as well
+         */
+        if (this.multipleSelectedNodes != null) {
+
+            for (Node node : this.multipleSelectedNodes) {
+                // deselect ports if they belong to this node.
+                if (node.containsPort(this.selectedInputPort)) {
+                    deselectInputPort();
+                }
+                if (node.containsPort(this.selectedOutputPort)) {
+                    deselectOutputPort();
+                }
+
+                this.workflow.removeNode(node);
+            }
+            deselectNode();
+
+            updateSize();
+            this.panel.repaint();
+        }
+    }
+
+    /**
+     * Removes the selected edge if any.
+     */
+    public synchronized void removeSelectedEdge() {
+        try {
+            if (this.selectedEdge != null) {
+                this.graph.removeEdge(this.selectedEdge);
+                deselectEdge();
+                this.panel.repaint();
+            }
+        } catch (GraphException e) {
+            // Should not happen
+            logger.error(e.getMessage(), e);
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+
+        }
+    }
+
+    /**
+     * 
+     */
+    public synchronized void addOrRemoveEdge() {
+
+        try {
+            if (this.selectedEdge != null) {
+                this.graph.removeEdge(this.selectedEdge);
+                deselectEdge();
+
+            } else if ((this.selectedOutputPort != null) && (this.selectedInputPort != null)) {
+
+                if (this.graph.containsEdge(this.selectedOutputPort, this.selectedInputPort)) {
+                    // If both ports are selected and they are connected
+                    // already, the edge will be deleted.
+                    this.graph.removeEdge(this.selectedOutputPort, this.selectedInputPort);
+                    deselectEdge();
+
+                } else {
+                    // Create a new edge
+                    connect(this.selectedOutputPort, this.selectedInputPort);
+                }
+            }
+            this.panel.repaint();
+        } catch (GraphException e) {
+            // Should not happen
+            logger.error(e.getMessage(), e);
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        } catch (Error e) {
+            logger.error(e.getMessage(), e);
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+
+        }
+    }
+
+    /**
+     * Returns the selectedNode.
+     * 
+     * @return The selectedNode
+     */
+    public Node getSelectedNode() {
+        return this.selectedNode;
+    }
+
+    /**
+     * Returns the selectedInputPort.
+     * 
+     * @return The selectedInputPort
+     */
+    public Port getSelectedInputPort() {
+        return this.selectedInputPort;
+    }
+
+    /**
+     * Returns the selectedOutputPort.
+     * 
+     * @return The selectedOutputPort
+     */
+    public Port getSelectedOutputPort() {
+        return this.selectedOutputPort;
+    }
+
+    /**
+     * Repaints the panel.
+     */
+    public void repaint() {
+        this.panel.repaint();
+    }
+
+    /**
+     * @param listener
+     */
+    public synchronized void addGraphCanvasListener(GraphCanvasListener listener) {
+        this.listeners.add(listener);
+    }
+
+    /**
+     * @param listener
+     */
+    public synchronized void removeGraphCanvasListener(GraphCanvasListener listener) {
+        this.listeners.remove(listener);
+    }
+
+    private void mouseClicked(MouseEvent event) {
+        /*
+         * If there is multi-selected and a click on a node, switch to that node or deselect node if it is already
+         * selected
+         */
+        Point point = event.getPoint();
+        GraphPiece clicked = NodeController.getGUI(this.graph).getGraphPieceAt(point);
+        if ((clicked instanceof Node) && this.multipleSelectedNodes != null) {
+            Node node = (Node) clicked;
+            if (!this.crtlPressed) {
+                selectNode(node);
+            }
+            return;
+        }else if ((clicked instanceof Port) && event.getClickCount()==2){
+        	//double click to add Input/Output nodes and connect with them when a DataPort is double clicked
+        	Port port=(Port)clicked;
+        	Point pos = port.getNode().getPosition();
+        	Node node=null;
+        	int xgap = (int)(1.5 * NodeGUI.MINIMUM_WIDTH);
+        	int ygap = (int)(NodeGUI.MINIMUM_HEIGHT/2);
+        	Point nodePos = null;
+			switch (port.getKind()){
+        	case DATA_IN:
+        		if (port.getFromNode()==null) {
+					nodePos = new Point(Math.max(0, pos.x - xgap), Math.max(0, pos.y - ygap));
+					node = addNode(new InputComponent(), nodePos);
+					connect(node.getOutputPorts().get(0), port);
+				}
+				break;
+        	case DATA_OUT:
+				nodePos = new Point(pos.x + NodeGUI.MINIMUM_WIDTH + xgap, pos.y + ygap);
+				node = addNode(new OutputComponent(), nodePos);
+				connect(port, node.getInputPorts().get(0));
+				break;
+        		default:
+        	}
+        }
+
+        // delegate the event.
+        NodeController.getGUI(this.graph).mouseClicked(event, this.engine);
+    }
+
+    private void mousePressed(MouseEvent event) {
+        Point point = event.getPoint();
+
+        // Get focus to handle key board events
+        this.panel.requestFocusInWindow();
+
+        // Get select item
+        GraphPiece selected = NodeController.getGUI(this.graph).getGraphPieceAt(point);
+
+        /*
+         * Doing Nothing if pressed is on the selected node
+         */
+        if (this.multipleSelectedNodes != null) {
+            maybeShowPopup(event);
+            if (this.crtlPressed && this.multipleSelectedNodes.contains(selected)) {
+                deselectNode((Node) selected);
+                return;
+            } else if (this.multipleSelectedNodes.contains(selected)) {
+                this.mousePoint = point;
+                this.panel.setCursor(SwingUtil.MOVE_CURSOR);
+                return;
+            } else if ((selected instanceof Node) && this.crtlPressed) {
+                this.mousePoint = point;
+                this.multipleSelectedNodes.add((Node) selected);
+                this.panel.setCursor(SwingUtil.MOVE_CURSOR);
+                selectNodes(this.multipleSelectedNodes);
+                return;
+            }
+        }
+        // control selection
+        if ((selected instanceof Node) && this.crtlPressed) {
+            this.multipleSelectedNodes = new ArrayList<Node>();
+            if (this.selectedNode != null) {
+                this.multipleSelectedNodes.add(this.selectedNode);
+            }
+            this.multipleSelectedNodes.add((Node) selected);
+            this.panel.setCursor(SwingUtil.MOVE_CURSOR);
+            selectNodes(this.multipleSelectedNodes);
+            return;
+        }
+
+        deselectNode();
+        deselectEdge();
+
+        if (selected instanceof Node) {
+            Node node = (Node) selected;
+            selectNode(node);
+            if (!NodeController.getGUI(node).isInConfig(point)) {
+                this.draggedNode = node;
+                NodeController.getGUI(node).setDraggedFlag(true);
+                this.panel.setCursor(SwingUtil.MOVE_CURSOR);
+            }
+
+        } else if (selected instanceof Port) {
+            Port port = (Port) selected;
+            NodeController.getGUI(port).setSelectedFlag(true);
+            switch (port.getKind()) {
+            case DATA_IN:
+            case CONTROL_IN:
+                selectInputPort(port);
+                break;
+            case CONTROL_OUT:
+            case DATA_OUT:
+            case EPR:
+                selectOutputPort(port);
+                break;
+            }
+
+            this.draggedPort = port;
+
+        } else if (selected instanceof Edge) {
+            Edge edge = (Edge) selected;
+            selectEdge(edge);
+        } else {
+            /*
+             * If nothing is selected
+             */
+            this.mousePointForSelection = event.getPoint();
+        }
+
+        maybeShowPopup(event);
+
+        this.mousePoint = point;
+        this.panel.repaint();
+        event.consume();
+    }
+
+    private void mouseReleased(MouseEvent event) {
+        Point point = event.getPoint();
+        if (this.draggedNode != null) {
+            NodeController.getGUI(this.draggedNode).setDraggedFlag(false);
+            this.panel.setCursor(SwingUtil.DEFAULT_CURSOR);
+
+            // Check if it s stream grouping
+            if (draggedNode instanceof InputNode) {
+                StreamSourceNode streamNode = NodeController.getGUI(this.graph).getStreamSourceAt(point);
+                if (streamNode != null) {
+                    streamNode.addInputNode((InputNode) draggedNode);
+                }
+
+            }
+            this.draggedNode = null;
+
+        }
+
+        if (this.draggedPort != null) {
+            GraphPiece graphPiece = NodeController.getGUI(this.graph).getGraphPieceAt(point);
+            if (graphPiece instanceof DynamicNode) {
+                if (this.draggedPort.getKind() == Kind.DATA_OUT && draggedPort instanceof DataPort) {
+                    this.panel.setCursor(SwingUtil.CROSSHAIR_CURSOR);
+                    DynamicNode dynamicNode = (DynamicNode) graphPiece;
+                    dynamicNode.getComponent();
+                    DataPort freePort = dynamicNode.getFreeInPort();
+                    try {
+                        freePort.copyType((DataPort) draggedPort);
+                    } catch (GraphException e) {
+                        engine.getGUI().getErrorWindow().error(e);
+                        return;
+                    }
+                    // selectInputPort(freePort);
+                    connect(this.draggedPort, freePort);
+                    this.dynamicNodeWithFreePort = null;
+                }
+
+            } else if (graphPiece instanceof Port) {
+                Port port = (Port) graphPiece;
+                if (this.draggedPort.getKind() == Kind.DATA_OUT && port.getKind() == Kind.DATA_IN) {
+                    connect(this.draggedPort, port);
+                } else if (port.getKind() == Kind.DATA_OUT && this.draggedPort.getKind() == Kind.DATA_IN) {
+                    connect(port, this.draggedPort);
+                } else if (this.draggedPort.getKind() == Kind.CONTROL_OUT && port.getKind() == Kind.CONTROL_IN) {
+                    connect(this.draggedPort, port);
+                } else if (this.draggedPort.getKind() == Kind.CONTROL_IN && port.getKind() == Kind.CONTROL_OUT) {
+                    connect(port, this.draggedPort);
+                } else if (this.draggedPort.getKind() == Kind.EPR && port.getKind() == Kind.DATA_IN) {
+                    connect(this.draggedPort, port);
+                } else if (this.draggedPort.getKind() == Kind.DATA_IN && port.getKind() == Kind.EPR) {
+                    connect(port, this.draggedPort);
+                }
+            }
+            this.draggedPort = null;
+        }
+
+        if (this.dynamicNodeWithFreePort != null) {
+            try {
+                this.dynamicNodeWithFreePort.removeLastDynamicallyAddedInPort();
+            } catch (GraphException e) {
+                this.engine.getGUI().getErrorWindow().error(e);
+            }
+        }
+
+        /*
+         * Multiple selected
+         */
+        if (this.mousePointForSelection != null) {
+            double width = Math.abs(this.mousePoint.getX() - this.mousePointForSelection.getX());
+            double height = Math.abs(this.mousePoint.getY() - this.mousePointForSelection.getY());
+            int x = (int) (this.mousePoint.getX() > this.mousePointForSelection.getX() ? this.mousePointForSelection
+                    .getX() : this.mousePoint.getX());
+            int y = (int) (this.mousePoint.getY() > this.mousePointForSelection.getY() ? this.mousePointForSelection
+                    .getY() : this.mousePoint.getY());
+
+            this.multipleSelectedNodes = NodeController.getGUI(this.graph).getNodesIn(new Rectangle(x, y, (int) width, (int) height));
+            selectNodes(this.multipleSelectedNodes);
+
+            // clear mousepoint
+            this.mousePointForSelection = null;
+        }
+
+        if (this.multipleSelectedNodes != null) {
+            this.panel.setCursor(SwingUtil.DEFAULT_CURSOR);
+        }
+
+        maybeShowPopup(event);
+
+        updateSize();
+        this.panel.repaint();
+        event.consume();
+    }
+
+    private void mouseDragged(MouseEvent event) {
+        Point point = event.getPoint();
+
+        if (editable) {
+			/*
+			 * Move nodes
+			 */
+			if (this.multipleSelectedNodes != null) {
+				if (point.x < 0) {
+					point.x = 0;
+				}
+				if (point.y < 0) {
+					point.y = 0;
+				}
+				int diffX = point.x - this.mousePoint.x;
+				int diffY = point.y - this.mousePoint.y;
+				for (Node node : this.multipleSelectedNodes) {
+					Point newPoint = new Point();
+					Point currentPoint = node.getPosition();
+					newPoint.x = currentPoint.x + diffX;
+					if (newPoint.x < 0) {
+						newPoint.x = 0;
+					}
+					newPoint.y = currentPoint.y + diffY;
+					if (newPoint.y < 0) {
+						newPoint.y = 0;
+					}
+					node.setPosition(newPoint);
+				}
+				this.panel.repaint();
+				event.consume();
+			}
+			if (this.draggedNode != null) {
+				if (point.x < 0) {
+					point.x = 0;
+				}
+				if (point.y < 0) {
+					point.y = 0;
+				}
+				int diffX = point.x - this.mousePoint.x;
+				int diffY = point.y - this.mousePoint.y;
+				Point newPoint = new Point();
+				Point currentPoint = this.draggedNode.getPosition();
+				newPoint.x = currentPoint.x + diffX;
+				if (newPoint.x < 0) {
+					newPoint.x = 0;
+				}
+				newPoint.y = currentPoint.y + diffY;
+				if (newPoint.y < 0) {
+					newPoint.y = 0;
+				}
+				this.draggedNode.setPosition(newPoint);
+
+				this.panel.repaint();
+				event.consume();
+			}
+			if (this.draggedPort != null) {
+				GraphPiece piece = NodeController.getGUI(this.graph).getGraphPieceAt(point);
+				if (piece instanceof Port) {
+					Port port = (Port) piece;
+					// Display the information of port that is close to the mouse
+					// pointer.
+					if (this.draggedPort.getKind() == Kind.DATA_IN
+							&& port.getKind() == Kind.DATA_OUT) {
+						this.panel.setCursor(SwingUtil.CROSSHAIR_CURSOR);
+						selectOutputPort(port);
+					} else if (this.draggedPort.getKind() == Kind.DATA_OUT
+							&& port.getKind() == Kind.DATA_IN) {
+						this.panel.setCursor(SwingUtil.CROSSHAIR_CURSOR);
+						selectInputPort(port);
+					} else if (this.draggedPort.getKind() == Kind.DATA_IN
+							&& port.getKind() == Kind.EPR) {
+						this.panel.setCursor(SwingUtil.CROSSHAIR_CURSOR);
+						selectOutputPort(port);
+					} else if (this.draggedPort.getKind() == Kind.EPR
+							&& port.getKind() == Kind.DATA_IN) {
+						this.panel.setCursor(SwingUtil.CROSSHAIR_CURSOR);
+						selectInputPort(port);
+					} else {
+						this.panel.setCursor(SwingUtil.DEFAULT_CURSOR);
+					}
+				} else if (piece instanceof PortAddable) {
+					PortAddable dynamicNode = (PortAddable) piece;
+					dynamicNode.getFreeInPort();
+					this.dynamicNodeWithFreePort = dynamicNode;
+				} else {
+
+					this.panel.setCursor(SwingUtil.DEFAULT_CURSOR);
+				}
+
+				this.panel.repaint();
+				event.consume();
+			}
+			this.mousePoint = point;
+			// draw rectangle
+			if (this.mousePointForSelection != null) {
+				this.panel.repaint();
+			}
+		}
+
+    }
+
+    private void mouseMoved(MouseEvent event) {
+        Point point = event.getPoint();
+        GraphPiece graphPiece = NodeController.getGUI(this.graph).getGraphPieceAt(point);
+        if (graphPiece instanceof Node) {
+            Node node = (Node) graphPiece;
+            if (NodeController.getGUI(node).isInConfig(point)) {
+                this.panel.setCursor(SwingUtil.HAND_CURSOR);
+            } else {
+                this.panel.setCursor(SwingUtil.DEFAULT_CURSOR);
+            }
+        } else if (graphPiece instanceof Port) {
+            this.panel.setCursor(SwingUtil.CROSSHAIR_CURSOR);
+        } else {
+            this.panel.setCursor(SwingUtil.DEFAULT_CURSOR);
+        }
+
+    }
+
+    private void keyPressed(KeyEvent event) {
+        int keyCode = event.getKeyCode();
+        if (editable && keyCode == KeyEvent.VK_DELETE) {
+            try {
+                removeSelected();
+            } catch (GraphException e) {
+                // Should not happen
+                logger.error(e.getMessage(), e);
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (RuntimeException e) {
+                logger.error(e.getMessage(), e);
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Error e) {
+                logger.error(e.getMessage(), e);
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            }
+        }
+
+        /*
+         * Multiple select with shift
+         */
+        if (keyCode == KeyEvent.VK_CONTROL) {
+            this.crtlPressed = true;
+        }
+    }
+
+    private void keyReleased(KeyEvent event) {
+        int keyCode = event.getKeyCode();
+
+        if (keyCode == KeyEvent.VK_CONTROL) {
+            this.crtlPressed = false;
+        }
+    }
+
+    private void drop(final DropTargetDropEvent event) {
+        logger.debug("Event:" + event);
+        Transferable transferable = event.getTransferable();
+        try {
+            // Cannot cast transferable.
+            final ComponentReference componentReference = (ComponentReference) transferable
+                    .getTransferData(ComponentSourceTransferable.FLAVOR);
+            final Point location = event.getLocation();
+
+            // The component might not have loaded if the network is slow.
+            new Thread() {
+                @Override
+                public void run() {
+                    try {
+                        Component component = componentReference.getComponent();
+                        addNode(component, location);
+                        // To be able to delete the added node by the keyboard.
+                        GraphCanvas.this.panel.requestFocusInWindow();
+                        // XXX this sometimes throws exception.
+                        event.dropComplete(true);
+                    } catch (ComponentException e) {
+                        // If there is any error, the component tree viewer
+                        // shows the error dialog.
+                        logger.error(e.getMessage(), e);
+                        event.dropComplete(false);
+                    } catch (ComponentRegistryException e) {
+                        logger.error(e.getMessage(), e);
+                        event.dropComplete(false);
+                    }
+                }
+            }.start();
+
+        } catch (UnsupportedFlavorException e) {
+            // Should not happen.
+            logger.error(e.getMessage(), e);
+        } catch (IOException e) {
+            // Should not happen.
+            logger.error(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * @return The image
+     */
+    private BufferedImage createImage() {
+        Rectangle bounds = NodeController.getGUI(this.graph).getBounds();
+        BufferedImage image = new BufferedImage(bounds.width, bounds.height, BufferedImage.TYPE_INT_ARGB);
+        Graphics2D graphics = image.createGraphics();
+
+        // Background
+        final Color background = new Color(226, 226, 222);
+        graphics.setBackground(background);
+        graphics.clearRect(0, 0, bounds.width, bounds.height);
+
+        paintComponent(graphics);
+
+        return image;
+    }
+
+    /**
+     * Connects two ports specified.
+     * 
+     * @param fromPort
+     * @param toPort
+     */
+    private void connect(Port fromPort, Port toPort) {
+        try {
+            // check the validity of the connection.
+            Edge edge = this.graph.addEdge(fromPort, toPort);
+            selectEdge(edge);
+        } catch (GraphException e) {
+            logger.error(e.getMessage(), e);
+            this.engine.getGUI().getErrorWindow().warning(e.getMessage());
+        } catch (RuntimeException e) {
+            logger.error(e.getMessage(), e);
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR);
+        }
+    }
+
+    private void paintComponent(Graphics2D g) {
+        NodeController.getGUI(this.graph).paint(g);
+
+        // Draws a creating edge.
+        if (this.draggedPort != null) {
+            Point p1, p2;
+            Kind kind = this.draggedPort.getKind();
+            if (kind == Kind.DATA_OUT || kind == Kind.CONTROL_OUT || kind == Kind.EPR) {
+                p1 = NodeController.getGUI(this.draggedPort).getPosition();
+                p2 = this.mousePoint;
+            } else if (kind == Kind.DATA_IN || kind == Kind.CONTROL_IN) {
+                p1 = this.mousePoint;
+                p2 = NodeController.getGUI(this.draggedPort).getPosition();
+            } else {
+                // This should not happen.
+                throw new WorkflowRuntimeException();
+            }
+            g.setColor(Color.RED);
+
+            Stroke originalStroke = g.getStroke();
+            if (kind == Kind.CONTROL_IN || kind == Kind.CONTROL_OUT) {
+                g.setStroke(EdgeGUI.CONTROL_EDGE_STROKE);
+            }
+            EdgeGUI.paintLine(p1, p2, g);
+            g.setStroke(originalStroke);
+
+        }
+
+        // Draw rectangular for selection
+        if (this.mousePointForSelection != null) {
+            double width = Math.abs(this.mousePoint.getX() - this.mousePointForSelection.getX());
+            double height = Math.abs(this.mousePoint.getY() - this.mousePointForSelection.getY());
+            int x = (int) (this.mousePoint.getX() > this.mousePointForSelection.getX() ? this.mousePointForSelection
+                    .getX() : this.mousePoint.getX());
+            int y = (int) (this.mousePoint.getY() > this.mousePointForSelection.getY() ? this.mousePointForSelection
+                    .getY() : this.mousePoint.getY());
+            g.setColor(Color.RED);
+            g.setStroke(new BasicStroke(1.0f, BasicStroke.CAP_ROUND, // End cap
+                                                                     // style
+                    BasicStroke.JOIN_MITER, // Join style
+                    15.0f, // Miter limit
+                    new float[] { 5.0f, 5.0f }, // Dash pattern
+                    3.0f)); // Dash phase
+            g.drawRect(x, y, (int) width, (int) height);
+        }
+    }
+
+    /**
+     * Gets an random position of for a new node. This method is called when a new node is added to the graph.
+     * 
+     * @return The position
+     */
+    private Point getRandomPosition() {
+        Rectangle area = this.panel.getVisibleRect();
+        int x = (int) (area.x + (area.width - NodeGUI.MINIMUM_WIDTH) * Math.random());
+        int y = (int) (area.y + (area.height - NodeGUI.MINIMUM_HEIGHT) * Math.random());
+        return new Point(x, y);
+    }
+
+    /**
+     * Updates the size of this Panel.
+     */
+    private void updateSize() {
+
+        Rectangle bounds = NodeController.getGUI(this.graph).getBounds();
+        Dimension newDimention = new Dimension(bounds.width, bounds.height);
+
+        if (!newDimention.equals(this.graphDimention)) {
+
+            // Updates this Panel's preferred size because the area taken up by
+            // the graph has changed.
+            this.panel.setPreferredSize(newDimention);
+
+            // Let the scroll pane know to update itself and its scrollbars.
+            this.panel.revalidate();
+
+            this.graphDimention = newDimention;
+        }
+    }
+
+    /**
+     * Sets the selected node.
+     * 
+     * Use this method to send the event to the listeners.
+     * 
+     * @param node
+     */
+    private void setSelectedNode(Node node) {
+        this.selectedNode = node;
+        notifyListeners(new GraphCanvasEvent(GraphCanvasEvent.GraphCanvasEventType.NODE_SELECTED, this, this.workflow));
+    }
+
+    /**
+     * Selects a node. The selected node changes its color.
+     * 
+     * @param node
+     *            The node to select.
+     */
+    private void selectNode(Node node) {
+        deselectNode();
+        NodeController.getGUI(node).setSelectedFlag(true);
+        setSelectedNode(node);
+    }
+
+    private void selectNodes(List<Node> nodes) {
+        deselectNode();
+        for (Node node : nodes) {
+            NodeController.getGUI(node).setSelectedFlag(true);
+            NodeController.getGUI(node).setDraggedFlag(true);
+        }
+        this.multipleSelectedNodes = nodes;
+        notifyListeners(new GraphCanvasEvent(GraphCanvasEvent.GraphCanvasEventType.NODE_SELECTED, this, this.workflow));
+    }
+
+    /**
+     * Deselects a node that is currently selected if any.
+     */
+    private void deselectNode() {
+        if (this.selectedNode != null) {
+            NodeController.getGUI(this.selectedNode).setSelectedFlag(false);
+            NodeController.getGUI(this.selectedNode).setDraggedFlag(false);
+            setSelectedNode(null);
+        }
+        if (this.multipleSelectedNodes != null) {
+            for (Node node : this.multipleSelectedNodes) {
+                NodeController.getGUI(node).setSelectedFlag(false);
+                NodeController.getGUI(node).setDraggedFlag(false);
+            }
+            this.multipleSelectedNodes = null;
+        }
+    }
+
+    private void deselectNode(Node node) {
+        if (this.multipleSelectedNodes != null && this.multipleSelectedNodes.contains(node)) {
+            NodeController.getGUI(node).setSelectedFlag(false);
+            NodeController.getGUI(node).setDraggedFlag(false);
+            this.multipleSelectedNodes.remove(node);
+        }
+    }
+
+    private void setSelectedInputPort(Port port) {
+        this.selectedInputPort = port;
+        notifyListeners(new GraphCanvasEvent(GraphCanvasEvent.GraphCanvasEventType.INPUT_PORT_SELECTED, this,
+                this.workflow));
+    }
+
+    private void selectInputPort(Port port) {
+        deselectInputPort();
+        NodeController.getGUI(port).setSelectedFlag(true);
+        setSelectedInputPort(port);
+    }
+
+    private void deselectInputPort() {
+        if (this.selectedInputPort != null) {
+        	NodeController.getGUI(this.selectedInputPort).setSelectedFlag(false);
+            setSelectedInputPort(null);
+        }
+    }
+
+    private void setSelectedOutputPort(Port port) {
+        this.selectedOutputPort = port;
+        notifyListeners(new GraphCanvasEvent(GraphCanvasEvent.GraphCanvasEventType.OUTPUT_PORT_SELECTED, this,
+                this.workflow));
+    }
+
+    private void selectOutputPort(Port port) {
+        deselectOutputPort();
+        NodeController.getGUI(port).setSelectedFlag(true);
+        setSelectedOutputPort(port);
+    }
+
+    private void deselectOutputPort() {
+        if (this.selectedOutputPort != null) {
+        	NodeController.getGUI(this.selectedOutputPort).setSelectedFlag(false);
+            setSelectedOutputPort(null);
+        }
+    }
+
+    private void selectEdge(Edge edge) {
+        if (edge != null) {
+            deselectEdge();
+            NodeController.getGUI(edge).setSelectedFlag(true);
+            this.selectedEdge = edge;
+
+            // When an edge is selected, ports on both sides will be selected
+            // too.
+            selectOutputPort(edge.getFromPort());
+            selectInputPort(edge.getToPort());
+        }
+    }
+
+    private void deselectEdge() {
+        if (this.selectedEdge != null) {
+        	NodeController.getGUI(this.selectedEdge).setSelectedFlag(false);
+            this.selectedEdge = null;
+        }
+    }
+
+    private void reset() {
+        setSelectedNode(null);
+        this.draggedNode = null;
+        setSelectedInputPort(null);
+        setSelectedOutputPort(null);
+        this.selectedEdge = null;
+        this.multipleSelectedNodes = null;
+    }
+
+    private void notifyListeners(GraphCanvasEvent event) {
+        for (GraphCanvasListener listener : this.listeners) {
+            listener.graphCanvasChanged(event);
+        }
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGUI() {
+        this.panel = new JPanel() {
+            @Override
+            protected void paintComponent(Graphics g) {
+                super.paintComponent(g);
+                GraphCanvas.this.paintComponent((Graphics2D) g);
+            }
+        };
+
+        this.panel.setLayout(null);
+        this.panel.setOpaque(true); // To make the background color visible.
+        this.panel.setBackground(new Color(255, 255, 255));
+        this.panel.setDoubleBuffered(true);
+
+        this.panel.addMouseListener(new MouseAdapter() {
+
+            @Override
+            public void mouseClicked(MouseEvent event) {
+                GraphCanvas.this.mouseClicked(event);
+            }
+
+            @Override
+            public void mousePressed(MouseEvent event) {
+                GraphCanvas.this.mousePressed(event);
+            }
+
+            @Override
+            public void mouseReleased(MouseEvent event) {
+                GraphCanvas.this.mouseReleased(event);
+                notifyListeners(new GraphCanvasEvent(GraphCanvasEvent.GraphCanvasEventType.WORKFLOW_CHANGED, GraphCanvas.this, GraphCanvas.this.workflow));
+            }
+        });
+
+        this.panel.addMouseMotionListener(new MouseMotionListener() {
+
+            public void mouseDragged(MouseEvent event) {
+                GraphCanvas.this.mouseDragged(event);
+            }
+
+            public void mouseMoved(MouseEvent event) {
+                GraphCanvas.this.mouseMoved(event);
+            }
+        });
+
+        this.panel.addKeyListener(new KeyAdapter() {
+            @Override
+            public void keyPressed(KeyEvent event) {
+                GraphCanvas.this.keyPressed(event);
+            }
+
+            @Override
+            public void keyReleased(KeyEvent event) {
+                GraphCanvas.this.keyReleased(event);
+            }
+
+        });
+
+        this.scrollPane = new JScrollPane(this.panel);
+
+        // Set up drag and drop
+        DropTargetListener dropTargetListener = new DropTargetAdapter() {
+            public void drop(DropTargetDropEvent event) {
+                GraphCanvas.this.drop(event);
+            }
+        };
+        new DropTarget(this.panel, DnDConstants.ACTION_COPY_OR_MOVE, dropTargetListener);
+
+        createPopupMenu();
+    }
+
+    private void createPopupMenu() {
+        createEdgePopupMenu();
+        createNodePopupMenu();
+    }
+
+    private void createNodePopupMenu() {
+        this.nodePopup = new JPopupMenu();
+        if (editable) {
+			JMenuItem deleteItem = new JMenuItem("Delete");
+			deleteItem.addActionListener(new AbstractAction() {
+				public void actionPerformed(ActionEvent event) {
+					try {
+						removeSelectedNode();
+					} catch (GraphException e) {
+						// Should not happen
+						logger.error(e.getMessage(), e);
+						GraphCanvas.this.engine.getGUI().getErrorWindow()
+								.error(ErrorMessages.UNEXPECTED_ERROR, e);
+					} catch (RuntimeException e) {
+						logger.error(e.getMessage(), e);
+						GraphCanvas.this.engine.getGUI().getErrorWindow()
+								.error(ErrorMessages.UNEXPECTED_ERROR, e);
+					} catch (Error e) {
+						logger.error(e.getMessage(), e);
+						GraphCanvas.this.engine.getGUI().getErrorWindow()
+								.error(ErrorMessages.UNEXPECTED_ERROR, e);
+					}
+
+				}
+			});
+			this.nodePopup.add(deleteItem);
+		}
+		rerunItem = new JMenuItem("ReRun");
+        rerunItem.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent event) {
+                try {
+                    rerunSelectedNode();
+                } catch (RuntimeException e) {
+                    logger.error(e.getMessage(), e);
+                    GraphCanvas.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                } catch (Error e) {
+                    logger.error(e.getMessage(), e);
+                    GraphCanvas.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                }
+
+            }
+        });
+
+        breakPointItem = new JMenuItem("Add break Point");
+        breakPointItem.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent event) {
+                try {
+                    toggleBreakPointToNode();
+                } catch (RuntimeException e) {
+                    logger.error(e.getMessage(), e);
+                    GraphCanvas.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                } catch (Error e) {
+                    logger.error(e.getMessage(), e);
+                    GraphCanvas.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                }
+
+            }
+        });
+  
+
+    }
+
+    private synchronized void toggleBreakPointToNode() {
+        if (this.selectedNode != null) {
+            this.selectedNode.setBreak(!this.selectedNode.isBreak());
+            this.repaint();
+        }
+    }
+
+    private void rerunSelectedNode() {
+        if (this.selectedNode != null) {
+
+            ArrayList<Node> exploreNodes = new ArrayList<Node>();
+            exploreNodes.add(this.selectedNode);
+            while (exploreNodes.size() != 0) {
+                Node node = exploreNodes.get(0);
+                List<DataPort> outputPorts = node.getOutputPorts();
+                for (DataPort dataPort : outputPorts) {
+                    exploreNodes.addAll(dataPort.getToNodes());
+                }
+                node.setState(NodeExecutionState.WAITING);
+
+                exploreNodes.remove(0);
+            }
+            this.repaint();
+        }
+    }
+
+    private void prepareNodePopupMenu(Node node) {
+        this.nodePopup.remove(rerunItem);
+        this.nodePopup.remove(breakPointItem);
+
+        if (this.engine.getGUI().getWorkflow().getExecutionState() == WorkflowExecutionState.PAUSED && !(node instanceof InputNode)) {
+            this.nodePopup.add(rerunItem);
+
+        }
+        if (this.engine.getGUI().getWorkflow().getExecutionState() != WorkflowExecutionState.NONE) {
+            if (node.isBreak()) {
+                breakPointItem.setText("Remove break Point");
+            } else {
+                breakPointItem.setText("Add break Point");
+            }
+            this.nodePopup.add(breakPointItem);
+        }
+       
+    }
+
+    private void createEdgePopupMenu() {
+        this.edgePopup = new JPopupMenu();
+        if (editable) {
+			JMenuItem deleteItem = new JMenuItem("Delete");
+			deleteItem.addActionListener(new AbstractAction() {
+				private static final long serialVersionUID = 1L;
+
+				public void actionPerformed(ActionEvent e) {
+					removeSelectedEdge();
+				}
+			});
+			this.edgePopup.add(deleteItem);
+		}
+    }
+
+    private void maybeShowPopup(MouseEvent event) {
+        if (event.isPopupTrigger()) {
+            GraphPiece piece = NodeController.getGUI(this.graph).getGraphPieceAt(event.getPoint());
+            if (piece instanceof Node) {
+                prepareNodePopupMenu((Node) piece);
+                this.nodePopup.show(event.getComponent(), event.getX(), event.getY());
+            } else if (piece instanceof Edge) {
+                this.edgePopup.show(event.getComponent(), event.getX(), event.getY());
+            }
+        }
+    }
+
+
+	public File getWorkflowFile() {
+		return workflowFile;
+	}
+
+	public void setWorkflowFile(File workflowFile) {
+		this.workflowFile = workflowFile;
+	}
+	
+	public boolean isWorkflowChanged(){
+		try {
+			if (originalWorkflowElement==null){
+				updateOriginalWorkflowElement();
+			}
+			return !XMLUtil.isEqual(originalWorkflowElement, getWorkflow().toXML());
+		} catch (Exception e) {
+			e.printStackTrace();
+			return true;
+		}
+	}
+	
+	public void workflowSaved(){
+		updateOriginalWorkflowElement();
+        notifyListeners(new GraphCanvasEvent(GraphCanvasEvent.GraphCanvasEventType.WORKFLOW_CHANGED, this, this.workflow));
+	}
+
+	private void updateOriginalWorkflowElement() {
+		originalWorkflowElement = getWorkflow().toXML();
+	}
+
+	@Override
+	public void executionModeChanged(XBayaConfiguration config) {
+		editable=config.getXbayaExecutionMode()==XBayaExecutionMode.IDE;
+		getGraph().setEditable(editable);
+		this.workflow.setEditable(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvasEvent.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvasEvent.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvasEvent.java
new file mode 100644
index 0000000..1d96da3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvasEvent.java
@@ -0,0 +1,99 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph;
+
+import org.apache.airavata.workflow.model.wf.Workflow;
+
+public class GraphCanvasEvent {
+
+    /**
+     * The type of an event.
+     */
+    public enum GraphCanvasEventType {
+        /**
+         * A graph was loaded.
+         */
+        GRAPH_LOADED,
+        /**
+         * The name or the description of the workflow has changed.
+         */
+        NAME_CHANGED,
+        /**
+         * A node is selected.
+         */
+        NODE_SELECTED,
+        /**
+         * An input port is selected.
+         */
+        INPUT_PORT_SELECTED,
+        /**
+         * An output port is selected.
+         */
+        OUTPUT_PORT_SELECTED,
+        
+        /**
+         * Event when the workflow was changed
+         */
+        WORKFLOW_CHANGED
+    }
+
+    private GraphCanvasEventType type;
+
+    private GraphCanvas graphCanvas;
+
+    private Workflow workflow;
+
+    /**
+     * Constructs a GraphPanelEvent.
+     * 
+     * @param type
+     * @param canvas
+     * @param workflow
+     */
+    public GraphCanvasEvent(GraphCanvasEventType type, GraphCanvas canvas, Workflow workflow) {
+        this.type = type;
+        this.graphCanvas = canvas;
+        this.workflow = workflow;
+    }
+
+    /**
+     * @return The type of the event
+     */
+    public GraphCanvasEventType getType() {
+        return this.type;
+    }
+
+    /**
+     * @return The graph panel
+     */
+    public GraphCanvas getGraphCanvas() {
+        return this.graphCanvas;
+    }
+
+    /**
+     * @return The graph
+     */
+    public Workflow getWorkflow() {
+        return this.workflow;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvasListener.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvasListener.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvasListener.java
new file mode 100644
index 0000000..b9168fb
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/graph/GraphCanvasListener.java
@@ -0,0 +1,32 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.graph;
+
+public interface GraphCanvasListener {
+
+    /**
+     * Called when a graph changes
+     * 
+     * @param event
+     */
+    public void graphCanvasChanged(GraphCanvasEvent event);
+}
\ No newline at end of file


[85/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
new file mode 100644
index 0000000..9ddadb3
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/subscription/SubscriptionState.java
@@ -0,0 +1,301 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.subscription;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+import org.apache.airavata.wsmg.commons.util.OMElementComparator;
+import org.apache.airavata.wsmg.messenger.OutGoingQueue;
+import org.apache.airavata.wsmg.util.BrokerUtil;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.addressing.EndpointReference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class SubscriptionState {
+
+    private final Logger logger = LoggerFactory.getLogger(SubscriptionState.class);
+
+    private long creationTime = 0;
+    private long lastAvailableTime = 0;
+
+    private int unAvailableCounter = 0;
+    private boolean isNeverExpire = false;
+    private boolean isWsrmPolicy;
+
+    public String subId;
+    public String curNotif;
+    private String localTopicString;
+    private String xpathString;
+    private String subscribeXml;
+
+    ConsumerInfo consumerInfo = null;
+
+    EndpointReference consumerReference;
+
+    URI consumerURI = null;
+
+    private OutGoingQueue outGoingQueue;
+
+    /**
+     * @return Returns the creationTime.
+     */
+    public long getCreationTime() {
+        return creationTime;
+    }
+
+    /**
+     * @param creationTime
+     *            The creationTime to set.
+     */
+    public void setCreationTime(long creationTime) {
+        this.creationTime = creationTime;
+    }
+
+    public void setId(String id) {
+        subId = id;
+    }
+
+    public String getId() {
+        return subId;
+    }
+
+    public boolean isWsrmPolicy() {
+        return isWsrmPolicy;
+    }
+
+    public void setWsrmPolicy(boolean wsrmPolicy) {
+        this.isWsrmPolicy = wsrmPolicy;
+    }
+
+    // TODO: outGoingQueue is not belong to this class. Move it to elsewhere
+    // related to notification handler in wsntAdapter.
+    public SubscriptionState(EndpointReference consumerRef, boolean useNotify, boolean wsrmEnabled, String topic,
+            String xpath, String type, OutGoingQueue outGoingQueue) {
+        this.consumerReference = consumerRef;
+        try {
+            this.consumerURI = new URI(consumerRef.getAddress());
+        } catch (URISyntaxException e) {
+            // this should not happen
+            logger.error("invalid consumer URI returned by axis om", e);
+
+        }
+        this.outGoingQueue = outGoingQueue;
+        // if (topic == null) {
+        // throw new IllegalArgumentException();
+        // }
+        this.localTopicString = topic;
+        this.xpathString = xpath;
+        this.isWsrmPolicy = wsrmEnabled;
+        consumerInfo = new ConsumerInfo(consumerRef.getAddress(), type, useNotify, false);
+
+    }
+
+    public void resume() {
+        consumerInfo.setPaused(false);
+    }
+
+    public void pause() {
+        consumerInfo.setPaused(true);
+    }
+
+    public String getConsumerIPAddressStr() {
+        return consumerURI.toString();
+    }
+
+    public URI getConsumerAddressURI() {
+        return consumerURI;
+    }
+
+    public String getLocalTopic() {
+        // QName topicExpressionQName =
+        // xsul.util.XsulUtil.toQName(localTopicString, localTopicString
+        // .requiredTextContent());
+        // String topicLocalString = topicExpressionQName.getLocalPart();
+        return localTopicString;
+    }
+
+    /**
+     * @return Returns the consumeReference.
+     */
+    public EndpointReference getConsumerReference() {
+        return consumerReference;
+    }
+
+    /**
+     * @return Returns the curNotif.
+     */
+    public String getCurNotif() {
+        return curNotif;
+    }
+
+    /**
+     * @param curNotif
+     *            The curNotif to set.
+     */
+    public void setCurNotif(String curNotif) {
+        this.curNotif = curNotif;
+    }
+
+    /**
+     * @return Returns the outGoingQueue.
+     */
+    public OutGoingQueue getOutGoingQueue() {
+        return outGoingQueue;
+    }
+
+    /**
+     * @param outGoingQueue
+     *            The outGoingQueue to set.
+     */
+    public void setOutGoingQueue(OutGoingQueue outGoingQueue) {
+        this.outGoingQueue = outGoingQueue;
+    }
+
+    /**
+     * @return Returns the consumerInfo.
+     */
+    public ConsumerInfo getConsumerInfo() {
+        return consumerInfo;
+    }
+
+    public void resetUnAvailableCounter() {
+        unAvailableCounter = 0;
+    }
+
+    public int addUnAvailableCounter() {
+        unAvailableCounter++;
+        return unAvailableCounter;
+    }
+
+    /**
+     * @return Returns the unAvailableCounter.
+     */
+    public int getUnAvailableCounter() {
+        return unAvailableCounter;
+    }
+
+    public String getXpathString() {
+        return xpathString;
+    }
+
+    public void setXpathString(String xpathString) {
+        this.xpathString = xpathString;
+    }
+
+    /**
+     * @return Returns the isNeverExpire.
+     */
+    public boolean isNeverExpire() {
+        return isNeverExpire;
+    }
+
+    /**
+     * @param isNeverExpire
+     *            The isNeverExpire to set.
+     */
+    public void setNeverExpire(boolean neverExpire) {
+        this.isNeverExpire = neverExpire;
+    }
+
+    /**
+     * @return Returns the lastAvailableTime.
+     */
+    public long getLastAvailableTime() {
+        return lastAvailableTime;
+    }
+
+    /**
+     * @param lastAvailableTime
+     *            The lastAvailableTime to set.
+     */
+    public void setLastAvailableTime(long lastAvailableTime) {
+        this.lastAvailableTime = lastAvailableTime;
+
+    }
+
+    public void setSubscribeXml(String xml) {
+        subscribeXml = xml;
+    }
+
+    public String getSubscribeXml() {
+        return subscribeXml;
+    }
+
+    @Override
+    public boolean equals(Object o) {
+        if (o instanceof SubscriptionState) {
+            SubscriptionState subscription = (SubscriptionState) o;
+            return BrokerUtil.sameStringValue(subscription.getLocalTopic(), this.getLocalTopic())
+                    && BrokerUtil.sameStringValue(subscription.getXpathString(), this.getXpathString())
+                    && BrokerUtil.sameStringValue(subscription.getConsumerIPAddressStr(),
+                            this.getConsumerIPAddressStr()) && equalReferenceParameters(subscription);
+        }
+        return false;
+    }
+
+    private boolean equalReferenceParameters(SubscriptionState anotherSubscription) {
+
+        Map<QName, OMElement> otherRefProperties = anotherSubscription.getConsumerReference()
+                .getAllReferenceParameters();
+        Map<QName, OMElement> myRefProperties = getConsumerReference().getAllReferenceParameters();
+
+        /*
+         * Basic comparison
+         */
+        if (otherRefProperties == null && myRefProperties == null) {
+            return true;
+        } else if (otherRefProperties == null || myRefProperties == null) {
+            return false;
+        } else if (otherRefProperties.size() != myRefProperties.size()) {
+            return false;
+        }
+
+        /*
+         * This OMElementComparator supports ignore list, but we don't use it here.
+         */
+        Iterator<Entry<QName, OMElement>> iterator = otherRefProperties.entrySet().iterator();
+        while (iterator.hasNext()) {
+
+            Entry<QName, OMElement> entry = iterator.next();
+            if (!myRefProperties.containsKey(entry.getKey())) {
+                return false;
+            }
+
+            OMElement myElement = myRefProperties.get(entry.getKey());
+            OMElement otherElement = entry.getValue();
+
+            if (!OMElementComparator.compare(myElement, otherElement)) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
new file mode 100644
index 0000000..fe276bf
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProcessingContextBuilder.java
@@ -0,0 +1,186 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.wseventing;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.wsmg.broker.context.ContextParameters;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.broker.context.ProcessingContextBuilder;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.util.BrokerUtil;
+import org.apache.airavata.wsmg.util.WsEventingOperations;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReferenceHelper;
+import org.apache.axis2.context.MessageContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WSEProcessingContextBuilder extends ProcessingContextBuilder {
+
+    private static final Logger logger = LoggerFactory.getLogger(WSEProcessingContextBuilder.class);
+
+    public ProcessingContext build(OMElement elem) {
+
+        ProcessingContext processingContext = new ProcessingContext();
+
+        if (elem != null && elem.getLocalName().equals("Subscribe")) {
+            logger.debug("found subscribe element");
+            onSubscription(processingContext, elem);
+
+        }
+
+        return processingContext;
+    }
+
+    public ProcessingContext build(SOAPEnvelope elem) {
+
+        ProcessingContext context = null;
+
+        SOAPBody soapBody = elem.getBody();
+        if (soapBody != null) {
+
+            context = build(soapBody.getFirstElement());
+
+        } else {
+            context = build((OMElement) null);
+        }
+
+        context.setEnvelope(elem);
+        extractInfoFromHeader(context, elem.getHeader());
+
+        return context;
+    }
+
+    public ProcessingContext build(MessageContext msgContext, WsEventingOperations operation) {
+
+        ProcessingContext processingContext = new ProcessingContext();
+
+        switch (operation) {
+        case SUBSCRIBE: {
+
+            Iterator<OMElement> iterator = msgContext.getEnvelope().getBody()
+                    .getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(), "Subscribe"));
+
+            if (!iterator.hasNext()) {
+                throw new RuntimeException("invalid subscription message - no subscribe element");
+            }
+
+            onSubscription(processingContext, iterator.next());
+        }
+            break;
+
+        }
+
+        processingContext.setMessageConext(msgContext);
+        processingContext.setEnvelope(msgContext.getEnvelope());
+        extractInfoFromHeader(processingContext, msgContext.getEnvelope().getHeader());
+        String topicFromUrl = BrokerUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
+
+        processingContext.setContextParameter(ContextParameters.TOPIC_FROM_URL, topicFromUrl);
+
+        return processingContext;
+    }
+
+    /**
+     * @param processingContext
+     * @param subscribeElement
+     */
+    private void onSubscription(ProcessingContext processingContext, OMElement subscribeElement) {
+
+        processingContext.setContextParameter(ContextParameters.SUBSCRIBE_ELEMENT, subscribeElement);
+
+        // -- check optional element - expires
+        Iterator iterator = subscribeElement.getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(),
+                "Expires"));
+
+        if (iterator.hasNext()) {
+
+            processingContext.setContextParameter(ContextParameters.SUBSCRIBER_EXPIRES,
+                    ((OMElement) iterator.next()).getText());
+
+        }
+
+        iterator = subscribeElement
+                .getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(), "Filter"));
+
+        if (!iterator.hasNext()) {
+
+            throw new RuntimeException("invalid subscription - unable to find filter dialet");
+
+        }
+
+        processingContext.setContextParameter(ContextParameters.FILTER_ELEMENT, iterator.next());
+
+        iterator = subscribeElement.getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(),
+                "Delivery"));
+
+        if (!iterator.hasNext()) {
+            throw new RuntimeException("invalid subscription - unable to find delivery tag");
+        }
+
+        OMElement delivery = (OMElement) iterator.next();
+
+        iterator = delivery.getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(), "NotifyTo"));
+
+        if (!iterator.hasNext()) {
+            throw new RuntimeException("invalid subscription - unable to find NotifyTo tag");
+        }
+
+        OMElement notifyToElement = (OMElement) iterator.next();
+
+        processingContext.setContextParameter(ContextParameters.NOTIFY_TO_ELEMENT, notifyToElement);
+
+        try {
+
+            processingContext.setContextParameter(ContextParameters.NOTIFY_TO_EPR,
+                    EndpointReferenceHelper.fromOM(notifyToElement));
+
+        } catch (AxisFault e) {
+            throw new RuntimeException("invalid subscription - unable to parse notify to end point reference", e);
+        }
+
+    }
+
+    private void extractInfoFromHeader(ProcessingContext context, SOAPHeader header) {
+
+        Iterator ite = header.getChildrenWithName(new QName(NameSpaceConstants.WSE_NS.getNamespaceURI(),
+                WsmgCommonConstants.SUBSCRIPTION_ID));
+
+        if (ite.hasNext()) {
+            OMElement identifier = (OMElement) ite.next();
+            logger.debug("extracted identifier " + identifier.getText());
+
+            context.setContextParameter(ContextParameters.SUB_ID, identifier.getText());
+
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
new file mode 100644
index 0000000..f17a980
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEProtocolSupport.java
@@ -0,0 +1,204 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.wseventing;
+
+import java.util.Calendar;
+import java.util.Date;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.wsmg.broker.context.ContextParameters;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+import org.apache.airavata.wsmg.commons.CommonRoutines;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.messenger.OutGoingQueue;
+import org.apache.airavata.wsmg.util.BrokerUtil;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.EndpointReferenceHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WSEProtocolSupport {
+
+    private static final Logger log = LoggerFactory.getLogger(WSEProtocolSupport.class);
+
+    public SubscriptionState createSubscriptionState(ProcessingContext ctx, OutGoingQueue outgoingQueue)
+            throws AxisFault {
+
+        boolean neverExpire = false; // is true if expiration time is less than
+        String topicLocalString = "";
+        String xpathString = "";
+        EndpointReference consumerReference = ctx.getContextParameter(ContextParameters.NOTIFY_TO_EPR);
+
+        if (consumerReference == null) {
+            throw new AxisFault("Only Push delivery Mode (NotifyTo) is supported in WSE");
+        }
+
+        String expireTimeString = ctx.getContextParameter(ContextParameters.SUBSCRIBER_EXPIRES);
+
+        if (expireTimeString == null) {
+            neverExpire = true;
+
+        } else {
+
+            long expireTime = Long.valueOf(expireTimeString);
+            if (expireTime < 0) {
+                neverExpire = true;
+            }
+        }
+
+        OMElement filterEl = ctx.getContextParameter(ContextParameters.FILTER_ELEMENT);
+
+        if (filterEl == null) {
+
+            topicLocalString = ctx.getContextParameter(ContextParameters.TOPIC_FROM_URL);
+
+            if (topicLocalString == null) {
+                topicLocalString = WsmgCommonConstants.WILDCARD_TOPIC;
+            }
+
+            log.debug("got topicLocalString=" + topicLocalString);
+            // topicLocalString = "wseTopic";
+            // // a special topic, used in WSNT and JMS. Do not use a
+            // wildcard topic here since wildcard string varies by system
+        } else {
+
+            String filterDialectAttrib = filterEl.getAttributeValue(new QName(null, "Dialect"));
+
+            if (filterDialectAttrib.compareTo(WsmgCommonConstants.TOPIC_EXPRESSION_SIMPLE_DIALECT) == 0) {
+                topicLocalString = BrokerUtil.getTopicLocalString(filterEl.getText()); // get what ever inside this
+                                                                                       // element
+
+                if (topicLocalString == null) {
+                    throw new AxisFault("topic is not given in the subscription");
+                }
+
+            } else if (filterDialectAttrib.compareTo(WsmgCommonConstants.XPATH_DIALECT) == 0) {
+
+                // use topicFromUrl if
+                // was provided
+                topicLocalString = ctx.getContextParameter(ContextParameters.TOPIC_FROM_URL);
+
+                xpathString = filterEl.getText();
+
+                log.debug("got topicLocalString=" + topicLocalString + " xpathString=" + xpathString);
+
+                // TODO: Add XPath canonicalization here in the parsing. To
+                // generate a
+                // canonicalized XPath string
+                // Possibly use Query query =
+                // XPQuery.parseQuery(xpathExpression, index);
+                if (xpathString == null) {
+                    throw new AxisFault("xpath expression is not given");
+                }
+            } else if (filterDialectAttrib.compareTo(WsmgCommonConstants.TOPIC_AND_XPATH_DIALECT) == 0) {
+                OMElement topicEl = filterEl.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
+                        .getNamespaceURI(), "TopicExpression"));
+                if (topicEl != null) {
+                    topicLocalString = BrokerUtil.getTopicLocalString(topicEl.getText());
+                }
+                OMElement xpathEl = filterEl.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
+                        .getNamespaceURI(), "MessageContent"));
+                if (xpathEl != null) {
+                    xpathString = xpathEl.getText();
+                    if (xpathString == null && topicLocalString == null) {
+                        throw new AxisFault("Both topic string and " + "XPath String are null!");
+                    }
+                }
+            } else {
+                throw new AxisFault("Unkown dialect: ");
+                // topicLocalString = "wseTopic"; //a special topic, used in
+                // WSNT and JMS
+            }
+
+        }
+
+        if (topicLocalString == null || topicLocalString.length() == 0) {
+            topicLocalString = WsmgCommonConstants.WILDCARD_TOPIC;
+        }
+
+        // Create SubscriptionState Object
+        SubscriptionState state = new SubscriptionState(consumerReference, true, false, topicLocalString, xpathString,
+                "wse", outgoingQueue);
+
+        state.setNeverExpire(neverExpire); // default false
+
+        return state;
+    }
+
+    public void createSubscribeResponse(ProcessingContext ctx, String subId) throws AxisFault {
+
+        OMFactory factory = OMAbstractFactory.getOMFactory();
+
+        ctx.addResponseMsgNameSpaces(NameSpaceConstants.WSE_NS);
+
+        OMElement responseMessage = factory.createOMElement("SubscribeResponse", NameSpaceConstants.WSE_NS);
+
+        OMElement identifier = factory.createOMElement(WsmgCommonConstants.SUBSCRIPTION_ID,
+                responseMessage.getNamespace());
+        identifier.setText(subId);
+        EndpointReference serviceLocationEndpointReference = new EndpointReference(ctx.getMessageContext()
+                .getAxisService().getEndpointURL());
+
+        serviceLocationEndpointReference.addReferenceParameter(identifier);
+
+        OMElement expiresEl = factory.createOMElement("Expires", responseMessage.getNamespace(), responseMessage);
+
+        Date expiration = getFutureExpirationDate();
+        String dateString = CommonRoutines.getXsdDateTime(expiration);
+        expiresEl.setText(dateString);
+
+        OMElement subscriptionManagerEpr = null;
+        try {
+
+            subscriptionManagerEpr = EndpointReferenceHelper.toOM(factory, serviceLocationEndpointReference, new QName(
+                    NameSpaceConstants.WSE_NS.getNamespaceURI(), "SubscriptionManager"), NameSpaceConstants.WSA_NS
+                    .getNamespaceURI());
+
+            responseMessage.addChild(subscriptionManagerEpr);
+            subscriptionManagerEpr.setNamespace(responseMessage.getNamespace());
+        } catch (AxisFault e) {
+            log.error("unable to resolve EPR from OM", e);
+            throw e;
+        }
+
+        ctx.setRespMessage(responseMessage);
+    }
+
+    private Date getFutureExpirationDate() {
+        // Get a Calendar for current locale and time zone
+        Calendar cal = Calendar.getInstance();
+        // currentDate.setDate(currentDate.getDate()+1);
+        // Get a Date object that represents 30 days from now
+        Date currentDate = new Date(); // Current date
+        cal.setTime(currentDate); // Set it in the Calendar object
+        cal.add(Calendar.DATE, 30); // Add 30 days
+        Date expiration = cal.getTime(); // Retrieve the resulting date
+        return expiration;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingMsgReceiver.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingMsgReceiver.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingMsgReceiver.java
new file mode 100644
index 0000000..6af3bc5
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingMsgReceiver.java
@@ -0,0 +1,77 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.wseventing;
+
+import org.apache.airavata.wsmg.broker.AbstractBrokerMsgReceiver;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
+import org.apache.airavata.wsmg.util.WsEventingOperations;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * BrokerServiceMessageReceiverInOut message receiver
+ */
+
+public class WSEventingMsgReceiver extends AbstractBrokerMsgReceiver {
+
+    private static final Logger log = LoggerFactory.getLogger(WSEventingMsgReceiver.class);
+    WSEProcessingContextBuilder builder = new WSEProcessingContextBuilder();
+
+    public MessageContext process(MessageContext inMsg, String operationName) throws AxisFault {
+
+        WsEventingOperations msgType = WsEventingOperations.valueFrom(operationName);
+        ProcessingContext processingContext = builder.build(inMsg, msgType);
+        MessageContext outputMsg = null;
+
+        log.debug("WS-Eventing: " + msgType);
+
+        switch (msgType) {
+        case SUBSCRIBE: {
+            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
+                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
+
+            brokerConfigContext.getSubscriptionManager().subscribe(processingContext);
+            outputMsg = createOutputMessageContext(inMsg, processingContext);
+            break;
+        }
+        case UNSUBSCRIBE: {
+            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
+                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
+
+            brokerConfigContext.getSubscriptionManager().unsubscribe(processingContext);
+            outputMsg = createOutputMessageContext(inMsg, processingContext);
+            break;
+        }
+        case RENEW:
+        case GET_STATUS:
+        case SUBSCRIPTION_END:
+        default:
+            throw new AxisFault("unsupported operation" + msgType.toString());
+
+        }
+        return outputMsg;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingPublishMsgReceiver.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingPublishMsgReceiver.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingPublishMsgReceiver.java
new file mode 100644
index 0000000..63c6bbc
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wseventing/WSEventingPublishMsgReceiver.java
@@ -0,0 +1,74 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.wseventing;
+
+import org.apache.airavata.wsmg.broker.AbstractBrokerMsgReceiver;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
+import org.apache.airavata.wsmg.util.WsEventingOperations;
+import org.apache.axiom.om.OMElement;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+
+public class WSEventingPublishMsgReceiver extends AbstractBrokerMsgReceiver {
+
+    WSEProcessingContextBuilder builder = new WSEProcessingContextBuilder();
+
+    @Override
+    protected MessageContext process(MessageContext inMsgContext, String operationName) throws AxisFault {
+
+        ProcessingContext processingContext = builder.build(inMsgContext, WsEventingOperations.PUBLISH);
+
+        try {
+
+            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsgContext
+                    .getConfigurationContext().getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
+
+            brokerConfigContext.getNotificationProcessor().processMsg(processingContext, NameSpaceConstants.WSE_NS);
+        } catch (Exception e) {
+            throw new AxisFault("unable to process message", e);
+        }
+        return createOutputMessageContext(inMsgContext, processingContext);
+    }
+
+    @Override
+    protected MessageContext createOutputMessageContext(MessageContext inMsg, ProcessingContext processingContext)
+            throws AxisFault {
+
+        MessageContext outputContext = null;
+
+        OMElement responseMessage = processingContext.getRespMessage();
+        if (responseMessage != null) {
+
+            outputContext = super.createOutputMessageContext(inMsg, processingContext);
+
+            String responseAction = String.format("%s/%s", NameSpaceConstants.WSE_NS.getNamespaceURI(),
+                    responseMessage.getLocalName());
+
+            outputContext.setSoapAction(responseAction);
+        }
+
+        return outputContext;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
new file mode 100644
index 0000000..c8d3e37
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNTProtocolSupport.java
@@ -0,0 +1,237 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.wsnotification;
+
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.wsmg.broker.context.ContextParameters;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.messenger.OutGoingQueue;
+import org.apache.airavata.wsmg.util.BrokerUtil;
+import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMFactory;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.EndpointReferenceHelper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WSNTProtocolSupport {
+
+    private static final Logger log = LoggerFactory.getLogger(WSNTProtocolSupport.class);
+
+    public SubscriptionState createSubscriptionState(ProcessingContext ctx, OutGoingQueue outgoingQueue)
+            throws AxisFault {
+
+        EndpointReference consumerReference = ctx.getContextParameter(ContextParameters.NOTIFY_TO_EPR);
+
+        if (consumerReference == null) {
+            throw new AxisFault("Only Push delivery Mode (NotifyTo) is supported");
+        }
+
+        boolean neverExpire = false; // is true if expiration time is less than
+        boolean useNotify = true; // notify by event notifications
+        boolean wsrmEnabled = false;
+        String topicLocalString = "";
+        String xpathString = "";
+
+        String expireTimeString = ctx.getContextParameter(ContextParameters.SUBSCRIBER_EXPIRES);
+
+        if (expireTimeString == null) {
+            neverExpire = true;
+        } else {
+            long expireTime = Long.valueOf(expireTimeString);
+            if (expireTime < 0) {
+                neverExpire = true;
+            }
+        }
+
+        OMElement useNotifyEl = ctx.getContextParameter(ContextParameters.USE_NOTIFY_ELEMENT);
+        if (useNotifyEl != null) {
+            String s = useNotifyEl.getText();
+            useNotify = Boolean.valueOf(s);
+        }
+
+        // get policy if exist
+        OMElement element = ctx.getContextParameter(ContextParameters.SUB_POLICY);
+        if (element != null) {
+            wsrmEnabled = true;
+        }
+
+        OMElement topicExpressionEl = ctx.getContextParameter(ContextParameters.TOPIC_EXPRESSION_ELEMENT);
+
+        if (topicExpressionEl != null) {
+            topicLocalString = BrokerUtil.getTopicLocalString(topicExpressionEl.getText());
+        }
+
+        OMElement xpathEl = ctx.getContextParameter(ContextParameters.XPATH_ELEMENT);
+
+        if (xpathEl != null) {
+            xpathString = BrokerUtil.getXPathString(xpathEl);
+        }
+        if (xpathString == null && topicLocalString == null) {
+            throw new AxisFault("Both topic string and XPath String are null!");
+
+        }
+
+        if (topicLocalString == null || topicLocalString.length() == 0) {
+            topicLocalString = WsmgCommonConstants.WILDCARD_TOPIC;
+        }
+
+        // Create SubscriptionState Object
+        SubscriptionState state = new SubscriptionState(consumerReference, useNotify, wsrmEnabled, topicLocalString,
+                xpathString, "wsnt", outgoingQueue);
+
+        state.setNeverExpire(neverExpire); // default false
+
+        return state;
+    }
+
+    public void createSubscribeResponse(ProcessingContext ctx, String subId) throws AxisFault {
+
+        OMFactory factory = OMAbstractFactory.getOMFactory();
+
+        ctx.addResponseMsgNameSpaces(NameSpaceConstants.WSNT_NS);
+        OMElement responseMessage = factory.createOMElement("SubscribeResponse", NameSpaceConstants.WSNT_NS);
+
+        OMElement identifier = factory.createOMElement(WsmgCommonConstants.SUBSCRIPTION_ID,
+                responseMessage.getNamespace());
+        identifier.setText(subId);
+        EndpointReference serviceLocationEndpointReference = new EndpointReference(ctx.getMessageContext()
+                .getAxisService().getEndpointURL());
+        serviceLocationEndpointReference.addReferenceParameter(identifier);
+
+        OMElement subscriptionReference = null;
+        try {
+            subscriptionReference = EndpointReferenceHelper.toOM(factory, serviceLocationEndpointReference, new QName(
+                    "SubscriptionReference"), NameSpaceConstants.WSA_NS.getNamespaceURI());
+
+            responseMessage.addChild(subscriptionReference);
+            subscriptionReference.setNamespace(responseMessage.getNamespace());
+
+        } catch (AxisFault e) {
+            log.error("unable to resolve EPR from OM", e);
+            throw e;
+        }
+
+        ctx.setRespMessage(responseMessage);
+    }
+
+    public static class Client {
+
+        public static OMElement createSubscriptionMsg(EndpointReference eventSinkLocation, String topicExpression,
+                String xpathExpression) throws AxisFault {
+            OMFactory factory = OMAbstractFactory.getOMFactory();
+
+            OMElement message = factory.createOMElement("SubscribeRequest", NameSpaceConstants.WSNT_NS);
+
+            if (topicExpression != null) {
+                OMElement topicExpEl = factory.createOMElement("TopicExpression", NameSpaceConstants.WSNT_NS, message);
+
+                topicExpEl.addAttribute("Dialect", WsmgCommonConstants.TOPIC_EXPRESSION_SIMPLE_DIALECT,
+                        NameSpaceConstants.WSNT_NS);
+                topicExpEl.declareNamespace(NameSpaceConstants.WIDGET_NS);
+                topicExpEl.setText(NameSpaceConstants.WIDGET_NS.getPrefix() + ":" + topicExpression);
+            }
+
+            if (xpathExpression != null) {
+                OMElement xpathExpEl = factory.createOMElement("Selector", NameSpaceConstants.WSNT_NS, message);
+                xpathExpEl.addAttribute("Dialect", WsmgCommonConstants.XPATH_DIALECT, null);
+                xpathExpEl.setText(xpathExpression);
+            }
+
+            OMElement useNotifyEl = factory.createOMElement("UseNotify", message.getNamespace(), message);
+            useNotifyEl.setText("true");// check wether we still need this
+
+            OMElement eprCrEl = EndpointReferenceHelper.toOM(factory, eventSinkLocation,
+                    new QName("ConsumerReference"), NameSpaceConstants.WSA_NS.getNamespaceURI());
+
+            message.addChild(eprCrEl);
+            eprCrEl.setNamespace(message.getNamespace());
+
+            return message;
+        }
+
+        public static String decodeSubscriptionResponse(OMElement subscriptionReference) throws AxisFault {
+
+            String subscriptionId = null;
+
+            EndpointReference subscriptionReferenceEPR = EndpointReferenceHelper.fromOM(subscriptionReference);
+
+            Map<QName, OMElement> referenceParams = subscriptionReferenceEPR.getAllReferenceParameters();
+
+            if (referenceParams != null) {
+                QName identifierQName = new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(),
+                        WsmgCommonConstants.SUBSCRIPTION_ID);
+
+                OMElement identifierEl = referenceParams.get(identifierQName);
+                subscriptionId = (identifierEl != null) ? identifierEl.getText() : null;
+
+            }
+
+            return subscriptionId;
+        }
+
+        public static OMElement createUnsubscribeMsg() {
+            OMFactory factory = OMAbstractFactory.getOMFactory();
+            OMElement message = factory.createOMElement("UnsubsribeRequest", NameSpaceConstants.WSNT_NS);
+
+            return message;
+        }
+
+        public static OMElement encodeNotification(String topic, OMElement message, EndpointReference producerReference)
+                throws AxisFault {
+            OMFactory factory = OMAbstractFactory.getOMFactory();
+
+            OMElement topicExpEl = factory.createOMElement("Topic", NameSpaceConstants.WSNT_NS);
+            topicExpEl.addAttribute("Dialect", WsmgCommonConstants.TOPIC_EXPRESSION_SIMPLE_DIALECT, null);
+            topicExpEl.declareNamespace(NameSpaceConstants.WIDGET_NS);
+            topicExpEl.setText(NameSpaceConstants.WIDGET_NS.getPrefix() + ":" + topic);
+
+            OMElement messageToNotify = factory.createOMElement("Notify", NameSpaceConstants.WSNT_NS);
+            messageToNotify.declareNamespace(NameSpaceConstants.WSNT_NS);
+            messageToNotify.declareNamespace(NameSpaceConstants.WSA_NS);
+            OMElement notificationMesssageEl = factory.createOMElement("NotificationMessage",
+                    messageToNotify.getNamespace(), messageToNotify);
+
+            notificationMesssageEl.addChild(topicExpEl);
+
+            notificationMesssageEl.addChild(EndpointReferenceHelper.toOM(factory, producerReference, new QName(
+                    notificationMesssageEl.getNamespace().getNamespaceURI(), "ProducerReference",
+                    notificationMesssageEl.getNamespace().getPrefix()), NameSpaceConstants.WSA_NS.getNamespaceURI()));
+
+            OMElement messageEl = factory.createOMElement("Message", notificationMesssageEl.getNamespace(),
+                    notificationMesssageEl);
+
+            messageEl.addChild(message);
+            return messageToNotify;
+        }
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationMsgReceiver.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationMsgReceiver.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationMsgReceiver.java
new file mode 100644
index 0000000..9d32ee9
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationMsgReceiver.java
@@ -0,0 +1,110 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.wsnotification;
+
+import org.apache.airavata.wsmg.broker.AbstractBrokerMsgReceiver;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.config.WsmgConfigurationContext;
+import org.apache.airavata.wsmg.util.WsNotificationOperations;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * BrokerServiceMessageReceiverInOut message receiver
+ */
+
+public class WSNotificationMsgReceiver extends AbstractBrokerMsgReceiver {
+
+    private static final Logger log = LoggerFactory.getLogger(WSNotificationMsgReceiver.class);
+
+    WSNotificationProcessingContextBuilder builder = new WSNotificationProcessingContextBuilder();
+
+    public MessageContext process(MessageContext inMsg, String operationName) throws AxisFault {
+
+        WsNotificationOperations msgType = WsNotificationOperations.valueFrom(operationName);
+
+        ProcessingContext processingContext = builder.build(inMsg, msgType);
+
+        MessageContext outputMsg = null;
+
+        switch (msgType) {
+        case NOTIFY: {
+            try {
+
+                WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg
+                        .getConfigurationContext().getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
+
+                brokerConfigContext.getNotificationProcessor()
+                        .processMsg(processingContext, NameSpaceConstants.WSNT_NS);
+            } catch (Exception e) {
+                throw new AxisFault("unable to process message", e);
+            }
+            outputMsg = createOutputMessageContext(inMsg, processingContext);
+            break;
+        }
+        case SUBSCRIBE: {
+
+            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
+                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
+            brokerConfigContext.getSubscriptionManager().subscribe(processingContext);
+            outputMsg = createOutputMessageContext(inMsg, processingContext);
+            break;
+        }
+        case UNSUBSCRIBE: {
+
+            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
+                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
+
+            brokerConfigContext.getSubscriptionManager().unsubscribe(processingContext);
+            outputMsg = createOutputMessageContext(inMsg, processingContext);
+            break;
+        }
+        case RESUME_SUBSCRIPTION: {
+
+            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
+                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
+
+            brokerConfigContext.getSubscriptionManager().resumeSubscription(processingContext);
+            outputMsg = createOutputMessageContext(inMsg, processingContext);
+            break;
+        }
+        case PAUSE_SUBSCRIPTION: {
+            WsmgConfigurationContext brokerConfigContext = (WsmgConfigurationContext) inMsg.getConfigurationContext()
+                    .getProperty(WsmgCommonConstants.BROKER_WSMGCONFIG);
+
+            brokerConfigContext.getSubscriptionManager().pauseSubscription(processingContext);
+            outputMsg = createOutputMessageContext(inMsg, processingContext);
+            break;
+        }
+        case GET_CURRENT_MSG:
+        default:
+            throw new AxisFault("not implemented yet");
+        }
+
+        return outputMsg;
+    }
+
+}// end of class

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
new file mode 100644
index 0000000..b517234
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/broker/wsnotification/WSNotificationProcessingContextBuilder.java
@@ -0,0 +1,179 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.broker.wsnotification;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.wsmg.broker.context.ContextParameters;
+import org.apache.airavata.wsmg.broker.context.ProcessingContext;
+import org.apache.airavata.wsmg.broker.context.ProcessingContextBuilder;
+import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
+import org.apache.airavata.wsmg.commons.NameSpaceConstants;
+import org.apache.airavata.wsmg.util.BrokerUtil;
+import org.apache.airavata.wsmg.util.WsNotificationOperations;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.addressing.EndpointReferenceHelper;
+import org.apache.axis2.context.MessageContext;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class WSNotificationProcessingContextBuilder extends ProcessingContextBuilder {
+
+    private static final Logger logger = LoggerFactory.getLogger(WSNotificationProcessingContextBuilder.class);
+
+    public ProcessingContext build(OMElement elem) {
+
+        ProcessingContext processingContext = new ProcessingContext();
+
+        if (elem == null
+                || (!elem.getNamespace().getNamespaceURI().equals(NameSpaceConstants.WSNT_NS.getNamespaceURI()))) {
+
+            logger.warn("invalid message payload recieved: " + elem);
+
+            return processingContext;
+        }
+
+        String localName = elem.getLocalName();
+
+        if (localName.equals("SubscribeRequest")) {
+            onSubscription(processingContext, elem);
+        }
+        return processingContext;
+    }
+
+    public void onSubscription(ProcessingContext context, OMElement subscribeElement) {
+        context.setContextParameter(ContextParameters.SUBSCRIBE_ELEMENT, subscribeElement);
+
+        OMElement consumerReference = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
+                .getNamespaceURI(), "ConsumerReference"));
+        if (consumerReference == null) {
+            logger.warn("unable to find consumer reference" + " in subscribe message: " + subscribeElement);
+            return;
+        }
+        context.setContextParameter(ContextParameters.NOTIFY_TO_ELEMENT, consumerReference);
+
+        try {
+            EndpointReference consumerEpr = EndpointReferenceHelper.fromOM(consumerReference);
+            context.setContextParameter(ContextParameters.NOTIFY_TO_EPR, consumerEpr);
+
+        } catch (AxisFault e) {
+            logger.warn("invalid epr", e);
+            return;
+        }
+
+        OMElement topicExpression = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
+                .getNamespaceURI(), "TopicExpression"));
+
+        if (topicExpression != null) { // topic can be null
+
+            context.setContextParameter(ContextParameters.TOPIC_EXPRESSION_ELEMENT, topicExpression);
+
+        }
+
+        OMElement useNotify = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
+                .getNamespaceURI(), "UseNotify"));
+
+        if (useNotify != null) {
+            context.setContextParameter(ContextParameters.USE_NOTIFY_ELEMENT, useNotify);
+        }
+
+        OMElement selector = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
+                .getNamespaceURI(), "Selector"));
+
+        if (selector != null) {
+            context.setContextParameter(ContextParameters.XPATH_ELEMENT, selector);
+        }
+
+        OMElement subscriptionPolicy = subscribeElement.getFirstChildWithName(new QName(NameSpaceConstants.WSNT_NS
+                .getNamespaceURI(), WsmgCommonConstants.SUBSCRIPTION_POLICY));
+
+        if (subscriptionPolicy != null) {
+            context.setContextParameter(ContextParameters.SUB_POLICY, subscriptionPolicy);
+        }
+
+    }
+
+    public ProcessingContext build(MessageContext msgContext, WsNotificationOperations operation) {
+        ProcessingContext context = new ProcessingContext();
+
+        SOAPEnvelope soapEnvelope = msgContext.getEnvelope();
+
+        if (soapEnvelope == null) {
+            throw new RuntimeException("invalid message context - envelope is not found");
+        }
+
+        SOAPBody soapBody = soapEnvelope.getBody();
+
+        if (soapBody == null) {
+            throw new RuntimeException("invalid message context - soap envelope is not found");
+        }
+
+        SOAPHeader soapHeader = soapEnvelope.getHeader();
+
+        if (soapHeader == null) {
+            throw new RuntimeException("invalid message context - soap header is not found");
+        }
+
+        switch (operation) {
+        case SUBSCRIBE: {
+
+            Iterator<OMElement> iterator = soapBody.getChildrenWithName(new QName(NameSpaceConstants.WSNT_NS
+                    .getNamespaceURI(), "SubscribeRequest"));
+            if (!iterator.hasNext()) {
+                throw new RuntimeException("invalid message context - unable to find Subscribe information");
+            }
+
+            onSubscription(context, iterator.next());
+        }
+            break;
+        }
+
+        context.setEnvelope(soapEnvelope);
+        extractInfoFromHeader(context, soapHeader);
+        context.setMessageConext(msgContext);
+        String topicFromUrl = BrokerUtil.getTopicFromRequestPath(msgContext.getTo().getAddress());
+        context.setContextParameter(ContextParameters.TOPIC_FROM_URL, topicFromUrl);
+
+        return context;
+    }
+
+    private void extractInfoFromHeader(ProcessingContext context, SOAPHeader header) {
+
+        Iterator ite = header.getChildrenWithName(new QName(NameSpaceConstants.WSNT_NS.getNamespaceURI(),
+                WsmgCommonConstants.SUBSCRIPTION_ID));
+        if (ite.hasNext()) {
+            OMElement identifier = (OMElement) ite.next();
+            logger.debug("extracted identifier " + identifier.getText());
+
+            context.setContextParameter(ContextParameters.SUB_ID, identifier.getText());
+
+        }
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/OutGoingMessage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/OutGoingMessage.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/OutGoingMessage.java
new file mode 100644
index 0000000..73eba17
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/OutGoingMessage.java
@@ -0,0 +1,125 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.commons;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
+import org.apache.airavata.wsmg.broker.ConsumerInfo;
+
+public class OutGoingMessage implements Serializable {
+    /**
+	 * 
+	 */
+    private static final long serialVersionUID = -6999667921413261492L;
+
+    String textMessage;
+
+    AdditionalMessageContent additionalMessageContent;
+
+    List<ConsumerInfo> consumerInfoList = null;
+
+    // ConsumerInfo consumerInfo=null;
+
+    /**
+	 * 
+	 */
+    public OutGoingMessage() {
+        // super();
+        // TODO Auto-generated constructor stub
+        // consumerInfo=new ConsumerInfo();
+    }
+
+    /**
+     * @param textMessage
+     * @param additionalMessageContent
+     * @param consumerInfoList
+     */
+    public OutGoingMessage(String textMessage, AdditionalMessageContent additionalMessageContent,
+            List<ConsumerInfo> consumerInfoList) {
+        super();
+        // TODO Auto-generated constructor stub
+        this.textMessage = textMessage;
+        this.additionalMessageContent = additionalMessageContent;
+        this.consumerInfoList = consumerInfoList;
+    }
+
+    /**
+     * @param consumerInfo
+     *            The consumerInfo to set.
+     */
+    public void addConsumerInfo(ConsumerInfo consumerInfo) {
+        // this.consumerInfo = consumerInfo;
+        if (consumerInfoList == null) {
+            consumerInfoList = new ArrayList<ConsumerInfo>();
+        }
+        consumerInfoList.add(consumerInfo);
+    }
+
+    /**
+     * @return Returns the textMessage.
+     */
+    public String getTextMessage() {
+        return textMessage;
+    }
+
+    /**
+     * @param textMessage
+     *            The textMessage to set.
+     */
+    public void setTextMessage(String textMessage) {
+        this.textMessage = textMessage;
+    }
+
+    /**
+     * @return Returns the consumerInfoList.
+     */
+    public List<ConsumerInfo> getConsumerInfoList() {
+        return consumerInfoList;
+    }
+
+    /**
+     * @param consumerInfoList
+     *            The consumerInfoList to set.
+     */
+    public void setConsumerInfoList(List<ConsumerInfo> consumerInfoList) {
+        this.consumerInfoList = consumerInfoList;
+    }
+
+    /**
+     * @return Returns the soapHeader.
+     */
+    public AdditionalMessageContent getAdditionalMessageContent() {
+        return additionalMessageContent;
+    }
+
+    /**
+     * @param soapHeader
+     *            The soapHeader to set.
+     */
+    public void setAdditionalMessageContent(AdditionalMessageContent soapHeader) {
+        this.additionalMessageContent = soapHeader;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgInMemoryStorage.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgInMemoryStorage.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgInMemoryStorage.java
new file mode 100644
index 0000000..6b051b1
--- /dev/null
+++ b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/commons/storage/WsmgInMemoryStorage.java
@@ -0,0 +1,106 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.commons.storage;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionEntry;
+import org.apache.airavata.wsmg.broker.subscription.SubscriptionState;
+
+public class WsmgInMemoryStorage implements WsmgStorage, WsmgQueue {
+
+    private LinkedBlockingQueue<Object> queue = new LinkedBlockingQueue<Object>();
+
+    private Map<String, SubscriptionState> expirableSubscriptions = new ConcurrentHashMap<String, SubscriptionState>();
+
+    private Map<String, SubscriptionState> unexpirableSubscriptions = new ConcurrentHashMap<String, SubscriptionState>();
+
+    public void dispose() {
+        queue.clear();
+        expirableSubscriptions.clear();
+        unexpirableSubscriptions.clear();
+    }
+
+    public int insert(SubscriptionState subscription) {
+        if (subscription.isNeverExpire()) {
+            unexpirableSubscriptions.put(subscription.getId(), subscription);
+        } else {
+            expirableSubscriptions.put(subscription.getId(), subscription);
+        }
+        return 0;
+    }
+
+    public int delete(String subscriptionId) {
+        expirableSubscriptions.remove(subscriptionId);
+        unexpirableSubscriptions.remove(subscriptionId);
+        return 0;
+    }
+
+    public List<SubscriptionEntry> getAllSubscription() {
+
+        List<SubscriptionEntry> ret = new ArrayList<SubscriptionEntry>(expirableSubscriptions.size()
+                + unexpirableSubscriptions.size());
+
+        Collection<SubscriptionState> entries = expirableSubscriptions.values();
+
+        for (SubscriptionState s : entries) {
+            SubscriptionEntry se = new SubscriptionEntry();
+            se.setSubscribeXml(s.getSubscribeXml());
+            se.setSubscriptionId(s.getId());
+            ret.add(se);
+        }
+        entries = unexpirableSubscriptions.values();
+        for (SubscriptionState s : entries) {
+            SubscriptionEntry se = new SubscriptionEntry();
+            se.setSubscribeXml(s.getSubscribeXml());
+            se.setSubscriptionId(s.getId());
+            ret.add(se);
+        }
+
+        return ret;
+    }
+
+    public Object blockingDequeue() {
+        Object obj = null;
+
+        try {
+            obj = queue.take();
+        } catch (InterruptedException ie) {
+            throw new RuntimeException("interruped exception occured", ie);
+        }
+
+        return obj;
+    }
+
+    public void cleanup() {
+        queue.clear();
+    }
+
+    public void enqueue(Object object, String trackId) {
+        queue.offer(object);
+    }
+}


[88/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/userstore/LDAPUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/userstore/LDAPUserStore.java b/modules/security/src/main/java/org/apache/airavata/security/userstore/LDAPUserStore.java
new file mode 100644
index 0000000..c0ba288
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/userstore/LDAPUserStore.java
@@ -0,0 +1,147 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.userstore;
+
+import org.apache.airavata.security.UserStore;
+import org.apache.airavata.security.UserStoreException;
+import org.apache.airavata.security.util.PasswordDigester;
+import org.apache.shiro.authc.AuthenticationException;
+import org.apache.shiro.authc.AuthenticationInfo;
+import org.apache.shiro.authc.AuthenticationToken;
+import org.apache.shiro.authc.UsernamePasswordToken;
+import org.apache.shiro.realm.ldap.JndiLdapContextFactory;
+import org.apache.shiro.realm.ldap.JndiLdapRealm;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+/**
+ * A user store which talks to LDAP server. User credentials and user information are stored in a LDAP server.
+ */
+public class LDAPUserStore implements UserStore {
+
+    private JndiLdapRealm ldapRealm;
+
+    protected static Logger log = LoggerFactory.getLogger(LDAPUserStore.class);
+
+    private PasswordDigester passwordDigester;
+
+    public boolean authenticate(String userName, Object credentials) throws UserStoreException {
+
+        AuthenticationToken authenticationToken = new UsernamePasswordToken(userName,
+                passwordDigester.getPasswordHashValue((String) credentials));
+
+        AuthenticationInfo authenticationInfo;
+        try {
+            authenticationInfo = ldapRealm.getAuthenticationInfo(authenticationToken);
+        } catch (AuthenticationException e) {
+            log.warn(e.getLocalizedMessage(), e);
+            return false;
+        }
+
+        return authenticationInfo != null;
+
+    }
+
+    @Override
+    public boolean authenticate(Object credentials) throws UserStoreException {
+        log.error("LDAP user store only supports authenticating with user name and password.");
+        throw new NotImplementedException();
+    }
+
+    public void configure(Node specificConfigurationNode) throws UserStoreException {
+
+        /**
+         * <specificConfiguration> <ldap> <url>ldap://localhost:10389</url> <systemUser>admin</systemUser>
+         * <systemUserPassword>secret</systemUserPassword> <userDNTemplate>uid={0},ou=system</userDNTemplate> </ldap>
+         * </specificConfiguration>
+         */
+
+        Node configurationNode = null;
+        if (specificConfigurationNode != null) {
+            NodeList nodeList = specificConfigurationNode.getChildNodes();
+
+            for (int i = 0; i < nodeList.getLength(); ++i) {
+                Node n = nodeList.item(i);
+                if (n.getNodeType() == Node.ELEMENT_NODE) {
+                    configurationNode = n;
+                }
+            }
+        }
+
+        String url = null;
+        String systemUser = null;
+        String systemUserPassword = null;
+        String userTemplate = null;
+        String passwordHashMethod = null;
+
+        if (configurationNode != null) {
+            NodeList nodeList = configurationNode.getChildNodes();
+
+            for (int i = 0; i < nodeList.getLength(); ++i) {
+                Node n = nodeList.item(i);
+
+                if (n.getNodeType() == Node.ELEMENT_NODE) {
+
+                    Element element = (Element) n;
+
+                    if (element.getNodeName().equals("url")) {
+                        url = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("systemUser")) {
+                        systemUser = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("systemUserPassword")) {
+                        systemUserPassword = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("userDNTemplate")) {
+                        userTemplate = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("passwordHashMethod")) {
+                        passwordHashMethod = element.getFirstChild().getNodeValue();
+                    }
+                }
+            }
+        }
+
+        passwordDigester = new PasswordDigester(passwordHashMethod);
+
+        initializeLDAP(url, systemUser, systemUserPassword, userTemplate);
+
+    }
+
+    protected void initializeLDAP(String ldapUrl, String systemUser, String systemUserPassword, String userNameTemplate) {
+
+        JndiLdapContextFactory jndiLdapContextFactory = new JndiLdapContextFactory();
+
+        jndiLdapContextFactory.setUrl(ldapUrl);
+        jndiLdapContextFactory.setSystemUsername(systemUser);
+        jndiLdapContextFactory.setSystemPassword(systemUserPassword);
+
+        ldapRealm = new JndiLdapRealm();
+
+        ldapRealm.setContextFactory(jndiLdapContextFactory);
+        ldapRealm.setUserDnTemplate(userNameTemplate);
+
+        ldapRealm.init();
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/userstore/SessionDBUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/userstore/SessionDBUserStore.java b/modules/security/src/main/java/org/apache/airavata/security/userstore/SessionDBUserStore.java
new file mode 100644
index 0000000..b332e68
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/userstore/SessionDBUserStore.java
@@ -0,0 +1,132 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.userstore;
+
+import org.apache.airavata.security.UserStoreException;
+import org.apache.airavata.common.utils.DBUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import sun.reflect.generics.reflectiveObjects.NotImplementedException;
+
+import java.sql.SQLException;
+
+/**
+ * User store which works on sessions. Will talk to database to check whether session ids are stored in the database.
+ */
+public class SessionDBUserStore extends AbstractJDBCUserStore {
+
+    private String sessionTable;
+    private String sessionColumn;
+    private String comparingColumn;
+
+    protected DBUtil dbUtil;
+
+    protected static Logger log = LoggerFactory.getLogger(SessionDBUserStore.class);
+
+    @Override
+    public boolean authenticate(String userName, Object credentials) throws UserStoreException {
+        // This user store only supports session tokens.
+        throw new NotImplementedException();
+    }
+
+    @Override
+    public boolean authenticate(Object credentials) throws UserStoreException {
+
+        String sessionTicket = (String) credentials;
+
+        try {
+            String sessionString = dbUtil.getMatchingColumnValue(sessionTable, sessionColumn, sessionTicket);
+            return (sessionString != null);
+        } catch (SQLException e) {
+            throw new UserStoreException("Error querying database for session information.", e);
+        }
+    }
+
+    @Override
+    public void configure(Node node) throws UserStoreException {
+
+        super.configure(node);
+        /**
+         * <specificConfigurations> <sessionTable> </sessionTable> <sessionColumn></sessionColumn>
+         * <comparingColumn></comparingColumn> </specificConfigurations>
+         */
+
+        NodeList databaseNodeList = node.getChildNodes();
+
+        Node databaseNode = null;
+
+        for (int k = 0; k < databaseNodeList.getLength(); ++k) {
+
+            Node n = databaseNodeList.item(k);
+
+            if (n != null && n.getNodeType() == Node.ELEMENT_NODE) {
+                databaseNode = n;
+            }
+        }
+
+        if (databaseNode != null) {
+            NodeList nodeList = databaseNode.getChildNodes();
+
+            for (int i = 0; i < nodeList.getLength(); ++i) {
+                Node n = nodeList.item(i);
+
+                if (n.getNodeType() == Node.ELEMENT_NODE) {
+
+                    Element element = (Element) n;
+
+                    if (element.getNodeName().equals("sessionTable")) {
+                        sessionTable = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("sessionColumn")) {
+                        sessionColumn = element.getFirstChild().getNodeValue();
+                    } else if (element.getNodeName().equals("comparingColumn")) {
+                        comparingColumn = element.getFirstChild().getNodeValue();
+                    }
+                }
+            }
+        }
+
+        initializeDatabaseLookup();
+
+        StringBuilder stringBuilder = new StringBuilder(
+                "Configuring DB parameters for authenticator with Session Table - ");
+        stringBuilder.append(sessionTable).append(" Session column - ").append(sessionColumn)
+                .append(" Comparing column - ").append(comparingColumn);
+
+        log.debug(stringBuilder.toString());
+    }
+
+    private void initializeDatabaseLookup() throws RuntimeException {
+
+        try {
+            this.dbUtil = new DBUtil(getDatabaseURL(), getDatabaseUserName(), getDatabasePassword(), getDatabaseDriver());
+        } catch (ClassNotFoundException e) {
+            throw new RuntimeException("Error loading database driver. Driver class not found.", e);
+        } catch (InstantiationException e) {
+            throw new RuntimeException("Error loading database driver. Error instantiating driver object.", e);
+        } catch (IllegalAccessException e) {
+            throw new RuntimeException("Error loading database driver. Illegal access to driver object.", e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
----------------------------------------------------------------------
diff --git a/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java b/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
new file mode 100644
index 0000000..113189c
--- /dev/null
+++ b/modules/security/src/main/java/org/apache/airavata/security/util/PasswordDigester.java
@@ -0,0 +1,111 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.util;
+
+import org.apache.airavata.common.utils.SecurityUtil;
+import org.apache.airavata.security.UserStoreException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+
+/**
+ * Contains some utility methods related to security.
+ */
+public class PasswordDigester {
+
+    protected static Logger log = LoggerFactory.getLogger(PasswordDigester.class);
+
+    private String hashMethod;
+
+    /**
+     * Creates password digester
+     * 
+     * @param method
+     *            The particular hash method. E.g :- MD5, SHA1 etc ...
+     */
+    public PasswordDigester(String method) throws UserStoreException {
+        hashMethod = method;
+        validateHashAlgorithm();
+    }
+
+    /**
+     * Gets the hash value of a password.
+     * 
+     * @param password
+     *            Password.
+     * @return Hashed password.
+     * @throws UserStoreException
+     *             If an invalid hash method is given.
+     */
+    public String getPasswordHashValue(String password) throws UserStoreException {
+
+        if (hashMethod.equals(SecurityUtil.PASSWORD_HASH_METHOD_PLAINTEXT)) {
+            return password;
+        } else {
+            MessageDigest messageDigest = null;
+            try {
+                messageDigest = MessageDigest.getInstance(hashMethod);
+            } catch (NoSuchAlgorithmException e) {
+                throw new UserStoreException("Error creating message digest with hash algorithm - " + hashMethod, e);
+            }
+            try {
+                return new String(messageDigest.digest(password.getBytes("UTF-8")));
+            } catch (UnsupportedEncodingException e) {
+                throw new UserStoreException("Unable to create password digest", e);
+            }
+        }
+
+    }
+
+    private void validateHashAlgorithm() throws UserStoreException {
+
+        if (hashMethod == null) {
+            log.warn("Password hash method is not configured. Setting default to plaintext.");
+            hashMethod = SecurityUtil.PASSWORD_HASH_METHOD_PLAINTEXT;
+        } else {
+
+            // Validating configured hash method is correct.
+            if (!hashMethod.equals(SecurityUtil.PASSWORD_HASH_METHOD_PLAINTEXT)) {
+                try {
+                    MessageDigest.getInstance(hashMethod);
+                } catch (NoSuchAlgorithmException e) {
+                    String msg = "Invalid hash algorithm - " + hashMethod
+                            + ". Use Java style way of specifying hash algorithm. E.g :- MD5";
+                    log.error(msg);
+                    throw new UserStoreException(msg, e);
+                }
+            }
+        }
+
+    }
+
+    public String getHashMethod() {
+        return hashMethod;
+    }
+
+    public void setHashMethod(String hashMethod) {
+        this.hashMethod = hashMethod;
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReaderTest.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReaderTest.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReaderTest.java
new file mode 100644
index 0000000..d0f99ac
--- /dev/null
+++ b/modules/security/src/test/java/org/apache/airavata/security/configurations/AuthenticatorConfigurationReaderTest.java
@@ -0,0 +1,119 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.configurations;
+
+import junit.framework.TestCase;
+import org.apache.airavata.security.Authenticator;
+import org.apache.airavata.security.userstore.JDBCUserStore;
+import org.apache.airavata.security.userstore.LDAPUserStore;
+
+import java.io.File;
+import java.net.URLDecoder;
+import java.util.List;
+
+/**
+ * A test class for authenticator configuration reader. Reads the authenticators.xml in resources directory.
+ */
+public class AuthenticatorConfigurationReaderTest extends TestCase {
+
+    private String configurationFile = URLDecoder.decode(this.getClass().getClassLoader()
+            .getResource("authenticators.xml").getFile());
+
+    public void setUp() throws Exception {
+
+        File f = new File(".");
+        System.out.println(f.getAbsolutePath());
+
+        File file = new File(configurationFile);
+
+        if (!file.exists() && !file.canRead()) {
+            throw new Exception("Error reading configuration file " + configurationFile);
+
+        }
+    }
+
+    public void testInit() throws Exception {
+
+        AuthenticatorConfigurationReader authenticatorConfigurationReader = new AuthenticatorConfigurationReader();
+        authenticatorConfigurationReader.init(configurationFile);
+
+        assertTrue(AuthenticatorConfigurationReader.isAuthenticationEnabled());
+
+        List<Authenticator> authenticators = authenticatorConfigurationReader.getAuthenticatorList();
+
+        assertEquals(authenticators.size(), 3);
+
+        for (Authenticator authenticator : authenticators) {
+            if (authenticator instanceof TestDBAuthenticator1) {
+                assertEquals("dbAuthenticator1", authenticator.getAuthenticatorName());
+                assertEquals(6, authenticator.getPriority());
+                assertEquals(true, authenticator.isEnabled());
+                assertEquals("jdbc:sql:thin:@//myhost:1521/mysql1",
+                        ((TestDBAuthenticator1) authenticator).getDatabaseURL());
+                assertEquals("org.apache.derby.jdbc.ClientDriver", ((TestDBAuthenticator1) authenticator).getDatabaseDriver());
+                assertEquals("mysql1", ((TestDBAuthenticator1) authenticator).getDatabaseUserName());
+                assertEquals("secret1", ((TestDBAuthenticator1) authenticator).getDatabasePassword());
+                assertNotNull(authenticator.getUserStore());
+                assertTrue(authenticator.getUserStore() instanceof JDBCUserStore);
+
+                JDBCUserStore jdbcUserStore = (JDBCUserStore) authenticator.getUserStore();
+                assertEquals("MD5", jdbcUserStore.getPasswordDigester().getHashMethod());
+            } else if (authenticator instanceof TestDBAuthenticator2) {
+                assertEquals("dbAuthenticator2", authenticator.getAuthenticatorName());
+                assertEquals(7, authenticator.getPriority());
+                assertEquals(true, authenticator.isEnabled());
+                assertTrue(authenticator.getUserStore() instanceof LDAPUserStore);
+
+            } else if (authenticator instanceof TestDBAuthenticator3) {
+                assertEquals("dbAuthenticator3", authenticator.getAuthenticatorName());
+                assertEquals(8, authenticator.getPriority());
+                assertEquals(true, authenticator.isEnabled());
+                assertEquals("jdbc:sql:thin:@//myhost:1521/mysql3",
+                        ((TestDBAuthenticator3) authenticator).getDatabaseURL());
+                assertEquals("org.apache.derby.jdbc.ClientDriver", ((TestDBAuthenticator3) authenticator).getDatabaseDriver());
+                assertEquals("mysql3", ((TestDBAuthenticator3) authenticator).getDatabaseUserName());
+                assertEquals("secret3", ((TestDBAuthenticator3) authenticator).getDatabasePassword());
+                assertNotNull(authenticator.getUserStore());
+                assertTrue(authenticator.getUserStore() instanceof JDBCUserStore);
+
+            }
+        }
+
+        assertEquals(8, authenticators.get(0).getPriority());
+        assertEquals(7, authenticators.get(1).getPriority());
+        assertEquals(6, authenticators.get(2).getPriority());
+
+    }
+
+    public void testDisabledAuthenticator() throws Exception {
+
+        String disabledConfiguration = URLDecoder.decode(this.getClass().getClassLoader()
+                .getResource("disabled-authenticator.xml").getFile());
+
+        AuthenticatorConfigurationReader authenticatorConfigurationReader = new AuthenticatorConfigurationReader();
+        authenticatorConfigurationReader.init(disabledConfiguration);
+
+        assertFalse(AuthenticatorConfigurationReader.isAuthenticationEnabled());
+
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator1.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator1.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator1.java
new file mode 100644
index 0000000..00712c0
--- /dev/null
+++ b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator1.java
@@ -0,0 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.configurations;
+
+import org.apache.airavata.security.AbstractDatabaseAuthenticator;
+import org.apache.airavata.security.AuthenticationException;
+
+public class TestDBAuthenticator1 extends AbstractDatabaseAuthenticator {
+
+    public TestDBAuthenticator1() {
+        super();
+    }
+
+    @Override
+    public void onSuccessfulAuthentication(Object authenticationInfo) {
+        // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public void onFailedAuthentication(Object authenticationInfo) {
+        // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public boolean authenticate(Object credentials) throws AuthenticationException {
+        return false; // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
+        return false; // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public boolean isAuthenticated(Object credentials) {
+        return false; // To change body of implemented methods use File | Settings | File Templates.
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator2.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator2.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator2.java
new file mode 100644
index 0000000..75f45c4
--- /dev/null
+++ b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator2.java
@@ -0,0 +1,58 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.configurations;
+
+import org.apache.airavata.security.AbstractAuthenticator;
+import org.apache.airavata.security.AuthenticationException;
+import org.w3c.dom.Node;
+
+public class TestDBAuthenticator2 extends AbstractAuthenticator {
+
+    public TestDBAuthenticator2() {
+        super();
+    }
+
+    @Override
+    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
+        return false; // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public void onSuccessfulAuthentication(Object authenticationInfo) {
+        // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public void onFailedAuthentication(Object authenticationInfo) {
+        // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public boolean isAuthenticated(Object credentials) {
+        return false; // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public void configure(Node node) throws RuntimeException {
+        // To change body of implemented methods use File | Settings | File Templates.
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator3.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator3.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator3.java
new file mode 100644
index 0000000..7523835
--- /dev/null
+++ b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestDBAuthenticator3.java
@@ -0,0 +1,57 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.security.configurations;
+
+import org.apache.airavata.security.AbstractDatabaseAuthenticator;
+import org.apache.airavata.security.AuthenticationException;
+
+public class TestDBAuthenticator3 extends AbstractDatabaseAuthenticator {
+
+    public TestDBAuthenticator3() {
+        super();
+    }
+
+    @Override
+    public void onSuccessfulAuthentication(Object authenticationInfo) {
+        // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public void onFailedAuthentication(Object authenticationInfo) {
+        // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public boolean authenticate(Object credentials) throws AuthenticationException {
+        return false; // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    protected boolean doAuthentication(Object credentials) throws AuthenticationException {
+        return false; // To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public boolean isAuthenticated(Object credentials) {
+        return false; // To change body of implemented methods use File | Settings | File Templates.
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/java/org/apache/airavata/security/configurations/TestUserStore.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/configurations/TestUserStore.java b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestUserStore.java
new file mode 100644
index 0000000..a16c0ac
--- /dev/null
+++ b/modules/security/src/test/java/org/apache/airavata/security/configurations/TestUserStore.java
@@ -0,0 +1,47 @@
+/*
+ *
+ *  *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  *   http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *  *
+ *
+ */
+
+package org.apache.airavata.security.configurations;
+
+import org.apache.airavata.security.UserStore;
+import org.w3c.dom.Node;
+
+/**
+ * Test user store class.
+ */
+public class TestUserStore implements UserStore {
+    @Override
+    public boolean authenticate(String userName, Object credentials) {
+        return false;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public boolean authenticate(Object credentials) {
+        return false;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    @Override
+    public void configure(Node node) throws RuntimeException {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/java/org/apache/airavata/security/userstore/JDBCUserStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/userstore/JDBCUserStoreTest.java b/modules/security/src/test/java/org/apache/airavata/security/userstore/JDBCUserStoreTest.java
new file mode 100644
index 0000000..65bb924
--- /dev/null
+++ b/modules/security/src/test/java/org/apache/airavata/security/userstore/JDBCUserStoreTest.java
@@ -0,0 +1,106 @@
+/*
+ *
+ *  *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  *   http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *  *
+ *
+ */
+
+package org.apache.airavata.security.userstore;
+
+import org.apache.airavata.common.utils.DatabaseTestCases;
+import org.apache.airavata.common.utils.DerbyUtil;
+import org.apache.airavata.security.UserStore;
+import org.junit.*;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * Test class for JDBC user store.
+ */
+public class JDBCUserStoreTest extends DatabaseTestCases {
+
+    /**
+     * <specificConfigurations>
+     <database>
+     <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
+     <jdbcUrl>jdbc:h2:src/test/resources/testdb/test</jdbcUrl>
+     <userName>sa</userName>
+     <password>sa</password>
+     <databaseDriver>org.h2.Driver</databaseDriver>
+     <userTableName>AIRAVATA_USER</userTableName>
+     <userNameColumnName>USERID</userNameColumnName>
+     <passwordColumnName>PASSWORD</passwordColumnName>
+     </database>
+     </specificConfigurations>
+     * @throws Exception
+     */
+
+
+    @BeforeClass
+    public static void setUpDatabase() throws Exception{
+        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
+
+        waitTillServerStarts();
+
+        String dropTable = "drop table AIRAVATA_USER";
+
+        try {
+            executeSQL(dropTable);
+        } catch (Exception e) {
+        }
+
+        String createTable = "create table AIRAVATA_USER ( USERID varchar(255), PASSWORD varchar(255) )";
+        executeSQL(createTable);
+
+        String insertSQL = "INSERT INTO AIRAVATA_USER VALUES('amilaj', 'secret')";
+        executeSQL(insertSQL);
+
+
+    }
+
+    @AfterClass
+    public static void shutDownDatabase() throws Exception {
+        DerbyUtil.stopDerbyServer();
+    }
+
+    @Before
+    public void setUp() throws Exception{
+    }
+
+    @Test
+    public void testAuthenticate() throws Exception {
+
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        Document doc = dBuilder.parse(this.getClass().getClassLoader().getResourceAsStream("jdbc-authenticator.xml"));
+        doc.getDocumentElement().normalize();
+
+        NodeList configurations = doc.getElementsByTagName("specificConfigurations");
+        UserStore userStore = new JDBCUserStore();
+        userStore.configure(configurations.item(0));
+
+        Assert.assertTrue(userStore.authenticate("amilaj", "secret"));
+        Assert.assertFalse(userStore.authenticate("amilaj", "1secret"));
+        Assert.assertFalse(userStore.authenticate("lahiru", "1234"));
+
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/java/org/apache/airavata/security/userstore/LDAPUserStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/userstore/LDAPUserStoreTest.java b/modules/security/src/test/java/org/apache/airavata/security/userstore/LDAPUserStoreTest.java
new file mode 100644
index 0000000..5749d8a
--- /dev/null
+++ b/modules/security/src/test/java/org/apache/airavata/security/userstore/LDAPUserStoreTest.java
@@ -0,0 +1,69 @@
+/*
+ *
+ *  *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  *   http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *  *
+ *
+ */
+
+package org.apache.airavata.security.userstore;
+
+import junit.framework.TestCase;
+import org.apache.airavata.security.UserStore;
+import org.junit.Ignore;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+/**
+ * User store test 2
+ */
+@Ignore("Need LDAP server to run these tests")
+public class LDAPUserStoreTest extends TestCase{
+
+    private LDAPUserStore ldapUserStore;
+
+    public void setUp() {
+        ldapUserStore = new LDAPUserStore();
+
+        ldapUserStore.initializeLDAP("ldap://localhost:10389", "admin", "secret", "uid={0},ou=system");
+    }
+
+    public void testAuthenticate() throws Exception {
+        assertTrue(ldapUserStore.authenticate("amilaj", "secret"));
+        assertFalse(ldapUserStore.authenticate("amilaj", "secret1"));
+    }
+
+    public void testConfigure() throws Exception {
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        Document doc = dBuilder.parse(this.getClass().getClassLoader().getResourceAsStream("ldap-authenticator.xml"));
+        doc.getDocumentElement().normalize();
+
+        NodeList configurations = doc.getElementsByTagName("specificConfigurations");
+        UserStore userStore = new LDAPUserStore();
+        userStore.configure(configurations.item(0));
+
+        assertTrue(userStore.authenticate("amilaj", "secret"));
+    }
+
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/java/org/apache/airavata/security/userstore/SessionDBUserStoreTest.java
----------------------------------------------------------------------
diff --git a/modules/security/src/test/java/org/apache/airavata/security/userstore/SessionDBUserStoreTest.java b/modules/security/src/test/java/org/apache/airavata/security/userstore/SessionDBUserStoreTest.java
new file mode 100644
index 0000000..9059c9a
--- /dev/null
+++ b/modules/security/src/test/java/org/apache/airavata/security/userstore/SessionDBUserStoreTest.java
@@ -0,0 +1,101 @@
+/*
+ *
+ *  *
+ *  * Licensed to the Apache Software Foundation (ASF) under one
+ *  * or more contributor license agreements.  See the NOTICE file
+ *  * distributed with this work for additional information
+ *  * regarding copyright ownership.  The ASF licenses this file
+ *  * to you under the Apache License, Version 2.0 (the
+ *  * "License"); you may not use this file except in compliance
+ *  * with the License.  You may obtain a copy of the License at
+ *  *
+ *  *   http://www.apache.org/licenses/LICENSE-2.0
+ *  *
+ *  * Unless required by applicable law or agreed to in writing,
+ *  * software distributed under the License is distributed on an
+ *  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  * KIND, either express or implied.  See the License for the
+ *  * specific language governing permissions and limitations
+ *  * under the License.
+ *  *
+ *
+ */
+
+package org.apache.airavata.security.userstore;
+
+import junit.framework.TestCase;
+import org.apache.airavata.common.utils.DatabaseTestCases;
+import org.apache.airavata.common.utils.DerbyUtil;
+import org.junit.*;
+import org.w3c.dom.Document;
+import org.w3c.dom.NodeList;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import java.io.File;
+import java.io.InputStream;
+
+/**
+ * Test class for session DB authenticator.
+ */
+
+public class SessionDBUserStoreTest extends DatabaseTestCases {
+
+    @BeforeClass
+    public static void setUpDatabase() throws Exception{
+        DerbyUtil.startDerbyInServerMode(getHostAddress(), getPort(), getUserName(), getPassword());
+
+        waitTillServerStarts();
+
+        String dropTable = "drop table Persons";
+
+        try {
+            executeSQL(dropTable);
+        } catch (Exception e) {
+        }
+
+        String createTable = "create table Persons ( sessionId varchar(255) )";
+        executeSQL(createTable);
+
+        String insertSQL = "INSERT INTO Persons VALUES('1234')";
+        executeSQL(insertSQL);
+    }
+
+    @AfterClass
+    public static void shutDownDatabase() throws Exception {
+        DerbyUtil.stopDerbyServer();
+    }
+
+    @Before
+    public void setUp() throws Exception{
+
+        loadConfigurations();
+
+    }
+
+    private SessionDBUserStore sessionDBUserStore = new SessionDBUserStore();
+
+    private InputStream configurationFileStream
+            = this.getClass().getClassLoader().getResourceAsStream("session-authenticator.xml");
+
+    private void loadConfigurations () throws Exception {
+        DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
+        DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
+        Document doc = dBuilder.parse(configurationFileStream);
+        doc.getDocumentElement().normalize();
+
+        NodeList specificConfigurations = doc.getElementsByTagName("specificConfigurations");
+        sessionDBUserStore.configure(specificConfigurations.item(0));
+    }
+
+    @Test
+    public void testAuthenticate() throws Exception {
+        Assert.assertTrue(sessionDBUserStore.authenticate("1234"));
+
+    }
+
+    @Test
+    public void testAuthenticateFailure() throws Exception  {
+        Assert.assertFalse(sessionDBUserStore.authenticate("12345"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/resources/authenticators.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/authenticators.xml b/modules/security/src/test/resources/authenticators.xml
new file mode 100644
index 0000000..46d71cd
--- /dev/null
+++ b/modules/security/src/test/resources/authenticators.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
+    contributor license agreements. See the NOTICE file ~ distributed with this
+    work for additional information ~ regarding copyright ownership. The ASF
+    licenses this file ~ to you under the Apache License, Version 2.0 (the ~
+    "License"); you may not use this file except in compliance ~ with the License.
+    You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
+    ~ ~ Unless required by applicable law or agreed to in writing, ~ software
+    distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
+    WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
+    License for the ~ specific language governing permissions and limitations
+    ~ under the License. -->
+
+<!--
+This file contains a sample authenticator configuration. We can define all authenticators in this file. Each authenticator
+configuration has to start with tag "authenticator". The name is the name given to the authenticator. The actual
+authenticator implementation is implemented in the class. There are configurations specific to authenticators.
+Those configurations are reside inside &lt;specificConfigurations&gt; tags.
+-->
+
+<authenticators>
+    <authenticator name="dbAuthenticator1" class="org.apache.airavata.security.configurations.TestDBAuthenticator1"
+                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
+        <specificConfigurations>
+            <database>
+                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql1</jdbcUrl>
+                <userName>mysql1</userName>
+                <password>secret1</password>
+                <passwordHashMethod>MD5</passwordHashMethod>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <sessionTable>Session1</sessionTable>
+                <sessionColumn>sessioncolumn</sessionColumn>
+                <comparingColumn>comparecolumn</comparingColumn>
+                <!-- TODO add datasource.name></datasource.name -->
+            </database>
+        </specificConfigurations>
+    </authenticator>
+
+    <authenticator name="dbAuthenticator2" class="org.apache.airavata.security.configurations.TestDBAuthenticator2"
+                   enabled="true" priority="7" userstore="org.apache.airavata.security.userstore.LDAPUserStore">
+        <specificConfigurations>
+            <ldap>
+                <!--
+                url - The URL which LDAP server is listening for requests
+                systemUser - The DN of the LDAP server connection user
+                systemUserPassword - The password of the LDAP server connection user
+                userDNTemplate - The DN structure of the users in LDAP
+            -->
+                <url>ldap://localhost:10389</url>
+                <systemUser>admin</systemUser>
+                <systemUserPassword>secret</systemUserPassword>
+                <userDNTemplate>uid={0},ou=system</userDNTemplate>
+            </ldap>
+        </specificConfigurations>
+    </authenticator>
+
+    <authenticator name="dbAuthenticator4" class="org.apache.airavata.security.configurations.TestDBAuthenticator2"
+                   enabled="false" priority="7" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
+        <specificConfigurations>
+            <database>
+                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql2</jdbcUrl>
+                <userName>mysql2</userName>
+                <password>secret2</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <sessionTable>Session2</sessionTable>
+                <sessionColumn>sessioncolumn2</sessionColumn>
+                <comparingColumn>comparecolumn2</comparingColumn>
+            </database>
+        </specificConfigurations>
+    </authenticator>
+
+    <authenticator name="dbAuthenticator3" class="org.apache.airavata.security.configurations.TestDBAuthenticator3"
+                   enabled="true" priority="8" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
+        <specificConfigurations>
+            <database>
+                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql3</jdbcUrl>
+                <userName>mysql3</userName>
+                <password>secret3</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <sessionTable>Session3</sessionTable>
+                <sessionColumn>sessioncolumn3</sessionColumn>
+                <comparingColumn>comparecolumn3</comparingColumn>
+            </database>
+        </specificConfigurations>
+    </authenticator>
+
+</authenticators>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/resources/disabled-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/disabled-authenticator.xml b/modules/security/src/test/resources/disabled-authenticator.xml
new file mode 100644
index 0000000..627ba57
--- /dev/null
+++ b/modules/security/src/test/resources/disabled-authenticator.xml
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ~ Licensed to the Apache Software Foundation (ASF) under one ~ or more
+    contributor license agreements. See the NOTICE file ~ distributed with this
+    work for additional information ~ regarding copyright ownership. The ASF
+    licenses this file ~ to you under the Apache License, Version 2.0 (the ~
+    "License"); you may not use this file except in compliance ~ with the License.
+    You may obtain a copy of the License at ~ ~ http://www.apache.org/licenses/LICENSE-2.0
+    ~ ~ Unless required by applicable law or agreed to in writing, ~ software
+    distributed under the License is distributed on an ~ "AS IS" BASIS, WITHOUT
+    WARRANTIES OR CONDITIONS OF ANY ~ KIND, either express or implied. See the
+    License for the ~ specific language governing permissions and limitations
+    ~ under the License. -->
+
+<!--
+This file contains a sample authenticator configuration. We can define all authenticators in this file. Each authenticator
+configuration has to start with tag "authenticator". The name is the name given to the authenticator. The actual
+authenticator implementation is implemented in the class. There are configurations specific to authenticators.
+Those configurations are reside inside &lt;specificConfigurations&gt; tags.
+-->
+
+<authenticators enabled="false">
+    <authenticator name="dbAuthenticator1" class="org.apache.airavata.security.configurations.TestDBAuthenticator1"
+                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
+        <specificConfigurations>
+            <database>
+                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql1</jdbcUrl>
+                <userName>mysql1</userName>
+                <password>secret1</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <sessionTable>Session1</sessionTable>
+                <sessionColumn>sessioncolumn</sessionColumn>
+                <comparingColumn>comparecolumn</comparingColumn>
+                <!-- TODO add datasource.name></datasource.name -->
+            </database>
+        </specificConfigurations>
+    </authenticator>
+
+    <authenticator name="dbAuthenticator2" class="org.apache.airavata.security.configurations.TestDBAuthenticator2"
+                   enabled="true" priority="7" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
+        <specificConfigurations>
+            <database>
+                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql2</jdbcUrl>
+                <userName>mysql2</userName>
+                <password>secret2</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <sessionTable>Session2</sessionTable>
+                <sessionColumn>sessioncolumn2</sessionColumn>
+                <comparingColumn>comparecolumn2</comparingColumn>
+            </database>
+        </specificConfigurations>
+    </authenticator>
+
+    <authenticator name="dbAuthenticator4" class="org.apache.airavata.security.configurations.TestDBAuthenticator2"
+                   enabled="false" priority="7" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
+        <specificConfigurations>
+            <database>
+                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql2</jdbcUrl>
+                <userName>mysql2</userName>
+                <password>secret2</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <sessionTable>Session2</sessionTable>
+                <sessionColumn>sessioncolumn2</sessionColumn>
+                <comparingColumn>comparecolumn2</comparingColumn>
+            </database>
+        </specificConfigurations>
+    </authenticator>
+
+    <authenticator name="dbAuthenticator3" class="org.apache.airavata.security.configurations.TestDBAuthenticator3"
+                   enabled="true" priority="8" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
+        <specificConfigurations>
+            <database>
+                <jdbcUrl>jdbc:sql:thin:@//myhost:1521/mysql3</jdbcUrl>
+                <userName>mysql3</userName>
+                <password>secret3</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <sessionTable>Session3</sessionTable>
+                <sessionColumn>sessioncolumn3</sessionColumn>
+                <comparingColumn>comparecolumn3</comparingColumn>
+            </database>
+        </specificConfigurations>
+    </authenticator>
+
+</authenticators>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/resources/jdbc-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/jdbc-authenticator.xml b/modules/security/src/test/resources/jdbc-authenticator.xml
new file mode 100644
index 0000000..c27b60f
--- /dev/null
+++ b/modules/security/src/test/resources/jdbc-authenticator.xml
@@ -0,0 +1,39 @@
+<!--
+  ~ /*
+  ~  *
+  ~  * Licensed to the Apache Software Foundation (ASF) under one
+  ~  * or more contributor license agreements.  See the NOTICE file
+  ~  * distributed with this work for additional information
+  ~  * regarding copyright ownership.  The ASF licenses this file
+  ~  * to you under the Apache License, Version 2.0 (the
+  ~  * "License"); you may not use this file except in compliance
+  ~  * with the License.  You may obtain a copy of the License at
+  ~  *
+  ~  *   http://www.apache.org/licenses/LICENSE-2.0
+  ~  *
+  ~  * Unless required by applicable law or agreed to in writing,
+  ~  * software distributed under the License is distributed on an
+  ~  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  * KIND, either express or implied.  See the License for the
+  ~  * specific language governing permissions and limitations
+  ~  * under the License.
+  ~  *
+  ~  */
+  -->
+<authenticators>
+    <authenticator name="dbAuthenticator1" class="org.apache.airavata.security.configurations.TestDBAuthenticator1"
+                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.JDBCUserStore">
+        <specificConfigurations>
+            <database>
+                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
+                <jdbcUrl>jdbc:derby://localhost:20000/persistent_data;create=true</jdbcUrl>
+                <userName>admin</userName>
+                <password>admin</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <userTableName>AIRAVATA_USER</userTableName>
+                <userNameColumnName>USERID</userNameColumnName>
+                <passwordColumnName>PASSWORD</passwordColumnName>
+            </database>
+        </specificConfigurations>
+    </authenticator>
+</authenticators>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/resources/ldap-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/ldap-authenticator.xml b/modules/security/src/test/resources/ldap-authenticator.xml
new file mode 100644
index 0000000..651920f
--- /dev/null
+++ b/modules/security/src/test/resources/ldap-authenticator.xml
@@ -0,0 +1,41 @@
+<!--
+  ~ /*
+  ~  *
+  ~  * Licensed to the Apache Software Foundation (ASF) under one
+  ~  * or more contributor license agreements.  See the NOTICE file
+  ~  * distributed with this work for additional information
+  ~  * regarding copyright ownership.  The ASF licenses this file
+  ~  * to you under the Apache License, Version 2.0 (the
+  ~  * "License"); you may not use this file except in compliance
+  ~  * with the License.  You may obtain a copy of the License at
+  ~  *
+  ~  *   http://www.apache.org/licenses/LICENSE-2.0
+  ~  *
+  ~  * Unless required by applicable law or agreed to in writing,
+  ~  * software distributed under the License is distributed on an
+  ~  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  * KIND, either express or implied.  See the License for the
+  ~  * specific language governing permissions and limitations
+  ~  * under the License.
+  ~  *
+  ~  */
+  -->
+<authenticators>
+    <authenticator name="dbAuthenticator1" class="org.apache.airavata.security.configurations.TestDBAuthenticator1"
+                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.LDAPUserStore">
+        <specificConfigurations>
+            <ldap>
+                <!--
+                url - The URL which LDAP server is listening for requests
+                systemUser - The DN of the LDAP server connection user
+                systemUserPassword - The password of the LDAP server connection user
+                userDNTemplate - The DN structure of the users in LDAP
+            -->
+                <url>ldap://localhost:10389</url>
+                <systemUser>admin</systemUser>
+                <systemUserPassword>secret</systemUserPassword>
+                <userDNTemplate>uid={0},ou=system</userDNTemplate>
+            </ldap>
+        </specificConfigurations>
+    </authenticator>
+</authenticators>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/security/src/test/resources/session-authenticator.xml
----------------------------------------------------------------------
diff --git a/modules/security/src/test/resources/session-authenticator.xml b/modules/security/src/test/resources/session-authenticator.xml
new file mode 100644
index 0000000..670913e
--- /dev/null
+++ b/modules/security/src/test/resources/session-authenticator.xml
@@ -0,0 +1,45 @@
+<!--
+  ~ /*
+  ~  *
+  ~  * Licensed to the Apache Software Foundation (ASF) under one
+  ~  * or more contributor license agreements.  See the NOTICE file
+  ~  * distributed with this work for additional information
+  ~  * regarding copyright ownership.  The ASF licenses this file
+  ~  * to you under the Apache License, Version 2.0 (the
+  ~  * "License"); you may not use this file except in compliance
+  ~  * with the License.  You may obtain a copy of the License at
+  ~  *
+  ~  *   http://www.apache.org/licenses/LICENSE-2.0
+  ~  *
+  ~  * Unless required by applicable law or agreed to in writing,
+  ~  * software distributed under the License is distributed on an
+  ~  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~  * KIND, either express or implied.  See the License for the
+  ~  * specific language governing permissions and limitations
+  ~  * under the License.
+  ~  *
+  ~  */
+  -->
+
+<authenticators>
+    <authenticator name="sessionAuthenticator" class="org.apache.airavata.services.registry.rest.security.session.SessionAuthenticator"
+                   enabled="true" priority="6" userstore="org.apache.airavata.security.userstore.SessionDBUserStore">
+        <specificConfigurations>
+            <database>
+                <!--jdbcUrl>jdbc:h2:modules/commons/airavata-registry-rest/src/test/resources/testdb/test</jdbcUrl-->
+                <!-- Points to /Users/thejaka/development/apache/airavata/trunk/modules/commons/airavata-registry-rest/target/tomcat6x/. -->
+                <jdbcUrl>jdbc:derby://localhost:20000/persistent_data;create=true</jdbcUrl>
+
+                <!--jdbcUrl>jdbc:h2:modules/security/src/test/resources/testdb/test</jdbcUrl-->
+
+                <userName>admin</userName>
+                <password>admin</password>
+                <databaseDriver>org.apache.derby.jdbc.ClientDriver</databaseDriver>
+                <sessionTable>Persons</sessionTable>
+                <sessionColumn>sessionId</sessionColumn>
+                <comparingColumn>sessionId</comparingColumn>
+            </database>
+        </specificConfigurations>
+    </authenticator>
+ </authenticators>
+

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/maven-eclipse.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/maven-eclipse.xml b/modules/ws-messenger/messagebox/maven-eclipse.xml
new file mode 100644
index 0000000..3f67e06
--- /dev/null
+++ b/modules/ws-messenger/messagebox/maven-eclipse.xml
@@ -0,0 +1,16 @@
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+	distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+	the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
+	obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+	in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+	ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+	the License. -->
+
+<project default="copy-resources">
+  <target name="init"/>
+  <target name="copy-resources" depends="init">
+    <copy todir="target/classes/META-INF" filtering="false">
+      <fileset dir="resources" includes="**/*.wsdl|**/*.xml" excludes="**/*.java"/>
+    </copy>
+  </target>
+</project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/pom.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/pom.xml b/modules/ws-messenger/messagebox/pom.xml
new file mode 100644
index 0000000..c1a83e5
--- /dev/null
+++ b/modules/ws-messenger/messagebox/pom.xml
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
+    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
+    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
+    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
+    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
+    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
+    the License. -->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <parent>
+        <groupId>org.apache.airavata</groupId>
+        <artifactId>airavata-ws-messenger</artifactId>
+        <version>0.12-SNAPSHOT</version>
+    </parent>
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>airavata-message-box</artifactId>
+    <packaging>jar</packaging>
+    <name>Airavata Message Box</name>
+    <url>http://airavata.apache.org/</url>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-messenger-commons</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-client-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-common-utils</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        
+        <!-- Logging -->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+
+        <!-- Test -->
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-messenger-client</artifactId>
+            <version>${project.version}</version>
+            <scope>test</scope>
+        </dependency>
+	<dependency>
+            <groupId>org.apache.airavata</groupId>
+            <artifactId>airavata-server-configuration</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <!-- Axis2 for test only -->
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-http</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transport-local</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+	<build>
+		<defaultGoal>install</defaultGoal>
+		<plugins>
+			<plugin>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<version>${antrun.version}</version><!--$NO-MVN-MAN-VER$-->
+				<executions>
+					<execution>
+						<id>restore-persistence</id>
+						<phase>prepare-package</phase>
+						<configuration>
+							<tasks>
+								<copy file="${project.build.outputDirectory}/services.xml" tofile="${project.build.outputDirectory}/META-INF/services.xml" />
+							</tasks>
+						</configuration>
+						<goals>
+							<goal>run</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
new file mode 100644
index 0000000..f0a62b4
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceLifeCycle.java
@@ -0,0 +1,192 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox;
+
+import java.net.URI;
+
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.client.tools.PeriodicExecutorThread;
+import org.apache.airavata.common.utils.AiravataUtils;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.common.utils.ServiceUtils;
+import org.apache.airavata.wsmg.commons.config.ConfigurationManager;
+import org.apache.airavata.wsmg.commons.util.Axis2Utils;
+import org.apache.airavata.wsmg.msgbox.Storage.MsgBoxStorage;
+import org.apache.airavata.wsmg.msgbox.Storage.dbpool.DatabaseStorageImpl;
+import org.apache.airavata.wsmg.msgbox.Storage.memory.InMemoryImpl;
+import org.apache.airavata.wsmg.msgbox.util.ConfigKeys;
+import org.apache.airavata.wsmg.msgbox.util.MsgBoxCommonConstants;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.engine.ServiceLifeCycle;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * This class initialize the messageBox service by setting the messageStore based on the configuration done by the user
+ * This is the LifeCycle class
+ */
+public class MsgBoxServiceLifeCycle implements ServiceLifeCycle {
+
+    private static final Logger logger = LoggerFactory.getLogger(MsgBoxServiceLifeCycle.class);
+//    private static final String CONFIGURATION_FILE_NAME = "airavata-server.properties";
+    private static final String TRUE = Boolean.toString(true);
+//    public static final String REPOSITORY_PROPERTIES = "airavata-server.properties";
+    public static final int GFAC_URL_UPDATE_INTERVAL = 1000 * 60 * 60 * 3;
+
+    public static final int JCR_AVAIALABILITY_WAIT_INTERVAL = 1000 * 10;
+    public static final String JCR_CLASS = "jcr.class";
+    public static final String JCR_USER = "jcr.user";
+    public static final String JCR_PASS = "jcr.pass";
+    public static final String ORG_APACHE_JACKRABBIT_REPOSITORY_URI = "org.apache.jackrabbit.repository.uri";
+	private static final String MESSAGE_BOX_SERVICE_NAME = "MsgBoxService";
+	private static final String SERVICE_URL = "message_box_service_url";
+	private static final String JCR_REGISTRY = "registry";
+	private Thread thread;
+    
+    public void shutDown(ConfigurationContext configurationcontext, AxisService axisservice) {
+        logger.info("Message box shutting down");
+        AiravataAPI registry = (AiravataAPI) configurationcontext.getProperty(JCR_REGISTRY);
+        if (registry != null && thread != null) {
+            try {
+                registry.getAiravataManager().unsetMessageBoxURI();
+            } catch (AiravataAPIInvocationException e) {
+                e.printStackTrace();
+            }
+            thread.interrupt();
+            try {
+                thread.join();
+            } catch (InterruptedException e) {
+                logger.info("Message box url update thread is interrupted");
+            }
+        }
+        if (configurationcontext.getProperty(MsgBoxCommonConstants.MSGBOX_STORAGE) != null) {
+            MsgBoxStorage msgBoxStorage = (MsgBoxStorage) configurationcontext
+                    .getProperty(MsgBoxCommonConstants.MSGBOX_STORAGE);
+            msgBoxStorage.dispose();
+        }
+    }
+
+    public void startUp(ConfigurationContext configurationcontext, AxisService axisservice) {
+    	AiravataUtils.setExecutionAsServer();
+        Axis2Utils.overrideAddressingPhaseHander(configurationcontext, new StoreMessageHandler());
+
+        // Load the configuration file from the classpath
+        ConfigurationManager confmanager = new ConfigurationManager();
+        initDatabase(configurationcontext, confmanager);
+        configurationcontext.setProperty(ConfigKeys.MSG_PRESV_INTERVAL,getIntervaltoExecuteDelete(confmanager));
+        final ConfigurationContext context=configurationcontext;
+        new Thread(){
+    		@Override
+    		public void run() {
+//    	        Properties properties = new Properties();
+    	        try {
+//    	            URL url = this.getClass().getClassLoader().getResource(REPOSITORY_PROPERTIES);
+//    	            properties.load(url.openStream());
+//    	            Map<String, String> map = new HashMap<String, String>((Map) properties);
+	            	try {
+						Thread.sleep(JCR_AVAIALABILITY_WAIT_INTERVAL);
+					} catch (InterruptedException e1) {
+						e1.printStackTrace();
+					}
+
+                    String userName = ServerSettings.getSystemUser();
+                    String gateway = ServerSettings.getSystemUserGateway();
+
+                    AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(gateway, userName);
+					String localAddress = ServiceUtils.generateServiceURLFromConfigurationContext(context, MESSAGE_BOX_SERVICE_NAME);
+					logger.debug("MESSAGE BOX SERVICE_ADDRESS:" + localAddress);
+                    context.setProperty(SERVICE_URL,new URI(localAddress));
+					context.setProperty(JCR_REGISTRY,airavataAPI);
+					/*
+					 * Heart beat message to registry
+					 */
+					thread = new MsgBoxURLRegisterThread(airavataAPI, context);
+					thread.start();
+    	        } catch (Exception e) {
+    	            logger.error(e.getMessage(), e);
+    	        }
+    		}
+    	}.start();
+    }
+
+    public void initDatabase(ConfigurationContext configurationcontext, ConfigurationManager confmanager) {
+        /*
+         * Determine Storage
+         */
+        String useDatabase = confmanager.getConfig(ConfigKeys.USE_DATABASE_STORAGE, TRUE);
+        MsgBoxStorage msgBoxStorage = null;
+        long time = getInterval(confmanager);
+        if (useDatabase.equalsIgnoreCase(TRUE)) {
+            String jdbcUrl = confmanager.getConfig(ConfigKeys.MSG_BOX_JDBC_URL);
+            String jdbcDriver = confmanager.getConfig(ConfigKeys.MSG_BOX_JDBC_DRIVER);
+            msgBoxStorage = new DatabaseStorageImpl(jdbcUrl, jdbcDriver, time);
+        } else {
+            msgBoxStorage = new InMemoryImpl(time);
+        }
+        configurationcontext.setProperty(MsgBoxCommonConstants.MSGBOX_STORAGE, msgBoxStorage);
+
+    }
+
+    private long getInterval(ConfigurationManager configs) {
+        int messagePreservationDays = configs.getConfig(ConfigKeys.MSG_PRESV_DAYS, 2);
+        int messagePreservationHours = configs.getConfig(ConfigKeys.MSG_PRESV_HRS, 0);
+        int messagePreservationMinutes = configs.getConfig(ConfigKeys.MSG_PRESV_MINS, 0);
+
+        long interval = messagePreservationDays * 24l;
+        interval = (interval + messagePreservationHours) * 60;
+        interval = (interval + messagePreservationMinutes) * 60;
+        interval = interval * 1000;
+        return interval;
+    }
+
+    private long getIntervaltoExecuteDelete(ConfigurationManager configs) {
+        int messagePreservationDays = configs.getConfig(ConfigKeys.MSG_PRESV_INTERVAL_DAYS, 0);
+        int messagePreservationHours = configs.getConfig(ConfigKeys.MSG_PRESV_INTERVAL_HRS, 0);
+        int messagePreservationMinutes = configs.getConfig(ConfigKeys.MSG_PRESV_INTERVAL_MINS, 5);
+
+        long interval = messagePreservationDays * 24l;
+        interval = (interval + messagePreservationHours) * 60;
+        interval = (interval + messagePreservationMinutes) * 60;
+        interval = interval * 1000;
+        return interval;
+    }
+    
+    class MsgBoxURLRegisterThread extends PeriodicExecutorThread {
+        private ConfigurationContext context = null;
+
+        MsgBoxURLRegisterThread(AiravataAPI registry, ConfigurationContext context) {
+            super(registry);
+            this.context = context;
+        }
+
+        @Override
+        protected void updateRegistry(AiravataAPI registry) throws Exception {
+            URI localAddress = (URI) this.context.getProperty(SERVICE_URL);
+            registry.getAiravataManager().setMessageBoxURI(localAddress);
+            logger.debug("Updated Message box service URL in to Repository");
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceMessageReceiverInOut.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceMessageReceiverInOut.java b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceMessageReceiverInOut.java
new file mode 100644
index 0000000..cf18f49
--- /dev/null
+++ b/modules/ws-messenger/messagebox/src/main/java/org/apache/airavata/wsmg/msgbox/MsgBoxServiceMessageReceiverInOut.java
@@ -0,0 +1,138 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.wsmg.msgbox;
+
+import org.apache.airavata.wsmg.msgbox.util.MsgBoxOperations;
+import org.apache.axiom.om.OMElement;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.receivers.AbstractInOutMessageReceiver;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.axis2.util.JavaUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * MsgBoxServiceMessageReceiverInOut message receiver, this is the actual location where the service operations get
+ * invoked.
+ */
+
+public class MsgBoxServiceMessageReceiverInOut extends AbstractInOutMessageReceiver {
+
+    private static Logger logger = LoggerFactory.getLogger(MsgBoxServiceMessageReceiverInOut.class);
+
+    public void invokeBusinessLogic(MessageContext inMsgContext, MessageContext outMsgContext) throws AxisFault {
+
+        // get the implementation class for the Web Service
+        MsgBoxServiceSkeleton skel = (MsgBoxServiceSkeleton) getTheImplementationObject(inMsgContext);
+
+        OMElement response = null;
+
+        try {
+
+            String operationName = getOperationName(inMsgContext);
+            MsgBoxOperations msgType = MsgBoxOperations.valueFrom(operationName);
+
+            switch (msgType) {
+
+            case STORE_MSGS: {
+                SOAPEnvelope enlp = inMsgContext.getEnvelope();
+                OMElement message = enlp.getBody().getFirstElement();
+                String msgBoxId = getClientId(inMsgContext);
+                String messageId = inMsgContext.getMessageID();
+                String soapAction = inMsgContext.getSoapAction();
+                response = skel.storeMessages(msgBoxId, messageId, soapAction, message);
+                break;
+            }
+
+            case DESTROY_MSGBOX: {
+                String msgBoxId = getClientId(inMsgContext);
+                response = skel.destroyMsgBox(msgBoxId);
+                break;
+            }
+
+            case TAKE_MSGS: {
+                String msgBoxId = getClientId(inMsgContext);
+                response = skel.takeMessages(msgBoxId);
+                break;
+            }
+
+            case CREATE_MSGBOX: {
+                response = skel.createMsgBox();
+                break;
+            }
+            default:
+                throw new AxisFault("unsupported operation" + msgType.toString());
+            }
+
+        } catch (AxisFault afe) {
+            throw afe;
+        } catch (Exception e) {
+            logger.error("Exception", e);
+            throw new AxisFault("Exception in Message Box ", e);
+        }
+
+        /*
+         * Output
+         */
+        SOAPFactory soapFactory = getSOAPFactory(inMsgContext);
+        SOAPEnvelope envelope = toEnvelope(soapFactory, response);
+        outMsgContext.setEnvelope(envelope);
+        outMsgContext.getOptions().setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
+    }
+
+    private String getClientId(MessageContext inMsg) throws AxisFault {
+        String toAddress = inMsg.getTo().getAddress();
+        int biginIndex = toAddress.indexOf("clientid");
+        if (biginIndex == -1) {
+            throw new AxisFault("clientid cannot be found");
+        }
+        String clientId = toAddress.substring(biginIndex + "clientid".length() + 1);
+        return clientId;
+    }
+
+    private SOAPEnvelope toEnvelope(SOAPFactory factory, OMElement response) {
+        SOAPEnvelope envelop = factory.getDefaultEnvelope();
+        envelop.getBody().addChild(response);
+        return envelop;
+    }
+
+    protected String getOperationName(MessageContext inMsg) throws AxisFault {
+
+        AxisOperation op = inMsg.getOperationContext().getAxisOperation();
+        if (op == null) {
+            throw new AxisFault(
+                    "Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider");
+        }
+
+        String operationName = null;
+        if ((op.getName() == null) || ((operationName = JavaUtils.xmlNameToJava(op.getName().getLocalPart())) == null)) {
+            throw new AxisFault("invalid operation found");
+        }
+
+        return operationName;
+    }
+
+}


[79/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java
new file mode 100644
index 0000000..9d9b6e2
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/SimpleWSClient.java
@@ -0,0 +1,134 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.gfac;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.v1.builder.XmlElement;
+import org.xmlpull.v1.builder.XmlInfosetBuilder;
+
+import xsul.XmlConstants;
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.WSIFOperation;
+import xsul.wsif.WSIFPort;
+import xsul.wsif.impl.WSIFMessageElement;
+import xsul.xwsif_runtime.WSIFClient;
+import xsul.xwsif_runtime.WSIFRuntime;
+
+/**
+ * This is a Simple Web Service client for easy SOAP Messages creation
+ * 
+ */
+public class SimpleWSClient {
+
+    private static final Logger logger = LoggerFactory.getLogger(SimpleWSClient.class);
+
+    private static final XmlInfosetBuilder builder = XmlConstants.BUILDER;
+
+    private String requestNS = GFacRegistryClient.GFAC_NAMESPACE;
+
+    /**
+     * @param url
+     * @param args
+     * @param opName
+     * @return The output
+     * @throws ComponentRegistryException
+     */
+    public WSIFMessage sendSOAPMessage(String url, Object[][] args, String opName) throws ComponentRegistryException {
+        WSIFClient wclient = WSIFRuntime.newClient(url);
+        return sendSOAPMessage(wclient, args, opName);
+    }
+
+    /**
+     * @param wclient
+     * @param args
+     * @param opName
+     * @return The output
+     * @throws ComponentRegistryException
+     */
+    public WSIFMessage sendSOAPMessage(WSIFClient wclient, Object[][] args, String opName)
+            throws ComponentRegistryException {
+
+        WSIFPort port = wclient.getPort();
+
+        WSIFOperation operation = port.createOperation(opName);
+        WSIFMessage outputMessage = operation.createOutputMessage();
+        WSIFMessage faultMessage = operation.createFaultMessage();
+        String messageName = operation.createInputMessage().getName();
+        XmlElement inputMsgElem = builder.newFragment(this.requestNS, messageName);
+
+        for (int i = 0; i < args.length; i++) {
+            createMessage((String) args[i][0], args[i][1], inputMsgElem);
+        }
+
+        WSIFMessageElement inputMessage = new WSIFMessageElement(inputMsgElem);
+
+        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
+        if (success) {
+            logger.debug("" + outputMessage);
+            return outputMessage;
+        } else {
+            throw new ComponentRegistryException("Excpetion at server " + faultMessage);
+        }
+    }
+
+    private void createMessage(String paramName, Object value, XmlElement inputMsgElem)
+            throws ComponentRegistryException {
+        XmlElement paramsElem = builder.newFragment(this.requestNS, paramName);
+        if (value instanceof String) {
+            paramsElem.addChild(value);
+        } else if (value instanceof Collection) {
+            Collection list = (Collection) value;
+            Iterator arrayValues = list.iterator();
+            while (arrayValues.hasNext()) {
+                XmlElement item = builder.newFragment("value");
+                item.addChild(arrayValues.next());
+                paramsElem.addChild(item);
+            }
+        } else if (value instanceof ArrayList) {
+            Collection list = (Collection) value;
+            Iterator arrayValues = list.iterator();
+            while (arrayValues.hasNext()) {
+                XmlElement item = builder.newFragment("value");
+                item.addChild(arrayValues.next());
+                paramsElem.addChild(item);
+            }
+        } else if (value instanceof String[]) {
+            String[] list = (String[]) value;
+            for (int i = 0; i < list.length; i++) {
+                XmlElement item = builder.newFragment("value");
+                item.addChild(list[i]);
+                paramsElem.addChild(item);
+            }
+        } else {
+            throw new ComponentRegistryException("Simple WS Client can not handle the value of type " + value);
+        }
+
+        inputMsgElem.addElement(paramsElem);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/FileTransferConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/FileTransferConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/FileTransferConstants.java
new file mode 100644
index 0000000..f40256e
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/FileTransferConstants.java
@@ -0,0 +1,38 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.globus;
+
+public class FileTransferConstants {
+    public static final String DATA_TYPE = "DATA_TYPE";
+    public static final String TRANSFER = "transfer";
+    public static final String SUBMISSION_ID = "submission_id";
+    public static final String TRANSFER_ITEM = "transfer_item";
+    public static final String SOURCE_ENDPOINT = "source_endpoint";
+    public static final String SOURCE_PATH = "source_path";
+    public static final String DESTINATION_ENDPOINT = "destination_endpoint";
+    public static final String DESTINATION_PATH = "destination_path";
+    public static final String DATA = "DATA";
+    public static final String SUBMISSION_ID_ENDPOINT = "/transfer/submission_id";
+    public static final String VALUE = "value";
+    public static final String TRANSFER_ENDPOINT = "/transfer";
+    public static final String TASK_ID = "task_id";
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/GridFTPFileTransferClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/GridFTPFileTransferClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/GridFTPFileTransferClient.java
new file mode 100644
index 0000000..7d6530b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/globus/GridFTPFileTransferClient.java
@@ -0,0 +1,238 @@
+///*
+// *
+// * Licensed to the Apache Software Foundation (ASF) under one
+// * or more contributor license agreements.  See the NOTICE file
+// * distributed with this work for additional information
+// * regarding copyright ownership.  The ASF licenses this file
+// * to you under the Apache License, Version 2.0 (the
+// * "License"); you may not use this file except in compliance
+// * with the License.  You may obtain a copy of the License at
+// *
+// *   http://www.apache.org/licenses/LICENSE-2.0
+// *
+// * Unless required by applicable law or agreed to in writing,
+// * software distributed under the License is distributed on an
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// * KIND, either express or implied.  See the License for the
+// * specific language governing permissions and limitations
+// * under the License.
+// *
+// */
+//
+//package org.apache.airavata.xbaya.globus;
+//
+//import org.globusonline.transfer.APIError;
+//import org.globusonline.transfer.BaseTransferAPIClient;
+//import org.globusonline.transfer.JSONTransferAPIClient;
+//import org.json.JSONArray;
+//import org.json.JSONException;
+//import org.json.JSONObject;
+//
+//import java.io.IOException;
+//import java.security.GeneralSecurityException;
+//import java.text.DateFormat;
+//import java.text.SimpleDateFormat;
+//import java.util.Date;
+//import java.util.HashMap;
+//import java.util.Iterator;
+//import java.util.Map;
+//
+//public class GridFTPFileTransferClient {
+//    private JSONTransferAPIClient client;
+//    private static DateFormat isoDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
+//
+//    public GridFTPFileTransferClient(JSONTransferAPIClient client) {
+//        this.client = client;
+//    }
+//
+//    public static void main(String args[]) {
+//        String username = "heshan";
+//        String caFile = "/home/heshan/Dev/globusonline/transfer-api-client-java.git/trunk/ca/gd-bundle_ca.cert";
+//        String certFile = "/tmp/x509up_u780936";
+//        String keyFile = "/tmp/x509up_u780936";
+//        String baseUrl = null;
+//
+//        String sourceEndpoint = "xsede#ranger";
+//        String sourceFilePath = "~/tmp.log";
+//        String destEndpoint = "xsede#trestles";
+//        String destFilePath = "~/tmp.log.copy";
+//
+//        // String destEndpoint = "heshan#my_testEndpoint";
+//        // String sourceFilePath = "~/var_tables.mod";
+//        try {
+//            JSONTransferAPIClient c = new JSONTransferAPIClient(username, caFile, certFile, keyFile, baseUrl);
+//            System.out.println("base url: " + c.getBaseUrl());
+//            GridFTPFileTransferClient e = new GridFTPFileTransferClient(c);
+//            e.transfer(sourceEndpoint, sourceFilePath, destEndpoint, destFilePath);
+//        } catch (Exception e) {
+//            e.printStackTrace();
+//        }
+//    }
+//
+//    /**
+//     * Transfers a file from source endpoint to destination endpoint.
+//     * 
+//     * @param sourceEndpoint
+//     *            Source endpoint
+//     * @param sourceFilePath
+//     *            Source file path
+//     * @param destEndpoint
+//     *            Destination endpoint
+//     * @param destFilePath
+//     *            Destination file path
+//     * @throws IOException
+//     *             IOException
+//     * @throws JSONException
+//     *             JSONException
+//     * @throws GeneralSecurityException
+//     *             GeneralSecurityException
+//     * @throws APIError
+//     *             APIError
+//     */
+//    public void transfer(String sourceEndpoint, String sourceFilePath, String destEndpoint, String destFilePath)
+//            throws IOException, JSONException, GeneralSecurityException, APIError {
+//        System.out.println("Starting transfer...");
+//
+//        // displayTasksummary();
+//        // displayTaskList(60 * 60 * 24 * 7); // tasks at most a week old
+//        // displayEndpointList();
+//
+//        if (!autoActivate(sourceEndpoint) || !autoActivate(destEndpoint)) {
+//            System.err.println("Unable to auto activate go tutorial endpoints, " + " exiting");
+//            return;
+//        }
+//
+//        // displayLs(sourceEndpoint, "~");
+//        // displayLs(destEndpoint, "~");
+//
+//        JSONTransferAPIClient.Result r = client.getResult(FileTransferConstants.SUBMISSION_ID_ENDPOINT);
+//        String submissionId = r.document.getString(FileTransferConstants.VALUE);
+//        JSONObject transfer = new JSONObject();
+//        transfer.put(FileTransferConstants.DATA_TYPE, FileTransferConstants.TRANSFER);
+//        transfer.put(FileTransferConstants.SUBMISSION_ID, submissionId);
+//        JSONObject item = new JSONObject();
+//        item.put(FileTransferConstants.DATA_TYPE, FileTransferConstants.TRANSFER_ITEM);
+//        item.put(FileTransferConstants.SOURCE_ENDPOINT, sourceEndpoint);
+//        item.put(FileTransferConstants.SOURCE_PATH, sourceFilePath);
+//        item.put(FileTransferConstants.DESTINATION_ENDPOINT, destEndpoint);
+//        item.put(FileTransferConstants.DESTINATION_PATH, destFilePath);
+//        transfer.append(FileTransferConstants.DATA, item);
+//
+//        r = client.postResult(FileTransferConstants.TRANSFER_ENDPOINT, transfer.toString(), null);
+//        String taskId = r.document.getString(FileTransferConstants.TASK_ID);
+//        if (!waitForTask(taskId, 120)) {
+//            System.out.println("Transfer not complete after 2 minutes, exiting");
+//            return;
+//        }
+//
+//        System.out.println("Transfer completed...");
+//
+//        // displayTasksummary();
+//        // displayLs(destEndpoint, "~");
+//    }
+//
+//    public void displayTasksummary() throws IOException, JSONException, GeneralSecurityException, APIError {
+//        JSONTransferAPIClient.Result r = client.getResult("/tasksummary");
+//        System.out.println("Task Summary for " + client.getUsername() + ": ");
+//        Iterator keysIter = r.document.sortedKeys();
+//        while (keysIter.hasNext()) {
+//            String key = (String) keysIter.next();
+//            if (!key.equals("DATA_TYPE"))
+//                System.out.println("  " + key + ": " + r.document.getString(key));
+//        }
+//    }
+//
+//    public void displayTaskList(long maxAge) throws IOException, JSONException, GeneralSecurityException, APIError {
+//        Map<String, String> params = new HashMap<String, String>();
+//        if (maxAge > 0) {
+//            long minTime = System.currentTimeMillis() - 1000 * maxAge;
+//            params.put("filter", "request_time:" + isoDateFormat.format(new Date(minTime)) + ",");
+//        }
+//        JSONTransferAPIClient.Result r = client.getResult("/task_list", params);
+//
+//        int length = r.document.getInt("length");
+//        if (length == 0) {
+//            System.out.println("No tasks were submitted in the last " + maxAge + " seconds");
+//            return;
+//        }
+//        JSONArray tasksArray = r.document.getJSONArray("DATA");
+//        for (int i = 0; i < tasksArray.length(); i++) {
+//            JSONObject taskObject = tasksArray.getJSONObject(i);
+//            System.out.println("Task " + taskObject.getString("task_id") + ":");
+//            displayTask(taskObject);
+//        }
+//    }
+//
+//    private static void displayTask(JSONObject taskObject) throws JSONException {
+//        Iterator keysIter = taskObject.sortedKeys();
+//        while (keysIter.hasNext()) {
+//            String key = (String) keysIter.next();
+//            if (!key.equals("DATA_TYPE") && !key.equals("LINKS") && !key.endsWith("_link")) {
+//                System.out.println("  " + key + ": " + taskObject.getString(key));
+//            }
+//        }
+//    }
+//
+//    public boolean autoActivate(String endpointName) throws IOException, JSONException, GeneralSecurityException,
+//            APIError {
+//        // Note: in a later release, auto-activation will be done at
+//        // /autoactivate instead.
+//        String resource = BaseTransferAPIClient.endpointPath(endpointName) + "/autoactivate";
+//        JSONTransferAPIClient.Result r = client.postResult(resource, null, null);
+//        String code = r.document.getString("code");
+//        if (code.startsWith("AutoActivationFailed")) {
+//            return false;
+//        }
+//        return true;
+//    }
+//
+//    public void displayLs(String endpointName, String path) throws IOException, JSONException,
+//            GeneralSecurityException, APIError {
+//        Map<String, String> params = new HashMap<String, String>();
+//        if (path != null) {
+//            params.put("path", path);
+//        }
+//        String resource = BaseTransferAPIClient.endpointPath(endpointName) + "/ls";
+//        JSONTransferAPIClient.Result r = client.getResult(resource, params);
+//        System.out.println("Contents of " + path + " on " + endpointName + ":");
+//
+//        JSONArray fileArray = r.document.getJSONArray("DATA");
+//        for (int i = 0; i < fileArray.length(); i++) {
+//            JSONObject fileObject = fileArray.getJSONObject(i);
+//            System.out.println("  " + fileObject.getString("name"));
+//            Iterator keysIter = fileObject.sortedKeys();
+//            while (keysIter.hasNext()) {
+//                String key = (String) keysIter.next();
+//                if (!key.equals("DATA_TYPE") && !key.equals("LINKS") && !key.endsWith("_link") && !key.equals("name")) {
+//                    System.out.println("    " + key + ": " + fileObject.getString(key));
+//                }
+//            }
+//        }
+//
+//    }
+//
+//    public boolean waitForTask(String taskId, int timeout) throws IOException, JSONException, GeneralSecurityException,
+//            APIError {
+//        String status = "ACTIVE";
+//        JSONTransferAPIClient.Result r;
+//
+//        String resource = "/task/" + taskId;
+//        Map<String, String> params = new HashMap<String, String>();
+//        params.put("fields", "status");
+//
+//        while (timeout > 0 && status.equals("ACTIVE")) {
+//            r = client.getResult(resource, params);
+//            status = r.document.getString("status");
+//            try {
+//                Thread.sleep(10000);
+//            } catch (InterruptedException e) {
+//                return false;
+//            }
+//            timeout -= 10;
+//        }
+//
+//        if (status.equals("ACTIVE"))
+//            return false;
+//        return true;
+//    }
+//}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
new file mode 100644
index 0000000..3ecf54c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/graph/controller/NodeController.java
@@ -0,0 +1,199 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.graph.controller;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.airavata.workflow.model.graph.Edge;
+import org.apache.airavata.workflow.model.graph.Graph;
+import org.apache.airavata.workflow.model.graph.GraphPiece;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
+import org.apache.airavata.workflow.model.graph.amazon.TerminateInstanceNode;
+import org.apache.airavata.workflow.model.graph.dynamic.DynamicNode;
+import org.apache.airavata.workflow.model.graph.subworkflow.SubWorkflowNode;
+import org.apache.airavata.workflow.model.graph.system.BlockNode;
+import org.apache.airavata.workflow.model.graph.system.ConstantNode;
+import org.apache.airavata.workflow.model.graph.system.DifferedInputNode;
+import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
+import org.apache.airavata.workflow.model.graph.system.EndBlockNode;
+import org.apache.airavata.workflow.model.graph.system.EndDoWhileNode;
+import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
+import org.apache.airavata.workflow.model.graph.system.EndifNode;
+import org.apache.airavata.workflow.model.graph.system.ExitNode;
+import org.apache.airavata.workflow.model.graph.system.ForEachNode;
+import org.apache.airavata.workflow.model.graph.system.IfNode;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.MemoNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.system.ReceiveNode;
+import org.apache.airavata.workflow.model.graph.system.S3InputNode;
+import org.apache.airavata.workflow.model.graph.system.StreamSourceNode;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.graph.ws.WorkflowNode;
+import org.apache.airavata.xbaya.ui.graph.EdgeGUI;
+import org.apache.airavata.xbaya.ui.graph.GraphGUI;
+import org.apache.airavata.xbaya.ui.graph.GraphPieceGUI;
+import org.apache.airavata.xbaya.ui.graph.NodeGUI;
+import org.apache.airavata.xbaya.ui.graph.PortGUI;
+import org.apache.airavata.xbaya.ui.graph.amazon.InstanceNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.amazon.TerminateInstanceNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.dynamic.DynamicNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.subworkflow.SubWorkflowNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.BlockNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.ConstantNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.DifferedInputNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.DoWhileNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.EndBlockNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.EndDoWhileNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.EndForEachNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.EndifNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.ExitNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.ForEachNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.IfNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.InputNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.MemoNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.OutputNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.ReceiveNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.S3InputNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.StreamSourceNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.ws.WSNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.ws.WorkflowNodeGUI;
+
+public class NodeController {
+	private static Map<GraphPiece,GraphPieceGUI> nodeMap=new HashMap<GraphPiece, GraphPieceGUI>();
+//	private static Map<Port,PortGUI> portMap=new HashMap<Port, PortGUI>();
+
+	public static GraphPieceGUI getGUI(GraphPiece node){
+		if (!nodeMap.containsKey(node)){
+			nodeMap.put(node,createNodeGUI(node));
+		}
+		return nodeMap.get(node);
+	}
+
+	public static GraphGUI getGUI(Graph node){
+		return (GraphGUI)getGUI((GraphPiece)node);
+	}
+
+	public static NodeGUI getGUI(Node node){
+		return (NodeGUI)getGUI((GraphPiece)node);
+	}
+
+	public static EdgeGUI getGUI(Edge port){
+		return (EdgeGUI)getGUI((GraphPiece)port);
+	}
+
+	public static PortGUI getGUI(Port port){
+		return (PortGUI)getGUI((GraphPiece)port);
+	}
+
+//	public static PortGUI getGUI(Port node){
+//		if (!portMap.containsKey(node)){
+//			portMap.put(node,createPortGUI(node));
+//		}
+//		return portMap.get(node);
+//	}
+//
+//	private static PortGUI createPortGUI(Port port){
+//		PortGUI portGUI=new PortGUI(port);
+//		return portGUI;
+//	}
+
+	private static GraphPieceGUI createNodeGUI(GraphPiece node){
+		GraphPieceGUI nodeGUI=null;
+		if (node instanceof SubWorkflowNode){
+		    nodeGUI=new SubWorkflowNodeGUI((SubWorkflowNode)node);
+		} else if (node instanceof DynamicNode){
+		    nodeGUI=new DynamicNodeGUI((DynamicNode)node);
+		} else if (node instanceof ConstantNode){
+		    nodeGUI=new ConstantNodeGUI((ConstantNode)node);
+		} else if (node instanceof IfNode){
+		    nodeGUI=new IfNodeGUI((IfNode)node);
+		} else if (node instanceof ExitNode){
+		    nodeGUI=new ExitNodeGUI((ExitNode)node);
+		} else if (node instanceof OutputNode){
+		    nodeGUI=new OutputNodeGUI((OutputNode)node);
+		} else if (node instanceof DifferedInputNode){
+		    nodeGUI=new DifferedInputNodeGUI((DifferedInputNode)node);
+		} else if (node instanceof BlockNode){
+		    nodeGUI=new BlockNodeGUI((BlockNode)node);
+		} else if (node instanceof EndForEachNode){
+		    nodeGUI=new EndForEachNodeGUI((EndForEachNode)node);
+		} else if (node instanceof S3InputNode){
+		    nodeGUI=new S3InputNodeGUI((S3InputNode)node);
+		} else if (node instanceof ForEachNode){
+		    nodeGUI=new ForEachNodeGUI((ForEachNode)node);
+		}else if (node instanceof DoWhileNode){
+		    nodeGUI=new DoWhileNodeGUI((DoWhileNode)node);
+		} else if (node instanceof EndDoWhileNode){
+		    nodeGUI=new EndDoWhileNodeGUI((EndDoWhileNode)node);
+		}  else if (node instanceof MemoNode){
+		    nodeGUI=new MemoNodeGUI((MemoNode)node);
+		} else if (node instanceof ReceiveNode){
+		    nodeGUI=new ReceiveNodeGUI((ReceiveNode)node);
+		} else if (node instanceof InputNode){
+		    nodeGUI=new InputNodeGUI((InputNode)node);
+		} else if (node instanceof EndifNode){
+		    nodeGUI=new EndifNodeGUI((EndifNode)node);
+		} else if (node instanceof EndBlockNode){
+		    nodeGUI=new EndBlockNodeGUI((EndBlockNode)node);
+		} else if (node instanceof WorkflowNode){
+		    nodeGUI=new WorkflowNodeGUI((WorkflowNode)node);
+		} else if (node instanceof WSNode){
+		    nodeGUI=new WSNodeGUI((WSNode)node);
+//		} else if (node instanceof Graph){
+//		    nodeGUI=new GraphGUI((Graph)node);
+//		} else if (node instanceof GraphPiece){
+//		    nodeGUI=new GraphPieceGUI((GraphPiece)node);
+		} else if (node instanceof Port){
+		    nodeGUI=new PortGUI((Port)node);
+		} else if (node instanceof Edge){
+		    nodeGUI=new EdgeGUI((Edge)node);
+		} else if (node instanceof TerminateInstanceNode){
+		    nodeGUI=new TerminateInstanceNodeGUI((TerminateInstanceNode)node);
+		} else if (node instanceof InstanceNode){
+		    nodeGUI=new InstanceNodeGUI((InstanceNode)node);
+		} else if (node instanceof StreamSourceNode){
+		    nodeGUI=new StreamSourceNodeGUI((StreamSourceNode)node);
+		} else if (node instanceof Graph){
+		    nodeGUI=new GraphGUI((Graph)node);
+		}
+
+		return nodeGUI;
+	}
+
+	public static boolean isFinished(Node node){
+		return node.getState() == NodeExecutionState.FINISHED;
+	}
+	public static boolean isWaiting(Node node){
+		return node.getState() == NodeExecutionState.WAITING;
+	}
+	public static boolean isRunning(Node node){
+		return node.getState() == NodeExecutionState.EXECUTING;
+	}
+	public static boolean isFailed(Node node){
+		return node.getState() == NodeExecutionState.FAILED;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java
new file mode 100644
index 0000000..a9b1027
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/DoWhileHandler.java
@@ -0,0 +1,251 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+package org.apache.airavata.xbaya.interpretor;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutorService;
+
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.airavata.workflow.model.component.Component;
+import org.apache.airavata.workflow.model.component.ws.WSComponent;
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.ControlPort;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.impl.EdgeImpl;
+import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
+import org.apache.airavata.workflow.model.graph.system.EndDoWhileNode;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.invoker.Invoker;
+import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
+import org.apache.airavata.xbaya.util.InterpreterUtil;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DoWhileHandler implements Callable<Boolean> {
+	private static Logger log = LoggerFactory.getLogger(DoWhileHandler.class);
+	private DoWhileNode dowhilenode;
+	private Map<Node, Invoker> invokerMap;
+	private ArrayList<Node> waitingNode;
+	private ArrayList<Node> finishedNodes;
+	private WorkflowInterpreter interpreter;
+	private ExecutorService threadExecutor;
+
+	/**
+	 *
+	 * Constructs a DoWhileHandler.
+	 *
+	 * @param node
+	 * @param invokerMap
+	 * @param waitingNode
+	 * @param finishedNodes
+	 * @param interpreter
+	 */
+
+	public DoWhileHandler(DoWhileNode node, Map<Node, Invoker> invokerMap, ArrayList<Node> waitingNode, ArrayList<Node> finishedNodes,
+			WorkflowInterpreter interpreter, ExecutorService threadExecutor) {
+		this.dowhilenode = node;
+		this.invokerMap = invokerMap;
+		this.waitingNode = waitingNode;
+		this.finishedNodes = finishedNodes;
+		this.interpreter = interpreter;
+		this.threadExecutor = threadExecutor;
+	}
+
+	/**
+	 * To evaluate dowhile condition with the input values
+	 *
+	 * @param doWhileNode
+	 * @param inputPorts
+	 * @param invokerMap
+	 * @return boolean value
+	 * @throws WorkFlowInterpreterException
+	 * @throws XBayaException
+	 */
+	private boolean evaluate(DoWhileNode doWhileNode, List<DataPort> inputPorts, Map<Node, Invoker> invokerMap) throws WorkFlowInterpreterException,
+			WorkflowException {
+		String booleanExpression = doWhileNode.getXpath();
+		if (booleanExpression == null) {
+			throw new WorkFlowInterpreterException("XPath for if cannot be null");
+		}
+
+		int i = 0;
+		for (DataPort port : inputPorts) {
+			Object inputVal1 = InterpreterUtil.findInputFromPort(port, invokerMap);
+			if (null == inputVal1) {
+				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + doWhileNode.getID());
+			}
+		    booleanExpression = booleanExpression.replaceAll("\\$" + i, "'" + inputVal1 + "'");
+			i++;
+		}
+		Boolean result = new Boolean(false);
+		// Now the XPath expression
+		try {
+			XPathFactory xpathFact = XPathFactory.newInstance();
+			XPath xpath = xpathFact.newXPath();
+			result = (Boolean) xpath.evaluate(booleanExpression, booleanExpression, XPathConstants.BOOLEAN);
+		} catch (XPathExpressionException e) {
+			throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
+		}
+		return result.booleanValue();
+	}
+
+	/**
+	 * To get only web service components attached to dowhile
+	 *
+	 * @param waitingNode
+	 * @return list
+	 */
+	private ArrayList<Node> handleDowhile(ArrayList<Node> waitingNode, ArrayList<Node> finishedNodes) {
+		ArrayList<Node> list = new ArrayList<Node>();
+		for (Node node : waitingNode) {
+			Component component = node.getComponent();
+			if (component instanceof WSComponent) {
+				ControlPort control = node.getControlInPort();
+				boolean controlDone = true;
+				if (control != null) {
+					for (EdgeImpl edge : control.getEdges()) {
+						controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode())
+								|| ((ControlPort) edge.getFromPort()).isConditionMet());
+					}
+				}
+
+				/*
+				 * Check for input ports
+				 */
+				List<DataPort> inputPorts = node.getInputPorts();
+				boolean inputsDone = true;
+				for (DataPort dataPort : inputPorts) {
+					inputsDone = inputsDone && finishedNodes.contains(dataPort.getFromNode());
+				}
+				if (inputsDone && controlDone) {
+					list.add(node);
+				}
+			}
+		}
+
+		return list;
+	}
+
+	/**
+	 * @see java.util.concurrent.Callable#call()
+	 */
+	@Override
+	public Boolean call() throws Exception {
+		log.debug("Invoked Dowhile node");
+		SystemComponentInvoker dowhileinvoker = new SystemComponentInvoker();
+		// TODO check for multiple input case
+		Object inputVal1 = InterpreterUtil.findInputFromPort(this.dowhilenode.getInputPort(0), this.invokerMap);
+		dowhileinvoker.addOutput(this.dowhilenode.getOutputPort(0).getID(), inputVal1);
+		this.invokerMap.put(this.dowhilenode, dowhileinvoker);
+		this.finishedNodes.add(this.dowhilenode);
+
+		ArrayList<Node> readyNodes = this.handleDowhile(this.waitingNode, this.finishedNodes);
+
+		// When you are starting 1st time its getting input from 1st node and
+		// invoking all the webservice components
+		if (readyNodes.size() != 1) {
+			throw new WorkflowRuntimeException("More than one dowhile execution not supported");
+		}
+		Node donode = readyNodes.get(0);
+		this.interpreter.handleWSComponent(donode);
+		log.debug("Invoked service " + donode.getName());
+
+		List<DataPort> inputPorts = this.dowhilenode.getInputPorts();
+		boolean runflag = true;
+		while (runflag) {
+			while (true) {
+				if (NodeController.isRunning(donode) || NodeController.isWaiting(donode)) {
+					Thread.sleep(500);
+					log.debug("Service " + donode.getName() + " waiting");
+				} else if (NodeController.isFinished(donode)) {
+					log.debug("Service " + donode.getName() + " Finished");
+					List<DataPort> ports = this.dowhilenode.getOutputPorts();
+					for (int outputPortIndex = 0, inputPortIndex = 1; outputPortIndex < ports.size(); outputPortIndex++) {
+						Object inputValue = InterpreterUtil.findInputFromPort(this.dowhilenode.getInputPort(inputPortIndex), this.invokerMap);
+						dowhileinvoker.addOutput(this.dowhilenode.getOutputPort(outputPortIndex).getID(), inputValue);
+					}
+					break;
+				} else if (NodeController.isFailed(donode)) {
+					log.debug("Service " + donode.getName() + " Failed");
+					runflag = false;
+					dowhilenode.setState(NodeExecutionState.FAILED);
+					this.threadExecutor.shutdown();
+					return false;
+				} else if (donode.isBreak()) {
+					log.debug("Service " + donode.getName() + " set to break");
+					runflag = false;
+					break;
+				} else {
+					log.error("Service " + donode.getName() + " have unknow status");
+					throw new WorkFlowInterpreterException("Unknow status of the node");
+				}
+			}
+
+			this.invokerMap.put(this.dowhilenode, dowhileinvoker);
+			log.debug("Going to evaluate do while expression for " + donode.getName());
+			if (!evaluate(this.dowhilenode, inputPorts, this.invokerMap)) {
+				log.debug("Expression evaluation is false so calling EndDoWhile");
+				runflag = false;
+			} else {
+				if (readyNodes.size() != 1) {
+					throw new WorkFlowInterpreterException("More than one dowhile execution not supported");
+				}
+
+				Node whileNode = readyNodes.get(0);
+				log.debug("Expression evaluation is true so invoking service again " + whileNode.getName());
+
+				this.interpreter.handleWSComponent(whileNode);
+			}
+		}
+		// WS node should be done
+		dowhilenode.setState(NodeExecutionState.FINISHED);
+		EndDoWhileNode endDoWhileNode = this.dowhilenode.getEndDoWhileNode();
+
+		// /////////////////////////////////////////////////////////
+		// // Do WHile finished execution thus we can set the //////
+		// //inputs to the EndDOWHile and resume the executions/////
+		SystemComponentInvoker invoker = new SystemComponentInvoker();
+
+		List<DataPort> inputports = endDoWhileNode.getInputPorts();
+
+		for (int inputPortIndex = 0; inputPortIndex < inputports.size(); inputPortIndex++) {
+			Object inputVal = dowhileinvoker.getOutput(inputports.get(inputPortIndex).getFromPort().getID());
+			invoker.addOutput(endDoWhileNode.getOutputPort(inputPortIndex).getID(), inputVal);
+		}
+
+		this.invokerMap.put(endDoWhileNode, invoker);
+		// TODO send mail once the iterations have converged
+
+		endDoWhileNode.setState(NodeExecutionState.FINISHED);
+		this.threadExecutor.shutdown();
+		return true;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
new file mode 100644
index 0000000..c08ee34
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/ExperimentTemplate.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import java.util.List;
+
+public class ExperimentTemplate {
+	private List<WorkflowExecutionTemplate> workflowExecutionTemplates;
+
+	public List<WorkflowExecutionTemplate> getWorkflowExecutionTemplates() {
+		return workflowExecutionTemplates;
+	}
+
+	public void setWorkflowExecutionTemplates(
+			List<WorkflowExecutionTemplate> workflowExecutionTemplates) {
+		this.workflowExecutionTemplates = workflowExecutionTemplates;
+	}
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java
new file mode 100644
index 0000000..526610d
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/GUIWorkflowInterpreterInteractorImpl.java
@@ -0,0 +1,211 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
+import org.apache.airavata.ws.monitor.MonitorException;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.graph.subworkflow.SubWorkflowNodeGUI;
+import org.apache.airavata.xbaya.ui.graph.system.DifferedInputHandler;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+import org.apache.airavata.xbaya.util.InterpreterUtil;
+
+public class GUIWorkflowInterpreterInteractorImpl implements
+		WorkflowInterpreterInteractor {
+	private XBayaGUI xbayaGUI;
+	private Workflow workflow;
+	private XBayaEngine engine;
+	
+	private Map<String, WaitDialog> taskDialogs = new HashMap<String, WaitDialog>();
+
+	public GUIWorkflowInterpreterInteractorImpl(XBayaEngine engine,
+			Workflow workflow) {
+		this.engine = engine;
+		this.xbayaGUI = engine.getGUI();
+		this.setWorkflow(workflow);
+	}
+
+	@Override
+	public boolean notify(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data) {
+		switch (messageType) {
+		case NODE_STATE_CHANGED:
+			xbayaGUI.getGraphCanvas().repaint();
+			break;
+		case EXECUTION_STATE_CHANGED:
+			WorkflowExecutionState state = (WorkflowExecutionState) data;
+			// if (state==WorkflowExecutionState.PAUSED ||
+			// state==WorkflowExecutionState.STOPPED) {
+			// if (getWorkflow().getExecutionState() ==
+			// WorkflowExecutionState.RUNNING
+			// || getWorkflow().getExecutionState() ==
+			// WorkflowExecutionState.STEP) {
+			// } else {
+			// throw new WorkflowRuntimeException(
+			// "Cannot pause when not running");
+			// }
+			// }
+			getWorkflow().setExecutionState(state);
+			if (state==WorkflowExecutionState.PAUSED){
+				if (config.getWorkflow().getExecutionState() == WorkflowExecutionState.RUNNING
+						|| config.getWorkflow().getExecutionState() == WorkflowExecutionState.STEP) {
+					config.getGUI().getToolbar().getPlayAction()
+							.actionPerformed(null);
+				}
+			}
+			break;
+		case EXECUTION_TASK_START:
+			TaskNotification task = (TaskNotification) data;
+			final WaitDialog waitDialog = new WaitDialog(new Cancelable() {
+				@Override
+				public void cancel() {
+					// Do nothing
+				}
+			}, task.messageTitle, task.message, this.xbayaGUI);
+			new Thread(new Runnable() {
+				@Override
+				public void run() {
+					waitDialog.show();
+				}
+			}).start();
+			taskDialogs.put(task.messageId, waitDialog);
+			break;
+		case EXECUTION_TASK_END:
+			task = (TaskNotification) data;
+			if (taskDialogs.containsKey(task.messageId)) {
+				taskDialogs.get(task.messageId).hide();
+				taskDialogs.remove(task.messageId);
+			}
+			break;
+		case EXECUTION_ERROR:
+			xbayaGUI.getErrorWindow().error((Exception) data);
+			break;
+		case OPEN_SUBWORKFLOW:
+			((SubWorkflowNodeGUI) NodeController.getGUI((Node) data))
+					.openWorkflowTab(config.getGUI());
+			break;
+		case EXECUTION_CLEANUP:
+			this.engine.resetWorkflowInterpreter();
+			try {
+				config.getMonitor().stop();
+			} catch (MonitorException e) {
+				e.printStackTrace();
+			} finally {
+				this.engine.getMonitor().resetEventData();
+			}
+			break;
+		case HANDLE_DEPENDENT_NODES_DIFFERED_INPUTS:
+			ArrayList<Node> waitingNodes = InterpreterUtil.getWaitingNodesDynamically((WSGraph)data);
+			for (Node readyNode : waitingNodes) {
+				DifferedInputHandler.handleDifferredInputsofDependentNodes(
+						readyNode, config.getGUI());
+			}
+			break;
+		default:
+			return false;	
+		}
+		return true;
+	}
+
+	@Override
+	public Object retrieveData(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data)
+			throws Exception {
+		Object result = null;
+		switch (messageType) {
+		case INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW:
+			Workflow subWorkflow= (Workflow) data;
+            WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(subWorkflow,config.getTopic(),config.getMessageBoxURL(), config.getMessageBrokerURL(), config.getRegistry(), config.getConfiguration(), config.getGUI(), this.engine.getMonitor());
+            workflowInterpreterConfiguration.setActOnProvenance(config.isActOnProvenance());
+            workflowInterpreterConfiguration.setSubWorkflow(true);
+            if (config.isTestMode()){
+        		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+            }
+			result = new WorkflowInterpreter(workflowInterpreterConfiguration, 
+					new GUIWorkflowInterpreterInteractorImpl(engine,
+							config.getWorkflow()));
+			this.engine.registerWorkflowInterpreter((WorkflowInterpreter)result);
+			break;
+//		case INPUT_GSS_CREDENTIAL:
+//			MyProxyChecker myProxyChecker = new MyProxyChecker(this.engine);
+//			myProxyChecker.loadIfNecessary();
+//			MyProxyClient myProxyClient = this.engine.getMyProxyClient();
+//			result = myProxyClient.getProxy();
+//			break;
+//		case INPUT_LEAD_CONTEXT_HEADER:
+//			Node node = (Node) data;
+//			result = XBayaUtil.buildLeadContextHeader(this.getWorkflow(),
+//					config.getConfiguration(),
+//					new MonitorConfiguration(config.getMessageBrokerURL(),
+//							config.getTopic(), true,
+//							config
+//									.getMessageBoxURL()), node.getID(),
+//					null);
+//			break;
+		default:
+			break;
+		}
+		return result;
+	}
+
+	public Workflow getWorkflow() {
+		return workflow;
+	}
+
+	public void setWorkflow(Workflow workflow) {
+		this.workflow = workflow;
+	}
+
+	@Override
+	public void pauseExecution(WorkflowInterpreterConfiguration config) {
+		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.PAUSED);
+	}
+
+	@Override
+	public void resumeExecution(WorkflowInterpreterConfiguration config) {
+		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.RUNNING);
+	}
+
+	@Override
+	public void terminateExecution(WorkflowInterpreterConfiguration config) {
+		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.STOPPED);
+	}
+
+	@Override
+	public boolean isExecutionPaused(WorkflowInterpreterConfiguration config) {
+		return config.getWorkflow().getExecutionState()==WorkflowExecutionState.PAUSED;
+	}
+
+	@Override
+	public boolean isExecutionTerminated(WorkflowInterpreterConfiguration config) {
+		return config.getWorkflow().getExecutionState()==WorkflowExecutionState.STOPPED;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/HeaderConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/HeaderConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/HeaderConstants.java
new file mode 100644
index 0000000..1e0bf7c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/HeaderConstants.java
@@ -0,0 +1,33 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+public interface HeaderConstants {
+
+    public static final String HEADER_ELEMENT_GFAC = "gfac";
+    public static final String HEADER_ELEMENT_REGISTRY = "registry";
+    public static final String HEADER_ELEMENT_PROXYSERVER = "proxyserver";
+    public static final String HEADER_ELEMENT_MSGBOX = "msgbox";
+    public static final String HEADER_ELEMENT_DSC = "dsc";
+    public static final String HEADER_ELEMENT_BROKER = "broker";
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java
new file mode 100644
index 0000000..32bd66b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SSWorkflowInterpreterInteractorImpl.java
@@ -0,0 +1,118 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
+
+public class SSWorkflowInterpreterInteractorImpl implements
+		WorkflowInterpreterInteractor {
+	
+	@Override
+	public boolean notify(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data) {
+		switch (messageType) {
+		case NODE_STATE_CHANGED:
+			break;
+		case EXECUTION_STATE_CHANGED:
+			WorkflowExecutionState state = (WorkflowExecutionState) data;
+			config.getWorkflow().setExecutionState(state);
+//			if (state == WorkflowExecutionState.PAUSED
+//					|| state == WorkflowExecutionState.STOPPED) {
+//				config.getWorkflow().setExecutionState(WorkflowExecutionState.STOPPED);
+//			}else if (state == WorkflowExecutionState.RUNNING) {
+//				config.getWorkflow().setExecutionState(WorkflowExecutionState.RUNNING);
+//			}
+			break;
+		case EXECUTION_TASK_START:
+			break;
+		case EXECUTION_TASK_END:
+			break;
+		case OPEN_SUBWORKFLOW:
+			break;
+		case HANDLE_DEPENDENT_NODES_DIFFERED_INPUTS:
+				break;
+		default:
+			return false;	
+		}
+		return true;
+	}
+
+	@Override
+	public Object retrieveData(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data)
+			throws Exception {
+		Object result = null;
+		switch (messageType) {
+		case INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW:
+			Workflow subWorkflow= (Workflow) data;
+            WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(subWorkflow,config.getTopic(),config.getMessageBoxURL(), config.getMessageBrokerURL(), config.getRegistry(), config.getConfiguration(), config.getGUI(), config.getMonitor());
+            if (config.isTestMode()){
+        		workflowInterpreterConfiguration.setNotifier(new StandaloneNotificationSender(workflowInterpreterConfiguration.getTopic(),workflowInterpreterConfiguration.getWorkflow()));
+            }
+			result = new WorkflowInterpreter(workflowInterpreterConfiguration
+					, 
+					new SSWorkflowInterpreterInteractorImpl());
+			break;
+//		case INPUT_GSS_CREDENTIAL:
+//			WorkflowInterpreter w = (WorkflowInterpreter) data;
+//			result = SecurityUtil.getGSSCredential(w.getUsername(),
+//					w.getPassword(), w.getConfig().getConfiguration().getMyProxyServer());
+//			break;
+//		case INPUT_LEAD_CONTEXT_HEADER:
+//			Node node = (Node) data;
+//			result = XBayaUtil.buildLeadContextHeader(config.getWorkflow(), config.getConfiguration(),
+//					new MonitorConfiguration(config.getMessageBrokerURL(),
+//							config.getTopic(), true,
+//							config.getMessageBoxURL()), node.getID(),
+//					null);
+//			break;
+		default:
+			break;
+		}
+		return result;
+	}
+
+	@Override
+	public void pauseExecution(WorkflowInterpreterConfiguration config) {
+		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.PAUSED);
+	}
+
+	@Override
+	public void resumeExecution(WorkflowInterpreterConfiguration config) {
+		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.RUNNING);
+	}
+
+	@Override
+	public void terminateExecution(WorkflowInterpreterConfiguration config) {
+		notify(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED,config, WorkflowExecutionState.STOPPED);
+	}
+
+	@Override
+	public boolean isExecutionPaused(WorkflowInterpreterConfiguration config) {
+		return config.getWorkflow().getExecutionState()==WorkflowExecutionState.PAUSED;
+	}
+
+	@Override
+	public boolean isExecutionTerminated(WorkflowInterpreterConfiguration config) {
+		return config.getWorkflow().getExecutionState()==WorkflowExecutionState.STOPPED;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java
new file mode 100644
index 0000000..432bc56
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/StandaloneNotificationSender.java
@@ -0,0 +1,135 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import java.net.URI;
+import java.util.List;
+
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.graph.controller.NodeController;
+import org.apache.airavata.xbaya.jython.lib.ServiceNotifiable;
+import org.apache.airavata.xbaya.jython.lib.StandaloneServiceNotificationSender;
+import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
+import org.apache.airavata.xbaya.ui.monitor.MonitorEventHandler.NodeState;
+import org.apache.axis2.addressing.EndpointReference;
+import org.python.core.PyObject;
+
+public class StandaloneNotificationSender implements WorkflowNotifiable {
+
+    private Workflow workflow;
+    private URI workflowID;
+
+    public StandaloneNotificationSender(String topic, Workflow workflow) {
+        this.workflow = workflow;
+        this.workflowID = URI.create(StringUtil.convertToJavaIdentifier(topic));
+    }
+
+    @Override
+    public EndpointReference getEventSink() {
+        return new EndpointReference(XBayaConstants.DEFAULT_BROKER_URL.toString());
+    }
+
+    @Override
+    public void workflowStarted(PyObject[] args, String[] keywords) {
+        List<InputNode> inputs = GraphUtil.getInputNodes(this.workflow.getGraph());
+        for (InputNode inputNode : inputs) {
+            inputNode.setState(NodeExecutionState.FINISHED);
+        }
+
+    }
+
+    @Override
+    public void workflowStarted(Object[] args, String[] keywords) {
+        List<InputNode> inputs = GraphUtil.getInputNodes(this.workflow.getGraph());
+        for (InputNode inputNode : inputs) {
+            inputNode.setState(NodeExecutionState.FINISHED);
+        }
+    }
+
+    @Override
+    public void workflowFinished(Object[] args, String[] keywords) {
+        List<OutputNode> outputs = GraphUtil.getOutputNodes(this.workflow.getGraph());
+        for (OutputNode outputNode : outputs) {
+        	outputNode.setState(NodeExecutionState.EXECUTING);
+        }
+
+    }
+
+    @Override
+    public void sendingPartialResults(Object[] args, String[] keywords) {
+        // noop
+
+    }
+
+    @Override
+    public void workflowFinished(PyObject[] args, String[] keywords) {
+        List<OutputNode> outputs = GraphUtil.getOutputNodes(this.workflow.getGraph());
+        for (OutputNode outputNode : outputs) {
+        	outputNode.setState(NodeExecutionState.EXECUTING);
+        }
+
+    }
+
+    @Override
+    public void workflowTerminated() {
+        // noop
+
+    }
+
+    @Override
+    public void workflowFailed(String message) {
+        // noop
+
+    }
+
+    @Override
+    public void workflowFailed(Throwable e) {
+        // noop
+
+    }
+
+    @Override
+    public void workflowFailed(String message, Throwable e) {
+        // noop
+
+    }
+
+    @Override
+    public ServiceNotifiable createServiceNotificationSender(String nodeID) {
+        return new StandaloneServiceNotificationSender(this.workflow, this.workflowID);
+    }
+
+    @Override
+    public void cleanup(){
+
+    }
+
+    public String getTopic() {
+        return this.workflowID.toASCIIString();
+    }
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java
new file mode 100644
index 0000000..d6a075a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/SystemComponentInvoker.java
@@ -0,0 +1,114 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowException;
+import org.apache.airavata.xbaya.invoker.Invoker;
+
+import xsul.wsif.WSIFMessage;
+import xsul.xwsif_runtime.WSIFClient;
+
+public class SystemComponentInvoker implements Invoker {
+
+    private Map<String, Object> outputs = new Hashtable<String, Object>();
+
+    /**
+     * 
+     * @param key
+     * @param value
+     */
+    public void addOutput(String key, Object value) {
+        outputs.put(key, value);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutput(java.lang.String)
+     */
+    @Override
+    public Object getOutput(String name) {
+        Object out = null;
+        while (out == null) {
+            try {
+                out = this.outputs.get(name);
+                Thread.sleep(200);
+            } catch (InterruptedException e) {
+                e.printStackTrace();
+            }
+        }
+        return out;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#getOutputs()
+     */
+    @Override
+    public WSIFMessage getOutputs() {
+        return null;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#invoke()
+     */
+    @Override
+    public boolean invoke() {
+        return true;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#setInput(java.lang.String, java.lang.Object)
+     */
+    @Override
+    public void setInput(String name, Object value) {
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.wXPath Operatorsorkflow.Invoker#setOperation(java.lang.String)
+     */
+    @Override
+    public void setOperation(String operationName) {
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.invoker.Invoker#setup()
+     */
+    @Override
+    public void setup() {
+    }
+
+    @Override
+    public WSIFClient getClient() {
+        return null;
+    }
+
+    @Override
+    public WSIFMessage getInputs() throws WorkflowException {
+        return null;
+    }
+
+    @Override
+    public WSIFMessage getFault() throws WorkflowException {
+        return null;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkFlowInterpreterException.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkFlowInterpreterException.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkFlowInterpreterException.java
new file mode 100644
index 0000000..7ec87e5
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkFlowInterpreterException.java
@@ -0,0 +1,37 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+public class WorkFlowInterpreterException extends RuntimeException {
+
+    public WorkFlowInterpreterException() {
+        super();
+    }
+
+    public WorkFlowInterpreterException(String message) {
+        super(message);
+    }
+
+    public WorkFlowInterpreterException(Throwable e) {
+        super(e);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java
new file mode 100644
index 0000000..98743a4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionMessage.java
@@ -0,0 +1,40 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+public enum WorkflowExecutionMessage {
+	NODE_STATE_CHANGED, 
+	//this.engine.getGUI().getGraphCanvas().repaint();
+	EXECUTION_STATE_CHANGED,
+	EXECUTION_RESUME,
+	EXECUTION_TASK_START,
+	EXECUTION_TASK_END,
+	EXECUTION_ERROR,
+	EXECUTION_CLEANUP,
+	OPEN_SUBWORKFLOW,
+	HANDLE_DEPENDENT_NODES_DIFFERED_INPUTS,
+	INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW,
+	INPUT_GSS_CREDENTIAL,
+	INPUT_LEAD_CONTEXT_HEADER,
+	INPUT_GFAC_INVOKER,
+	
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
new file mode 100644
index 0000000..4c34032
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowExecutionTemplate.java
@@ -0,0 +1,51 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.interpretor;
+
+import java.util.List;
+
+import org.apache.airavata.client.api.ExperimentAdvanceOptions;
+import org.apache.airavata.workflow.model.wf.WorkflowInput;
+
+public class WorkflowExecutionTemplate {
+	private String workflowTemplateName;
+	private List<WorkflowInput> input;
+	private ExperimentAdvanceOptions advanceOptions;
+	public String getWorkflowTemplateName() {
+		return workflowTemplateName;
+	}
+	public void setWorkflowTemplateName(String workflowTemplateName) {
+		this.workflowTemplateName = workflowTemplateName;
+	}
+	public List<WorkflowInput> getInput() {
+		return input;
+	}
+	public void setInput(List<WorkflowInput> input) {
+		this.input = input;
+	}
+	public ExperimentAdvanceOptions getAdvanceOptions() {
+		return advanceOptions;
+	}
+	public void setAdvanceOptions(ExperimentAdvanceOptions advanceOptions) {
+		this.advanceOptions = advanceOptions;
+	}
+}


[42/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ConfigurationResourceClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ConfigurationResourceClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ConfigurationResourceClient.java
deleted file mode 100644
index 969ca02..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/ConfigurationResourceClient.java
+++ /dev/null
@@ -1,1141 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.rest.mappings.resourcemappings.ConfigurationList;
-import org.apache.airavata.rest.mappings.resourcemappings.URLList;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.utils.BasicAuthHeaderUtil;
-import org.apache.airavata.rest.utils.ClientConstant;
-import org.apache.airavata.rest.utils.CookieManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.ws.rs.core.*;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-public class ConfigurationResourceClient {
-    private WebResource webResource;
-    private final static Logger logger = LoggerFactory.getLogger(ConfigurationResourceClient.class);
-    private String userName;
-    private PasswordCallback callback;
-    private String baseURI;
-    private Cookie cookie;
-    private WebResource.Builder builder;
-    private ClientResponse response;
-    private String gateway;
-//    private CookieManager cookieManager = new CookieManager();
-
-    public ConfigurationResourceClient(String userName,
-                                       String gateway,
-                                       String seriveURI,
-                                       PasswordCallback callback,
-                                       Cookie cookie) {
-        this.userName = userName;
-        this.callback = callback;
-        this.baseURI = seriveURI;
-        this.gateway = gateway;
-        this.cookie = cookie;
-    }
-
-    private URI getBaseURI() {
-        logger.debug("Creating Base URI");
-        return UriBuilder.fromUri(baseURI).build();
-    }
-
-    private WebResource getConfigurationBaseResource() {
-        ClientConfig config = new DefaultClientConfig();
-        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
-                Boolean.TRUE);
-        Client client = Client.create(config);
-        WebResource baseWebResource = client.resource(getBaseURI());
-        webResource = baseWebResource.path(ResourcePathConstants.
-                ConfigResourcePathConstants.CONFIGURATION_REGISTRY_RESOURCE);
-        return webResource;
-    }
-
-
-    public Object getConfiguration(String configKey) {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.GET_CONFIGURATION);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("key", configKey);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        response = builder.get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.get(ClientResponse.class);
-
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else  if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-        String output = response.getEntity(String.class);
-        return output;
-    }
-
-    public List<Object> getConfigurationList(String configKey) {
-        List<Object> configurationValueList = new ArrayList<Object>();
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.GET_CONFIGURATION_LIST);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("key", configKey);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        response = builder.accept(
-                MediaType.APPLICATION_JSON).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = webResource.queryParams(queryParams).accept(
-                    MediaType.APPLICATION_JSON).get(ClientResponse.class);
-
-
-            status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return configurationValueList;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return configurationValueList;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        ConfigurationList configurationList = response.getEntity(ConfigurationList.class);
-        Object[] configValList = configurationList.getConfigValList();
-        for (Object configVal : configValList) {
-            configurationValueList.add(configVal);
-        }
-
-        return configurationValueList;
-    }
-
-    public void setConfiguration(String configKey, String configVal, Date date) {
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String formattedDate = dateFormat.format(date);
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.SAVE_CONFIGURATION);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("key", configKey);
-        formData.add("value", configVal);
-        formData.add("date", formattedDate);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).post(
-                ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).post(
-                    ClientResponse.class, formData);
-
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addConfiguration(String configKey, String configVal, Date date) {
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String formattedDate = dateFormat.format(date);
-        webResource = getConfigurationBaseResource().path(ResourcePathConstants.
-                ConfigResourcePathConstants.UPDATE_CONFIGURATION);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("key", configKey);
-        formData.add("value", configVal);
-        formData.add("date", formattedDate);
-        builder = BasicAuthHeaderUtil.getBuilder(webResource, null,
-                userName, null, cookie, gateway);
-
-        response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).
-                post(ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(webResource, null,
-                    userName, callback.getPassword(userName), null, gateway);
-            response = builder.type(MediaType.APPLICATION_FORM_URLENCODED).
-                    post(ClientResponse.class, formData);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void removeAllConfiguration(String key) {
-        webResource = getConfigurationBaseResource().path(ResourcePathConstants.
-                ConfigResourcePathConstants.DELETE_ALL_CONFIGURATION);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("key", key);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void removeConfiguration(String key, String value) {
-        webResource = getConfigurationBaseResource().path(ResourcePathConstants.
-                ConfigResourcePathConstants.DELETE_CONFIGURATION);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("key", key);
-        queryParams.add("value", value);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public List<URI> getGFacURIs() {
-        List<URI> uriList = new ArrayList<URI>();
-        try {
-            webResource = getConfigurationBaseResource().path(ResourcePathConstants.
-                    ConfigResourcePathConstants.GET_GFAC_URI_LIST);
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, null, cookie, gateway);
-
-            response = builder.get(ClientResponse.class);
-            int status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-                builder = BasicAuthHeaderUtil.getBuilder(
-                        webResource, null, userName, callback.getPassword(userName), null, gateway);
-                response = builder.get(ClientResponse.class);
-                status = response.getStatus();
-
-                if (status == ClientConstant.HTTP_NO_CONTENT) {
-                    return uriList;
-                }
-
-                if (status != ClientConstant.HTTP_OK) {
-                    logger.error(response.getEntity(String.class));
-                    throw new RuntimeException("Failed : HTTP error code : "
-                            + status);
-                } else {
-                    if (response.getCookies().size() > 0) {
-                        cookie = response.getCookies().get(0).toCookie();
-                        CookieManager.setCookie(cookie);
-                    }
-                }
-            } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return uriList;
-            } else {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            }
-
-            URLList urlList = response.getEntity(URLList.class);
-            String[] uris = urlList.getUris();
-            for (String url : uris) {
-                URI uri = new URI(url);
-                uriList.add(uri);
-            }
-        } catch (URISyntaxException e) {
-            logger.error("URI syntax is not correct...");
-            return null;
-        }
-        return uriList;
-    }
-
-    public List<URI> getWorkflowInterpreterURIs() {
-        List<URI> uriList = new ArrayList<URI>();
-        try {
-            webResource = getConfigurationBaseResource().path(ResourcePathConstants.
-                    ConfigResourcePathConstants.GET_WFINTERPRETER_URI_LIST);
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, null, cookie, gateway);
-
-            response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-            int status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-                builder = BasicAuthHeaderUtil.getBuilder(
-                        webResource, null, userName, callback.getPassword(userName), null, gateway);
-                response = builder.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class);
-                status = response.getStatus();
-
-                if (status == ClientConstant.HTTP_NO_CONTENT) {
-                    return uriList;
-                }
-
-                if (status != ClientConstant.HTTP_OK) {
-                    logger.error(response.getEntity(String.class));
-                    throw new RuntimeException("Failed : HTTP error code : "
-                            + status);
-                } else {
-                    if (response.getCookies().size() > 0) {
-                        cookie = response.getCookies().get(0).toCookie();
-                        CookieManager.setCookie(cookie);
-                    }
-                }
-            } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return uriList;
-            } else {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            }
-
-            URLList urlList = response.getEntity(URLList.class);
-            String[] uris = urlList.getUris();
-            for (String url : uris) {
-                URI uri = new URI(url);
-                uriList.add(uri);
-            }
-        } catch (URISyntaxException e) {
-            return null;
-        }
-        return uriList;
-    }
-
-
-    public URI getEventingURI() {
-        try {
-            webResource = getConfigurationBaseResource().path(ResourcePathConstants.
-                    ConfigResourcePathConstants.GET_EVENTING_URI);
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, null, cookie, gateway);
-
-            response = builder.get(ClientResponse.class);
-            int status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-                builder = BasicAuthHeaderUtil.getBuilder(
-                        webResource, null, userName, callback.getPassword(userName), null, gateway);
-                response = builder.get(ClientResponse.class);
-                status = response.getStatus();
-
-                if (status == ClientConstant.HTTP_NO_CONTENT) {
-                    return null;
-                }
-
-                if (status != ClientConstant.HTTP_OK) {
-                    logger.error(response.getEntity(String.class));
-                    throw new RuntimeException("Failed : HTTP error code : "
-                            + status);
-                } else {
-                    if (response.getCookies().size() > 0) {
-                        cookie = response.getCookies().get(0).toCookie();
-                        CookieManager.setCookie(cookie);
-                    }
-                }
-            } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            } else {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            }
-
-            String uri = response.getEntity(String.class);
-            URI eventingURI = new URI(uri);
-            return eventingURI;
-        } catch (URISyntaxException e) {
-            return null;
-        }
-    }
-
-    public URI getMsgBoxURI() {
-        try {
-            webResource = getConfigurationBaseResource().path(ResourcePathConstants.
-                    ConfigResourcePathConstants.GET_MESSAGE_BOX_URI);
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, null, cookie, gateway);
-
-            response = builder.get(ClientResponse.class);
-            int status = response.getStatus();
-
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    if (response.getCookies().size() > 0) {
-                        cookie = response.getCookies().get(0).toCookie();
-                        CookieManager.setCookie(cookie);
-                    }
-                }
-            } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-                builder = BasicAuthHeaderUtil.getBuilder(
-                        webResource, null, userName, callback.getPassword(userName), null, gateway);
-                response = builder.get(ClientResponse.class);
-                status = response.getStatus();
-
-                if (status == ClientConstant.HTTP_NO_CONTENT) {
-                    return null;
-                }
-
-                if (status != ClientConstant.HTTP_OK) {
-                    logger.error(response.getEntity(String.class));
-                    throw new RuntimeException("Failed : HTTP error code : "
-                            + status);
-                } else {
-                    if (response.getCookies().size() > 0) {
-                        cookie = response.getCookies().get(0).toCookie();
-                        CookieManager.setCookie(cookie);
-                    }
-                }
-            } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            } else {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            }
-
-            String uri = response.getEntity(String.class);
-            URI msgBoxURI = new URI(uri);
-            return msgBoxURI;
-        } catch (URISyntaxException e) {
-            return null;
-        }
-    }
-
-    public void addGFacURI(URI uri) {
-        webResource = getConfigurationBaseResource().path(ResourcePathConstants.
-                ConfigResourcePathConstants.ADD_GFAC_URI);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("uri", uri.toString());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.accept(MediaType.TEXT_PLAIN).
-                post(ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addWFInterpreterURI(URI uri) {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.ADD_WFINTERPRETER_URI);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("uri", uri.toString());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, callback.getPassword(userName), null, gateway);
-
-        response = builder.accept(MediaType.TEXT_PLAIN).post(
-                ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void setEventingURI(URI uri) {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.ADD_EVENTING_URI);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("uri", uri.toString());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void setMessageBoxURI(URI uri) {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.ADD_MESSAGE_BOX_URI);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("uri", uri.toString());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addGFacURIByDate(URI uri, Date date) {
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String formattedDate = dateFormat.format(date);
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.ADD_GFAC_URI_DATE);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("uri", uri.toString());
-        formData.add("date", formattedDate);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void addWorkflowInterpreterURI(URI uri, Date date) {
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String formattedDate = dateFormat.format(date);
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.ADD_WFINTERPRETER_URI_DATE);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("uri", uri.toString());
-        formData.add("date", formattedDate);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void setEventingURIByDate(URI uri, Date date) {
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String formattedDate = dateFormat.format(date);
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.ADD_EVENTING_URI_DATE);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("uri", uri.toString());
-        formData.add("date", formattedDate);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.accept(
-                MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void setMessageBoxURIByDate(URI uri, Date date) {
-        DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
-        String formattedDate = dateFormat.format(date);
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.ADD_MSG_BOX_URI_DATE);
-        MultivaluedMap formData = new MultivaluedMapImpl();
-        formData.add("uri", uri.toString());
-        formData.add("date", formattedDate);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formData);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void removeGFacURI(URI uri) {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.DELETE_GFAC_URI);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("uri", uri.toString());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void removeAllGFacURI() {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_GFAC_URIS);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void removeWorkflowInterpreterURI(URI uri) {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.DELETE_WFINTERPRETER_URI);
-        MultivaluedMap queryParams = new MultivaluedMapImpl();
-        queryParams.add("uri", uri.toString());
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-
-        response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK && status != ClientConstant.HTTP_UNAUTHORIZED) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void removeAllWorkflowInterpreterURI() {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.DELETE_ALL_WFINTERPRETER_URIS);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void unsetEventingURI() {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.DELETE_EVENTING_URI);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public void unsetMessageBoxURI() {
-        webResource = getConfigurationBaseResource().path(
-                ResourcePathConstants.ConfigResourcePathConstants.DELETE_MSG_BOX_URI);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-
-        response = builder.delete(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.delete(ClientResponse.class);
-            status = response.getStatus();
-
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/rest/client/src/main/java/org/apache/airavata/rest/client/CredentialStoreResourceClient.java
----------------------------------------------------------------------
diff --git a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/CredentialStoreResourceClient.java b/modules/rest/client/src/main/java/org/apache/airavata/rest/client/CredentialStoreResourceClient.java
deleted file mode 100644
index 29fbef9..0000000
--- a/modules/rest/client/src/main/java/org/apache/airavata/rest/client/CredentialStoreResourceClient.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.rest.client;
-
-import java.net.URI;
-
-import javax.ws.rs.core.Cookie;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedMap;
-import javax.ws.rs.core.UriBuilder;
-
-import org.apache.airavata.registry.api.PasswordCallback;
-import org.apache.airavata.rest.mappings.utils.ResourcePathConstants;
-import org.apache.airavata.rest.utils.BasicAuthHeaderUtil;
-import org.apache.airavata.rest.utils.ClientConstant;
-import org.apache.airavata.rest.utils.CookieManager;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import com.sun.jersey.api.client.Client;
-import com.sun.jersey.api.client.ClientResponse;
-import com.sun.jersey.api.client.WebResource;
-import com.sun.jersey.api.client.config.ClientConfig;
-import com.sun.jersey.api.client.config.DefaultClientConfig;
-import com.sun.jersey.api.json.JSONConfiguration;
-import com.sun.jersey.core.util.MultivaluedMapImpl;
-
-public class CredentialStoreResourceClient {
-    private WebResource webResource;
-    private final static Logger logger = LoggerFactory.getLogger(CredentialStoreResourceClient.class);
-    private String userName;
-    private PasswordCallback callback;
-    private String baseURI;
-    private Cookie cookie;
-    private WebResource.Builder builder;
-    private String gateway;
-
-    public CredentialStoreResourceClient(String userName,
-                                    String gateway,
-                                    String serviceURL,
-                                    PasswordCallback callback,
-                                    Cookie cookie) {
-        this.userName = userName;
-        this.callback = callback;
-        this.baseURI = serviceURL;
-        this.gateway = gateway;
-        this.cookie = cookie;
-    }
-
-    private URI getBaseURI() {
-        logger.debug("Creating Base URI");
-        return UriBuilder.fromUri(baseURI).build();
-    }
-
-    private WebResource getCredentialStoreRegistryBaseResource() {
-        ClientConfig config = new DefaultClientConfig();
-        config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING,
-                Boolean.TRUE);
-        Client client = Client.create(config);
-        WebResource baseWebResource = client.resource(getBaseURI());
-        webResource = baseWebResource.path(
-                ResourcePathConstants.CredentialResourceConstants.REGISTRY_API_CREDENTIALREGISTRY);
-        return webResource;
-    }
-
-    public boolean isCredentialExist(String gatewayId, String tokenId) {
-    	webResource = getCredentialStoreRegistryBaseResource().path(
-                ResourcePathConstants.CredentialResourceConstants.SSH_CREDENTIAL_EXIST);
-        MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
-        queryParams.add("gatewayId", gatewayId);
-        queryParams.add("tokenId", tokenId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equalsIgnoreCase("true")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_OK) {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-            String exists = response.getEntity(String.class);
-            if (exists.equalsIgnoreCase("true")) {
-                return true;
-            } else {
-                return false;
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-    }
-
-    public String getCredentialPublicKey(String gatewayId, String tokenId) {
-        webResource = getCredentialStoreRegistryBaseResource().path(
-                ResourcePathConstants.CredentialResourceConstants.SSH_CREDENTIAL);
-        MultivaluedMap<String, String> queryParams = new MultivaluedMapImpl();
-        queryParams.add("gatewayId", gatewayId);
-        queryParams.add("tokenId", tokenId);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, queryParams, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(
-                MediaType.TEXT_PLAIN).get(ClientResponse.class);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, queryParams, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).get(ClientResponse.class);
-            status = response.getStatus();
-            if (status == ClientConstant.HTTP_NO_CONTENT) {
-                return null;
-            }
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else if (status == ClientConstant.HTTP_NO_CONTENT) {
-            return null;
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-
-        String publicKey = response.getEntity(String.class);
-        return publicKey;
-    }
-    
-    public String createCredential(String gatewayId, String tokenId) {
-    	return this.createCredential(gatewayId, tokenId, null);
-    }
-    
-    public String createCredential(String gatewayId, String tokenId, String username) {
-    	webResource = getCredentialStoreRegistryBaseResource().path(
-                ResourcePathConstants.CredentialResourceConstants.SSH_CREDENTIAL);
-        MultivaluedMap<String, String> formParams = new MultivaluedMapImpl();
-        formParams.add("gatewayId", gatewayId);
-        formParams.add("tokenId", tokenId);
-        if(username!=null)
-        	formParams.add("username", username);
-        builder = BasicAuthHeaderUtil.getBuilder(
-                webResource, null, userName, null, cookie, gateway);
-        ClientResponse response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-        int status = response.getStatus();
-
-        if (status == ClientConstant.HTTP_OK) {
-            if (response.getCookies().size() > 0) {
-                cookie = response.getCookies().get(0).toCookie();
-                CookieManager.setCookie(cookie);
-            }
-        } else if (status == ClientConstant.HTTP_UNAUTHORIZED) {
-            builder = BasicAuthHeaderUtil.getBuilder(
-                    webResource, null, userName, callback.getPassword(userName), null, gateway);
-            response = builder.accept(MediaType.TEXT_PLAIN).post(ClientResponse.class, formParams);
-            status = response.getStatus();
-            if (status != ClientConstant.HTTP_OK) {
-                logger.error(response.getEntity(String.class));
-                throw new RuntimeException("Failed : HTTP error code : "
-                        + status);
-            } else {
-                if (response.getCookies().size() > 0) {
-                    cookie = response.getCookies().get(0).toCookie();
-                    CookieManager.setCookie(cookie);
-                }
-            }
-        } else {
-            logger.error(response.getEntity(String.class));
-            throw new RuntimeException("Failed : HTTP error code : "
-                    + status);
-        }
-        
-        String publicKey = response.getEntity(String.class);
-        return publicKey;
-    }
-
-}


[23/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/SenderUtils.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/SenderUtils.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/SenderUtils.java
deleted file mode 100644
index 072cbb3..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/SenderUtils.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger;
-
-import java.io.StringReader;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.commons.CommonRoutines;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.config.WSMGParameter;
-import org.apache.airavata.wsmg.messenger.protocol.DeliveryProtocol;
-import org.apache.airavata.wsmg.messenger.protocol.SendingException;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
-import org.apache.axis2.addressing.EndpointReference;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/*
- * this class is not thread safe
- * */
-public class SenderUtils implements Deliverable {
-
-    private static final Logger logger = LoggerFactory.getLogger(SenderUtils.class);
-
-    private static OMFactory factory = OMAbstractFactory.getOMFactory();
-
-    private ConsumerUrlManager urlManager;
-
-    private DeliveryProtocol protocol;
-
-    public SenderUtils(ConsumerUrlManager urlMan) {
-        urlManager = urlMan;
-    }
-
-    public void setProtocol(DeliveryProtocol protocol) {
-        this.protocol = protocol;
-    }
-
-    public void send(ConsumerInfo consumerInfo, OMElement notificationMessageBodyEl,
-            AdditionalMessageContent additionalMessageContent) {
-
-        if (consumerInfo.isPaused()) {
-            return;
-        }
-
-        if (notificationMessageBodyEl == null) {
-            logger.info("notification message is null, IGNORED");
-            return;
-        }
-
-        if (urlManager.isUnavailable(consumerInfo.getConsumerEprStr())) {
-            logger.info("consumer url is unavailable: " + consumerInfo.getConsumerEprStr());
-            return;
-        }
-
-        EndpointReference consumerReference = new EndpointReference(consumerInfo.getConsumerEprStr());
-
-        /*
-         * Extract message
-         */
-        OMElement message = null;
-        if (consumerInfo.getType().compareTo("wsnt") == 0) {
-            if (consumerInfo.isUseNotify()) {
-                message = wrapRawMessageToWsntWrappedFormat(notificationMessageBodyEl, additionalMessageContent);
-            } else {
-                message = notificationMessageBodyEl;
-            }
-        } else { // wse
-            message = notificationMessageBodyEl;
-        }
-
-        long timeElapsed = -1;
-        long startTime = -1;
-
-        startTime = System.currentTimeMillis();
-
-        try {
-
-            /*
-             * sending message out
-             */
-            protocol.deliver(consumerInfo, message, additionalMessageContent);
-
-            long finishTime = System.currentTimeMillis();
-            timeElapsed = finishTime - startTime;
-            if (WSMGParameter.showTrackId)
-                logger.info(String.format("track id = %s : delivered to: %s in %d ms",
-                        additionalMessageContent.getTrackId(), consumerReference.getAddress(), timeElapsed));
-
-            urlManager.onSucessfullDelivery(consumerReference, timeElapsed);
-        } catch (SendingException ex) {
-
-            long finishTime = System.currentTimeMillis();
-            timeElapsed = finishTime - startTime;
-
-            urlManager.onFailedDelivery(consumerReference, finishTime, timeElapsed, ex, additionalMessageContent);
-
-        }
-    }
-
-    public OMElement wrapRawMessageToWsntWrappedFormat(OMElement rawNotif,
-            AdditionalMessageContent additionalMessageContent) {
-
-        OMElement fullNotif = factory.createOMElement("Notify", NameSpaceConstants.WSNT_NS);
-
-        OMElement notificationMessageEl = factory.createOMElement("NotificationMessage", NameSpaceConstants.WSNT_NS,
-                fullNotif);
-
-        String topicElString = additionalMessageContent.getTopicElement();
-        if (topicElString != null) {
-            OMElement topicEl = null;
-            try {
-                topicEl = CommonRoutines.reader2OMElement(new StringReader(topicElString));
-            } catch (XMLStreamException e) {
-                logger.error("XMLStreamreader exception when setting topicEl", e);
-            }
-            notificationMessageEl.addChild(topicEl);
-        }
-        String producerReferenceElString = additionalMessageContent.getProducerReference();
-        if (producerReferenceElString != null) {
-            OMElement producerReferenceEl = null;
-            try {
-                producerReferenceEl = CommonRoutines.reader2OMElement(new StringReader(producerReferenceElString));
-            } catch (XMLStreamException e) {
-                logger.error("XMLStreamException at creating producerReferenceEl", e);
-            }
-            notificationMessageEl.addChild(producerReferenceEl);
-        }
-
-        OMElement messageEl = factory.createOMElement("Message", NameSpaceConstants.WSNT_NS, notificationMessageEl);
-        messageEl.addChild(rawNotif);
-
-        return fullNotif;
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/DeliveryProtocol.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/DeliveryProtocol.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/DeliveryProtocol.java
deleted file mode 100644
index 417cef7..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/DeliveryProtocol.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger.protocol;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.axiom.om.OMElement;
-
-public interface DeliveryProtocol {
-
-    public void deliver(ConsumerInfo consumerInfo, OMElement message, AdditionalMessageContent additionalMessageContent)
-            throws SendingException;
-
-    public void setTimeout(long timeout);
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/SendingException.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/SendingException.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/SendingException.java
deleted file mode 100644
index c4dd24a..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/SendingException.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger.protocol;
-
-import org.apache.axis2.AxisFault;
-
-public class SendingException extends AxisFault {
-
-    /**
-	 * 
-	 */
-    private static final long serialVersionUID = 6250791562500752579L;
-
-    public SendingException(Throwable cause) {
-        super(cause);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/impl/Axis2Protocol.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/impl/Axis2Protocol.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/impl/Axis2Protocol.java
deleted file mode 100644
index 7e2568a..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/protocol/impl/Axis2Protocol.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger.protocol.impl;
-
-import java.io.StringReader;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.commons.CommonRoutines;
-import org.apache.airavata.wsmg.commons.NameSpaceConstants;
-import org.apache.airavata.wsmg.messenger.protocol.DeliveryProtocol;
-import org.apache.airavata.wsmg.messenger.protocol.SendingException;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.util.ElementHelper;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axiom.soap.SOAPHeaderBlock;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.client.Options;
-import org.apache.axis2.client.ServiceClient;
-import org.apache.axis2.transport.http.HTTPConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class Axis2Protocol implements DeliveryProtocol {
-
-    private static final Logger logger = LoggerFactory.getLogger(Axis2Protocol.class);
-
-    private static SOAPFactory soapfactory = OMAbstractFactory.getSOAP11Factory();
-
-    private ServiceClient nonThreadLocalServiceClient;
-
-    long tcpConnectionTimeout;
-
-    public void deliver(ConsumerInfo consumerInfo, OMElement message, AdditionalMessageContent additionalMessageContent)
-            throws SendingException {
-        EndpointReference consumerReference = new EndpointReference(consumerInfo.getConsumerEprStr());
-
-        /*
-         * Extract information
-         */
-        String actionString = null;
-        List<OMElement> soapHeaders = new LinkedList<OMElement>();
-        if (consumerInfo.getType().compareTo("wsnt") == 0) {
-            actionString = NameSpaceConstants.WSNT_NS.getNamespaceURI() + "/Notify";
-        } else { // wse
-            actionString = additionalMessageContent.getAction();
-            String topicElString = additionalMessageContent.getTopicElement();
-            if (topicElString != null) {
-                OMElement topicEl = null;
-                try {
-                    topicEl = CommonRoutines.reader2OMElement(new StringReader(topicElString));
-                    soapHeaders.add(topicEl);
-                } catch (XMLStreamException e) {
-                    logger.error("exception at topicEl xmlStreamException", e);
-                }
-            }
-        }
-
-        ServiceClient client = null;
-        try {
-
-            client = configureServiceClient(actionString, consumerReference, additionalMessageContent.getMessageID(),
-                    soapHeaders);
-
-            client.sendRobust(message);
-
-        } catch (AxisFault ex) {
-            throw new SendingException(ex.getCause());
-        } finally {
-            if (client != null) {
-                try {
-                    client.cleanup();
-                    client.cleanupTransport();
-                } catch (AxisFault ex) {
-                    logger.error(ex.getMessage(), ex);
-                }
-            }
-        }
-    }
-
-    public void setTimeout(long timeout) {
-        this.tcpConnectionTimeout = timeout;
-    }
-
-    private ServiceClient configureServiceClient(String action, EndpointReference consumerLocation, String msgId,
-            List<OMElement> soapHeaders) throws AxisFault {
-
-        // not engaging addressing modules
-        ServiceClient client = getServiceClient();
-
-        SOAPHeaderBlock msgIdEl = soapfactory.createSOAPHeaderBlock("MessageID", NameSpaceConstants.WSA_NS);
-        msgIdEl.setText(msgId);
-        SOAPHeaderBlock actionEl = soapfactory.createSOAPHeaderBlock("Action", NameSpaceConstants.WSA_NS);
-        actionEl.setText(action);
-
-        SOAPHeaderBlock to = soapfactory.createSOAPHeaderBlock("To", NameSpaceConstants.WSA_NS);
-        to.setText(consumerLocation.getAddress());
-
-        client.addHeader(actionEl);
-        client.addHeader(msgIdEl);
-        client.addHeader(to);
-
-        for (OMElement omHeader : soapHeaders) {
-            try {
-                SOAPHeaderBlock headerBlock = ElementHelper.toSOAPHeaderBlock(omHeader, soapfactory);
-                client.addHeader(headerBlock);
-            } catch (Exception e) {
-                throw AxisFault.makeFault(e);
-            }
-        }
-
-        Options opts = new Options();
-        opts.setTimeOutInMilliSeconds(tcpConnectionTimeout);
-        opts.setMessageId(msgId);
-        opts.setTo(consumerLocation);
-        opts.setAction(action);
-        opts.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
-        opts.setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION, HTTPConstants.HEADER_PROTOCOL_10);
-        client.setOptions(opts);
-
-        return client;
-    }
-
-    private ServiceClient getServiceClient() throws AxisFault {
-        if (nonThreadLocalServiceClient == null) {
-            nonThreadLocalServiceClient = new ServiceClient();
-        }
-        nonThreadLocalServiceClient.removeHeaders();
-        return nonThreadLocalServiceClient;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/SendingStrategy.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/SendingStrategy.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/SendingStrategy.java
deleted file mode 100644
index 9eb50cc..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/SendingStrategy.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger.strategy;
-
-import org.apache.airavata.wsmg.commons.OutGoingMessage;
-import org.apache.airavata.wsmg.messenger.Deliverable;
-
-public interface SendingStrategy {
-    void init();
-
-    void addMessageToSend(OutGoingMessage outMessage, Deliverable deliverable);
-
-    void shutdown();
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ConsumerHandler.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ConsumerHandler.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ConsumerHandler.java
deleted file mode 100644
index 5236f47..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ConsumerHandler.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger.strategy.impl;
-
-import java.io.StringReader;
-import java.util.List;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.apache.airavata.wsmg.commons.CommonRoutines;
-import org.apache.airavata.wsmg.messenger.Deliverable;
-import org.apache.axiom.om.OMElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public abstract class ConsumerHandler implements Runnable {
-
-    private static final Logger log = LoggerFactory.getLogger(FixedParallelSender.class);
-
-    protected LinkedBlockingQueue<LightweightMsg> queue = new LinkedBlockingQueue<LightweightMsg>();
-
-    private String consumerUrl;
-
-    private Deliverable deliverable;
-
-    public ConsumerHandler(String url, Deliverable deliverable) {
-        this.consumerUrl = url;
-        this.deliverable = deliverable;
-    }
-
-    public String getConsumerUrl() {
-        return consumerUrl;
-    }
-
-    public void submitMessage(LightweightMsg msg) {
-        try {
-            queue.put(msg);
-        } catch (InterruptedException e) {
-            log.error("Interrupted when trying to add message");
-        }
-    }
-
-    protected void send(List<LightweightMsg> list) {
-        for (LightweightMsg m : list) {
-            try {
-                OMElement messgae2Send = CommonRoutines.reader2OMElement(new StringReader(m.getPayLoad()));
-                deliverable.send(m.getConsumerInfo(), messgae2Send, m.getHeader());
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/FixedParallelSender.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/FixedParallelSender.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/FixedParallelSender.java
deleted file mode 100644
index 7d21fdb..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/FixedParallelSender.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger.strategy.impl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.commons.OutGoingMessage;
-import org.apache.airavata.wsmg.messenger.Deliverable;
-import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class FixedParallelSender implements SendingStrategy {
-
-    private static final Logger log = LoggerFactory.getLogger(FixedParallelSender.class);
-
-    private static final long TIME_TO_WAIT_FOR_SHUTDOWN_SECOND = 30;
-
-    private HashMap<String, ConsumerHandler> activeConsumerHandlers = new HashMap<String, ConsumerHandler>();
-    private HashMap<String, Boolean> submittedConsumerHandlers = new HashMap<String, Boolean>();
-
-    private int batchSize;
-
-    private ExecutorService threadPool;
-
-    private boolean stop;
-
-    private Thread t;
-
-    public FixedParallelSender(int poolsize, int batchsize) {
-        this.threadPool = Executors.newFixedThreadPool(poolsize);
-        this.batchSize = batchsize;
-    }
-
-    public void init() {
-        this.t = new Thread(new ChooseHandlerToSubmit());
-        this.t.start();
-    }
-
-    public void addMessageToSend(OutGoingMessage outMessage, Deliverable deliverable) {
-        List<ConsumerInfo> consumerInfoList = outMessage.getConsumerInfoList();
-        for (ConsumerInfo consumer : consumerInfoList) {
-            sendToConsumerHandler(consumer, outMessage, deliverable);
-        }
-    }
-
-    public void shutdown() {
-        log.debug("Shutting down");
-        this.stop = true;
-
-        try {
-            this.t.join();
-        } catch (InterruptedException ie) {
-            log.error("Wait for ChooseHandlerToSubmit thread to finish (join) is interrupted");
-        }
-
-        threadPool.shutdown();
-        try {
-            threadPool.awaitTermination(TIME_TO_WAIT_FOR_SHUTDOWN_SECOND, TimeUnit.SECONDS);
-        } catch (InterruptedException ie) {
-            log.error("Interrupted while waiting thread pool to shutdown");
-        }
-
-        log.debug("Shut down");
-    }
-
-    private void sendToConsumerHandler(ConsumerInfo consumer, OutGoingMessage message, Deliverable deliverable) {
-
-        String consumerUrl = consumer.getConsumerEprStr();
-
-        LightweightMsg lwm = new LightweightMsg(consumer, message.getTextMessage(),
-                message.getAdditionalMessageContent());
-
-        synchronized (activeConsumerHandlers) {
-            ConsumerHandler handler = activeConsumerHandlers.get(consumerUrl);
-            if (handler == null) {
-                handler = new FixedParallelConsumerHandler(consumerUrl, deliverable);
-                activeConsumerHandlers.put(consumerUrl, handler);
-                submittedConsumerHandlers.put(consumerUrl, Boolean.FALSE);
-            }
-            handler.submitMessage(lwm);
-        }
-    }
-
-    class ChooseHandlerToSubmit implements Runnable {
-        private static final int SLEEP_TIME_SECONDS = 1;
-
-        public void run() {
-            /*
-             * If stop is true, we will not get any message to send from addMessageToSend() method. So,
-             * activeConsumerHandlers size will not increase but decrease only. When shutdown() is invoked, we will have
-             * to send out all messages in our queue.
-             */
-            while (!stop || activeConsumerHandlers.size() > 0) {
-
-                synchronized (activeConsumerHandlers) {
-                    Iterator<String> it = activeConsumerHandlers.keySet().iterator();
-                    while (it.hasNext()) {
-                        String key = it.next();
-                        boolean submitted = submittedConsumerHandlers.get(key);
-
-                        /*
-                         * If consumer handlers is not scheduled to run, submit it to thread pool.
-                         */
-                        if (!submitted) {
-                            threadPool.submit(activeConsumerHandlers.get(key));
-                            submittedConsumerHandlers.put(key, Boolean.TRUE);
-                        }
-                    }
-                }
-
-                try {
-                    TimeUnit.SECONDS.sleep(SLEEP_TIME_SECONDS);
-                } catch (InterruptedException e) {
-                    log.error("interrupted while waiting", e);
-                }
-            }
-        }
-    }
-
-    class FixedParallelConsumerHandler extends ConsumerHandler {
-
-        public FixedParallelConsumerHandler(String url, Deliverable deliverable) {
-            super(url, deliverable);
-        }
-
-        public void run() {
-
-            log.debug(String.format("FixedParallelConsumerHandler starting: %s", getConsumerUrl()));
-
-            ArrayList<LightweightMsg> localList = new ArrayList<LightweightMsg>();
-
-            queue.drainTo(localList, batchSize);
-
-            send(localList);
-            localList.clear();
-
-            /*
-             * Remove handler if and only if there is no message
-             */
-            synchronized (activeConsumerHandlers) {
-
-                /*
-                 * all message is sent or not, we will set it as not submitted. So, it can be put back to thread pool.
-                 */
-                submittedConsumerHandlers.put(getConsumerUrl(), Boolean.FALSE);
-
-                if (queue.size() == 0) {
-                    submittedConsumerHandlers.remove(getConsumerUrl());
-                    activeConsumerHandlers.remove(getConsumerUrl());
-
-                    log.debug(String.format("Consumer handler is already removed: %s", getConsumerUrl()));
-                }
-            }
-
-            log.debug(String.format("FixedParallelConsumerHandler done: %s,", getConsumerUrl()));
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/LightweightMsg.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/LightweightMsg.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/LightweightMsg.java
deleted file mode 100644
index ca56c58..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/LightweightMsg.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger.strategy.impl;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-
-class LightweightMsg {
-    private ConsumerInfo consumerInfo;
-    private String payload;
-    private AdditionalMessageContent header;
-
-    public LightweightMsg(ConsumerInfo c, String pld, AdditionalMessageContent h) {
-        consumerInfo = c;
-        payload = pld;
-        header = h;
-    }
-
-    public String getPayLoad() {
-        return payload;
-    }
-
-    public ConsumerInfo getConsumerInfo() {
-        return consumerInfo;
-    }
-
-    public AdditionalMessageContent getHeader() {
-        return header;
-    }
-
-    public String toString() {
-        return String.format("header: %s, consumer: %s, pld: %s", header, consumerInfo.getConsumerEprStr(), payload);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ParallelSender.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ParallelSender.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ParallelSender.java
deleted file mode 100644
index cede65d..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/ParallelSender.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger.strategy.impl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.commons.OutGoingMessage;
-import org.apache.airavata.wsmg.messenger.Deliverable;
-import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Each subscriber (URL Endpoint) will have its own thread to send a message to
- * 
- */
-public class ParallelSender implements SendingStrategy {
-
-    private static final Logger log = LoggerFactory.getLogger(ParallelSender.class);
-
-    private static final long TIME_TO_WAIT_FOR_SHUTDOWN_SECOND = 30;
-
-    private HashMap<String, ConsumerHandler> activeConsumerHandlers = new HashMap<String, ConsumerHandler>();
-
-    private ExecutorService threadPool;
-
-    public void init() {
-        this.threadPool = Executors.newCachedThreadPool();
-    }
-
-    public void addMessageToSend(OutGoingMessage outMessage, Deliverable deliverable) {
-        List<ConsumerInfo> consumerInfoList = outMessage.getConsumerInfoList();
-        for (ConsumerInfo consumer : consumerInfoList) {
-            sendToConsumerHandler(consumer, outMessage, deliverable);
-        }
-    }
-
-    public void shutdown() {
-        log.debug("Shutting down");
-
-        threadPool.shutdown();
-        try {
-            threadPool.awaitTermination(TIME_TO_WAIT_FOR_SHUTDOWN_SECOND, TimeUnit.SECONDS);
-        } catch (InterruptedException ie) {
-            log.error("Interrupted while waiting thread pool to shutdown");
-        }
-        log.debug("Shut down");
-    }
-
-    private void sendToConsumerHandler(ConsumerInfo consumer, OutGoingMessage message, Deliverable deliverable) {
-        String consumerUrl = consumer.getConsumerEprStr();
-
-        LightweightMsg lwm = new LightweightMsg(consumer, message.getTextMessage(),
-                message.getAdditionalMessageContent());
-
-        synchronized (activeConsumerHandlers) {
-            ConsumerHandler handler = activeConsumerHandlers.get(consumerUrl);
-            if (handler == null) {
-                handler = new ParallelConsumerHandler(consumerUrl, deliverable);
-                activeConsumerHandlers.put(consumerUrl, handler);
-                handler.submitMessage(lwm);
-                threadPool.submit(handler);
-            } else {
-                handler.submitMessage(lwm);
-            }
-        }
-    }
-
-    class ParallelConsumerHandler extends ConsumerHandler {
-
-        private static final int MAX_UNSUCCESSFUL_DRAINS = 3;
-        private static final int SLEEP_TIME_SECONDS = 1;
-        private int numberOfUnsuccessfulDrain = 0;
-
-        public ParallelConsumerHandler(String url, Deliverable deliverable) {
-            super(url, deliverable);
-        }
-
-        public void run() {
-            log.debug(String.format("ParallelConsumerHandler starting: %s", getConsumerUrl()));
-
-            ArrayList<LightweightMsg> localList = new ArrayList<LightweightMsg>();
-            while (true) {
-
-                /*
-                 * Try to find more message to send out
-                 */
-                if (queue.drainTo(localList) <= 0) {
-                    numberOfUnsuccessfulDrain++;
-                } else {
-                    numberOfUnsuccessfulDrain = 0;
-                }
-
-                /*
-                 * No new message for sometimes
-                 */
-                if (numberOfUnsuccessfulDrain >= MAX_UNSUCCESSFUL_DRAINS) {
-                    /*
-                     * Stop this thread if and only if there is no message
-                     */
-                    synchronized (activeConsumerHandlers) {
-                        if (queue.size() == 0) {
-                            if (activeConsumerHandlers.remove(getConsumerUrl()) != null) {
-                                log.debug(String.format("Consumer handler is already removed: %s", getConsumerUrl()));
-                            }
-                            log.debug(String.format("ParallelConsumerHandler done: %s,", getConsumerUrl()));
-                            break;
-                        }
-                    }
-                }
-
-                send(localList);
-                localList.clear();
-
-                if (numberOfUnsuccessfulDrain > 0) {
-                    waitForMessages();
-                }
-            }
-        }
-
-        private void waitForMessages() {
-            try {
-                TimeUnit.SECONDS.sleep(SLEEP_TIME_SECONDS);
-                log.debug("finished - waiting for messages");
-            } catch (InterruptedException e) {
-                log.error("interrupted while waiting for messages", e);
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/SerialSender.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/SerialSender.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/SerialSender.java
deleted file mode 100644
index 380e559..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/messenger/strategy/impl/SerialSender.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.messenger.strategy.impl;
-
-import java.io.StringReader;
-import java.util.List;
-
-import javax.xml.stream.XMLStreamException;
-
-import org.apache.airavata.wsmg.broker.AdditionalMessageContent;
-import org.apache.airavata.wsmg.broker.ConsumerInfo;
-import org.apache.airavata.wsmg.commons.CommonRoutines;
-import org.apache.airavata.wsmg.commons.OutGoingMessage;
-import org.apache.airavata.wsmg.messenger.Deliverable;
-import org.apache.airavata.wsmg.messenger.strategy.SendingStrategy;
-import org.apache.axiom.om.OMElement;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class SerialSender implements SendingStrategy {
-
-    private static final Logger log = LoggerFactory.getLogger(SerialSender.class);
-
-    public void init() {
-    }
-
-    public void shutdown() {
-    }
-
-    public void addMessageToSend(OutGoingMessage outMessage, Deliverable deliverable) {
-        sendNotification(outMessage, deliverable);
-    }
-
-    public void sendNotification(OutGoingMessage outGoingMessage, Deliverable deliverable) {
-
-        if (outGoingMessage == null) {
-            log.error("Got a null outgoing message");
-            return;
-        }
-        String messageString = outGoingMessage.getTextMessage();
-
-        List<ConsumerInfo> consumerInfoList = outGoingMessage.getConsumerInfoList();
-        AdditionalMessageContent soapHeader = outGoingMessage.getAdditionalMessageContent();
-
-        try {
-            OMElement messgae2Send = CommonRoutines.reader2OMElement(new StringReader(messageString));
-
-            for (ConsumerInfo obj : consumerInfoList) {
-                deliverable.send(obj, messgae2Send, soapHeader);
-            }
-
-        } catch (XMLStreamException e) {
-            log.error(e.getMessage(), e);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java
deleted file mode 100644
index 6400f63..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/BrokerUtil.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.util;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.wsmg.commons.WsmgCommonConstants;
-import org.apache.axiom.om.OMAttribute;
-import org.apache.axiom.om.OMElement;
-import org.apache.axis2.AxisFault;
-
-public class BrokerUtil {
-
-    /**
-     * Compares String {@code x} with String {@code y}. The result is {@code true} if and only if both arguments are
-     * {@code null} or String {@code x} has the same sequence of characters as String {@code y}.
-     * 
-     * @param x
-     * @param y
-     * @return {@code true} if the String {@code x} and String {@code y} are equivalent, {@code false} otherwise
-     */
-    public static boolean sameStringValue(String x, String y) {
-        return (x == null && y == null) || (x != null && y != null && x.equals(y));
-    }
-
-    public static String getTopicLocalString(String filterText) {
-
-        if (filterText == null)
-            throw new IllegalArgumentException("filter text can't be null");
-
-        String localName = null;
-
-        int pos = filterText.indexOf(':');
-
-        if (pos != -1) {
-            localName = filterText.substring(pos + 1);
-
-        } else {
-
-            localName = filterText;
-        }
-
-        return localName;
-    }
-
-    /**
-     * 
-     * @return localString
-     * @throws AxisFault
-     */
-    public static String getXPathString(OMElement xpathEl) throws AxisFault {
-
-        if (xpathEl == null) {
-            throw new IllegalArgumentException("xpath element can't be null");
-        }
-
-        OMAttribute dialectAttribute = xpathEl.getAttribute(new QName("Dialect"));
-
-        if (dialectAttribute == null) {
-            dialectAttribute = xpathEl.getAttribute(new QName("DIALECT"));
-
-        }
-        if (dialectAttribute == null) {
-            throw new AxisFault("dialect is required for subscribe");
-        }
-        String dialectString = dialectAttribute.getAttributeValue();
-        if (!dialectString.equals(WsmgCommonConstants.XPATH_DIALECT)) {
-            // System.out.println("***Unkown dialect: " + dialectString);
-            throw new AxisFault("Unkown dialect: " + dialectString);
-        }
-        String xpathLocalString = xpathEl.getText();
-        return xpathLocalString;
-    }
-
-    public static String getTopicFromRequestPath(String topicPath) {
-        if (topicPath == null)
-            return null;
-        if (topicPath.length() == 0)
-            return null;
-        if (topicPath.startsWith("/")) {
-            topicPath = topicPath.substring(1);
-            if (topicPath.length() == 0)
-                return null;
-        }
-
-        String ret = null;
-
-        int index = topicPath.indexOf(WsmgCommonConstants.TOPIC_PREFIX);
-        if (index >= 0) {
-
-            ret = topicPath.substring(index + WsmgCommonConstants.TOPIC_PREFIX.length());
-
-            if (ret.length() == 0) {
-                ret = null;
-            }
-
-        }
-
-        return ret;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/Counter.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/Counter.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/Counter.java
deleted file mode 100644
index bcd00a4..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/Counter.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.util;
-
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.concurrent.atomic.AtomicReference;
-
-//Used for stress test. use together with TimerThread
-public class Counter {
-
-    private AtomicLong counter = new AtomicLong(0);
-
-    private AtomicReference<String> otherStringValue = new AtomicReference<String>();
-
-    public void addCounter() {
-        counter.getAndIncrement();
-
-    }
-
-    public synchronized void addCounter(String otherValue) {
-        counter.getAndIncrement();
-        otherStringValue.set(otherValue);
-    }
-
-    /**
-     * @return Returns the counterValue.
-     */
-    public long getCounterValue() {
-
-        return counter.get();
-    }
-
-    /**
-     * @param counterValue
-     *            The counterValue to set.
-     */
-    public void setCounterValue(long counterValue) {
-        counter.set(counterValue);
-
-    }
-
-    /**
-     * @return Returns the otherValueString.
-     */
-    public String getOtherValueString() {
-
-        return otherStringValue.get();
-    }
-
-    /**
-     * @param otherValueString
-     *            The otherValueString to set.
-     */
-    public void setOtherValueString(String otherValueString) {
-        otherStringValue.set(otherValueString);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/RunTimeStatistics.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/RunTimeStatistics.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/RunTimeStatistics.java
deleted file mode 100644
index a2c0bfc..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/RunTimeStatistics.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.util;
-
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.TreeSet;
-
-import org.apache.airavata.wsmg.commons.CommonRoutines;
-import org.apache.airavata.wsmg.commons.WsmgVersion;
-
-public class RunTimeStatistics {
-    public static long totalMessageSize = 0;
-    public static long totalReceivedNotification = 0;
-    public static long totalSentOutNotification = 0;
-    public static long totalFailedNotification = 0;
-    public static long totalSubscriptions = 0;
-    public static long totalSubscriptionsAtStartUp = 0;
-    public static long totalUnSubscriptions = 0;
-    public static long minMessageSize = Long.MAX_VALUE;
-    public static long maxMessageSize = 0;
-    public static String startUpTime = "";
-    public static long totalSuccessfulDeliveryTime = 0;
-    public static long totalFailedDeliveryTime = 0;
-    public static long minSuccessfulDeliveryTime = Long.MAX_VALUE;
-    public static long maxSuccessfulDeliveryTime = 0;
-    public static long minFailedDeliveryTime = Long.MAX_VALUE;
-    public static long maxFailedDeliveryTime = 0;
-    public static final HashMap<String, Integer> failConsumerList = new HashMap<String, Integer>();
-
-    // public static TreeSet currentBlackList=new TreeSet();
-    // public static TreeSet previousBlackList=new TreeSet();
-
-    private static long startUpTimeInMillis;
-
-    public static synchronized void addNewNotificationMessageSize(int size) {
-        if (size < minMessageSize) {
-            minMessageSize = size;
-        }
-        if (size > maxMessageSize) {
-            maxMessageSize = size;
-        }
-        totalMessageSize += size;
-        totalReceivedNotification++;
-    }
-
-    public static synchronized void addNewSuccessfulDeliverTime(long deliveryTime) {
-        if (deliveryTime < minSuccessfulDeliveryTime) {
-            minSuccessfulDeliveryTime = deliveryTime;
-        }
-        if (deliveryTime > maxSuccessfulDeliveryTime) {
-            maxSuccessfulDeliveryTime = deliveryTime;
-        }
-        totalSuccessfulDeliveryTime += deliveryTime;
-        totalSentOutNotification++;
-    }
-
-    public static synchronized void addNewFailedDeliverTime(long deliveryTime) {
-        if (deliveryTime < minFailedDeliveryTime) {
-            minFailedDeliveryTime = deliveryTime;
-        }
-        if (deliveryTime > maxFailedDeliveryTime) {
-            maxFailedDeliveryTime = deliveryTime;
-        }
-        totalFailedDeliveryTime += deliveryTime;
-        totalFailedNotification++;
-    }
-
-    public static synchronized void addFailedConsumerURL(String url) {
-        Integer previousCount = failConsumerList.get(url);
-        if (previousCount == null) {
-            failConsumerList.put(url, 1);
-        } else {
-            previousCount++;
-            failConsumerList.put(url, previousCount);
-        }
-    }
-
-    public static void setStartUpTime() {
-        Date currentDate = new Date(); // Current date
-        startUpTime = CommonRoutines.getXsdDateTime(currentDate);
-        startUpTimeInMillis = currentDate.getTime();
-    }
-
-    public static String getHtmlString() {
-        String htmlString = "";
-
-        htmlString += "<p>Total incoming message number: <span class=\"xml-requests-count\">"
-                + totalReceivedNotification + "</span><br />\n";
-        htmlString += "Total successful outgoing message number: " + totalSentOutNotification + "<br>\n";
-        htmlString += "Total unreachable outgoing message number: " + totalFailedNotification + "<br>\n";
-        htmlString += "Total subscriptions requested: " + totalSubscriptions + "(+" + totalSubscriptionsAtStartUp
-                + " startUp)<br>\n";
-        htmlString += "Total Unsubscriptions requested: " + totalUnSubscriptions + "<br>\n";
-        htmlString += "</p>\n";
-        int averageMessageSize = 0;
-        if (totalReceivedNotification != 0) {
-            averageMessageSize = (int) (totalMessageSize / totalReceivedNotification);
-        }
-        htmlString += "<p>Average message size: " + averageMessageSize + " bytes<br>\n";
-        htmlString += "Max message size: " + maxMessageSize + " bytes<br>\n";
-        htmlString += "Min message size: " + minMessageSize + " bytes<br>\n";
-        htmlString += "</p>\n";
-        long averageSuccessfulDeliveryTime = 0;
-        if (totalSuccessfulDeliveryTime != 0) {
-            averageSuccessfulDeliveryTime = (totalSuccessfulDeliveryTime / totalSentOutNotification);
-        }
-        htmlString += "<p>Average Successful Delivery Time: " + averageSuccessfulDeliveryTime + " ms<br>\n";
-        htmlString += "Max Successful Delivery Time: " + maxSuccessfulDeliveryTime + " ms<br>\n";
-        htmlString += "Min Successful Delivery Time: " + minSuccessfulDeliveryTime + " ms<br>\n";
-        htmlString += "</p>\n";
-        long averageFailedDeliveryTime = 0;
-        if (totalFailedDeliveryTime != 0) {
-            averageFailedDeliveryTime = (totalFailedDeliveryTime / totalFailedNotification);
-        }
-        htmlString += "<p>Average Unreachable Delivery Time: " + averageFailedDeliveryTime + " ms<br>\n";
-        htmlString += "Max Unreachable Delivery Time: " + maxFailedDeliveryTime + " ms<br>\n";
-        htmlString += "Min Unreachable Delivery Time: " + minFailedDeliveryTime + " ms<br>\n";
-        htmlString += "</p>\n";
-        htmlString += "<p>Service started at: " + startUpTime + " <span class=\"starttime-seconds\">"
-                + startUpTimeInMillis + "</span> [seconds] since UNIX epoch)" + "<br />\n";
-
-        htmlString += "Version: <span class=\"service-name\">" + WsmgVersion.getImplementationVersion()
-                + "</span></p>\n";
-
-        htmlString += "<p>Total unreachable consumerUrl: " + failConsumerList.size() + " <br>\n";
-        TreeSet<String> consumerUrlList = new TreeSet<String>(failConsumerList.keySet());
-        Iterator<String> iter = consumerUrlList.iterator();
-        while (iter.hasNext()) {
-            String url = iter.next();
-            int failedCount = failConsumerList.get(url);
-            htmlString += "  " + url + " -->" + failedCount + " <br>\n";
-        }
-        htmlString += "</p>\n";
-        return htmlString;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/TimerThread.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/TimerThread.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/TimerThread.java
deleted file mode 100644
index 77f7c57..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/TimerThread.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.util;
-
-public class TimerThread implements Runnable {
-    Counter counter;
-
-    long counterValue = 0;
-
-    long seqNum = 0;
-
-    String comment = "";
-
-    public TimerThread(Counter counter, String comment) {
-        this.counter = counter;
-        this.comment = comment;
-    }
-
-    public void run() {
-        long currentTime = 0;
-        long interval = 1000;
-        long lastCounter = 0;
-        long idleCount = 0;
-        // wait for about 5 sec and start from 000 time so that other thread can
-        // start together
-        currentTime = System.currentTimeMillis();
-        long launchTime = ((currentTime + 2000) / 1000) * 1000;
-        long sleepTime = launchTime - currentTime;
-        System.out.println("launchTime=" + launchTime + " SleepTime=" + sleepTime);
-        try {
-            Thread.sleep(sleepTime);
-        } catch (InterruptedException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-        while (true) {
-            currentTime = System.currentTimeMillis();
-            counterValue = counter.getCounterValue();
-            long receivedCount = counterValue - lastCounter;
-            lastCounter = counterValue;
-            if (receivedCount == 0) {
-                idleCount++;
-            } else {
-                idleCount = 0;
-            }
-            if (receivedCount > 0 || (receivedCount == 0 && idleCount < 3)) {
-                // System.out.println("time="+currentTime+" counter="+
-                // counter.getCounterValue()+"
-                // received="+receivedCount+comment);
-                System.out.println(seqNum + " " + counter.getCounterValue() + " " + receivedCount + comment
-                        + counter.getOtherValueString());
-            }
-            seqNum++;
-            launchTime = launchTime + interval;
-            sleepTime = launchTime - currentTime;
-            // System.out.println("launchTime="+launchTime+"
-            // SleepTime="+sleepTime);
-            if (sleepTime < 0)
-                sleepTime = 0;
-            try {
-                Thread.sleep(sleepTime);
-            } catch (InterruptedException e) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsEventingOperations.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsEventingOperations.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsEventingOperations.java
deleted file mode 100644
index 931a5bf..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsEventingOperations.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.util;
-
-public enum WsEventingOperations {
-
-    RENEW("renew"), PUBLISH("publish"), GET_STATUS("getStatus"), SUBSCRIPTION_END("subscriptionEnd"), SUBSCRIBE(
-            "subscribe"), UNSUBSCRIBE("unsubscribe");
-
-    private final String name;
-
-    private WsEventingOperations(String n) {
-        name = n;
-    }
-
-    public String toString() {
-        return name;
-    }
-
-    public boolean equals(String s) {
-        return name.equals(s);
-    }
-
-    public static WsEventingOperations valueFrom(String s) {
-        for (WsEventingOperations status : WsEventingOperations.values()) {
-            if (status.toString().equalsIgnoreCase(s)) {
-                return status;
-            }
-
-        }
-
-        throw new RuntimeException("invalid WsEventingOperation:- " + s);
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsNotificationOperations.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsNotificationOperations.java b/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsNotificationOperations.java
deleted file mode 100644
index c771134..0000000
--- a/modules/ws-messenger/messagebroker/src/main/java/org/apache/airavata/wsmg/util/WsNotificationOperations.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.util;
-
-public enum WsNotificationOperations {
-
-    NOTIFY("notify"), SUBSCRIBE("subscribe"), GET_CURRENT_MSG("getCurrentMessage"), PAUSE_REQUEST("gause"), RESUME_REQUEST(
-            "resume"), PAUSE_SUBSCRIPTION("pauseSubscription"), RESUME_SUBSCRIPTION("resumeSubscription"), REGISTER_PUBLISHER(
-            "registerPublisher"), UNSUBSCRIBE("unsubscribe");
-
-    private final String name;
-
-    private WsNotificationOperations(String n) {
-        name = n;
-    }
-
-    public String toString() {
-        return name;
-    }
-
-    public boolean equals(String s) {
-        return name.equals(s);
-    }
-
-    public static WsNotificationOperations valueFrom(String s) {
-        for (WsNotificationOperations status : WsNotificationOperations.values()) {
-            if (status.toString().equalsIgnoreCase(s)) {
-                return status;
-            }
-
-        }
-
-        throw new RuntimeException("invalid Ws notification Operation:- " + s);
-
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/cleanDBScript.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/cleanDBScript.sql b/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/cleanDBScript.sql
deleted file mode 100755
index 5663ebf..0000000
--- a/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/cleanDBScript.sql
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
- 
-delete from disQ;
-delete from MaxIDTable;
-delete from MinIDTable;
-delete from specialSubscription;
-delete from subscription;
-delete from msgbox;

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-derby.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-derby.sql b/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-derby.sql
deleted file mode 100644
index 80b51a4..0000000
--- a/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-derby.sql
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
- 
-CREATE TABLE SUBSCRIPTION (
-                SUBSCRIPTIONID VARCHAR(200) NOT NULL DEFAULT '',          
-                TOPICS VARCHAR(255) DEFAULT '',                               
-                XPATH VARCHAR(200) DEFAULT '',                       
-                CONSUMERADDRESS VARCHAR(255) DEFAULT '',                      
-                REFERENCEPROPERTIES BLOB,
-                CONTENT BLOB,                                                     
-                WSRM INTEGER NOT NULL DEFAULT 0 ,                                  
-                CREATIONTIME TIMESTAMP NOT NULL  
-              );
-CREATE TABLE SPECIALSUBSCRIPTION (                              
-                       SUBSCRIPTIONID VARCHAR(200) NOT NULL DEFAULT '',              
-                       TOPICS VARCHAR(255) DEFAULT '',                               
-                       XPATH VARCHAR(200) DEFAULT '',                                
-                       CONSUMERADDRESS VARCHAR(255) DEFAULT '',                      
-                       REFERENCEPROPERTIES BLOB,                                     
-                       CONTENT BLOB,                                                     
-                       WSRM INTEGER NOT NULL DEFAULT 0,                         
-                       CREATIONTIME TIMESTAMP NOT NULL 
-                     );               
-
-	
-CREATE TABLE DISQ (                       
-          ID BIGINT GENERATED BY DEFAULT AS IDENTITY,
-          TRACKID VARCHAR(100) DEFAULT NULL,      
-          MESSAGE BLOB,                           
-          STATUS INTEGER  DEFAULT NULL,    
-          TOPIC VARCHAR(255) DEFAULT '',     
-          PRIMARY KEY  (ID)                       
-        );	
-	
-CREATE TABLE MAXIDTABLE(
-	MAXID INTEGER
-	);
-	
-CREATE TABLE MINIDTABLE(
-	MINID INTEGER
-	);
-	

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-mysql.sql
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-mysql.sql b/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-mysql.sql
deleted file mode 100755
index cb506ef..0000000
--- a/modules/ws-messenger/messagebroker/src/main/resources/database_scripts/msgBroker-mysql.sql
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
- 
-CREATE DATABASE IF NOT EXISTS wsmg;
-CREATE TABLE `subscription` (
-                `SubscriptionId` varchar(200) NOT NULL default '',
-                `Topics` varchar(255) default '',
-                `XPath` varchar(200) default '',
-                `ConsumerAddress` varchar(255) default '',
-                `ReferenceProperties` blob,
-                `content` blob,
-                `wsrm` tinyint(1) NOT NULL default '0',
-                `CreationTime` datetime NOT NULL default '0000-00-00 00:00:00'
-              );
-CREATE TABLE `specialSubscription` (
-                       `SubscriptionId` varchar(200) NOT NULL default '',
-                       `Topics` varchar(255) default '',
-                       `XPath` varchar(200) default '',
-                       `ConsumerAddress` varchar(255) default '',
-                       `ReferenceProperties` blob,
-                       `content` blob,
-                       `wsrm` tinyint(1) NOT NULL default '0',
-                       `CreationTime` datetime NOT NULL default '0000-00-00 00:00:00'
-                     );
-
-
-CREATE TABLE `disQ` (
-          `id` bigint(11) NOT NULL auto_increment,
-          `trackId` varchar(100) default NULL,
-          `message` longblob,
-          `status` int(11) default NULL,
-          `topic` varchar(255) default '',
-          PRIMARY KEY  (`id`)
-        );
-
-CREATE TABLE MaxIDTable(
-       maxID integer
-       );
-
-CREATE TABLE MinIDTable(
-       minID integer
-       );
-

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/main/resources/services.xml
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/main/resources/services.xml b/modules/ws-messenger/messagebroker/src/main/resources/services.xml
deleted file mode 100644
index 229262c..0000000
--- a/modules/ws-messenger/messagebroker/src/main/resources/services.xml
+++ /dev/null
@@ -1,125 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-   http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
-
--->
-<serviceGroup>
-    <service name="EventingService" class="org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle">
-
-        <operation name="renew">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Renew
-            </actionMapping>
-            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/RenewResponse
-            </outputActionMapping>
-        </operation>
-
-        <operation name="getStatus">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatus
-            </actionMapping>
-            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/GetStatusResponse
-            </outputActionMapping>
-        </operation>
-
-        <operation name="subscriptionEnd">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscriptionEnd
-            </actionMapping>
-        </operation>
-
-        <operation name="subscribe">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
-            </actionMapping>
-            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse
-            </outputActionMapping>
-        </operation>
-
-        <operation name="unsubscribe">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingMsgReceiver" />
-            <actionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/Unsubscribe
-            </actionMapping>
-            <outputActionMapping>http://schemas.xmlsoap.org/ws/2004/08/eventing/UnsubscribeResponse
-            </outputActionMapping>
-        </operation>
-
-        <operation name="publish">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wseventing.WSEventingPublishMsgReceiver" />
-            <actionMapping>http://org.apache.airavata/WseNotification
-            </actionMapping>
-        </operation>
-
-    </service>
-
-    <service name="NotificationService" class="org.apache.airavata.wsmg.broker.BrokerServiceLifeCycle">
-
-        <operation name="notify">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/Notify
-            </actionMapping>
-            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/NotifyResponse
-            </outputActionMapping>
-        </operation>
-        
-        <operation name="subscribe">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequest
-            </actionMapping>
-            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/SubscribeRequestResponse
-            </outputActionMapping>
-        </operation>
-
-        <operation name="getCurrentMessage">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageRequest
-            </actionMapping>
-            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/GetCurrentMessageResponse
-            </outputActionMapping>
-        </operation>
-        
-        <operation name="pauseSubscription">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubsriptionRequest
-            </actionMapping>
-            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/PauseSubscriptionResponse
-            </outputActionMapping>
-        </operation>
-        
-        <operation name="resumeSubscription">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubsriptionRequest
-            </actionMapping>
-            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/ResumeSubscriptionResponse
-            </outputActionMapping>
-        </operation>
-
-        <operation name="unsubscribe">
-            <messageReceiver class="org.apache.airavata.wsmg.broker.wsnotification.WSNotificationMsgReceiver" />
-            <actionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubsribeRequest
-            </actionMapping>
-            <outputActionMapping>http://www.ibm.com/xmlns/stdwip/web-services/WS-BaseNotification/UnsubscribeResponse
-            </outputActionMapping>
-        </operation>
-
-    </service>
-
-    <parameter name="configuration.file.name" locked="false">airavata-server.properties</parameter>
-
-</serviceGroup>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSETest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSETest.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSETest.java
deleted file mode 100644
index 4867ba7..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSETest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.WseMsgBrokerClient;
-import org.apache.airavata.wsmg.util.TestUtilServer;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-import org.junit.Test;
-
-public class BrokerWSETest extends TestCase implements ConsumerNotificationHandler {
-
-    private static int port = TestUtilServer.TESTING_PORT;
-    static Properties configs = new Properties();
-
-    public void handleNotification(SOAPEnvelope msgEnvelope) {
-        System.out.println("Received " + msgEnvelope);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        TestUtilServer.start(null, null);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        TestUtilServer.stop();
-    }
-
-    @Test
-    public void testRoundTrip() throws InterruptedException {
-
-        try {
-
-            String brokerEPR = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/EventingService";
-            long value = System.currentTimeMillis();
-            String msg = String.format("<msg> current time is : %d </msg>", value);
-
-            WseMsgBrokerClient wseMsgBrokerClient = new WseMsgBrokerClient();
-            wseMsgBrokerClient.init(brokerEPR);
-            int consumerPort = TestUtilServer.getAvailablePort();
-
-            String[] consumerEPRs = wseMsgBrokerClient.startConsumerService(consumerPort, this);
-
-            assertTrue(consumerEPRs.length > 0);
-
-            String topic = "WseRoundTripTestTopic";
-
-            String subscriptionID = wseMsgBrokerClient.subscribe(consumerEPRs[0], topic, null);
-            System.out.println("topic sub id = " + subscriptionID);
-
-            try {
-                wseMsgBrokerClient.publish(topic, msg);
-                wseMsgBrokerClient.publish(topic, AXIOMUtil.stringToOM("<foo><bar>Test</bar></foo>"));
-            } catch (Exception e) {
-                fail(e.getMessage());
-            }
-
-            Thread.sleep(2000);
-
-            try {
-                wseMsgBrokerClient.unSubscribe(subscriptionID);
-            } catch (AxisFault e) {
-                e.printStackTrace();
-                fail(e.getMessage());
-            }
-            wseMsgBrokerClient.shutdownConsumerService();
-
-        } catch (AxisFault e) {
-            e.printStackTrace();
-            try {
-                System.in.read();
-            } catch (IOException e1) {
-                e1.printStackTrace();
-            }
-            fail("unexpected exception occured");
-        }
-        System.out.println("Broker roundtrip done");
-
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSNTTest.java
----------------------------------------------------------------------
diff --git a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSNTTest.java b/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSNTTest.java
deleted file mode 100644
index baebd31..0000000
--- a/modules/ws-messenger/messagebroker/src/test/java/org/apache/airavata/wsmg/broker/BrokerWSNTTest.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.wsmg.broker;
-
-import java.io.IOException;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-import org.apache.airavata.wsmg.client.ConsumerNotificationHandler;
-import org.apache.airavata.wsmg.client.WsntMsgBrokerClient;
-import org.apache.airavata.wsmg.util.TestUtilServer;
-import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
-import org.junit.Test;
-
-public class BrokerWSNTTest extends TestCase implements ConsumerNotificationHandler {
-
-    static Properties configs = new Properties();
-
-    public void handleNotification(SOAPEnvelope msgEnvelope) {
-        System.out.println("Received " + msgEnvelope);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        TestUtilServer.start(null, null);
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        TestUtilServer.stop();
-    }
-
-    @Test
-    public void testRoundTrip() throws InterruptedException {
-
-        try {
-            long value = System.currentTimeMillis();
-            String msg = String.format("<msg> current time is : %d </msg>", value);
-
-            WsntMsgBrokerClient wsntMsgBrokerClient = new WsntMsgBrokerClient();
-
-            int consumerPort = 6767;
-
-            String brokerEPR = "http://localhost:" + TestUtilServer.TESTING_PORT + "/axis2/services/NotificationService";
-            wsntMsgBrokerClient.init(brokerEPR);
-            String[] consumerEPRs = wsntMsgBrokerClient.startConsumerService(consumerPort, this);
-
-            assertTrue(consumerEPRs.length > 0);
-
-            String topic = "/WsntRoundTripTestTopic";
-
-            String topicSubscriptionID = wsntMsgBrokerClient.subscribe(consumerEPRs[0], topic, null);
-            System.out.println("topic subscription id: " + topicSubscriptionID);
-
-            try {
-                wsntMsgBrokerClient.publish(topic, msg);
-                wsntMsgBrokerClient.publish(topic, AXIOMUtil.stringToOM("<foo><bar>Test</bar></foo>"));
-            } catch (Exception e) {
-                fail(e.getMessage());
-            }
-
-            Thread.sleep(2000);
-
-            try {
-                wsntMsgBrokerClient.unSubscribe(topicSubscriptionID);
-            } catch (AxisFault e) {
-                e.printStackTrace();
-                fail(e.getMessage());
-            }
-
-            wsntMsgBrokerClient.shutdownConsumerService();
-
-        } catch (AxisFault e) {
-            e.printStackTrace();
-            try {
-                System.in.read();
-            } catch (IOException e1) {
-                e1.printStackTrace();
-            }
-
-            fail("unexpected exception occured");
-        }
-        System.out.println("Broker roundtrip done");
-
-    }
-}


[61/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/StreamSourceConfigurationDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/StreamSourceConfigurationDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/StreamSourceConfigurationDialog.java
new file mode 100644
index 0000000..1eead0c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/system/StreamSourceConfigurationDialog.java
@@ -0,0 +1,129 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.system;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.apache.airavata.workflow.model.graph.system.StreamSourceNode;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class StreamSourceConfigurationDialog {
+
+    private XBayaGUI xbayaGUI;
+
+    private StreamSourceNode node;
+
+    private XBayaDialog dialog;
+
+    private GridPanel gridPanel;
+
+    private XBayaLabel wsdlLabel;
+
+    private XBayaTextField wsdlTextField;
+
+    private XBayaLabel descriptionLabel;
+
+    private XBayaTextField descriptionTextField;
+
+    /**
+     * Constructs an InputConfigurationWindow.
+     * 
+     * @param node
+     * @param engine
+     */
+    public StreamSourceConfigurationDialog(StreamSourceNode node, XBayaGUI xbayaGUI) {
+        this.xbayaGUI = xbayaGUI;
+        this.node = node;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setInput() {
+        this.node.setStreamSourceURL(this.wsdlTextField.getText());
+        this.node.setConfigured(true);
+        this.node.setDescription(this.descriptionTextField.getText());
+        hide();
+        this.xbayaGUI.getGraphCanvas().repaint();
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGui() {
+        this.wsdlTextField = new XBayaTextField();
+        this.wsdlLabel = new XBayaLabel("The EPR of the Stream Source", this.wsdlTextField);
+
+        this.descriptionTextField = new XBayaTextField();
+        this.descriptionLabel = new XBayaLabel("Description", this.descriptionTextField);
+
+        this.gridPanel = new GridPanel();
+        this.gridPanel.add(wsdlLabel);
+        this.gridPanel.add(this.wsdlTextField);
+        this.gridPanel.add(descriptionLabel);
+        this.gridPanel.add(this.descriptionTextField);
+        this.gridPanel.layout(2, 2, 1, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setInput();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Configure Streaming Data source", this.gridPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/ServiceInteractionWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/ServiceInteractionWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/ServiceInteractionWindow.java
new file mode 100644
index 0000000..bc2c594
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/ServiceInteractionWindow.java
@@ -0,0 +1,132 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.ws;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.apache.airavata.ws.monitor.Monitor;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.views.MonitorPanel;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class ServiceInteractionWindow {
+
+    private XBayaGUI xbayaGUI;
+
+    private XBayaDialog dialog;
+
+    private WaitDialog invokingDialog;
+
+    private XBayaTextArea consoleTextArea;
+
+    private XBayaTextField commandField;
+
+    private String nodeID;
+
+    private Monitor monitor;
+    
+    public ServiceInteractionWindow(XBayaGUI xbayaGUI, String nodeID, Monitor monitor) {
+        this.xbayaGUI=xbayaGUI;
+        this.nodeID = nodeID;
+        this.monitor=monitor;
+        initGui();
+    }
+
+    /**
+	 * 
+	 */
+    private void initGui() {
+
+        GridPanel mainPanel = new GridPanel();
+
+        MonitorPanel monitorPanel = new MonitorPanel(this.xbayaGUI, this.nodeID, monitor);
+        this.consoleTextArea = new XBayaTextArea();
+        XBayaLabel consoleLabel = new XBayaLabel("Console", this.consoleTextArea);
+
+        this.commandField = new XBayaTextField();
+        XBayaLabel commandLabel = new XBayaLabel("Command", this.commandField);
+
+        mainPanel.add(monitorPanel);
+        mainPanel.add(consoleLabel);
+        mainPanel.add(this.consoleTextArea);
+        mainPanel.add(commandLabel);
+        mainPanel.add(this.commandField);
+
+        mainPanel.layout(5, 1, GridPanel.WEIGHT_NONE, 1);
+
+        JButton sendButton = new JButton("Send");
+        sendButton.addActionListener(new AbstractAction() {
+            /**
+             * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
+             */
+            public void actionPerformed(ActionEvent e) {
+                send();
+
+            }
+
+        });
+
+        JButton cancelButton = new JButton("Done");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(sendButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Deploy workflow to ODE and Registry", mainPanel, buttonPanel);
+        this.dialog.setDefaultButton(sendButton);
+
+    }
+
+    private void hide() {
+        this.dialog.hide();
+
+    }
+
+    /**
+	 * 
+	 */
+    public void show() {
+        this.dialog.show();
+    }
+
+    private void send() {
+        String command = this.commandField.getText();
+        this.commandField.setText("");
+        this.consoleTextArea.setText(this.consoleTextArea.getText() + "\n>" + command + "\n");
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/WSNodeWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/WSNodeWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/WSNodeWindow.java
new file mode 100644
index 0000000..56809b3
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/graph/ws/WSNodeWindow.java
@@ -0,0 +1,140 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.graph.ws;
+
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+import xsul5.wsdl.WsdlDefinitions;
+
+public class WSNodeWindow {
+
+    private XBayaEngine engine;
+
+    private WSNode node;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextField idTextField;
+
+    private XBayaTextField typeTextField;
+
+    private XBayaTextArea wsdlTextArea;
+
+    /**
+     * Constructs a WSNodeWindow.
+     * 
+     * @param engine
+     *            The XBayaEngine
+     * @param node
+     */
+    public WSNodeWindow(XBayaEngine engine, WSNode node) {
+        this.engine = engine;
+        this.node = node;
+        initGUI();
+    }
+
+    /**
+     *
+     */
+    public void show() {
+
+        WsdlDefinitions wsdl = this.node.getComponent().getWSDL();
+        String type;
+        if (WSDLUtil.isAWSDL(wsdl)) {
+            type = "Abstract WSDL";
+        } else {
+            type = "Concrete WSDL";
+        }
+
+        this.nameTextField.setText(this.node.getName());
+        this.idTextField.setText(this.node.getID());
+        this.typeTextField.setText(type);
+        // wsdl.toStringPretty uses tab, which doesn't look good in the editor
+        // pane.
+        this.wsdlTextArea.setText(XMLUtil.BUILDER.serializeToStringPretty(wsdl.xml()));
+
+        this.dialog.show();
+    }
+
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void initGUI() {
+
+        this.nameTextField = new XBayaTextField();
+        this.nameTextField.setEditable(false);
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.idTextField = new XBayaTextField();
+        this.idTextField.setEditable(false);
+        XBayaLabel idLabel = new XBayaLabel("ID", this.idTextField);
+
+        this.typeTextField = new XBayaTextField();
+        this.typeTextField.setEditable(false);
+        XBayaLabel typeLabel = new XBayaLabel("Type", this.typeTextField);
+
+        this.wsdlTextArea = new XBayaTextArea();
+        this.wsdlTextArea.setEditable(false);
+        XBayaLabel wsdlLabel = new XBayaLabel("WSDL", this.wsdlTextArea);
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(nameLabel);
+        infoPanel.add(this.nameTextField);
+        infoPanel.add(idLabel);
+        infoPanel.add(this.idTextField);
+        infoPanel.add(typeLabel);
+        infoPanel.add(this.typeTextField);
+        infoPanel.add(wsdlLabel);
+        infoPanel.add(this.wsdlTextArea);
+        infoPanel.layout(4, 2, 3, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), this.node.getName(), infoPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/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
new file mode 100644
index 0000000..1d1fcfa
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorConfigurationWindow.java
@@ -0,0 +1,196 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.monitor;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+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;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class MonitorConfigurationWindow {
+
+    private XBayaEngine engine;
+
+    private MonitorConfiguration configuration;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField brokerTextField;
+
+    private XBayaTextField topicTextField;
+
+    private JCheckBox pullCheckBox;
+
+    private XBayaTextField messageBoxTextField;
+
+    /**
+     * @param engine
+     * 
+     */
+    public MonitorConfigurationWindow(XBayaEngine engine) {
+        this.engine = engine;
+        this.configuration = engine.getMonitor().getConfiguration();
+        initGui();
+    }
+
+    /**
+     * 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.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void setConfiguration() {
+        String broker = this.brokerTextField.getText();
+        String topic = this.topicTextField.getText();
+        String messageBox = this.messageBoxTextField.getText();
+        boolean pull = this.pullCheckBox.isSelected();
+
+        if (broker.length() == 0) {
+            this.engine.getGUI().getErrorWindow().error("Broker URL cannot be empty");
+            return;
+        }
+        URI brokerURL;
+        try {
+            brokerURL = new URI(broker).parseServerAuthority();
+        } catch (URISyntaxException e) {
+            String message = "Broker URL is in a wrong format";
+            this.engine.getGUI().getErrorWindow().error(message, e);
+            return;
+        }
+
+        if (topic.length() == 0) {
+            String message = "Topic cannot be empty";
+            this.engine.getGUI().getErrorWindow().error(message);
+            return;
+        }
+
+        URI messageBoxURL = null;
+        if (pull) {
+            if (messageBox.length() == 0) {
+                this.engine.getGUI().getErrorWindow().error("Message box URL cannot be empty");
+                return;
+            }
+            try {
+                messageBoxURL = new URI(messageBox).parseServerAuthority();
+            } catch (URISyntaxException e) {
+                String message = "Message box URL is in a wrong format";
+                this.engine.getGUI().getErrorWindow().error(message, e);
+                return;
+            }
+        } else {
+            messageBoxURL = this.configuration.getMessageBoxURL();
+        }
+
+        this.configuration.set(brokerURL, topic, pull, messageBoxURL);
+        this.engine.getConfiguration().setMessageBoxURL(messageBoxURL);
+        this.engine.getConfiguration().setBrokerURL(brokerURL);
+        this.engine.getConfiguration().setTopic(topic);
+        hide();
+    }
+
+    private void initGui() {
+
+        this.brokerTextField = new XBayaTextField();
+        XBayaLabel brokerLabel = new XBayaLabel("Broker URL", this.brokerTextField);
+
+        this.topicTextField = new XBayaTextField();
+        XBayaLabel topicLabel = new XBayaLabel("Topic", this.topicTextField);
+
+        this.pullCheckBox = new JCheckBox("Pull Mode");
+        JLabel dummyLabel = new JLabel();
+
+        this.messageBoxTextField = new XBayaTextField();
+        XBayaLabel msgBoxLabel = new XBayaLabel("Message Box URL", this.messageBoxTextField);
+
+        this.messageBoxTextField.setEnabled(false);
+        this.pullCheckBox.addItemListener(new ItemListener() {
+            public void itemStateChanged(ItemEvent event) {
+                int stateChange = event.getStateChange();
+                if (stateChange == ItemEvent.SELECTED) {
+                    MonitorConfigurationWindow.this.messageBoxTextField.setEnabled(true);
+                } else if (stateChange == ItemEvent.DESELECTED) {
+                    MonitorConfigurationWindow.this.messageBoxTextField.setEnabled(false);
+                }
+            }
+        });
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(brokerLabel);
+        infoPanel.add(this.brokerTextField);
+        infoPanel.add(topicLabel);
+        infoPanel.add(this.topicTextField);
+        infoPanel.add(dummyLabel);
+        infoPanel.add(this.pullCheckBox);
+        infoPanel.add(msgBoxLabel);
+        infoPanel.add(this.messageBoxTextField);
+        infoPanel.layout(4, 2, SwingUtil.WEIGHT_NONE, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setConfiguration();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Notification Configuration", infoPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorWindow.java
new file mode 100644
index 0000000..389147d
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/monitor/MonitorWindow.java
@@ -0,0 +1,178 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.monitor;
+
+import java.awt.Color;
+import java.awt.Toolkit;
+import java.awt.datatransfer.Clipboard;
+import java.awt.datatransfer.StringSelection;
+import java.awt.event.ActionEvent;
+import java.net.URL;
+import java.util.Date;
+import java.util.regex.Pattern;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JEditorPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.TransferHandler;
+import javax.swing.event.HyperlinkEvent;
+import javax.swing.event.HyperlinkEvent.EventType;
+import javax.swing.event.HyperlinkListener;
+
+import org.apache.airavata.common.utils.BrowserLauncher;
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.ws.monitor.EventDataRepository;
+import org.apache.airavata.ws.monitor.MonitorUtil;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.commons.lang.StringEscapeUtils;
+import org.xmlpull.infoset.XmlElement;
+
+import xsul5.XmlConstants;
+
+public class MonitorWindow {
+
+    private XBayaGUI xbayaGUI;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField timeTextField;
+
+    private XBayaTextField idTextField;
+
+    private XBayaTextField statusTextField;
+
+    private JEditorPane messageTextArea;
+    private String messageText;
+    
+
+    /**
+     * Constructs a MonitorWindow.
+     * 
+     * @param engine
+     *            The XBayaEngine
+     */
+    public MonitorWindow(XBayaGUI xbayaGUI) {
+        this.xbayaGUI=xbayaGUI;
+        init();
+    }
+
+    /**
+     * Shows the notification.
+     * 
+     * @param event
+     *            The notification to show
+     */
+    public void show(XmlElement event) {
+        Date timestamp = MonitorUtil.getTimestamp(event);
+        if (timestamp != null) {
+            this.timeTextField.setText(timestamp.toString());
+        } else {
+            this.timeTextField.setText("");
+        }
+        this.idTextField.setText(MonitorUtil.getNodeID(event));
+        this.statusTextField.setText(MonitorUtil.getStatus(event));
+        
+        // Show the raw XML for now.
+        messageText = XMLUtil.BUILDER.serializeToStringPretty(event);
+		this.messageTextArea.setText(StringUtil.createHTMLUrlTaggedString2(StringEscapeUtils.escapeHtml(messageText),StringUtil.getURLS(messageText)).replaceAll(Pattern.quote(" "), "&nbsp;").replaceAll(Pattern.quote("\n"), "<br />\n"));
+
+        this.dialog.show();
+        this.dialog.getDialog().setSize(600, 800);
+    }
+
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void init() {
+        this.timeTextField = new XBayaTextField();
+        this.timeTextField.setEditable(false);
+        XBayaLabel timeLabel = new XBayaLabel(EventDataRepository.Column.TIME.getName(), this.timeTextField);
+
+        this.idTextField = new XBayaTextField();
+        this.idTextField.setEditable(false);
+        XBayaLabel idLabel = new XBayaLabel(EventDataRepository.Column.ID.getName(), this.idTextField);
+
+        this.statusTextField = new XBayaTextField();
+        this.statusTextField.setEditable(false);
+        XBayaLabel statusLabel = new XBayaLabel(EventDataRepository.Column.STATUS.getName(), this.statusTextField);
+
+        this.messageTextArea = new JEditorPane(XmlConstants.CONTENT_TYPE_HTML, "");
+        this.messageTextArea.setSize(500, 500);
+        this.messageTextArea.setEditable(false);
+        messageTextArea.setBackground(Color.WHITE);
+        messageTextArea.addHyperlinkListener(new HyperlinkListener() {
+            public void hyperlinkUpdate(HyperlinkEvent event) {
+                if (event.getEventType() == EventType.ACTIVATED) {
+                    URL url = event.getURL();
+                    try {
+                        BrowserLauncher.openURL(url.toString());
+                    } catch (Exception e) {
+                        MonitorWindow.this.xbayaGUI.getErrorWindow().error(MonitorWindow.this.dialog.getDialog(),
+                                e.getMessage(), e);
+                    }
+                }
+            }
+        });
+        JScrollPane pane = new JScrollPane(messageTextArea);
+        pane.setSize(500, 500);
+        XBayaLabel messageLabel = new XBayaLabel(EventDataRepository.Column.MESSAGE.getName(), pane);
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(timeLabel);
+        infoPanel.add(this.timeTextField);
+        infoPanel.add(idLabel);
+        infoPanel.add(this.idTextField);
+        infoPanel.add(statusLabel);
+        infoPanel.add(this.statusTextField);
+        infoPanel.add(messageLabel);
+        infoPanel.add(pane);
+        infoPanel.layout(4, 2, 3, 1);
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+        JButton copyButton = new JButton("Copy to Clipboard");
+        copyButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+            	Toolkit.getDefaultToolkit().getSystemClipboard().setContents(new StringSelection(messageText), null);
+            }
+        });
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(copyButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Notification", infoPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/NewRegistryUserDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/NewRegistryUserDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/NewRegistryUserDialog.java
new file mode 100644
index 0000000..d677ffa
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/NewRegistryUserDialog.java
@@ -0,0 +1,305 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.registry;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.net.URL;
+
+import javax.swing.*;
+
+import org.apache.airavata.persistance.registry.jpa.ResourceType;
+import org.apache.airavata.persistance.registry.jpa.ResourceUtils;
+import org.apache.airavata.persistance.registry.jpa.resources.GatewayResource;
+import org.apache.airavata.persistance.registry.jpa.resources.UserResource;
+import org.apache.airavata.persistance.registry.jpa.resources.WorkerResource;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+
+public class NewRegistryUserDialog {
+
+    private XBayaEngine engine;
+
+    private XBayaDialog dialog;
+
+//    private XBayaTextField urlTextField;
+
+    private XBayaTextField usernameTextField;
+
+    private JPasswordField passwordTextField;
+
+    private String gatewayName = "default";
+
+    private String username;
+
+    private URL url;
+
+    private String password;
+
+    private JPasswordField confirmPasswordTextField;
+
+    private JButton okButton;
+
+    private boolean userCreated = false;
+//    public static final String GATEWAY_ID = "default.registry.gateway";
+
+    public NewRegistryUserDialog(XBayaEngine engine) {
+        this(engine, null, null);
+    }
+
+    public NewRegistryUserDialog(XBayaEngine engine, URL url) {
+        this(engine, url, null);
+    }
+
+    public NewRegistryUserDialog(XBayaEngine engine, String username) {
+        this(engine, null, username);
+    }
+
+    /**
+     * @param engine
+     */
+    public NewRegistryUserDialog(XBayaEngine engine, URL url, String username) {
+        this.engine = engine;
+        setUrl(url);
+        setUsername(username);
+        initGUI();
+    }
+
+    /**
+     * Displays the dialog.
+     */
+    public void show() {
+        this.dialog.show();
+    }
+
+    private void hide() {
+//        setUserCreated(false);
+        this.dialog.hide();
+    }
+
+    private void setData() {
+//        updateURL();
+        updateUsername();
+        updatePassword();
+    }
+
+    private void ok() {
+        setData();
+        String status = updateStatus();
+        if (status == null) {
+            try {
+//                Properties properties = Utils.loadProperties();
+                GatewayResource gatewayResource = (GatewayResource)ResourceUtils.getGateway(getGatewayName());
+                UserResource userResource = (UserResource) gatewayResource.create(ResourceType.USER);
+                userResource.setUserName(getUsername());
+                userResource.setPassword(getPassword());
+                userResource.save();
+                WorkerResource workerResource = (WorkerResource) gatewayResource.create(ResourceType.GATEWAY_WORKER);
+                workerResource.setUser(userResource.getUserName());
+                workerResource.save();
+                setUserCreated(true);
+//                JCRComponentRegistry registry = new JCRComponentRegistry(getUsername(),getPassword());
+            } catch (Exception e) {
+                e.printStackTrace();
+                engine.getGUI().getErrorWindow().error(e.getMessage());
+            }
+        } else {
+            engine.getGUI().getErrorWindow().error(status);
+        }
+        close();
+    }
+
+    private String updateStatus() {
+        String msg = null;
+//        if (getUrl() == null) {
+//            msg = "The url cannot be empty";
+//        } else
+        if (getUsername() == null || getUsername().equals("")) {
+            msg = "Username cannot be empty";
+        } else if (getPassword() == null || getPassword().equals("")) {
+            msg = "Passwords must match or cannot be empty";
+        }
+        // okButton.setEnabled(msg==null);
+        return msg;
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGUI() {
+//        this.urlTextField = new XBayaTextField();
+        this.usernameTextField = new XBayaTextField();
+        this.passwordTextField = new JPasswordField();
+        this.confirmPasswordTextField = new JPasswordField();
+//        XBayaLabel urlLabel = new XBayaLabel("URL", this.urlTextField);
+        XBayaLabel userLabel = new XBayaLabel("Username", this.usernameTextField);
+        XBayaLabel passLabel = new XBayaLabel("Password", this.passwordTextField);
+        XBayaLabel confirmPassLabel = new XBayaLabel("Confirm Password", this.confirmPasswordTextField);
+
+        GridPanel infoPanel = new GridPanel();
+//        infoPanel.add(urlLabel);
+//        infoPanel.add(this.urlTextField);
+        infoPanel.add(userLabel);
+        infoPanel.add(this.usernameTextField);
+        infoPanel.add(passLabel);
+        infoPanel.add(this.passwordTextField);
+        infoPanel.add(confirmPassLabel);
+        infoPanel.add(this.confirmPasswordTextField);
+
+//        infoPanel.layout(4, 2, GridPanel.WEIGHT_NONE, 1);
+        infoPanel.layout(3, 2, GridPanel.WEIGHT_NONE, 1);
+
+//        urlTextField.getSwingComponent().addActionListener(new ActionListener() {
+//            public void actionPerformed(ActionEvent event) {
+//                updateURL();
+//                updateStatus();
+//            }
+//
+//        });
+
+        usernameTextField.getSwingComponent().addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent event) {
+                updateUsername();
+                updateStatus();
+            }
+
+        });
+
+        passwordTextField.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent event) {
+                updatePassword();
+                updateStatus();
+            }
+        });
+
+        confirmPasswordTextField.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent event) {
+                updatePassword();
+                updateStatus();
+            }
+        });
+
+        okButton = new JButton("OK");
+        okButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                ok();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new ActionListener() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Registry New User", infoPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+        updateControlData();
+    }
+
+    public String getUsername() {
+        return username;
+    }
+
+    public void setUsername(String username) {
+        this.username = username;
+    }
+
+    public void updateControlData() {
+        if (usernameTextField != null && getUsername() != null) {
+            usernameTextField.setText(getUsername());
+        }
+//        if (urlTextField != null && getUrl() != null) {
+//            urlTextField.setText(getUrl().toString());
+//        }
+    }
+
+    public URL getUrl() {
+        return url;
+    }
+
+    public void setUrl(URL url) {
+        this.url = url;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+//    private void updateURL() {
+//        URL specifiedURL = null;
+//        try {
+//            specifiedURL = new URL(urlTextField.getText());
+//        } catch (MalformedURLException e) {
+//            // erroneious url, ignore it
+//        }
+//        setUrl(specifiedURL);
+//    }
+
+    private void updateUsername() {
+        setUsername(usernameTextField.getText());
+    }
+
+    private void updatePassword() {
+        String password = null;
+        String ptext = new String(passwordTextField.getPassword());
+        String ctext = new String(confirmPasswordTextField.getPassword());
+        if (ptext.equals(ctext)) {
+            password = ptext;
+        }
+        setPassword(password);
+    }
+
+    public boolean isUserCreated() {
+        return userCreated;
+    }
+
+    public void setUserCreated(boolean userCreated) {
+        this.userCreated = userCreated;
+    }
+
+    public String getGatewayName() {
+        return gatewayName;
+    }
+
+    public void setGatewayName(String gatewayName) {
+        this.gatewayName = gatewayName;
+    }
+
+    public void close() {
+        hide();
+    }
+
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/RegistryWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/RegistryWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/RegistryWindow.java
new file mode 100644
index 0000000..e1c9f80
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/RegistryWindow.java
@@ -0,0 +1,313 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.registry;
+
+import java.awt.event.ActionEvent;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import javax.swing.AbstractAction;
+import javax.swing.BorderFactory;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPasswordField;
+
+import org.apache.airavata.client.AiravataAPIFactory;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ClientSettings;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
+import org.apache.airavata.xbaya.registry.PasswordCallbackImpl;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLinkButton;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.apache.airavata.xbaya.util.RegistryConstants;
+
+public class RegistryWindow {
+
+    private XBayaEngine engine;
+
+    private XBayaDialog dialog;
+
+    private XBayaTextField urlTextField;
+
+    private XBayaTextField gatewayTextField;
+
+    private XBayaTextField usernameTextField;
+
+    private JPasswordField passwordTextField;
+
+    private XBayaLinkButton newUserButton;
+
+    private NewRegistryUserDialog newUserWindow;
+
+    private String userName;
+
+    private String password;
+
+    private String regURL;
+
+    private String gateway;
+
+    private static String previousRegURL;
+
+    /**
+     * @param engine
+     */
+    public RegistryWindow(XBayaEngine engine) {
+        this.engine = engine;
+        ComponentRegistryLoader.getLoader(this.engine, RegistryConstants.REGISTRY_TYPE_JCR);
+        initGUI();
+    }
+
+    /**
+     * Displays the dialog.
+     */
+    public void show() {
+        this.dialog.show();
+    }
+
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void ok() {
+        setRegURL(this.urlTextField.getText());
+        setPreviousRegURL(this.urlTextField.getText());
+        setUserName(this.usernameTextField.getText());
+        setPassword(new String(this.passwordTextField.getPassword()));
+        setGateway(this.gatewayTextField.getText());
+
+        if (getRegURL().length() == 0) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_EMPTY);
+            return;
+        }
+        URI url;
+        try {
+            url = new URI(regURL);
+        } catch (URISyntaxException e) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.URL_WRONG, e);
+            return;
+        }
+
+        AiravataAPI airavataAPI = getAiravataAPI();
+
+//        JCRComponentRegistry registry = null;
+//        try {
+//            registry = new JCRComponentRegistry(airavataAPI);
+//        } catch (Exception e) {
+//            this.engine.getGUI().getErrorWindow().error(e.getMessage());
+//            return;
+//        }
+        XBayaConfiguration configuration = this.engine.getConfiguration();
+        this.engine.setAiravataAPI(airavataAPI);
+        configuration.setAiravataAPI(airavataAPI);
+        configuration.setRegigstryUserName(userName);
+        configuration.setRegistryPassphrase(password);
+        configuration.setRegistryURL(url);
+        configuration.setDefaultGateway(gateway);
+        engine.updateXBayaConfigurationServiceURLs();
+        hide();
+
+//        this.loader.load(registry);
+    }
+
+    private void createNewUser() {
+        URL specifiedURL = null;
+        try {
+            specifiedURL = new URL(urlTextField.getText());
+        } catch (MalformedURLException e1) {
+            // the text box contains invalid url, we'll just ignore it
+        }
+        if (newUserWindow == null) {
+            newUserWindow = new NewRegistryUserDialog(engine);
+        }
+//        newUserWindow.setUrl(specifiedURL);
+        newUserWindow.setUsername(usernameTextField.getText());
+        newUserWindow.updateControlData();
+        newUserWindow.show();
+        if (newUserWindow.isUserCreated()) {
+//            urlTextField.setText(newUserWindow.getUrl().toString());
+            usernameTextField.setText(newUserWindow.getUsername());
+            passwordTextField.setText(newUserWindow.getPassword());
+        }
+    }
+
+    /**
+     * Initializes the GUI.
+     */
+    private void initGUI() {
+        this.urlTextField = new XBayaTextField();
+        this.gatewayTextField = new XBayaTextField();
+        this.usernameTextField = new XBayaTextField();
+        this.passwordTextField = new JPasswordField();
+        try {
+            if (getPreviousRegURL() != null){
+                this.urlTextField.setText(engine.getConfiguration().getRegistryURL().toASCIIString());
+            } else if (engine.getConfiguration().isRegURLSetByCMD()){
+                this.urlTextField.setText(engine.getConfiguration().getRegistryURL().toASCIIString());
+            } else if (ClientSettings.isSettingDefined(XBayaConstants.XBAYA_REGISTRY_URL)){
+                this.urlTextField.setText(ClientSettings.getSetting(XBayaConstants.XBAYA_REGISTRY_URL));
+            }  else {
+                this.urlTextField.setText(engine.getConfiguration().getRegistryURL().toASCIIString());
+            }
+            if (ClientSettings.isSettingDefined(XBayaConstants.XBAYA_REGISTRY_USER)){
+                this.usernameTextField.setText(ClientSettings.getSetting(XBayaConstants.XBAYA_REGISTRY_USER));
+            } else {
+                this.usernameTextField.setText(engine.getConfiguration().getRegistryUserName());
+            }
+            if (ClientSettings.isSettingDefined(XBayaConstants.XBAYA_DEFAULT_GATEWAY)){
+                this.gatewayTextField.setText(ClientSettings.getSetting(XBayaConstants.XBAYA_DEFAULT_GATEWAY));
+            } else {
+                this.gatewayTextField.setText(engine.getConfiguration().getDefaultGateway());
+            }
+        } catch (ApplicationSettingsException e) {
+            e.printStackTrace();
+        }
+
+        try {
+            ClientSettings.initializeTrustStore();
+        } catch (ApplicationSettingsException e) {
+            throw new RuntimeException("An error occurred while initializing client configurations");
+        }
+
+        this.passwordTextField.setText(engine.getConfiguration().getRegistryPassphrase());
+        XBayaLabel urlLabel = new XBayaLabel("Registry URL", this.urlTextField);
+        XBayaLabel gatewayLabel = new XBayaLabel("Gateway", this.gatewayTextField);
+        XBayaLabel nameLabel = new XBayaLabel("Username", this.usernameTextField);
+        XBayaLabel passLabel = new XBayaLabel("Password", this.usernameTextField);
+        this.newUserButton = new XBayaLinkButton("Create new user...");
+        newUserButton.setHorizontalAlignment(XBayaLinkButton.RIGHT);
+        JLabel emptyLabel = new JLabel("");
+
+        newUserButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                createNewUser();
+            }
+        });
+
+        GridPanel infoPanel = new GridPanel();
+        infoPanel.add(urlLabel);
+        infoPanel.add(this.urlTextField);
+        infoPanel.add(gatewayLabel);
+        infoPanel.add(this.gatewayTextField);
+        infoPanel.add(nameLabel);
+        infoPanel.add(this.usernameTextField);
+        infoPanel.add(passLabel);
+        infoPanel.add(this.passwordTextField);
+        infoPanel.add(emptyLabel);
+        infoPanel.add(this.newUserButton);
+        infoPanel.layout(5, 2, GridPanel.WEIGHT_NONE, 1);
+//        infoPanel.layout(2, 2, GridPanel.WEIGHT_NONE, 1);
+
+        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+
+        JButton okButton = new JButton("OK");
+        okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                ok();
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        GridPanel buttonPanel = new GridPanel();
+        buttonPanel.add(okButton);
+        buttonPanel.add(cancelButton);
+        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Configure Airavata Registry", infoPanel, buttonPanel);
+        this.dialog.setDefaultButton(okButton);
+    }
+
+    public AiravataAPI getAiravataAPI(){
+        try {
+            URI regURI = new URI(getRegURL());
+            PasswordCallbackImpl passwordCallback = new PasswordCallbackImpl(userName, password);
+            AiravataAPI airavataAPI = AiravataAPIFactory.getAPI(regURI, getGateway(), userName, passwordCallback);
+            return airavataAPI;
+        } catch (URISyntaxException e) {
+            e.printStackTrace();
+        }catch (AiravataAPIInvocationException e) {
+            e.printStackTrace();
+            engine.getGUI().getErrorWindow().error("Some error has occurred while initialize. Please check whether you " +
+                    "entered correct credentials...", e);
+
+        }
+        return null;
+
+    }
+
+    public String getUserName() {
+        return userName;
+    }
+
+    public String getPassword() {
+        return password;
+    }
+
+    public String getRegURL() {
+        return regURL;
+    }
+
+    public void setRegURL(String regURL) {
+        this.regURL = regURL;
+    }
+
+    public void setUserName(String userName) {
+        this.userName = userName;
+    }
+
+    public void setPassword(String password) {
+        this.password = password;
+    }
+
+    public String getGateway() {
+        return gateway;
+    }
+
+    public void setGateway(String gateway) {
+        this.gateway = gateway;
+    }
+
+    public static String getPreviousRegURL() {
+        return previousRegURL;
+    }
+
+    public static void setPreviousRegURL(String previousRegURL) {
+        RegistryWindow.previousRegURL = previousRegURL;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/browser/JCRBrowserDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/browser/JCRBrowserDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/browser/JCRBrowserDialog.java
new file mode 100644
index 0000000..2268c03
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/registry/browser/JCRBrowserDialog.java
@@ -0,0 +1,117 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.registry.browser;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JButton;
+import javax.swing.JDialog;
+import javax.swing.JPanel;
+
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.views.JCRBrowserPanel;
+
+public class JCRBrowserDialog extends JDialog {
+
+    /**
+	 * 
+	 */
+    private static final long serialVersionUID = 2866874255829295553L;
+    private JPanel contentPanel = new JPanel();
+    private XBayaEngine engine;
+
+    /**
+     * Launch the application.
+     */
+    public static void main(String[] args) {
+        try {
+            JCRBrowserDialog dialog = new JCRBrowserDialog(null);
+            dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+            dialog.setVisible(true);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * Create the dialog.
+     */
+    public JCRBrowserDialog(XBayaEngine engine) {
+        setEngine(engine);
+        initGUI();
+    }
+
+    private void initGUI() {
+        setModal(true);
+        setLocationRelativeTo(null);
+        setBounds(100, 100, 450, 300);
+        getContentPane().setLayout(new BorderLayout());
+        contentPanel = new JCRBrowserPanel(getEngine());
+        getContentPane().add(contentPanel, BorderLayout.CENTER);
+        // contentPanel.setLayout(new BorderLayout(0, 0));
+        // {
+        // JScrollPane scrollPane = new JScrollPane();
+        // contentPanel.add(scrollPane, BorderLayout.CENTER);
+        // {
+        // JTree tree = new JTree(AiravataTreeNodeFactory.getTreeNode(getJCRRegistry(),null));
+        // tree.setCellRenderer(new RegistryTreeCellRenderer());
+        // scrollPane.setViewportView(tree);
+        // }
+        // }
+        {
+            JPanel buttonPane = new JPanel();
+            buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT));
+            getContentPane().add(buttonPane, BorderLayout.SOUTH);
+            {
+                JButton okButton = new JButton("Close");
+                okButton.addActionListener(new ActionListener() {
+                    public void actionPerformed(ActionEvent e) {
+                        close();
+                    }
+                });
+                okButton.setActionCommand("OK");
+                buttonPane.add(okButton);
+                getRootPane().setDefaultButton(okButton);
+            }
+        }
+    }
+
+    public void close() {
+        setVisible(false);
+    }
+
+    public void open() {
+        setVisible(true);
+    }
+
+    public XBayaEngine getEngine() {
+        return engine;
+    }
+
+    public void setEngine(XBayaEngine engine) {
+        this.engine = engine;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/ParameterPropertyWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/ParameterPropertyWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/ParameterPropertyWindow.java
new file mode 100644
index 0000000..4be2ed8
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/ParameterPropertyWindow.java
@@ -0,0 +1,170 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.workflow;
+
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.util.Collections;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.system.OutputNode;
+import org.apache.airavata.workflow.model.graph.util.GraphUtil;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.views.ParameterPropertyPanel;
+import org.xmlpull.infoset.XmlElement;
+
+public class ParameterPropertyWindow {
+
+    private XBayaEngine engine;
+
+    protected XBayaDialog dialog;
+
+    private ParameterPropertyPanel inputPanel;
+
+    private ParameterPropertyPanel outputPanel;
+
+    private JButton okButton;
+
+    private WSGraph graph;
+
+    private List<? extends Node> nodes;
+
+    private List<InputNode> inputNodes;
+
+    private List<OutputNode> outputNodes;
+
+    /**
+     * @param engine
+     */
+    public ParameterPropertyWindow(XBayaEngine engine) {
+        this.engine = engine;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        this.graph = this.engine.getGUI().getWorkflow().getGraph();
+        this.nodes = this.graph.getNodes();
+        this.inputNodes = GraphUtil.getInputNodes(this.graph);
+        this.outputNodes = GraphUtil.getOutputNodes(this.graph);
+
+        this.inputPanel.setParameterNodes(this.inputNodes);
+        this.inputPanel.setMetadata(this.graph.getInputMetadata());
+        this.outputPanel.setParameterNodes(this.outputNodes);
+        this.outputPanel.setMetadata(this.graph.getOutputMetadata());
+
+        this.dialog.show();
+    }
+
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private void ok() {
+        String inputMetadataText = this.inputPanel.getMetadata();
+        XmlElement inputMetadata;
+        if (inputMetadataText.length() == 0) {
+            inputMetadata = null;
+        } else {
+            try {
+                inputMetadata = XMLUtil.stringToXmlElement(inputMetadataText);
+            } catch (RuntimeException e) {
+                String warning = "The input metadata is ill-formed.";
+                this.engine.getGUI().getErrorWindow().error(warning, e);
+                return;
+            }
+        }
+
+        String outputMetadataText = this.outputPanel.getMetadata();
+        XmlElement outputMetadata;
+        if (outputMetadataText.length() == 0) {
+            outputMetadata = null;
+        } else {
+            try {
+                outputMetadata = XMLUtil.stringToXmlElement(outputMetadataText);
+            } catch (RuntimeException e) {
+                String warning = "The output metadata is ill-formed.";
+                this.engine.getGUI().getErrorWindow().error(warning, e);
+                return;
+            }
+        }
+
+        // Check is done at this point.
+
+        this.graph.setInputMetadata(inputMetadata);
+        this.graph.setOutputMetadata(outputMetadata);
+
+        // Sort the nodes in the graph in the order of sorted inputs, sorted
+        // outputs, and the rest.
+        for (int i = 0; i < this.inputNodes.size(); i++) {
+            InputNode inputNode = this.inputNodes.get(i);
+            Collections.swap(this.nodes, i, this.nodes.indexOf(inputNode));
+        }
+        for (int i = 0; i < this.outputNodes.size(); i++) {
+            OutputNode outputNode = this.outputNodes.get(i);
+            Collections.swap(this.nodes, this.inputNodes.size() + i, this.nodes.indexOf(outputNode));
+        }
+        hide();
+    }
+
+    private void initGui() {
+        this.inputPanel = new ParameterPropertyPanel("Inputs");
+        this.outputPanel = new ParameterPropertyPanel("Outputs");
+
+        JPanel mainPanel = new JPanel();
+        mainPanel.setLayout(new GridLayout(1, 2)); // To have the same size.
+        mainPanel.add(this.inputPanel.getSwingComponent());
+        mainPanel.add(this.outputPanel.getSwingComponent());
+
+        JPanel buttonPanel = new JPanel();
+        this.okButton = new JButton("OK");
+        this.okButton.setDefaultCapable(true);
+        this.okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                ok();
+            }
+        });
+        buttonPanel.add(this.okButton);
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Workflow Paremeter Properties", mainPanel, buttonPanel);
+        this.dialog.setDefaultButton(this.okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/WorkflowPropertyWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/WorkflowPropertyWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/WorkflowPropertyWindow.java
new file mode 100644
index 0000000..9043d76
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/workflow/WorkflowPropertyWindow.java
@@ -0,0 +1,216 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.dialogs.workflow;
+
+import java.awt.event.ActionEvent;
+import java.net.URI;
+import java.util.List;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+
+import org.apache.airavata.common.utils.StringUtil;
+import org.apache.airavata.common.utils.WSConstants;
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.ui.XBayaGUI;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextArea;
+import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
+import org.xmlpull.infoset.XmlElement;
+
+public class WorkflowPropertyWindow {
+
+    private XBayaGUI xbayaGUI;
+
+    private XBayaDialog dialog;
+
+    private JButton okButton;
+
+    private Workflow workflow;
+
+    private XBayaTextField nameTextField;
+
+    private XBayaTextField templateIDField;
+
+    private XBayaTextField instanceIDField;
+
+    private XBayaTextArea descriptionTextArea;
+
+    private XBayaTextArea metadataTextArea;
+
+    
+    /**
+     * @param engine
+     */
+    public WorkflowPropertyWindow(XBayaGUI xbayaGUI) {
+        this.xbayaGUI = xbayaGUI;
+        initGui();
+    }
+
+    /**
+     * Shows the dialog.
+     */
+    public void show() {
+        this.workflow = this.xbayaGUI.getWorkflow();
+
+        String name = this.workflow.getName();
+        this.nameTextField.setText(name);
+
+        String description = this.workflow.getDescription();
+        this.descriptionTextArea.setText(description);
+
+        URI templateID = this.workflow.getUniqueWorkflowName();
+        if (templateID == null) {
+            this.templateIDField.setText("");
+        } else {
+            this.templateIDField.setText(templateID.toString());
+        }
+
+        URI instanceID = this.workflow.getGPELInstanceID();
+        if (instanceID == null) {
+            this.instanceIDField.setText("");
+        } else {
+            this.instanceIDField.setText(instanceID.toString());
+        }
+
+        XmlElement metadata = this.workflow.getMetadata();
+        String metadataText;
+        if (metadata == null) {
+            metadataText = WSConstants.EMPTY_APPINFO;
+        } else {
+            metadataText = XMLUtil.xmlElementToString(metadata);
+        }
+        this.metadataTextArea.setText(metadataText);
+
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the dialog.
+     */
+    private void hide() {
+        this.dialog.hide();
+    }
+
+    private boolean isWorkflowNameAlreadyPresent(String name){
+    	List<GraphCanvas> graphCanvases = xbayaGUI.getGraphCanvases();
+    	for (GraphCanvas graphCanvas : graphCanvases) {
+    		if (graphCanvas!=xbayaGUI.getGraphCanvas()){
+				String existingName = graphCanvas.getWorkflow().getGraph().getName();
+				if (name.equals(existingName)){
+					return true;
+				}
+    		}
+		}
+    	return false;
+    }
+    
+    private void setToWorkflow() {
+        String name = this.nameTextField.getText();
+        if (name != null && name.equals(StringUtil.convertToJavaIdentifier(name)) && (!isWorkflowNameAlreadyPresent(name))) {
+            String description = this.descriptionTextArea.getText();
+            String metadataText = this.metadataTextArea.getText();
+
+            XmlElement metadata;
+            if (metadataText.length() == 0) {
+                metadata = null;
+            } else {
+                try {
+                    metadata = XMLUtil.stringToXmlElement(metadataText);
+                } catch (RuntimeException e) {
+                    String warning = "The metadata is ill-formed.";
+                    this.xbayaGUI.getErrorWindow().error(warning, e);
+                    return;
+                }
+            }
+
+            GraphCanvas graphCanvas = this.xbayaGUI.getGraphCanvas();
+            graphCanvas.setNameAndDescription(name, description);
+            graphCanvas.getWorkflow().setMetadata(metadata);
+            hide();
+        } else {
+            this.nameTextField.setText(StringUtil.convertToJavaIdentifier(name));
+            JOptionPane.showMessageDialog(this.xbayaGUI.getFrame(),
+                    "Invalid Name or a Workflow under the same name already exists. Please consider the Name suggsted", "Invalid Name", JOptionPane.OK_OPTION);
+        }
+    }
+
+    private void initGui() {
+        this.nameTextField = new XBayaTextField();
+        XBayaLabel nameLabel = new XBayaLabel("Name", this.nameTextField);
+
+        this.templateIDField = new XBayaTextField();
+        this.templateIDField.setEditable(false);
+        XBayaLabel templateIDLabel = new XBayaLabel("Template ID", this.templateIDField);
+
+        this.instanceIDField = new XBayaTextField();
+        this.instanceIDField.setEditable(false);
+        XBayaLabel instanceIDLabel = new XBayaLabel("Instance ID", this.instanceIDField);
+
+        this.descriptionTextArea = new XBayaTextArea();
+        XBayaLabel descriptionLabel = new XBayaLabel("Description", this.descriptionTextArea);
+
+        this.metadataTextArea = new XBayaTextArea();
+        XBayaLabel metadataLabel = new XBayaLabel("Metadata", this.metadataTextArea);
+
+        GridPanel mainPanel = new GridPanel();
+        mainPanel.add(nameLabel);
+        mainPanel.add(this.nameTextField);
+        mainPanel.add(templateIDLabel);
+        mainPanel.add(this.templateIDField);
+        mainPanel.add(instanceIDLabel);
+        mainPanel.add(this.instanceIDField);
+        mainPanel.add(descriptionLabel);
+        mainPanel.add(this.descriptionTextArea);
+        mainPanel.add(metadataLabel);
+        mainPanel.add(this.metadataTextArea);
+        mainPanel.layout(new double[] { 0, 0, 0, 0.5, 0.5 }, new double[] { 0, 1 });
+
+        this.okButton = new JButton("OK");
+        this.okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                setToWorkflow();
+
+            }
+        });
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+
+        JPanel buttonPanel = new JPanel();
+        buttonPanel.add(this.okButton);
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.xbayaGUI, "Workflow Properties", mainPanel, buttonPanel);
+        this.dialog.setDefaultButton(this.okButton);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/ExperimentMenu.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/ExperimentMenu.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/ExperimentMenu.java
new file mode 100644
index 0000000..a33dd49
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/ExperimentMenu.java
@@ -0,0 +1,110 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.experiment;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.KeyEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.registry.RegistryAccesser;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+
+public class ExperimentMenu {
+
+    private JMenu experimentMenu;
+
+    protected RegistryAccesser registryAccesser;
+
+    private JMenuItem configureRegistryItem;
+
+    private JMenuItem deleteWorkflowfromRegistryItem;
+
+    private XBayaEngine engine;
+
+    /**
+     * Constructs a FileMenu.
+     * 
+     * @param engine
+     * 
+     */
+    public ExperimentMenu(XBayaEngine engine) {
+        this.engine = engine;
+        this.registryAccesser = new RegistryAccesser(engine);
+
+        createExperimentMenu();
+    }
+
+    private void createExperimentMenu() {
+
+        createConfigureRegistryItem();
+        createDeleteWorkflowtoRegistryItem();
+
+        this.experimentMenu = new JMenu("Experiment");
+        this.experimentMenu.setMnemonic(KeyEvent.VK_F);
+
+        this.experimentMenu.add(this.configureRegistryItem);
+        this.experimentMenu.addSeparator();
+        this.experimentMenu.add(this.deleteWorkflowfromRegistryItem);
+        this.experimentMenu.addSeparator();
+        this.experimentMenu.addSeparator();
+    }
+
+    /**
+     * @return The Experiment menu.
+     */
+    public JMenu getMenu() {
+        return this.experimentMenu;
+    }
+
+    private void createConfigureRegistryItem() {
+        this.configureRegistryItem = new JMenuItem("Configure Registry");
+        configureRegistryItem.setMnemonic(KeyEvent.VK_C);
+        configureRegistryItem.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                XBayaEngine xbayaEngine = ExperimentMenu.this.engine;
+                XBayaUtil.updateJCRRegistryInfo(xbayaEngine);
+            }
+        });
+    }
+
+    private void createDeleteWorkflowtoRegistryItem() {
+        this.deleteWorkflowfromRegistryItem = new JMenuItem("Delete Workflows in Registry");
+        this.deleteWorkflowfromRegistryItem.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                try {
+                    ExperimentMenu.this.registryAccesser.deleteOGCEWorkflow(ExperimentMenu.this.engine.getGUI().getWorkflow()
+                            .getQname());
+                } catch (AiravataAPIInvocationException e1) {
+                    throw new WorkflowRuntimeException(e1);
+                }
+            }
+        });
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryLoaderWindow.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryLoaderWindow.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryLoaderWindow.java
new file mode 100644
index 0000000..5d266ce
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/experiment/RegistryLoaderWindow.java
@@ -0,0 +1,239 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.ui.experiment;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.util.Map;
+import java.util.Set;
+import java.util.Vector;
+
+import javax.swing.AbstractAction;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.SwingUtilities;
+import javax.swing.border.EtchedBorder;
+import javax.swing.border.TitledBorder;
+
+import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
+import org.apache.airavata.registry.api.exception.RegistryException;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.registry.RegistryAccesser;
+import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.GridPanel;
+import org.apache.airavata.xbaya.ui.widgets.XbayaEnhancedList;
+import org.apache.airavata.xbaya.util.XBayaUtil;
+
+public class RegistryLoaderWindow {
+
+    private XBayaEngine engine;
+
+    private XBayaDialog dialog;
+
+    private JButton okButton;
+
+    private JButton deleteButton;
+
+    private XbayaEnhancedList<RegistrySearchResult> list;
+
+    /**
+     * Constructs a RegistryLoaderWindow.
+     * 
+     * @param engine
+     */
+    public RegistryLoaderWindow(XBayaEngine engine) {
+        this.engine = engine;
+        if (XBayaUtil.acquireJCRRegistry(this.engine)) {
+            initGUI();
+        }
+    }
+
+    /**
+     * Shows the window.
+     */
+    public void show() {
+
+        /*
+         * this.list.getList().setListData( new String[]{ "Loading the workflow list from the Registry.",
+         * "Please wait for a moment."});
+         */
+        this.list.setEnabled(false);
+        this.okButton.setEnabled(false);
+        this.deleteButton.setEnabled(false);
+
+        new Thread() {
+            @Override
+            public void run() {
+                try {
+                    RegistryAccesser registryAccesser = new RegistryAccesser(RegistryLoaderWindow.this.engine);
+
+                    final Map<String, String> resultList = registryAccesser.getOGCEWorkflowTemplateList();
+                    final Set<String> keys = resultList.keySet();
+
+                    SwingUtilities.invokeLater(new Runnable() {
+                        public void run() {
+                            if (resultList == null || resultList.size() == 0) {
+                                /*
+                                 * OGCEXRegistryLoaderWindow.this.list.getList(). setListData( new
+                                 * String[]{"No workflow"});
+                                 */
+                            } else {
+                                Vector<RegistrySearchResult> results = new Vector<RegistrySearchResult>();
+                                String val = null;
+                                for (String key : keys) {
+                                    val = resultList.get(key);
+                                    try {
+										results.add(new RegistrySearchResult(new Workflow(val)));
+									} catch (GraphException e) {
+										e.printStackTrace();
+									} catch (ComponentException e) {
+										e.printStackTrace();
+									}
+                                }
+                                RegistryLoaderWindow.this.list.setListData(results);
+                                RegistryLoaderWindow.this.list.setEnabled(true);
+                            }
+                        }
+                    });
+                } catch (RuntimeException e) {
+                    RegistryLoaderWindow.this.engine.getGUI().getErrorWindow().error(
+                            ErrorMessages.REGISTRY_WORKFLOW_LIST_LOAD_ERROR, e);
+                    hide();
+                } catch (Error e) {
+                    RegistryLoaderWindow.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                    hide();
+                } catch (AiravataAPIInvocationException e) {
+                    RegistryLoaderWindow.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+                    hide();
+                }
+            }
+        }.start();
+
+        // This has to be the last because it blocks when the dialog is modal.
+        this.dialog.show();
+    }
+
+    /**
+     * Hides the window.
+     */
+    public void hide() {
+        this.dialog.hide();
+    }
+
+    private void ok() {
+        RegistrySearchResult result = this.list.getSelectedValue();
+        hide();
+
+        try {
+            Workflow workflow = new RegistryAccesser(this.engine).getWorkflow(result.getResourceName());
+            GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
+            newGraphCanvas.setWorkflow(workflow);
+            //this.engine.setWorkflow(workflow);
+            engine.getGUI().getGraphCanvas().setWorkflowFile(null);
+//            RegistryLoaderWindow.this.engine.setWorkflow(workflow);
+        } catch (Exception e) {
+            RegistryLoaderWindow.this.engine.getGUI().getErrorWindow().error(e);
+        }
+    }
+
+    private void delete() {
+        RegistryAccesser registryAccesser = new RegistryAccesser(RegistryLoaderWindow.this.engine);
+        for (RegistrySearchResult i : this.list.getSelectedValues()) {
+            try {
+                registryAccesser.deleteOGCEWorkflow(i.getResourceId());
+            }  catch (AiravataAPIInvocationException e) {
+                e.printStackTrace();
+            }
+        }
+        this.list.removeSelectedRows();
+        hide();
+    }
+
+    /**
+     * Initializes the GUI
+     */
+    private void initGUI() {
+
+        this.list = new XbayaEnhancedList<RegistrySearchResult>();
+
+        this.list.addMouseListener(new MouseAdapter() {
+            @Override
+            public void mouseClicked(MouseEvent e) {
+                if (e.getClickCount() >= 2) {
+                    // double click is same as cliking the OK button.
+                    RegistryLoaderWindow.this.okButton.doClick();
+                }
+
+                if (RegistryLoaderWindow.this.list.getSelectedIndex() == -2) {
+                    RegistryLoaderWindow.this.okButton.setEnabled(false);
+                    RegistryLoaderWindow.this.deleteButton.setEnabled(true);
+                } else if (RegistryLoaderWindow.this.list.getSelectedIndex() != -1) {
+                    RegistryLoaderWindow.this.okButton.setEnabled(true);
+                    RegistryLoaderWindow.this.deleteButton.setEnabled(true);
+                } else {
+                    RegistryLoaderWindow.this.okButton.setEnabled(false);
+                    RegistryLoaderWindow.this.deleteButton.setEnabled(false);
+                }
+            }
+        });
+
+        GridPanel mainPanel = new GridPanel();
+        TitledBorder border = new TitledBorder(new EtchedBorder(), "Select a workflow to load");
+        mainPanel.getSwingComponent().setBorder(border);
+        mainPanel.add(this.list);
+        mainPanel.layout(1, 1, 0, 0);
+
+        JPanel buttonPanel = new JPanel();
+        this.okButton = new JButton("Load");
+        this.okButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                ok();
+            }
+        });
+        buttonPanel.add(this.okButton);
+
+        this.deleteButton = new JButton("Delete");
+        this.deleteButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                delete();
+            }
+        });
+        buttonPanel.add(this.deleteButton);
+
+        JButton cancelButton = new JButton("Cancel");
+        cancelButton.addActionListener(new AbstractAction() {
+            public void actionPerformed(ActionEvent e) {
+                hide();
+            }
+        });
+        buttonPanel.add(cancelButton);
+
+        this.dialog = new XBayaDialog(this.engine.getGUI(), "Load a Workflow from the Registry", mainPanel, buttonPanel);
+        this.dialog.setDefaultButton(this.okButton);
+    }
+}


[16/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
deleted file mode 100644
index bc3d23f..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreter.java
+++ /dev/null
@@ -1,1508 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.atomic.AtomicInteger;
-
-import javax.xml.namespace.QName;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.utils.Pair;
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.common.utils.WSDLUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.common.workflow.execution.context.WorkflowContextHeaderBuilder;
-import org.apache.airavata.gfac.ec2.AmazonSecurityContext;
-import org.apache.airavata.registry.api.workflow.WorkflowExecution;
-import org.apache.airavata.registry.api.workflow.WorkflowExecutionStatus.State;
-import org.apache.airavata.registry.api.workflow.WorkflowInstanceNode;
-import org.apache.airavata.registry.api.workflow.WorkflowNodeType;
-import org.apache.airavata.workflow.model.component.Component;
-import org.apache.airavata.workflow.model.component.amazon.InstanceComponent;
-import org.apache.airavata.workflow.model.component.amazon.TerminateInstanceComponent;
-import org.apache.airavata.workflow.model.component.dynamic.DynamicComponent;
-import org.apache.airavata.workflow.model.component.system.ConstantComponent;
-import org.apache.airavata.workflow.model.component.system.DifferedInputComponent;
-import org.apache.airavata.workflow.model.component.system.DoWhileComponent;
-import org.apache.airavata.workflow.model.component.system.EndDoWhileComponent;
-import org.apache.airavata.workflow.model.component.system.EndForEachComponent;
-import org.apache.airavata.workflow.model.component.system.EndifComponent;
-import org.apache.airavata.workflow.model.component.system.ForEachComponent;
-import org.apache.airavata.workflow.model.component.system.IfComponent;
-import org.apache.airavata.workflow.model.component.system.InputComponent;
-import org.apache.airavata.workflow.model.component.system.MemoComponent;
-import org.apache.airavata.workflow.model.component.system.OutputComponent;
-import org.apache.airavata.workflow.model.component.system.S3InputComponent;
-import org.apache.airavata.workflow.model.component.system.SubWorkflowComponent;
-import org.apache.airavata.workflow.model.component.ws.WSComponent;
-import org.apache.airavata.workflow.model.component.ws.WSComponentPort;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.workflow.model.graph.ControlPort;
-import org.apache.airavata.workflow.model.graph.DataPort;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Node.NodeExecutionState;
-import org.apache.airavata.workflow.model.graph.amazon.InstanceNode;
-import org.apache.airavata.workflow.model.graph.dynamic.BasicTypeMapping;
-import org.apache.airavata.workflow.model.graph.dynamic.DynamicNode;
-import org.apache.airavata.workflow.model.graph.impl.EdgeImpl;
-import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
-import org.apache.airavata.workflow.model.graph.subworkflow.SubWorkflowNode;
-import org.apache.airavata.workflow.model.graph.system.ConstantNode;
-import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
-import org.apache.airavata.workflow.model.graph.system.EndForEachNode;
-import org.apache.airavata.workflow.model.graph.system.EndifNode;
-import org.apache.airavata.workflow.model.graph.system.ForEachNode;
-import org.apache.airavata.workflow.model.graph.system.IfNode;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.system.OutputNode;
-import org.apache.airavata.workflow.model.graph.ws.WSGraph;
-import org.apache.airavata.workflow.model.graph.ws.WSNode;
-import org.apache.airavata.workflow.model.graph.ws.WSPort;
-import org.apache.airavata.workflow.model.ode.ODEClient;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.workflow.model.wf.WorkflowExecutionState;
-import org.apache.airavata.ws.monitor.MonitorException;
-import org.apache.airavata.xbaya.concurrent.PredicatedTaskRunner;
-import org.apache.airavata.xbaya.invoker.DynamicInvoker;
-import org.apache.airavata.xbaya.invoker.EmbeddedGFacInvoker;
-import org.apache.airavata.xbaya.invoker.GenericInvoker;
-import org.apache.airavata.xbaya.invoker.Invoker;
-import org.apache.airavata.xbaya.invoker.WorkflowInputUtil;
-import org.apache.airavata.xbaya.provenance.ProvenanceReader;
-import org.apache.airavata.xbaya.provenance.ProvenanceWrite;
-import org.apache.airavata.xbaya.util.AmazonUtil;
-import org.apache.airavata.xbaya.util.InterpreterUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
-
-import xsul.lead.LeadResourceMapping;
-import xsul5.XmlConstants;
-
-public class WorkflowInterpreter {
-    private static final Logger log = LoggerFactory.getLogger(WorkflowInterpreter.class);
-
-	public static final String WORKFLOW_STARTED = "Workflow Running";
-	public static final String WORKFLOW_FINISHED = "Workflow Finished";
-
-	private WorkflowInterpreterConfiguration config;
-
-	private Map<Node, Invoker> invokerMap = new HashMap<Node, Invoker>();
-
-	private LeadResourceMapping resourceMapping;
-
-	private PredicatedTaskRunner provenanceWriter;
-
-	private WorkflowInterpreterInteractor interactor;
-
-
-    public static ThreadLocal<WorkflowInterpreterConfiguration> workflowInterpreterConfigurationThreadLocal =
-            new ThreadLocal<WorkflowInterpreterConfiguration>();
-
-    /**
-     *
-     * @param config
-     * @param interactor
-     */
-	public WorkflowInterpreter(WorkflowInterpreterConfiguration config, WorkflowInterpreterInteractor interactor) {
-		this.setConfig(config);
-		config.validateNotifier();
-		this.interactor = interactor;
-		if (config.isActOnProvenance()==null) {
-			config.setActOnProvenance(config.getConfiguration()
-					.isCollectProvenance());
-		}
-		config.setSubWorkflow(false);
-        setWorkflowInterpreterConfigurationThreadLocal(config);
-	}
-
-	public WorkflowInterpreterInteractor getInteractor(){
-		return this.interactor;
-	}
-	public void setResourceMapping(LeadResourceMapping resourceMapping) {
-		this.resourceMapping = resourceMapping;
-	}
-
-	private void notifyViaInteractor(WorkflowExecutionMessage messageType, Object data) {
-		interactor.notify(messageType, config, data);
-	}
-
-	private Object getInputViaInteractor(WorkflowExecutionMessage messageType, Object data) throws Exception {
-		return interactor.retrieveData(messageType, config, data);
-	}
-
-	/**
-	 * @throws WorkflowException
-	 */
-	public void scheduleDynamically() throws WorkflowException {
-		try {
-			if (!this.config.isSubWorkflow() && this.getWorkflow().getExecutionState() != WorkflowExecutionState.NONE) {
-				throw new WorkFlowInterpreterException("XBaya is already running a workflow");
-			}
-
-			this.getWorkflow().setExecutionState(WorkflowExecutionState.RUNNING);
-			ArrayList<Node> inputNodes = this.getInputNodesDynamically();
-			Object[] values = new Object[inputNodes.size()];
-			String[] keywords = new String[inputNodes.size()];
-			for (int i = 0; i < inputNodes.size(); ++i) {
-				Node node = inputNodes.get(i);
-				node.setState(NodeExecutionState.FINISHED);
-				notifyViaInteractor(WorkflowExecutionMessage.NODE_STATE_CHANGED, null);
-				keywords[i] = ((InputNode) node).getName();
-				values[i] = ((InputNode) node).getDefaultValue();
-                //Saving workflow input Node data before running the workflow
-                WorkflowNodeType workflowNodeType = new WorkflowNodeType();
-                workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.INPUTNODE);
-                WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(new WorkflowExecution(getConfig().getTopic(),
-                        getConfig().getTopic()), node.getID());
-                this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowInstanceNodeInput(workflowInstanceNode, keywords[i] + "=" + (String) values[i]);
-                this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowNodeType(workflowInstanceNode, workflowNodeType);
-			}
-			this.config.getNotifier().workflowStarted(values, keywords);
-			this.config.getConfiguration().setContextHeader(WorkflowContextHeaderBuilder.getCurrentContextHeader());
-
-			while (this.getWorkflow().getExecutionState() != WorkflowExecutionState.STOPPED) {
-                ArrayList<Node> readyNodes = this.getReadyNodesDynamically();
-                ArrayList<Thread> threadList = new ArrayList<Thread>();
-                if (getRemainNodesDynamically() == 0) {
-                    notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED, WorkflowExecutionState.STOPPED);
-                }
-                // ok we have paused sleep
-                if (this.getWorkflow().getExecutionState() == WorkflowExecutionState.PAUSED) {
-                	log.info("Workflow execution "+config.getTopic()+" is paused.");
-	                while (this.getWorkflow().getExecutionState() == WorkflowExecutionState.PAUSED) {
-	                    try {
-	                        Thread.sleep(400);
-	                    } catch (InterruptedException e) {
-	                        e.printStackTrace();
-	                    }
-	                }
-	                if (this.getWorkflow().getExecutionState() == WorkflowExecutionState.STOPPED) {
-	                	continue;
-	                }
-	                log.info("Workflow execution "+config.getTopic()+" is resumed.");
-                }
-                // get task list and execute them
-				for (final Node node : readyNodes) {
-					if (node.isBreak()) {
-						this.notifyPause();
-						break;
-					}
-					if (this.getWorkflow().getExecutionState() == WorkflowExecutionState.PAUSED
-							|| this.getWorkflow().getExecutionState() == WorkflowExecutionState.STOPPED) {
-						break;
-					}
-
-                    // Since this is an independent node execution we can run these nodes in separate threads.
-                    Thread th = new Thread() {
-                        public synchronized void run() {
-                            try {
-                                executeDynamically(node);
-                            } catch (WorkflowException e) {
-                                log.error("Error execution workflow Node : " + node.getID());
-                                return;
-                            }
-                        }
-                    };
-                    threadList.add(th);
-                    th.start();
-					if (this.getWorkflow().getExecutionState() == WorkflowExecutionState.STEP) {
-						this.getWorkflow().setExecutionState(WorkflowExecutionState.PAUSED);
-						break;
-					}
-				}
-                //This thread waits until parallel nodes get finished to send the outputs dynamically.
-               for(Thread th:threadList){
-                   try {
-                       th.join();
-                   } catch (InterruptedException e) {
-                       e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                   }
-               }
-                // Above statement set the nodeCount back to 0.
-
-				// TODO commented this for foreach, fix this.
-				sendOutputsDynamically();
-				// Dry run sleep a lil bit to release load
-				if (readyNodes.size() == 0) {
-					// when there are no ready nodes and no running nodes
-					// and there are failed nodes then workflow is stuck because
-					// of failure
-					// so we should pause the execution
-					if (InterpreterUtil.getRunningNodeCountDynamically(this.getGraph()) == 0
-							/**&& InterpreterUtil.getFailedNodeCountDynamically(this.getGraph()) != 0**/) {
-                        //Since airavata only support workflow interpreter server mode we do not want to keep thread in sleep mode
-                        // continuously, so we make the workflow stop when there's nothing to do.
-						this.getWorkflow().setExecutionState(WorkflowExecutionState.STOPPED);
-					}
-
-					try {
-						Thread.sleep(400);
-					} catch (InterruptedException e) {
-						log.error("Workflow Excecution is interrupted !");
-                        return;
-					}
-				}
-			}
-
-			if (InterpreterUtil.getFailedNodeCountDynamically(this.getGraph()) == 0) {
-				if (this.config.isActOnProvenance()) {
-
-                    try {
-                        this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowInstanceStatus(
-                                this.config.getTopic(), this.config.getTopic(), State.FINISHED);
-                    } catch (Exception e) {
-                        throw new WorkflowException(e);
-                    }
-
-					// System.out.println(this.config.getConfiguration().getJcrComponentRegistry().getRegistry().getWorkflowStatus(this.topic));
-				}
-			} else {
-				if (this.config.isActOnProvenance()) {
-					try {
-						this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().
-                                setWorkflowInstanceStatus(this.config.getTopic(),this.config.getTopic(), State.FAILED);
-					} catch (AiravataAPIInvocationException e) {
-						throw new WorkflowException(e);
-					}
-				}
-			}
-
-            this.config.getNotifier().workflowTerminated();
-
-            UUID uuid = UUID.randomUUID();
-			notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_TASK_START, new WorkflowInterpreterInteractor.TaskNotification("Stop Workflow",
-					"Cleaning up resources for Workflow", uuid.toString()));
-			// Send Notification for output values
-			finish();
-			// Sleep to provide for notification delay
-			try {
-				Thread.sleep(1000);
-			} catch (InterruptedException e) {
-				e.printStackTrace();
-			}
-			notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_TASK_END, new WorkflowInterpreterInteractor.TaskNotification("Stop Workflow",
-					"Cleaning up resources for Workflow", uuid.toString()));
-
-		} catch (RuntimeException e) {
-			// we reset all the state
-			cleanup();
-            this.config.getNotifier().workflowFailed(e.getMessage());
-        	raiseException(e);
-		} catch (AiravataAPIInvocationException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        }finally{
-        	cleanup();
-			if (config.getNotifier() != null) {
-				this.config.getNotifier().cleanup();
-			}
-			this.getWorkflow().setExecutionState(WorkflowExecutionState.NONE);
-	    }
-    }
-
-	/**
-	 * @param node
-	 * @return
-	 * @throws WorkflowException
-	 * @throws java.io.IOException
-	 */
-	private boolean readProvenance(Node node) {
-
-		try {
-			List<DataPort> inputPorts = node.getInputPorts();
-			Pair<String, String>[] inputs = new Pair[inputPorts.size()];
-			for (int i = 0; i < inputPorts.size(); ++i) {
-				String inputTagname = inputPorts.get(i).getName();
-				// cordinate return
-				if(node instanceof DoWhileNode){
-					inputs[i] = new Pair<String, String>(inputTagname, "<" + inputTagname + ">"
-							+ InterpreterUtil.findInputFromPort(inputPorts.get(i), this.invokerMap).toString() + "</" + inputTagname + ">");
-				break;
-				}else{
-				inputs[i] = new Pair<String, String>(inputTagname, "<" + inputTagname + ">"
-						+ InterpreterUtil.findInputFromPort(inputPorts.get(i), this.invokerMap).toString() + "</" + inputTagname + ">");
-				}
-			}
-
-			String output = ((String) new ProvenanceReader(node, this.config.getTopic(), this.config.getAiravataAPI()).read());
-			if (output != null) {
-				XmlElement result = XMLUtil.stringToXmlElement(output);
-				SystemComponentInvoker invoker = new SystemComponentInvoker();
-				List<DataPort> outPorts = node.getOutputPorts();
-				for (DataPort dataPort : outPorts) {
-
-					Iterable itr = result.children();
-					for (Object outputElem : itr) {
-						if (outputElem instanceof XmlElement) {
-							if (((XmlElement) outputElem).getName().equals(dataPort.getName())) {
-								invoker.addOutput(dataPort.getName(), ((XmlElement) outputElem).children().iterator().next());
-							}
-						}
-					}
-				}
-
-				this.invokerMap.put(node, invoker);
-				node.setState(NodeExecutionState.FINISHED);
-				return true;
-			} else {
-//				writeProvenanceLater(node);
-			}
-		} catch (Exception e) {
-			throw new WorkflowRuntimeException(e);
-		}
-		return false;
-
-	}
-
-	/**
-	 * @param node
-	 * @throws WorkflowException
-	 */
-	private void writeProvenanceLater(Node node) throws WorkflowException {
-
-		if (node instanceof ForEachNode) {
-			node = InterpreterUtil.findEndForEachFor((ForEachNode) node);
-		}
-		if (this.provenanceWriter == null) {
-			this.provenanceWriter = new PredicatedTaskRunner(1);
-		}
-		this.provenanceWriter.scedule(new ProvenanceWrite(node, this.getWorkflow().getName(), invokerMap, this.config.getTopic(), this.getConfig()
-				.getConfiguration().getAiravataAPI()));
-	}
-
-	/**
-	 * @param e
-	 */
-	public void raiseException(Throwable e) {
-		notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_ERROR, e);
-	}
-
-	/**
-     *
-     */
-	private void notifyPause() {
-		if (this.getWorkflow().getExecutionState() != WorkflowExecutionState.RUNNING && this.getWorkflow().getExecutionState() != WorkflowExecutionState.STEP) {
-			throw new WorkflowRuntimeException("Cannot pause when not running");
-		}
-		notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_STATE_CHANGED, WorkflowExecutionState.PAUSED);
-	}
-
-	/**
-	 * @throws MonitorException
-	 */
-	public void cleanup() throws MonitorException {
-		this.getWorkflow().setExecutionState(WorkflowExecutionState.STOPPED);
-		notifyViaInteractor(WorkflowExecutionMessage.EXECUTION_CLEANUP, null);
-	}
-
-	private void sendOutputsDynamically() throws WorkflowException, AiravataAPIInvocationException {
-		ArrayList<Node> outputNodes = getReadyOutputNodesDynamically();
-		if (outputNodes.size() != 0) {
-            LinkedList<Object> outputValues = new LinkedList<Object>();
-			LinkedList<String> outputKeywords = new LinkedList<String>();
-			for (Node node : outputNodes) {
-				// Change it to processing state so we will not pic it up in the
-				// next run
-				// even if the next run runs before the notification arrives
-
-				node.setState(NodeExecutionState.EXECUTING);
-				// OutputNode node = (OutputNode) outputNode;
-				List<DataPort> inputPorts = node.getInputPorts();
-
-				for (DataPort dataPort : inputPorts) {
-					Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
-					if (null == val) {
-						throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
-					}
-					// This is ok because the outputnodes always got only one
-					// input
-					if (val instanceof org.xmlpull.v1.builder.XmlElement) {
-						((OutputNode) node).setDescription(XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
-					} else {
-						((OutputNode) node).setDescription(val.toString());
-					}
-                    // Saving output Node data in to database
-                    WorkflowNodeType workflowNodeType = new WorkflowNodeType();
-                    workflowNodeType.setNodeType(WorkflowNodeType.WorkflowNode.OUTPUTNODE);
-                    WorkflowInstanceNode workflowInstanceNode = new WorkflowInstanceNode(new WorkflowExecution(config.getTopic(), config.getTopic()), node.getID());
-                    String portname = node.getName();
-                    String portValue = ((OutputNode) node).getDescription();
-                    this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowInstanceNodeOutput(workflowInstanceNode, portname + "=" + portValue);
-                    this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowNodeType(workflowInstanceNode, workflowNodeType);
-
-					if (this.config.isActOnProvenance()) {
-						try {
-							if (val instanceof String) {
-								this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager()
-										.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
-							} else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
-								this.getConfig()
-										.getConfiguration()
-										.getAiravataAPI().getProvenanceManager()
-										.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
-												XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
-							}
-                            outputValues.add(val);
-                            outputKeywords.add(dataPort.getID());
-						} catch (AiravataAPIInvocationException e) {
-							e.printStackTrace(); // To change body of catch
-													// statement use File |
-													// Settings | File
-													// Templates.
-						}
-					}
-					node.setState(NodeExecutionState.FINISHED);
-				}
-			}
-
-		}
-	}
-
-	private void finish() throws WorkflowException {
-		ArrayList<Node> outoutNodes = new ArrayList<Node>();
-		List<NodeImpl> nodes = this.getGraph().getNodes();
-		for (Node node : nodes) {
-			if (node instanceof OutputNode) {
-				if (node.getInputPort(0).getFromNode().getState()== NodeExecutionState.FINISHED) {
-					outoutNodes.add(node);
-				} else {
-					// The workflow is incomplete so return without sending
-					// workflowFinished
-					return;
-				}
-			}
-		}
-		LinkedList<Object> outputValues = new LinkedList<Object>();
-		LinkedList<String> outputKeywords = new LinkedList<String>();
-		for (Node outputNode : outoutNodes) {
-			OutputNode node = (OutputNode) outputNode;
-			List<DataPort> inputPorts = node.getInputPorts();
-			for (DataPort dataPort : inputPorts) {
-				Object val = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
-				;
-
-				if (null == val) {
-					throw new WorkFlowInterpreterException("Unable to find output for the node:" + node.getID());
-				}
-				// Some node not yet updated
-				if (node.getState().equals(NodeExecutionState.FINISHED)) {
-					if (this.config.isActOnProvenance()) {
-						try {
-							if (val instanceof String) {
-                                /**
-                                 TODO :  saveWorkflowExecutionOutput() is not implemented in Registry
-                                  API or Airavata API at the moment
-                                  **/
-								this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager()
-										.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(), val.toString());
-							} else if (val instanceof org.xmlpull.v1.builder.XmlElement) {
-								this.getConfig()
-										.getConfiguration()
-										.getAiravataAPI().getProvenanceManager()
-										.saveWorkflowExecutionOutput(this.config.getTopic(), node.getName(),
-												XMLUtil.xmlElementToString((org.xmlpull.v1.builder.XmlElement) val));
-							}
-
-						} catch (AiravataAPIInvocationException e) {
-							e.printStackTrace(); // To change body of catch
-													// statement use File |
-													// Settings | File
-													// Templates.
-						}
-					}
-					if (val instanceof XmlElement) {
-						((OutputNode) node).setDescription(XMLUtil.xmlElementToString((XmlElement) val));
-					} else {
-						((OutputNode) node).setDescription(val.toString());
-					}
-                    outputValues.add(val);
-                    outputKeywords.add(dataPort.getID());
-					node.setState(NodeExecutionState.FINISHED);
-				}
-			}
-
-		}
-		this.config.getNotifier().sendingPartialResults(outputValues.toArray(), outputKeywords.toArray(new String[outputKeywords.size()]));
-	}
-
-	private void executeDynamically(final Node node) throws WorkflowException {
-		node.setState(NodeExecutionState.EXECUTING);
-		Component component = node.getComponent();
-		if (component instanceof SubWorkflowComponent) {
-			handleSubWorkComponent(node);
-		} else if (component instanceof WSComponent) {
-			handleWSComponent(node);
-		} else if (component instanceof DynamicComponent) {
-			handleDynamicComponent(node);
-		} else if (component instanceof ForEachComponent) {
-			handleForEach(node);
-		} else if (component instanceof IfComponent) {
-			handleIf(node);
-		} else if (component instanceof EndifComponent) {
-			handleEndIf(node);
-		} else if (component instanceof DoWhileComponent) {
-			handleDoWhile(node);
-		}else if (component instanceof EndDoWhileComponent) {
-		// Component is handled in DoWhileHandler after eval condition
-		}
-		else if (component instanceof InstanceComponent) {
-			handleAmazonInstance(node);
-		} else if (component instanceof TerminateInstanceComponent) {
-			handleAmazonTerminateInstance(node);
-		} else {
-            throw new WorkFlowInterpreterException("Encountered Node that cannot be executed:" + node);
-		}
-	}
-
-	private void handleAmazonTerminateInstance(final Node node)
-			throws WorkflowException {
-		Object inputVal = InterpreterUtil.findInputFromPort(node.getInputPort(0), this.invokerMap);
-		String instanceId = inputVal.toString();
-		/*
-		 * Terminate instance
-		 */
-		AmazonUtil.terminateInstances(instanceId);
-
-		// set color to done
-		node.setState(NodeExecutionState.FINISHED);
-	}
-
-	private void handleAmazonInstance(final Node node) {
-		if (config.getAwsAccessKey().isEmpty() || config.getAwsSecretKey().isEmpty()) {
-			throw new WorkFlowInterpreterException("Please set Amazon Credential before using EC2 Instance Component");
-		}
-		for (ControlPort ports : node.getControlOutPorts()) {
-			ports.setConditionMet(true);
-		}
-	}
-
-	private void handleDoWhile(final Node node) {
-		// Executor thread is shutdown inside as thread gets killed when you
-		// shutdown
-		ExecutorService threadExecutor = Executors.newSingleThreadExecutor();
-		DoWhileHandler doWhileHandler = new DoWhileHandler((DoWhileNode) node, this.invokerMap, getWaitingNodesDynamically(),
-				getFinishedNodesDynamically(), this, threadExecutor);
-		threadExecutor.submit(doWhileHandler);
-	}
-
-	private void handleSubWorkComponent(Node node) throws WorkflowException {
-		notifyViaInteractor(WorkflowExecutionMessage.OPEN_SUBWORKFLOW, node);
-		// setting the inputs
-		Workflow subWorkflow = ((SubWorkflowNode) node).getWorkflow();
-		ArrayList<Node> subWorkflowInputNodes = getInputNodes(subWorkflow);
-
-		List<DataPort> inputPorts = node.getInputPorts();
-		for (DataPort port : inputPorts) {
-			Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
-			if (null == inputVal) {
-				throw new WorkFlowInterpreterException("Unable to find inputs for the subworkflow node node:" + node.getID());
-			}
-
-			for (Iterator<Node> iterator = subWorkflowInputNodes.iterator(); iterator.hasNext();) {
-				InputNode inputNode = (InputNode) iterator.next();
-				if (inputNode.getName().equals(port.getName())) {
-					inputNode.setDefaultValue(inputVal);
-				}
-			}
-		}
-		for (Iterator<Node> iterator = subWorkflowInputNodes.iterator(); iterator.hasNext();) {
-			InputNode inputNode = (InputNode) iterator.next();
-			if (inputNode.getDefaultValue() == null) {
-				throw new WorkFlowInterpreterException("Input not set for  :" + inputNode.getID());
-			}
-
-		}
-
-		try {
-			WorkflowInterpreter subworkflowInterpreter = (WorkflowInterpreter) getInputViaInteractor(
-					WorkflowExecutionMessage.INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW, subWorkflow);
-			subworkflowInterpreter.scheduleDynamically();
-		} catch (Exception e) {
-			throw new WorkflowException(e);
-		}
-	}
-
-	protected void handleWSComponent(Node node) throws WorkflowException {
-		WSComponent wsComponent = ((WSComponent) node.getComponent());
-		QName portTypeQName = wsComponent.getPortTypeQName();
-        Invoker invoker = this.invokerMap.get(node);
-
-        // We do this because invokers cannot be cached because the puretls expires
-        if (invoker != null) {
-            this.invokerMap.remove(invoker);
-        }
-
-        final WSNode wsNode = (WSNode) node;
-        String wsdlLocation = InterpreterUtil.getEPR(wsNode);
-        final String gfacURLString = this.getConfig().getConfiguration().getGFacURL().toString();
-        if (null == wsdlLocation) {
-
-            /* If there is a instance control component connects to this
-             * component send information in soap header */
-            for (Node n : wsNode.getControlInPort().getFromNodes()) {
-                if (n instanceof InstanceNode) {
-                    AmazonSecurityContext amazonSecurityContext;
-                    final String awsAccessKeyId = config.getAwsAccessKey();
-                    final String awsSecretKey = config.getAwsSecretKey();
-                    final String username = ((InstanceNode) n).getUsername();
-
-                    if (((InstanceNode) n).isStartNewInstance()) {
-                        final String amiId = ((InstanceNode) n).getIdAsValue();
-                        final String instanceType = ((InstanceNode) n).getInstanceType();
-
-                        amazonSecurityContext =
-                                new AmazonSecurityContext(username, awsAccessKeyId, awsSecretKey, amiId, instanceType);
-                    } else {
-                        final String instanceId = ((InstanceNode) n).getIdAsValue();
-                        amazonSecurityContext =
-                                new AmazonSecurityContext(username, awsAccessKeyId, awsSecretKey, instanceId);
-                    }
-
-                    this.config.getConfiguration().setAmazonSecurityContext(amazonSecurityContext);
-                }
-            }
-
-            if ((this.config.isGfacEmbeddedMode()) || (config.getAwsAccessKey() != null)) {
-                invoker = new EmbeddedGFacInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode.getComponent().getWSDL()), node.getID(),
-                        this.config.getMessageBoxURL().toASCIIString(), this.config.getMessageBrokerURL().toASCIIString(), this.config.getNotifier(),
-                        this.config.getTopic(), this.config.getAiravataAPI(), portTypeQName.getLocalPart(), this.config.getConfiguration());
-            } else {
-                invoker = new GenericInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(wsNode.getComponent().getWSDL()), node.getID(),
-                        this.config.getMessageBoxURL().toASCIIString(), gfacURLString, this.config.getNotifier());
-            }
-
-        } else {
-			if (wsdlLocation.endsWith("/")) {
-				wsdlLocation = wsdlLocation.substring(0, wsdlLocation.length() - 1);
-			}
-			if (!wsdlLocation.endsWith("?wsdl")) {
-				wsdlLocation += "?wsdl";
-			}
-			invoker = new GenericInvoker(portTypeQName, wsdlLocation, node.getID(), this.getConfig().getConfiguration().getMessageBoxURL().toString(),
-					gfacURLString, this.config.getNotifier());
-		}
-		invoker.setup();
-		this.invokerMap.put(node, invoker);
-		invoker.setOperation(wsComponent.getOperationName());
-
-		// find inputs
-		List<DataPort> inputPorts = node.getInputPorts();
-		ODEClient odeClient = new ODEClient();
-		for (DataPort port : inputPorts) {
-			Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
-
-			/*
-			 * Need to override inputValue if it is odeClient
-			 */
-			if (port.getFromNode() instanceof InputNode) {
-				inputVal = WorkflowInputUtil.parseValue((WSComponentPort) port.getComponentPort(), (String) inputVal);
-			}
-
-			if (null == inputVal) {
-				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + node.getID());
-			}
-			if (port.getFromNode() instanceof EndForEachNode) {
-				inputVal = WorkflowInputUtil.parseValue((WSComponentPort) port.getComponentPort(), (String) inputVal);
-				// org.xmlpull.v1.builder.XmlElement inputElem = XMLUtil
-				// .stringToXmlElement3("<" + port.getName() + ">"
-				// + inputVal.toString() + "</" + port.getName()
-				// + ">");
-				// inputVal = inputElem;
-			}
-			invoker.setInput(port.getName(), inputVal);
-		}
-		invoker.invoke();
-	}
-
-	private void handleDynamicComponent(Node node) throws WorkflowException {
-		DynamicComponent dynamicComponent = (DynamicComponent) node.getComponent();
-		String className = dynamicComponent.getClassName();
-		String operationName = dynamicComponent.getOperationName();
-		URL implJarLocation = dynamicComponent.getImplJarLocation();
-		DynamicNode dynamicNode = (DynamicNode) node;
-		LinkedList<Object> inputs = new LinkedList<Object>();
-		List<DataPort> inputPorts = dynamicNode.getInputPorts();
-		for (DataPort dataPort : inputPorts) {
-			Object inputVal = InterpreterUtil.findInputFromPort(dataPort, this.invokerMap);
-
-			/*
-			 * Set type after get input value, and override inputValue if output
-			 * type is array
-			 */
-			Node fromNode = dataPort.getFromNode();
-			QName type = null;
-			if (fromNode instanceof InputNode) {
-				type = BasicTypeMapping.STRING_QNAME;
-			} else if (fromNode instanceof ConstantNode) {
-				type = ((ConstantNode) fromNode).getType();
-			} else if ((dataPort.getFromPort() instanceof WSPort)
-					&& BasicTypeMapping.isArrayType(((WSPort) dataPort.getFromPort()).getComponentPort().getElement())) {
-				Invoker fromInvoker = this.invokerMap.get(fromNode);
-				inputVal = BasicTypeMapping.getOutputArray(XmlConstants.BUILDER.parseFragmentFromString(fromInvoker.getOutputs().toString()), dataPort
-						.getFromPort().getName(), BasicTypeMapping.getSimpleTypeIndex(((DataPort) dataPort.getFromPort()).getType()));
-				type = ((DataPort) dataPort.getFromPort()).getType();
-			} else {
-				type = ((DataPort) dataPort.getFromPort()).getType();
-			}
-
-			if (null == inputVal) {
-				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + node.getID());
-			}
-			inputs.add(BasicTypeMapping.getObjectOfType(type, inputVal));
-
-		}
-
-		DynamicInvoker dynamicInvoker = new DynamicInvoker(className, implJarLocation, operationName, inputs.toArray());
-		this.invokerMap.put(node, dynamicInvoker);
-		dynamicInvoker.setup();
-		dynamicInvoker.invoke();
-		node.setState(NodeExecutionState.FINISHED);
-	}
-
-	private void handleForEach(Node node) throws WorkflowException {
-		final ForEachNode forEachNode = (ForEachNode) node;
-		EndForEachNode endForEachNode = null;
-		Collection<Node> repeatNodes = node.getOutputPort(0).getToNodes();
-		// we will support only one for now
-		if (repeatNodes.size() != 1) {
-			throw new WorkFlowInterpreterException("Only one node allowed inside foreach");
-		}
-		Iterator<Node> iterator = repeatNodes.iterator();
-		if (iterator.hasNext()) {
-
-			Node middleNode = iterator.next();
-
-			// forEachNode should point to a WSNode and should have only one
-			// output
-			if ((!(middleNode instanceof WSNode)) && (!(middleNode instanceof SubWorkflowNode))) {
-				throw new WorkFlowInterpreterException("Encountered Node inside foreach that is not a WSNode" + middleNode);
-			} else if (middleNode instanceof SubWorkflowNode) {
-				/* Get the EndforEach Node of the Subworkflow */
-				Iterator<Node> subWorkflowOut = middleNode.getOutputPort(0).getToNodes().iterator();
-				while (subWorkflowOut.hasNext()) {
-					Node node2 = subWorkflowOut.next();
-					if (node2 instanceof EndForEachNode) {
-						endForEachNode = (EndForEachNode) node2;
-					}
-				}
-
-				final LinkedList<String> listOfValues = new LinkedList<String>();
-				InterpreterUtil.getInputsForForEachNode(forEachNode, listOfValues, this.invokerMap);
-				final Integer[] inputNumbers = InterpreterUtil.getNumberOfInputsForForEachNode(forEachNode, this.invokerMap);
-				Workflow workflow1 = ((SubWorkflowNode) middleNode).getWorkflow();
-				List<NodeImpl> nodes = workflow1.getGraph().getNodes();
-				List<Node> wsNodes = new ArrayList<Node>();
-				/* Take the List of WSNodes in the subworkflow */
-				for (NodeImpl subWorkflowNode : nodes) {
-					if (subWorkflowNode instanceof WSNode) {
-						wsNodes.add(subWorkflowNode);
-					}
-				}
-
-				for (int i = 0; i < wsNodes.size(); i++) {
-					final WSNode node1 = (WSNode) wsNodes.get(i);
-					SystemComponentInvoker systemInvoker = null;
-					List<DataPort> outputPorts1 = node1.getOutputPorts();
-					List<Node> endForEachNodes = new ArrayList<Node>();
-					for (DataPort port : outputPorts1) {
-						Iterator<Node> endForEachNodeItr1 = port.getToNodes().iterator();
-						while (endForEachNodeItr1.hasNext()) {
-							Node node2 = endForEachNodeItr1.next();
-							if (node2 instanceof EndForEachNode) {
-								endForEachNodes.add(node2);
-							} else if (node2 instanceof OutputNode) {
-								// intentionally left noop
-							} else {
-								throw new WorkFlowInterpreterException("Found More than one node inside foreach");
-							}
-
-						}
-					}
-					final List<Node> finalEndForEachNodes = endForEachNodes;
-
-					Iterator<Node> endForEachNodeItr1 = node1.getOutputPort(0).getToNodes().iterator();
-					while (endForEachNodeItr1.hasNext()) {
-						Node node2 = endForEachNodeItr1.next();
-						// Start reading input came for foreach node
-						int parallelRuns = listOfValues.size() * node1.getOutputPorts().size();
-						if (listOfValues.size() > 0) {
-							forEachNode.setState(NodeExecutionState.EXECUTING);
-							node1.setState(NodeExecutionState.EXECUTING);
-							List<DataPort> outputPorts = node1.getOutputPorts();
-							final AtomicInteger counter = new AtomicInteger();
-							for (Node endFor : endForEachNodes) {
-								systemInvoker = new SystemComponentInvoker();
-								this.invokerMap.put(endFor, systemInvoker);
-							}
-							final Map<Node, Invoker> finalMap = this.invokerMap;
-							new Thread() {
-								@Override
-								public void run() {
-									try {
-										runInThread(listOfValues, forEachNode, node1, finalEndForEachNodes, finalMap, counter, inputNumbers);
-									} catch (WorkflowException e) {
-
-										WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
-									}
-								}
-
-							}.start();
-
-							while (counter.intValue() < parallelRuns) {
-								try {
-									Thread.sleep(100);
-								} catch (InterruptedException e) {
-									Thread.currentThread().interrupt();
-								}
-
-							}
-							if (!(node2 instanceof OutputNode)) {
-								listOfValues.removeAll(listOfValues);
-								String output = (String) systemInvoker.getOutput(node1.getOutputPort(0).getName());
-								XmlElement xmlElement = XMLUtil.stringToXmlElement("<result>" + output + "</result>");
-								Iterator iterator1 = xmlElement.children().iterator();
-								while (iterator1.hasNext()) {
-									Object next1 = iterator1.next();
-									if (next1 instanceof XmlElement) {
-										listOfValues.add((String) ((XmlElement) next1).children().iterator().next());
-									}
-								}
-							}
-						}
-					}
-				}
-				// we have finished execution so end foreach is finished
-				// todo this has to be done in a separate thread
-				endForEachNode.setState(NodeExecutionState.FINISHED);
-				middleNode.setState(NodeExecutionState.FINISHED);
-				node.setState(NodeExecutionState.FINISHED);
-
-			} else {
-
-				// First node after foreach should end with EndForEachNode
-				List<DataPort> outputPorts1 = middleNode.getOutputPorts();
-				List<Node> endForEachNodes = new ArrayList<Node>();
-				for (DataPort port : outputPorts1) {
-					Iterator<Node> endForEachNodeItr1 = port.getToNodes().iterator();
-					while (endForEachNodeItr1.hasNext()) {
-						Node node2 = endForEachNodeItr1.next();
-						if (node2 instanceof EndForEachNode) {
-							endForEachNodes.add(node2);
-						} else if (node2 instanceof OutputNode) {
-							// intentionally left noop
-						} else {
-							throw new WorkFlowInterpreterException("Found More than one node inside foreach");
-						}
-
-					}
-				}
-				final List<Node> finalEndForEachNodes = endForEachNodes;
-				final Node foreachWSNode = middleNode;
-				final LinkedList<String> listOfValues = new LinkedList<String>();
-
-				// Start reading input came for foreach node
-				InterpreterUtil.getInputsForForEachNode(forEachNode, listOfValues, this.invokerMap);
-				final Integer[] inputNumbers = InterpreterUtil.getNumberOfInputsForForEachNode(forEachNode, this.invokerMap);
-
-				int parallelRuns = createInputValues(listOfValues, inputNumbers).size() * outputPorts1.size();
-				if (listOfValues.size() > 0) {
-
-					forEachNode.setState(NodeExecutionState.EXECUTING);
-					foreachWSNode.setState(NodeExecutionState.EXECUTING);
-					List<DataPort> outputPorts = middleNode.getOutputPorts();
-					final AtomicInteger counter = new AtomicInteger();
-					for (Node endFor : endForEachNodes) {
-						final SystemComponentInvoker systemInvoker = new SystemComponentInvoker();
-						this.invokerMap.put(endFor, systemInvoker);
-					}
-					final Map<Node, Invoker> finalInvokerMap = this.invokerMap;
-
-					new Thread() {
-						@Override
-						public void run() {
-							try {
-								runInThread(listOfValues, forEachNode, foreachWSNode, finalEndForEachNodes, finalInvokerMap, counter, inputNumbers);
-							} catch (WorkflowException e) {
-								WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
-							}
-						}
-
-					}.start();
-					while (counter.intValue() < parallelRuns) {
-						try {
-							Thread.sleep(100);
-						} catch (InterruptedException e) {
-							Thread.currentThread().interrupt();
-						}
-
-					}
-					// we have finished execution so end foreach is finished
-					// todo this has to be done in a separate thread
-					middleNode.setState(NodeExecutionState.FINISHED);
-					for (Node endForEach : endForEachNodes) {
-						endForEach.setState(NodeExecutionState.FINISHED);
-					}
-				} else {
-					throw new WorkFlowInterpreterException("No array values found for foreach");
-				}
-
-			}
-		}
-	}
-
-	private void handleIf(Node node) throws WorkflowException {
-		IfNode ifNode = (IfNode) node;
-
-		/*
-		 * Get all input to check condition
-		 */
-		String booleanExpression = ifNode.getXPath();
-		if (booleanExpression == null) {
-			throw new WorkFlowInterpreterException("XPath for if cannot be null");
-		}
-
-		List<DataPort> inputPorts = node.getInputPorts();
-		int i = 0;
-		for (DataPort port : inputPorts) {
-			Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
-
-			if (null == inputVal) {
-				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + node.getID());
-			}
-
-			booleanExpression = booleanExpression.replaceAll("\\$" + i, "'" + inputVal + "'");
-		}
-
-		// Now the XPath expression
-		try {
-			XPathFactory xpathFact = XPathFactory.newInstance();
-			XPath xpath = xpathFact.newXPath();
-			Boolean result = (Boolean) xpath.evaluate(booleanExpression, booleanExpression, XPathConstants.BOOLEAN);
-
-			/*
-			 * Set control port to make execution flow continue according to
-			 * condition
-			 */
-			for (ControlPort controlPort : node.getControlOutPorts()) {
-				if (controlPort.getName().equals(IfComponent.TRUE_PORT_NAME)) {
-					controlPort.setConditionMet(result.booleanValue());
-				} else if (controlPort.getName().equals(IfComponent.FALSE_PORT_NAME)) {
-					controlPort.setConditionMet(!result.booleanValue());
-				}
-			}
-
-			node.setState(NodeExecutionState.FINISHED);
-
-		} catch (XPathExpressionException e) {
-			throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
-		}
-	}
-
-	private void handleEndIf(Node node) throws WorkflowException {
-		EndifNode endIfNode = (EndifNode) node;
-		SystemComponentInvoker invoker = new SystemComponentInvoker();
-
-		List<DataPort> ports = endIfNode.getOutputPorts();
-		for (int outputPortIndex = 0, inputPortIndex = 0; outputPortIndex < ports.size(); outputPortIndex++, inputPortIndex = inputPortIndex + 2) {
-
-			Object inputVal = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex), this.invokerMap);
-
-			Object inputVal2 = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex + 1), this.invokerMap);
-
-			if ((inputVal == null && inputVal2 == null) || (inputVal != null && inputVal2 != null)) {
-				throw new WorkFlowInterpreterException("EndIf gets wrong input number" + "Port:" + inputPortIndex + " and " + (inputPortIndex + 1));
-			}
-
-			Object value = inputVal != null ? inputVal : inputVal2;
-			invoker.addOutput(endIfNode.getOutputPort(outputPortIndex).getID(), value);
-		}
-
-		this.invokerMap.put(node, invoker);
-
-		node.setState(NodeExecutionState.FINISHED);
-	}
-
-	private Invoker createInvokerForEachSingleWSNode(Node foreachWSNode, String gfacURLString, WSComponent wsComponent) throws WorkflowException {
-		Invoker invoker;
-		String wsdlLocation = InterpreterUtil.getEPR((WSNode) foreachWSNode);
-		QName portTypeQName = wsComponent.getPortTypeQName();
-		if (null == wsdlLocation) {
-            // WorkflowInterpreter is no longer using gfac in service mode. we only support embedded mode.
-//			if (gfacURLString.startsWith("https")) {
-//				LeadContextHeader leadCtxHeader = null;
-//				try {
-//					leadCtxHeader = XBayaUtil.buildLeadContextHeader(this.getWorkflow(), this.getConfig().getConfiguration(), new MonitorConfiguration(this
-//							.getConfig().getConfiguration().getBrokerURL(), this.config.getTopic(), true, this.getConfig().getConfiguration()
-//							.getMessageBoxURL()), foreachWSNode.getID(), null);
-//				} catch (URISyntaxException e) {
-//					throw new WorkflowException(e);
-//				}
-//				invoker = new WorkflowInvokerWrapperForGFacInvoker(portTypeQName, gfacURLString, this.getConfig().getConfiguration().getMessageBoxURL()
-//						.toString(), leadCtxHeader, this.config.getNotifier().createServiceNotificationSender(foreachWSNode.getID()));
-//			} else {
-                if (this.config.isGfacEmbeddedMode()) {
-					invoker = new EmbeddedGFacInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(((WSNode)foreachWSNode).getComponent().getWSDL()), foreachWSNode.getID(),
-							this.config.getMessageBoxURL().toASCIIString(), this.config.getMessageBrokerURL().toASCIIString(), this.config.getNotifier(),
-							this.config.getTopic(), this.config.getAiravataAPI(), portTypeQName.getLocalPart(), this.config.getConfiguration());
-				} else {
-					invoker = new GenericInvoker(portTypeQName, WSDLUtil.wsdlDefinitions5ToWsdlDefintions3(((WSNode)foreachWSNode).getComponent().getWSDL()), foreachWSNode.getID(),
-							this.config.getMessageBoxURL().toASCIIString(), gfacURLString, this.config.getNotifier());
-				}
-//			}
-
-		} else {
-			if (wsdlLocation.endsWith("/")) {
-				wsdlLocation = wsdlLocation.substring(0, wsdlLocation.length() - 1);
-			}
-			if (!wsdlLocation.endsWith("?wsdl")) {
-				wsdlLocation += "?wsdl";
-			}
-			invoker = new GenericInvoker(portTypeQName, wsdlLocation, foreachWSNode.getID(), this.getConfig().getConfiguration().getMessageBoxURL().toString(),
-					gfacURLString, this.config.getNotifier());
-		}
-		return invoker;
-	}
-
-	private void runInThread(final LinkedList<String> listOfValues, ForEachNode forEachNode, final Node middleNode, List<Node> endForEachNodes,
-			Map<Node, Invoker> tempInvoker, AtomicInteger counter, final Integer[] inputNumber) throws WorkflowException {
-
-		final LinkedList<Invoker> invokerList = new LinkedList<Invoker>();
-
-		if (inputNumber.length > 1) {
-			List<String> inputValues = createInputValues(listOfValues, inputNumber);
-			for (final Iterator<String> iterator = inputValues.iterator(); iterator.hasNext();) {
-				final String gfacURLString = this.getConfig().getConfiguration().getGFacURL().toString();
-				final String input = iterator.next();
-				WSComponent wsComponent = (WSComponent) middleNode.getComponent();
-				final Invoker invoker2 = createInvokerForEachSingleWSNode(middleNode, gfacURLString, wsComponent);
-				invokerList.add(invoker2);
-
-				new Thread() {
-					@Override
-					public void run() {
-						try {
-							getInvoker(middleNode, invoker2);
-							invokeGFacService(listOfValues, middleNode, inputNumber, input, invoker2);
-
-						} catch (WorkflowException e) {
-							WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
-						}
-					}
-
-				}.start();
-
-				try {
-					Thread.sleep(3000);
-				} catch (InterruptedException e) {
-					WorkflowInterpreter.this.config.getGUI().getErrorWindow().error(e);
-				}
-			}
-		} else {
-			Invoker invoker = null;
-			for (Iterator<String> iterator = listOfValues.iterator(); iterator.hasNext();) {
-				String input = iterator.next();
-				final String gfacURLString = this.getConfig().getConfiguration().getGFacURL().toString();
-				WSComponent wsComponent = (WSComponent) middleNode.getComponent();
-				invoker = createInvokerForEachSingleWSNode(middleNode, gfacURLString, wsComponent);
-				invokerList.add(invoker);
-				getInvoker(middleNode, invoker);
-
-				// find inputs
-				List<DataPort> inputPorts = middleNode.getInputPorts();
-				for (DataPort port : inputPorts) {
-					Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
-
-					/*
-					 * Handle ForEachNode
-					 */
-					Node fromNode = port.getFromNode();
-					// if (fromNode instanceof ForEachNode) {
-					inputVal = WorkflowInputUtil.parseValue((WSComponentPort) port.getComponentPort(), input);
-					// }
-
-					if (null == inputVal) {
-						throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + middleNode.getID());
-					}
-					invoker.setInput(port.getName(), inputVal);
-				}
-				invoker.invoke();
-			}
-		}
-
-		// String arrayElementName = foreachWSNode.getOperationName() +
-		// "ArrayResponse";
-		// String outputStr = "<" + arrayElementName + ">";
-		// invokerMap size and endForEachNodes size can be difference
-		// because we can create endForEachNode with n number of input/output
-		// ports so always have to use
-		// middleNode.getOutputPorts when iterate
-		String[] outputStr = new String[middleNode.getOutputPorts().size()];
-		int i = 0;
-		for (DataPort port : middleNode.getOutputPorts()) {
-			String outputString = "";
-			for (Iterator<Invoker> iterator = invokerList.iterator(); iterator.hasNext();) {
-				Invoker workflowInvoker = iterator.next();
-
-				// /
-				Object output = workflowInvoker.getOutput(port.getName());
-				if (output instanceof org.xmlpull.v1.builder.XmlElement) {
-					org.xmlpull.v1.builder.XmlElement element = (org.xmlpull.v1.builder.XmlElement) ((org.xmlpull.v1.builder.XmlElement) output).children()
-							.next();
-					outputString += "\n" + XMLUtil.xmlElementToString(element);
-				} else {
-					outputString += "\n<value>" + output + "</value>";
-				}
-				counter.incrementAndGet();
-			}
-			outputStr[i] = outputString;
-			System.out.println(outputStr[i]);
-			i++;
-		}
-		i = 0;
-		// outputStr += "\n</" + arrayElementName + ">";
-		int outputPortIndex = 0;
-		for (DataPort port : middleNode.getOutputPorts()) {
-			for (Node endForEachNode : endForEachNodes) {
-				if (tempInvoker.get(endForEachNode) != null) {
-					if (!(endForEachNode instanceof OutputNode)) {
-						((SystemComponentInvoker) tempInvoker.get(endForEachNode)).addOutput(port.getName(), outputStr[i]);
-					}
-				}
-				outputPortIndex++;
-			}
-			i++;
-		}
-		forEachNode.setState(NodeExecutionState.FINISHED);
-	}
-
-	private void invokeGFacService(LinkedList<String> listOfValues, Node middleNode, Integer[] inputNumber, String input, Invoker invoker)
-			throws WorkflowException {
-
-		// find inputs
-		List<DataPort> inputPorts = middleNode.getInputPorts();
-		String[] inputArray = null;
-		if (inputNumber.length == 1) {
-			inputArray = listOfValues.toArray(new String[listOfValues.size()]);
-		} else {
-			inputArray = StringUtil.getElementsFromString(input);
-		}
-		int index = 0;
-		for (DataPort port : inputPorts) {
-			Object inputVal = InterpreterUtil.findInputFromPort(port, this.invokerMap);
-			/*
-			 * Handle ForEachNode
-			 */
-			Node fromNode = port.getFromNode();
-			if (fromNode instanceof ForEachNode) {
-				inputVal = inputArray[index++];
-			}
-
-			if (null == inputVal) {
-				throw new WorkFlowInterpreterException("Unable to find inputs for the node:" + middleNode.getID());
-			}
-			invoker.setInput(port.getName(), inputVal);
-		}
-		invoker.invoke();
-
-	}
-
-	private Invoker getInvoker(Node middleNode, Invoker invoker) throws WorkflowException {
-		if (middleNode instanceof WSNode) {
-			WSComponent wsComponent = (WSComponent) middleNode.getComponent();
-			invoker.setup();
-			invoker.setOperation(wsComponent.getOperationName());
-		} else if (middleNode instanceof SubWorkflowNode) {
-			// ((SubWorkflowNode) middleNode).getWorkflow();
-			// this.config.getConfiguration();
-			// TODO : Need to create a invoker!
-			// new WorkflowInterpreter()
-		} else {
-			throw new WorkflowRuntimeException("Only Web services and subworkflows are supported for For-Each : Found : " + middleNode);
-		}
-		return invoker;
-	}
-
-	private List<String> createInputValues(LinkedList<String> listOfValues, Integer[] inputNumbers) throws WorkflowException {
-		List<String> inputValues = null;
-		try {
-			inputValues = new ArrayList<String>();
-			if (inputNumbers.length == 1) {
-				return listOfValues;
-			}
-			if (this.config.isRunWithCrossProduct()) {
-				for (int i = 0; i < inputNumbers[0]; i++) {
-					for (int j = 0; j < inputNumbers[1]; j++) {
-						inputValues.add(listOfValues.get(i) + StringUtil.DELIMETER + listOfValues.get(inputNumbers[0] + j));
-					}
-				}
-
-			} else {
-				List<String[]> inputList = new ArrayList<String[]>();
-				int startIndex = 0;
-				for (int input = 0; input < inputNumbers.length; input++) {
-					String[] inputArray = new String[inputNumbers[input]];
-					for (int travers = 0; travers < inputNumbers[input]; travers++) {
-						inputArray[travers] = listOfValues.get(startIndex++);
-					}
-					inputList.add(inputArray);
-				}
-				int inputSize = 1;
-				for (String[] inputArrays : inputList) {
-					if (inputArrays.length != 1) {
-						inputSize = inputArrays.length;
-					}
-				}
-				List<String[]> finalInputList = new ArrayList<String[]>();
-				for (String[] inputArrays : inputList) {
-					if (inputArrays.length == 1) {
-						String[] fullArray = new String[inputSize];
-						for (int i = 0; i < fullArray.length; i++) {
-							fullArray[i] = inputArrays[0];
-						}
-						finalInputList.add(fullArray);
-					} else {
-						finalInputList.add(inputArrays);
-					}
-				}
-				for (int i = 0; i < inputSize; i++) {
-					String inputValue = "";
-					for (String[] array : finalInputList) {
-						inputValue = inputValue + StringUtil.DELIMETER + StringUtil.quoteString(array[i]);
-					}
-					inputValue = inputValue.replaceFirst(StringUtil.DELIMETER , "");
-					inputValues.add(inputValue);
-				}
-
-			}
-		} catch (ArrayIndexOutOfBoundsException e) {
-			throw new WorkflowException("Wrong number of Inputs to For EachNode");
-		}
-		return inputValues;
-	}
-
-	private ArrayList<Node> getReadyOutputNodesDynamically() {
-		ArrayList<Node> list = new ArrayList<Node>();
-		List<NodeImpl> nodes = this.getGraph().getNodes();
-		for (Node node : nodes) {
-			if (node instanceof OutputNode && node.getState()==NodeExecutionState.WAITING
-					&& node.getInputPort(0).getFromNode().getState()== NodeExecutionState.FINISHED) {
-
-				list.add(node);
-			}
-		}
-		return list;
-	}
-
-	private int getRemainNodesDynamically() {
-		return InterpreterUtil.getWaitingNodeCountDynamically(this.getGraph()) + InterpreterUtil.getRunningNodeCountDynamically(this.getGraph());
-	}
-
-	private ArrayList<Node> getInputNodesDynamically() {
-		return getInputNodes(this.getWorkflow());
-	}
-
-	private ArrayList<Node> getInputNodes(Workflow wf) {
-		ArrayList<Node> list = new ArrayList<Node>();
-		List<NodeImpl> nodes = wf.getGraph().getNodes();
-		for (Node node : nodes) {
-			String name = node.getComponent().getName();
-			if (InputComponent.NAME.equals(name) || ConstantComponent.NAME.equals(name) || S3InputComponent.NAME.equals(name)) {
-				list.add(node);
-			}
-		}
-		return list;
-	}
-
-	private ArrayList<Node> getReadyNodesDynamically() {
-		ArrayList<Node> list = new ArrayList<Node>();
-		ArrayList<Node> waiting = InterpreterUtil.getWaitingNodesDynamically(this.getGraph());
-		ArrayList<Node> finishedNodes = InterpreterUtil.getFinishedNodesDynamically(this.getGraph());
-		for (Node node : waiting) {
-			Component component = node.getComponent();
-			if (component instanceof WSComponent
-					|| component instanceof DynamicComponent
-					|| component instanceof SubWorkflowComponent
-					|| component instanceof ForEachComponent
-					|| component instanceof EndForEachComponent
-					|| component instanceof IfComponent
-					|| component instanceof InstanceComponent) {
-
-				/*
-				 * Check for control ports from other node
-				 */
-				ControlPort control = node.getControlInPort();
-				boolean controlDone = true;
-				if (control != null) {
-					for (EdgeImpl edge : control.getEdges()) {
-						controlDone = controlDone && (finishedNodes.contains(edge.getFromPort().getNode())
-						// amazon component use condition met to check
-						// whether the control port is done
-						// FIXME I changed the "||" to a "&&" in the following since thats the only this
-						// that makes sense and if anyone found a scenario it should be otherwise pls fix
-								|| ((ControlPort) edge.getFromPort()).isConditionMet());
-					}
-				}
-
-				/*
-				 * Check for input ports
-				 */
-				List<DataPort> inputPorts = node.getInputPorts();
-				boolean inputsDone = true;
-				for (DataPort dataPort : inputPorts) {
-					inputsDone = inputsDone && finishedNodes.contains(dataPort.getFromNode());
-				}
-				if (inputsDone && controlDone) {
-					list.add(node);
-				}
-			} else if (component instanceof EndifComponent) {
-				/*
-				 * EndIfComponent can run if number of input equals to number of
-				 * output that it expects
-				 */
-				int expectedOutput = node.getOutputPorts().size();
-				int actualInput = 0;
-				List<DataPort> inputPorts = node.getInputPorts();
-				for (DataPort dataPort : inputPorts) {
-					if (finishedNodes.contains(dataPort.getFromNode()))
-						actualInput++;
-				}
-
-				if (expectedOutput == actualInput) {
-					list.add(node);
-				}
-			} else if (component instanceof TerminateInstanceComponent) {
-				/*
-				 * All node connected to controlIn port must be done
-				 */
-				ControlPort control = node.getControlInPort();
-				boolean controlDone = true;
-				if (control != null) {
-					for (EdgeImpl edge : control.getEdges()) {
-						controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
-					}
-				}
-
-				/*
-				 * Check for input ports
-				 */
-				List<DataPort> inputPorts = node.getInputPorts();
-				boolean inputsDone = true;
-				for (DataPort dataPort : inputPorts) {
-					inputsDone = inputsDone && finishedNodes.contains(dataPort.getFromNode());
-				}
-				if (inputsDone && controlDone) {
-					list.add(node);
-				}
-
-			} else if (InputComponent.NAME.equals(component.getName())
-					|| DifferedInputComponent.NAME.equals(component.getName())
-					|| S3InputComponent.NAME.equals(component.getName())
-					|| OutputComponent.NAME.equals(component.getName())
-					|| MemoComponent.NAME.equals(component.getName())
-					|| component instanceof EndDoWhileComponent) {
-				// no op
-			} else if (component instanceof DoWhileComponent) {
-				ControlPort control = node.getControlInPort();
-				boolean controlDone = true;
-				if (control != null) {
-					for (EdgeImpl edge : control.getEdges()) {
-						controlDone = controlDone && finishedNodes.contains(edge.getFromPort().getFromNode());
-					}
-				}
-
-				if (controlDone) {
-					list.add(node);
-				}
-			} else {
-				throw new WorkFlowInterpreterException("Component Not handled :" + component.getName());
-			}
-		}
-
-		notifyViaInteractor(WorkflowExecutionMessage.HANDLE_DEPENDENT_NODES_DIFFERED_INPUTS, this.getGraph());
-
-		return list;
-
-	}
-
-	public Workflow getWorkflow() {
-		return this.config.getWorkflow();
-	}
-
-	public void setProvenanceWriter(PredicatedTaskRunner provenanceWriter) {
-		this.provenanceWriter = provenanceWriter;
-	}
-
-	public WorkflowInterpreterConfiguration getConfig() {
-		return config;
-	}
-
-	public void setConfig(WorkflowInterpreterConfiguration config) {
-		this.config = config;
-	}
-
-	private WSGraph getGraph() {
-		return this.getWorkflow().getGraph();
-	}
-
-	private ArrayList<Node> getFinishedNodesDynamically() {
-		return this.getNodesWithState(NodeExecutionState.FINISHED);
-	}
-
-	private ArrayList<Node> getWaitingNodesDynamically() {
-		return this.getNodesWithState(NodeExecutionState.WAITING);
-	}
-
-	private ArrayList<Node> getNodesWithState(NodeExecutionState state) {
-		ArrayList<Node> list = new ArrayList<Node>();
-		List<NodeImpl> nodes = getGraph().getNodes();
-		for (Node node : nodes) {
-			if (state==node.getState()) {
-				list.add(node);
-			}
-		}
-		return list;
-	}
-
-    public static void setWorkflowInterpreterConfigurationThreadLocal(WorkflowInterpreterConfiguration workflowInterpreterConfiguration) {
-        WorkflowInterpreter.workflowInterpreterConfigurationThreadLocal.set(workflowInterpreterConfiguration);
-    }
-
-    public static WorkflowInterpreterConfiguration getWorkflowInterpreterConfiguration() {
-        return workflowInterpreterConfigurationThreadLocal.get();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java
deleted file mode 100644
index e21c18c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterConfiguration.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.ws.monitor.Monitor;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.jython.lib.NotificationSender;
-import org.apache.airavata.xbaya.jython.lib.WorkflowNotifiable;
-import org.apache.airavata.xbaya.ui.XBayaGUI;
-
-import java.net.URI;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class WorkflowInterpreterConfiguration {
-//	public static final int GUI_MODE = 1;
-//	public static final int SERVER_MODE = 2;
-//	
-	private URI messageBoxURL;
-	private URI messageBrokerURL;
-	private AiravataAPI registry;
-	private XBayaConfiguration configuration;
-	private XBayaGUI gui;
-	private Monitor monitor;
-	private boolean offline=false;
-	private boolean runWithCrossProduct=false;
-	private Workflow workflow;
-	private WorkflowNotifiable notifier;
-	private String topic;
-    private boolean gfacEmbeddedMode = false;
-	private Boolean actOnProvenance = null;
-	private boolean subWorkflow;
-	private boolean testMode=false;
-    private AiravataAPI airavataAPI;
-    private String awsAccessKey;
-    private String awsSecretKey;
-
-	public WorkflowInterpreterConfiguration(Workflow workflow,
-                                            String topic,
-                                            URI messageBoxURL,
-                                            URI messageBrokerURL,
-                                            AiravataAPI registry,
-                                            XBayaConfiguration configuration,
-                                            XBayaGUI gui,Monitor monitor) {
-		this(workflow, topic, messageBoxURL,messageBrokerURL,registry,configuration,gui,monitor, true);
-	}
-	
-    public WorkflowInterpreterConfiguration(Workflow workflow,
-                                            String topic,
-                                            URI messageBoxURL,
-                                            URI messageBrokerURL,
-                                            AiravataAPI airavataAPI,
-                                            XBayaConfiguration configuration,
-                                            XBayaGUI gui,
-                                            Monitor monitor,
-                                            boolean offline) {
-        this.messageBoxURL = messageBoxURL;
-        this.messageBrokerURL = messageBrokerURL;
-        this.airavataAPI = airavataAPI;
-        this.configuration = configuration;
-        this.gui = gui;
-        this.monitor = monitor;
-        this.offline = offline;
-        this.workflow = workflow;
-        this.topic = topic;
-    }
-	
-	public URI getMessageBoxURL() {
-		return messageBoxURL;
-	}
-	public void setMessageBoxURL(URI messageBoxURL) {
-		this.messageBoxURL = messageBoxURL;
-	}
-	public URI getMessageBrokerURL() {
-		return messageBrokerURL;
-	}
-	public void setMessageBrokerURL(URI messageBrokerURL) {
-		this.messageBrokerURL = messageBrokerURL;
-	}
-	public AiravataAPI getRegistry() {
-		return registry;
-	}
-	public void setRegistry(AiravataAPI registry) {
-		this.registry = registry;
-	}
-	public XBayaConfiguration getConfiguration() {
-		return configuration;
-	}
-	public void setConfiguration(XBayaConfiguration configuration) {
-		this.configuration = configuration;
-	}
-	public XBayaGUI getGUI() {
-		return gui;
-	}
-	public void setGUI(XBayaGUI gui) {
-		this.gui = gui;
-	}
-	public Monitor getMonitor() {
-		return monitor;
-	}
-	public void setMonitor(Monitor monitor) {
-		this.monitor = monitor;
-	}
-
-	public boolean isOffline() {
-		return offline;
-	}
-
-	public void setOffline(boolean offline) {
-		this.offline = offline;
-	}
-
-	public boolean isRunWithCrossProduct() {
-		return runWithCrossProduct;
-	}
-
-	public void setRunWithCrossProduct(boolean runWithCrossProduct) {
-		this.runWithCrossProduct = runWithCrossProduct;
-	}
-
-	public Workflow getWorkflow() {
-		return workflow;
-	}
-
-	public void setWorkflow(Workflow workflow) {
-		this.workflow = workflow;
-	}
-
-	public WorkflowNotifiable getNotifier() {
-		if (notifier==null){
-			notifier=new NotificationSender(getMessageBrokerURL(), getTopic());
-		}
-		return notifier;
-	}
-
-	public void validateNotifier(){
-		getNotifier();
-	}
-	
-	public String getTopic() {
-		return topic;
-	}
-
-	public void setTopic(String topic) {
-		this.topic = topic;
-	}
-
-//	public int getMode() {
-//		return getMonitor()==null? SERVER_MODE:GUI_MODE;
-//	}
-
-	public boolean isGfacEmbeddedMode() {
-		return gfacEmbeddedMode;
-	}
-
-	public void setGfacEmbeddedMode(boolean gfacEmbeddedMode) {
-		this.gfacEmbeddedMode = gfacEmbeddedMode;
-	}
-
-	public Boolean isActOnProvenance() {
-		return actOnProvenance;
-	}
-
-	public void setActOnProvenance(Boolean actOnProvenance) {
-		this.actOnProvenance = actOnProvenance;
-	}
-
-	public boolean isSubWorkflow() {
-		return subWorkflow;
-	}
-
-	public void setSubWorkflow(boolean subWorkflow) {
-		this.subWorkflow = subWorkflow;
-	}
-	
-	public void setNotifier(WorkflowNotifiable notifier) {
-		this.notifier = notifier;
-		setTestMode(notifier instanceof StandaloneNotificationSender);
-	}
-
-	public boolean isTestMode() {
-		return testMode;
-	}
-
-	private void setTestMode(boolean testMode) {
-		this.testMode = testMode;
-	}
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public String getAwsAccessKey() {
-        return awsAccessKey;
-    }
-
-    public void setAwsAccessKey(String awsAccessKey) {
-        this.awsAccessKey = awsAccessKey;
-    }
-
-    public String getAwsSecretKey() {
-        return awsSecretKey;
-    }
-
-    public void setAwsSecretKey(String awsSecretKey) {
-        this.awsSecretKey = awsSecretKey;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
deleted file mode 100644
index df39ef8..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInteractor.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-
-public interface WorkflowInterpreterInteractor {
-	public boolean notify(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data);
-	public Object retrieveData(WorkflowExecutionMessage messageType, WorkflowInterpreterConfiguration config, Object data) throws Exception;
-	public void pauseExecution(WorkflowInterpreterConfiguration config);
-	public void resumeExecution(WorkflowInterpreterConfiguration config);
-	public void terminateExecution(WorkflowInterpreterConfiguration config);
-	
-	public boolean isExecutionPaused(WorkflowInterpreterConfiguration config);
-	public boolean isExecutionTerminated(WorkflowInterpreterConfiguration config);
-	
-	public static class TaskNotification{
-		String messageTitle;
-		String message;
-		String messageId;
-		public TaskNotification(String messageTitle, String message, String messageId) {
-			this.messageTitle=messageTitle;
-			this.message=message;
-			this.messageId=messageId;
-		}
-	}
-	
-//	public static class WorkflowExecutionData{
-//		Workflow workflow;
-//		String topic;
-//		WorkflowInterpreter currentInterpreter;
-//		public WorkflowExecutionData(Workflow workflow,String topic, WorkflowInterpreter currentInterpreter) {
-//			this.workflow=workflow;
-//			this.topic=topic;
-//			this.currentInterpreter=currentInterpreter;
-//		}
-//	}
-//	
-//	public static class WSNodeData{
-//		WSNode wsNode;
-//		WorkflowInterpreter currentInterpreter;
-//		public WSNodeData(WSNode wsNode, WorkflowInterpreter currentInterpreter) {
-//			this.wsNode=wsNode;
-//			this.currentInterpreter=currentInterpreter;
-//		}
-//	}
-//	
-//	public static class GFacInvokerData{
-//		QName portTypeQName;
-//		WsdlDefinitions wsdl;
-//		String nodeID;
-//		String messageBoxURL;
-//        String gfacURL;
-//        WorkflowNotifiable notifier;
-//        String topic;
-//        AiravataRegistry2 registry;
-//        String serviceName;
-//        XBayaConfiguration config;
-//        boolean embeddedMode;
-//        
-//        public GFacInvokerData(boolean embeddedMode, QName portTypeQName, WsdlDefinitions wsdl, String nodeID, String messageBoxURL,
-//                String gfacURL, WorkflowNotifiable notifier,String topic,AiravataRegistry2 registry,String serviceName,XBayaConfiguration config) {
-//        	this.embeddedMode=embeddedMode;
-//        	this.portTypeQName = portTypeQName;
-//        	this.wsdl = wsdl;
-//        	this.nodeID = nodeID;
-//        	this.messageBoxURL = messageBoxURL;
-//        	this.gfacURL = gfacURL;
-//        	this.notifier = notifier;
-//        	this.topic = topic;
-//        	this.registry = registry;
-//        	this.serviceName = serviceName;
-//        	this.config = config;
-//		}
-//	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInvoker.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInvoker.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInvoker.java
deleted file mode 100644
index 2e08ec9..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/interpretor/WorkflowInterpreterInvoker.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.interpretor;
-
-public class WorkflowInterpreterInvoker {
-    // implements HeaderConstants {
-    //
-    // public void invoke(Workflow workflow, String serverURL, String userName, String password, String topic)
-    // throws AxisFault, RemoteException, ComponentException {
-    //
-    // String workflowAsString = workflow.toXMLText();
-    // NameValue[] configurations = new NameValue[6];
-    // configurations[0] = new NameValue();
-    // configurations[0].setName(HEADER_ELEMENT_GFAC);
-    // configurations[0].setValue(XBayaConstants.DEFAULT_GFAC_URL.toString());
-    // configurations[1] = new NameValue();
-    // configurations[1].setName(HEADER_ELEMENT_REGISTRY);
-    // configurations[2] = new NameValue();
-    // configurations[2].setName(HEADER_ELEMENT_PROXYSERVER);
-    // configurations[2].setValue(XBayaConstants.DEFAULT_MYPROXY_SERVER);
-    //
-    // configurations[3] = new NameValue();
-    // configurations[3].setName(HEADER_ELEMENT_MSGBOX);
-    // configurations[3].setValue(XBayaConstants.DEFAULT_MESSAGE_BOX_URL.toString());
-    //
-    // configurations[4] = new NameValue();
-    // configurations[4].setName(HEADER_ELEMENT_DSC);
-    // configurations[4].setValue(XBayaConstants.DEFAULT_DSC_URL.toString());
-    //
-    // configurations[5] = new NameValue();
-    // configurations[5].setName(HEADER_ELEMENT_BROKER);
-    // configurations[5].setValue(XBayaConstants.DEFAULT_BROKER_URL.toString());
-    //
-    // LinkedList<NameValue> nameValPairsList = new LinkedList<NameValue>();
-    // List<InputNode> wfInputs = new ODEClient().getInputNodes(workflow);
-    // for (InputNode node : wfInputs) {
-    // NameValue nameValue = new NameValue();
-    // nameValue.setName(node.getName());
-    // nameValue.setValue(node.getDefaultValue().toString());
-    // }
-    //
-    // new WorkflowInterpretorStub(serverURL).launchWorkflow(workflowAsString, topic, password, userName,
-    // nameValPairsList.toArray(new NameValue[0]), configurations);
-    //
-    // }
-
-}
\ No newline at end of file


[06/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/Echo.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/Echo.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/Echo.java
deleted file mode 100644
index bfc22db..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/Echo.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.echo;
-
-import java.io.File;
-
-import org.apache.airavata.xbaya.test.service.Service;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.xwsif_runtime.XmlElementBasedStub;
-
-public interface Echo extends XmlElementBasedStub {
-
-    /**
-     * SERVICE_NAME
-     */
-    public final static String SERVICE_NAME = "EchoService";
-
-    /**
-     * WSDL_NAME
-     */
-    public final static String WSDL_NAME = "echo.wsdl";
-
-    /**
-     * WSDL_PATH
-     */
-    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
-
-    /**
-     * @param input
-     *            the input message
-     * @return the output message
-     */
-    public XmlElement echo(XmlElement input);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoClient.java
deleted file mode 100644
index bc31eea..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoClient.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.echo;
-
-import java.net.URI;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.lead.LeadContextHeaderHelper;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsif.WSIFMessage;
-import xsul.wsif.WSIFOperation;
-import xsul.wsif.WSIFPort;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xwsif_runtime.WSIFClient;
-import xsul.xwsif_runtime.WSIFRuntime;
-import xsul.xwsif_runtime_async.WSIFAsyncResponsesCorrelator;
-
-public class EchoClient {
-
-    private final static Logger logger = LoggerFactory.getLogger(EchoClient.class);
-
-    private EchoService service;
-
-    /**
-     * 
-     */
-    public void run() {
-        String wsdlLoc = startServer();
-        runClient(wsdlLoc);
-        shutdownServer();
-    }
-
-    private String startServer() {
-        this.service = new EchoService(0);
-        this.service.run();
-        return this.service.getServiceWsdlLocation();
-    }
-
-    private void shutdownServer() {
-        this.service.shutdownServer();
-    }
-
-    private void runClient(String wsdlLoc) {
-        logger.info("Starting " + EchoClient.class.getName());
-        logger.info("Invoking operation echoString using WSDL from " + wsdlLoc);
-
-        WSIFAsyncResponsesCorrelator correlator;
-        correlator = null;
-
-        // pass some headers
-        LeadContextHeaderHelper helper = new LeadContextHeaderHelper();
-        helper.setXBayaConfiguration(new XBayaConfiguration());
-        LeadContextHeader leadContext = helper.getLeadContextHeader();
-        leadContext.setWorkflowId(URI.create("http://host/2005/11/09/workflowinstace"));
-        leadContext.setNodeId("decoder1");
-        leadContext.setTimeStep("5");
-        leadContext.setServiceId("decoder-instance-10");
-
-        WSIFClient wclient = WSIFRuntime.newClient(wsdlLoc)
-                .addHandler(new StickySoapHeaderHandler("use-lead-header", leadContext)).useAsyncMessaging(correlator)
-                .setAsyncResponseTimeoutInMs(33000L); // to simplify testing set to just few
-        // seconds
-
-        WSIFPort port = wclient.getPort();
-        WSIFOperation operation = port.createOperation("echo");
-        WSIFMessage inputMessage = operation.createInputMessage();
-        WSIFMessage outputMessage = operation.createOutputMessage();
-        WSIFMessage faultMessage = operation.createFaultMessage();
-
-        inputMessage.setObjectPart("input", "test");
-
-        logger.info("Using WSIF to send message:\n" + XMLUtil.xmlElementToString((XmlElement) inputMessage));
-        boolean success = operation.executeRequestResponseOperation(inputMessage, outputMessage, faultMessage);
-
-        XmlElement result;
-        if (success) {
-            result = (XmlElement) outputMessage;
-        } else {
-            result = (XmlElement) faultMessage;
-        }
-        logger.info("Received message:\n" + XMLUtil.xmlElementToString(result));
-
-        logger.info("Finished");
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        (new EchoClient()).run();
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoImpl.java
deleted file mode 100644
index e0a0243..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.echo;
-
-import java.util.Random;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-import org.xmlpull.v1.builder.XmlNamespace;
-
-import xsul.XmlConstants;
-
-public class EchoImpl implements Echo {
-
-    private final static Logger logger = LoggerFactory.getLogger(EchoImpl.class);
-
-    /**
-     * @see org.apache.airavata.xbaya.test.service.echo.Echo#echo(org.xmlpull.v1.builder.XmlElement)
-     */
-    public XmlElement echo(XmlElement inputElement) {
-        logger.info(XMLUtil.xmlElementToString(inputElement));
-
-        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
-
-        XmlElement input = inputElement.requiredElement(null, "input");
-
-        Random random = new Random();
-        int msec = random.nextInt(5000);
-        logger.info("Sleep for " + msec + " msec");
-        try {
-            Thread.sleep(msec);
-        } catch (InterruptedException e) {
-            logger.error(e.getMessage(), e);
-        }
-
-        XmlElement output = input;
-        output.setParent(null);
-        output.setName("output");
-
-        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("echotypens",
-                "http://www.extreme.indiana.edu/math/echo/xsd/");
-        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "EchoOutput");
-        outputElement.addElement(output);
-
-        if (notifier != null) {
-            notifier.sendingResult(outputElement);
-        }
-        logger.info(XMLUtil.xmlElementToString(outputElement));
-        return outputElement;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoService.java
deleted file mode 100644
index c3c58a8..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/echo/EchoService.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.echo;
-
-import java.io.File;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.test.service.Service;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xservo.XService;
-import xsul.xservo_soap.XSoapDocLiteralService;
-import xsul.xservo_soap_http.HttpBasedServices;
-
-public class EchoService implements Service {
-
-    private final static Logger logger = LoggerFactory.getLogger(EchoService.class);
-
-    private HttpBasedServices httpServices;
-
-    private XService xservice;
-
-    private int port;
-
-    /**
-     * Constructs an EchoService.
-     * 
-     * @param port
-     */
-    public EchoService(int port) {
-        this.port = port;
-    }
-
-    /**
-     * Runs the service.
-     */
-    public void run() {
-        this.httpServices = new HttpBasedServices(this.port);
-        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(Echo.SERVICE_NAME,
-                Service.MATH_DIRECTORY_NAME + File.separator + Echo.WSDL_PATH, new EchoImpl()));
-        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
-        this.xservice.startService();
-    }
-
-    /**
-     * Returns the location of the WSDL of the service.
-     * 
-     * @return The location of the WSDL of the service.
-     */
-    public String getServiceWsdlLocation() {
-        return this.httpServices.getServer().getLocation() + "/" + Echo.SERVICE_NAME + "?wsdl";
-    }
-
-    /**
-     * Returns the WSDL of the service.
-     * 
-     * @return The WSDL of the service.
-     */
-    public WsdlDefinitions getWsdl() {
-        return this.xservice.getWsdl();
-    }
-
-    /**
-     * Shutdowns the service.
-     */
-    public void shutdownServer() {
-        this.httpServices.getServer().shutdownServer();
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        try {
-            int port = 0;
-            if (args.length == 2) {
-                if ("-port".equalsIgnoreCase(args[0])) {
-                    port = Integer.parseInt(args[1]);
-                }
-            }
-            EchoService service = new EchoService(port);
-            service.run();
-            WsdlDefinitions wsdl = service.getWsdl();
-            File wsdlFile = new File(SAMPLE_WSDL_DIRECTORY, Echo.WSDL_NAME);
-            XMLUtil.saveXML(wsdl, wsdlFile);
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/Multiplier.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/Multiplier.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/Multiplier.java
deleted file mode 100644
index c1cde5c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/Multiplier.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.multiplier;
-
-import java.io.File;
-
-import org.apache.airavata.xbaya.test.service.Service;
-import org.xmlpull.v1.builder.XmlElement;
-
-import xsul.xwsif_runtime.XmlElementBasedStub;
-
-public interface Multiplier extends XmlElementBasedStub {
-
-    /**
-     * SERVICE_NAME
-     */
-    public final static String SERVICE_NAME = "MultiplierService";
-
-    /**
-     * WSDL_NAME
-     */
-    public final static String WSDL_NAME = "multiplier.wsdl";
-
-    /**
-     * WSDL_PATH
-     */
-    public final static String WSDL_PATH = Service.MATH_DIRECTORY_NAME + File.separator + WSDL_NAME;
-
-    /**
-     * @param input
-     *            the input message
-     * @return the output message
-     */
-    public XmlElement multiply(XmlElement input);
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierImpl.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierImpl.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierImpl.java
deleted file mode 100644
index 6b53c0a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierImpl.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.multiplier;
-
-import java.util.Random;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.xbaya.test.service.ServiceNotificationSender;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.v1.builder.XmlElement;
-import org.xmlpull.v1.builder.XmlNamespace;
-
-import xsul.XmlConstants;
-
-public class MultiplierImpl implements Multiplier {
-
-    private final static Logger logger = LoggerFactory.getLogger(MultiplierImpl.class);
-
-    /**
-     * @see org.apache.airavata.xbaya.test.service.multiplier.Multiplier#multiply(org.xmlpull.v1.builder.XmlElement)
-     */
-    public XmlElement multiply(XmlElement inputElement) {
-        logger.info(XMLUtil.xmlElementToString(inputElement));
-
-        ServiceNotificationSender notifier = ServiceNotificationSender.invoked(inputElement);
-
-        XmlElement xElement = inputElement.requiredElement(null, "x");
-        XmlElement yElement = inputElement.requiredElement(null, "y");
-        String xString = xElement.requiredTextContent();
-        String yString = yElement.requiredTextContent();
-
-        int x = Integer.parseInt(xString);
-        int y = Integer.parseInt(yString);
-
-        Random random = new Random();
-        int msec = random.nextInt(10000);
-        logger.info("Sleep for " + msec + " msec");
-        try {
-            Thread.sleep(msec);
-        } catch (InterruptedException e) {
-            logger.error(e.getMessage(), e);
-        }
-
-        int z = x * y;
-
-        String zString = "" + z;
-
-        XmlNamespace namespace = XmlConstants.BUILDER.newNamespace("multipliertypens",
-                "http://www.extreme.indiana.edu/math/multiplier/xsd/");
-        XmlElement outputElement = XmlConstants.BUILDER.newFragment(namespace, "MultiplyOutput");
-        XmlElement zElement = outputElement.addElement("z");
-        zElement.addChild(zString);
-
-        if (notifier != null) {
-            notifier.sendingResult(outputElement);
-        }
-        logger.info(XMLUtil.xmlElementToString(outputElement));
-        return outputElement;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierService.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierService.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierService.java
deleted file mode 100644
index e4d910b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/service/multiplier/MultiplierService.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.service.multiplier;
-
-import java.io.File;
-
-import org.apache.airavata.common.utils.XMLUtil;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import xsul.lead.LeadContextHeader;
-import xsul.wsdl.WsdlDefinitions;
-import xsul.xhandler_soap_sticky_header.StickySoapHeaderHandler;
-import xsul.xservo.XService;
-import xsul.xservo_soap.XSoapDocLiteralService;
-import xsul.xservo_soap_http.HttpBasedServices;
-
-public class MultiplierService {
-
-    private final static String SERVICE_NAME = "MultiplierService";
-
-    private final static String BASE_WSDL_LOCATION = "wsdls/math/multiplier-wsdl.xml";
-
-    private final static String OUTPUT_WSDL_LOCATION = "wsdls/sample/multiplier-wsdl.xml";
-
-    private final static Logger logger = LoggerFactory.getLogger(MultiplierService.class);
-
-    private HttpBasedServices httpServices;
-
-    private XService xservice;
-
-    private int port;
-
-    /**
-     * Constructs a MultiplierService.
-     * 
-     */
-    public MultiplierService() {
-        this(0);
-    }
-
-    /**
-     * Constructs a MultiplierService.
-     * 
-     * @param port
-     */
-    public MultiplierService(int port) {
-        this.port = port;
-    }
-
-    /**
-     * Runs the service.
-     */
-    public void run() {
-        this.httpServices = new HttpBasedServices(this.port);
-        logger.info("Server started on " + this.httpServices.getServerPort());
-
-        logger.info("Using WSDL for service description from " + BASE_WSDL_LOCATION);
-        this.xservice = this.httpServices.addService(new XSoapDocLiteralService(SERVICE_NAME, BASE_WSDL_LOCATION,
-                new MultiplierImpl()));
-        this.xservice.addHandler(new StickySoapHeaderHandler("retrieve-lead-header", LeadContextHeader.TYPE));
-        this.xservice.startService();
-        logger.info("Service started");
-        logger.info("Service WSDL available at " + getServiceWsdlLocation());
-    }
-
-    /**
-     * Returns the location of the WSDL.
-     * 
-     * @return The location of the WSDL
-     */
-    public String getServiceWsdlLocation() {
-        return this.httpServices.getServer().getLocation() + "/" + SERVICE_NAME + "?wsdl";
-    }
-
-    /**
-     * Returns the WSDL of the service.
-     * 
-     * @return The WSDL of the service.
-     */
-    public WsdlDefinitions getWsdl() {
-        return this.xservice.getWsdl();
-    }
-
-    /**
-     * Shutdowns the service.
-     */
-    public void shutdownServer() {
-        this.httpServices.getServer().shutdownServer();
-    }
-
-    /**
-     * @param args
-     */
-    public static void main(String[] args) {
-        try {
-            int port = 0;
-            if (args.length == 2) {
-                if ("-port".equalsIgnoreCase(args[0])) {
-                    port = Integer.parseInt(args[1]);
-                }
-            }
-            MultiplierService service = new MultiplierService(port);
-            service.run();
-            WsdlDefinitions wsdl = service.getWsdl();
-            File wsdlFile = new File(OUTPUT_WSDL_LOCATION);
-            XMLUtil.saveXML(wsdl, wsdlFile);
-        } catch (Exception e) {
-            logger.error(e.getMessage(), e);
-        }
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/util/WorkflowCreator.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/util/WorkflowCreator.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/util/WorkflowCreator.java
deleted file mode 100644
index 708788a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/test/util/WorkflowCreator.java
+++ /dev/null
@@ -1,741 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.test.util;
-
-import java.awt.Point;
-
-import org.apache.airavata.workflow.model.component.Component;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.component.ComponentRegistryException;
-import org.apache.airavata.workflow.model.component.local.LocalComponentRegistry;
-import org.apache.airavata.workflow.model.component.system.ConstantComponent;
-import org.apache.airavata.workflow.model.component.system.DoWhileComponent;
-import org.apache.airavata.workflow.model.component.system.EndDoWhileComponent;
-import org.apache.airavata.workflow.model.component.system.EndForEachComponent;
-import org.apache.airavata.workflow.model.component.system.EndifComponent;
-import org.apache.airavata.workflow.model.component.system.ForEachComponent;
-import org.apache.airavata.workflow.model.component.system.IfComponent;
-import org.apache.airavata.workflow.model.component.system.InputComponent;
-import org.apache.airavata.workflow.model.component.system.OutputComponent;
-import org.apache.airavata.workflow.model.component.system.ReceiveComponent;
-import org.apache.airavata.workflow.model.graph.Graph;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.system.ConstantNode;
-import org.apache.airavata.workflow.model.graph.system.DoWhileNode;
-import org.apache.airavata.workflow.model.graph.system.IfNode;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.system.OutputNode;
-import org.apache.airavata.workflow.model.graph.system.ReceiveNode;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.xbaya.file.XBayaPathConstants;
-import org.apache.airavata.xbaya.test.service.adder.Adder;
-import org.apache.airavata.xbaya.test.service.approver.Approver;
-import org.apache.airavata.xbaya.test.service.arrayadder.ArrayAdder;
-import org.apache.airavata.xbaya.test.service.arraygen.ArrayGenerator;
-import org.apache.airavata.xbaya.test.service.echo.Echo;
-import org.apache.airavata.xbaya.test.service.multiplier.Multiplier;
-
-public class WorkflowCreator {
-
-    /**
-     * GFAC_TEST_AWSDL
-     */
-    public static final String GFAC_TEST_AWSDL = "TestCMD_Example1_AWSDL.xml";
-
-    private Component inputComponent;
-
-    private Component outputComponent;
-
-    private LocalComponentRegistry componentRegistry;
-
-    private ConstantComponent constantComponent;
-
-    private ForEachComponent splitComponent;
-
-    private EndForEachComponent mergeComponent;
-
-    private IfComponent ifComponent;
-
-    private EndifComponent endifComponent;
-
-    private ReceiveComponent receiveComponent;
-
-    private DoWhileComponent doWhileComponent;
-
-    private EndDoWhileComponent endDoWhileComponent;
-
-    /**
-     * Constructs a WorkflowCreator.
-     */
-    public WorkflowCreator() {
-        this.componentRegistry = new LocalComponentRegistry(XBayaPathConstants.WSDL_DIRECTORY);
-        this.inputComponent = new InputComponent();
-        this.outputComponent = new OutputComponent();
-        this.constantComponent = new ConstantComponent();
-        this.splitComponent = new ForEachComponent();
-        this.mergeComponent = new EndForEachComponent();
-        this.ifComponent = new IfComponent();
-        this.endifComponent = new EndifComponent();
-        this.receiveComponent = new ReceiveComponent();
-        this.doWhileComponent = new DoWhileComponent();
-        this.endDoWhileComponent = new EndDoWhileComponent();
-    }
-
-    /**
-     * @return The graph
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createSimpleMathWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("Simple math workflow");
-        workflow.setDescription("Simple math workflow");
-
-        Graph graph = workflow.getGraph();
-
-        // Adder node
-        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
-        Node adderNode = workflow.addNode(adderComp);
-        adderNode.setPosition(new Point(250, 100));
-
-        // Input parameter node 1
-        InputNode paramNode1 = (InputNode) workflow.addNode(this.inputComponent);
-        paramNode1.setPosition(new Point(50, 50));
-
-        // Input parameter node 2
-        InputNode paramNode2 = (InputNode) workflow.addNode(this.inputComponent);
-        paramNode2.setPosition(new Point(50, 120));
-
-        // Output parameter
-        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
-        outParamNode.setPosition(new Point(300, 220));
-
-        // Connect ports
-        graph.addEdge(paramNode1.getOutputPort(0), adderNode.getInputPort(0));
-        graph.addEdge(paramNode2.getOutputPort(0), adderNode.getInputPort(1));
-        graph.addEdge(adderNode.getOutputPort(0), outParamNode.getInputPort(0));
-
-        // Set the default values
-        // This needs to be after connection.
-        String paramValue1 = "2";
-        paramNode1.setDefaultValue(paramValue1);
-        String paramValue2 = "3";
-        paramNode2.setDefaultValue(paramValue2);
-        return workflow;
-    }
-
-    /**
-     * @return The graph
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createMathWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("Math workflow");
-        workflow.setDescription("A workflow that calculates (a + b) * c.");
-
-        Graph graph = workflow.getGraph();
-
-        // Adder node
-        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
-
-        Node adderNode1 = workflow.addNode(adderComp);
-        adderNode1.setPosition(new Point(170, 50));
-
-        // Multiplier node
-        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);
-
-        Node multiNode = workflow.addNode(multiComp);
-        multiNode.setPosition(new Point(320, 130));
-
-        // Input node 1
-        InputNode inputNode1 = (InputNode) workflow.addNode(this.inputComponent);
-        inputNode1.setPosition(new Point(20, 30));
-
-        // Input node 2
-        InputNode inputNode2 = (InputNode) workflow.addNode(this.inputComponent);
-        inputNode2.setPosition(new Point(20, 100));
-
-        // Input node 3
-        InputNode inputNode3 = (InputNode) workflow.addNode(this.inputComponent);
-        inputNode3.setPosition(new Point(20, 170));
-
-        // Output
-        OutputNode outputNode = (OutputNode) workflow.addNode(this.outputComponent);
-        outputNode.setPosition(new Point(500, 130));
-
-        // Connect ports
-        graph.addEdge(inputNode1.getOutputPort(0), adderNode1.getInputPort(0));
-        graph.addEdge(inputNode2.getOutputPort(0), adderNode1.getInputPort(1));
-        graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
-        graph.addEdge(inputNode3.getOutputPort(0), multiNode.getInputPort(1));
-        graph.addEdge(multiNode.getOutputPort(0), outputNode.getInputPort(0));
-
-        // Set the default values
-        // This needs to be after connection.
-        inputNode1.setConfiguredName("a");
-        inputNode2.setConfiguredName("b");
-        inputNode3.setConfiguredName("c");
-        inputNode1.setConfigured(true);
-        inputNode2.setConfigured(true);
-        inputNode3.setConfigured(true);
-        inputNode1.setDefaultValue("2");
-        inputNode2.setDefaultValue("3");
-        inputNode3.setDefaultValue("4");
-        outputNode.setConfiguredName("z");
-        outputNode.setConfigured(true);
-
-        return workflow;
-    }
-
-    /**
-     * @return The graph
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createComplexMathWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("Complex math workflow");
-        workflow.setDescription("Complex math workflow");
-
-        Graph graph = workflow.getGraph();
-
-        // Adder nodes
-        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
-
-        Node adderNode1 = workflow.addNode(adderComp);
-        adderNode1.setPosition(new Point(170, 50));
-
-        Node adderNode2 = workflow.addNode(adderComp);
-        adderNode2.setPosition(new Point(170, 210));
-
-        // Multiplier node
-        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);
-
-        Node multiNode = workflow.addNode(multiComp);
-        multiNode.setPosition(new Point(320, 130));
-
-        // Input node 1
-        InputNode inputNode1 = (InputNode) workflow.addNode(this.inputComponent);
-        inputNode1.setPosition(new Point(20, 30));
-
-        // Input node 2
-        InputNode inputNode2 = (InputNode) workflow.addNode(this.inputComponent);
-        inputNode2.setPosition(new Point(20, 100));
-
-        // Input node 3
-        InputNode inputNode3 = (InputNode) workflow.addNode(this.inputComponent);
-        inputNode3.setPosition(new Point(20, 170));
-
-        // Input node 4
-        InputNode inputNode4 = (InputNode) workflow.addNode(this.inputComponent);
-        inputNode4.setPosition(new Point(20, 240));
-
-        // Output
-        OutputNode outputNode = (OutputNode) workflow.addNode(this.outputComponent);
-        outputNode.setPosition(new Point(500, 130));
-
-        // Connect ports
-        graph.addEdge(inputNode1.getOutputPort(0), adderNode1.getInputPort(0));
-        graph.addEdge(inputNode2.getOutputPort(0), adderNode1.getInputPort(1));
-        graph.addEdge(inputNode3.getOutputPort(0), adderNode2.getInputPort(0));
-        graph.addEdge(inputNode4.getOutputPort(0), adderNode2.getInputPort(1));
-        graph.addEdge(adderNode1.getOutputPort(0), multiNode.getInputPort(0));
-        graph.addEdge(adderNode2.getOutputPort(0), multiNode.getInputPort(1));
-        graph.addEdge(multiNode.getOutputPort(0), outputNode.getInputPort(0));
-
-        // Set the default values
-        // This needs to be after connection.
-        inputNode1.setConfiguredName("a");
-        inputNode2.setConfiguredName("b");
-        inputNode3.setConfiguredName("c");
-        inputNode4.setConfiguredName("d");
-        inputNode1.setDescription("This is the first input.");
-        inputNode2.setDescription("This is the second input.");
-        inputNode3.setDescription("This is the third input.");
-        inputNode4.setDescription("This is the fourth input.");
-        inputNode1.setConfigured(true);
-        inputNode2.setConfigured(true);
-        inputNode3.setConfigured(true);
-        inputNode4.setConfigured(true);
-        inputNode1.setDefaultValue("2");
-        inputNode2.setDefaultValue("3");
-        inputNode3.setDefaultValue("4");
-        inputNode4.setDefaultValue("5");
-        outputNode.setConfiguredName("z");
-        outputNode.setConfigured(true);
-
-        return workflow;
-    }
-
-    /**
-     * @return The graph
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createMathWithConstWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
-
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("Math with const");
-        workflow.setDescription("Math with const");
-
-        Graph graph = workflow.getGraph();
-
-        // Adder node
-        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
-        Node adderNode = workflow.addNode(adderComp);
-        adderNode.setPosition(new Point(250, 100));
-
-        // Input parameter node
-        InputNode inputNode = (InputNode) workflow.addNode(this.inputComponent);
-        inputNode.setPosition(new Point(50, 50));
-
-        // Constant node
-        ConstantNode constantNode = (ConstantNode) workflow.addNode(this.constantComponent);
-        constantNode.setPosition(new Point(50, 120));
-
-        // Output parameter
-        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
-        outParamNode.setPosition(new Point(300, 220));
-
-        // Connect ports
-        graph.addEdge(inputNode.getOutputPort(0), adderNode.getInputPort(0));
-        graph.addEdge(constantNode.getOutputPort(0), adderNode.getInputPort(1));
-        graph.addEdge(adderNode.getOutputPort(0), outParamNode.getInputPort(0));
-
-        // Set the default value of an input and the constant.
-        // This needs to be after connection.
-        String paramValue1 = "2";
-        inputNode.setDefaultValue(paramValue1);
-        String paramValue2 = "3";
-        constantNode.setValue(paramValue2);
-        return workflow;
-    }
-
-    /**
-     * @return The workflow
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createArrayWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("Array test");
-        workflow.setDescription("A workflow that tests arrays");
-
-        Graph graph = workflow.getGraph();
-
-        // n
-        InputNode inputN = (InputNode) workflow.addNode(this.inputComponent);
-        inputN.setPosition(new Point(0, 80));
-
-        // Array generator
-        Component arrayGeneratorComponent = this.componentRegistry.getComponent(ArrayGenerator.WSDL_PATH);
-        Node arrayGenerator = workflow.addNode(arrayGeneratorComponent);
-        arrayGenerator.setPosition(new Point(150, 80));
-
-        // Array adder
-        Component arrayAdderComponent = this.componentRegistry.getComponent(ArrayAdder.WSDL_PATH);
-        Node arrayAdder = workflow.addNode(arrayAdderComponent);
-        arrayAdder.setPosition(new Point(400, 80));
-
-        // Output
-        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
-        output.setConfiguredName("output");
-        output.setPosition(new Point(550, 80));
-
-        // Connect ports
-        graph.addEdge(inputN.getOutputPort(0), arrayGenerator.getInputPort(0));
-        graph.addEdge(arrayGenerator.getOutputPort(0), arrayAdder.getInputPort(0));
-        graph.addEdge(arrayAdder.getOutputPort(0), output.getInputPort(0));
-
-        // Set the default values
-        // This needs to be after connection.
-        String n = "5";
-        inputN.setDefaultValue(n);
-
-        return workflow;
-    }
-
-    /**
-     * @return The workflow
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createForEachWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("ForEach test");
-        workflow.setDescription("Workflow that tests if");
-
-        Graph graph = workflow.getGraph();
-
-        // x
-        InputNode inputX = (InputNode) workflow.addNode(this.inputComponent);
-        inputX.setPosition(new Point(0, 0));
-
-        // n
-        InputNode inputN = (InputNode) workflow.addNode(this.inputComponent);
-        inputN.setPosition(new Point(0, 80));
-
-        // Array generator
-        Component arrayGeneratorComponent = this.componentRegistry.getComponent(ArrayGenerator.WSDL_PATH);
-        Node arrayGenerator = workflow.addNode(arrayGeneratorComponent);
-        arrayGenerator.setPosition(new Point(120, 80));
-
-        // Split
-        Node split = workflow.addNode(this.splitComponent);
-        split.setPosition(new Point(310, 80));
-
-        // Adder
-        Component adderComponent = this.componentRegistry.getComponent(Adder.WSDL_PATH);
-        Node adder = workflow.addNode(adderComponent);
-        adder.setPosition(new Point(440, 40));
-
-        // Merge
-        Node merge = workflow.addNode(this.mergeComponent);
-        merge.setPosition(new Point(580, 40));
-
-        // Output
-        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
-        output.setConfiguredName("output");
-        output.setPosition(new Point(720, 40));
-
-        // Connect ports
-        graph.addEdge(inputX.getOutputPort(0), adder.getInputPort(0));
-        graph.addEdge(inputN.getOutputPort(0), arrayGenerator.getInputPort(0));
-        graph.addEdge(arrayGenerator.getOutputPort(0), split.getInputPort(0));
-        graph.addEdge(split.getOutputPort(0), adder.getInputPort(1));
-        graph.addEdge(adder.getOutputPort(0), merge.getInputPort(0));
-        graph.addEdge(merge.getOutputPort(0), output.getInputPort(0));
-
-        // Set the default values
-        // This needs to be after connection.
-        String x = "2";
-        inputX.setDefaultValue(x);
-        String n = "3";
-        inputN.setDefaultValue(n);
-
-        return workflow;
-    }
-
-    /**
-     * @return The workflow
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     * @throws ComponentException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createIfWorkflow() throws GraphException, ComponentException, ComponentRegistryException {
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("If test");
-        workflow.setDescription("Workflow that tests if");
-
-        Graph graph = workflow.getGraph();
-
-        // x
-        InputNode x = (InputNode) workflow.addNode(this.inputComponent);
-        x.setPosition(new Point(10, 10));
-
-        // y
-        InputNode y = (InputNode) workflow.addNode(this.inputComponent);
-        y.setPosition(new Point(10, 90));
-
-        // const0
-        ConstantNode const0 = (ConstantNode) workflow.addNode(this.constantComponent);
-        const0.setPosition(new Point(20, 180));
-
-        // if
-        IfNode ifNode = (IfNode) workflow.addNode(this.ifComponent);
-        ifNode.setPosition(new Point(170, 180));
-
-        // Adder nodes
-        Component adderComp = this.componentRegistry.getComponent(Adder.WSDL_PATH);
-
-        Node adder = workflow.addNode(adderComp);
-        adder.setPosition(new Point(400, 10));
-
-        // Multiplier node
-        Component multiComp = this.componentRegistry.getComponent(Multiplier.WSDL_PATH);
-
-        Node multiplier = workflow.addNode(multiComp);
-        multiplier.setPosition(new Point(400, 90));
-
-        // endif
-        Node endif = workflow.addNode(this.endifComponent);
-        endif.setPosition(new Point(550, 40));
-
-        // Output
-        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
-        output.setConfiguredName("output");
-        output.setPosition(new Point(700, 40));
-
-        // Connect ports
-        graph.addEdge(x.getOutputPort(0), adder.getInputPort(0));
-        graph.addEdge(x.getOutputPort(0), multiplier.getInputPort(0));
-        graph.addEdge(y.getOutputPort(0), adder.getInputPort(1));
-        graph.addEdge(y.getOutputPort(0), multiplier.getInputPort(1));
-        graph.addEdge(const0.getOutputPort(0), ifNode.getInputPort(0));
-        graph.addEdge(ifNode.getControlOutPorts().get(0), adder.getControlInPort());
-        graph.addEdge(ifNode.getControlOutPorts().get(1), multiplier.getControlInPort());
-        graph.addEdge(adder.getOutputPort(0), endif.getInputPort(0));
-        graph.addEdge(multiplier.getOutputPort(0), endif.getInputPort(1));
-        graph.addEdge(endif.getOutputPort(0), output.getInputPort(0));
-
-        // Set the default values
-        // This needs to be after connection.
-        x.setDefaultValue("2");
-        y.setDefaultValue("3");
-        const0.setValue("adder");
-        ifNode.setXPath("$0 = 'adder'");
-
-        return workflow;
-    }
-
-    /**
-     * @return The workflow
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     * @throws ComponentException
-     */
-    public Workflow createReceiveWorkflow() throws GraphException, ComponentException, ComponentRegistryException {
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("Receive test");
-        workflow.setDescription("Workflow that tests receive");
-
-        Graph graph = workflow.getGraph();
-
-        // Adder nodes
-        Component echoComponent = this.componentRegistry.getComponent(Echo.WSDL_PATH);
-
-        Node echo = workflow.addNode(echoComponent);
-        echo.setPosition(new Point(40, 40));
-
-        // receive
-        ReceiveNode receive = (ReceiveNode) workflow.addNode(this.receiveComponent);
-        receive.setPosition(new Point(200, 200));
-
-        // Output
-        OutputNode output1 = (OutputNode) workflow.addNode(this.outputComponent);
-        output1.setPosition(new Point(350, 40));
-
-        OutputNode output2 = (OutputNode) workflow.addNode(this.outputComponent);
-        output2.setPosition(new Point(350, 200));
-
-        // Connect ports
-        graph.addEdge(receive.getEPRPort(), echo.getInputPort(0));
-        graph.addEdge(echo.getOutputPort(0), output1.getInputPort(0));
-        graph.addEdge(receive.getOutputPort(0), output2.getInputPort(0));
-        graph.addEdge(echo.getControlOutPorts().get(0), receive.getControlInPort());
-
-        // Confugure
-        output1.setConfiguredName("output1");
-        output1.setConfigured(true);
-        output2.setConfiguredName("output2");
-        output2.setConfigured(true);
-
-        return workflow;
-
-    }
-
-    /**
-     * @return The graph
-     * @throws ComponentException
-     * @throws GraphException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createGFacWorkflow() throws ComponentException, GraphException, ComponentRegistryException {
-
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("GFac test workflow");
-        workflow.setDescription("GFac test workflow");
-
-        Graph graph = workflow.getGraph();
-
-        // Adder node
-        Component gfacComp = this.componentRegistry.getComponent(GFAC_TEST_AWSDL);
-        Node gfacNode = workflow.addNode(gfacComp);
-        gfacNode.setPosition(new Point(250, 100));
-
-        // Input parameter node 1
-        InputNode paramNode1 = (InputNode) workflow.addNode(this.inputComponent);
-        paramNode1.setPosition(new Point(50, 50));
-        String paramValue1 = "300";
-        paramNode1.setDefaultValue(paramValue1);
-
-        // Output parameter
-        OutputNode outParamNode = (OutputNode) workflow.addNode(this.outputComponent);
-        outParamNode.setPosition(new Point(300, 220));
-
-        // Connect ports
-        graph.addEdge(paramNode1.getOutputPort(0), gfacNode.getInputPort(0));
-        graph.addEdge(gfacNode.getOutputPort(0), outParamNode.getInputPort(0));
-
-        return workflow;
-    }
-
-    /**
-     * @return The workflow created.
-     * @throws GraphException
-     * @throws ComponentException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createLoanWorkflow() throws GraphException, ComponentException, ComponentRegistryException {
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("Loan Approval");
-        workflow.setDescription("Loan Approval");
-
-        Graph graph = workflow.getGraph();
-
-        // amount
-        InputNode amount = (InputNode) workflow.addNode(this.inputComponent);
-        amount.setPosition(new Point(10, 10));
-
-        // if
-        IfNode ifNode = (IfNode) workflow.addNode(this.ifComponent);
-        ifNode.setPosition(new Point(200, 100));
-
-        // Approver nodes
-        Component approverComponent = this.componentRegistry.getComponent(Approver.WSDL_PATH);
-
-        Node approver = workflow.addNode(approverComponent);
-        approver.setPosition(new Point(350, 10));
-
-        // const
-        ConstantNode constYes = (ConstantNode) workflow.addNode(this.constantComponent);
-        constYes.setPosition(new Point(350, 200));
-
-        // endif
-        Node endif = workflow.addNode(this.endifComponent);
-        endif.setPosition(new Point(550, 100));
-
-        // Output
-        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
-        output.setPosition(new Point(700, 100));
-
-        // Connect ports
-        graph.addEdge(amount.getOutputPort(0), approver.getInputPort(0));
-        graph.addEdge(amount.getOutputPort(0), ifNode.getInputPort(0));
-        graph.addEdge(ifNode.getControlOutPorts().get(0), approver.getControlInPort());
-        graph.addEdge(ifNode.getControlOutPorts().get(1), constYes.getControlInPort());
-        graph.addEdge(approver.getOutputPort(0), endif.getInputPort(0));
-        graph.addEdge(constYes.getOutputPort(0), endif.getInputPort(1));
-        graph.addEdge(endif.getOutputPort(0), output.getInputPort(0));
-
-        // Set the default values
-        // This needs to be after connection.
-        amount.setDefaultValue("500");
-        constYes.setValue("Yes");
-        ifNode.setXPath("$0 > 1000");
-        output.setConfiguredName("accept");
-        output.setConfigured(true);
-
-        return workflow;
-    }
-    /**
-     * Create a dowhile workflow
-     * @return Workflow created.
-     * @throws GraphException
-     * @throws ComponentException
-     * @throws ComponentRegistryException
-     */
-    public Workflow createDoWhileWorkflow() throws GraphException, ComponentException, ComponentRegistryException {
-        Workflow workflow = new Workflow();
-
-        // Name, description
-        workflow.setName("Do While");
-        workflow.setDescription("Do While");
-
-        Graph graph = workflow.getGraph();
-
-        // amount
-        InputNode amount = (InputNode) workflow.addNode(this.inputComponent);
-        amount.setPosition(new Point(10, 10));
-
-        // if
-        DoWhileNode doWhileNode = (DoWhileNode) workflow.addNode(this.doWhileComponent);
-        doWhileNode.setPosition(new Point(200, 100));
-
-        // Approver nodes
-        Component approverComponent = this.componentRegistry.getComponent(Approver.WSDL_PATH);
-
-        Node approver = workflow.addNode(approverComponent);
-        approver.setPosition(new Point(350, 10));
-
-        // const
-        ConstantNode constYes = (ConstantNode) workflow.addNode(this.constantComponent);
-        constYes.setPosition(new Point(350, 200));
-
-        // endif
-        Node endDoWhile = workflow.addNode(this.endDoWhileComponent);
-        endDoWhile.setPosition(new Point(550, 100));
-
-        // Output
-        OutputNode output = (OutputNode) workflow.addNode(this.outputComponent);
-        output.setPosition(new Point(700, 100));
-
-        // Connect ports
-        graph.addEdge(amount.getOutputPort(0), approver.getInputPort(0));
-        graph.addEdge(amount.getOutputPort(0), doWhileNode.getInputPort(0));
-        graph.addEdge(doWhileNode.getControlOutPorts().get(0), approver.getControlInPort());
-        graph.addEdge(doWhileNode.getControlOutPorts().get(1), constYes.getControlInPort());
-        graph.addEdge(approver.getOutputPort(0), endDoWhile.getInputPort(0));
-        graph.addEdge(constYes.getOutputPort(0), endDoWhile.getInputPort(1));
-        graph.addEdge(endDoWhile.getOutputPort(0), output.getInputPort(0));
-
-        // Set the default values
-        // This needs to be after connection.
-        amount.setDefaultValue("0");
-        constYes.setValue("Yes");
-        doWhileNode.setXpath("$1 = 1");
-        output.setConfiguredName("accept");
-        output.setConfigured(true);
-
-        return workflow;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
deleted file mode 100644
index 0e36d3e..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/XBayaGUI.java
+++ /dev/null
@@ -1,850 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ContainerEvent;
-import java.awt.event.ContainerListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JSplitPane;
-import javax.swing.JTabbedPane;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.WindowConstants;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.common.utils.XMLUtil;
-import org.apache.airavata.workflow.model.component.Component;
-import org.apache.airavata.workflow.model.component.ComponentException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowException;
-import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Port;
-import org.apache.airavata.workflow.model.wf.Workflow;
-import org.apache.airavata.ws.monitor.MonitorException;
-import org.apache.airavata.ws.monitor.event.Event;
-import org.apache.airavata.ws.monitor.event.Event.Type;
-import org.apache.airavata.ws.monitor.event.EventListener;
-import org.apache.airavata.xbaya.XBayaConfiguration;
-import org.apache.airavata.xbaya.XBayaConfiguration.XBayaExecutionMode;
-import org.apache.airavata.xbaya.XBayaConstants;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.core.generators.WorkflowFiler;
-import org.apache.airavata.xbaya.core.ide.XBayaExecutionModeListener;
-import org.apache.airavata.xbaya.ui.dialogs.ErrorWindow;
-import org.apache.airavata.xbaya.ui.dialogs.workflow.WorkflowPropertyWindow;
-import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
-import org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent;
-import org.apache.airavata.xbaya.ui.graph.GraphCanvasEvent.GraphCanvasEventType;
-import org.apache.airavata.xbaya.ui.graph.GraphCanvasListener;
-import org.apache.airavata.xbaya.ui.menues.XBayaMenu;
-import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
-import org.apache.airavata.xbaya.ui.views.ComponentViewer;
-import org.apache.airavata.xbaya.ui.views.JCRBrowserPanel;
-import org.apache.airavata.xbaya.ui.views.MonitorPanel;
-import org.apache.airavata.xbaya.ui.views.PortViewer;
-import org.apache.airavata.xbaya.ui.widgets.ScrollPanel;
-import org.apache.airavata.xbaya.ui.widgets.TabLabelButton;
-import org.apache.airavata.xbaya.ui.widgets.XBayaToolBar;
-import org.apache.airavata.xbaya.ui.widgets.component.ComponentSelector;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.xmlpull.infoset.XmlElement;
-
-public class XBayaGUI implements EventListener, XBayaExecutionModeListener {
-
-    private static final Logger logger = LoggerFactory.getLogger(XBayaGUI.class);
-
-    private static final int STATIC_MENU_ITEMS = 4;
-
-    private XBayaEngine engine;
-
-    private JFrame frame;
-
-    private XBayaMenu menu;
-
-    private List<GraphCanvas> graphCanvases = new LinkedList<GraphCanvas>();
-
-    private PortViewer portViewer;
-
-    private ComponentViewer componentViewer;
-
-    private ComponentSelector componentSelector;
-
-    private MonitorPanel monitorPane;
-
-    private XBayaToolBar toolbar;
-
-    private ErrorWindow errorWindow;
-
-    private JTabbedPane rightBottomTabbedPane;
-
-    private JTabbedPane graphTabbedPane;
-
-    private boolean graphPanelMaximized;
-
-    private int previousMainDividerLocation;
-
-    private int previousRightDividerLocation;
-
-    private JSplitPane mainSplitPane;
-
-    private JSplitPane leftSplitPane;
-
-    private JSplitPane rightSplitPane;
-
-    private JTabbedPane componentTabbedPane;
-
-    private ScrollPanel compTreeXBayapanel;
-
-	private WorkflowFiler graphFiler;
-
-    private WorkflowPropertyWindow workflowPropertiesWindow;
-
-    /**
-     * Constructs an XBayaEngine.
-     * 
-     * @param engine
-     */
-    public XBayaGUI(XBayaEngine engine) {
-        this.engine = engine;
-        this.engine.getMonitor().addEventListener(this);
-        graphFiler = new WorkflowFiler(engine);
-        engine.getConfiguration().registerExecutionModeChangeListener(this);
-
-        try {
-            SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    init();
-                }
-            });
-        } catch (InterruptedException e) {
-            // Shouldn't happen.
-            throw new WorkflowRuntimeException(e);
-        } catch (InvocationTargetException e) {
-            // Shouldn't happen.
-        	//It happened
-        	/* exception occurs when xbaya is opened twice from the jvm
-        	 * org.apache.airavata.xbaya.XBayaRuntimeException: java.lang.reflect.InvocationTargetException
-				at org.apache.airavata.xbaya.gui.XBayaGUI.<init>(XBayaGUI.java:148)
-				at org.apache.airavata.xbaya.XBayaEngine.<init>(XBayaEngine.java:106)
-				at org.apache.airavata.xbaya.XBaya.<init>(XBaya.java:51)
-				at org.ogce.paramchem.XBayaLauncher.run(XBayaLauncher.java:44)
-				at java.lang.Thread.run(Thread.java:662)
-			Caused by: java.lang.reflect.InvocationTargetException
-				at java.awt.EventQueue.invokeAndWait(EventQueue.java:1042)
-				at javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1326)
-				at org.apache.airavata.xbaya.gui.XBayaGUI.<init>(XBayaGUI.java:138)
-				... 4 more
-        	 */
-            throw new WorkflowRuntimeException(e);
-        }
-        
-        // Following suppsed to jump in the middle to save unsaved workflows when exiting xbaya
-        // but its not working because the UI is already disposed it seems :(
-//        Runtime.getRuntime().addShutdownHook(new Thread(){
-//        	@Override
-//        	public void run() {
-//        		while (getGraphCanvases().size()>0){
-//        			removeGraphCanvasFromIndex(0);
-//        		}
-//        	}
-//        });
-    }
-
-    /**
-     * Returns the notificationPane.
-     * 
-     * @return The notificationPane
-     */
-    public MonitorPanel getMonitorPane() {
-        return this.monitorPane;
-    }
-
-    /**
-     * Returns the ComponentTreeViewer.
-     * 
-     * @return The ComponentTreeViewer
-     */
-    public ComponentSelector getComponentSelector() {
-        return this.componentSelector;
-    }
-
-    /**
-     * Returns the ErrorWindow.
-     * 
-     * @return the errorWindow
-     */
-    public ErrorWindow getErrorWindow() {
-        return this.errorWindow;
-    }
-
-    /**
-     * Returns the Frame.
-     * 
-     * @return the Frame
-     */
-    public JFrame getFrame() {
-        return this.frame;
-    }
-
-    /**
-     * @return The list of GraphCanvases.
-     */
-    public List<GraphCanvas> getGraphCanvases() {
-        return this.graphCanvases;
-    }
-
-    /**
-     * Return the active GraphPanel.
-     * 
-     * @return The GraphPanel
-     */
-    public GraphCanvas getGraphCanvas() {
-        int index = this.graphTabbedPane.getSelectedIndex();
-        if (index!=-1) {
-			return this.graphCanvases.get(index);
-		}else{
-			return null;
-		}
-    }
-
-    /**
-     * Returns the toolbar.
-     * 
-     * @return The toolbar
-     */
-    public XBayaToolBar getToolbar() {
-    	if (toolbar==null){
-    		this.toolbar = new XBayaToolBar(this.engine);
-    	}
-        return this.toolbar;
-    }
-
-    public GraphCanvas newGraphCanvas(boolean focus) {
-    	return newGraphCanvas(focus, false);
-    }
-    
-    /**
-     * Creates a new graph tab.
-     * 
-     * This method needs to be called by Swing event thread.
-     * 
-     * @param focus
-     * 
-     * @return The graph canvas created
-     */
-    public GraphCanvas newGraphCanvas(boolean focus, boolean withID) {
-        GraphCanvas newGraphCanvas = new GraphCanvas(this.engine);
-        this.graphCanvases.add(newGraphCanvas);
-        this.graphTabbedPane.addTab(newGraphCanvas.getWorkflow().getName(), newGraphCanvas.getSwingComponent());
-        final int index = graphTabbedPane.getTabCount()-1;
-		TabLabelButton tabLabelButton = new TabLabelButton(graphTabbedPane,"Close this workflow");
-		graphTabbedPane.setTabComponentAt(index, tabLabelButton); 
-		tabLabelButton.setCloseButtonListener(new ActionListener(){
-			@Override
-			public void actionPerformed(ActionEvent e) {
-				removeGraphCanvasFromIndex(index);				
-			}
-		});
-        graphTabbedPane.addContainerListener(new ContainerListener(){
-
-			@Override
-			public void componentAdded(ContainerEvent event) {
-			}
-
-			@Override
-			public void componentRemoved(ContainerEvent event) {
-				List<GraphCanvas> graphCanvases = engine.getGUI().getGraphCanvases();
-				for (GraphCanvas graphCanvas : graphCanvases) {
-					if (graphCanvas.getSwingComponent()==event.getComponent()){
-						if (graphCanvas.isWorkflowChanged()){
-							setFocus(graphCanvas);
-							if (JOptionPane.showConfirmDialog(null, "The workflow '"+graphCanvas.getWorkflow().getName()+"' has been modified. Save changes?", "Save Workflow", JOptionPane.YES_NO_OPTION)==JOptionPane.YES_OPTION){
-								graphFiler.saveWorkflow(graphCanvas);
-							}
-						}
-						break;
-					}
-				}
-			}
-        	
-        });
-        if (focus) {
-            setFocus(newGraphCanvas);
-        }
-        newGraphCanvas.addGraphCanvasListener(this.componentViewer);
-        newGraphCanvas.addGraphCanvasListener(this.portViewer);
-        newGraphCanvas.addGraphCanvasListener(new GraphCanvasListener() {
-
-            public void graphCanvasChanged(GraphCanvasEvent event) {
-                GraphCanvasEventType type = event.getType();
-                final GraphCanvas graphCanvas = event.getGraphCanvas();
-                final Workflow workflow = event.getWorkflow();
-                switch (type) {
-                case GRAPH_LOADED:
-                case NAME_CHANGED:
-                    SwingUtilities.invokeLater(new Runnable() {
-                        public void run() {
-                            String name = workflow.getName();
-
-                            // Change the name of the tab.
-                            updateTabTitle(graphCanvas, workflow);
-
-                            // Change the name of the frame.
-                            setFrameName(name);
-                        }
-
-						
-                    });
-                    break;
-                case NODE_SELECTED:
-                case INPUT_PORT_SELECTED:
-                case OUTPUT_PORT_SELECTED:
-                    // Do nothing
-                case WORKFLOW_CHANGED:
-                	updateTabTitle(graphCanvas,graphCanvas.getWorkflow());
-                	setFrameName(workflow.getName());
-                	for (ChangeListener listener:tabChangeListeners){
-                		try{
-                			listener.stateChanged(null);
-                		}catch(Exception e){
-                			e.printStackTrace();
-                		}
-                	}
-                }
-            }
-            private void updateTabTitle(
-					final GraphCanvas graphCanvas,
-					final Workflow workflow) {
-				int index = XBayaGUI.this.graphTabbedPane.indexOfComponent(graphCanvas.getSwingComponent());
-                String newTitle = workflow.getName();
-                if (graphCanvas.isWorkflowChanged()){
-                	newTitle="*"+newTitle;
-                }
-				XBayaGUI.this.graphTabbedPane.setTitleAt(index, newTitle);
-			}
-        });
-        if (withID){
-        	getWorkflowPropertyWindow().show();
-        }
-        return newGraphCanvas;
-    }
-
-    /**
-     * @param graphCanvas
-     */
-    public void setFocus(GraphCanvas graphCanvas) {
-        this.graphTabbedPane.setSelectedComponent(graphCanvas.getSwingComponent());
-    }
-
-    /**
-     * Selects a canvas with a specified workflow if any; otherwise create one.
-     * 
-     * This method needs to be called by Swing event thread.
-     * 
-     * @param workflow
-     */
-    public void selectOrCreateGraphCanvas(Workflow workflow) {
-        GraphCanvas graphCanvas = null;
-        for (GraphCanvas canvas : this.graphCanvases) {
-            if (workflow == canvas.getWorkflow()) {
-                graphCanvas = canvas;
-            }
-        }
-        if (graphCanvas == null) {
-            graphCanvas = newGraphCanvas(true);
-            graphCanvas.setWorkflow(workflow);
-        } else {
-            setFocus(graphCanvas);
-        }
-    }
-    
-    private List<ChangeListener> tabChangeListeners=new ArrayList<ChangeListener>();
-
-	private JCRBrowserPanel jcrBrowserPanel;
-    
-    public void addWorkflowTabChangeListener(ChangeListener listener){
-		graphTabbedPane.addChangeListener(listener);
-		tabChangeListeners.add(listener);
-    }
-    
-    public void removeWorkflowTabChangeListener(ChangeListener listener){
-		graphTabbedPane.removeChangeListener(listener);
-		tabChangeListeners.remove(listener);
-    }
-    /**
-     * Closes the selected graph canvas.
-     * 
-     * This method needs to be called by Swing event thread.
-     */
-    public void closeGraphCanvas() {
-        removeGraphCanvasFromIndex(this.graphTabbedPane.getSelectedIndex());
-    	//I dont know why but aparently you have to have atleast one tab present
-//    	newGraphCanvas(true);
-    }
-
-    public boolean closeAllGraphCanvas(){
-    	while (graphTabbedPane.getTabCount()>0){
-    		if (!removeGraphCanvasFromIndex(0)){
-    			return false;
-    		}
-    	}
-		return true;
-    	//I dont know why but aparently you have to have atleast one tab present
-//    	newGraphCanvas(true);
-    }
-    
-	private boolean removeGraphCanvasFromIndex(int index) {
-		boolean actionSuccess=true;
-		if ((graphTabbedPane.getTabCount()>0) && (index<this.graphTabbedPane.getTabCount())){
-			GraphCanvas graphCanvas = graphCanvases.get(index);
-			if (graphCanvas.isWorkflowChanged()){
-				int result = JOptionPane.showConfirmDialog(frame, "'"+graphCanvas.getWorkflow().getName()+"' has been modified. Save changes?", "Save Workflow", JOptionPane.YES_NO_CANCEL_OPTION);
-				try {
-					if (result==JOptionPane.YES_OPTION){
-						graphFiler.saveWorkflow(graphCanvas);
-						if (graphCanvas.isWorkflowChanged()){
-							//if cancelled while trying to save
-							actionSuccess=false;
-						}
-					}else if (result==JOptionPane.CANCEL_OPTION){
-						actionSuccess=false;
-					}
-						
-				} catch (Exception e) {
-					e.printStackTrace();
-				}
-			}
-			if (actionSuccess) {
-				graphCanvases.remove(index);
-				graphTabbedPane.removeTabAt(index);
-				activeTabChanged();
-			}
-		}
-		return actionSuccess;
-	}
-    
-    /**
-     * Selects the next graph canvas.
-     * 
-     * This method needs to be called by Swing event thread.
-     */
-    public void selectNextGraphCanvas() {
-        int count = this.graphTabbedPane.getTabCount();
-        int index = this.graphTabbedPane.getSelectedIndex();
-        index = (index + 1) % count;
-        this.graphTabbedPane.setSelectedIndex(index);
-    }
-
-    /**
-     * Toggles the maximization of the Graph Panel.
-     */
-    public void toggleMaximizeGraphPanel() {
-        if (XBayaGUI.this.graphPanelMaximized) {
-            unmaximizeGraphPanel();
-        } else {
-            maximizeGraphPanel();
-        }
-    }
-
-    /**
-     * Maximizes the Graph Panel.
-     */
-    public void maximizeGraphPanel() {
-        if (!XBayaGUI.this.graphPanelMaximized) {
-            XBayaGUI.this.graphPanelMaximized = true;
-
-            SwingUtilities.invokeLater(new Runnable() {
-                public void run() {
-                    XBayaGUI.this.previousMainDividerLocation = XBayaGUI.this.mainSplitPane.getDividerLocation();
-                    XBayaGUI.this.previousRightDividerLocation = XBayaGUI.this.rightSplitPane.getDividerLocation();
-                    XBayaGUI.this.mainSplitPane.setDividerLocation(0.0);
-                    XBayaGUI.this.rightSplitPane.setDividerLocation(1.0);
-                }
-            });
-        }
-    }
-
-    /**
-     * Set the size of the graph panel to the original.
-     */
-    public void unmaximizeGraphPanel() {
-        if (XBayaGUI.this.graphPanelMaximized) {
-            XBayaGUI.this.graphPanelMaximized = false;
-
-            SwingUtilities.invokeLater(new Runnable() {
-                public void run() {
-                    XBayaGUI.this.mainSplitPane.setDividerLocation(XBayaGUI.this.previousMainDividerLocation);
-                    XBayaGUI.this.rightSplitPane.setDividerLocation(XBayaGUI.this.previousRightDividerLocation);
-                }
-            });
-        }
-    }
-
-    /**
-     * Adds a selected component as a node at random position.
-     */
-    public void addNode() {
-        getGraphCanvas().addNode(this.componentSelector.getSelectedComponent());
-    }
-
-    /**
-     * @see org.apache.airavata.ws.monitor.event.EventListener#eventReceived(org.apache.airavata.ws.monitor.event.Event)
-     */
-    public void eventReceived(Event event) {
-        Type type = event.getType();
-        if (type == Type.MONITOR_STARTED || type == Type.KARMA_STARTED) {
-            // Show the monitor panel.
-            this.rightBottomTabbedPane.setSelectedComponent(this.monitorPane.getSwingComponent());
-        }
-    }
-
-    /**
-     * Initializes
-     */
-    private void init() {
-        createFrame();
-
-        this.menu = new XBayaMenu(this.engine, getToolbar());
-        this.frame.setJMenuBar(this.menu.getSwingComponent());
-
-        initPane();
-
-        // Create an empty graph canvas.
-//        newGraphCanvas(true);
-
-        this.frame.setVisible(true);
-    	loadDefaultGraph();
-
-        executionModeChanged(this.engine.getConfiguration());
-    }
-
-    /**
-     * Initializes the GUI.
-     */
-    private void initPane() {
-        Container contentPane = this.frame.getContentPane();
-
-        // Error window
-        this.errorWindow = new ErrorWindow(contentPane);
-
-        contentPane.add(getToolbar().getSwingComponent(), BorderLayout.PAGE_START);
-
-        this.portViewer = new PortViewer();
-        this.componentViewer = new ComponentViewer();
-        this.componentSelector = new ComponentSelector(this.engine);
-        this.componentSelector.addComponentSelectorListener(this.componentViewer);
-        this.monitorPane = new MonitorPanel(this,this.engine.getMonitor());
-
-        compTreeXBayapanel = new ScrollPanel(this.componentSelector, ComponentSelector.TITLE);
-        ScrollPanel compViewXBayaPanel = new ScrollPanel(this.componentViewer, ComponentViewer.TITLE);
-
-        this.rightBottomTabbedPane = new JTabbedPane();
-        this.rightBottomTabbedPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
-        this.rightBottomTabbedPane.setPreferredSize(new Dimension(0, 200));
-        this.rightBottomTabbedPane.addTab(PortViewer.TITLE, this.portViewer.getSwingComponent());
-        this.rightBottomTabbedPane.addTab(MonitorPanel.TITLE, this.monitorPane.getSwingComponent());
-
-        this.graphTabbedPane = new JTabbedPane();
-        this.graphTabbedPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
-        this.graphTabbedPane.addMouseListener(new MouseAdapter() {
-            @Override
-            public void mouseClicked(MouseEvent e) {
-                if (e.getClickCount() >= 2) {
-                    toggleMaximizeGraphPanel();
-                }
-            }
-        });
-        this.graphTabbedPane.addChangeListener(new ChangeListener() {
-            public void stateChanged(ChangeEvent event) {
-                // Called when the active tab changed.
-                // Note that this is not called when a tab is removed.
-                logger.debug(event.toString());
-                XBayaGUI.this.activeTabChanged();
-            }
-        });
-
-        this.leftSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
-        this.rightSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true);
-        this.mainSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, this.leftSplitPane, this.rightSplitPane);
-        contentPane.add(this.mainSplitPane, BorderLayout.CENTER);
-
-        this.leftSplitPane.setOneTouchExpandable(true);
-        this.rightSplitPane.setOneTouchExpandable(true);
-        this.mainSplitPane.setOneTouchExpandable(true);
-
-        // this.leftSplitPane.setTopComponent(compTreeXBayapanel.getSwingComponent());
-        // this.leftSplitPane.setTopComponent(new JCRBrowserPanel(engine));
-
-        this.componentTabbedPane = new JTabbedPane();
-        this.componentTabbedPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
-        this.leftSplitPane.setTopComponent(this.componentTabbedPane);
-        this.componentTabbedPane.add(this.compTreeXBayapanel.getSwingComponent());
-        this.componentTabbedPane.setTitleAt(0, "Component");
-
-        this.leftSplitPane.setBottomComponent(compViewXBayaPanel.getSwingComponent());
-        this.rightSplitPane.setTopComponent(this.graphTabbedPane);
-        this.rightSplitPane.setBottomComponent(this.rightBottomTabbedPane);
-
-        this.leftSplitPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
-        this.rightSplitPane.setMinimumSize(SwingUtil.MINIMUM_SIZE);
-
-        //
-        // Adjust sizes
-        //
-
-        // Need to pack the frame first to get the size of each component.
-        this.frame.pack();
-
-        final int leftPanelWidth = 250;
-        final int portViewHight = 200;
-
-        this.mainSplitPane.setDividerLocation(leftPanelWidth);
-        this.leftSplitPane.setDividerLocation(0.5);
-        this.leftSplitPane.setResizeWeight(0.5);
-
-        this.rightSplitPane.setDividerLocation(this.rightSplitPane.getSize().height - portViewHight);
-        // The bottom component to stay the same size
-        this.rightSplitPane.setResizeWeight(1.0);
-
-    }
-
-    public void viewJCRBrowserPanel(){
-    	if (jcrBrowserPanel!=null){
-    		jcrBrowserPanel=componentTabbedPane.indexOfComponent(jcrBrowserPanel)==-1? null:jcrBrowserPanel;
-    	}
-    	if (jcrBrowserPanel==null) {
-			jcrBrowserPanel = new JCRBrowserPanel(engine);
-			this.componentTabbedPane.add(jcrBrowserPanel);
-			int index=this.componentTabbedPane.getTabCount()-1;
-			this.componentTabbedPane.setTitleAt(1, "Airavata Registry");
-			TabLabelButton tabLabelButton = new TabLabelButton(componentTabbedPane, "Close JCR Browser");
-			tabLabelButton.setCloseButtonListener(new ActionListener(){
-				@Override
-				public void actionPerformed(ActionEvent arg0) {
-					componentTabbedPane.remove(jcrBrowserPanel);
-				}
-				
-			});
-			this.componentTabbedPane.setTabComponentAt(index, tabLabelButton);
-		}
-		componentTabbedPane.setSelectedComponent(jcrBrowserPanel);
-    }
-    
-    public void viewComponentTree(){
-    	componentTabbedPane.setSelectedComponent(compTreeXBayapanel.getSwingComponent());
-    }
-    
-  
-    /**
-     * Creates a frame.
-     */
-    private void createFrame() {
-        try {
-            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-        } catch (Exception e) {
-            // OK. The default will be used.
-            logger.error(e.getMessage(), e);
-        }
-
-        JFrame.setDefaultLookAndFeelDecorated(false);
-        this.frame = new JFrame();
-
-        // Adjust the size
-        XBayaConfiguration config = this.engine.getConfiguration();
-        int width = config.getWidth();
-        int height = config.getHeight();
-        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        final int inset = 50;
-        this.frame.setLocation(inset, inset);
-        Dimension size = new Dimension(screenSize.width - inset * 2, screenSize.height - inset * 2);
-        if (width != 0) {
-            size.width = width;
-        }
-        if (height != 0) {
-            size.height = height;
-        }
-
-        // This controls the size when you open in a huge screen
-        if(size.width > 1280 && size.height > 800){
-            size.width = 1280;
-            size.height = 800;
-        }
-        this.frame.setPreferredSize(size);
-
-        this.frame.setTitle(XBayaConstants.APPLICATION_NAME);
-
-        this.frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
-        this.frame.addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowClosing(WindowEvent event) {
-            	int result = JOptionPane.showConfirmDialog(frame, "'Are you sure you want to exit?", "Exit XBaya", JOptionPane.YES_NO_OPTION);
-				if (result==JOptionPane.NO_OPTION || (!closeAllGraphCanvas())){
-					return;
-				}
-                logger.debug(event.toString());
-                XBayaGUI.this.frame.setVisible(false);
-                try {
-                    XBayaGUI.this.engine.dispose();
-                } catch (WorkflowException e) {
-                    // Ignore the error.
-                    logger.error(e.getMessage(), e);
-                } catch (RuntimeException e) {
-                    // Ignore the error.
-                    logger.error(e.getMessage(), e);
-                }
-                if (XBayaGUI.this.engine.getConfiguration().isCloseOnExit()) {
-                    System.exit(0);
-                }
-            }
-
-            @Override
-            public void windowClosed(WindowEvent e) {
-                logger.debug(e.toString());
-
-                try {
-                    XBayaGUI.this.engine.getMonitor().stop();
-                } catch (MonitorException e1) {
-                    logger.error(e1.getMessage(), e1);
-                }
-                // Make sure to kill all threads.
-                // Dispose only when it can be disposed to prevent infinite loop
-                if (XBayaGUI.this.frame.isDisplayable()) {
-                    XBayaGUI.this.frame.dispose();
-                }
-            }
-        });
-        this.frame.setIconImage(SwingUtil.createImage("airavata-2.png"));
-    }
-
-    private void activeTabChanged() {
-        GraphCanvas graphPanel = getGraphCanvas();
-
-        if (graphPanel!=null) {
-			// Reset the port viewers.
-			Port inputPort = graphPanel.getSelectedInputPort();
-			Port outputPort = graphPanel.getSelectedOutputPort();
-			this.portViewer.setInputPort(inputPort);
-			this.portViewer.setOutputPort(outputPort);
-			// Reset component viewer.
-			Node node = graphPanel.getSelectedNode();
-			Component component;
-			if (node != null) {
-				component = node.getComponent();
-			} else {
-				component = this.componentSelector.getSelectedComponent();
-			}
-			this.componentViewer.setComponent(component);
-			String name = graphPanel.getWorkflow().getName();
-			setFrameName(name);
-		}else{
-			//TODO what to do when no tabs are present???
-		}
-    }
-
-    public ComponentViewer getComponentVIewer() {
-        return this.componentViewer;
-    }
-
-    private void setFrameName(String workflowName) {
-        String title = this.engine.getConfiguration().getTitle();
-        this.frame.setTitle(workflowName + " - " + title);
-    }
-
-	@Override
-	public void executionModeChanged(XBayaConfiguration config) {
-		this.leftSplitPane.setVisible(config.getXbayaExecutionMode()==XBayaExecutionMode.IDE);
-	}
-
-
-    /**
-     * @return
-     */
-    public WorkflowPropertyWindow getWorkflowPropertyWindow() {
-        if (this.workflowPropertiesWindow == null) {
-            this.workflowPropertiesWindow = new WorkflowPropertyWindow(this);
-        }
-        return this.workflowPropertiesWindow;
-    }
-    
-    /**
-     * Sets the workflow.
-     *
-     * @param workflow
-     *            The workflow
-     */
-    public void setWorkflow(Workflow workflow) {
-        this.getGraphCanvas().setWorkflow(workflow);
-    }
-
-    /**
-     * Return the current workflow.
-     *
-     * @return The current workflow
-     */
-    public Workflow getWorkflow() {
-        return this.getGraphCanvas().getWorkflowWithImage();
-    }
-    
-    private void loadDefaultGraph() {
-        if (this.engine.getConfiguration().getWorkflow() != null) {
-            this.newGraphCanvas(true, false);
-            try {
-            	String xml = this.engine.getConfiguration().getAiravataAPI().getWorkflowManager().getWorkflowAsString(this.engine.getConfiguration().getWorkflow());
-                XmlElement xwf = XMLUtil.stringToXmlElement(xml);
-                Workflow workflow = new Workflow(xwf);
-                setWorkflow(workflow);
-            } catch (AiravataAPIInvocationException e) {
-               getErrorWindow().error(ErrorMessages.REPOSITORY_CONFIGURATION_IS_WRONG_FAILED_TO_LOAD_THE_WORKFLOW, e);
-            } catch (GraphException e) {
-                getErrorWindow().error(ErrorMessages.WORKFLOW_IS_WRONG, e);
-            } catch (ComponentException e) {
-                getErrorWindow().error(ErrorMessages.COMPONENT_FORMAT_ERROR, e);
-            }
-        }
-
-    }
-
-	public XBayaConfiguration getConfiguration() {
-		return engine.getConfiguration();
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/AbstractBrowserActionItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/AbstractBrowserActionItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/AbstractBrowserActionItem.java
deleted file mode 100644
index 406e3b7..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/actions/AbstractBrowserActionItem.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.actions;
-
-import java.awt.event.ActionListener;
-
-import javax.swing.Icon;
-import javax.swing.JMenuItem;
-
-public abstract class AbstractBrowserActionItem {
-
-    private String caption;
-    private Icon icon;
-    private JMenuItem menuItem;
-    private String description;
-
-    public abstract String getID();
-
-    public void setIcon(Icon icon) {
-        this.icon = icon;
-        getMenuItem().setIcon(getIcon());
-    }
-
-    public Icon getIcon() {
-        return icon;
-    }
-
-    public String getCaption() {
-        return caption;
-    }
-
-    public void setCaption(String caption) {
-        this.caption = caption;
-        getMenuItem().setText(getCaption());
-    }
-
-    public JMenuItem getMenuItem() {
-        if (menuItem == null) {
-            menuItem = new JMenuItem(getCaption());
-        }
-        menuItem.setText(getCaption());
-        return menuItem;
-    }
-
-    public void addActionListener(ActionListener listener) {
-        getMenuItem().addActionListener(listener);
-    }
-
-    public void removeActionListener(ActionListener listener) {
-        getMenuItem().removeActionListener(listener);
-    }
-
-    public void setVisible(boolean visible) {
-        getMenuItem().setVisible(visible);
-    }
-
-    public void setEnabled(boolean enabled) {
-        getMenuItem().setEnabled(enabled);
-    }
-
-    public abstract String getDefaultCaption();
-
-    public String getDescription() {
-        return description;
-    }
-
-    public void setDescription(String description) {
-        this.description = description;
-        getMenuItem().setToolTipText(getDescription());
-    }
-}


[49/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/src/main/resources/LICENSE
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/src/main/resources/LICENSE b/modules/distribution/xbaya-gui/src/main/resources/LICENSE
deleted file mode 100644
index 6c147f8..0000000
--- a/modules/distribution/xbaya-gui/src/main/resources/LICENSE
+++ /dev/null
@@ -1,2273 +0,0 @@
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
-===================================================================================
-The Apache Airavata distribution includes a number of run time 
-dependencies with separate copyright notices and license terms. Your use of the
-Apache Airavata code is subject to the terms and conditions of the following licenses.
-===================================================================================
-
-===============================================================================
-The following components come under Apache Software License 2.0
-===============================================================================
-
-apache axiom, apache axis2, apache commons, apache derby, apache geronimo,
-apache httpcore components, apache log4j, apache xmlbeans, apache xmlschema,
-aws-java-sdk-1.1.8.jar, bcel-5.1.jar, Codehaus Jackson (jackson-core-asl-1.9.2.jar,
-jackson-jaxrs-1.9.2.jar, jackson-mapper-asl-1.9.2.jar, jackson-xc-1.9.2.jar, 
-jets3t-0.8.0.jar, jettison-1.0-RC2.jar, neethi-2.0.4.jar, PDFBox libraries 
-(pdfbox, jempbox, fontbox), wstx-asl-3.2.4.jar
-
-===============================================================================
-The following components use Apache based Licenses
-===============================================================================
-
-===============================================================================
-For: jdom-1.0.jar
-    Containing Project URL: http://www.jdom.org/
-/*-- 
-
- $Id: LICENSE.txt,v 1.11 2004/02/06 09:32:57 jhunter Exp $
-
- Copyright (C) 2000-2004 Jason Hunter & Brett McLaughlin.
- All rights reserved.
- 
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
- 
- 1. Redistributions of source code must retain the above copyright
-    notice, this list of conditions, and the following disclaimer.
- 
- 2. Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions, and the disclaimer that follows 
-    these conditions in the documentation and/or other materials 
-    provided with the distribution.
-
- 3. The name "JDOM" must not be used to endorse or promote products
-    derived from this software without prior written permission.  For
-    written permission, please contact <request_AT_jdom_DOT_org>.
- 
- 4. Products derived from this software may not be called "JDOM", nor
-    may "JDOM" appear in their name, without prior written permission
-    from the JDOM Project Management <request_AT_jdom_DOT_org>.
- 
- In addition, we request (but do not require) that you include in the 
- end-user documentation provided with the redistribution and/or in the 
- software itself an acknowledgement equivalent to the following:
-     "This product includes software developed by the
-      JDOM Project (http://www.jdom.org/)."
- Alternatively, the acknowledgment may be graphical using the logos 
- available at http://www.jdom.org/images/logos.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- DISCLAIMED.  IN NO EVENT SHALL THE JDOM AUTHORS OR THE PROJECT
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
- USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE.
-
- This software consists of voluntary contributions made by many 
- individuals on behalf of the JDOM Project and was originally 
- created by Jason Hunter <jhunter_AT_jdom_DOT_org> and
- Brett McLaughlin <brett_AT_jdom_DOT_org>.  For more information
- on the JDOM Project, please see <http://www.jdom.org/>. 
-
- */
-
-===============================================================================
-
-ASM bytecode manipulation library (asm)
-    Containing Project URL: http://asm.ow2.org/
-
-    Copyright (c) 2000-2005 INRIA, France Telecom
-    All rights reserved.
-
-    Redistribution and use in source and binary forms, with or without
-    modification, are permitted provided that the following conditions
-    are met:
-
-    1. Redistributions of source code must retain the above copyright
-       notice, this list of conditions and the following disclaimer.
-
-    2. Redistributions in binary form must reproduce the above copyright
-       notice, this list of conditions and the following disclaimer in the
-       documentation and/or other materials provided with the distribution.
-
-    3. Neither the name of the copyright holders nor the names of its
-       contributors may be used to endorse or promote products derived from
-       this software without specific prior written permission.
-
-    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
-    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-    THE POSSIBILITY OF SUCH DAMAGE.
-
-===============================================================================
-
-For: cryptix-asn1-versionless.jar, cryptix32-versionless.jar
-    Containing Project URL: http://www.cryptix.org/
-
-Cryptix General License
-
-Copyright (c) 1995-2005 The Cryptix Foundation Limited.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-  1. Redistributions of source code must retain the copyright notice,
-     this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright
-     notice, this list of conditions and the following disclaimer in
-     the documentation and/or other materials provided with the
-     distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE CRYPTIX FOUNDATION LIMITED AND
-CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE CRYPTIX FOUNDATION LIMITED OR CONTRIBUTORS BE
-LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
-OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
-IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-===============================================================================
-The following components come under Extreme! Lab Software License
-===============================================================================
-
-XPP3
-    Containing Project URL: http://www.extreme.indiana.edu/xgws/xsoap/xpp/
-xsul, xsul5, xutil
-    Containing Project URL: http://www.extreme.indiana.edu/xgws/xsul/
-wsmg
-    Containing Project URL: http://www.extreme.indiana.edu/xgws/messenger/index.html
-gpel, weps-beans, pegasuswebservice, mapReduce-service-client, atomixmiser
-    Containing Project URL: http://www.extreme.indiana.edu/xgws/
-    
-Indiana University Extreme! Lab Software License
-
-Version 1.1.1
-
-Copyright (c) 2002 Extreme! Lab, Indiana University. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright notice,
-   this list of conditions and the following disclaimer.
-
-2. Redistributions in binary form must reproduce the above copyright
-   notice, this list of conditions and the following disclaimer in
-   the documentation and/or other materials provided with the distribution.
-
-3. The end-user documentation included with the redistribution, if any,
-   must include the following acknowledgment:
-
-  "This product includes software developed by the Indiana University
-  Extreme! Lab (http://www.extreme.indiana.edu/)."
-
-Alternately, this acknowledgment may appear in the software itself,
-if and wherever such third-party acknowledgments normally appear.
-
-4. The names "Indiana Univeristy" and "Indiana Univeristy Extreme! Lab"
-must not be used to endorse or promote products derived from this
-software without prior written permission. For written permission,
-please contact http://www.extreme.indiana.edu/.
-
-5. Products derived from this software may not use "Indiana Univeristy"
-name nor may "Indiana Univeristy" appear in their name, without prior
-written permission of the Indiana University.
-
-THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-IN NO EVENT SHALL THE AUTHORS, COPYRIGHT HOLDERS OR ITS CONTRIBUTORS
-BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
-CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
-SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
-BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-======================================================================== 
-The following components are MIT Licensed 
-========================================================================
-
-SLF4J,log4j-over-slf4j, jcl-over-slf4j, slf4j-api,mockito-all-1.8.5,jopt-simple-3.2.jar
-    Containing Project URL: http://www.slf4j.org/
-
-Copyright (c) 2004-2008 QOS.ch
- All rights reserved.
-
- Permission is hereby granted, free  of charge, to any person obtaining
- a  copy  of this  software  and  associated  documentation files  (the
- "Software"), to  deal in  the Software without  restriction, including
- without limitation  the rights to  use, copy, modify,  merge, publish,
- distribute,  sublicense, and/or sell  copies of  the Software,  and to
- permit persons to whom the Software  is furnished to do so, subject to
- the following conditions:
-
- The  above  copyright  notice  and  this permission  notice  shall  be
- included in all copies or substantial portions of the Software.
-
- THE  SOFTWARE IS  PROVIDED  "AS  IS", WITHOUT  WARRANTY  OF ANY  KIND,
- EXPRESS OR  IMPLIED, INCLUDING  BUT NOT LIMITED  TO THE  WARRANTIES OF
- MERCHANTABILITY,    FITNESS    FOR    A   PARTICULAR    PURPOSE    AND
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
- OF CONTRACT, TORT OR OTHERWISE,  ARISING FROM, OUT OF OR IN CONNECTION
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-========================================================================
-
-For dom4j-1.6.1.jar:
-    Containing Project URL: http://dom4j.sourceforge.net/
-Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
-
-Redistribution and use of this software and associated documentation
-("Software"), with or without modification, are permitted provided
-that the following conditions are met:
-
-1. Redistributions of source code must retain copyright
-   statements and notices.  Redistributions must also contain a
-   copy of this document.
- 
-2. Redistributions in binary form must reproduce the
-   above copyright notice, this list of conditions and the
-   following disclaimer in the documentation and/or other
-   materials provided with the distribution.
- 
-3. The name "DOM4J" must not be used to endorse or promote
-   products derived from this Software without prior written
-   permission of MetaStuff, Ltd.  For written permission,
-   please contact dom4j-info@metastuff.com.
- 
-4. Products derived from this Software may not be called "DOM4J"
-   nor may "DOM4J" appear in their names without prior written
-   permission of MetaStuff, Ltd. DOM4J is a registered
-   trademark of MetaStuff, Ltd.
- 
-5. Due credit should be given to the DOM4J Project - 
-   http://www.dom4j.org
- 
-THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
-``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
-NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
-FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
-METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
-INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
-STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
-OF THE POSSIBILITY OF SUCH DAMAGE.
-
-====================================================================================================
-
-For Bouncy Castle:
-    Containing Project URL: http://www.bouncycastle.org/
-
-Copyright (c) 2000 - 2011 The Legion Of The Bouncy Castle (http://www.bouncycastle.org)
-
-Permission iss software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions hereby granted, free of charge, to any person obtaining a copy of this software
-and associated documentation files (the "Software"), to deal in the Software without restriction,
-including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial
-portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
-LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-=======================================================================================================
-
-For: The International Components for Unicode (icu4j-2.6.1.jar)
-    Containing Project URL: http://site.icu-project.org/
-
-    Copyright (c) 1995-2009 International Business Machines Corporation
-    and others
-
-    All rights reserved.
-
-    Permission is hereby granted, free of charge, to any person obtaining
-    a copy of this software and associated documentation files (the
-    "Software"), to deal in the Software without restriction, including
-    without limitation the rights to use, copy, modify, merge, publish,
-    distribute, and/or sell copies of the Software, and to permit persons
-    to whom the Software is furnished to do so, provided that the above
-    copyright notice(s) and this permission notice appear in all copies
-    of the Software and that both the above copyright notice(s) and this
-    permission notice appear in supporting documentation.
-
-    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-    OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
-    IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE
-    BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES,
-    OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
-    WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
-    SOFTWARE.
-
-    Except as contained in this notice, the name of a copyright holder shall
-    not be used in advertising or otherwise to promote the sale, use or other
-    dealings in this Software without prior written authorization of the
-    copyright holder.
-    
-====================================================================== 
-The following components are CDDL based License 
-======================================================================
-
-For activation-1.1.jar, jaxb-api-2.1.jar, mail-1.4.jar, junit, 
-Servlet Specification 2.5 API (servlet-api-2.5-6.1.14.jar),
-Classfish Jasper API (jsp-api-2.1-6.1.14.jar), and
-JSP2.1 Jasper implementation from Glassfish (jsp-2.1-6.1.14.jar), 
-Jersey from Glassfish (jersey-client-1.13.jar, jersey-core-1.13.jar,
-jersey-json-1.13.jar, jersey-multipart-1.13.jar) and JSP2.1 Jasper 
-implementation from Glassfish (jsp-2.1-6.1.14.jar),whirr-core-0.7.1.jar, whirr-hadoop-0.7.1.jar:
- 
-NOTE: jersey is dual licensed (http://jersey.java.net/CDDL+GPL.html), 
-Apahce Airavata elects to include jersey in this distribution under the
-[CDDLv_1.0] license.
-
-    COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
-
-    1. Definitions.
-
-    1.1. Contributor means each individual or entity that creates or
-    contributes to the creation of Modifications.
-
-    1.2. Contributor Version means the combination of the Original Software,
-    prior Modifications used by a Contributor (if any), and the Modifications
-    made by that particular Contributor.
-
-    1.3. Covered Software means (a) the Original Software, or
-    (b) Modifications, or (c) the combination of files containing Original
-    Software with files containing Modifications, in each case including
-    portions thereof.
-
-    1.4. Executable means the Covered Software in any form other than Source
-    Code.
-
-    1.5. Initial Developer means the individual or entity that first makes
-    Original Software available under this License.
-
-    1.6. Larger Work means a work which combines Covered Software or portions
-    thereof with code not governed by the terms of this License.
-
-    1.7. License means this document.
-
-    1.8. Licensable means having the right to grant, to the maximum extent
-    possible, whether at the time of the initial grant or subsequently
-    acquired, any and all of the rights conveyed herein.
-
-    1.9. Modifications means the Source Code and Executable form of any of
-    the following: A. Any file that results from an addition to, deletion
-    from or modification of the contents of a file containing Original
-    Software or previous Modifications; B. Any new file that contains any
-    part of the Original Software or previous Modification; or C. Any new
-    file that is contributed or otherwise made available under the terms of
-    this License.
-
-    1.10. Original Software means the Source Code and Executable form of
-    computer software code that is originally released under this License.
-
-    1.11. Patent Claims means any patent claim(s), now owned or hereafter
-    acquired, including without limitation, method, process, and apparatus
-    claims, in any patent Licensable by grantor.
-
-    1.12. Source Code means (a) the common form of computer software code in
-    which modifications are made and (b) associated documentation included in
-    or with such code.
-
-    1.13. You (or Your) means an individual or a legal entity exercising
-    rights under, and complying with all of the terms of, this License. For
-    legal entities, You includes any entity which controls, is controlled by,
-    or is under common control with You. For purposes of this definition,
-    control means (a) the power, direct or indirect, to cause the direction
-    or management of such entity, whether by contract or otherwise, or
-    (b) ownership of more than fifty percent (50%) of the outstanding shares
-    or beneficial ownership of such entity.
-
-    2. License Grants.
-
-    2.1. The Initial Developer Grant. Conditioned upon Your compliance with
-    Section 3.1 below and subject to third party intellectual property
-    claims, the Initial Developer hereby grants You a world-wide,
-    royalty-free, non-exclusive license:
-
-    (a) under intellectual property rights (other than patent or trademark)
-        Licensable by Initial Developer, to use, reproduce, modify, display,
-        perform, sublicense and distribute the Original Software (or portions
-        thereof), with or without Modifications, and/or as part of a Larger
-        Work; and
-
-    (b) under Patent Claims infringed by the making, using or selling of
-        Original Software, to make, have made, use, practice, sell, and offer
-        for sale, and/or otherwise dispose of the Original Software (or
-        portions thereof);
-
-    (c) The licenses granted in Sections 2.1(a) and (b) are effective on the
-        date Initial Developer first distributes or otherwise makes the
-        Original Software available to a third party under the terms of
-        this License;
-
-    (d) Notwithstanding Section 2.1(b) above, no patent license is granted:
-        (1) for code that You delete from the Original Software, or (2) for
-        infringements caused by: (i) the modification of the Original
-        Software, or (ii) the combination of the Original Software with other
-        software or devices.
-
-    2.2. Contributor Grant. Conditioned upon Your compliance with Section 3.1
-    below and subject to third party intellectual property claims, each
-    Contributor hereby grants You a world-wide, royalty-free, non-exclusive
-    license:
-
-    (a) under intellectual property rights (other than patent or trademark)
-        Licensable by Contributor to use, reproduce, modify, display, perform,
-        sublicense and distribute the Modifications created by such
-        Contributor (or portions thereof), either on an unmodified basis,
-        with other Modifications, as Covered Software and/or as part of a
-        Larger Work; and
-
-    (b) under Patent Claims infringed by the making, using, or selling of
-        Modifications made by that Contributor either alone and/or in
-        combination with its Contributor Version (or portions of such
-        combination), to make, use, sell, offer for sale, have made, and/or
-        otherwise dispose of: (1) Modifications made by that Contributor (or
-        portions thereof); and (2) the combination of Modifications made by
-        that Contributor with its Contributor Version (or portions of such
-        combination).
-
-    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are effective on
-        the date Contributor first distributes or otherwise makes the
-        Modifications available to a third party.
-
-    (d) Notwithstanding Section 2.2(b) above, no patent license is granted:
-        (1) for any code that Contributor has deleted from the Contributor
-        Version; (2) for infringements caused by: (i) third party
-        modifications of Contributor Version, or (ii) the combination of
-        Modifications made by that Contributor with other software (except
-        as part of the Contributor Version) or other devices; or (3) under
-        Patent Claims infringed by Covered Software in the absence of
-        Modifications made by that Contributor.
-
-    3. Distribution Obligations.
-
-    3.1. Availability of Source Code. Any Covered Software that You distribute
-    or otherwise make available in Executable form must also be made available
-    in Source Code form and that Source Code form must be distributed only
-    under the terms of this License. You must include a copy of this License
-    with every copy of the Source Code form of the Covered Software You
-    distribute or otherwise make available. You must inform recipients of any
-    such Covered Software in Executable form as to how they can obtain such
-    Covered Software in Source Code form in a reasonable manner on or through
-    a medium customarily used for software exchange.
-
-    3.2. Modifications. The Modifications that You create or to which You
-    contribute are governed by the terms of this License. You represent that
-    You believe Your Modifications are Your original creation(s) and/or You
-    have sufficient rights to grant the rights conveyed by this License.
-
-    3.3. Required Notices. You must include a notice in each of Your
-    Modifications that identifies You as the Contributor of the Modification.
-    You may not remove or alter any copyright, patent or trademark notices
-    contained within the Covered Software, or any notices of licensing or any
-    descriptive text giving attribution to any Contributor or the Initial
-    Developer.
-
-    3.4. Application of Additional Terms. You may not offer or impose any
-    terms on any Covered Software in Source Code form that alters or restricts
-    the applicable version of this License or the recipients rights hereunder.
-    You may choose to offer, and to charge a fee for, warranty, support,
-    indemnity or liability obligations to one or more recipients of Covered
-    Software. However, you may do so only on Your own behalf, and not on
-    behalf of the Initial Developer or any Contributor. You must make it
-    absolutely clear that any such warranty, support, indemnity or liability
-    obligation is offered by You alone, and You hereby agree to indemnify the
-    Initial Developer and every Contributor for any liability incurred by the
-    Initial Developer or such Contributor as a result of warranty, support,
-    indemnity or liability terms You offer.
-
-    3.5. Distribution of Executable Versions. You may distribute the
-    Executable form of the Covered Software under the terms of this License or
-    under the terms of a license of Your choice, which may contain terms
-    different from this License, provided that You are in compliance with the
-    terms of this License and that the license for the Executable form does
-    not attempt to limit or alter the recipients rights in the Source Code
-    form from the rights set forth in this License. If You distribute the
-    Covered Software in Executable form under a different license, You must
-    make it absolutely clear that any terms which differ from this License
-    are offered by You alone, not by the Initial Developer or Contributor.
-    You hereby agree to indemnify the Initial Developer and every Contributor
-    for any liability incurred by the Initial Developer or such Contributor as
-    a result of any such terms You offer.
-
-    3.6. Larger Works. You may create a Larger Work by combining Covered
-    Software with other code not governed by the terms of this License and
-    distribute the Larger Work as a single product. In such a case, You must
-    make sure the requirements of this License are fulfilled for the Covered
-    Software.
-
-    4. Versions of the License.
-
-    4.1. New Versions. Sun Microsystems, Inc. is the initial license steward
-    and may publish revised and/or new versions of this License from time to
-    time. Each version will be given a distinguishing version number. Except
-    as provided in Section 4.3, no one other than the license steward has the
-    right to modify this License.
-
-    4.2. Effect of New Versions. You may always continue to use, distribute
-    or otherwise make the Covered Software available under the terms of the
-    version of the License under which You originally received the Covered
-    Software. If the Initial Developer includes a notice in the Original
-    Software prohibiting it from being distributed or otherwise made
-    available under any subsequent version of the License, You must
-    distribute and make the Covered Software available under the terms of
-    the version of the License under which You originally received the
-    Covered Software. Otherwise, You may also choose to use, distribute or
-    otherwise make the Covered Software available under the terms of any
-    subsequent version of the License published by the license steward.
-
-    4.3. Modified Versions. When You are an Initial Developer and You want
-    to create a new license for Your Original Software, You may create and
-    use a modified version of this License if You: (a) rename the license and
-    remove any references to the name of the license steward (except to note
-    that the license differs from this License); and (b) otherwise make it
-    clear that the license contains terms which differ from this License.
-
-    5. DISCLAIMER OF WARRANTY. COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE
-    ON AN AS IS BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
-    IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED
-    SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE
-    OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF
-    THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY COVERED SOFTWARE PROVE
-    DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
-    CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR
-    CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF
-    THIS LICENSE. NO USE OF ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER
-    EXCEPT UNDER THIS DISCLAIMER.
-
-    6. TERMINATION.
-
-    6.1. This License and the rights granted hereunder will terminate
-    automatically if You fail to comply with terms herein and fail to cure
-    such breach within 30 days of becoming aware of the breach. Provisions
-    which, by their nature, must remain in effect beyond the termination of
-    this License shall survive.
-
-    6.2. If You assert a patent infringement claim (excluding declaratory
-    judgment actions) against Initial Developer or a Contributor (the Initial
-    Developer or Contributor against whom You assert such claim is referred
-    to as Participant) alleging that the Participant Software (meaning the
-    Contributor Version where the Participant is a Contributor or the
-    Original Software where the Participant is the Initial Developer)
-    directly or indirectly infringes any patent, then any and all rights
-    granted directly or indirectly to You by such Participant, the Initial
-    Developer (if the Initial Developer is not the Participant) and all
-    Contributors under Sections 2.1 and/or 2.2 of this License shall, upon
-    60 days notice from Participant terminate prospectively and automatically
-    at the expiration of such 60 day notice period, unless if within such
-    60 day period You withdraw Your claim with respect to the Participant
-    Software against such Participant either unilaterally or pursuant to a
-    written agreement with Participant.
-
-    6.3. In the event of termination under Sections 6.1 or 6.2 above, all end
-    user licenses that have been validly granted by You or any distributor
-    hereunder prior to termination (excluding licenses granted to You by any
-    distributor) shall survive termination.
-
-    7. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
-    THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL
-    YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF
-    COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY
-    PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF
-    ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST PROFITS,
-    LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY
-    AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE
-    BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
-    LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
-    RESULTING FROM SUCH PARTYS NEGLIGENCE TO THE EXTENT APPLICABLE LAW
-    PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION
-    OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION
-    AND LIMITATION MAY NOT APPLY TO YOU.
-
-    8. U.S. GOVERNMENT END USERS. The Covered Software is a commercial item,
-    as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
-    commercial computer software (as that term is defined at 48 C.F.R.
-    252.227-7014(a)(1)) and commercial computer software documentation as such
-    terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R.
-    12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S.
-    Government End Users acquire Covered Software with only those rights set
-    forth herein. This U.S. Government Rights clause is in lieu of, and
-    supersedes, any other FAR, DFAR, or other clause or provision that
-    addresses Government rights in computer software under this License.
-
-    9. MISCELLANEOUS. This License represents the complete agreement
-    concerning subject matter hereof. If any provision of this License is
-    held to be unenforceable, such provision shall be reformed only to the
-    extent necessary to make it enforceable. This License shall be governed
-    by the law of the jurisdiction specified in a notice contained within
-    the Original Software (except to the extent applicable law, if any,
-    provides otherwise), excluding such jurisdictions conflict-of-law
-    provisions. Any litigation relating to this License shall be subject to
-    the jurisdiction of the courts located in the jurisdiction and venue
-    specified in a notice contained within the Original Software, with the
-    losing party responsible for costs, including, without limitation, court
-    costs and reasonable attorneys fees and expenses. The application of the
-    United Nations Convention on Contracts for the International Sale of
-    Goods is expressly excluded. Any law or regulation which provides that
-    the language of a contract shall be construed against the drafter shall
-    not apply to this License. You agree that You alone are responsible for
-    compliance with the United States export administration regulations (and
-    the export control laws and regulation of any other countries) when You
-    use, distribute or otherwise make available any Covered Software.
-
-    10. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the
-    Contributors, each party is responsible for claims and damages arising,
-    directly or indirectly, out of its utilization of rights under this
-    License and You agree to work with Initial Developer and Contributors
-    to distribute such responsibility on an equitable basis. Nothing herein
-    is intended or shall be deemed to constitute any admission of liability.
-
-    NOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND DISTRIBUTION
-    LICENSE (CDDL) The code released under the CDDL shall be governed by the
-    laws of the State of California (excluding conflict-of-law provisions).
-    Any litigation relating to this License shall be subject to the
-    jurisdiction of the Federal Courts of the Northern District of California
-    and the state courts of the State of California, with venue lying in
-    Santa Clara County, California.
-
-
-==============================================================================
-
-For: jaxb-xjc-2.1.7.jar
-    Containing Project URL: 
-
-Copyright (c) 2004 Kohsuke Kawaguchi
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom
-the Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall
-be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
-OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-=============================================================================== 
-The following components are BSD Licensed 
-=============================================================================== 
-
-For jibx-bind-1.2.1.jar,jibx-run-1.2.1.jar, antlr-2.7.7.jar,hamcrest-all-1.1.jar,whirr-core-0.7.1.jar, whirr-hadoop-0.7.1.jar:
-    Containing Project URL: http://jibx.sourceforge.net, http://www.antlr.org/
-
-Copyright (c) 2003-2007, Dennis M. Sosnoski
-All rights reserved.
-
-Copyright (c) 2010 Terence Parr
-All rights reserved.
-
-[The BSD License]
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
-   list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
-   this list of conditions and the following disclaimer in the documentation
-   and/or other materials provided with the distribution.
- * Neither the name of JiBX nor the names of its contributors may be used
-   to endorse or promote products derived from this software without specific
-   prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-==============================================================================
-
-For YFilter:
-    Containing Project URL: http://yfilter.cs.umass.edu/
-
-YFilter 1.0 COPYRIGHT, LICENSE and DISCLAIMER
-
-Copyright (c) 2002, 2004, Regents of the University of California All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are
-permitted provided that the following conditions are met:
-
-    * Redistributions of source code must retain the above copyright notice, this
-    list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright notice, this
-    list of conditions and the following disclaimer in the documentation and/or other
-    materials provided with the distribution.
-    * Neither the name of the University of California at Berkeley nor the names of
-    its contributors may be used to endorse or promote products derived from this
-    software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
-EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
-SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
-OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-==========================================================================================
-For jaxen-1.1.1.jar:
-    Containing Project URL: http://jaxen.codehaus.org/
-
- Copyright 2003-2006 The Werken Company. All Rights Reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are
- met:
-
-  * Redistributions of source code must retain the above copyright
-    notice, this list of conditions and the following disclaimer.
-
-  * Redistributions in binary form must reproduce the above copyright
-    notice, this list of conditions and the following disclaimer in the
-    documentation and/or other materials provided with the distribution.
-
-  * Neither the name of the Jaxen Project nor the names of its
-    contributors may be used to endorse or promote products derived
-    from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
-IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
-PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
-OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-=============================================================================== 
-The following components are CPL Licensed 
-=============================================================================== 
-
-For wsdl4j-1.6.2.jar:
-    Containing Project URL: http://sourceforge.net/projects/wsdl4j/
-
-Common Public License Version 1.0
-
-THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON PUBLIC
LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM
CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-1. DEFINITIONS
-"Contribution" means:
-a) in the case of the initial Contributor, the initial code and
documentation distributed under this Agreement, and
-b) in the case of each subsequent Contributor:
-i) changes to the Program, and
-ii) additions to the Program;
-where such changes and/or additions to the Program originate from and are
distributed by that particular Contributor. A Contribution 'originates' from a
Contributor if it was added to the Program by such Contributor itself or anyone
acting on such Contributor's behalf. Contributions do not include additions to
the Program which: (i) are separate modules of software distributed in
conjunction with the Program under their own license agreement, and (ii) are not
derivative works of the Program.
-"Contributor" means any person or entity that distributes the Program.
-"Licensed Patents " mean patent claims licensable by a Contributor which are
necessarily infringed by the use or sale of its Contribution alone or when
combined with the Program.
-"Program" means the Contributions distributed in accordance with this Agreement.
-"Recipient" means anyone who receives the Program under this Agreement,
including all Contributors.
-2. GRANT OF RIGHTS
-a) Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide, royalty-free copyright license to
reproduce, prepare derivative works of, publicly display, publicly perform,
distribute and sublicense the Contribution of such Contributor, if any, and such
derivative works, in source code and object code form.
-b) Subject to the terms of this Agreement, each Contributor hereby grants
Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed
Patents to make, use, sell, offer to sell, import and otherwise transfer the
Contribution of such Contributor, if any, in source code and object code form.
This patent license shall apply to the combination of the Contribution and the
Program if, at the time the Contribution is added by the Contributor, such
addition of the Contribution causes such combination to be covered by the
Licensed Patents. The patent license shall not apply to any other combinations
which include the Contribution. No hardware per se is licensed hereunder.
-c) Recipient understands that although each Contributor grants the licenses
to its Contributions set forth herein, no assurances are provided by any
Contributor that the Program does not infringe the patent or other intellectual
property rights of any other entity. Each Contributor disclaims any liability to
Recipient for claims brought by any other entity based on infringement of
intellectual property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, each Recipient hereby assumes sole
responsibility to secure any other intellectual property rights needed, if any.
For example, if a third party patent license is required to allow Recipient to
distribute the Program, it is Recipient's responsibility to acquire that license
before distributing the Program.
-d) Each Contributor represents that to its knowledge it has sufficient
copyright rights in its Contribution, if any, to grant the copyright license set
forth in this Agreement.
-3. REQUIREMENTS
-A Contributor may choose to distribute the Program in object code form under its
own license agreement, provided that:
-a) it complies with the terms and conditions of this Agreement; and
-b) its license agreement:
-i) effectively disclaims on behalf of all Contributors all warranties and
conditions, express and implied, including warranties or conditions of title and
non-infringement, and implied warranties or conditions of merchantability and
fitness for a particular purpose;
-ii) effectively excludes on behalf of all Contributors all liability for
damages, including direct, indirect, special, incidental and consequential
damages, such as lost profits;
-iii) states that any provisions which differ from this Agreement are offered
by that Contributor alone and not by any other party; and
-iv) states that source code for the Program is available from such
Contributor, and informs licensees how to obtain it in a reasonable manner on or
through a medium customarily used for software exchange.
-When the Program is made available in source code form:
-a) it must be made available under this Agreement; and
-b) a copy of this Agreement must be included with each copy of the Program.
-Contributors may not remove or alter any copyright notices contained within the
Program.
-Each Contributor must identify itself as the originator of its Contribution, if
any, in a manner that reasonably allows subsequent Recipients to identify the
originator of the Contribution.
-4. COMMERCIAL DISTRIBUTION
-Commercial distributors of software may accept certain responsibilities with
respect to end users, business partners and the like. While this license is
intended to facilitate the commercial use of the Program, the Contributor who
includes the Program in a commercial product offering should do so in a manner
which does not create potential liability for other Contributors. Therefore, if
a Contributor includes the Program in a commercial product offering, such
Contributor ("Commercial Contributor") hereby agrees to defend and indemnify
every other Contributor ("Indemnified Contributor") against any losses, damages
and costs (collectively "Losses") arising from claims, lawsuits and other legal
actions brought by a third party against the Indemnified Contributor to the
extent caused by the acts or omissions of such Commercial Contributor in
connection with its distribution of the Program in a commercial product
offering. The obligations in this section do not ap
 ply to any claims or Losses
relating to any actual or alleged intellectual property infringement. In order
to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
Contributor in writing of such claim, and b) allow the Commercial Contributor to
control, and cooperate with the Commercial Contributor in, the defense and any
related settlement negotiations. The Indemnified Contributor may participate in
any such claim at its own expense.
-For example, a Contributor might include the Program in a commercial product
offering, Product X. That Contributor is then a Commercial Contributor. If that
Commercial Contributor then makes performance claims, or offers warranties
related to Product X, those performance claims and warranties are such
Commercial Contributor's responsibility alone. Under this section, the
Commercial Contributor would have to defend claims against the other
Contributors related to those performance claims and warranties, and if a court
requires any other Contributor to pay any damages as a result, the Commercial
Contributor must pay those damages.
-5. NO WARRANTY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE,
NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each
Recipient is solely responsible for determining the appropriateness of using and
distributing the Program and assumes all risks associated with its exercise of
rights under this Agreement, including but not limited to the risks and costs of
program errors, compliance with applicable laws, damage to or loss of data,
programs or equipment, and unavailability or interruption of operations.
-6. DISCLAIMER OF LIABILITY
-EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY
CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS
GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-7. GENERAL
-If any provision of this Agreement is invalid or unenforceable under applicable
law, it shall not affect the validity or enforceability of the remainder of the
terms of this Agreement, and without further action by the parties hereto, such
provision shall be reformed to the minimum extent necessary to make such
provision valid and enforceable.
-If Recipient institutes patent litigation against a Contributor with respect to
a patent applicable to software (including a cross-claim or counterclaim in a
lawsuit), then any patent licenses granted by that Contributor to such Recipient
under this Agreement shall terminate as of the date such litigation is filed. In
addition, if Recipient institutes patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that the Program
itself (excluding combinations of the Program with other software or hardware)
infringes such Recipient's patent(s), then such Recipient's rights granted under
Section 2(b) shall terminate as of the date such litigation is filed.
-All Recipient's rights under this Agreement shall terminate if it fails to
comply with any of the material terms or conditions of this Agreement and does
not cure such failure in a reasonable period of time after becoming aware of
such noncompliance. If all Recipient's rights under this Agreement terminate,
Recipient agrees to cease use and distribution of the Program as soon as
reasonably practicable. However, Recipient's obligations under this Agreement
and any licenses granted by Recipient relating to the Program shall continue and
survive.
-Everyone is permitted to copy and distribute copies of this Agreement, but in
order to avoid inconsistency the Agreement is copyrighted and may only be
modified in the following manner. The Agreement Steward reserves the right to
publish new versions (including revisions) of this Agreement from time to time.
No one other than the Agreement Steward has the right to modify this Agreement.
IBM is the initial Agreement Steward. IBM may assign the responsibility to serve
as the Agreement Steward to a suitable separate entity. Each new version of the
Agreement will be given a distinguishing version number. The Program (including
Contributions) may always be distributed subject to the version of the Agreement
under which it was received. In addition, after a new version of the Agreement
is published, Contributor may elect to distribute the Program (including its
Contributions) under the new version. Except as expressly stated in Sections
2(a) and 2(b) above, Recipie
 nt receives no rights or licenses to the
intellectual property of any Contributor under this Agreement, whether
expressly, by implication, estoppel or otherwise. All rights in the Program not
expressly granted under this Agreement are reserved.
-This Agreement is governed by the laws of the State of New York and the
intellectual property laws of the United States of America. No party to this
Agreement will bring a legal action under this Agreement more than one year
after the cause of action arose. Each party waives its rights to a jury trial in
any resulting litigation.
-
-==========================================================================================
-==========================================================================================
-
-For puretls:
-    Containing Project URL: 
-
-  This package is a SSLv3/TLS implementation written by Eric Rescorla
-   <ek...@rtfm.com> and licensed by Claymore Systems, Inc.
-
-   Redistribution and use in source and binary forms, with or without
-   modification, are permitted provided that the following conditions
-   are met:
-   1. Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-   2. Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in the
-      documentation and/or other materials provided with the distribution.
-   3. Neither the name of Claymore Systems, Inc. nor the name of Eric
-      Rescorla may be used to endorse or promote products derived from this
-      software without specific prior written permission.
-   THIS SOFTWARE IS PROVIDED BY CLAYMORE SYSTEMS AND CONTRIBUTORS ``AS IS'' AND
-   ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-   ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-   FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-   OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-   LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-   OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-   SUCH DAMAGE.
-
-==============================================================================
-
-For xml-api,woden-api-1.0M8.jar,woden-impl-dom-1.0M8.jar:
-    Containing Project URL: 
-
-For the W3C schema and DTD files in the org.apache.woden.resolver package:
-
-W3C® DOCUMENT LICENSE
-http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231
-
-Public documents on the W3C site are provided by the copyright holders under
-the following license. By using and/or copying this document, or the W3C
-document from which this statement is linked, you (the licensee) agree that
-you have read, understood, and will comply with the following terms and
-conditions:
-
-Permission to copy, and distribute the contents of this document, or the W3C
-document from which this statement is linked, in any medium for any purpose
-and without fee or royalty is hereby granted, provided that you include the
-following on ALL copies of the document, or portions thereof, that you use:
-
-  1. A link or URL to the original W3C document.
-  2. The pre-existing copyright notice of the original author, or if it
-     doesn't exist, a notice (hypertext is preferred, but a textual
-     representation is permitted) of the form: "Copyright © [$date-of-document]
-     World Wide Web Consortium, (Massachusetts Institute of Technology,
-     European Research Consortium for Informatics and Mathematics, Keio
-     University). All Rights Reserved.
-     http://www.w3.org/Consortium/Legal/2002/copyright-documents-20021231"
-  3. If it exists, the STATUS of the W3C document.
-
-When space permits, inclusion of the full text of this NOTICE should be
-provided. We request that authorship attribution be provided in any software,
-documents, or other items or products that you create pursuant to the
-implementation of the contents of this document, or any portion thereof.
-
-No right to create modifications or derivatives of W3C documents is granted
-pursuant to this license. However, if additional requirements (documented in
-the Copyright FAQ) are satisfied, the right to create modifications or
-derivatives is sometimes granted by the W3C to individuals complying with
-those requirements.
-
-THIS DOCUMENT IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO
-REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING, BUT NOT
-LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
-NON-INFRINGEMENT, OR TITLE; THAT THE CONTENTS OF THE DOCUMENT ARE SUITABLE
-FOR ANY PURPOSE; NOR THAT THE IMPLEMENTATION OF SUCH CONTENTS WILL NOT
-INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE DOCUMENT OR THE
-PERFORMANCE OR IMPLEMENTATION OF THE CONTENTS THEREOF.
-
-The name and trademarks of copyright holders may NOT be used in advertising
-or publicity pertaining to this document or its contents without specific,
-written prior permission. Title to copyright in this document will at all
-times remain with copyright holders.
-
-This formulation of W3C's notice and license became active on December 31 2002. 
-This version removes the copyright ownership notice such that this license can 
-be used with materials other than those owned by the W3C, reflects that ERCIM is 
-now a host of the W3C, includes references to this specific dated version of the 
-license, and removes the ambiguous grant of "use". Otherwise, this version is the 
-same as the previous version and is written so as to preserve the Free Software 
-Foundation's assessment of GPL compatibility and OSI's certification under the 
-Open Source Definition. Please see our Copyright FAQ for common questions about 
-using materials from our site, including specific terms and conditions for packages 
-like libwww, Amaya, and Jigsaw. Other questions about this notice can be directed 
-o site-policy@w3.org.
-
-Joseph Reagle <si...@w3.org>
- 
-Last revised $Id: copyright-software-20021231.html,v 1.11 2004/07/06 16:02:49 slesch Exp $ 
-
-==========================================================================================
-
-XML API library, org.w3c classes (xml-apis)
-    Containing Project URL: 
-
-    DOM Java Language Binding:
-    http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/java-binding.html
-
-    W3C IPR SOFTWARE NOTICE
-    Copyright (C) 2000 World Wide Web Consortium, (Massachusetts Institute of
-    Technology, Institut National de Recherche en Informatique et en
-    Automatique, Keio University). All Rights Reserved.
-
-    The DOM bindings are published under the W3C Software Copyright Notice
-    and License. The software license requires "Notice of any changes or
-    modifications to the W3C files, including the date changes were made."
-    Consequently, modified versions of the DOM bindings must document that
-    they do not conform to the W3C standard; in the case of the IDL binding,
-    the pragma prefix can no longer be 'w3c.org'; in the case of the Java
-    binding, the package names can no longer be in the 'org.w3c' package.
-
-    Note: The original version of the W3C Software Copyright Notice and
-    License could be found at
-    http://www.w3.org/Consortium/Legal/copyright-software-19980720
-
-    Copyright (C) 1994-2000 World Wide Web Consortium, (Massachusetts
-    Institute of Technology, Institut National de Recherche en Informatique
-    et en Automatique, Keio University). All Rights Reserved.
-    http://www.w3.org/Consortium/Legal/
-
-    This W3C work (including software, documents, or other related items) is
-    being provided by the copyright holders under the following license. By
-    obtaining, using and/or copying this work, you (the licensee) agree that
-    you have read, understood, and will comply with the following terms and
-    conditions:
-
-    Permission to use, copy, and modify this software and its documentation,
-    with or without modification, for any purpose and without fee or royalty
-    is hereby granted, provided that you include the following on ALL copies
-    of the software and documentation or portions thereof, including
-    modifications, that you make:
-
-      1. The full text of this NOTICE in a location viewable to users of the
-         redistributed or derivative work.
-
-      2. Any pre-existing intellectual property disclaimers, notices, or
-         terms and conditions. If none exist, a short notice of the following
-         form (hypertext is preferred, text is permitted) should be used
-         within the body of any redistributed or derivative code:
-         "Copyright (C) [$date-of-software] World Wide Web Consortium,
-         (Massachusetts Institute of Technology, Institut National de
-         Recherche en Informatique et en Automatique, Keio University).
-         All Rights Reserved. http://www.w3.org/Consortium/Legal/"
-
-      3. Notice of any changes or modifications to the W3C files, including
-         the date changes were made. (We recommend you provide URIs to the
-         location from which the code is derived.)
-
-    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS
-    MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT
-    NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR
-    PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE
-    ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
-
-    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL
-    OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR
-    DOCUMENTATION.
-
-    The name and trademarks of copyright holders may NOT be used in
-    advertising or publicity pertaining to the software without specific,
-    written prior permission. Title to copyright in this software and any
-    associated documentation will at all times remain with copyright holders.
-
-=============================================================================== 
-The following components come under the Eclipse Public 1.0 License 
-=============================================================================== 
-Eclipse JDT Core (core-3.1.1.jar)
-
-  Eclipse Public License - v 1.0
-
-    THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
-    PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF
-    THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
-
-    1. DEFINITIONS
-
-    "Contribution" means:
-
-    a) in the case of the initial Contributor, the initial code and
-       documentation distributed under this Agreement, and
-
-    b) in the case of each subsequent Contributor:
-
-       i) changes to the Program, and
-
-       ii) additions to the Program;
-
-       where such changes and/or additions to the Program originate from and
-       are distributed by that particular Contributor. A Contribution
-       'originates' from a Contributor if it was added to the Program by
-       such Contributor itself or anyone acting on such Contributor's behalf.
-       Contributions do not include additions to the Program which: (i) are
-       separate modules of software distributed in conjunction with the
-       Program under their own license agreement, and (ii) are not derivative
-       works of the Program.
-
-    "Contributor" means any person or entity that distributes the Program.
-
-    "Licensed Patents " mean patent claims licensable by a Contributor which
-    are necessarily infringed by the use or sale of its Contribution alone or
-    when combined with the Program.
-
-    "Program" means the Contributions distributed in accordance with this
-    Agreement.
-
-    "Recipient" means anyone who receives the Program under this Agreement,
-    including all Contributors.
-
-    2. GRANT OF RIGHTS
-
-    a) Subject to the terms of this Agreement, each Contributor hereby grants
-       Recipient a non-exclusive, worldwide, royalty-free copyright license to
-       reproduce, prepare derivative works of, publicly display, publicly
-       perform, distribute and sublicense the Contribution of such
-       Contributor, if any, and such derivative works, in source code and
-       object code form.
-
-    b) Subject to the terms of this Agreement, each Contributor hereby grants
-       Recipient a non-exclusive, worldwide, royalty-free patent license under
-       Licensed Patents to make, use, sell, offer to sell, import and
-       otherwise transfer the Contribution of such Contributor, if any, in
-       source code and object code form. This patent license shall apply to
-       the combination of the Contribution and the Program if, at the time
-       the Contribution is added by the Contributor, such addition of the
-       Contribution causes such combination to be covered by the Licensed
-       Patents. The patent license shall not apply to any other combinations
-       which include the Contribution. No hardware per se is licensed hereunder.
-
-    c) Recipient understands that although each Contributor grants the
-       licenses to its Contributions set forth herein, no assurances are
-       provided by any Contributor that the Program does not infringe the
-       patent or other intellectual property rights of any other entity. Each
-       Contributor disclaims any liability to Recipient for claims brought by
-       any other entity based on infringement of intellectual property rights
-       or otherwise. As a condition to exercising the rights and licenses
-       granted hereunder, each Recipient hereby assumes sole responsibility
-       to secure any other intellectual property rights needed, if any. For
-       example, if a third party patent license is required to allow Recipient
-       to distribute the Program, it is Recipient's responsibility to acquire
-       that license before distributing the Program.
-
-    d) Each Contributor represents that to its knowledge it has sufficient
-       copyright rights in its Contribution, if any, to grant the copyright
-       license set forth in this Agreement.
-
-    3. REQUIREMENTS
-
-    A Contributor may choose to distribute the Program in object code form
-    under its own license agreement, provided that:
-
-    a) it complies with the terms and conditions of this Agreement; and
-
-    b) its license agreement:
-
-       i)   effectively disclaims on behalf of all Contributors all warranties
-            and conditions, express and implied, including warranties or
-            conditions of title and non-infringement, and implied warranties
-            or conditions of merchantability and fitness for a particular
-            purpose;
-
-       ii)  effectively excludes on behalf of all Contributors all liability
-            for damages, including direct, indirect, special, incidental and
-            consequential damages, such as lost profits;
-
-       iii) states that any provisions which differ from this Agreement are
-            offered by that Contributor alone and not by any other party; and
-
-       iv)  states that source code for the Program is available from such
-            Contributor, and informs licensees how to obtain it in a
-            reasonable manner on or through a medium customarily used for
-            software exchange.
-
-    When the Program is made available in source code form:
-
-    a) it must be made available under this Agreement; and
-
-    b) a copy of this Agreement must be included with each copy of the
-       Program.
-
-    Contributors may not remove or alter any copyright notices contained
-    within the Program.
-
-    Each Contributor must identify itself as the originator of its
-    Contribution, if any, in a manner that reasonably allows subsequent
-    Recipients to identify the originator of the Contribution.
-
-    4. COMMERCIAL DISTRIBUTION
-
-    Commercial distributors of software may accept certain responsibilities
-    with respect to end users, business partners and the like. While this
-    license is intended to facilitate the commercial use of the Program,
-    the Contributor who includes the Program in a commercial product offering
-    should do so in a manner which does not create potential liability for
-    other Contributors. Therefore, if a Contributor includes the Program in
-    a commercial product offering, such Contributor ("Commercial Contributor")
-    hereby agrees to defend and indemnify every other Contributor
-    ("Indemnified Contributor") against any losses, damages and costs
-    (collectively "Losses") arising from claims, lawsuits and other legal
-    actions brought by a third party against the Indemnified Contributor to
-    the extent caused by the acts or omissions of such Commercial Contributor
-    in connection with its distribution of the Program in a commercial
-    product offering. The obligations in this section do not apply to any
-    claims or Losses relating to any actual or alleged intellectual property
-    infringement. In order to qualify, an Indemnified Contributor must:
-    a) promptly notify the Commercial Contributor in writing of such claim,
-    and b) allow the Commercial Contributor to control, and cooperate with
-    the Commercial Contributor in, the defense and any related settlement
-    negotiations. The Indemnified Contributor may participate in any such
-    claim at its own expense.
-
-    For example, a Contributor might include the Program in a commercial
-    product offering, Product X. That Contributor is then a Commercial
-    Contributor. If that Commercial Contributor then makes performance claims,
-    or offers warranties related to Product X, those performance claims and
-    warranties are such Commercial Contributor's responsibility alone. Under
-    this section, the Commercial Contributor would have to defend claims
-    against the other Contributors related to those performance claims and
-    warranties, and if a court requires any other Contributor to pay any
-    damages as a result, the Commercial Contributor must pay those damages.
-
-    5. NO WARRANTY
-
-    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
-    ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
-    EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
-    CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
-    PARTICULAR PURPOSE. Each Recipient is solely responsible for determining
-    the appropriateness of using and distributing the Program and assumes all
-    risks associated with its exercise of rights under this Agreement ,
-    including but not limited to the risks and costs of program errors,
-    compliance with applicable laws, damage to or loss of data, programs or
-    equipment, and unavailability or interruption of operations.
-
-    6. DISCLAIMER OF LIABILITY
-
-    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
-    ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
-    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
-    WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
-    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
-    DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
-    HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-    7. GENERAL
-
-    If any provision of this Agreement is invalid or unenforceable under
-    applicable law, it shall not affect the validity or enforceability of
-    the remainder of the terms of this Agreement, and without further action
-    by the parties hereto, such provision shall be reformed to the minimum
-    extent necessary to make such provision valid and enforceable.
-
-    If Recipient institutes patent litigation against any entity (including
-    a cross-claim or counterclaim in a lawsuit) alleging that the Program
-    itself (excluding combinations of the Program with other software or
-    hardware) infringes such Recipient's patent(s), then such Recipient's
-    rights granted under Section 2(b) shall terminate as of the date such
-    litigation is filed.
-
-    All Recipient's rights under this Agreement shall terminate if it fails
-    to comply with any of the material terms or conditions of this Agreement
-    and does not cure such failure in a reasonable period of time after
-    becoming aware of such noncompliance. If all Recipient's rights under
-    this Agreement terminate, Recipient agrees to cease use and distribution
-    of the Program as soon as reasonably practicable. However, Recipient's
-    obligations under this Agreement and any licenses granted by Recipient
-    relating to the Program shall continue and survive.
-
-    Everyone is permitted to copy and distribute copies of this Agreement,
-    but in order to avoid inconsistency the Agreement is copyrighted and may
-    only be modified in the following manner. The Agreement Steward reserves
-    the right to publish new versions (including revisions) of this Agreement
-    from time to time. No one other than the Agreement Steward has the right
-    to modify this Agreement. The Eclipse Foundation is the initial Agreement
-    Steward. The Eclipse Foundation may assign the responsibility to serve as
-    the Agreement Steward to a suitable separate entity. Each new version of
-    the Agreement will be given a distinguishing version number. The Program
-    (including Contributions) may always be distributed subject to the version
-    of the Agreement under which it was received. In addition, after a new
-    version of the Agreement is published, Contributor may elect to distribute
-    the Program (including its Contributions) under the new version. Except as
-    expressly stated in Sections 2(a) and 2(b) above, Recipient receives no
-    rights or licenses to the intellectual property of any Contributor under
-    this Agreement, whether expressly, by implication, estoppel or otherwise.
-    All rights in the Program not expressly granted under this Agreement
-    are reserved.
-
-    This Agreement is governed by the

<TRUNCATED>

[51/90] [abbrv] [partial] git commit: AIRAVATA-1124

Posted by sa...@apache.org.
AIRAVATA-1124


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/0e2c10f5
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/0e2c10f5
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/0e2c10f5

Branch: refs/heads/master
Commit: 0e2c10f568f583d886657ad0b536ae62f7fa04ad
Parents: 5940988
Author: Saminda Wijeratne <sa...@gmail.com>
Authored: Sun Apr 13 18:01:11 2014 -0700
Committer: Saminda Wijeratne <sa...@gmail.com>
Committed: Sun Apr 13 18:01:11 2014 -0700

----------------------------------------------------------------------
 modules/commons/json/pom.xml                    |   44 -
 .../apache/airavata/json/StaxonJSONBuilder.java |   63 -
 .../airavata/json/StaxonJSONFormatter.java      |  106 -
 modules/commons/pom.xml                         |    1 -
 modules/distribution/pom.xml                    |    1 -
 modules/distribution/xbaya-gui/pom.xml          |  558 ---
 .../src/main/assembly/bin-assembly.xml          |  165 -
 .../airavata/distribution/xbaya/jnlp/Main.java  |  156 -
 .../xbaya-gui/src/main/resources/INSTALL        |   44 -
 .../xbaya-gui/src/main/resources/LICENSE        | 2273 -----------
 .../xbaya-gui/src/main/resources/NOTICE         |  163 -
 .../xbaya-gui/src/main/resources/README         |  101 -
 .../src/main/resources/airavata-logo.gif        |  Bin 13895 -> 0 bytes
 .../xbaya-gui/src/main/resources/bin/setenv.bat |   42 -
 .../xbaya-gui/src/main/resources/bin/setenv.sh  |   77 -
 .../src/main/resources/bin/xbaya-gui.bat        |   23 -
 .../src/main/resources/bin/xbaya-gui.sh         |   22 -
 .../xbaya-gui/src/main/resources/jnlp/INSTALL   |   48 -
 .../xbaya-gui/src/main/resources/jnlp/LICENSE   | 2272 ----------
 .../xbaya-gui/src/main/resources/jnlp/NOTICE    |  163 -
 .../xbaya-gui/src/main/resources/jnlp/README    |   91 -
 .../src/main/resources/jnlp/xbaya.jnlp          |   42 -
 .../xbaya-gui/src/main/resources/xbaya.jks      |  Bin 2234 -> 0 bytes
 .../xbaya-gui/src/main/resources/xbaya.jnlp     |   42 -
 .../registry/airavata-registry-service/pom.xml  |  116 -
 .../services/ConfigurationRegistryService.java  |   77 -
 .../services/DescriptorRegistryService.java     |  105 -
 .../services/ProjectsRegistryService.java       |   66 -
 .../services/ProvenanceRegistryService.java     |  311 --
 .../PublishedWorkflowRegistryService.java       |   51 -
 .../registry/services/RegistryService.java      |  164 -
 .../services/UserWorkflowRegistryService.java   |   47 -
 .../registry/services/utils/ConnectionPool.java |  381 --
 .../services/utils/DatabaseCreator.java         |  348 --
 .../registry/services/utils/JdbcStorage.java    |  180 -
 .../src/main/resources/services.xml             |   22 -
 modules/registry/airavata-registry-test/pom.xml |  112 -
 .../api/test/AiravataRegistryAPITest.java       | 1800 --------
 .../registry/api/test/util/Initialize.java      |  296 --
 .../src/test/resources/registry-derby.sql       |  380 --
 modules/registry/pom.xml                        |    2 -
 modules/rest/client/pom.xml                     |   82 -
 .../java/org/apache/airavata/rest/Test.java     |  542 ---
 .../client/BasicRegistryResourceClient.java     |  429 --
 .../client/ConfigurationResourceClient.java     | 1141 ------
 .../client/CredentialStoreResourceClient.java   |  226 -
 .../rest/client/DescriptorResourceClient.java   | 1278 ------
 .../rest/client/ExperimentResourceClient.java   |  498 ---
 .../rest/client/PasswordCallbackImpl.java       |   40 -
 .../rest/client/ProjectResourceClient.java      |  391 --
 .../rest/client/ProvenanceResourceClient.java   | 2854 -------------
 .../client/PublishedWorkflowResourceClient.java |  410 --
 .../airavata/rest/client/RegistryClient.java    | 1111 -----
 .../rest/client/UserWorkflowResourceClient.java |  376 --
 .../rest/utils/BasicAuthHeaderUtil.java         |   79 -
 .../airavata/rest/utils/ClientConstant.java     |   30 -
 .../airavata/rest/utils/CookieManager.java      |   37 -
 modules/rest/mappings/pom.xml                   |   72 -
 .../resourcemappings/ApplicationDescriptor.java |  264 --
 .../ApplicationDescriptorList.java              |   40 -
 .../ApplicationStatusDataList.java              |   40 -
 .../resourcemappings/ConfigurationList.java     |   37 -
 .../resourcemappings/DescriptorNameList.java    |   42 -
 .../resourcemappings/ExecutionErrorsList.java   |   41 -
 .../resourcemappings/ExperimentDataList.java    |   45 -
 .../resourcemappings/ExperimentErrorsList.java  |   41 -
 .../resourcemappings/ExperimentIDList.java      |   42 -
 .../resourcemappings/ExperimentList.java        |   41 -
 .../resourcemappings/GFacErrorsList.java        |   41 -
 .../mappings/resourcemappings/GFacJobList.java  |   40 -
 .../resourcemappings/HostDescriptionList.java   |   41 -
 .../resourcemappings/HostDescriptor.java        |  109 -
 .../resourcemappings/NodeErrorsList.java        |   40 -
 .../PublishWorkflowNamesList.java               |   40 -
 .../ServiceDescriptionList.java                 |   36 -
 .../resourcemappings/ServiceDescriptor.java     |   68 -
 .../resourcemappings/ServiceParameters.java     |   63 -
 .../rest/mappings/resourcemappings/URLList.java |   38 -
 .../mappings/resourcemappings/UserList.java     |   45 -
 .../mappings/resourcemappings/Workflow.java     |   49 -
 .../resourcemappings/WorkflowErrorsList.java    |   41 -
 .../resourcemappings/WorkflowInstancesList.java |   38 -
 .../mappings/resourcemappings/WorkflowList.java |   42 -
 .../WorkflowNodeIODataList.java                 |   40 -
 .../resourcemappings/WorkspaceProjectList.java  |   42 -
 .../utils/ApplicationDescriptorTypes.java       |   29 -
 .../rest/mappings/utils/DescriptorUtil.java     |  483 ---
 .../airavata/rest/mappings/utils/HostTypes.java |   32 -
 .../rest/mappings/utils/RegIdentifier.java      |   40 -
 .../rest/mappings/utils/RegPoolUtils.java       |  100 -
 .../mappings/utils/RegistryInstancesPool.java   |   50 -
 .../rest/mappings/utils/RegistryListener.java   |   54 -
 .../mappings/utils/ResourcePathConstants.java   |  249 --
 .../mappings/utils/RestServicesConstants.java   |   30 -
 modules/rest/pom.xml                            |   44 -
 modules/rest/service/pom.xml                    |   99 -
 .../experiment/ExperimentDataService.java       |   32 -
 .../experiment/ExperimentExecutionService.java  |  115 -
 .../gateway/ApplicationDataService.java         |   32 -
 .../gateway/PublishedWorkflowDataService.java   |   31 -
 .../services/gateway/WorkflowDataService.java   |   31 -
 .../rest/resources/BasicRegistryResouce.java    |  199 -
 .../ConfigurationRegistryResource.java          |  732 ----
 .../resources/CredentialRegistryResource.java   |  152 -
 .../resources/DescriptorRegistryResource.java   |  889 ----
 .../resources/ExperimentRegistryResource.java   |  364 --
 .../rest/resources/ProjectRegistryResource.java |  271 --
 .../resources/ProvenanceRegistryResource.java   | 1949 ---------
 .../PublishWorkflowRegistryResource.java        |  289 --
 .../rest/resources/UserRegistryResource.java    |   81 -
 .../resources/UserWorkflowRegistryResource.java |  291 --
 .../rest/security/HttpAuthenticatorFilter.java  |  191 -
 .../rest/security/ServletRequestHelper.java     |  118 -
 .../basic/BasicAccessAuthenticator.java         |  220 -
 .../rest/security/local/LocalUserStore.java     |  339 --
 .../security/session/SessionAuthenticator.java  |  120 -
 .../registry/rest/utils/WebAppUtil.java         |   64 -
 .../server/ServerConfigurationService.java      |   32 -
 .../security/AbstractAuthenticatorTest.java     |   84 -
 .../rest/security/MyHttpServletRequest.java     |  373 --
 .../basic/BasicAccessAuthenticatorTest.java     |  116 -
 .../rest/security/local/LocalUserStoreTest.java |  113 -
 .../session/SessionAuthenticatorTest.java       |   84 -
 .../src/test/resources/authenticators.xml       |   55 -
 modules/rest/webapp/README.txt                  |  164 -
 modules/rest/webapp/pom.xml                     |  257 --
 .../src/main/resources/authenticators.xml       |   89 -
 .../resources/credential-store/airavata.jks     |  Bin 501 -> 0 bytes
 .../main/resources/credential-store/client.xml  |   38 -
 .../credential-store/oauth-privkey.pk8          |   28 -
 .../resources/credential-store/oauth-pubkey.pem |    9 -
 .../rest/webapp/src/main/resources/log4j.xml    |   49 -
 .../rest/webapp/src/main/webapp/WEB-INF/web.xml |  200 -
 .../rest/webapp/src/main/webapp/acs/index.jsp   |   44 -
 .../src/main/webapp/credential-store/error.jsp  |   53 -
 .../credential-store/password-credentials.jsp   |   33 -
 .../webapp/credential-store/show-redirect.jsp   |   44 -
 .../main/webapp/credential-store/success.jsp    |   25 -
 .../src/main/webapp/images/airavata-logo-2.png  |  Bin 4314 -> 0 bytes
 modules/rest/webapp/src/main/webapp/index.jsp   |   26 -
 .../webapp/src/main/webapp/user-store/add.jsp   |  142 -
 .../webapp/src/main/webapp/user-store/index.jsp |  138 -
 .../src/main/webapp/user-store/password.jsp     |  157 -
 modules/security/pom.xml                        |   55 -
 .../security/AbstractAuthenticator.java         |  150 -
 .../security/AbstractDatabaseAuthenticator.java |  129 -
 .../security/AuthenticationException.java       |   41 -
 .../apache/airavata/security/Authenticator.java |  108 -
 .../apache/airavata/security/Authoriser.java    |   43 -
 .../org/apache/airavata/security/UserStore.java |   71 -
 .../airavata/security/UserStoreException.java   |   46 -
 .../AbstractConfigurationReader.java            |   55 -
 .../AuthenticatorConfigurationReader.java       |  244 --
 .../userstore/AbstractJDBCUserStore.java        |  134 -
 .../security/userstore/JDBCUserStore.java       |  166 -
 .../security/userstore/LDAPUserStore.java       |  147 -
 .../security/userstore/SessionDBUserStore.java  |  132 -
 .../security/util/PasswordDigester.java         |  111 -
 .../AuthenticatorConfigurationReaderTest.java   |  119 -
 .../configurations/TestDBAuthenticator1.java    |   57 -
 .../configurations/TestDBAuthenticator2.java    |   58 -
 .../configurations/TestDBAuthenticator3.java    |   57 -
 .../security/configurations/TestUserStore.java  |   47 -
 .../security/userstore/JDBCUserStoreTest.java   |  106 -
 .../security/userstore/LDAPUserStoreTest.java   |   69 -
 .../userstore/SessionDBUserStoreTest.java       |  101 -
 .../src/test/resources/authenticators.xml       |   88 -
 .../test/resources/disabled-authenticator.xml   |   84 -
 .../src/test/resources/jdbc-authenticator.xml   |   39 -
 .../src/test/resources/ldap-authenticator.xml   |   41 -
 .../test/resources/session-authenticator.xml    |   45 -
 modules/workflow-interpreter/pom.xml            |   96 -
 .../src/main/resources/WorkflowInterpretor.wsdl |   92 -
 .../src/main/resources/services.xml             |   27 -
 modules/workflow-model/pom.xml                  |    3 -
 .../workflow-model-component-node/pom.xml       |   77 -
 .../workflow-model-component/pom.xml            |   83 -
 .../registry/JCRComponentReference.java         |   65 -
 .../registry/JCRComponentRegistry.java          |  162 -
 modules/ws-messenger/distribution/pom.xml       |  139 -
 .../src/main/assembly/bin-assembly.xml          |  190 -
 .../distribution/src/main/resources/axis2.xml   |  551 ---
 .../src/main/resources/bin/axis2.bat            |   75 -
 .../src/main/resources/bin/axis2.sh             |   56 -
 .../src/main/resources/bin/axis2server.bat      |  118 -
 .../src/main/resources/bin/axis2server.sh       |   66 -
 .../src/main/resources/bin/java2wsdl.bat        |   79 -
 .../src/main/resources/bin/java2wsdl.sh         |   21 -
 .../src/main/resources/bin/setenv.sh            |  112 -
 .../src/main/resources/bin/wsdl2java.bat        |   78 -
 .../src/main/resources/bin/wsdl2java.sh         |   21 -
 .../distribution/src/main/resources/startGUI.sh |   44 -
 .../ws-messenger/messagebox/maven-eclipse.xml   |   16 -
 modules/ws-messenger/messagebox/pom.xml         |  100 -
 .../wsmg/msgbox/MsgBoxServiceLifeCycle.java     |  192 -
 .../MsgBoxServiceMessageReceiverInOut.java      |  138 -
 .../wsmg/msgbox/MsgBoxServiceSkeleton.java      |  186 -
 .../wsmg/msgbox/Storage/MsgBoxStorage.java      |   59 -
 .../Storage/dbpool/DatabaseStorageImpl.java     |  125 -
 .../msgbox/Storage/dbpool/MessageBoxDB.java     |  265 --
 .../msgbox/Storage/memory/InMemoryImpl.java     |  133 -
 .../wsmg/msgbox/StoreMessageHandler.java        |  123 -
 .../airavata/wsmg/msgbox/util/ConfigKeys.java   |   36 -
 .../wsmg/msgbox/util/MsgBoxCommonConstants.java |   26 -
 .../wsmg/msgbox/util/MsgBoxOperations.java      |   53 -
 .../airavata/wsmg/msgbox/util/MsgBoxUtils.java  |   71 -
 .../resources/database_scripts/msgBox-derby.sql |   41 -
 .../resources/database_scripts/msgBox-mysql.sql |   42 -
 .../messagebox/src/main/resources/services.xml  |   57 -
 .../wsmg/msgbox/InMemoryMessageBoxServer.java   |  157 -
 .../wsmg/msgbox/MessageBoxStressTest.java       |  129 -
 .../apache/airavata/wsmg/msgbox/MsgBoxTest.java |  103 -
 modules/ws-messenger/messagebroker/pom.xml      |  117 -
 .../wsmg/broker/AbstractBrokerMsgReceiver.java  |  105 -
 .../wsmg/broker/AdditionalMessageContent.java   |  131 -
 .../wsmg/broker/BrokerServiceLifeCycle.java     |  328 --
 .../airavata/wsmg/broker/ConsumerInfo.java      |  123 -
 .../airavata/wsmg/broker/ConsumerList.java      |   73 -
 .../wsmg/broker/ConsumerListManager.java        |   79 -
 .../wsmg/broker/NotificationProcessor.java      |  313 --
 .../broker/amqp/AMQPNotificationProcessor.java  |  132 -
 .../broker/context/ContextParameterInfo.java    |   58 -
 .../wsmg/broker/context/ContextParameters.java  |   72 -
 .../wsmg/broker/context/ProcessingContext.java  |  114 -
 .../context/ProcessingContextBuilder.java       |   30 -
 .../broker/handler/PublishedMessageHandler.java |  120 -
 .../wsmg/broker/subscription/CleanupThread.java |  148 -
 .../broker/subscription/SubscriptionEntry.java  |   49 -
 .../subscription/SubscriptionManager.java       |  440 --
 .../broker/subscription/SubscriptionState.java  |  301 --
 .../wseventing/WSEProcessingContextBuilder.java |  186 -
 .../broker/wseventing/WSEProtocolSupport.java   |  204 -
 .../wseventing/WSEventingMsgReceiver.java       |   77 -
 .../WSEventingPublishMsgReceiver.java           |   74 -
 .../wsnotification/WSNTProtocolSupport.java     |  237 --
 .../WSNotificationMsgReceiver.java              |  110 -
 .../WSNotificationProcessingContextBuilder.java |  179 -
 .../airavata/wsmg/commons/OutGoingMessage.java  |  125 -
 .../commons/storage/WsmgInMemoryStorage.java    |  106 -
 .../commons/storage/WsmgPersistantStorage.java  |  773 ----
 .../wsmg/commons/storage/WsmgQueue.java         |   34 -
 .../wsmg/commons/storage/WsmgStorage.java       |   39 -
 .../wsmg/commons/util/OMElementComparator.java  |  177 -
 .../airavata/wsmg/config/WSMGParameter.java     |   48 -
 .../wsmg/config/WsmgConfigurationContext.java   |  118 -
 .../wsmg/matching/AbstractMessageMatcher.java   |   89 -
 .../wsmg/matching/XPath/YFilterInfo.java        |  156 -
 .../matching/XPath/YFilterMessageMatcher.java   |  183 -
 .../simpleTopic/DirectWsntMessageMatcher.java   |  125 -
 .../wsmg/messenger/ConsumerUrlManager.java      |  195 -
 .../airavata/wsmg/messenger/Deliverable.java    |   32 -
 .../wsmg/messenger/DeliveryProcessor.java       |   90 -
 .../airavata/wsmg/messenger/OutGoingQueue.java  |   65 -
 .../airavata/wsmg/messenger/SenderUtils.java    |  161 -
 .../messenger/protocol/DeliveryProtocol.java    |   34 -
 .../messenger/protocol/SendingException.java    |   37 -
 .../messenger/protocol/impl/Axis2Protocol.java  |  156 -
 .../messenger/strategy/SendingStrategy.java     |   33 -
 .../strategy/impl/ConsumerHandler.java          |   71 -
 .../strategy/impl/FixedParallelSender.java      |  185 -
 .../messenger/strategy/impl/LightweightMsg.java |   54 -
 .../messenger/strategy/impl/ParallelSender.java |  155 -
 .../messenger/strategy/impl/SerialSender.java   |   75 -
 .../apache/airavata/wsmg/util/BrokerUtil.java   |  121 -
 .../org/apache/airavata/wsmg/util/Counter.java  |   77 -
 .../airavata/wsmg/util/RunTimeStatistics.java   |  157 -
 .../apache/airavata/wsmg/util/TimerThread.java  |   87 -
 .../wsmg/util/WsEventingOperations.java         |   55 -
 .../wsmg/util/WsNotificationOperations.java     |   56 -
 .../database_scripts/cleanDBScript.sql          |   27 -
 .../database_scripts/msgBroker-derby.sql        |   60 -
 .../database_scripts/msgBroker-mysql.sql        |   61 -
 .../src/main/resources/services.xml             |  125 -
 .../airavata/wsmg/broker/BrokerWSETest.java     |  107 -
 .../airavata/wsmg/broker/BrokerWSNTTest.java    |  108 -
 .../wsmg/commons/TestCommonRoutines.java        |   57 -
 .../TestAddtionalWseXpathAndTopicScenarios.java |  151 -
 .../XPath/TestWseXpathAndTopicSubscription.java |  137 -
 .../XPath/TestWseXpathSubscription.java         |  139 -
 .../matching/XPath/performance/XppXPath.java    |  269 --
 .../rtt/NotificationManager.java                |  151 -
 .../rtt/PerformanceTest.java                    |  399 --
 .../rtt/PublisherThread.java                    |   99 -
 .../rtt/StatCalculatorThread.java               |  103 -
 .../rtt/StatContainer.java                      |   49 -
 .../performance_evaluator/rtt/Subscription.java |  107 -
 .../rtt/util/ConfigKeys.java                    |   43 -
 .../rtt/util/LoadMsgPayload.java                |   66 -
 .../rtt/util/LoadXpath.java                     |   66 -
 .../airavata/wsmg/util/BrokerUtilTest.java      |  167 -
 .../apache/airavata/wsmg/util/ConfigKeys.java   |   34 -
 .../airavata/wsmg/util/TestUtilServer.java      |  225 -
 .../src/test/resources/unit_tests.properties    |   24 -
 modules/ws-messenger/pom.xml                    |    3 -
 .../README.txt                                  |   28 -
 .../build.properties                            |   24 -
 .../build.xml                                   |   78 -
 .../conf/configuration.properties               |   23 -
 .../wsmg/samples/msgBox/SimpleMsgBoxExec.java   |   93 -
 .../airavata/wsmg/samples/util/ConfigKeys.java  |   31 -
 .../README.txt                                  |   28 -
 .../build.properties                            |   23 -
 .../build.xml                                   |   87 -
 .../conf/configurations.properties              |   29 -
 .../airavata/wsmg/samples/util/ConfigKeys.java  |   38 -
 .../airavata/wsmg/samples/wse/MsgUtil.java      |   71 -
 .../wse/MultipleProducersConsumersTopics.java   |  126 -
 .../airavata/wsmg/samples/wse/Producer.java     |   94 -
 .../README.txt                                  |   25 -
 .../build.properties                            |   23 -
 .../build.xml                                   |   87 -
 .../conf/configurations.properties              |   29 -
 .../airavata/wsmg/samples/util/ConfigKeys.java  |   38 -
 .../airavata/wsmg/samples/wse/Consumer.java     |  154 -
 .../airavata/wsmg/samples/wse/MsgUtil.java      |   71 -
 .../wse/MultipleProducersConsumersTopics.java   |  163 -
 .../airavata/wsmg/samples/wse/Producer.java     |   94 -
 .../README.txt                                  |   25 -
 .../build.properties                            |   23 -
 .../build.xml                                   |   87 -
 .../conf/configurations.properties              |   28 -
 .../airavata/wsmg/samples/util/ConfigKeys.java  |   39 -
 .../airavata/wsmg/samples/wse/Consumer.java     |  147 -
 .../samples/wse/MultipleProducersConsumers.java |   90 -
 .../airavata/wsmg/samples/wse/Producer.java     |  108 -
 .../wse-multiple-producers-consumers/README.txt |   25 -
 .../build.properties                            |   21 -
 .../wse-multiple-producers-consumers/build.xml  |   87 -
 .../conf/configurations.properties              |   28 -
 .../airavata/wsmg/samples/util/ConfigKeys.java  |   39 -
 .../airavata/wsmg/samples/wse/Consumer.java     |  146 -
 .../samples/wse/MultipleProducersConsumers.java |   93 -
 .../airavata/wsmg/samples/wse/Producer.java     |  108 -
 .../messagebroker/wse-round-trip/README.txt     |   26 -
 .../wse-round-trip/build.properties             |   23 -
 .../messagebroker/wse-round-trip/build.xml      |   88 -
 .../conf/configurations.properties              |   27 -
 .../airavata/wsmg/samples/util/ConfigKeys.java  |   38 -
 .../airavata/wsmg/samples/wse/Consumer.java     |  143 -
 .../airavata/wsmg/samples/wse/Producer.java     |   87 -
 .../airavata/wsmg/samples/wse/WSERoundTrip.java |   70 -
 .../wse-topic-subscription/README.txt           |   25 -
 .../wse-topic-subscription/build.properties     |   23 -
 .../wse-topic-subscription/build.xml            |   87 -
 .../conf/configurations.properties              |   28 -
 .../airavata/wsmg/samples/util/ConfigKeys.java  |   37 -
 .../wsmg/samples/wse/TopicSubscribe.java        |   66 -
 .../wse-xpath-subscription/README.txt           |   24 -
 .../wse-xpath-subscription/build.properties     |   23 -
 .../wse-xpath-subscription/build.xml            |   87 -
 .../conf/configurations.properties              |   28 -
 .../airavata/wsmg/samples/util/ConfigKeys.java  |   37 -
 .../wsmg/samples/wse/XpathSubscribe.java        |   67 -
 .../samples/messagebroker/wsmg-gui/README.txt   |   22 -
 .../messagebroker/wsmg-gui/build.properties     |   23 -
 .../samples/messagebroker/wsmg-gui/build.xml    |   51 -
 modules/xbaya-gui/pom.xml                       |  322 --
 .../java/org/apache/airavata/xbaya/XBaya.java   |  315 --
 .../airavata/xbaya/XBayaConfiguration.java      |  974 -----
 .../apache/airavata/xbaya/XBayaConstants.java   |  205 -
 .../org/apache/airavata/xbaya/XBayaEngine.java  |  302 --
 .../org/apache/airavata/xbaya/XBayaVersion.java |   42 -
 .../component/registry/ComponentController.java |   50 -
 .../registry/ComponentRegistryLoader.java       |  195 -
 .../xbaya/concurrent/PredicatedExecutable.java  |   33 -
 .../xbaya/concurrent/PredicatedTaskRunner.java  |  153 -
 .../xbaya/core/amazon/AmazonCredential.java     |   79 -
 .../xbaya/core/amazon/EC2InstanceResult.java    |   94 -
 .../xbaya/core/generators/BPELFiler.java        |  145 -
 .../xbaya/core/generators/ImageFiler.java       |  106 -
 .../xbaya/core/generators/JythonFiler.java      |  128 -
 .../xbaya/core/generators/ODEScriptFiler.java   |  165 -
 .../xbaya/core/generators/ScuflFiler.java       |  127 -
 .../xbaya/core/generators/WorkflowFiler.java    |  267 --
 .../xbaya/core/generators/XmlBeansFiler.java    |   71 -
 .../core/ide/XBayaExecutionModeListener.java    |   34 -
 .../xbaya/core/workflow/ParameterListModel.java |   88 -
 .../xbaya/datadriven/WorkflowHarvester.java     |  191 -
 .../airavata/xbaya/file/XBayaPathConstants.java |   64 -
 .../airavata/xbaya/gfac/GFacRegistryClient.java |  169 -
 .../airavata/xbaya/gfac/SimpleWSClient.java     |  134 -
 .../xbaya/globus/FileTransferConstants.java     |   38 -
 .../xbaya/globus/GridFTPFileTransferClient.java |  238 --
 .../xbaya/graph/controller/NodeController.java  |  199 -
 .../xbaya/interpretor/DoWhileHandler.java       |  251 --
 .../xbaya/interpretor/ExperimentTemplate.java   |   37 -
 .../GUIWorkflowInterpreterInteractorImpl.java   |  211 -
 .../xbaya/interpretor/HeaderConstants.java      |   33 -
 .../SSWorkflowInterpreterInteractorImpl.java    |  118 -
 .../StandaloneNotificationSender.java           |  135 -
 .../interpretor/SystemComponentInvoker.java     |  114 -
 .../WorkFlowInterpreterException.java           |   37 -
 .../interpretor/WorkflowExecutionMessage.java   |   40 -
 .../interpretor/WorkflowExecutionTemplate.java  |   51 -
 .../xbaya/interpretor/WorkflowInterpreter.java  | 1508 -------
 .../WorkflowInterpreterConfiguration.java       |  233 --
 .../WorkflowInterpreterInteractor.java          |   94 -
 .../interpretor/WorkflowInterpreterInvoker.java |   66 -
 .../WorkflowInterpretorEventListener.java       |  387 --
 ...WorkflowInterpretorMessageReceiverInOut.java |  262 --
 .../WorkflowInterpretorSkeleton.java            |  572 ---
 .../xbaya/invoker/AsynchronousInvoker.java      |  118 -
 .../airavata/xbaya/invoker/DynamicInvoker.java  |  167 -
 .../xbaya/invoker/DynamicServiceCreator.java    |   86 -
 .../xbaya/invoker/EmbeddedGFacInvoker.java      |  686 ----
 .../airavata/xbaya/invoker/GFacInvoker.java     |  199 -
 .../airavata/xbaya/invoker/GenericInvoker.java  |  529 ---
 .../apache/airavata/xbaya/invoker/Invoker.java  |  105 -
 .../invoker/MsgBoxWsaResponsesCorrelator.java   |  140 -
 .../airavata/xbaya/invoker/SimpleInvoker.java   |  260 --
 .../xbaya/invoker/WorkflowInputUtil.java        |   84 -
 .../WorkflowInvokerWrapperForGFacInvoker.java   |  233 --
 .../xbaya/invoker/factory/InvokerFactory.java   |   90 -
 .../xbaya/jython/lib/GFacServiceCreator.java    |  168 -
 .../xbaya/jython/lib/NotificationSender.java    |  289 --
 .../xbaya/jython/lib/ServiceNotifiable.java     |   82 -
 .../jython/lib/ServiceNotificationSender.java   |  293 --
 .../StandaloneServiceNotificationSender.java    |   95 -
 .../xbaya/jython/lib/WorkflowNotifiable.java    |   92 -
 .../xbaya/jython/runner/JythonClassLoader.java  |  423 --
 .../jython/runner/JythonOneTimeRunner.java      |   35 -
 .../jython/runner/JythonOneTimeRunnerImpl.java  |   85 -
 .../xbaya/jython/runner/JythonRunner.java       |   73 -
 .../xbaya/jython/script/JythonScript.java       |  671 ---
 .../apache/airavata/xbaya/lead/LEADTypes.java   |  225 -
 .../xbaya/lead/LeadContextHeaderHelper.java     |  155 -
 .../xbaya/lead/NotificationHandler.java         |  190 -
 .../xbaya/menues/tools/ToolsMenuItem.java       |  100 -
 .../registrybrowser/AiravataConfigurations.java |   54 -
 .../ApplicationDeploymentDescriptionWrap.java   |   98 -
 .../ApplicationDeploymentDescriptions.java      |  107 -
 .../registrybrowser/EventingServiceURL.java     |   54 -
 .../registrybrowser/EventingServiceURLs.java    |   54 -
 .../xbaya/model/registrybrowser/GFacURL.java    |   54 -
 .../xbaya/model/registrybrowser/GFacURLs.java   |   56 -
 .../model/registrybrowser/HostDescriptions.java |   50 -
 .../model/registrybrowser/InputParameters.java  |   36 -
 .../registrybrowser/InterpreterServiceURL.java  |   54 -
 .../registrybrowser/InterpreterServiceURLs.java |   56 -
 .../model/registrybrowser/MessageBoxURL.java    |   54 -
 .../model/registrybrowser/MessageBoxURLs.java   |   54 -
 .../model/registrybrowser/NodeParameter.java    |   60 -
 .../model/registrybrowser/OutputParameters.java |   36 -
 .../registrybrowser/ServiceDescriptions.java    |   50 -
 .../registrybrowser/ServiceParameters.java      |   57 -
 .../model/registrybrowser/XBayaWorkflow.java    |   94 -
 .../XBayaWorkflowExperiment.java                |   81 -
 .../XBayaWorkflowExperiments.java               |   65 -
 .../XBayaWorkflowNodeElement.java               |  107 -
 .../registrybrowser/XBayaWorkflowTemplate.java  |   50 -
 .../registrybrowser/XBayaWorkflowTemplates.java |   63 -
 .../xbaya/modifier/WorkflowModifier.java        |  260 --
 .../xbaya/provenance/ProvenanceReader.java      |   64 -
 .../xbaya/provenance/ProvenanceWrite.java       |  217 -
 .../provenance/WorkflowNodeStatusUpdater.java   |  135 -
 .../xbaya/provenance/WorkflowStatusUpdater.java |  103 -
 .../xbaya/registry/PasswordCallbackImpl.java    |   39 -
 .../xbaya/registry/RegistryAccesser.java        |  212 -
 .../nodes/AbstractAiravataTreeNode.java         |  255 --
 .../nodes/AiravataConfigurationsNode.java       |   94 -
 .../nodes/AiravataTreeNodeFactory.java          |  112 -
 .../ApplicationDeploymentDescriptionNode.java   |  131 -
 .../ApplicationDeploymentDescriptionsNode.java  |  139 -
 .../nodes/EventingServiceURLNode.java           |   98 -
 .../nodes/EventingServiceURLsNode.java          |   91 -
 .../registrybrowser/nodes/GFacURLNode.java      |   98 -
 .../registrybrowser/nodes/GFacURLsNode.java     |   91 -
 .../nodes/HostDescriptionNode.java              |  127 -
 .../nodes/HostDescriptionsNode.java             |  131 -
 .../nodes/InputParametersNode.java              |   46 -
 .../nodes/InterpreterServiceURLNode.java        |   98 -
 .../nodes/InterpreterServiceURLsNode.java       |   90 -
 .../registrybrowser/nodes/JCRBrowserIcons.java  |   50 -
 .../nodes/MessageBoxURLNode.java                |   98 -
 .../nodes/MessageBoxURLsNode.java               |   90 -
 .../nodes/OutputParametersNode.java             |   46 -
 .../registrybrowser/nodes/ParameterNode.java    |  136 -
 .../nodes/ParameterValueNode.java               |   90 -
 .../registrybrowser/nodes/ParametersNode.java   |   90 -
 .../registrybrowser/nodes/RegistryNode.java     |  130 -
 .../nodes/RegistryTreeCellRenderer.java         |   43 -
 .../nodes/ServiceDescriptionNode.java           |  142 -
 .../nodes/ServiceDescriptionsNode.java          |  137 -
 .../nodes/XBayaWorkflowExperimentNode.java      |  141 -
 .../nodes/XBayaWorkflowExperimentsNode.java     |   89 -
 .../nodes/XBayaWorkflowNode.java                |  107 -
 .../nodes/XBayaWorkflowNodeElementNode.java     |  101 -
 .../nodes/XBayaWorkflowTemplateNode.java        |  130 -
 .../nodes/XBayaWorkflowTemplatesNode.java       |   99 -
 .../xbaya/scufl/script/ScuflScript.java         |  539 ---
 .../airavata/xbaya/test/BPELScriptTestCase.java |  209 -
 .../airavata/xbaya/test/BrowserTestCase.java    |   38 -
 .../apache/airavata/xbaya/test/DSCTestCase.java |  131 -
 .../airavata/xbaya/test/DSCUtilTestCase.java    |   79 -
 .../xbaya/test/GFacServiceCreaterTestCase.java  |  120 -
 .../airavata/xbaya/test/GraphTestCase.java      |   54 -
 .../airavata/xbaya/test/MetadataTestCase.java   |  221 -
 .../airavata/xbaya/test/MonitorTestCase.java    |   67 -
 .../xbaya/test/ResourceNotifierTestCase.java    |   59 -
 .../airavata/xbaya/test/StringUtilTestCase.java |   55 -
 .../airavata/xbaya/test/WSDLTestCase.java       |   92 -
 .../airavata/xbaya/test/WSDLUtilTestCase.java   |   51 -
 .../airavata/xbaya/test/WSIFTestCase.java       |   53 -
 .../airavata/xbaya/test/WaitDialogTestCase.java |  282 --
 .../WebComponentRegistryClientTestCase.java     |  173 -
 .../test/WorkflowModificationTestCase.java      |  373 --
 .../airavata/xbaya/test/WorkflowTestCase.java   |  120 -
 .../xbaya/test/XBayaSecurityTestCase.java       |   68 -
 .../airavata/xbaya/test/XBayaTestCase.java      |   77 -
 .../apache/airavata/xbaya/test/XppTestCase.java |   71 -
 .../test/jython/JythonClassLoaderTestCase.java  |   44 -
 .../xbaya/test/jython/JythonLibraryTest.java    |  115 -
 .../jython/JythonOneTimeRunnerTestCase.java     |   70 -
 .../xbaya/test/jython/JythonRunnerTestCase.java |   74 -
 .../xbaya/test/jython/JythonScriptTestCase.java |  131 -
 .../xbaya/test/service/AllServices.java         |  115 -
 .../airavata/xbaya/test/service/Service.java    |   44 -
 .../test/service/ServiceNotificationSender.java |  161 -
 .../xbaya/test/service/adder/Adder.java         |   54 -
 .../xbaya/test/service/adder/AdderClient.java   |  114 -
 .../xbaya/test/service/adder/AdderImpl.java     |   79 -
 .../xbaya/test/service/adder/AdderService.java  |  131 -
 .../xbaya/test/service/approver/Approver.java   |   54 -
 .../test/service/approver/ApproverClient.java   |  113 -
 .../test/service/approver/ApproverImpl.java     |   74 -
 .../test/service/approver/ApproverService.java  |  131 -
 .../test/service/arrayadder/ArrayAdder.java     |   54 -
 .../service/arrayadder/ArrayAdderClient.java    |  121 -
 .../test/service/arrayadder/ArrayAdderImpl.java |   83 -
 .../service/arrayadder/ArrayAdderService.java   |  131 -
 .../test/service/arraygen/ArrayGenerator.java   |   54 -
 .../service/arraygen/ArrayGeneratorClient.java  |  113 -
 .../service/arraygen/ArrayGeneratorImpl.java    |   77 -
 .../service/arraygen/ArrayGeneratorService.java |  131 -
 .../airavata/xbaya/test/service/echo/Echo.java  |   54 -
 .../xbaya/test/service/echo/EchoClient.java     |  116 -
 .../xbaya/test/service/echo/EchoImpl.java       |   73 -
 .../xbaya/test/service/echo/EchoService.java    |  113 -
 .../test/service/multiplier/Multiplier.java     |   54 -
 .../test/service/multiplier/MultiplierImpl.java |   80 -
 .../service/multiplier/MultiplierService.java   |  132 -
 .../xbaya/test/util/WorkflowCreator.java        |  741 ----
 .../org/apache/airavata/xbaya/ui/XBayaGUI.java  |  850 ----
 .../ui/actions/AbstractBrowserActionItem.java   |   90 -
 .../ui/actions/registry/browser/AddAction.java  |   43 -
 .../actions/registry/browser/BrowserAction.java |   39 -
 .../ui/actions/registry/browser/CopyAction.java |   39 -
 .../actions/registry/browser/DeleteAction.java  |   42 -
 .../ui/actions/registry/browser/EditAction.java |   39 -
 .../actions/registry/browser/ImportAction.java  |   39 -
 .../actions/registry/browser/RefreshAction.java |   43 -
 .../ui/actions/registry/browser/ViewAction.java |   39 -
 .../airavata/xbaya/ui/dialogs/AboutWindow.java  |  126 -
 .../airavata/xbaya/ui/dialogs/ErrorWindow.java  |  279 --
 .../ui/dialogs/GlobusFileTransferWindow.java    |  258 --
 .../airavata/xbaya/ui/dialogs/TextWindow.java   |  139 -
 .../airavata/xbaya/ui/dialogs/WaitDialog.java   |  140 -
 .../airavata/xbaya/ui/dialogs/XBayaDialog.java  |  267 --
 .../dialogs/amazon/AmazonEC2InvokerWindow.java  |  222 -
 .../ui/dialogs/amazon/AmazonS3UtilsWindow.java  |  312 --
 .../xbaya/ui/dialogs/amazon/BucketsLoader.java  |  123 -
 .../dialogs/amazon/ChangeCredentialWindow.java  |  204 -
 .../amazon/EC2InstancesManagementWindow.java    |  183 -
 .../ui/dialogs/amazon/EC2LaunchWindow.java      |  181 -
 .../ui/dialogs/amazon/InstancesLoader.java      |  105 -
 .../xbaya/ui/dialogs/amazon/S3Downloader.java   |  137 -
 .../xbaya/ui/dialogs/amazon/S3Uploader.java     |  127 -
 .../ui/dialogs/component/URLRegistryWindow.java |  132 -
 .../ui/dialogs/component/WebResigtryWindow.java |  131 -
 ...licationDescriptionAdvancedOptionDialog.java |  358 --
 .../ApplicationDescriptionDialog.java           |  822 ----
 ...tionDescriptionHostAdvancedOptionDialog.java |  459 ---
 .../DeploymentDescriptionDialog.java            |  816 ----
 .../descriptors/DescriptorEditorDialog.java     |  424 --
 .../descriptors/DescriptorListDialog.java       |  261 --
 .../descriptors/HostDeploymentDialog.java       |  617 ---
 .../descriptors/HostDescriptionDialog.java      |  592 ---
 .../descriptors/ServiceDescriptionDialog.java   |  727 ----
 .../amazon/InstanceConfigurationDialog.java     |  224 -
 .../graph/dynamic/DynamicNodeWindow.java        |  472 ---
 .../dynamic/DynamicWorkflowRunnerWindow.java    |  394 --
 .../system/ConstantConfigurationDialog.java     |  213 -
 .../DifferedInputConfigurationDialog.java       |  263 --
 .../graph/system/DoWhileConfigrationDialog.java |  189 -
 .../system/EndBlockConfigurationDialog.java     |  163 -
 .../system/EndDoWhileConfigurationDialog.java   |  172 -
 .../system/EndForEachConfigurationDialog.java   |  161 -
 .../graph/system/EndifConfigurationDialog.java  |  163 -
 .../system/ForEachConfigurationDialog.java      |  161 -
 .../graph/system/IfConfigurationDialog.java     |  190 -
 .../graph/system/InputConfigurationDialog.java  |  261 --
 .../graph/system/MemoConfigurationDialog.java   |  115 -
 .../graph/system/OutputConfigurationDialog.java |  172 -
 .../system/ReceiveConfigurationDialog.java      |  161 -
 .../ui/dialogs/graph/system/S3FileChooser.java  |  193 -
 .../system/StreamSourceConfigurationDialog.java |  129 -
 .../graph/ws/ServiceInteractionWindow.java      |  132 -
 .../xbaya/ui/dialogs/graph/ws/WSNodeWindow.java |  140 -
 .../monitor/MonitorConfigurationWindow.java     |  196 -
 .../xbaya/ui/dialogs/monitor/MonitorWindow.java |  178 -
 .../dialogs/registry/NewRegistryUserDialog.java |  305 --
 .../ui/dialogs/registry/RegistryWindow.java     |  313 --
 .../registry/browser/JCRBrowserDialog.java      |  117 -
 .../workflow/ParameterPropertyWindow.java       |  170 -
 .../workflow/WorkflowPropertyWindow.java        |  216 -
 .../xbaya/ui/experiment/ExperimentMenu.java     |  110 -
 .../ui/experiment/RegistryLoaderWindow.java     |  239 --
 .../ui/experiment/RegistrySearchResult.java     |  131 -
 .../RegistryWorkflowPublisherWindow.java        |  144 -
 .../WorkflowInterpreterLaunchWindow.java        |  350 --
 .../apache/airavata/xbaya/ui/graph/EdgeGUI.java |  142 -
 .../airavata/xbaya/ui/graph/GraphCanvas.java    | 1375 -------
 .../xbaya/ui/graph/GraphCanvasEvent.java        |   99 -
 .../xbaya/ui/graph/GraphCanvasListener.java     |   32 -
 .../airavata/xbaya/ui/graph/GraphGUI.java       |  198 -
 .../airavata/xbaya/ui/graph/GraphPieceGUI.java  |   36 -
 .../apache/airavata/xbaya/ui/graph/NodeGUI.java |  535 ---
 .../airavata/xbaya/ui/graph/Paintable.java      |   35 -
 .../apache/airavata/xbaya/ui/graph/PortGUI.java |  274 --
 .../xbaya/ui/graph/amazon/InstanceNodeGUI.java  |  166 -
 .../graph/amazon/TerminateInstanceNodeGUI.java  |  160 -
 .../xbaya/ui/graph/dynamic/DynamicNodeGUI.java  |   73 -
 .../graph/subworkflow/SubWorkflowNodeGUI.java   |   89 -
 .../xbaya/ui/graph/system/BlockNodeGUI.java     |   87 -
 .../ui/graph/system/ConfigurableNodeGUI.java    |  140 -
 .../xbaya/ui/graph/system/ConstantNodeGUI.java  |   63 -
 .../ui/graph/system/DifferedInputHandler.java   |   87 -
 .../ui/graph/system/DifferedInputNodeGUI.java   |  101 -
 .../xbaya/ui/graph/system/DoWhileNodeGUI.java   |  191 -
 .../xbaya/ui/graph/system/EndBlockNodeGUI.java  |  176 -
 .../ui/graph/system/EndDoWhileNodeGUI.java      |  178 -
 .../ui/graph/system/EndForEachNodeGUI.java      |  148 -
 .../xbaya/ui/graph/system/EndifNodeGUI.java     |  176 -
 .../xbaya/ui/graph/system/ExitNodeGUI.java      |   98 -
 .../xbaya/ui/graph/system/ForEachNodeGUI.java   |  155 -
 .../xbaya/ui/graph/system/IfNodeGUI.java        |  183 -
 .../xbaya/ui/graph/system/InputNodeGUI.java     |   81 -
 .../xbaya/ui/graph/system/MemoNodeGUI.java      |  107 -
 .../xbaya/ui/graph/system/OutputNodeGUI.java    |   91 -
 .../xbaya/ui/graph/system/ReceiveNodeGUI.java   |  150 -
 .../xbaya/ui/graph/system/S3InputNodeGUI.java   |   81 -
 .../ui/graph/system/StreamSourceNodeGUI.java    |   73 -
 .../airavata/xbaya/ui/graph/ws/WSNodeGUI.java   |  156 -
 .../xbaya/ui/graph/ws/WorkflowNodeGUI.java      |   74 -
 .../xbaya/ui/menues/AmazonEC2MenuItem.java      |  160 -
 .../airavata/xbaya/ui/menues/EditMenuItem.java  |  169 -
 .../airavata/xbaya/ui/menues/MenuIcons.java     |   39 -
 .../xbaya/ui/menues/RegistryMenuItem.java       |  118 -
 .../airavata/xbaya/ui/menues/RunMenuItem.java   |  412 --
 .../airavata/xbaya/ui/menues/ViewMenuItem.java  |  140 -
 .../airavata/xbaya/ui/menues/XBayaMenu.java     |  158 -
 .../airavata/xbaya/ui/menues/XBayaMenuItem.java |  610 ---
 .../xbaya/ui/monitor/MonitorEventHandler.java   |  547 ---
 .../xbaya/ui/monitor/MonitorStarter.java        |  125 -
 .../xbaya/ui/monitor/ResourcePaintable.java     |   65 -
 .../airavata/xbaya/ui/utils/Cancelable.java     |   30 -
 .../airavata/xbaya/ui/utils/DrawUtils.java      |  108 -
 .../airavata/xbaya/ui/utils/ErrorMessages.java  |  240 --
 .../xbaya/ui/views/ComponentViewer.java         |  139 -
 .../xbaya/ui/views/JCRBrowserPanel.java         |  287 --
 .../airavata/xbaya/ui/views/MonitorPanel.java   |  307 --
 .../xbaya/ui/views/ParameterPropertyPanel.java  |  194 -
 .../airavata/xbaya/ui/views/PortViewer.java     |  167 -
 .../airavata/xbaya/ui/widgets/GridPanel.java    |  165 -
 .../airavata/xbaya/ui/widgets/ScrollPanel.java  |  124 -
 .../xbaya/ui/widgets/TabLabelButton.java        |  142 -
 .../xbaya/ui/widgets/TableRenderable.java       |   31 -
 .../xbaya/ui/widgets/ToolbarButton.java         |  109 -
 .../xbaya/ui/widgets/XBayaComboBox.java         |  100 -
 .../xbaya/ui/widgets/XBayaComponent.java        |   35 -
 .../airavata/xbaya/ui/widgets/XBayaLabel.java   |   95 -
 .../xbaya/ui/widgets/XBayaLinkButton.java       |  306 --
 .../airavata/xbaya/ui/widgets/XBayaList.java    |  169 -
 .../xbaya/ui/widgets/XBayaTextArea.java         |  120 -
 .../xbaya/ui/widgets/XBayaTextComponent.java    |   37 -
 .../xbaya/ui/widgets/XBayaTextField.java        |  124 -
 .../airavata/xbaya/ui/widgets/XBayaToolBar.java |  362 --
 .../xbaya/ui/widgets/XbayaEnhancedList.java     |  308 --
 .../xbaya/ui/widgets/amazon/S3Tree.java         |  133 -
 .../xbaya/ui/widgets/amazon/S3TreeModel.java    |   65 -
 .../ui/widgets/component/ComponentSelector.java |  530 ---
 .../component/ComponentSelectorEvent.java       |   85 -
 .../component/ComponentSelectorListener.java    |   32 -
 .../component/ComponentSourceTransferable.java  |   73 -
 .../widgets/component/ComponentTreeModel.java   |   71 -
 .../ui/widgets/component/ComponentTreeNode.java |  107 -
 .../apache/airavata/xbaya/util/AmazonUtil.java  |  150 -
 .../org/apache/airavata/xbaya/util/Data.java    |   70 -
 .../apache/airavata/xbaya/util/GOConstants.java |   30 -
 .../airavata/xbaya/util/GlobusOnlineUtils.java  |  245 --
 .../airavata/xbaya/util/InterpreterUtil.java    |  391 --
 .../airavata/xbaya/util/RegistryConstants.java  |   30 -
 .../airavata/xbaya/util/TransferFile.java       |  170 -
 .../apache/airavata/xbaya/util/XBayaUtil.java   |  353 --
 .../airavata/xbaya/workflow/WorkflowClient.java |  246 --
 .../xbaya/workflow/WorkflowEngineException.java |   42 -
 .../xbaya/workflow/proxy/ProxyWSDL.java         |   87 -
 .../xbaya/workflow/proxy/WorkflowClient.java    |   35 -
 .../xbaya/workflow/proxy/WorkflowContext.java   |   42 -
 .../workflow/proxy/WorkflowProxyException.java  |   64 -
 .../src/main/resources/WorkflowInterpretor.wsdl |   72 -
 .../src/main/resources/images/airavata-2.png    |  Bin 5582 -> 0 bytes
 .../main/resources/images/airavata-config.png   |  Bin 1297 -> 0 bytes
 .../src/main/resources/images/airavata-icon.png |  Bin 584 -> 0 bytes
 .../main/resources/images/airavata-icon2.png    |  Bin 981 -> 0 bytes
 .../src/main/resources/images/airavata-name.png |  Bin 8261 -> 0 bytes
 .../resources/images/airavata-title-text.png    |  Bin 16438 -> 0 bytes
 .../src/main/resources/images/airavata.png      |  Bin 17280 -> 0 bytes
 .../src/main/resources/images/application.png   |  Bin 894 -> 0 bytes
 .../src/main/resources/images/applications.png  |  Bin 657 -> 0 bytes
 .../src/main/resources/images/closed.gif        |  Bin 923 -> 0 bytes
 .../src/main/resources/images/cloud.png         |  Bin 573 -> 0 bytes
 .../src/main/resources/images/experiment.png    |  Bin 543 -> 0 bytes
 .../src/main/resources/images/experiments.png   |  Bin 1142 -> 0 bytes
 .../src/main/resources/images/gfac_url.png      |  Bin 739 -> 0 bytes
 .../src/main/resources/images/gfac_urls.png     |  Bin 816 -> 0 bytes
 .../src/main/resources/images/host.png          |  Bin 652 -> 0 bytes
 .../src/main/resources/images/hosts.png         |  Bin 671 -> 0 bytes
 .../src/main/resources/images/input_para.png    |  Bin 428 -> 0 bytes
 .../src/main/resources/images/jcr-repo.png      |  Bin 1010 -> 0 bytes
 .../src/main/resources/images/leaf.gif          |  Bin 906 -> 0 bytes
 .../src/main/resources/images/menu/jcr.png      |  Bin 1158 -> 0 bytes
 .../src/main/resources/images/menu/new2.png     |  Bin 1175 -> 0 bytes
 .../src/main/resources/images/menu/open1.png    |  Bin 925 -> 0 bytes
 .../src/main/resources/images/menu/open2.png    |  Bin 964 -> 0 bytes
 .../src/main/resources/images/menu/open_dir.png |  Bin 749 -> 0 bytes
 .../src/main/resources/images/menu/pause1.png   |  Bin 1101 -> 0 bytes
 .../resources/images/menu/pause_monitor1.png    |  Bin 873 -> 0 bytes
 .../src/main/resources/images/menu/play3.png    |  Bin 1192 -> 0 bytes
 .../src/main/resources/images/menu/play4.png    |  Bin 765 -> 0 bytes
 .../images/menu/resume_monitoring1.png          |  Bin 957 -> 0 bytes
 .../src/main/resources/images/menu/save1.png    |  Bin 1200 -> 0 bytes
 .../src/main/resources/images/menu/stop.png     |  Bin 316 -> 0 bytes
 .../src/main/resources/images/opened.gif        |  Bin 917 -> 0 bytes
 .../src/main/resources/images/output_para.png   |  Bin 490 -> 0 bytes
 .../src/main/resources/images/parameter.png     |  Bin 544 -> 0 bytes
 .../src/main/resources/images/pause.jpeg        |  Bin 458 -> 0 bytes
 .../src/main/resources/images/play.jpeg         |  Bin 471 -> 0 bytes
 .../src/main/resources/images/registry.png      |  Bin 3419 -> 0 bytes
 .../src/main/resources/images/service.png       |  Bin 871 -> 0 bytes
 .../src/main/resources/images/services.png      |  Bin 899 -> 0 bytes
 .../src/main/resources/images/step.gif          |  Bin 211 -> 0 bytes
 .../src/main/resources/images/stop.jpeg         |  Bin 497 -> 0 bytes
 .../src/main/resources/images/workflow.png      |  Bin 601 -> 0 bytes
 .../resources/images/workflow_templates.png     |  Bin 710 -> 0 bytes
 .../src/main/resources/images/workflows.png     |  Bin 778 -> 0 bytes
 .../xbaya-gui/src/main/resources/services.xml   |   30 -
 .../resources/wsdls/TestCMD_Example1_AWSDL.xml  |   56 -
 .../src/main/resources/wsdls/adder-awsdl.xml    |   63 -
 .../src/main/resources/wsdls/eventing.wsdl      |  332 --
 .../interpreter/ComplexForEachWorkflowTest.java |   73 -
 .../xbaya/interpreter/ComplexMathService.java   |   40 -
 .../interpreter/ComplexMathWorkflowTest.java    |   71 -
 .../interpreter/CrossProductWorkflowTest.java   |   71 -
 .../airavata/xbaya/interpreter/EchoService.java |   28 -
 .../xbaya/interpreter/ForEachWorkflowTest.java  |   73 -
 .../interpreter/LevenshteinDistanceService.java |   48 -
 .../airavata/xbaya/interpreter/Listener.java    |   31 -
 .../xbaya/interpreter/NotificationSender.java   |  204 -
 .../xbaya/interpreter/RegistryServiceTest.java  |  105 -
 .../interpreter/SimpleForEachWorkflowTest.java  |   72 -
 .../interpreter/SimpleMathWorkflowTest.java     |   73 -
 .../xbaya/interpreter/WorkflowTest.java         |   74 -
 .../xbaya/interpreter/WorkflowTrackingTest.java |  105 -
 .../xbaya/interpreter/XBayaClientTest.java      |   80 -
 .../interpreter/XBayaConsolidatedTestSuite.java |   67 -
 .../xbaya/interpreter/utils/ConfigKeys.java     |   34 -
 .../xbaya/interpreter/utils/TestUtilServer.java |  243 --
 .../interpreter/utils/WorkflowTestUtils.java    |   97 -
 modules/xbaya-gui/src/test/java/test.xwf        |  251 --
 .../src/test/resources/axis2_default.xml        |  278 --
 pom.xml                                         |    4 -
 .../airavata-client/create-application/README   |   24 -
 .../create-application/build.xml                |   50 -
 .../airavata-client/create-application/pom.xml  |  118 -
 .../airavata/api/samples/CreateApplication.java |  160 -
 .../main/resources/airavata-client.properties   |   61 -
 samples/airavata-client/pom.xml                 |   29 -
 samples/airavata-client/workflow-run/README     |   24 -
 samples/airavata-client/workflow-run/build.xml  |   50 -
 samples/airavata-client/workflow-run/pom.xml    |  118 -
 .../client/samples/MonitorListener.java         |   83 -
 .../client/samples/MonitorWorkflow.java         |   50 -
 .../airavata/client/samples/RunWorkflow.java    |  159 -
 .../src/main/resources/EchoWorkflow.xwf         |  149 -
 .../main/resources/airavata-client.properties   |   61 -
 .../application-emulators/MockPwscf/Pwscf_Input |   44 -
 .../MockPwscf/Pwscf_Output                      |   30 -
 samples/application-emulators/MockPwscf/README  |   59 -
 .../application-emulators/MockPwscf/pseudo_1    |   25 -
 .../application-emulators/MockPwscf/pseudo_2    |   25 -
 samples/application-emulators/MockPwscf/pwscf.c |  140 -
 samples/application-emulators/mpi/README        |   52 -
 .../application-emulators/mpi/mpi-hello-world.c |   37 -
 .../application-emulators/parameter-app/README  |   36 -
 samples/applications/echo.bat                   |   18 -
 samples/applications/echo.sh                    |   22 -
 samples/applications/echo_out.sh                |   21 -
 samples/complex-math-service/README.txt         |    7 -
 samples/complex-math-service/pom.xml            |   58 -
 .../airavata/samples/ComplexMathService.java    |   40 -
 .../src/main/resources/ComplexMathService.wsdl  |  140 -
 .../src/main/resources/services.xml             |   18 -
 samples/distribution/pom.xml                    |  101 -
 .../src/main/assembly/bin-assembly.xml          |  101 -
 samples/distribution/src/main/resources/INSTALL |   55 -
 samples/distribution/src/main/resources/LICENSE | 2273 -----------
 samples/distribution/src/main/resources/NOTICE  |  163 -
 samples/distribution/src/main/resources/README  |  121 -
 samples/echo-service/README.txt                 |    7 -
 samples/echo-service/pom.xml                    |   58 -
 .../apache/airavata/samples/EchoService.java    |   28 -
 .../src/main/resources/services.xml             |   18 -
 samples/gateway-developer-guide/README.txt      |    7 -
 samples/gateway-developer-guide/pom.xml         |   75 -
 .../airavata/samples/MonitorListener.java       |   84 -
 .../airavata/samples/PasswordCallbackImpl.java  |   39 -
 .../apache/airavata/samples/SimpleGateway.java  |  328 --
 .../src/main/resources/EchoWorkflow.xwf         |  149 -
 .../src/main/resources/SimpleEcho.xwf           |  404 --
 .../main/resources/airavata-client.properties   |   66 -
 .../src/main/resources/gateway.properties       |   24 -
 .../src/main/resources/log4j.properties         |   34 -
 samples/levenshtein-distance-service/README.txt |    7 -
 samples/levenshtein-distance-service/pom.xml    |   58 -
 .../samples/LevenshteinDistanceService.java     |   48 -
 .../resources/LevenshteinDistanceService.wsdl   |   88 -
 .../src/main/resources/services.xml             |   18 -
 samples/pom.xml                                 |   48 -
 samples/provenance-registry-handler/pom.xml     |   39 -
 .../CustomProvenanceDataHandler.java            |  306 --
 samples/sample-gateway/pom.xml                  |   67 -
 .../configurations/airavata-server.properties   |  220 -
 .../src/configurations/client.xml               |   35 -
 .../src/configurations/oauth-privkey.pk8        |   28 -
 .../src/configurations/oauth-pubkey.pem         |    9 -
 .../sample/gateway/ExecutionParameters.java     |  172 -
 .../airavata/sample/gateway/SampleGateway.java  |  176 -
 .../gateway/executor/PasswordCallbackImpl.java  |   54 -
 .../gateway/executor/WorkflowExecutor.java      |  304 --
 .../gateway/userstore/GatewayUserStore.java     |  448 --
 .../airavata/sample/gateway/userstore/User.java |   68 -
 .../src/main/resources/EchoWorkflow.xwf         |  149 -
 .../main/resources/airavata-client.properties   |   70 -
 .../src/main/resources/gateway.properties       |   23 -
 .../src/main/webapp/WEB-INF/web.xml             |   48 -
 .../src/main/webapp/gateway/acs.jsp             |   62 -
 .../src/main/webapp/gateway/callback.jsp        |   78 -
 .../src/main/webapp/gateway/job.jsp             |   95 -
 .../src/main/webapp/gateway/job_execute.jsp     |  120 -
 .../src/main/webapp/gateway/list_users.jsp      |   78 -
 .../src/main/webapp/gateway/logout.jsp          |   35 -
 .../src/main/webapp/gateway/user.jsp            |  102 -
 .../src/main/webapp/images/echowf.png           |  Bin 18770 -> 0 bytes
 .../sample-gateway/src/main/webapp/index.jsp    |   53 -
 .../gateway/executor/WorkflowExecutorTest.java  |  150 -
 samples/simple-math-service/README.txt          |    7 -
 samples/simple-math-service/pom.xml             |   65 -
 .../airavata/samples/SimpleMathService.java     |   81 -
 .../src/main/resources/SimpleMathService.wsdl   |  354 --
 .../src/main/resources/services.xml             |   20 -
 .../simple-service-tracking/README.txt          |   26 -
 .../simple-service-tracking/build.properties    |   25 -
 .../simple-service-tracking/build.xml           |   78 -
 .../conf/configuration.properties               |   24 -
 .../samples/invoke/NotificationSender.java      |  210 -
 .../samples/invoke/SimpleWorkflowTracker.java   |   94 -
 .../samples/util/ConfigKeys.java                |   34 -
 .../workflowtracking/samples/util/Listener.java |   33 -
 samples/workflows/ComplexForEach.xwf            | 3863 ------------------
 samples/workflows/ComplexMath.xwf               | 1880 ---------
 samples/workflows/LevenshteinDistance.xwf       |  844 ----
 samples/workflows/SimpleEcho.xwf                |  404 --
 samples/workflows/SimpleForEach.xwf             |  887 ----
 samples/workflows/SimpleMath.xwf                | 1863 ---------
 875 files changed, 133865 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/commons/json/pom.xml
----------------------------------------------------------------------
diff --git a/modules/commons/json/pom.xml b/modules/commons/json/pom.xml
deleted file mode 100644
index 4697998..0000000
--- a/modules/commons/json/pom.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <parent>
-        <artifactId>commons</artifactId>
-        <groupId>org.apache.airavata</groupId>
-        <version>0.12-SNAPSHOT</version>
-    </parent>
-    <modelVersion>4.0.0</modelVersion>
-
-    <artifactId>json</artifactId>
-    <packaging>jar</packaging>
-    <name>Airavata JSON </name>
-    <url>http://airavata.apache.org/</url>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-kernel</artifactId>
-            <version>${axis2.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>de.odysseus.staxon</groupId>
-            <artifactId>staxon</artifactId>
-            <version>1.2</version>
-        </dependency>
-        <dependency>
-            <groupId>de.odysseus.staxon</groupId>
-            <artifactId>staxon-jackson</artifactId>
-            <version>1.2</version>
-        </dependency>
-
-
-    </dependencies>
-
-</project>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/commons/json/src/main/java/org/apache/airavata/json/StaxonJSONBuilder.java
----------------------------------------------------------------------
diff --git a/modules/commons/json/src/main/java/org/apache/airavata/json/StaxonJSONBuilder.java b/modules/commons/json/src/main/java/org/apache/airavata/json/StaxonJSONBuilder.java
deleted file mode 100644
index 505c423..0000000
--- a/modules/commons/json/src/main/java/org/apache/airavata/json/StaxonJSONBuilder.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.json;
-
-import de.odysseus.staxon.json.JsonXMLConfig;
-import de.odysseus.staxon.json.JsonXMLConfigBuilder;
-import de.odysseus.staxon.json.JsonXMLInputFactory;
-import org.apache.axiom.om.OMAbstractFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.soap.SOAPBody;
-import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.builder.Builder;
-import org.apache.axis2.context.MessageContext;
-
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.InputStream;
-
-
-public class StaxonJSONBuilder implements Builder {
-    @Override
-    public OMElement processDocument(InputStream inputStream, String s, MessageContext messageContext) throws AxisFault {
-        SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        SOAPEnvelope envelope = factory.createSOAPEnvelope();
-        // configure JSON to XML conversion property
-        JsonXMLConfig config = new JsonXMLConfigBuilder().multiplePI(false).prettyPrint(false).build();
-        //
-        try {
-            String charSetEncoding = (String) messageContext.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
-            XMLStreamReader reader = new JsonXMLInputFactory(config).createXMLStreamReader(inputStream, charSetEncoding);
-            StAXOMBuilder stAXOMBuilder = new StAXOMBuilder(reader);
-            OMElement message = stAXOMBuilder.getDocumentElement();
-            envelope.getBody().addChild(message);
-        } catch (XMLStreamException e) {
-            throw new AxisFault("Error while creating XMLStreamReader with JsonXMLInputFactory");
-        }
-        return envelope;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/commons/json/src/main/java/org/apache/airavata/json/StaxonJSONFormatter.java
----------------------------------------------------------------------
diff --git a/modules/commons/json/src/main/java/org/apache/airavata/json/StaxonJSONFormatter.java b/modules/commons/json/src/main/java/org/apache/airavata/json/StaxonJSONFormatter.java
deleted file mode 100644
index dc42e78..0000000
--- a/modules/commons/json/src/main/java/org/apache/airavata/json/StaxonJSONFormatter.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.json;
-
-import de.odysseus.staxon.json.JsonXMLConfig;
-import de.odysseus.staxon.json.JsonXMLConfigBuilder;
-import de.odysseus.staxon.json.JsonXMLOutputFactory;
-import de.odysseus.staxon.json.stream.jackson.JacksonStreamFactory;
-import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.transport.MessageFormatter;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-import javax.xml.transform.*;
-import javax.xml.transform.stax.StAXResult;
-import javax.xml.transform.stax.StAXSource;
-import java.io.OutputStream;
-import java.net.URL;
-
-public class StaxonJSONFormatter implements MessageFormatter {
-    @Override
-    public byte[] getBytes(MessageContext messageContext, OMOutputFormat omOutputFormat) throws AxisFault {
-        return new byte[0];
-    }
-
-    @Override
-    public void writeTo(MessageContext messageContext, OMOutputFormat omOutputFormat, OutputStream outputStream,
-                        boolean preserve) throws AxisFault {
-        String charSetEncoding = (String) messageContext.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);
-        JsonXMLConfig config = new JsonXMLConfigBuilder()
-                .autoArray(true)
-                .autoPrimitive(true)
-                .prettyPrint(true)
-                .build();
-
-
-
-        try {
-            OMElement outMessage = messageContext.getEnvelope().getBody().getFirstElement();
-            XMLStreamReader reader = null;
-            if (preserve) {
-                // do not consume the OM
-                reader = outMessage.getXMLStreamReader();
-            }else{
-                // consume the OM
-                reader = outMessage.getXMLStreamReaderWithoutCaching();
-            }
-            Source source = new StAXSource(reader);
-
-            XMLStreamWriter writer = new JsonXMLOutputFactory(config, new JacksonStreamFactory())
-                    .createXMLStreamWriter(outputStream, charSetEncoding);
-            Result result = new StAXResult(writer);
-            String backupProp = System.getProperty("javax.xml.transform.TransformerFactory");
-            System.setProperty("javax.xml.transform.TransformerFactory",
-                    "com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
-            TransformerFactory.newInstance().newTransformer().transform(source, result);
-            System.setProperty("javax.xml.transform.TransformerFactory", backupProp);
-        } catch (XMLStreamException e) {
-            throw new AxisFault("Error while writing OMElement to output writer ", e);
-        } catch (TransformerConfigurationException e) {
-            throw new AxisFault("StaxonJSONFormatter threw an error while writing to output ",e);
-        } catch (TransformerException e) {
-            throw new AxisFault("StaxonJSONFormatter threw an error while writing to output",e);
-        }
-
-    }
-
-    @Override
-    public String getContentType(MessageContext messageContext, OMOutputFormat omOutputFormat, String s) {
-        return (String) messageContext.getProperty(Constants.Configuration.CONTENT_TYPE);
-    }
-
-    @Override
-    public URL getTargetAddress(MessageContext messageContext, OMOutputFormat omOutputFormat, URL url) throws AxisFault {
-        return null;
-    }
-
-    @Override
-    public String formatSOAPAction(MessageContext messageContext, OMOutputFormat omOutputFormat, String s) {
-        return null;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/commons/pom.xml
----------------------------------------------------------------------
diff --git a/modules/commons/pom.xml b/modules/commons/pom.xml
index e53c3d0..8c55a9f 100644
--- a/modules/commons/pom.xml
+++ b/modules/commons/pom.xml
@@ -34,7 +34,6 @@
                 <module>gfac-schema</module>
                 <module>utils</module>
                 <module>workflow-execution-context</module>
-                <!--module>json</module-->
             </modules>
         </profile>
     </profiles>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/pom.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/pom.xml b/modules/distribution/pom.xml
index f236ce9..7ee358f 100644
--- a/modules/distribution/pom.xml
+++ b/modules/distribution/pom.xml
@@ -30,7 +30,6 @@
             <modules>
                 <module>airavata-server</module>
                 <module>airavata-client</module>
-                <!--module>xbaya-gui</module-->
 		<module>release</module>
             </modules>
         </profile>

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/distribution/xbaya-gui/pom.xml
----------------------------------------------------------------------
diff --git a/modules/distribution/xbaya-gui/pom.xml b/modules/distribution/xbaya-gui/pom.xml
deleted file mode 100644
index e3e185f..0000000
--- a/modules/distribution/xbaya-gui/pom.xml
+++ /dev/null
@@ -1,558 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!--Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file 
-    distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under 
-    the Apache License, Version 2.0 (theÏ "License"); you may not use this file except in compliance with the License. You may 
-    obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to 
-    in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 
-    ANY ~ KIND, either express or implied. See the License for the specific language governing permissions and limitations under 
-    the License. -->
-
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <parent>
-        <groupId>org.apache.airavata</groupId>
-        <artifactId>distribution</artifactId>
-        <version>0.12-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-    <artifactId>apache-airavata-xbaya-gui</artifactId>
-    <name>Airavata xbaya-gui distribution</name>
-    <packaging>pom</packaging>
-    <url>http://airavata.apache.org/</url>
-
-    <profiles>
-        <profile>
-            <id>default</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-compiler-plugin</artifactId>
-                        <configuration>
-                            <encoding>UTF-8</encoding>
-                            <source>1.6</source>
-                            <target>1.6</target>
-                        </configuration>
-                        <executions>
-                            <execution>
-                                <id>default</id>
-                                <phase>compile</phase>
-                                <goals>
-                                    <goal>compile</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-		    <plugin>
-		        <groupId>org.apache.maven.plugins</groupId>
-		        <artifactId>maven-dependency-plugin</artifactId>
-		        <version>2.8</version>
-		        <executions>
-		            <execution>
-		                <id>unpack</id>
-		                <phase>compile</phase>
-		                <goals>
-		                    <goal>unpack</goal>
-		                </goals>
-		                <configuration>
-		                    <artifactItems>
-		                        <artifactItem>
-		                            <groupId>org.apache.airavata</groupId>
-		                            <artifactId>airavata-client-configuration</artifactId>
-		                            <version>${project.version}</version>
-		                            <type>jar</type>
-		                        </artifactItem>
-		                    </artifactItems>
-		                    <outputDirectory>${project.build.directory}/conf</outputDirectory>
-		                </configuration>
-		            </execution>
-		        </executions>
-		    </plugin>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-assembly-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <id>distribution-package</id>
-                                <phase>compile</phase>
-                                <goals>
-                                    <goal>single</goal>
-                                </goals>
-                                <configuration>
-                                    <finalName>${archieve.name}-${project.version}</finalName>
-                                    <descriptors>
-                                        <descriptor>src/main/assembly/bin-assembly.xml</descriptor>
-                                    </descriptors>
-                                    <attach>false</attach>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>build-helper-maven-plugin</artifactId>
-                        <version>1.7</version>
-                        <executions>
-                            <execution>
-                                <id>bin-artifacts</id>
-                                <phase>package</phase>
-                                <goals>
-                                    <goal>attach-artifact</goal>
-                                </goals>
-                                <configuration>
-                                    <artifacts>
-                                        <artifact>
-                                            <file>${airavata.xbaya-bin.zip}</file>
-                                            <type>zip</type>
-                                            <classifier>bin</classifier>
-                                        </artifact>
-                                        <artifact>
-                                            <file>${airavata.xbaya-bin.tar.gz}</file>
-                                            <type>tar.gz</type>
-                                            <classifier>bin</classifier>
-                                        </artifact>
-                                    </artifacts>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-        <profile> <!-- JNLP -->
-            <id>jnlp</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-antrun-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <id>0-copy-xbaya</id>
-                                <phase>compile</phase>
-                                <configuration>
-                                    <target>
-                                        <taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="maven.dependency.classpath" />
-                                        <unzip src="target/apache-airavata-xbaya-gui-${project.version}-bin.zip" dest="${project.build.directory}/temp" />
-                                        <mkdir dir="${jnlp.direcotry}" />
-                                        <mkdir dir="${jnlp.direcotry}/lib" />
-                                        <copy todir="${jnlp.direcotry}/lib">
-                                            <fileset dir="${xbaya.directory}/lib" />
-                                        </copy>
-                                        <copy todir="${jnlp.direcotry}">
-                                            <fileset dir="${project.basedir}/src/main/resources/jnlp" />
-                                        </copy>
-                                        <copy file="${project.basedir}/src/main/resources/airavata-logo.gif" todir="${jnlp.direcotry}" />
-                                    </target>
-                                </configuration>
-                                <goals>
-                                    <goal>run</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                    <plugin>
-                        <groupId>org.apache.maven.plugins</groupId>
-                        <artifactId>maven-jarsigner-plugin</artifactId>
-                        <version>1.2</version>
-                        <executions>
-                            <execution>
-                                <id>1-sign</id>
-                                <phase>compile</phase>
-                                <goals>
-                                    <goal>sign</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                        <configuration>
-                            <archiveDirectory>${jnlp.direcotry}/lib</archiveDirectory>
-                            <keystore>${project.basedir}/src/main/resources/xbaya.jks</keystore>
-                            <alias>xbaya</alias>
-                            <storepass>xbaya-secret</storepass>
-                            <keypass>xbaya-secret</keypass>
-                        </configuration>
-                    </plugin>
-                    <plugin>
-                        <groupId>org.codehaus.mojo</groupId>
-                        <artifactId>exec-maven-plugin</artifactId>
-                        <version>1.1.1</version>
-                        <executions>
-                            <execution>
-                                <id>2-execute-jnlp-modifier</id>
-                                <phase>compile</phase>
-                                <goals>
-                                    <goal>java</goal>
-                                </goals>
-                                <configuration>
-                                    <mainClass>org.apache.airavata.distribution.xbaya.jnlp.Main</mainClass>
-                                    <arguments>
-                                        <argument>${jnlp.direcotry}/lib</argument>
-                                        <argument>${jnlp.direcotry}/xbaya.jnlp</argument>
-                                    </arguments>
-                                </configuration>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile>
-        <profile>
-            <id>zip-jnlp</id>
-            <activation>
-                <activeByDefault>true</activeByDefault>
-            </activation>
-            <build>
-                <plugins>
-                    <plugin>
-                        <artifactId>maven-antrun-plugin</artifactId>
-                        <executions>
-                            <execution>
-                                <id>3-zip-xbaya-jnlp</id>
-                                <phase>package</phase>
-                                <configuration>
-                                    <target>
-                                        <zip destfile="${airavata.xbaya-jnlp.zip}" basedir="${jnlp.direcotry}" />
-                                        <tar destfile="${project.build.directory}/xbaya-jnlp-${project.version}.tar" basedir="${jnlp.direcotry}" />
-                                        <gzip destfile="${airavata.xbaya-jnlp.tar.gz}" src="${project.build.directory}/xbaya-jnlp-${project.version}.tar" />
-                                        <delete file="${project.build.directory}/xbaya-jnlp-${project.version}.tar" />
-                                    </target>
-                                </configuration>
-                                <goals>
-                                    <goal>run</goal>
-                                </goals>
-                            </execution>
-                        </executions>
-                    </plugin>
-                </plugins>
-            </build>
-        </profile> <!-- END JNLP -->
-    </profiles>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>xpp3</artifactId>
-            <version>${xpp3.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>xpp5</artifactId>
-            <version>${xpp5.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>xsul</artifactId>
-            <version>${xsul.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>gpel-client</artifactId>
-            <version>${gpel.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.ogce</groupId>
-            <artifactId>atomixmiser</artifactId>
-            <version>${atomixmiser.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>commons-httpclient</groupId>
-            <artifactId>commons-httpclient</artifactId>
-            <version>3.1</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>commons-codec</groupId>
-                    <artifactId>commons-codec</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>commons-codec</groupId>
-            <artifactId>commons-codec</artifactId>
-            <version>1.6</version>
-        </dependency>
-        <dependency>
-            <groupId>org.python</groupId>
-            <artifactId>jython</artifactId>
-            <version>${jython.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>${junit.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.xmlbeans</groupId>
-            <artifactId>xmlbeans</artifactId>
-            <version>${xmlbeans.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-adb</artifactId>
-            <version>${axis2.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-kernel</artifactId>
-            <version>${axis2.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-api</artifactId>
-            <version>1.2.8</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-impl</artifactId>
-            <version>1.2.8</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.axiom</groupId>
-            <artifactId>axiom-dom</artifactId>
-            <version>1.2.8</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ws.commons.schema</groupId>
-            <artifactId>XmlSchema</artifactId>
-            <version>1.4.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.neethi</groupId>
-            <artifactId>neethi</artifactId>
-            <version>2.0.4</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-transport-local</artifactId>
-            <version>${axis2.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.axis2</groupId>
-            <artifactId>axis2-transport-http</artifactId>
-            <version>${axis2.version}</version>
-        </dependency>
-
-        <!-- AMAZON STUFFS -->
-        <dependency>
-            <groupId>com.amazonaws</groupId>
-            <artifactId>aws-java-sdk</artifactId>
-            <version>1.3.20</version>
-        </dependency>
-        <dependency>
-            <groupId>net.java.dev.jets3t</groupId>
-            <artifactId>jets3t</artifactId>
-            <version>0.8.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpclient</artifactId>
-            <version>4.3</version>
-            <type>jar</type>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.httpcomponents</groupId>
-            <artifactId>httpcore</artifactId>
-            <version>4.3</version>
-            <type>jar</type>
-        </dependency>
-
-        <!-- AIRAVATA modules -->
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-xbaya-gui</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-model-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-model-component</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-message-monitor</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-client-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-message-broker</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-common-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-tracking</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-jpa-registry</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-registry-api</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <!-- JCR Support -->
-        <!-- TODO need clean up -->
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-gfac-schema-utils</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-gfac-core</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-gfac-ec2</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>jcl-over-slf4j</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <scope>runtime</scope>
-        </dependency>
-        <dependency>
-            <groupId>javax.jcr</groupId>
-            <artifactId>jcr</artifactId>
-            <version>${jcr.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.airavata</groupId>
-            <artifactId>airavata-workflow-execution-context</artifactId>
-            <version>${project.version}</version>
-        </dependency>
-        <!--dependency> <groupId>org.apache.airavata</groupId> <artifactId>airavata-jpa-registry</artifactId> <version>${project.version}</version> 
-            </dependency -->
-        <dependency>
-            <groupId>org.apache.derby</groupId>
-            <artifactId>derbyclient</artifactId>
-            <version>${derby.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xercesImpl</artifactId>
-            <version>2.9.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-mapper-asl</artifactId>
-            <version>1.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-xc</artifactId>
-            <version>1.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-jaxrs</artifactId>
-            <version>1.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>org.codehaus.jackson</groupId>
-            <artifactId>jackson-core-asl</artifactId>
-            <version>1.9.2</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-servlet</artifactId>
-            <version>${jersey.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-json</artifactId>
-            <version>${jersey.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey.contribs</groupId>
-            <artifactId>jersey-multipart</artifactId>
-            <version>${jersey.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-client</artifactId>
-            <version>${jersey.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>com.sun.jersey</groupId>
-            <artifactId>jersey-core</artifactId>
-            <version>${jersey.version}</version>
-        </dependency>
-        <dependency>
-            <groupId>ant-contrib</groupId>
-            <artifactId>ant-contrib</artifactId>
-            <version>1.0b3</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>ant</groupId>
-                    <artifactId>ant</artifactId>
-                </exclusion>
-            </exclusions>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.ant</groupId>
-            <artifactId>ant-nodeps</artifactId>
-            <version>1.8.1</version>
-        </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <version>12.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.bouncycastle</groupId>
-            <artifactId>bcprov-jdk16</artifactId>
-            <version>1.45</version>
-        </dependency>
-    </dependencies>
-    <properties>
-        <jersey.version>1.13</jersey.version>
-        <grizzly.version>2.0.0-M3</grizzly.version>
-        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <archieve.name>apache-airavata-xbaya-gui</archieve.name>
-        <used.axis2.release>${axis2.version}</used.axis2.release>
-        <airavata.xbaya-dist.name>${archieve.name}-${project.version}</airavata.xbaya-dist.name>
-        <airavata.xbaya-bin.zip>${project.build.directory}/${airavata.xbaya-dist.name}-bin.zip</airavata.xbaya-bin.zip>
-        <airavata.xbaya-bin.tar.gz>${project.build.directory}/${airavata.xbaya-dist.name}-bin.tar.gz</airavata.xbaya-bin.tar.gz>
-        <airavata.xbaya-jnlp.name>xbaya-jnlp-${project.version}</airavata.xbaya-jnlp.name>
-        <airavata.xbaya-jnlp.zip>${project.build.directory}/${airavata.xbaya-jnlp.name}.zip</airavata.xbaya-jnlp.zip>
-        <airavata.xbaya-jnlp.tar.gz>${project.build.directory}/${airavata.xbaya-jnlp.name}.tar.gz</airavata.xbaya-jnlp.tar.gz>
-        <xbaya.directory>${project.build.directory}/temp/apache-airavata-xbaya-gui-${project.version}</xbaya.directory>
-        <jnlp.direcotry>${project.build.directory}/jnlp</jnlp.direcotry>
-    </properties>
-</project>


[02/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
deleted file mode 100644
index 340ab65..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorEditorDialog.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.descriptors;
-
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.AbstractButton;
-import javax.swing.BorderFactory;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.DefaultListModel;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JScrollPane;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-import org.apache.airavata.xbaya.XBayaEngine;
-import org.apache.airavata.xbaya.component.registry.ComponentRegistryLoader;
-import org.apache.airavata.xbaya.registrybrowser.nodes.JCRBrowserIcons;
-import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.util.RegistryConstants;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class DescriptorEditorDialog extends JDialog {
-
-	private static final long serialVersionUID = 478151437279682576L;
-
-	private XBayaEngine engine;
-
-    private XBayaDialog dialog;
-
-    private AiravataAPI registry;
-
-	private JList descriptorList;
-
-	private Map<ApplicationDescription,String> dlist;
-
-	private JButton editButton;
-
-	private AbstractButton removeButton;
-	
-	private boolean descriptorChanged=false;
-	
-	public enum DescriptorType{
-		HOST,
-		SERVICE,
-		APPLICATION
-	};
-
-	public DescriptorType descriptorType;
-	
-    /**
-     * @param engine XBaya workflow engine
-     */
-    public DescriptorEditorDialog(XBayaEngine engine, DescriptorType descriptorType) {
-        this.engine = engine;
-        this.descriptorType=descriptorType;
-        setRegistry(engine.getConfiguration().getAiravataAPI());
-        initGUI();
-    }
-
-    /**
-     * Displays the dialog.
-     */
-    public void show() {
-        this.dialog.show();
-    }
-
-    public void hide() {
-        this.dialog.hide();
-    }
-
-    /**
-     * Initializes the GUI.
-     */
-    private void initGUI() {
-    	descriptorList= new JList(new DefaultListModel());
-    	descriptorList.setCellRenderer(new DescriptorListCellRenderer(descriptorType));
-    	JScrollPane pane = new JScrollPane(descriptorList);
-    	
-    	descriptorList.addMouseListener(new MouseAdapter(){
-    		@Override
-    		public void mouseClicked(MouseEvent e) {
-    			if (e.getClickCount()==2){
-    				try {
-						editDescriptor();
-    				} catch (AiravataAPIInvocationException e1) {
-    					engine.getGUI().getErrorWindow().error("Error while editing descriptor", e1);
-    					e1.printStackTrace();
-    				}
-				}
-    		}
-    	});
-    	GridPanel infoPanel=new GridPanel();
-        infoPanel.add(pane);
-        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 1, 1, 0, 0);
-
-        JButton newButton = new JButton("New...");
-        newButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-            	try {
-					newDescriptor();
-        		} catch (AiravataAPIInvocationException e1) {
-        			engine.getGUI().getErrorWindow().error("Error while creating descriptors", e1);
-        			e1.printStackTrace();
-        		}
-            }
-        });
-        descriptorList.addListSelectionListener(new ListSelectionListener(){
-			public void valueChanged(ListSelectionEvent e) {
-				boolean isSelected=descriptorList.getSelectedIndex()!=-1;
-				editButton.setEnabled(isSelected);
-				removeButton.setEnabled(isSelected);
-			}
-        	
-        });
-        editButton = new JButton("Edit...");
-        editButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-            	try {
-					editDescriptor();
-        		} catch (AiravataAPIInvocationException e1) {
-        			engine.getGUI().getErrorWindow().error("Error while editing descriptor", e1);
-        			e1.printStackTrace();
-        		}
-            }
-
-        });
-        removeButton = new JButton("Remove");
-        removeButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-            	try {
-					deleteDescriptor();
-        		} catch (AiravataAPIInvocationException e1) {
-        			engine.getGUI().getErrorWindow().error("Error while removing descriptor", e1);
-        			e1.printStackTrace();
-        		}
-            }
-        });
-        JButton closeButton = new JButton("Close");
-        closeButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                hide();
-            }
-        });
-        
-
-        GridPanel buttonPanel = new GridPanel();
-        buttonPanel.add(newButton);
-        buttonPanel.add(editButton);
-        buttonPanel.add(removeButton);
-        buttonPanel.add(closeButton);
-        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        String title=null; 
-        switch (descriptorType){
-        	case HOST:
-        		title="Host Descriptions";
-        		break;
-        	case SERVICE:
-        		title="Applications";
-        		break;
-        	case APPLICATION:
-        		title="Application Descriptions";
-        		break;
-        }
-		this.dialog = new XBayaDialog(this.engine.getGUI(), title, infoPanel, buttonPanel);
-        this.dialog.setDefaultButton(editButton);
-        editButton.setEnabled(false);
-        removeButton.setEnabled(false);
-        try {
-			loadDescriptors();
-		} catch (AiravataAPIInvocationException e1) {
-			engine.getGUI().getErrorWindow().error("Error while loading descriptors", e1);
-			e1.printStackTrace();
-		}
-    }
-    
-    private void editDescriptor() throws AiravataAPIInvocationException {
-    	switch (descriptorType){
-	    	case HOST:
-	    		HostDescription h = (HostDescription) getSelected();
-	    		HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine.getConfiguration().getAiravataAPI(),false,h, null);
-	    		hostDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
-	    		hostDescriptionDialog.open();
-	    		if (hostDescriptionDialog.isHostCreated()) {
-					loadDescriptors();
-					setAsChanged();
-				}
-	    		break;
-	    	case SERVICE:
-	    		ServiceDescription d = (ServiceDescription) getSelected();
-	    		DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(getAPI(),false,d, null);
-	        	serviceDescriptionDialog.open();
-//	    		ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry(),false,d);
-//	    		serviceDescriptionDialog.open();
-	    		if (serviceDescriptionDialog.isServiceCreated()) {
-					loadDescriptors();
-					setAsChanged();
-				}
-	    		break;
-	    	case APPLICATION:
-                ApplicationDescription a = (ApplicationDescription) getSelected();
-                String[] s = dlist.get(a).split("\\$");
-                ApplicationDescriptionDialog aDescriptionDialog = new ApplicationDescriptionDialog(engine, false, a, s[1], s[0]);
-                aDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
-                aDescriptionDialog.open();
-                if (aDescriptionDialog.isApplicationDescCreated()) {
-                    loadDescriptors();
-					setAsChanged();
-                }
-			break;
-    	}
-	}
-
-	private void setAsChanged() {
-		descriptorChanged=true;
-    	if (DescriptorEditorDialog.this.descriptorType==DescriptorType.SERVICE){
-			reloadComponentRegistry();
-		}
-	}
-
-    private void newDescriptor() throws AiravataAPIInvocationException {
-    	switch (descriptorType){
-	    	case HOST:
-	    		HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(engine.getConfiguration().getAiravataAPI(), null);
-	    		hostDescriptionDialog.open();
-	    		if (hostDescriptionDialog.isHostCreated()){
-	    			loadDescriptors();
-					setAsChanged();
-	    		}
-	    		break;
-	    	case SERVICE:
-	    		DeploymentDescriptionDialog serviceDescriptionDialog = new DeploymentDescriptionDialog(null, getAPI());
-	        	serviceDescriptionDialog.open();
-//	    		ServiceDescriptionDialog serviceDescriptionDialog = new ServiceDescriptionDialog(getRegistry());
-//	    		serviceDescriptionDialog.open();
-	    		if (serviceDescriptionDialog.isServiceCreated()){
-	    			loadDescriptors();
-					setAsChanged();
-	    		}
-	    		break;
-	    	case APPLICATION:
-	    		ApplicationDescriptionDialog applicationDescriptionDialog = new ApplicationDescriptionDialog(engine);
-	    		applicationDescriptionDialog.setLocationRelativeTo(this.engine.getGUI().getFrame());
-	    		applicationDescriptionDialog.open();
-	    		if (applicationDescriptionDialog.isApplicationDescCreated()){
-	    			loadDescriptors();
-					setAsChanged();
-	    		}
-	    		break;
-    	}
-		
-	}
-    
-	private Object getSelected() {
-		return descriptorList.getModel().getElementAt(descriptorList.getSelectedIndex());
-	}
-	protected boolean askQuestion(String title, String question) {
-        return JOptionPane.showConfirmDialog(this, question, title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
-    }
-    private boolean deleteDescriptor() throws AiravataAPIInvocationException{
-    	String title=null;
-    	String question=null;
-    	switch (descriptorType){
-	    	case HOST:
-	    		HostDescription h = (HostDescription) getSelected();
-	    		title = "Host description";
-	    		question = "Are you sure that you want to remove the service description \""
-	                    + h.getType().getHostName() + "\"?";
-	    		break;
-	    	case SERVICE:
-	        	ServiceDescription d = (ServiceDescription) getSelected();
-	    		title = "Service description";
-	    		question = "Are you sure that you want to remove the applications associated with \""
-	                    + d.getType().getName() + "\"?";
-	    		break;
-	    	case APPLICATION:
-	    		ApplicationDescription a = (ApplicationDescription) getSelected();
-	    		title = "Service description";
-	    		question = "Are you sure that you want to remove the service description \""
-	                    + a.getType().getApplicationName().getStringValue() + "\"?";
-	    		break;
-    	}
-    	
-        
-		if (askQuestion(title, question)) {
-            	switch (descriptorType){
-	    	    	case HOST:
-	    	    		HostDescription h = (HostDescription) getSelected();
-	    	        	getAPI().getApplicationManager().deleteHostDescription(h.getType().getHostName());
-                        loadDescriptors();
-    					setAsChanged();
-	    	    		break;
-	    	    	case SERVICE:
-	    	        	ServiceDescription d = (ServiceDescription) getSelected();
-	    	        	getAPI().getApplicationManager().deleteServiceDescription(d.getType().getName());
-                        loadDescriptors();
-    					setAsChanged();
-	    	    		break;
-	    	    	case APPLICATION:
-	    	    		ApplicationDescription a = (ApplicationDescription) getSelected();
-	    	    		String[] s = dlist.get(a).split("\\$");
-	    	        	getAPI().getApplicationManager().deleteApplicationDescription(s[0], s[1], a.getType().getApplicationName().getStringValue());
-	    	    		loadDescriptors();
-						setAsChanged();
-                        break;
-            	}
-//				loadDescriptors();
-        }
-        return true;
-    }
-
-	private void reloadComponentRegistry() {
-		ComponentRegistryLoader loader = ComponentRegistryLoader.getLoader(engine, RegistryConstants.REGISTRY_TYPE_JCR);
-		loader.load(engine.getConfiguration().getJcrComponentRegistry());
-	}
-    
-    private void loadDescriptors() throws AiravataAPIInvocationException {
-    	try {
-    		//allow the registry cache to update
-			Thread.sleep(500);
-		} catch (InterruptedException e1) {
-			e1.printStackTrace();
-		}
-    	((DefaultListModel)descriptorList.getModel()).removeAllElements();
-    		List<?> descriptors=null;
-			switch (descriptorType){
-	    	case HOST:
-	    		descriptors = getAPI().getApplicationManager().getAllHostDescriptions();
-	    		break;
-	    	case SERVICE:
-	    		descriptors = getAPI().getApplicationManager().getAllServiceDescriptions();
-	    		break;
-	    	case APPLICATION:
-	    		Map<String,ApplicationDescription> temp =getAPI().getApplicationManager().getApplicationDescriptors(null);
-                for(String value:temp.keySet()) {
-                    dlist.put(temp.get(value), value);
-
-                }
-	    		descriptors =Arrays.asList(dlist.keySet().toArray(new ApplicationDescription[]{}));
-	    		break;
-    		}
-    		for (Object d : descriptors) {
-				((DefaultListModel)descriptorList.getModel()).addElement(d);
-			}
-	}
-    
-    private static class DescriptorListCellRenderer extends DefaultListCellRenderer{
-		private static final long serialVersionUID = -1019715929291926180L;
-		private DescriptorType descriptorType;
-		public DescriptorListCellRenderer(DescriptorType descriptorType) {
-			this.descriptorType=descriptorType;
-		}
-		public Component getListCellRendererComponent(JList list, Object value,
-				int index, boolean isSelected, boolean cellHasFocus) {
-			Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-			if (c instanceof JLabel){
-				switch (descriptorType){
-		    	case HOST:
-		    		((JLabel) c).setText(((HostDescription)value).getType().getHostName());
-					((JLabel) c).setIcon(JCRBrowserIcons.HOST_ICON);
-		    		break;
-		    	case SERVICE:
-		    		((JLabel) c).setText(((ServiceDescription)value).getType().getName());
-					((JLabel) c).setIcon(JCRBrowserIcons.SERVICE_ICON);
-		    		break;
-		    	case APPLICATION:
-		    		((JLabel) c).setText(((ApplicationDescription)value).getType().getApplicationName().getStringValue());
-					((JLabel) c).setIcon(JCRBrowserIcons.APPLICATION_ICON);
-		    		break;
-				}
-				
-			}
-			return c;
-		}
-    	
-    }
-    public AiravataAPI getAPI() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorListDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorListDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorListDialog.java
deleted file mode 100644
index fa4d03a..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/DescriptorListDialog.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.descriptors;
-
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import javax.swing.BorderFactory;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.DefaultListModel;
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JScrollPane;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.xbaya.registrybrowser.nodes.JCRBrowserIcons;
-import org.apache.airavata.xbaya.ui.XBayaGUI;
-import org.apache.airavata.xbaya.ui.dialogs.XBayaDialog;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-
-public class DescriptorListDialog extends JDialog {
-
-	private static final long serialVersionUID = 478151437279682576L;
-
-	private XBayaGUI xbayaGUI;
-
-    private XBayaDialog dialog;
-
-    private AiravataAPI registry;
-
-	private JList descriptorList;
-
-	private Map<String[],ApplicationDescription> dlist;
-
-	private JButton okButton;
-	
-	private boolean serviceSelected=false;
-
-	public enum DescriptorType{
-		HOST,
-		SERVICE,
-		APPLICATION
-	};
-
-	public DescriptorType descriptorType;
-
-    /**
-     *
-     * @param registry
-     * @param descriptorType
-     */
-    public DescriptorListDialog(AiravataAPI registry, DescriptorType descriptorType) {
-        setRegistry(registry);
-        this.descriptorType=descriptorType;
-        initGUI();
-        
-    }
-
-    /**
-     * Displays the dialog.
-     */
-    public void open() {
-    	pack();
-    	setModal(true);
-        // Adjust the size if it's bigger than the screen.
-        Dimension size = getSize();
-        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
-        final int inset = 100;
-        int width = size.width;
-        if (width > screenSize.width) {
-            width = screenSize.width - inset;
-        }
-        int height = size.height;
-        if (height > screenSize.height) {
-            height = screenSize.height - inset;
-        }
-        setSize(width, height);
-
-        setLocationRelativeTo(null);
-        setVisible(true);
-    }
-
-    public void close() {
-        setVisible(false);
-    }
-
-    /**
-     * Initializes the GUI.
-     */
-    private void initGUI() {
-    	descriptorList= new JList(new DefaultListModel());
-    	descriptorList.setCellRenderer(new DescriptorListCellRenderer(descriptorType));
-    	JScrollPane pane = new JScrollPane(descriptorList);
-
-    	GridPanel infoPanel=new GridPanel();
-        infoPanel.add(pane);
-        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 1, 1, 0, 0);
-
-        descriptorList.addListSelectionListener(new ListSelectionListener(){
-			@Override
-			public void valueChanged(ListSelectionEvent e) {
-				boolean isSelected=descriptorList.getSelectedIndex()!=-1;
-				okButton.setEnabled(isSelected);
-			}
-        	
-        });
-        okButton = new JButton("OK");
-        okButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-            	serviceSelected=true;
-            	close();
-            }
-
-        });
-        JButton closeButton = new JButton("Cancel");
-        closeButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                close();
-            }
-        });
-        
-
-        GridPanel buttonPanel = new GridPanel();
-        buttonPanel.add(okButton);
-        buttonPanel.add(closeButton);
-        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        String title=null; 
-        switch (descriptorType){
-        	case HOST:
-        		title="Host Descriptions";
-        		break;
-        	case SERVICE:
-        		title="Service Descriptions";
-        		break;
-        	case APPLICATION:
-        		title="Application Descriptions";
-        		break;
-        }
-        getContentPane().add(infoPanel.getSwingComponent());
-        getContentPane().add(buttonPanel.getSwingComponent());
-        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
-        getRootPane().setDefaultButton(okButton);
-        okButton.setEnabled(false);
-        loadDescriptors();
-    }
-    
-	public Object getSelected() {
-		return descriptorList.getModel().getElementAt(descriptorList.getSelectedIndex());
-	}
-
-	protected boolean askQuestion(String title, String question) {
-        return JOptionPane.showConfirmDialog(null, question, title, JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
-    }
-    
-    private void loadDescriptors() {
-    	((DefaultListModel)descriptorList.getModel()).removeAllElements();
-    	try {
-    		List<?> descriptors=null;
-			switch (descriptorType){
-	    	case HOST:
-	    		descriptors = getRegistry().getApplicationManager().getAllHostDescriptions();
-	    		break;
-	    	case SERVICE:
-	    		descriptors = getRegistry().getApplicationManager().getAllServiceDescriptions();
-	    		break;
-	    	case APPLICATION:
-	    		dlist=getRegistry().getApplicationManager().getAllApplicationDescriptions();
-	    		descriptors =Arrays.asList(dlist.values().toArray(new ApplicationDescription[]{}));
-	    		break;
-    		}
-    		for (Object d : descriptors) {
-				((DefaultListModel)descriptorList.getModel()).addElement(d);
-			}
-		} catch (AiravataAPIInvocationException e) {
-			xbayaGUI.getErrorWindow().error(e);
-		}
-	}
-    
-    private static class DescriptorListCellRenderer extends DefaultListCellRenderer{
-		private static final long serialVersionUID = -1019715929291926180L;
-		private DescriptorType descriptorType;
-		public DescriptorListCellRenderer(DescriptorType descriptorType) {
-			this.descriptorType=descriptorType;
-		}
-		public Component getListCellRendererComponent(JList list, Object value,
-				int index, boolean isSelected, boolean cellHasFocus) {
-			Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
-			if (c instanceof JLabel){
-				switch (descriptorType){
-		    	case HOST:
-		    		((JLabel) c).setText(((HostDescription)value).getType().getHostName());
-					((JLabel) c).setIcon(JCRBrowserIcons.HOST_ICON);
-		    		break;
-		    	case SERVICE:
-		    		((JLabel) c).setText(((ServiceDescription)value).getType().getName());
-					((JLabel) c).setIcon(JCRBrowserIcons.SERVICE_ICON);
-		    		break;
-		    	case APPLICATION:
-		    		((JLabel) c).setText(((ApplicationDescription)value).getType().getApplicationName().getStringValue());
-					((JLabel) c).setIcon(JCRBrowserIcons.APPLICATION_ICON);
-		    		break;
-				}
-				
-			}
-			return c;
-		}
-    	
-    }
-    public AiravataAPI getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-
-	public boolean isServiceSelected() {
-		return serviceSelected;
-	}
-
-	public void setServiceSelected(boolean serviceSelected) {
-		this.serviceSelected = serviceSelected;
-	}
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
deleted file mode 100644
index d544e16..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDeploymentDialog.java
+++ /dev/null
@@ -1,617 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.descriptors;
-
-import java.awt.Color;
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.util.List;
-
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JDialog;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JSeparator;
-import javax.swing.JTextField;
-import javax.swing.ProgressMonitor;
-import javax.swing.SwingConstants;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-import org.apache.airavata.schemas.gfac.*;
-import org.apache.airavata.xbaya.ui.menues.MenuIcons;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLinkButton;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-import org.apache.xmlbeans.XmlException;
-
-public class HostDeploymentDialog extends JDialog implements ActionListener {
-    /**
-	 * 
-	 */
-    private static final long serialVersionUID = -2745085755585610025L;
-    private XBayaTextField txtExecPath;
-    private XBayaTextField txtTempDir;
-
-    private AiravataAPI registry;
-    private ApplicationDescription shellApplicationDescription;
-    private JLabel lblError;
-    private boolean applcationDescCreated = false;
-    private JButton okButton;
-
-    private String hostName;
-    private JComboBox cmbHostName;
-
-    private JButton btnHostAdvanceOptions;
-    private boolean newDescriptor;
-    private ApplicationDescription originalDescription;
-    private String originalHost;
-    private JButton btnTmpDirBrowse;
-    private JButton btnExecBrowse;
-    private List<String> existingHostList;
-
-    /**
-     * Create the dialog.
-     */
-    public HostDeploymentDialog(AiravataAPI registry, boolean newDescriptor,
-            ApplicationDescription originalDescription, String originalHost, List<String> existingHostList) {
-        setNewDescriptor(newDescriptor);
-        setOriginalDescription(originalDescription);
-        setOriginalHost(originalHost);
-        setRegistry(registry);
-        setExistingHostList(existingHostList);
-        iniGUI();
-    }
-
-    public void open() {
-        setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-        setVisible(true);
-    }
-
-    protected HostDeploymentDialog getDialog() {
-        return this;
-    }
-
-    private void iniGUI() {
-        if (isNewDescriptor()) {
-            setTitle("New Application Deployment");
-        } else {
-            setTitle("Update Application Deployment: "
-                    + getOriginalDescription().getType().getApplicationName().getStringValue());
-        }
-        setBounds(100, 100, 600, 620);
-        setModal(true);
-        setLocationRelativeTo(null);
-        GridPanel buttonPane = new GridPanel();
-        {
-            lblError = new JLabel("");
-            lblError.setForeground(Color.RED);
-            buttonPane.add(lblError);
-            if (!isNewDescriptor()) {
-                JButton resetButton = new JButton("Reset");
-                resetButton.addActionListener(new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        loadData();
-                    }
-                });
-                buttonPane.add(resetButton);
-            }
-            {
-                okButton = new JButton("Add");
-                if (!isNewDescriptor()) {
-                    okButton.setText("Update");
-                }
-                okButton.addActionListener(new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        saveApplicationDescription();
-                        close();
-                    }
-                });
-                okButton.setEnabled(false);
-                okButton.setActionCommand("OK");
-                buttonPane.add(okButton);
-                getRootPane().setDefaultButton(okButton);
-            }
-            {
-                JButton cancelButton = new JButton("Cancel");
-                cancelButton.addActionListener(new ActionListener() {
-                    public void actionPerformed(ActionEvent e) {
-                        setApplicationDescCreated(false);
-                        close();
-                    }
-                });
-                cancelButton.setActionCommand("Cancel");
-                buttonPane.add(cancelButton);
-            }
-        }
-        {
-            JPanel execPath = new JPanel();
-            txtExecPath = new XBayaTextField();
-            txtExecPath.getTextField().addKeyListener(new KeyAdapter() {
-                @Override
-                public void keyReleased(KeyEvent e) {
-                    setExecutablePath(txtExecPath.getText());
-                }
-            });
-            txtExecPath.getTextField().addFocusListener(new FocusAdapter() {
-                @Override
-                public void focusLost(FocusEvent e) {
-                    super.focusLost(e);
-                    updateTempDirWithExecPath(txtExecPath.getText());
-                }
-            });
-            txtExecPath.setColumns(10);
-            btnExecBrowse = new JButton(MenuIcons.OPEN_ICON);
-            btnExecBrowse.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent arg0) {
-                    JFileChooser c = new JFileChooser();
-                    int rVal = c.showOpenDialog(null);
-                    if (rVal == JFileChooser.APPROVE_OPTION) {
-                        txtExecPath.setText(c.getSelectedFile().toString());
-                        setExecutablePath(txtExecPath.getText());
-                    }
-                }
-            });
-            execPath.add(txtExecPath.getSwingComponent());
-            execPath.add(btnExecBrowse);
-
-            setupLayoutForBrowse(execPath, txtExecPath.getSwingComponent());
-
-            JLabel lblExecutablePath = new JLabel("Executable path");
-            JPanel tmpDirPath = new JPanel();
-
-            txtTempDir = new XBayaTextField();
-            txtTempDir.getTextField().addKeyListener(new KeyAdapter() {
-                @Override
-                public void keyReleased(KeyEvent e) {
-                    setTempDir(txtTempDir.getText());
-                }
-            });
-            txtTempDir.setColumns(10);
-            btnTmpDirBrowse = new JButton(MenuIcons.OPEN_DIR_ICON);
-            btnTmpDirBrowse.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent arg0) {
-                    JFileChooser c = new JFileChooser();
-                    c.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
-                    int rVal = c.showOpenDialog(null);
-                    if (rVal == JFileChooser.APPROVE_OPTION) {
-                        txtTempDir.setText(c.getSelectedFile().toString());
-                        setTempDir(txtTempDir.getText());
-                    }
-                }
-            });
-            JTextField component = txtTempDir.getSwingComponent();
-            tmpDirPath.add(component);
-            tmpDirPath.add(btnTmpDirBrowse);
-
-            setupLayoutForBrowse(tmpDirPath, component);
-
-            JLabel lblTemporaryDirectory = new JLabel("Scratch working directory");
-
-            JButton btnAdvance = new JButton("Advanced application configurations...");
-            btnAdvance.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent e) {
-                    try {
-                        ApplicationDescriptionAdvancedOptionDialog serviceDescriptionDialog = new ApplicationDescriptionAdvancedOptionDialog(
-                                getRegistry(), getShellApplicationDescription());
-                        serviceDescriptionDialog.open();
-                    } catch (Exception e1) {
-                        e1.printStackTrace();
-                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
-                    }
-                }
-            });
-
-            cmbHostName = new JComboBox();
-            cmbHostName.addActionListener(this);
-
-            XBayaLabel lblHostName = new XBayaLabel("Application host", cmbHostName);
-            XBayaLinkButton lnkNewHost = new XBayaLinkButton("New button");
-            lnkNewHost.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent e) {
-                    try {
-                        HostDescriptionDialog hostDescriptionDialog = new HostDescriptionDialog(getRegistry(), null);
-                        hostDescriptionDialog.setLocationRelativeTo(getContentPane());
-                        hostDescriptionDialog.open();
-
-                        if (hostDescriptionDialog.isHostCreated()) {
-                            ProgressMonitor progressMonitor = new ProgressMonitor(getContentPane(),
-                                    "Host Descriptions", "Refreshing host list..", 0, 200);
-                            int progress = 1;
-                            progressMonitor.setProgress(progress++);
-                            while (cmbHostName.getSelectedIndex() == -1
-                                    || !cmbHostName.getSelectedItem().toString()
-                                            .equals(hostDescriptionDialog.getHostLocation())) {
-                                loadHostDescriptions();
-                                cmbHostName.setSelectedItem(hostDescriptionDialog.getHostLocation());
-                                progressMonitor.setProgress(progress++);
-                                Thread.sleep(50);
-                            }
-                            progressMonitor.setProgress(200);
-                        }
-                    } catch (Exception e1) {
-                        e1.printStackTrace();
-                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
-                    }
-                }
-            });
-            lnkNewHost.setText("Create new host...");
-            lnkNewHost.setHorizontalAlignment(SwingConstants.TRAILING);
-
-            btnHostAdvanceOptions = new JButton("HPC Configuration...");
-            btnHostAdvanceOptions.addActionListener(new ActionListener() {
-                public void actionPerformed(ActionEvent arg0) {
-                    try {
-                        ApplicationDescriptionHostAdvancedOptionDialog hostAdvancedOptionsDialog = new ApplicationDescriptionHostAdvancedOptionDialog(
-                                getRegistry(), getShellApplicationDescription());
-                        hostAdvancedOptionsDialog.open();
-                    } catch (Exception e1) {
-                        e1.printStackTrace();
-                        JOptionPane.showMessageDialog(null, e1.getLocalizedMessage());
-                    }
-                }
-            });
-            btnHostAdvanceOptions.setVisible(false);
-            GridPanel hostPanel = new GridPanel();
-            hostPanel.add(cmbHostName);
-            // hostPanel.add(btnHostAdvanceOptions);
-            hostPanel.add(new JLabel());
-
-            SwingUtil.layoutToGrid(hostPanel.getSwingComponent(), 1, 2, 0, 0);
-
-            GridPanel infoPanel1 = new GridPanel();
-
-            infoPanel1.add(lblExecutablePath);
-            infoPanel1.add(execPath);
-            infoPanel1.add(lblTemporaryDirectory);
-            infoPanel1.add(tmpDirPath);
-
-            GridPanel infoPanel3 = new GridPanel();
-
-            infoPanel3.add(lblHostName);
-            infoPanel3.add(hostPanel);
-            infoPanel3.add(new JLabel());
-            infoPanel3.add(lnkNewHost);
-
-            GridPanel infoPanel4 = new GridPanel();
-            // infoPanel4.add(new JLabel());
-            infoPanel4.add(btnHostAdvanceOptions);
-            infoPanel4.add(btnAdvance);
-            infoPanel4.layout(1, 2, 0, 0);
-
-            SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 4, 1, SwingUtil.WEIGHT_NONE, 0);
-            SwingUtil.layoutToGrid(infoPanel3.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
-
-            GridPanel infoPanel = new GridPanel();
-            infoPanel.add(new JSeparator());
-            infoPanel.add(infoPanel3);
-            infoPanel.add(new JSeparator());
-            infoPanel.add(infoPanel1);
-
-            infoPanel.add(new JSeparator());
-            infoPanel.add(infoPanel4);
-
-            SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 6, 1, SwingUtil.WEIGHT_NONE, 0);
-            SwingUtil.layoutToGrid(buttonPane.getSwingComponent(), 1, buttonPane.getContentPanel().getComponentCount(),
-                    SwingUtil.WEIGHT_NONE, 0);
-            getContentPane().add(infoPanel.getSwingComponent());
-            getContentPane().add(buttonPane.getSwingComponent());
-
-            buttonPane.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-            infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-
-            SwingUtil.layoutToGrid(getContentPane(), 2, 1, -1, 0);
-            loadHostDescriptions();
-        }
-        setResizable(true);
-        getRootPane().setDefaultButton(okButton);
-        if (!isNewDescriptor()) {
-            loadData();
-        }
-        pack();
-        if (getSize().getWidth() < 500) {
-            setSize(500, getSize().height);
-        }
-    }
-
-    private void setupLayoutForBrowse(JPanel tmpDirPath, JTextField component) {
-        GridBagLayout layout;
-        GridBagConstraints constraints;
-        layout = new GridBagLayout();
-        constraints = new GridBagConstraints();
-        constraints.fill = GridBagConstraints.BOTH;
-        constraints.weightx = 1;
-        layout.setConstraints(component, constraints);
-        tmpDirPath.setLayout(layout);
-    }
-
-    private void loadData() {
-        txtExecPath.setText(getOriginalDescription().getType().getExecutableLocation());
-        setExecutablePath(txtExecPath.getText());
-        txtTempDir.setText(getOriginalDescription().getType().getScratchWorkingDirectory());
-        setTempDir(txtTempDir.getText());
-
-        cmbHostName.setSelectedItem(getOriginalHost());
-        setHostName(cmbHostName.getSelectedItem().toString());
-        cmbHostName.setEnabled(isNewDescriptor());
-    }
-
-    private void loadHostDescriptions() {
-        cmbHostName.removeAllItems();
-        setHostName(null);
-        try {
-            List<HostDescription> hostDescriptions = getRegistry().getApplicationManager().getAllHostDescriptions();
-            for (HostDescription hostDescription : hostDescriptions) {
-                if (!isNewDescriptor() || !getExistingHostList().contains(hostDescription.getType().getHostName())) {
-                    cmbHostName.addItem(hostDescription.getType().getHostName());
-                }
-            }
-        } catch (Exception e) {
-            setError(e.getLocalizedMessage());
-        }
-        updateHostName();
-    }
-
-    public ApplicationDescription getShellApplicationDescription() {
-        if (shellApplicationDescription == null) {
-            if (isNewDescriptor()) {
-                shellApplicationDescription = new ApplicationDescription();
-            } else {
-                try {
-                    shellApplicationDescription = ApplicationDescription.fromXML(getOriginalDescription().toXML());
-                } catch (XmlException e) {
-                    // shouldn't happen (hopefully)
-                }
-            }
-        }
-        return shellApplicationDescription;
-    }
-
-    public ApplicationDeploymentDescriptionType getApplicationDescriptionType() {
-        return getShellApplicationDescription().getType();
-    }
-
-    public String getExecutablePath() {
-        return getApplicationDescriptionType().getExecutableLocation();
-    }
-
-    public void setExecutablePath(String executablePath) {
-        getApplicationDescriptionType().setExecutableLocation(executablePath);
-        updateTempDirWithExecPath(executablePath);
-        updateDialogStatus();
-    }
-
-    private void updateTempDirWithExecPath(String executablePath) {
-        // if (!executablePath.trim().equals("") && (!txtExecPath.getSwingComponent().isFocusOwner()) &&
-        // (getApplicationDescriptionType().getScratchWorkingDirectory()==null ||
-        // getApplicationDescriptionType().getScratchWorkingDirectory().trim().equalsIgnoreCase(""))){
-        // String temp_location = "workflow_runs";
-        // String tempDir = new File(new File(executablePath).getParentFile(),temp_location).toString();
-        // txtTempDir.setText(tempDir);
-        // txtTempDir.getSwingComponent().setSelectionStart(tempDir.length()-temp_location.length());
-        // txtTempDir.getSwingComponent().setSelectionEnd(tempDir.length());
-        // setTempDir(txtTempDir.getText());
-        // txtTempDir.getSwingComponent().requestFocus();
-        // }
-    }
-
-    public String getTempDir() {
-        return getApplicationDescriptionType().getScratchWorkingDirectory();
-    }
-
-    public void setTempDir(String tempDir) {
-        getApplicationDescriptionType().setScratchWorkingDirectory(tempDir);
-        updateDialogStatus();
-    }
-
-    public void close() {
-        getDialog().setVisible(false);
-    }
-
-    public void saveApplicationDescription() {
-        setApplicationDescCreated(true);
-    }
-
-    public boolean isApplicationDescCreated() {
-        return applcationDescCreated;
-    }
-
-    public void setApplicationDescCreated(boolean applicationDescCreated) {
-        this.applcationDescCreated = applicationDescCreated;
-    }
-
-    private void setError(String errorMessage) {
-        if (errorMessage == null || errorMessage.trim().equals("")) {
-            lblError.setText("");
-        } else {
-            lblError.setText(errorMessage.trim());
-        }
-    }
-
-    private void updateDialogStatus() {
-        String message = null;
-        try {
-            validateDialog();
-        } catch (Exception e) {
-            message = e.getLocalizedMessage();
-        }
-        okButton.setEnabled(message == null);
-        setError(message);
-    }
-
-    private void validateDialog() throws Exception {
-        if (getExecutablePath() == null || getExecutablePath().trim().equals("")) {
-            throw new Exception("Executable path cannot be empty!!!");
-        }
-
-        if (getTempDir() == null || getTempDir().trim().equals("")) {
-            throw new Exception("Temporary directory location cannot be empty!!!");
-        }
-
-        if (getHostName() == null || getHostName().trim().equals("")) {
-            throw new Exception("Please select/create host to bind to this deployment description");
-        }
-
-    }
-
-    public String getHostName() {
-        return hostName;
-    }
-
-    public void setHostName(String hostName) {
-        this.hostName = hostName;
-        if (hostName != null) {
-            HostDescription hostDescription;
-            try {
-                hostDescription = registry.getApplicationManager().getHostDescription(hostName);
-                if (hostDescription.getType() instanceof GlobusHostType || hostDescription.getType() instanceof UnicoreHostType || hostDescription.getType() instanceof GsisshHostType) {
-                    getShellApplicationDescription().getType().changeType(HpcApplicationDeploymentType.type);
-                }else if (hostDescription.getType() instanceof SSHHostType && ((SSHHostType)hostDescription.getType()).getHpcResource()) {
-                    getShellApplicationDescription().getType().changeType(HpcApplicationDeploymentType.type);
-                } else {
-                    getShellApplicationDescription().getType().changeType(ApplicationDeploymentDescriptionType.type);
-                }
-                btnHostAdvanceOptions.setVisible(getShellApplicationDescription().getType() instanceof HpcApplicationDeploymentType);
-                String hostAddress = hostDescription.getType().getHostAddress();
-                boolean isLocal = isLocalAddress(hostAddress);
-                btnExecBrowse.setVisible(isLocal);
-                btnTmpDirBrowse.setVisible(isLocal);
-            } catch (AiravataAPIInvocationException e) {
-                e.printStackTrace();
-            }
-        }
-        updateDialogStatus();
-    }
-
-    private boolean isLocalAddress(String hostAddress) {
-        return hostAddress.equalsIgnoreCase("localhost") || hostAddress.equalsIgnoreCase("127.0.0.1");
-    }
-
-    private void updateHostName() {
-        if (cmbHostName.getSelectedItem() != null) {
-            setHostName(cmbHostName.getSelectedItem().toString());
-        }
-    }
-
-    public void actionPerformed(ActionEvent e) {
-        if (e.getSource() == cmbHostName) {
-            updateHostName();
-        }
-        if (e.getSource() == txtExecPath) {
-            setExecutablePath(txtExecPath.getText());
-        }
-        if (e.getSource() == txtTempDir) {
-            setTempDir(txtTempDir.getText());
-        }
-    }
-
-    public AiravataAPI getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-
-    public boolean isNewDescriptor() {
-        return newDescriptor;
-    }
-
-    public void setNewDescriptor(boolean newDescriptor) {
-        this.newDescriptor = newDescriptor;
-    }
-
-    public ApplicationDescription getOriginalDescription() {
-        return originalDescription;
-    }
-
-    public void setOriginalDescription(ApplicationDescription originalDescription) {
-        this.originalDescription = originalDescription;
-    }
-
-    public String getOriginalHost() {
-        return originalHost;
-    }
-
-    public void setOriginalHost(String originalHost) {
-        this.originalHost = originalHost;
-    }
-
-    public HostDeployment execute() throws AiravataAPIInvocationException {
-        open();
-        if (isApplicationDescCreated()) {
-            return new HostDeployment(getRegistry().getApplicationManager().getHostDescription(getHostName()),
-                    getShellApplicationDescription());
-        }
-        return null;
-    }
-
-    public List<String> getExistingHostList() {
-        return existingHostList;
-    }
-
-    public void setExistingHostList(List<String> existingHostList) {
-        this.existingHostList = existingHostList;
-    }
-
-    public static class HostDeployment {
-        private HostDescription hostDescription;
-        private ApplicationDescription applicationDescription;
-
-        public HostDeployment(HostDescription hostDescription, ApplicationDescription applicationDescription) {
-            setHostDescription(hostDescription);
-            setApplicationDescription(applicationDescription);
-        }
-
-        public ApplicationDescription getApplicationDescription() {
-            return applicationDescription;
-        }
-
-        public void setApplicationDescription(ApplicationDescription applicationDescription) {
-            this.applicationDescription = applicationDescription;
-        }
-
-        public HostDescription getHostDescription() {
-            return hostDescription;
-        }
-
-        public void setHostDescription(HostDescription hostDescription) {
-            this.hostDescription = hostDescription;
-        }
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
deleted file mode 100644
index 5dece7b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/ui/dialogs/descriptors/HostDescriptionDialog.java
+++ /dev/null
@@ -1,592 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.ui.dialogs.descriptors;
-
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyAdapter;
-import java.awt.event.KeyEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.swing.BorderFactory;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.SwingConstants;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.client.api.exception.DescriptorAlreadyExistsException;
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.common.utils.SwingUtil;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.schemas.gfac.Ec2HostType;
-import org.apache.airavata.schemas.gfac.ExportProperties;
-import org.apache.airavata.schemas.gfac.ExportProperties.Name;
-import org.apache.airavata.schemas.gfac.GlobusHostType;
-import org.apache.airavata.schemas.gfac.GsisshHostType;
-import org.apache.airavata.schemas.gfac.HostDescriptionType;
-import org.apache.airavata.schemas.gfac.SSHHostType;
-import org.apache.airavata.schemas.gfac.UnicoreHostType;
-import org.apache.airavata.xbaya.ui.widgets.GridPanel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaLabel;
-import org.apache.airavata.xbaya.ui.widgets.XBayaTextField;
-
-public class HostDescriptionDialog extends JDialog {
-
-	private static final long serialVersionUID = -2910634296292034085L;
-
-    private XBayaTextField hostIdTextField;
-
-    private XBayaTextField hostAddressTextField;
-
-    private XBayaTextField gateKeeperTextField;
-
-    private XBayaTextField gridFTPTextField;
-
-    private HostDescription hostDescription;
-
-    private boolean hostCreated = false;
-
-    private AiravataAPI registry;
-
-	private XBayaLabel gateKeeperLabel;
-
-	private XBayaLabel gridFTPLabel;
-
-    private JLabel lblError;
-
-    private String hostId;
-
-    private JButton okButton;
-
-    private boolean newHost;
-
-    private HostDescription originalHostDescription;
-
-//    private XBayaEngine engine;
-
-	private JComboBox cmbResourceProtocol;
-
-	private GridPanel infoPanel2;
-
-	private XBayaTextField exportsTextField;
-
-	private XBayaTextField preJobCommandsTextField;
-
-	private XBayaTextField postJobCommandsTextField;
-
-	private XBayaLabel postJobCommandsTextFieldLabel;
-
-	private XBayaLabel preJobCommandsLabel;
-
-	private XBayaLabel exportsLabel;
-
-	private XBayaTextField fileEndPointPrefixTextField;
-
-	private XBayaLabel fileEndPointPrefixLabel;
-
-	private JCheckBox hpcResourceCheckBoxField;
-
-	private JLabel emptyLabel;
-
-	private static final String REMOTE_PROTOCOL_STR_LOCAL="Local";
-	private static final String REMOTE_PROTOCOL_STR_SSH="SSH";
-	private static final String REMOTE_PROTOCOL_STR_GLOBUS="Globus";
-	private static final String REMOTE_PROTOCOL_STR_UNICORE="Unicore";
-	private static final String REMOTE_PROTOCOL_STR_AMAZON_EC2="Amazon EC2";
-	private static final String REMOTE_PROTOCOL_STR_HADOOP="Hadoop";
-	private static final String REMOTE_PROTOCOL_GSI_SSH="GSI-SSH";
-
-
-    public HostDescriptionDialog(AiravataAPI registry, JFrame parent) {
-    	this(registry,true,null, parent);
-    }
-
-    /**
-     *
-     * @param registry
-     * @param newHost
-     * @param originalHostDescription
-     */
-    public HostDescriptionDialog(AiravataAPI registry, boolean newHost, HostDescription originalHostDescription, JFrame parent) {
-        super(parent);
-        setNewHost(newHost);
-        setOriginalHostDescription(originalHostDescription);
-        addWindowListener(new WindowAdapter() {
-            @Override
-            public void windowOpened(WindowEvent arg0) {
-//                if (isNewHost()) {
-//					String baseName = "Host";
-//					int i = 1;
-//					String defaultName = baseName + i;
-//					try {
-//						while (getRegistry().getServiceDescription(defaultName) != null) {
-//							defaultName = baseName + (++i);
-//						}
-//					} catch (Exception e) {
-//						e.printStackTrace();
-//					}
-//					hostIdTextField.setText(defaultName);
-//				}
-            }
-        });
-        setRegistry(registry);
-        initGUI();
-    }
-
-    /**
-     * Displays the dialog.
-     */
-    public void open() {
-        setModal(true);
-        setLocationRelativeTo(getOwner());
-		setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
-		setVisible(true);
-    }
-
-    public void close() {
-    	setVisible(false);
-    }
-
-    private void ok() {
-        hostId = this.hostIdTextField.getText();
-        String hostAddress = this.hostAddressTextField.getText();
-
-        setHostId(hostId);
-        setHostLocation(hostAddress);
-        HostDescriptionType host = getHostDescription().getType();
-        if(host instanceof GlobusHostType) {
-        	((GlobusHostType)hostDescription.getType()).addGlobusGateKeeperEndPoint(this.gateKeeperTextField.getText());
-            ((GlobusHostType)hostDescription.getType()).addGridFTPEndPoint(this.gridFTPTextField.getText());
-        }else if (host instanceof UnicoreHostType){
-        	((UnicoreHostType)hostDescription.getType()).addUnicoreBESEndPoint(this.gateKeeperTextField.getText());
-            ((UnicoreHostType)hostDescription.getType()).addGridFTPEndPoint(this.gridFTPTextField.getText());
-        }else if (host instanceof SSHHostType){
-        	while(((SSHHostType)hostDescription.getType()).getFileEndPointPrefixArray().length>0){
-        		((SSHHostType)hostDescription.getType()).removeFileEndPointPrefix(0);
-        	}
-        	String[] prefixes = StringUtil.getElementsFromString(this.fileEndPointPrefixTextField.getText());
-        	for (String prefix : prefixes) {
-        		((SSHHostType)hostDescription.getType()).addNewFileEndPointPrefix().setStringValue(prefix);
-			}
-            ((SSHHostType)hostDescription.getType()).setHpcResource(hpcResourceCheckBoxField.isSelected());
-        }else if (host instanceof GsisshHostType){
-        	String[] exports = StringUtil.getElementsFromString(exportsTextField.getText());
-        	ExportProperties exportsElement = ((GsisshHostType)hostDescription.getType()).addNewExports();
-        	for (String export : exports) {
-        		String[] nameVal = StringUtil.getElementsFromString(export,"=",StringUtil.QUOTE);
-        		if (nameVal.length>0){
-            		Name name = exportsElement.addNewName();
-        			name.setStringValue(nameVal[0]);
-        			if (nameVal.length>1){
-        				name.setValue(nameVal[1]);
-        			}
-        		}
-			}
-            ((GsisshHostType)hostDescription.getType()).setPreJobCommandsArray(StringUtil.getElementsFromString(this.preJobCommandsTextField.getText()));
-            ((GsisshHostType)hostDescription.getType()).setPostJobCommandsArray(StringUtil.getElementsFromString(this.postJobCommandsTextField.getText()));
-        }
-        saveHostDescription();
-        close();
-    }
-
-    private GridPanel createPanelWithMessage(String message){
-    	GridPanel gridPanel = new GridPanel();
-    	JLabel lblMessage = new JLabel(message, SwingConstants.CENTER);
-		gridPanel.add(lblMessage);
-		lblMessage.setFont(new Font("Tahoma", Font.ITALIC, 11));
-    	gridPanel.layout(1,1, 0,0);
-    	return gridPanel;
-    }
-
-    /**
-     * Initializes the GUI.
-     */
-    private void initGUI() {
-    	setBounds(100, 100, 400, 350);
-    	setModal(true);
-        setLocationRelativeTo(null);
-        if (isNewHost()) {
-			setTitle("Register Host");
-		}else{
-			setTitle("Update Host: "+getOriginalHostDescription().getType().getHostName());
-		}
-		this.hostIdTextField = new XBayaTextField();
-        this.hostAddressTextField = new XBayaTextField();
-
-        XBayaLabel hostIdLabel = new XBayaLabel("Host ID", this.hostIdTextField);
-        XBayaLabel hostAddressLabel = new XBayaLabel("Host Address", this.hostAddressTextField);
-        cmbResourceProtocol = new JComboBox(new String[]{REMOTE_PROTOCOL_STR_LOCAL,REMOTE_PROTOCOL_STR_SSH,REMOTE_PROTOCOL_STR_GLOBUS,REMOTE_PROTOCOL_STR_UNICORE,REMOTE_PROTOCOL_STR_AMAZON_EC2, REMOTE_PROTOCOL_STR_HADOOP, REMOTE_PROTOCOL_GSI_SSH});
-        JLabel lblResourceProtocol = new JLabel("Resource Protocol");
-        GridPanel pnlResourceProtocolSelection=new GridPanel();
-        pnlResourceProtocolSelection.add(lblResourceProtocol);
-        pnlResourceProtocolSelection.add(cmbResourceProtocol);
-        pnlResourceProtocolSelection.layout(1, 2, 0, 1);
-        cmbResourceProtocol.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent arg0) {
-                updateRemoteProtocolTypeAndControls();
-            }
-        });
-        hostIdTextField.getSwingComponent().addKeyListener(new KeyAdapter() {
-            @Override
-            public void keyReleased(KeyEvent e) {
-            	updateDialogStatus();
-            }
-        });
-        hostAddressTextField.getSwingComponent().addKeyListener(new KeyAdapter() {
-            @Override
-            public void keyReleased(KeyEvent e) {
-            	updateDialogStatus();
-            }
-        });
-        GridPanel infoPanel1 = new GridPanel();
-        infoPanel1.add(hostIdLabel);
-        infoPanel1.add(this.hostIdTextField);
-        infoPanel1.add(hostAddressLabel);
-        infoPanel1.add(this.hostAddressTextField);
-//        infoPanel1.add(chkGobusHost);
-        infoPanel2 = new GridPanel();
-        infoPanel2.add(createPanelWithMessage("Initializing..."));
-        SwingUtil.layoutToGrid(infoPanel1.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
-        SwingUtil.layoutToGrid(infoPanel2.getSwingComponent(), 1, 1, SwingUtil.WEIGHT_NONE, 1);
-
-        GridPanel infoPanel = new GridPanel();
-
-        infoPanel.add(infoPanel1);
-        infoPanel.add(pnlResourceProtocolSelection);
-        infoPanel.add(infoPanel2);
-        infoPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-        SwingUtil.layoutToGrid(infoPanel.getSwingComponent(), 3, 1, SwingUtil.WEIGHT_NONE, 0);
-
-        GridPanel buttonPanel = new GridPanel();
-        lblError = new JLabel();
-        lblError.setForeground(Color.RED);
-        buttonPanel.add(lblError);
-        okButton = new JButton("Save");
-        if (!isNewHost()) {
-			okButton.setText("Update");
-		}
-		okButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                ok();
-            }
-        });
-
-        buttonPanel.add(okButton);
-
-        JButton cancelButton = new JButton("Cancel");
-        cancelButton.addActionListener(new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
-                close();
-            }
-        });
-
-        buttonPanel.add(cancelButton);
-        buttonPanel.layout(1,3,SwingUtil.WEIGHT_NONE,0);
-        buttonPanel.getSwingComponent().setBorder(BorderFactory.createEtchedBorder());
-
-        getContentPane().add(infoPanel.getSwingComponent());
-        getContentPane().add(buttonPanel.getSwingComponent());
-
-        SwingUtil.layoutToGrid(getContentPane(), 2, 1, 0, 0);
-
-        getRootPane().setDefaultButton(okButton);
-        cmbResourceProtocol.setSelectedIndex(0);
-        updateRemoteProtocolTypeAndControls();
-        if (!isNewHost()) {
-			loadData();
-		}
-//        SwingUtil.addPlaceHolder(hostIdTextField.getSwingComponent(), "[unique name for the host]");
-//        SwingUtil.addPlaceHolder(hostAddressTextField.getSwingComponent(), "[a valid host address, eg: myhost.com, 127.0.0.1]");
-//        SwingUtil.addPlaceHolder(GridFTPTextField.getSwingComponent(), "[List of grid ftp endpoints]");
-//        SwingUtil.addPlaceHolder(globusGateKeeperTextField.getSwingComponent(), "[List of globus gate keeper endpoints]");
-        updateDialogStatus();
-    }
-
-	private GridPanel createGlobusRemoteProtocolPanel() {
-		GridPanel globusPanel = new GridPanel();
-        if (gridFTPTextField==null) {
-			this.gridFTPTextField = new XBayaTextField();
-			this.gateKeeperTextField = new XBayaTextField();
-			gateKeeperLabel = new XBayaLabel("GRAM Endpoint", this.gateKeeperTextField);
-	        gridFTPLabel = new XBayaLabel("Grid FTP Endpoint", this.gridFTPTextField);
-		}
-        globusPanel.add(gateKeeperLabel);
-        globusPanel.add(gateKeeperTextField);
-        globusPanel.add(gridFTPLabel);
-        globusPanel.add(gridFTPTextField);
-        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
-        return globusPanel;
-	}
-	
-	private GridPanel createSSHRemoteProtocolPanel() {
-		GridPanel globusPanel = new GridPanel();
-        if (fileEndPointPrefixTextField==null) {
-			this.fileEndPointPrefixTextField = new XBayaTextField();
-			this.hpcResourceCheckBoxField = new JCheckBox("HPC Resource");
-			fileEndPointPrefixLabel = new XBayaLabel("File Endpoint Prefix", this.fileEndPointPrefixTextField);
-			this.emptyLabel=new JLabel();
-		}
-        globusPanel.add(hpcResourceCheckBoxField);
-        globusPanel.add(emptyLabel);
-        globusPanel.add(fileEndPointPrefixLabel);
-        globusPanel.add(fileEndPointPrefixTextField);
-        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
-        return globusPanel;
-	}
-	
-	private GridPanel createGSISSHRemoteProtocolPanel() {
-		GridPanel globusPanel = new GridPanel();
-        if (exportsTextField==null) {
-			this.exportsTextField = new XBayaTextField();
-			this.preJobCommandsTextField = new XBayaTextField();
-			this.postJobCommandsTextField = new XBayaTextField();
-			exportsLabel = new XBayaLabel("Exports", this.exportsTextField);
-			preJobCommandsLabel = new XBayaLabel("Pre-job Commands", this.preJobCommandsTextField);
-			postJobCommandsTextFieldLabel = new XBayaLabel("Post-job Commands", this.postJobCommandsTextField);
-		}
-        globusPanel.add(exportsLabel);
-        globusPanel.add(exportsTextField);
-        globusPanel.add(preJobCommandsLabel);
-        globusPanel.add(preJobCommandsTextField);
-        globusPanel.add(postJobCommandsTextFieldLabel);
-        globusPanel.add(postJobCommandsTextField);
-        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 3, 2, SwingUtil.WEIGHT_NONE, 1);
-        return globusPanel;
-	}
-
-	private GridPanel createUnicoreRemoteProtocolPanel() {
-		GridPanel globusPanel = new GridPanel();
-        if (gridFTPTextField==null) {
-			this.gridFTPTextField = new XBayaTextField();
-			this.gateKeeperTextField = new XBayaTextField();
-			gateKeeperLabel = new XBayaLabel("Unicore Endpoint", this.gateKeeperTextField);
-	        gridFTPLabel = new XBayaLabel("GridFTP Endpoint", this.gridFTPTextField);
-		}
-        globusPanel.add(gateKeeperLabel);
-        globusPanel.add(gateKeeperTextField);
-        globusPanel.add(gridFTPLabel);
-        globusPanel.add(gridFTPTextField);
-        SwingUtil.layoutToGrid(globusPanel.getSwingComponent(), 2, 2, SwingUtil.WEIGHT_NONE, 1);
-        return globusPanel;
-	}
-    private void loadData() {
-    	HostDescriptionType t = getOriginalHostDescription().getType();
-    	hostIdTextField.setText(t.getHostName());
-		hostAddressTextField.setText(t.getHostAddress());
-		if (t instanceof GlobusHostType){
-			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_GLOBUS);
-			gateKeeperTextField.setText(StringUtil.createDelimiteredString(((GlobusHostType) t).getGlobusGateKeeperEndPointArray()));
-			gridFTPTextField.setText(StringUtil.createDelimiteredString(((GlobusHostType) t).getGridFTPEndPointArray()));
-		}else if (t instanceof SSHHostType){
-			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_SSH);
-			fileEndPointPrefixTextField.setText(StringUtil.createDelimiteredString(((SSHHostType)t).getFileEndPointPrefixArray()));
-			hpcResourceCheckBoxField.setSelected(((SSHHostType)t).getHpcResource());
-		}else if (t instanceof UnicoreHostType){
-			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_UNICORE);
-			gateKeeperTextField.setText(StringUtil.createDelimiteredString(((UnicoreHostType) t).getUnicoreBESEndPointArray()));
-			gridFTPTextField.setText(StringUtil.createDelimiteredString(((UnicoreHostType) t).getGridFTPEndPointArray()));
-		}else if (t instanceof Ec2HostType){
-			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_STR_AMAZON_EC2);
-		}else if (t instanceof GsisshHostType){
-			cmbResourceProtocol.setSelectedItem(REMOTE_PROTOCOL_GSI_SSH);
-			List<String> arr=new ArrayList<String>();
-			ExportProperties exports = ((GsisshHostType) t).getExports();
-			if (exports!=null) {
-				Name[] nameArray = exports.getNameArray();
-				for (Name name : nameArray) {
-					arr.add(name.getStringValue() + "="
-							+ StringUtil.quoteString(name.getValue(), "="));
-				}
-			}
-			exportsTextField.setText(StringUtil.createDelimiteredString(arr.toArray(new String[]{})));
-			preJobCommandsTextField.setText(StringUtil.createDelimiteredString(((GsisshHostType) t).getPreJobCommandsArray()));
-			postJobCommandsTextField.setText(StringUtil.createDelimiteredString(((GsisshHostType) t).getPostJobCommandsArray()));
-		}
-		hostIdTextField.setEditable(isNewHost());
-		updateRemoteProtocolTypeAndControls();
-	}
-
-    public String getHostId() {
-        return getHostDescription().getType().getHostName();
-    }
-
-    public void setHostId(String hostId) {
-        getHostDescription().getType().setHostName(hostId);
-        updateDialogStatus();
-    }
-
-    public String getHostLocation() {
-        return getHostDescription().getType().getHostName();
-    }
-
-    public void setHostLocation(String hostLocation) {
-        getHostDescription().getType().setHostAddress(hostLocation);
-        updateDialogStatus();
-    }
-
-    private void validateDialog() throws Exception {
-        if (isNewHost()) {
-			String hostName = this.hostIdTextField.getText();
-			if (hostName == null
-					|| hostName.trim().equals("")) {
-				throw new Exception("Id of the host cannot be empty!!!");
-			}
-			HostDescription hostDescription2 = null;
-		    hostDescription2 = getRegistry().getApplicationManager().getHostDescription(hostName);
-			if (hostDescription2 != null) {
-				throw new Exception(
-						"Host descriptor with the given id already exists!!!");
-			}
-		}
-        String hostAddress = this.hostAddressTextField.getText();
-		if (hostAddress == null || hostAddress.trim().equals("")) {
-            throw new Exception("Host location/ip cannot be empty!!!");
-        }
-    }
-
-    private void updateDialogStatus() {
-        String message = null;
-        try {
-            validateDialog();
-        } catch (Exception e) {
-            message = e.getLocalizedMessage();
-        }
-        okButton.setEnabled(message == null);
-        setError(message);
-    }
-
-    private void setError(String errorMessage) {
-        if (errorMessage == null || errorMessage.trim().equals("")) {
-            lblError.setText("");
-        } else {
-            lblError.setText(errorMessage.trim());
-        }
-
-    }
-
-    public boolean isHostCreated() {
-        return hostCreated;
-    }
-
-    public void setHostCreated(boolean hostCreated) {
-        this.hostCreated = hostCreated;
-    }
-
-    public HostDescription getHostDescription() {
-        if (hostDescription == null) {
-            hostDescription = new HostDescription(GlobusHostType.type);
-        }
-        return hostDescription;
-    }
-
-    public void saveHostDescription() {
-        HostDescription desc = getHostDescription();
-        try {
-        	if (getRegistry().getApplicationManager().isHostDescriptorExists(desc.getType().getHostName())){
-        		getRegistry().getApplicationManager().updateHostDescriptor(desc);
-        	}else{
-        		getRegistry().getApplicationManager().addHostDescription(desc);
-        	}
-			setHostCreated(true);
-		}catch (DescriptorAlreadyExistsException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}  catch (AiravataAPIInvocationException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-
-		}
-    }
-
-    public AiravataAPI getRegistry() {
-        return registry;
-    }
-
-    public void setRegistry(AiravataAPI registry) {
-        this.registry = registry;
-    }
-    String previousProtocol=null;
-	private void updateRemoteProtocolTypeAndControls() {
-		String selectedProtocol=cmbResourceProtocol.getSelectedItem().toString();
-		if (previousProtocol==null || !previousProtocol.equals(selectedProtocol)){
-			infoPanel2.getContentPanel().removeAll();
-			if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_LOCAL)){
-				getHostDescription().getType().changeType(HostDescriptionType.type);
-				infoPanel2.add(createPanelWithMessage("No configurations needed."));
-			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_SSH)){
-				getHostDescription().getType().changeType(SSHHostType.type);
-				infoPanel2.add(createSSHRemoteProtocolPanel());
-			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_GLOBUS)){
-				getHostDescription().getType().changeType(GlobusHostType.type);
-				infoPanel2.add(createGlobusRemoteProtocolPanel());
-			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_UNICORE)){
-				getHostDescription().getType().changeType(UnicoreHostType.type);
-				infoPanel2.add(createUnicoreRemoteProtocolPanel());
-			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_STR_AMAZON_EC2)){
-				getHostDescription().getType().changeType(Ec2HostType.type);
-				infoPanel2.add(createPanelWithMessage("No configurations needed."));
-			}else if (selectedProtocol.equals(REMOTE_PROTOCOL_GSI_SSH)){
-				getHostDescription().getType().changeType(GsisshHostType.type);
-				infoPanel2.add(createGSISSHRemoteProtocolPanel());
-			}else{
-				infoPanel2.add(createPanelWithMessage("Not supported."));
-			}
-			infoPanel2.getContentPanel().setBorder(BorderFactory.createEtchedBorder());
-			infoPanel2.getContentPanel().updateUI();
-			infoPanel2.layout(1, 1,0,0);
-		}
-	}
-
-	public boolean isNewHost() {
-		return newHost;
-	}
-
-	public void setNewHost(boolean newHost) {
-		this.newHost = newHost;
-	}
-
-	public HostDescription getOriginalHostDescription() {
-		return originalHostDescription;
-	}
-
-	public void setOriginalHostDescription(HostDescription originalHostDescription) {
-		this.originalHostDescription = originalHostDescription;
-	}
-
-//	public XBayaEngine getEngine() {
-//		return engine;
-//	}
-//
-//	public void setEngine(XBayaEngine engine) {
-//		this.engine = engine;
-//	}
-}
\ No newline at end of file


[12/90] [abbrv] [partial] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/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
deleted file mode 100644
index 17e6620..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/jython/script/JythonScript.java
+++ /dev/null
@@ -1,671 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.jython.script;
-
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.List;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.utils.StringUtil;
-import org.apache.airavata.workflow.model.component.ws.WSComponent;
-import org.apache.airavata.workflow.model.graph.Graph;
-import org.apache.airavata.workflow.model.graph.GraphException;
-import org.apache.airavata.workflow.model.graph.Node;
-import org.apache.airavata.workflow.model.graph.Port;
-import org.apache.airavata.workflow.model.graph.system.ConstantNode;
-import org.apache.airavata.workflow.model.graph.system.EndifNode;
-import org.apache.airavata.workflow.model.graph.system.IfNode;
-import org.apache.airavata.workflow.model.graph.system.InputNode;
-import org.apache.airavata.workflow.model.graph.system.MemoNode;
-import org.apache.airavata.workflow.model.graph.system.OutputNode;
-import org.apache.airavata.workflow.model.graph.util.GraphUtil;
-import org.apache.airavata.workflow.model.graph.ws.WSNode;
-import org.apache.airavata.workflow.model.wf.Workflow;
-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 {
-
-    /**
-     * GFAC_VARIABLE
-     */
-    public static final String GFAC_VARIABLE = "gfacURL";
-
-    /**
-     * BROKER_LOC_VARIABLE
-     */
-    public static final String BROKER_URL_VARIABLE = "brokerURL";
-
-    /**
-     * MESSAGE_BOX_URL_VARIABLE
-     */
-    public static final String MESSAGE_BOX_URL_VARIABLE = "msgBoxURL";
-
-    /**
-     * TOPIC_VARIABLE
-     */
-    public static final String TOPIC_VARIABLE = "topic";
-
-    private static final String INVOKER_CLASS = StringUtil.getClassName(GenericInvoker.class);
-
-    private static final String NOTIFICATION_CLASS = StringUtil.getClassName(NotificationSender.class);
-
-    private static final String WORKFLOW_STARTED_METHOD = "workflowStarted";
-
-    private static final String WORKFLOW_COMPLETED_METHOD = "workflowFinished";
-
-    private static final String WORKFLOW_INCOMPLETED_METHOD = "workflowFailed";
-
-    private static final String SETUP_METHOD = "setup";
-
-    private static final String SET_OPERATION_METHOD = "setOperation";
-
-    private static final String SET_INPUT_METHOD = "setInput";
-
-    private static final String GET_OUTPUT_METHOD = "getOutput";
-
-    private static final String WAIT_METHOD = "waitToFinish";
-
-    private static final String INVOKE_METHOD = "invoke";
-
-    private static final String GET_PROPERTY_METHOD = "getProperty";
-
-    private static final String NOTIFICATION_VARIABLE = "notifier";
-
-    private static final String PROPERTIES_VARIABLE = "properties";
-
-    private static final String INVOKER_SUFFIX = "_invoker";
-
-    private static final String QNAME_SUFFIX = "_qname";
-
-    private static final String VALUE_SUFFIX = "_value";
-
-    private static final String TAB = "    ";
-
-    /**
-     * Suffix to put after node ID to create WSDL ID.
-     */
-    private static final String WSDL_SUFFIX = "_wsdl";
-
-    private XBayaConfiguration configuration;
-
-    private Workflow workflow;
-
-    private Graph graph;
-
-    /**
-     * Collection of nodes that are not invoked yet
-     */
-    private Collection<Node> notYetInvokedNodes;
-
-    /**
-     * Collection of nodes that are executing now, and not finished yet.
-     */
-    private Collection<Node> executingNodes;
-
-    private Collection<InputNode> inputNodes;
-
-    private Collection<OutputNode> outputNodes;
-
-    /**
-     * List of command-line arguments
-     */
-    private List<String> arguments;
-
-    private String scriptString;
-
-    /**
-     * Constructs a JythonScript.
-     * 
-     * @param workflow
-     * @param configuration
-     */
-    public JythonScript(Workflow workflow, XBayaConfiguration configuration) {
-        this.workflow = workflow;
-        this.configuration = configuration;
-        this.graph = this.workflow.getGraph();
-
-        this.arguments = new ArrayList<String>();
-
-        this.notYetInvokedNodes = new LinkedList<Node>();
-        for (Node node : this.graph.getNodes()) {
-            if (!(node instanceof MemoNode)) {
-                this.notYetInvokedNodes.add(node);
-            }
-        }
-        this.executingNodes = new LinkedList<Node>();
-        this.inputNodes = GraphUtil.getInputNodes(this.graph);
-        this.outputNodes = GraphUtil.getOutputNodes(this.graph);
-    }
-
-    /**
-     * Returns the WSDL ID.
-     * 
-     * @param node
-     * 
-     * @return the WSDL ID
-     */
-    public static String getWSDLID(Node node) {
-        return node.getID() + WSDL_SUFFIX;
-    }
-
-    /**
-     * @return The Jython script string
-     */
-    public String getJythonString() {
-        return this.scriptString;
-    }
-
-    /**
-     * 
-     * @param parameters
-     * @return the jython script with prefilled argument
-     */
-    public String getJythonString(List<String> parameters) {
-        int index = this.scriptString.indexOf("# Process command-line arguments.");
-        StringBuilder builder = new StringBuilder(this.scriptString.substring(0, index));
-        builder.append("sys.argv = [");
-        for (String string : parameters) {
-            builder.append("'");
-            builder.append(string);
-            builder.append("',");
-        }
-        builder.deleteCharAt(builder.length() - 1);
-        builder.append("]");
-        builder.append("\n");
-        builder.append(this.scriptString.substring(index));
-        return builder.toString();
-    }
-
-    /**
-     * @param warnings
-     *            returns the warning messages.
-     * @return true if the workflow is valid; false otherwise.
-     */
-    public boolean validate(List<String> warnings) {
-        // Empty
-        if (this.graph.getNodes().size() == 0) {
-            String message = "The workflow is empty.";
-            warnings.add(message);
-        }
-
-        // Input ports need to be connected.
-        Collection<Port> inputPorts = GraphUtil.getPorts(this.graph, Port.Kind.DATA_IN);
-        for (Port inputPort : inputPorts) {
-            Collection<Port> fromPorts = inputPort.getFromPorts();
-            if (fromPorts.size() == 0) {
-                Node node = inputPort.getNode();
-                String message = node.getID() + " has an unconnected input " + inputPort.getName();
-                warnings.add(message);
-            }
-        }
-
-        // Input nodes need to be connected.
-        for (InputNode inputNode : this.inputNodes) {
-            if (inputNode.getPort().getToPorts().size() == 0) {
-                String message = inputNode.getID() + " is not connected to any service.";
-                warnings.add(message);
-            }
-        }
-
-        // Cycle
-        if (GraphUtil.containsCycle(this.graph)) {
-            String message = "There is a cycle in the workflow, only acyclic workflows are supported";
-            warnings.add(message);
-        }
-
-        // Constants are not supported.
-        List<ConstantNode> constantNodes = GraphUtil.getNodes(this.graph, ConstantNode.class);
-        if (constantNodes.size() > 0) {
-            String message = "Constants are not supported for Jython scripts.";
-            warnings.add(message);
-        }
-
-        // If/endif are not supported.
-        List<IfNode> ifNodes = GraphUtil.getNodes(this.graph, IfNode.class);
-        List<EndifNode> endifNodes = GraphUtil.getNodes(this.graph, EndifNode.class);
-        if (ifNodes.size() > 0 || endifNodes.size() > 0) {
-            String message = "If/endif are not supported for Jython scripts.";
-            warnings.add(message);
-        }
-
-        if (warnings.size() > 0) {
-            return false;
-        } else {
-            // No error.
-            return true;
-        }
-    }
-
-    /**
-     * @throws GraphExceptionconcreteWSDL
-     */
-    public void create() throws GraphException {
-        StringWriter stringWriter = new StringWriter();
-        PrintWriter printWriter = new PrintWriter(stringWriter);
-
-        writeHeader(printWriter);
-        writeParameters(printWriter);
-        writeWSDLLocations(printWriter);
-        writeCommandLineArguments(printWriter);
-        writeSetup(printWriter);
-        writeInvocations(printWriter);
-        writeOutputs(printWriter);
-        writeWaitAll(printWriter);
-        writeFooter(printWriter);
-
-        printWriter.close();
-        this.scriptString = stringWriter.toString();
-    }
-
-    /**
-     * @param pw
-     */
-    private void writeCommandLineArguments(PrintWriter pw) {
-        pw.println("def usage():");
-        pw.println(TAB + "print '''");
-        pw.println("Options: -help");
-        pw.println(TAB + TAB + " -f properties_file");
-        for (String argument : this.arguments) {
-            pw.println(TAB + TAB + " -" + argument + " value");
-        }
-        pw.println("'''");
-        pw.println(TAB + "sys.exit(0)");
-        pw.println();
-
-        pw.println("# Process command-line arguments.");
-        pw.println("if sys.argv[0][0] != '-':");
-        pw.println(TAB + "sys.argv = sys.argv[1:]");
-        pw.println("while sys.argv:");
-        pw.println(TAB + "if sys.argv[0] == '-f':");
-        pw.println(TAB + TAB + "# Read parameters from a file.");
-        pw.println(TAB + TAB + "propertyFilename = sys.argv[1]");
-        pw.println(TAB + TAB + "inputStream = FileInputStream(propertyFilename)");
-        pw.println(TAB + TAB + PROPERTIES_VARIABLE + ".load(inputStream)");
-
-        for (String argument : this.arguments) {
-            pw.println(TAB + "elif sys.argv[0] == '-" + argument + "':");
-            pw.println(TAB + TAB + PROPERTIES_VARIABLE + ".put('" + argument + "', sys.argv[1])");
-        }
-
-        pw.println(TAB + "else:");
-        pw.println(TAB + TAB + "usage()");
-        pw.println(TAB + "sys.argv = sys.argv[2:]");
-        pw.println();
-    }
-
-    /**
-     * Writes import statements
-     * 
-     * @param pw
-     */
-    private void writeHeader(PrintWriter pw) {
-        pw.println("#");
-        pw.println("# This script is automatically generated by " + XBayaConstants.APPLICATION_NAME + " "
-                + XBayaVersion.VERSION + ".");
-        pw.println("#");
-        pw.println();
-        pw.println("import sys, thread");
-        pw.println("from java.lang import Throwable");
-        pw.println("from java.util import Properties");
-        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();
-    }
-
-    /**
-     * Handles parameters
-     * 
-     * @param pw
-     */
-    private void writeParameters(PrintWriter pw) {
-        pw.println(PROPERTIES_VARIABLE + " = Properties()");
-        pw.println();
-        pw.println("# Set up defaut parameter values.");
-
-        writeSetProperty(BROKER_URL_VARIABLE, XBayaConstants.DEFAULT_BROKER_URL, pw);
-        writeSetProperty(MESSAGE_BOX_URL_VARIABLE, this.configuration.getMessageBoxURL(), pw);
-        writeSetProperty(TOPIC_VARIABLE, XBayaConstants.DEFAULT_TOPIC, pw);
-        writeSetProperty(GFAC_VARIABLE, this.configuration.getGFacURL(), pw);
-
-        for (InputNode paramNode : this.inputNodes) {
-            writeParameter(paramNode, pw);
-            this.notYetInvokedNodes.remove(paramNode);
-        }
-
-        pw.println();
-    }
-
-    /**
-     * @param inputNode
-     * @param pw
-     */
-    private void writeParameter(InputNode inputNode, PrintWriter pw) {
-        String id = inputNode.getID();
-        Object value = inputNode.getDefaultValue();
-        String valueString = "";
-        if (value instanceof String) {
-            valueString = (String) value;
-        }
-        writeSetProperty(id, valueString, pw);
-    }
-
-    /**
-     * @param pw
-     */
-    private void writeWSDLLocations(PrintWriter pw) {
-        pw.println("# Set up default WSDL URLs.");
-        for (WSNode node : GraphUtil.getWSNodes(this.graph)) {
-            writeWSDLLocation(node, pw);
-        }
-        pw.println();
-
-    }
-
-    /**
-     * @param node
-     * @param pw
-     */
-    private void writeWSDLLocation(WSNode node, PrintWriter pw) {
-        String defaultWsdlLocation = ""; // TODO
-        writeSetProperty(getWSDLID(node), defaultWsdlLocation, pw);
-    }
-
-    private void writeSetProperty(String name, URI uri, PrintWriter pw) {
-        writeSetProperty(name, StringUtil.toString(uri), pw);
-    }
-
-    private void writeSetProperty(String name, String value, PrintWriter pw) {
-        if (value == null) {
-            value = "";
-        }
-        pw.println(PROPERTIES_VARIABLE + ".setProperty(");
-        pw.println(TAB + TAB + "'" + name + "',");
-        pw.println(TAB + TAB + "'" + value + "')");
-
-        // This will be used to read from command-line
-        this.arguments.add(name);
-    }
-
-    /**
-     * @param pw
-     */
-    private void writeSetup(PrintWriter pw) {
-        // Initialize some variables.
-        pw.println(GFAC_VARIABLE + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + GFAC_VARIABLE
-                + "')");
-        pw.println(TOPIC_VARIABLE + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + TOPIC_VARIABLE
-                + "')");
-        pw.println(BROKER_URL_VARIABLE + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('"
-                + BROKER_URL_VARIABLE + "')");
-        pw.println(MESSAGE_BOX_URL_VARIABLE + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('"
-                + MESSAGE_BOX_URL_VARIABLE + "')");
-
-        // Initialize a notification sender.
-        pw.println(NOTIFICATION_VARIABLE + " = " + NOTIFICATION_CLASS + "(" + BROKER_URL_VARIABLE + ", "
-                + TOPIC_VARIABLE + ")");
-
-        // Send a START_WORKFLOW notification.
-        pw.println(NOTIFICATION_VARIABLE + "." + WORKFLOW_STARTED_METHOD + "(");
-        boolean first = true;
-        for (InputNode inputNode : this.inputNodes) {
-            String id = inputNode.getID();
-            if (first) {
-                first = false;
-            } else {
-                pw.println(",");
-            }
-            pw.print(TAB + id + "=" + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + id + "')");
-        }
-        pw.println(")");
-
-        pw.println();
-
-        // The biggining of try
-        pw.println("try:");
-    }
-
-    /**
-     * @param pw
-     * @throws GraphException
-     */
-    private void writeInvocations(PrintWriter pw) throws GraphException {
-        Collection<Node> nextNodes = getNextNodes();
-        while (nextNodes.size() > 0) {
-            // If there are more than one nodes to invoke, they can run
-            // concurrently using threads.
-            boolean thread = (nextNodes.size() > 1);
-            for (Node node : nextNodes) {
-                if (node instanceof WSNode) {
-                    WSNode wsNode = (WSNode) node;
-                    writeInvocation(wsNode, thread, pw);
-
-                } else {
-                    // TODO conditions, loops might come here.
-                }
-                this.notYetInvokedNodes.remove(node);
-            }
-
-            nextNodes = getNextNodes();
-        }
-    }
-
-    /**
-     * @param node
-     * @param thread
-     * @param pw
-     */
-    private void writeInvocation(WSNode node, boolean thread, PrintWriter pw) {
-        String id = node.getID();
-        String wsdlID = getWSDLID(node);
-
-        WSComponent component = node.getComponent();
-        QName portTypeQName = component.getPortTypeQName();
-        String operation = component.getOperationName();
-
-        pw.println(TAB + "# Invoke " + id + ".");
-        pw.println(TAB + id + QNAME_SUFFIX + " = QName('" + portTypeQName.getNamespaceURI() + "', '"
-                + portTypeQName.getLocalPart() + "')");
-        pw.println(TAB + wsdlID + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + wsdlID + "')");
-        pw.println(TAB + id + INVOKER_SUFFIX + " = " + INVOKER_CLASS + "(" + id + QNAME_SUFFIX + ", " + wsdlID + ", '"
-                + id + "',");
-        pw.println(TAB + TAB + MESSAGE_BOX_URL_VARIABLE + ", " + GFAC_VARIABLE + ", " + NOTIFICATION_VARIABLE + ")");
-
-        pw.println(TAB + "def " + INVOKE_METHOD + id + "():");
-        pw.println(TAB + TAB + id + INVOKER_SUFFIX + "." + SETUP_METHOD + "()");
-        pw.println(TAB + TAB + id + INVOKER_SUFFIX + "." + SET_OPERATION_METHOD + "('" + operation + "')");
-
-        // Ports
-        for (Port port : node.getInputPorts()) {
-            String portName = port.getName();
-            String value;
-            Node fromNode = port.getFromNode();
-            if (fromNode instanceof InputNode) {
-                value = PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('" + fromNode.getID() + "')";
-            } else {
-                Port fromPort = port.getFromPort();
-                value = "" + fromNode.getID() + INVOKER_SUFFIX + "." + GET_OUTPUT_METHOD + "('" + fromPort.getName()
-                        + "')";
-
-                // This might try to remove a node that has been removed
-                // already, but it's OK.
-                this.executingNodes.remove(fromNode);
-            }
-            pw.println(TAB + TAB + portName + VALUE_SUFFIX + " = " + value);
-            pw.println(TAB + TAB + id + INVOKER_SUFFIX + "." + SET_INPUT_METHOD + "('" + portName + "', " + portName
-                    + VALUE_SUFFIX + ")");
-        }
-
-        pw.println(TAB + TAB + "print 'Invoking " + id + ".'");
-        pw.println(TAB + TAB + id + INVOKER_SUFFIX + "." + INVOKE_METHOD + "()");
-
-        if (thread) {
-            pw.println(TAB + "thread.start_new_thread(" + INVOKE_METHOD + id + ", ())");
-        } else {
-            pw.println(TAB + INVOKE_METHOD + id + "()");
-        }
-
-        pw.println();
-
-        this.executingNodes.add(node);
-    }
-
-    private void writeOutputs(PrintWriter pw) throws GraphException {
-        for (OutputNode outputNode : this.outputNodes) {
-            writeOutput(outputNode, pw);
-        }
-    }
-
-    private void writeOutput(OutputNode node, PrintWriter pw) throws GraphException {
-        String id = node.getID();
-        Port port = node.getPort();
-
-        Node fromNode = port.getFromNode();
-        if (fromNode == null) {
-            throw new GraphException("Output parameter has to be connected to some node.");
-        }
-        Port fromPort = port.getFromPort();
-        if (fromNode instanceof InputNode) {
-            // The OutputNode is directly connected to an InputNode.
-            pw.println(TAB + id + VALUE_SUFFIX + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('"
-                    + fromNode.getID() + "')");
-        } else {
-            pw.println(TAB + "# Wait output " + id);
-            pw.println(TAB + id + VALUE_SUFFIX + " = " + fromNode.getID() + INVOKER_SUFFIX + "." + GET_OUTPUT_METHOD
-                    + "('" + fromPort.getName() + "')");
-        }
-        pw.println(TAB + "print '" + id + " = ', " + id + VALUE_SUFFIX);
-
-        // This might try to remove a node that has been removed
-        // already, but it's OK.
-        this.executingNodes.remove(fromNode);
-
-        pw.println();
-    }
-
-    /**
-     * @param pw
-     */
-    private void writeWaitAll(PrintWriter pw) {
-        pw.println(TAB + "# Wait all executing services.");
-        for (Node node : this.executingNodes) {
-            writeWait(node, pw);
-        }
-        pw.println();
-    }
-
-    /**
-     * @param node
-     * @param pw
-     */
-    private void writeWait(Node node, PrintWriter pw) {
-        String id = node.getID();
-        pw.println(TAB + "print 'Waiting " + id + " to be done.'");
-        pw.println(TAB + id + INVOKER_SUFFIX + "." + WAIT_METHOD + "()");
-    }
-
-    /**
-     * @param pw
-     */
-    private void writeFooter(PrintWriter pw) {
-        // Send a COMPLETE_WORKFLOW notification.
-        pw.println(TAB + NOTIFICATION_VARIABLE + "." + WORKFLOW_COMPLETED_METHOD + "(");
-        boolean first = true;
-        for (OutputNode node : this.outputNodes) {
-            if (first) {
-                first = false;
-            } else {
-                pw.println(",");
-            }
-            String id = node.getID();
-            pw.print(TAB + TAB + id + "=" + id + VALUE_SUFFIX);
-        }
-        pw.println(")");
-
-        pw.println(TAB + "print 'Everything is done successfully.'");
-
-        pw.println();
-        pw.println("except Throwable, e:");
-        pw.println(TAB + "print 'Error: ', e");
-        pw.println(TAB + NOTIFICATION_VARIABLE + "." + WORKFLOW_INCOMPLETED_METHOD + "(e)");
-    }
-
-    private Collection<Node> getNextNodes() throws GraphException {
-        Collection<Node> nextNodes = new ArrayList<Node>();
-        for (Node node : this.notYetInvokedNodes) {
-            if (isNextNode(node)) {
-                nextNodes.add(node);
-            }
-        }
-        return nextNodes;
-    }
-
-    /**
-     * Checks is a specified node can be executed next. A node can be executed if all the previous node are done or
-     * there is no input ports.
-     * 
-     * @param node
-     *            the specified node
-     * @return true if the specified node can be executed next; false otherwise
-     * @throws GraphException
-     */
-    private boolean isNextNode(Node node) throws GraphException {
-        if (node instanceof OutputNode) {
-            return false;
-        }
-        for (Port port : node.getInputPorts()) {
-            Collection<Node> fromNodes = port.getFromNodes();
-            if (fromNodes.isEmpty()) {
-                throw new GraphException("There is a port that is not connected to any.");
-            } else {
-                for (Node fromNode : fromNodes) {
-                    if (this.notYetInvokedNodes.contains(fromNode)) {
-                        // There is a node that should be executed before this
-                        // node.
-                        return false;
-                    }
-                }
-            }
-        }
-        Port port = node.getControlInPort();
-        if (port != null) {
-            Collection<Node> fromNodes = port.getFromNodes();
-            for (Node fromNode : fromNodes) {
-                if (this.notYetInvokedNodes.contains(fromNode)) {
-                    return false;
-                }
-            }
-        }
-        return true;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADTypes.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADTypes.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADTypes.java
deleted file mode 100644
index dc0b8bc..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LEADTypes.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.lead;
-
-import javax.xml.namespace.QName;
-
-import org.apache.airavata.common.utils.WSConstants;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class LEADTypes {
-
-    private static final Logger logger = LoggerFactory.getLogger(LEADTypes.class);
-
-    /**
-     * http://www.extreme.indiana.edu/lead/xsd
-     */
-    public static final String LEAD_XSD_NS_URI = "http://airavata.apache.org/schemas/gfac/2012/12";
-
-    // Simple types
-
-    /**
-     * LEADFileIDType
-     */
-    public static final QName LEAD_FILE_ID_TYPE = new QName(LEAD_XSD_NS_URI, "LEADFileIDType");
-
-    /**
-     * DATA_ID_TYPE
-     */
-    public static final QName DATA_ID_TYPE = new QName(LEAD_XSD_NS_URI, "DataIDType");
-
-    /**
-     * LEADWorkflowIDType
-     */
-    public static final QName LEAD_WORKFLOW_ID_TYPE = new QName(LEAD_XSD_NS_URI, "LEADWorkflowIDType");
-
-    /**
-     * LEADNameListFileType
-     */
-    public static final QName LEAD_NAME_LIST_FILE_TYPE = new QName(LEAD_XSD_NS_URI, "LEADNameListFileType");
-
-    /**
-     * LEADNameListPropertiesFileType
-     */
-    public static final QName LEAD_NAME_LIST_PROPERTIES_FILE_TYPE = new QName(LEAD_XSD_NS_URI,
-            "LEADNameListPropertiesFileType");
-
-    /**
-     * HostNameType
-     */
-    public static final QName HOST_NAME_TYPE = new QName(LEAD_XSD_NS_URI, "HostNameType");
-
-    // Array types
-
-    /**
-     * StringArrayType
-     */
-    public static final QName STRING_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "StringArrayType");
-
-    /**
-     * IntegerArrayType
-     */
-    public static final QName INTEGER_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "IntegerArrayType");
-
-    /**
-     * FloatArrayType
-     */
-    public static final QName FLOAT_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "FloatArrayType");
-
-    /**
-     * DoubleArrayType
-     */
-    public static final QName DOUBLE_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "DoubleArrayType");
-
-    /**
-     * BooleanArrayType
-     */
-    public static final QName BOOLEAN_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "BooleanArrayType");
-
-    /**
-     * QNameArrayType
-     */
-    public static final QName QNAME_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "QNameArrayType");
-
-    /**
-     * URIArrayType
-     */
-    public static final QName URI_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "URIArrayType");
-
-    /**
-     * LEADFileIDArrayType
-     */
-    public static final QName LEAD_FILE_ID_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "LEADFileIDArrayType");
-
-    /**
-     * DATA_ID_ARRAY_TYPE
-     */
-    public static final QName DATA_ID_ARRAY_TYPE = new QName(LEAD_XSD_NS_URI, "DataIDArrayType");
-
-    public static final QName STRING_TYPE = new QName(LEAD_XSD_NS_URI, "StringParameterType");
-
-      /**
-       * IntegerArrayType
-       */
-      public static final QName INTEGER_TYPE = new QName(LEAD_XSD_NS_URI, "IntegerParameterType");
-
-      /**
-       * FloatArrayType
-       */
-      public static final QName FLOAT_TYPE = new QName(LEAD_XSD_NS_URI, "FloatParameterType");
-
-      /**
-       * DoubleArrayType
-       */
-      public static final QName DOUBLE_TYPE = new QName(LEAD_XSD_NS_URI, "DoubleParameterType");
-
-      /**
-       * BooleanArrayType
-       */
-      public static final QName BOOLEAN_TYPE = new QName(LEAD_XSD_NS_URI, "BooleanParameterType");
-
-      /**
-       * URIArrayType
-       */
-      public static final QName URI_TYPE = new QName(LEAD_XSD_NS_URI, "URIParameterType");
-
-
-    /**
-     * Checks if a specified type is known. If the type is known, the GUI accepts string as a user's input. If not
-     * known, the GUI accepts XML as the input.
-     * 
-     * @param type
-     * @return true if the type is known; otherwise false;
-     */
-    public static boolean isKnownType(QName type) {
-        if (WSConstants.XSD_ANY_TYPE.equals(type)) {
-            // we need to input XML directly for xsd:any
-            return false;
-        } else if (WSConstants.XSD_NS_URI.equals(type.getNamespaceURI())) {
-            return true;
-        } else if (LEAD_FILE_ID_TYPE.equals(type) || DATA_ID_TYPE.equals(type) || LEAD_WORKFLOW_ID_TYPE.equals(type)
-                || LEAD_NAME_LIST_FILE_TYPE.equals(type) || LEAD_NAME_LIST_PROPERTIES_FILE_TYPE.equals(type)
-                || HOST_NAME_TYPE.equals(type) || STRING_ARRAY_TYPE.equals(type) || INTEGER_ARRAY_TYPE.equals(type)
-                || FLOAT_ARRAY_TYPE.equals(type) || DOUBLE_ARRAY_TYPE.equals(type) || BOOLEAN_ARRAY_TYPE.equals(type)
-                || QNAME_ARRAY_TYPE.equals(type) || URI_ARRAY_TYPE.equals(type) || LEAD_FILE_ID_ARRAY_TYPE.equals(type)
-                || DATA_ID_ARRAY_TYPE.equals(type) || STRING_TYPE.equals(type) || URI_TYPE.equals(type)
-                || INTEGER_TYPE.equals(type) || FLOAT_TYPE.equals(type) || DOUBLE_TYPE.equals(type)
-                || BOOLEAN_TYPE.equals(type)) {
-            return true;
-        } else if (DATA_ID_TYPE.getLocalPart().equals(type.getLocalPart())) {
-            // XXX temporary hack.
-            logger.warn("The name space of " + type.getLocalPart() + " should be " + DATA_ID_TYPE.getNamespaceURI()
-                    + ", not " + type.getNamespaceURI() + ".");
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * @param type
-     * @return true if type is an uri type; false otherwise.
-     */
-    public static boolean isURIType(QName type) {
-        if (WSConstants.XSD_ANY_URI.equals(type) || LEAD_NAME_LIST_PROPERTIES_FILE_TYPE.equals(type)
-                || LEAD_FILE_ID_TYPE.equals(type) || LEAD_NAME_LIST_FILE_TYPE.equals(type)
-                || LEAD_WORKFLOW_ID_TYPE.equals(type) || URI_TYPE.equals(type)) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * @param type
-     * @return true if type is an array type; false otherwise.
-     */
-    public static boolean isArrayType(QName type) {
-        if (STRING_ARRAY_TYPE.equals(type) || INTEGER_ARRAY_TYPE.equals(type) || FLOAT_ARRAY_TYPE.equals(type)
-                || DOUBLE_ARRAY_TYPE.equals(type) || BOOLEAN_ARRAY_TYPE.equals(type) || QNAME_ARRAY_TYPE.equals(type)
-                || URI_ARRAY_TYPE.equals(type) || LEAD_FILE_ID_ARRAY_TYPE.equals(type)
-                || DATA_ID_ARRAY_TYPE.equals(type)) {
-            return true;
-        } else if (LEAD_FILE_ID_ARRAY_TYPE.getLocalPart().equals(type.getLocalPart())) {
-            // TODO remove this.
-            // for workflow input message created from workflow template
-            logger.warn("The name space of " + type.getLocalPart() + " should be "
-                    + LEAD_FILE_ID_ARRAY_TYPE.getNamespaceURI() + ", not " + type.getNamespaceURI() + ".");
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    /**
-     * @param type
-     * @return true if type is an uri array type; false otherwise.
-     */
-    public static boolean isURIArrayType(QName type) {
-        if (URI_ARRAY_TYPE.equals(type) || LEAD_FILE_ID_ARRAY_TYPE.equals(type)) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/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
deleted file mode 100644
index c8db9fd..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/LeadContextHeaderHelper.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-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;
-
-public class LeadContextHeaderHelper {
-
-    /**
-     * DEFAULT_USER
-     */
-    private static final String DEFAULT_USER = "xbaya-user";
-
-    /**
-     * DEFAULT_EXPERIMENT
-     */
-    private static final String DEFAULT_EXPERIMENT = "xbaya-experiment";
-
-    private LeadContextHeader leadContextHeader;
-
-    /**
-     * Constructs a LeadContextHeaderHelper.
-     * 
-     */
-    public LeadContextHeaderHelper() {
-        // The default experiment and user will be will be overwritten.
-        this.leadContextHeader = new LeadContextHeader(DEFAULT_EXPERIMENT, DEFAULT_USER);
-    }
-
-    /**
-     * @return The leadContextHeader.
-     */
-    public LeadContextHeader getLeadContextHeader() {
-        return this.leadContextHeader;
-    }
-
-    /**
-     * @param user
-     */
-    public void setUser(String user) {
-        if (user == null || user.length() == 0) {
-            user = DEFAULT_USER;
-        }
-        this.leadContextHeader.setUserDn(user);
-    }
-
-    /**
-     * @param workflowTemplateID
-     */
-    public void setWorkflowTemplateID(URI workflowTemplateID) {
-        if (workflowTemplateID != null) {
-            this.leadContextHeader.setWorkflowTemplateId(workflowTemplateID);
-        }
-    }
-
-    /**
-     * @param workflowInstanceID
-     */
-    public void setWorkflowInstanceID(URI workflowInstanceID) {
-        if (workflowInstanceID != null) {
-            this.leadContextHeader.setWorkflowInstanceId(workflowInstanceID);
-        }
-    }
-
-    /**
-     * @param brokerURL
-     * @param topic
-     */
-    public void setEventSink(URI brokerURL, String topic) {
-        if (brokerURL != null) {
-            if (topic == null || topic.length() == 0) {
-                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);
-        }
-    }
-
-    /**
-     * @param gFacURL
-     */
-    public void setGFacURL(URI gFacURL) {
-        if (gFacURL != null) {
-            this.leadContextHeader.setGfacUrl(WSDLUtil.appendWSDLQuary(gFacURL));
-        }
-    }
-
-    //
-    // The followings are higer-level APIs.
-    //
-
-    /**
-     * @param workflow
-     */
-    public void setWorkflow(Workflow workflow) {
-        if (workflow != null) {
-            setWorkflowTemplateID(workflow.getGPELTemplateID());
-            setWorkflowInstanceID(workflow.getGPELInstanceID());
-        }
-    }
-
-    /**
-     * @param monitorConfiguration
-     */
-    public void setMonitorConfiguration(MonitorConfiguration monitorConfiguration) {
-        setEventSink(monitorConfiguration.getBrokerURL(), monitorConfiguration.getTopic());
-    }
-
-    /**
-     * This method has to be called before setMonitorConfiguration because this will overwrite some variables.
-     * 
-     * @param xbayaConfiguration
-     */
-    public void setXBayaConfiguration(XBayaConfiguration xbayaConfiguration) {
-        setGFacURL(xbayaConfiguration.getGFacURL());
-
-        // The followings might overwrite some variables.
-        setWorkflowTemplateID(xbayaConfiguration.getGPELTemplateID());
-        setWorkflowInstanceID(xbayaConfiguration.getGPELInstanceID());
-        setEventSink(xbayaConfiguration.getBrokerURL(), xbayaConfiguration.getTopic());
-    }
-
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/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
deleted file mode 100644
index 982cdf3..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/lead/NotificationHandler.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-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;
-import xsul.message_router.MessageContext;
-import xsul.xbeans_util.XBeansUtil;
-import xsul.xhandler.BaseHandler;
-
-public class NotificationHandler extends BaseHandler {
-
-    private static final Logger logger = LoggerFactory.getLogger(NotificationHandler.class);
-
-    private static final String INVOKING_MESSAGE = "Invoking a workflow";
-
-    private static final String RECEIVE_RESULT_MESSAGE = "A workflow finished successfully.";
-
-    private static final String RECEIVE_FAULT_MESSAGE = "A workflow failed.";
-
-    private LeadContextHeader leadContext;
-
-    private WorkflowNotifier notifier;
-
-    private WorkflowTrackingContext context;
-
-    private InvocationContext invocationContext;
-
-    private InvocationEntity invocationEntity;
-
-    private WorkflowContextHeaderBuilder builder;
-
-    /**
-     * Constructs a NotificationHandler.
-     * 
-     * @param leadContext
-     */
-    public NotificationHandler(LeadContextHeader leadContext) {
-        super(NotificationHandler.class.getName());
-        this.leadContext = leadContext;
-        this.notifier = NotifierFactory.createNotifier();
-        URI myWorkflowID = null;
-        URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
-        String userDN = this.leadContext.getUserDn();
-        if (userDN != null ){
-            if(userDN.trim().length() == 0) {
-                String serviceIDAsString = XBayaConstants.APPLICATION_SHORT_NAME + ":" + userDN.trim();
-                try {
-                    myServiceID = new URI(null, null, serviceIDAsString, null);
-                } catch (URISyntaxException e) {
-                    logger.error(e.getMessage(), e);
-                }
-            }
-        }
-        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);
-    }
-
-    public NotificationHandler(WorkflowContextHeaderBuilder builder) {
-        super(NotificationHandler.class.getName());
-        this.builder = builder;
-        this.notifier = NotifierFactory.createNotifier();
-        URI myWorkflowID = null;
-        URI myServiceID = URI.create(XBayaConstants.APPLICATION_SHORT_NAME);
-        String userDN = this.builder.getUserIdentifier();
-        if (userDN != null) {
-            if (userDN.trim().length() == 0) {
-                String serviceIDAsString = XBayaConstants.APPLICATION_SHORT_NAME + ":" + userDN.trim();
-                try {
-                    myServiceID = new URI(null, null, serviceIDAsString, null);
-                } catch (URISyntaxException e) {
-                    logger.error(e.getMessage(), e);
-                }
-            }
-        }
-        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);
-    }
-
-    /**
-     * @see xsul.xhandler.BaseHandler#processOutgoingXml(org.xmlpull.v1.builder.XmlElement,
-     *      xsul.message_router.MessageContext)
-     */
-    @Override
-    public boolean processOutgoingXml(XmlElement soapEnvelope, MessageContext context)
-            throws DynamicInfosetInvokerException {
-        logger.debug("soapEnvelope: " + XMLUtil.xmlElementToString(soapEnvelope));
-
-        URI serviceWorkflowID = null;
-        URI serviceServiceID = URI.create(this.builder.getWorkflowMonitoringContext().getServiceInstanceId());
-        if (serviceServiceID == null) {
-            serviceServiceID = URI.create("NoWorkflowIDSet");
-        }
-//        Integer serviceTimestep = null;
-/*        String timeStep = Integer.toString(this.builder.getWorkflowMonitoringContext().getWorkflowTimeStep());
-        if (timeStep != null) {
-            try {
-                serviceTimestep = new Integer(this.builder.getWorkflowMonitoringContext().getWorkflowTimeStep());
-            } catch (NumberFormatException e) {
-                logger.error(e.getMessage(), e);
-            }
-        }*/
-        XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
-        XmlElement soapBody = soapEnvelope.element(null, XmlConstants.S_BODY);
-        XmlObject headerObject = null;
-        if (soapHeader != null) {
-            headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
-        }
-        XmlObject bodyObject = XBeansUtil.xmlElementToXmlObject(soapBody);
-
-        this.invocationContext = this.notifier.invokingService(this.context, this.invocationEntity, headerObject,
-                bodyObject, INVOKING_MESSAGE);
-        return super.processOutgoingXml(soapEnvelope, context);
-    }
-
-    /**
-     * @see xsul.xhandler.BaseHandler#processIncomingXml(org.xmlpull.v1.builder.XmlElement,
-     *      xsul.message_router.MessageContext)
-     */
-    @Override
-    public boolean processIncomingXml(XmlElement soapEnvelope, MessageContext context)
-            throws DynamicInfosetInvokerException {
-        logger.info("soapEnvelope: " + XMLUtil.xmlElementToString(soapEnvelope));
-
-        XmlElement soapHeader = soapEnvelope.element(null, XmlConstants.S_HEADER);
-        XmlObject headerObject = null;
-        if (soapHeader != null) {
-            headerObject = XBeansUtil.xmlElementToXmlObject(soapHeader);
-        }
-
-        XmlElement soapBody = soapEnvelope.element(null, XmlConstants.S_BODY);
-        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);
-        } else {
-            this.notifier.receivedFault(this.context, this.invocationContext, headerObject, bodyObject,
-                    RECEIVE_FAULT_MESSAGE);
-        }
-
-        return super.processIncomingXml(soapEnvelope, context);
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/tools/ToolsMenuItem.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/tools/ToolsMenuItem.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/tools/ToolsMenuItem.java
deleted file mode 100644
index 972088d..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/menues/tools/ToolsMenuItem.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.menues.tools;
-
-import org.apache.airavata.xbaya.XBayaEngine;
-//import org.apache.airavata.xbaya.ui.dialogs.GlobusFileTransferWindow;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import javax.swing.*;
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
-
-public class ToolsMenuItem {
-
-    private XBayaEngine engine;
-
-    private JMenu toolsMenu;
-
-    private static final Logger logger = LoggerFactory.getLogger(ToolsMenuItem.class);
-
-    /**
-     * Constructs a WorkflowMenu.
-     * 
-     * @param engine
-     */
-    public ToolsMenuItem(XBayaEngine engine) {
-        this.engine = engine;
-        createWorkflowMenu();
-    }
-
-    /**
-     * @return The workflow menu.
-     */
-    public JMenu getMenu() {
-        return this.toolsMenu;
-    }
-
-    /**
-     * Creates workflow menu.
-     */
-    private void createWorkflowMenu() {
-//        JMenuItem globusFileTransferItem = createGlobusFileTransferItem();
-//        toolsMenu = new JMenu("Tools");
-//        toolsMenu.setMnemonic(KeyEvent.VK_T);
-//        toolsMenu.add(globusFileTransferItem);
-
-    }
-    
-//    private JMenuItem createGlobusFileTransferItem() {
-//        JMenuItem item = new JMenuItem("Globus File Transfer...");
-//        item.setMnemonic(KeyEvent.VK_J);
-//        item.addActionListener(new AbstractAction() {
-//            private GlobusFileTransferWindow window;
-//
-//            public void actionPerformed(ActionEvent e) {
-//                if (this.window == null) {
-//                    this.window = new GlobusFileTransferWindow(engine);
-//                }
-//                this.window.show();
-//            }
-//        });
-//        return item;
-//    }
-
-//    private JMenuItem createAmberRunItem() {
-//        JMenuItem item = new JMenuItem("Amber Run...");
-//        item.setMnemonic(KeyEvent.VK_J);
-//        item.addActionListener(new AbstractAction() {
-//            private AmberRunWindow window;
-//
-//            public void actionPerformed(ActionEvent e) {
-//                if (this.window == null) {
-//                    this.window = new AmberRunWindow(engine);
-//                }
-//                this.window.show();
-//            }
-//        });
-//        return item;
-//    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java
deleted file mode 100644
index 6702f1c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/AiravataConfigurations.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class AiravataConfigurations {
-//    private AiravataRegistry2 registry;
-    private AiravataAPI airavataAPI;
-
-//    public AiravataConfigurations(AiravataRegistry2 registry) {
-//        setRegistry(registry);
-//    }
-    public AiravataConfigurations(AiravataAPI airavataAPI) {
-        setAiravataAPI(airavataAPI);
-    }
-
-//    public AiravataRegistry2 getRegistry() {
-//        return registry;
-//    }
-//
-//    public void setRegistry(AiravataRegistry2 registry) {
-//        this.registry = registry;
-//    }
-
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java
deleted file mode 100644
index 3c66c43..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptionWrap.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class ApplicationDeploymentDescriptionWrap {
-    private ApplicationDescription applicationDescription;
-    private String service;
-    private String host;
-//    private AiravataRegistry2 registry;
-    private AiravataAPI airavataAPI;
-
-    public ApplicationDeploymentDescriptionWrap(AiravataAPI airavataAPI,
-            ApplicationDescription applicationDescription, String service, String host) {
-        setApplicationDescription(applicationDescription);
-        setService(service);
-        setHost(host);
-        setAiravataAPI(airavataAPI);
-    }
-
-    public ApplicationDescription getDescription() {
-        return applicationDescription;
-    }
-
-    public void setApplicationDescription(ApplicationDescription applicationDescription) {
-        this.applicationDescription = applicationDescription;
-    }
-
-    public String getService() {
-        return service;
-    }
-
-    public ServiceDescription getServiceDescription() throws AiravataAPIInvocationException {
-        ServiceDescription desc = getAiravataAPI().getApplicationManager().getServiceDescription(getService());
-        if(desc!=null){
-        	return desc;
-        }
-        throw new AiravataAPIInvocationException(new Exception("Service Description not found in registry."));
-    }
-
-    public void setService(String service) {
-        this.service = service;
-    }
-
-    public String getHost() {
-        return host;
-    }
-
-    public HostDescription getHostDescription() throws AiravataAPIInvocationException {
-        return getAiravataAPI().getApplicationManager().getHostDescription(getHost());
-    }
-
-    public void setHost(String host) {
-        this.host = host;
-    }
-
-//    public AiravataRegistry2 getRegistry() {
-//        return registry;
-//    }
-//
-//    public void setRegistry(AiravataRegistry2 registry) {
-//        this.registry = registry;
-//    }
-
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java
deleted file mode 100644
index 247a7e8..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/ApplicationDeploymentDescriptions.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.ApplicationManager;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.commons.gfac.type.ApplicationDescription;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.commons.gfac.type.ServiceDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class ApplicationDeploymentDescriptions {
-//    private AiravataRegistry2 registry;
-    private AiravataAPI airavataAPI;
-    private String serviceName;
-    
-//    public ApplicationDeploymentDescriptions(AiravataRegistry2 registry, String serviceName) {
-//        setRegistry(registry);
-//        setServiceName(serviceName);
-//    }
-
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public ApplicationDeploymentDescriptions(AiravataAPI airavataAPI, String serviceName) {
-        setAiravataAPI(airavataAPI);
-        setServiceName(serviceName);
-    }
-    
-//    public ApplicationDeploymentDescriptions(AiravataRegistry2 registry) {
-//        this(registry,null);
-//    }
-
-    public ApplicationDeploymentDescriptions(AiravataAPI airavataAPI) {
-        this(airavataAPI,null);
-    }
-
-//    public AiravataRegistry2 getRegistry() {
-//        return registry;
-//    }
-//
-//    public void setRegistry(AiravataRegistry2 registry) {
-//        this.registry = registry;
-//    }
-
-    public List<ApplicationDeploymentDescriptionWrap> getDescriptions() throws RegistryException, AiravataAPIInvocationException {
-        List<ApplicationDeploymentDescriptionWrap> list = new ArrayList<ApplicationDeploymentDescriptionWrap>();
-        if (getServiceName()==null) {
-            ApplicationManager applicationManager = getAiravataAPI().getApplicationManager();
-            List<ServiceDescription> serviceDescriptors = applicationManager.getAllServiceDescriptions();
-        	for (ServiceDescription serviceDescription : serviceDescriptors) {
-        		String serviceName = serviceDescription.getType().getName();
-				Map<String,ApplicationDescription> deploymentDescriptions = applicationManager.getApplicationDescriptors(serviceName);
-				for (String hostName : deploymentDescriptions.keySet()) {
-					ApplicationDescription descriptionWrap=deploymentDescriptions.get(hostName);
-					list.add(new ApplicationDeploymentDescriptionWrap(getAiravataAPI(), descriptionWrap, serviceName,hostName));
-				}
-			}
-			
-		}else{
-			Map<String,ApplicationDescription> deploymentDescriptions = getAiravataAPI().getApplicationManager().getApplicationDescriptors(serviceName);
-			for (String hostName : deploymentDescriptions.keySet()) {
-				ApplicationDescription descriptionWrap=deploymentDescriptions.get(hostName);
-				list.add(new ApplicationDeploymentDescriptionWrap(getAiravataAPI(), descriptionWrap, getServiceName(),hostName));
-			}
-		}
-		return list;
-    }
-
-	public String getServiceName() {
-		return serviceName;
-	}
-
-	public void setServiceName(String serviceName) {
-		this.serviceName = serviceName;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java
deleted file mode 100644
index 480848b..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURL.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-
-import java.net.URI;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class EventingServiceURL {
-    private AiravataAPI airavataAPI;
-    private URI eventingServiceURL;
-
-    public EventingServiceURL(AiravataAPI airavataAPI, URI eventingServiceURL) {
-        setAiravataAPI(airavataAPI);
-        setEventingServiceURL(eventingServiceURL);
-    }
-
-	public URI getEventingServiceURL() {
-		return eventingServiceURL;
-	}
-
-	public void setEventingServiceURL(URI eventingServiceURL) {
-		this.eventingServiceURL = eventingServiceURL;
-	}
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java
deleted file mode 100644
index 8669821..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/EventingServiceURLs.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class EventingServiceURLs {
-    private AiravataAPI airavataAPI;
-
-    public EventingServiceURLs(AiravataAPI airavataAPI) {
-        setAiravataAPI(airavataAPI);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public List<EventingServiceURL> getURLS() throws AiravataAPIInvocationException {
-        List<EventingServiceURL> urls = new ArrayList<EventingServiceURL>();
-        URI gfacDescriptor = getAiravataAPI().getAiravataManager().getEventingServiceURL();
-		urls.add(new EventingServiceURL(getAiravataAPI(), gfacDescriptor));
-        return urls;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURL.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURL.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURL.java
deleted file mode 100644
index 3f45bdd..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURL.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-
-import java.net.URI;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class GFacURL {
-    private AiravataAPI airavataAPI;
-    private URI gfacURL;
-
-    public GFacURL(AiravataAPI airavataAPI, URI url) {
-        setAiravataAPI(airavataAPI);
-        setGfacURL(url);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public URI getGfacURL() {
-        return gfacURL;
-    }
-
-    public void setGfacURL(URI url) {
-        this.gfacURL = url;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
deleted file mode 100644
index 2c2b89c..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/GFacURLs.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class GFacURLs {
-    private AiravataAPI airavataAPI;
-
-    public GFacURLs(AiravataAPI airavataAPI) {
-        setAiravataAPI(airavataAPI);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-//    public List<GFacURL> getURLS() throws AiravataAPIInvocationException {
-//        List<GFacURL> urls = new ArrayList<GFacURL>();
-//        List<URI> gfacDescriptorList = getAiravataAPI().getAiravataManager().getGFaCURLs();
-//		for (URI url : gfacDescriptorList) {
-//		    urls.add(new GFacURL(getAiravataAPI(), url));
-//		}
-//        return urls;
-//    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/HostDescriptions.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/HostDescriptions.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/HostDescriptions.java
deleted file mode 100644
index aba3fc2..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/HostDescriptions.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import java.util.List;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-import org.apache.airavata.registry.api.exception.RegistryException;
-import org.apache.airavata.commons.gfac.type.HostDescription;
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class HostDescriptions {
-    private AiravataAPI airavataAPI;
-
-    public HostDescriptions(AiravataAPI airavataAPI) {
-        setAiravataAPI(airavataAPI);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public List<HostDescription> getDescriptions() throws AiravataAPIInvocationException {
-        return getAiravataAPI().getApplicationManager().getAllHostDescriptions();
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InputParameters.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InputParameters.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InputParameters.java
deleted file mode 100644
index 41bf8b0..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InputParameters.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.schemas.gfac.Parameter;
-
-public class InputParameters extends ServiceParameters {
-
-	public InputParameters(NodeParameter[] parameters) {
-		super(parameters);
-	}
-	
-	public InputParameters(Parameter[] parameters) {
-		super(parameters);
-	}
-
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURL.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURL.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURL.java
deleted file mode 100644
index d648af3..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURL.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-
-import java.net.URI;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class InterpreterServiceURL {
-    private AiravataAPI airavataAPI;
-    private URI interpreterServiceURL;
-
-    public InterpreterServiceURL(AiravataAPI airavataAPI, URI interpreterServiceURI) {
-        setAiravataAPI(airavataAPI);
-        setInterpreterServiceURI(interpreterServiceURI);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public URI getInterpreterServiceURL() {
-        return interpreterServiceURL;
-    }
-
-    public void setInterpreterServiceURI(URI interpreterServiceURI) {
-        this.interpreterServiceURL = interpreterServiceURI;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURLs.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURLs.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURLs.java
deleted file mode 100644
index 71ae486..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/InterpreterServiceURLs.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class InterpreterServiceURLs {
-    private AiravataAPI airavataAPI;
-
-    public InterpreterServiceURLs(AiravataAPI airavataAPI) {
-        setAiravataAPI(airavataAPI);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public List<InterpreterServiceURL> getURLS() throws AiravataAPIInvocationException {
-        List<InterpreterServiceURL> urls = new ArrayList<InterpreterServiceURL>();
-        List<URI> gfacDescriptorList = getAiravataAPI().getAiravataManager().getWorkflowInterpreterServiceURLs();
-		for (URI uri : gfacDescriptorList) {
-		    urls.add(new InterpreterServiceURL(getAiravataAPI(), uri));
-		}
-        return urls;
-    }
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURL.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURL.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURL.java
deleted file mode 100644
index 3754f16..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURL.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-
-import java.net.URI;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class MessageBoxURL {
-    private AiravataAPI airavataAPI;
-    private URI messageBoxURL;
-
-    public MessageBoxURL(AiravataAPI airavataAPI, URI messageBoxURL) {
-        setAiravataAPI(airavataAPI);
-        setMessageBoxURL(messageBoxURL);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public URI getMessageBoxURL() {
-		return messageBoxURL;
-	}
-
-	public void setMessageBoxURL(URI messageBoxURL) {
-		this.messageBoxURL = messageBoxURL;
-	}
-}

http://git-wip-us.apache.org/repos/asf/airavata/blob/0e2c10f5/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURLs.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURLs.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURLs.java
deleted file mode 100644
index 600af77..0000000
--- a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/model/registrybrowser/MessageBoxURLs.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-package org.apache.airavata.xbaya.model.registrybrowser;
-
-import org.apache.airavata.client.api.AiravataAPI;
-import org.apache.airavata.client.api.exception.AiravataAPIInvocationException;
-
-import java.net.URI;
-import java.util.ArrayList;
-import java.util.List;
-
-//import org.apache.airavata.registry.api.AiravataRegistry2;
-
-public class MessageBoxURLs {
-    private AiravataAPI airavataAPI;
-
-    public MessageBoxURLs(AiravataAPI airavataAPI) {
-        setAiravataAPI(airavataAPI);
-    }
-
-    public AiravataAPI getAiravataAPI() {
-        return airavataAPI;
-    }
-
-    public void setAiravataAPI(AiravataAPI airavataAPI) {
-        this.airavataAPI = airavataAPI;
-    }
-
-    public List<MessageBoxURL> getURLS() throws AiravataAPIInvocationException {
-        List<MessageBoxURL> urls = new ArrayList<MessageBoxURL>();
-        URI gfacDescriptor = getAiravataAPI().getAiravataManager().getMessageBoxServiceURL();
-		urls.add(new MessageBoxURL(getAiravataAPI(), gfacDescriptor));
-        return urls;
-    }
-}


[80/90] [abbrv] AIRAVATA-1124

Posted by sa...@apache.org.
http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
new file mode 100644
index 0000000..b0f44e9
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/component/registry/ComponentRegistryLoader.java
@@ -0,0 +1,195 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.component.registry;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Observable;
+import java.util.Observer;
+
+//import org.apache.airavata.registry.api.AiravataRegistry2;
+import org.apache.airavata.client.api.AiravataAPI;
+import org.apache.airavata.workflow.model.component.ComponentRegistry;
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.apache.airavata.workflow.model.component.registry.JCRComponentRegistry;
+import org.apache.airavata.xbaya.XBayaConfiguration;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.dialogs.WaitDialog;
+import org.apache.airavata.xbaya.ui.utils.Cancelable;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.apache.airavata.xbaya.ui.widgets.component.ComponentTreeNode;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ComponentRegistryLoader implements Cancelable, Observer {
+
+    private static final Logger logger = LoggerFactory.getLogger(ComponentRegistryLoader.class);
+
+    private XBayaEngine engine;
+
+    private Thread loadThread;
+
+    private boolean canceled;
+
+    private WaitDialog loadingDialog;
+    
+    private ComponentTreeNode componentTree;
+
+    private Observable observableRegistry;
+    
+    private Map<String,ComponentTreeNode> componentTreeNodesMap;
+    
+    private static Map<String, ComponentRegistryLoader> loaders;
+    
+    /**
+     * Constructs a WorkflowLoader.
+     * 
+     * @param engine
+     */
+    private ComponentRegistryLoader(XBayaEngine engine) {
+        this.setEngine(engine);
+
+        this.loadingDialog = new WaitDialog(this, "Loading a Component List.", "Loading a Component List. "
+                + "Please wait for a moment.", this.getEngine().getGUI());
+        getEngine().getConfiguration().addObserver(this);
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.utils.Cancelable#cancel()
+     */
+    public void cancel() {
+        this.canceled = true;
+        this.loadThread.interrupt();
+    }
+
+    /**
+     * Loads the workflow.
+     * 
+     * @param registry
+     * 
+     */
+    public void load(final ComponentRegistry registry) {
+        this.canceled = false;
+        
+        this.loadThread = new Thread() {
+            @Override
+            public void run() {
+                runInThread(registry);
+            }
+        };
+        this.loadThread.start();
+        
+        if (!getComponentTreeNodesMap().containsKey(registry.getName())) {
+			// This has to be the last because it blocks when the dialog is modal.
+			this.loadingDialog.show();
+		}
+    }
+
+    /**
+     * @param registry
+     */
+    /**
+     * TODO : this method triggered twice when connecting to the registy. We need to find
+     *  why it is happening
+     */
+    private synchronized void runInThread(ComponentRegistry registry) {
+        try {
+            this.getEngine().getGUI().getComponentSelector().removeComponentRegistry(registry.getName());
+//            if (getComponentTreeNodesMap().containsKey(registry.getName())){
+//        		this.getEngine().getGUI().getComponentSelector().removeComponentTree(getComponentTreeNodesMap().get(registry.getName()));
+//        		getComponentTreeNodesMap().remove(registry.getName());
+//        	}
+            componentTree = ComponentController.getComponentTree(registry);
+            if (this.canceled) {
+                return;
+            }
+            this.getEngine().getGUI().getComponentSelector().addComponentTree(componentTree);
+//            getComponentTreeNodesMap().put(registry.getName(),componentTree);
+            this.loadingDialog.hide();
+        } catch (ComponentRegistryException e) {
+            if (this.canceled) {
+                logger.error(e.getMessage(), e);
+            } else {
+                this.getEngine().getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
+                this.loadingDialog.hide();
+            }
+        } catch (RuntimeException e) {
+            if (this.canceled) {
+                logger.error(e.getMessage(), e);
+            } else {
+                this.getEngine().getGUI().getErrorWindow().error(ErrorMessages.COMPONENT_LIST_LOAD_ERROR, e);
+                this.loadingDialog.hide();
+            }
+        } catch (Error e) {
+            this.getEngine().getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            this.loadingDialog.hide();
+        }
+    }
+
+	@Override
+	public void update(Observable observable, Object o) {
+		if ((observable instanceof XBayaConfiguration) && (o instanceof ComponentRegistry)){
+			ComponentRegistry componentRegistry=(ComponentRegistry)o;
+			if (observableRegistry!=null){
+				observableRegistry.deleteObserver(this);
+			}
+			if (componentRegistry instanceof JCRComponentRegistry){
+				AiravataAPI registry = ((JCRComponentRegistry)componentRegistry).getAiravataAPI();
+				if (registry!=null && registry instanceof Observable){
+					(observableRegistry=(Observable)registry).addObserver(this);
+				}
+			}
+			load(componentRegistry);
+		}else if (observable instanceof AiravataAPI){
+			load(getEngine().getConfiguration().getJcrComponentRegistry());
+		}
+	}
+	
+	public XBayaEngine getEngine() {
+		return engine;
+	}
+
+	public void setEngine(XBayaEngine engine) {
+		this.engine = engine;
+	}
+
+	public Map<String,ComponentTreeNode> getComponentTreeNodesMap() {
+		if (componentTreeNodesMap==null){
+			componentTreeNodesMap=new HashMap<String, ComponentTreeNode>();
+		}
+		return componentTreeNodesMap;
+	}
+
+	protected static Map<String, ComponentRegistryLoader> getLoaders() {
+		if (loaders==null){
+			loaders=new HashMap<String, ComponentRegistryLoader>();
+		}
+		return loaders;
+	}
+
+	public static ComponentRegistryLoader getLoader(XBayaEngine engine, String id){
+		if (!getLoaders().containsKey(id)){
+			getLoaders().put(id, new ComponentRegistryLoader(engine));
+		}
+		return getLoaders().get(id);
+	}
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedExecutable.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedExecutable.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedExecutable.java
new file mode 100644
index 0000000..6a06c19
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedExecutable.java
@@ -0,0 +1,33 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.concurrent;
+
+/**
+ * Intended for jobs that are runnable; Way of determining
+ * whether a given job is ready to be executed
+ *
+ * @author Chathura Herath
+ */
+public interface PredicatedExecutable extends Runnable{
+
+	public boolean isReady();
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedTaskRunner.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedTaskRunner.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedTaskRunner.java
new file mode 100644
index 0000000..1bed1f4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/concurrent/PredicatedTaskRunner.java
@@ -0,0 +1,153 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.xbaya.concurrent;
+
+import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+/**
+ * Used to run jobs that need to be started after a predicate is
+ *
+ * @author Chathura Herath
+ */
+public class PredicatedTaskRunner {
+
+	protected volatile ConcurrentLinkedQueue<PredicatedExecutable> jobQueue = new ConcurrentLinkedQueue<PredicatedExecutable>();
+
+	protected ExecutorService threadPool;
+
+	protected volatile boolean stop = false;
+
+	public PredicatedTaskRunner(int numberOfThreads) {
+		this.threadPool = Executors.newFixedThreadPool(numberOfThreads);
+		addIdleTask();
+		startCheckThread();
+
+	}
+
+	private void addIdleTask() {
+		PredicatedExecutable sleepTask = new PredicatedExecutable() {
+
+			@Override
+			public void run() {
+				synchronized (jobQueue) {
+					if (jobQueue.size() == 1) {
+						try {
+							jobQueue.wait();
+						} catch (InterruptedException e) {
+							Thread.currentThread().interrupt();
+						}
+					} else if (allTasksAreWaiting(jobQueue)) {
+						try {
+							Thread.sleep(50);
+						} catch (InterruptedException e) {
+							Thread.currentThread().interrupt();
+						}
+					}
+				}
+
+			}
+
+			private boolean allTasksAreWaiting(
+					ConcurrentLinkedQueue<PredicatedExecutable> jobQueue) {
+				for (PredicatedExecutable predicatedExecutable : jobQueue) {
+					if (predicatedExecutable.isReady()) {
+						return false;
+					}
+				}
+				return true;
+
+			}
+
+			@Override
+			public boolean isReady() {
+				// TODO Auto-generated method stub
+				return true;
+			}
+		};
+
+		this.jobQueue.add(sleepTask);
+	}
+
+	private void startCheckThread() {
+		new Thread(new Runnable() {
+
+			@Override
+			public void run() {
+
+				while (!stop) {
+					try {
+
+
+						synchronized (jobQueue) {
+							while(jobQueue.size() == 0 || allTasksAreWaiting(jobQueue)){
+								jobQueue.wait(50);
+							}
+						}
+
+						PredicatedExecutable job = jobQueue.remove();
+						if (job.isReady()) {
+							// remove from front and execute and you are done
+							threadPool.execute(job);
+						} else {
+							// add to end if not ready to run
+							jobQueue.add(job);
+						}
+
+
+
+					} catch (Throwable e) {
+						// we go on no matter what
+						e.printStackTrace();
+					}
+				}
+
+			}
+		}).start();
+	}
+
+	private  boolean allTasksAreWaiting(
+			ConcurrentLinkedQueue<PredicatedExecutable> jobQueue) {
+		for (PredicatedExecutable predicatedExecutable : jobQueue) {
+			if (predicatedExecutable.isReady()) {
+				return false;
+			}
+		}
+		return true;
+
+	}
+
+	public void scedule(PredicatedExecutable job) {
+
+		synchronized (jobQueue) {
+			this.jobQueue.add(job);
+			this.jobQueue.notifyAll();
+		}
+
+	}
+
+	public void shutDown() {
+		this.threadPool.shutdown();
+		this.stop = true;
+	}
+
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/AmazonCredential.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/AmazonCredential.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/AmazonCredential.java
new file mode 100644
index 0000000..fdf2267
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/AmazonCredential.java
@@ -0,0 +1,79 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.amazon;
+
+public class AmazonCredential {
+    private static AmazonCredential instance;
+    private String awsAccesskey;
+    private String awsSecretAccessKey;
+
+    private AmazonCredential() {
+        this.awsAccesskey = "";
+        this.awsSecretAccessKey = "";
+    }
+
+    /**
+     * 
+     * @return AmazonCredential
+     */
+    public static AmazonCredential getInstance() {
+        if (instance == null) {
+            instance = new AmazonCredential();
+        }
+        return instance;
+    }
+
+    /**
+     * 
+     * @param accesskey
+     */
+    public void setAwsAccessKeyId(String accesskey) {
+        this.awsAccesskey = accesskey;
+    }
+
+    /**
+     * 
+     * @param secretAccessKey
+     */
+    public void setAwsSecretAccessKey(String secretAccessKey) {
+        this.awsSecretAccessKey = secretAccessKey;
+    }
+
+    /**
+     * 
+     * @param accesskey
+     * @return
+     */
+    public String getAwsAccessKeyId() {
+        return this.awsAccesskey;
+    }
+
+    /**
+     * 
+     * @param secretAccessKey
+     * @return
+     */
+    public String getAwsSecretAccessKey() {
+        return this.awsSecretAccessKey;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/EC2InstanceResult.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/EC2InstanceResult.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/EC2InstanceResult.java
new file mode 100644
index 0000000..260ef2c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/amazon/EC2InstanceResult.java
@@ -0,0 +1,94 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.amazon;
+
+import org.apache.airavata.xbaya.ui.widgets.TableRenderable;
+
+import com.amazonaws.services.ec2.model.Instance;
+
+public class EC2InstanceResult implements TableRenderable {
+
+    private static String[] columnName = { "Instance", "AMI ID", "Root Device", "Type", "Status", "Key Pair Name",
+            "Monitoring", "Virtualization", "Placement Group" };
+
+    private Instance instance;
+
+    /**
+     * 
+     * Constructs a EC2InstancesResult.
+     * 
+     * @param ins
+     */
+    public EC2InstanceResult(Instance ins) {
+        this.instance = ins;
+    }
+
+    public Instance getInstance() {
+        return this.instance;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getColumnCount()
+     */
+    @Override
+    public int getColumnCount() {
+        return 8;
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getColumnTitle(int)
+     */
+    @Override
+    public String getColumnTitle(int index) {
+        return columnName[index];
+    }
+
+    /**
+     * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getValue(int)
+     */
+    @Override
+    public Object getValue(int index) {
+        switch (index) {
+        case 0:
+            return this.instance.getInstanceId();
+        case 1:
+            return this.instance.getImageId();
+        case 2:
+            return this.instance.getRootDeviceType();
+        case 3:
+            return this.instance.getInstanceType();
+        case 4:
+            return this.instance.getState().getName();
+        case 5:
+            return this.instance.getKeyName();
+        case 6:
+            return this.instance.getMonitoring().getState();
+        case 7:
+            return this.instance.getVirtualizationType();
+        case 8:
+            return this.instance.getPlacement().getGroupName();
+        default:
+            return null;
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java
new file mode 100644
index 0000000..2e0f4f5
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/BPELFiler.java
@@ -0,0 +1,145 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.generators;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.gpel.script.BPELScript;
+import org.apache.airavata.workflow.model.gpel.script.BPELScriptType;
+import org.apache.airavata.workflow.model.gpel.script.WorkflowWSDL;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.gpel.model.GpelProcess;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class BPELFiler {
+
+    private static Logger logger = LoggerFactory.getLogger(BPELFiler.class);
+
+    private XBayaEngine engine;
+
+    private JFileChooser bpelFileChooser;
+
+    private final FileFilter bpelFileFilter = new FileFilter() {
+
+        @Override
+        public String getDescription() {
+            return "BPEL Files";
+        }
+
+        @Override
+        public boolean accept(File file) {
+            if (file.isDirectory()) {
+                return true;
+            }
+            String name = file.getName();
+            if (name.endsWith(XBayaConstants.BPEL_SUFFIX)) {
+                return true;
+            }
+            return false;
+        }
+    };
+
+    /**
+     * Constructs a BPELFiler.
+     * 
+     * @param engine
+     */
+    public BPELFiler(XBayaEngine engine) {
+        this.engine = engine;
+
+        this.bpelFileChooser = new JFileChooser(XBayaPathConstants.BPEL_SCRIPT_DIRECTORY);
+        this.bpelFileChooser.addChoosableFileFilter(this.bpelFileFilter);
+
+    }
+
+    /**
+     * Exports a BPEL process to the local file
+     */
+    public void exportBPEL() {
+        Workflow workflow = this.engine.getGUI().getWorkflow();
+        BPELScript bpel = new BPELScript(workflow);
+
+        // Check if there is any errors in the workflow first.
+        ArrayList<String> warnings = new ArrayList<String>();
+        if (!bpel.validate(warnings)) {
+            StringBuilder buf = new StringBuilder();
+            for (String warning : warnings) {
+                buf.append("- ");
+                buf.append(warning);
+                buf.append("\n");
+            }
+            this.engine.getGUI().getErrorWindow().warning(buf.toString());
+            return;
+        }
+
+        int returnVal = this.bpelFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+            File file = this.bpelFileChooser.getSelectedFile();
+            logger.debug(file.getPath());
+
+            String path = file.getPath();
+
+            // Remove ".bpel" at the end if any
+            if (path.endsWith(XBayaConstants.BPEL_SUFFIX)) {
+                path = path.substring(0, path.length() - XBayaConstants.BPEL_SUFFIX.length());
+            }
+
+            // Add ".bpel" at the end of the file name
+            File bpelFile = new File(path + XBayaConstants.BPEL_SUFFIX);
+            // Add ".wsdl" at the end of the file name
+            File wsdlFile = new File(path + XBayaConstants.WSDL_SUFFIX);
+
+            try {
+                // Create the script.
+                bpel.create(BPELScriptType.BPEL2);
+
+                GpelProcess gpelProcess = bpel.getGpelProcess();
+                XMLUtil.saveXML(gpelProcess.xml(), bpelFile);
+
+                WorkflowWSDL workflowWSDL = bpel.getWorkflowWSDL();
+                XMLUtil.saveXML(workflowWSDL.getWsdlDefinitions().xml(), wsdlFile);
+
+            } catch (IOException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
+            } catch (GraphException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_NOT_READY_ERROR, e);
+            } catch (RuntimeException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Error e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            }
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ImageFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ImageFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ImageFiler.java
new file mode 100644
index 0000000..34902db
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ImageFiler.java
@@ -0,0 +1,106 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.generators;
+
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.imageio.ImageIO;
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ImageFiler {
+
+    private static Logger logger = LoggerFactory.getLogger(ImageFiler.class);
+
+    private XBayaEngine engine;
+
+    private JFileChooser pngFileChooser;
+
+    private final FileFilter pngFileFilter = new FileFilter() {
+        @Override
+        public String getDescription() {
+            return "PNG Files";
+        }
+
+        @Override
+        public boolean accept(File file) {
+            if (file.isDirectory()) {
+                return true;
+            }
+            String name = file.getName();
+            if (name.endsWith(XBayaConstants.PNG_SUFFIX)) {
+                return true;
+            }
+            return false;
+        }
+    };
+
+    /**
+     * Constructs an ImageFiler.
+     * 
+     * @param engine
+     */
+    public ImageFiler(XBayaEngine engine) {
+        this.engine = engine;
+
+        this.pngFileChooser = new JFileChooser();
+        this.pngFileChooser.addChoosableFileFilter(this.pngFileFilter);
+    }
+
+    /**
+     * Save the workflow image to the local file
+     */
+    public void saveWorkflowImage() {
+        int returnVal = this.pngFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+            File file = this.pngFileChooser.getSelectedFile();
+            logger.debug(file.getPath());
+
+            // Put ".png" at the end of the file name
+            String path = file.getPath();
+            if (!path.endsWith(XBayaConstants.PNG_SUFFIX)) {
+                file = new File(path + XBayaConstants.PNG_SUFFIX);
+            }
+
+            BufferedImage image;
+            try {
+                image = this.engine.getGUI().getWorkflow().getImage();
+                ImageIO.write(image, XBayaConstants.PNG_FORMAT_NAME, file);
+            } catch (IOException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
+            } catch (RuntimeException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Error e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            }
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/JythonFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/JythonFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/JythonFiler.java
new file mode 100644
index 0000000..b2dd641
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/JythonFiler.java
@@ -0,0 +1,128 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.generators;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import org.apache.airavata.common.utils.IOUtil;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.jython.script.JythonScript;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class JythonFiler {
+
+    private static Logger logger = LoggerFactory.getLogger(JythonFiler.class);
+
+    private XBayaEngine engine;
+
+    private JFileChooser jythonFileChooser;
+
+    private final FileFilter jythonFileFilter = new FileFilter() {
+        @Override
+        public String getDescription() {
+            return "Jython Scripts";
+        }
+
+        @Override
+        public boolean accept(File file) {
+            if (file.isDirectory()) {
+                return true;
+            }
+            String name = file.getName();
+            if (name.endsWith(XBayaConstants.JYTHON_SCRIPT_SUFFIX)) {
+                return true;
+            }
+            return false;
+        }
+    };
+
+    /**
+     * Constructs a JythonFile.
+     * 
+     * @param engine
+     */
+    public JythonFiler(XBayaEngine engine) {
+        this.engine = engine;
+        this.jythonFileChooser = new JFileChooser(XBayaPathConstants.JYTHON_SCRIPT_DIRECTORY);
+        this.jythonFileChooser.addChoosableFileFilter(this.jythonFileFilter);
+    }
+
+    /**
+     * Exports a Jython script to the local file
+     */
+    public void exportJythonScript() {
+        Workflow workflow = this.engine.getGUI().getWorkflow();
+        JythonScript script = new JythonScript(workflow, this.engine.getConfiguration());
+
+        // Check if there is any errors in the workflow first.
+        ArrayList<String> warnings = new ArrayList<String>();
+        if (!script.validate(warnings)) {
+            StringBuilder buf = new StringBuilder();
+            for (String warning : warnings) {
+                buf.append("- ");
+                buf.append(warning);
+                buf.append("\n");
+            }
+            this.engine.getGUI().getErrorWindow().warning(buf.toString());
+            return;
+        }
+
+        int returnVal = this.jythonFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+            File file = this.jythonFileChooser.getSelectedFile();
+            logger.debug(file.getPath());
+
+            // Put ".py" at the end of the file name
+            String path = file.getPath();
+            if (!path.endsWith(XBayaConstants.JYTHON_SCRIPT_SUFFIX)) {
+                file = new File(path + XBayaConstants.JYTHON_SCRIPT_SUFFIX);
+            }
+
+            try {
+                // Create the script.
+                script.create();
+                // Write to a file
+                IOUtil.writeToFile(script.getJythonString(), file);
+            } catch (IOException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
+            } catch (GraphException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+            } catch (RuntimeException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Error e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            }
+        }
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java
new file mode 100644
index 0000000..a1573d4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ODEScriptFiler.java
@@ -0,0 +1,165 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.generators;
+
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Map;
+import java.util.Set;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.WSDLUtil;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.gpel.model.GpelProcess;
+import org.xmlpull.infoset.XmlElement;
+
+import xsul5.XmlConstants;
+import xsul5.wsdl.WsdlDefinitions;
+
+public class ODEScriptFiler {
+
+    private XBayaEngine engine;
+
+    private JFileChooser bpelFileChooser;
+
+    private final FileFilter bpelFileFilter = new FileFilter() {
+
+        @Override
+        public String getDescription() {
+            return "BPEL Files";
+        }
+
+        @Override
+        public boolean accept(File file) {
+            if (file.isDirectory()) {
+                return true;
+            }
+            String name = file.getName();
+            if (name.endsWith(XBayaConstants.BPEL_SUFFIX)) {
+                return true;
+            }
+            return false;
+        }
+    };
+
+    /**
+     * Constructs a ODEScriptFiler.
+     * 
+     * @param engine
+     */
+    public ODEScriptFiler(XBayaEngine engine) {
+        this.engine = engine;
+
+        this.bpelFileChooser = new JFileChooser(XBayaPathConstants.BPEL_SCRIPT_DIRECTORY);
+        this.bpelFileChooser.addChoosableFileFilter(this.bpelFileFilter);
+    }
+
+    /**
+	 * 
+	 */
+    public void save() {
+        Workflow wf = this.engine.getGUI().getWorkflow();
+        if (0 == wf.getGraph().getNodes().size()) {
+            this.engine.getGUI().getErrorWindow().warning("Workflow is Empty");
+            return;
+        }
+        GpelProcess process;
+        try {
+
+            int returnVal = this.bpelFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
+            if (returnVal == JFileChooser.APPROVE_OPTION) {
+                File file = this.bpelFileChooser.getSelectedFile();
+
+                String path = file.getPath();
+
+                // Remove ".bpel" at the end if any
+                if (path.endsWith(XBayaConstants.BPEL_SUFFIX)) {
+                    path = path.substring(0, path.length() - XBayaConstants.BPEL_SUFFIX.length());
+                }
+
+                // Add ".bpel" at the end of the file name
+                File bpelFile = new File(path + XBayaConstants.BPEL_SUFFIX);
+                // Add ".wsdl" at the end of the file name
+                File wsdlFile = new File(path + XBayaConstants.WSDL_SUFFIX);
+                // todo this has to fix, for compilation purpose passing dummy value instead of xregistry url
+                URI temp = null;
+                try {
+                    temp = new URI("temp");
+                } catch (URISyntaxException e) {
+                    e.printStackTrace(); // To change body of catch statement use File | Settings | File Templates.
+                }
+                process = wf.getOdeProcess(WSDLUtil.appendWSDLQuary(temp), this.engine.getConfiguration().getODEURL());
+                String processString = process.xmlStringPretty();
+                FileWriter writer = new FileWriter(bpelFile);
+                writer.write(processString);
+                writer.close();
+
+                WsdlDefinitions workflowWSDL = wf.getOdeWorkflowWSDL(this.engine.getConfiguration().getDSCURL(),
+                        this.engine.getConfiguration().getODEURL());
+                String workflowWsdlStr = XmlConstants.BUILDER.serializeToStringPretty(workflowWSDL.xml());
+                writer = new FileWriter(wsdlFile);
+                writer.write(workflowWsdlStr);
+
+                Map<String, WsdlDefinitions> wsdlMap = wf.getOdeServiceWSDLs(
+                        this.engine.getConfiguration().getDSCURL(), this.engine.getConfiguration().getODEURL());
+                Set<String> keySet = wsdlMap.keySet();
+                for (String string : keySet) {
+                    writer = new FileWriter(new File(wsdlFile.getParent(), QName.valueOf(string).getLocalPart()));
+                    writer.write(XmlConstants.BUILDER.serializeToStringPretty(wsdlMap.get(string).xml()));
+                    writer.close();
+                }
+
+                XmlElement deployDescriptor = wf.getODEDeploymentDescriptor(this.engine.getConfiguration().getDSCURL(),
+                        this.engine.getConfiguration().getODEURL());
+                writer = new FileWriter(new File(wsdlFile.getParent(), "deploy.xml"));
+                writer.write(XmlConstants.BUILDER.serializeToString(deployDescriptor));
+                writer.close();
+
+            }
+
+        } catch (IOException e) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
+        } catch (GraphException e) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+        } catch (RuntimeException e) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        } catch (Error e) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        } catch (ComponentException e) {
+            this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+        }
+
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ScuflFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ScuflFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ScuflFiler.java
new file mode 100644
index 0000000..bed2bc4
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/ScuflFiler.java
@@ -0,0 +1,127 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.generators;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import org.apache.airavata.common.utils.IOUtil;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.scufl.script.ScuflScript;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ScuflFiler {
+
+    private static Logger logger = LoggerFactory.getLogger(ScuflFiler.class);
+
+    private XBayaEngine engine;
+
+    private JFileChooser scuflFileChooser;
+
+    private final FileFilter scuflFileFilter = new FileFilter() {
+        @Override
+        public String getDescription() {
+            return "Scufl Scripts";
+        }
+
+        @Override
+        public boolean accept(File file) {
+            if (file.isDirectory()) {
+                return true;
+            }
+            String name = file.getName();
+            if (name.endsWith(XBayaConstants.SCUFL_SCRIPT_SUFFIX)) {
+                return true;
+            }
+            return false;
+        }
+    };
+
+    /**
+     * Constructs a ScuflFiler.
+     * 
+     * @param engine
+     */
+    public ScuflFiler(XBayaEngine engine) {
+        this.engine = engine;
+        this.scuflFileChooser = new JFileChooser(XBayaPathConstants.SCUFL_SCRIPT_DIRECTORY);
+        this.scuflFileChooser.addChoosableFileFilter(this.scuflFileFilter);
+    }
+
+    /**
+     * Exports a Scufl script to the local file
+     */
+    public void exportScuflScript() {
+        Workflow workflow = this.engine.getGUI().getWorkflow();
+        ScuflScript script = new ScuflScript(workflow, this.engine.getConfiguration());
+
+        // Check if there is any errors in the workflow first.
+        ArrayList<String> warnings = new ArrayList<String>();
+        if (!script.validate(warnings)) {
+            StringBuilder buf = new StringBuilder();
+            for (String warning : warnings) {
+                buf.append("- ");
+                buf.append(warning);
+                buf.append("\n");
+            }
+            this.engine.getGUI().getErrorWindow().warning(buf.toString());
+            return;
+        }
+        int returnVal = this.scuflFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+            File file = this.scuflFileChooser.getSelectedFile();
+            logger.debug(file.getPath());
+
+            // Put ".py" at the end of the file name
+            String path = file.getPath();
+            if (!path.endsWith(XBayaConstants.SCUFL_SCRIPT_SUFFIX)) {
+                file = new File(path + XBayaConstants.SCUFL_SCRIPT_SUFFIX);
+            }
+
+            try {
+                // Create the script.
+                script.create();
+                // Write to a file
+                IOUtil.writeToFile(script.getScript(), file);
+            } catch (IOException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
+            } catch (GraphException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+            } catch (RuntimeException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Error e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            }
+        }
+
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
new file mode 100644
index 0000000..46c567c
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/WorkflowFiler.java
@@ -0,0 +1,267 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.generators;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import javax.swing.JFileChooser;
+import javax.swing.filechooser.FileFilter;
+
+import org.apache.airavata.common.utils.XMLUtil;
+import org.apache.airavata.workflow.model.component.ComponentException;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.ws.WSGraph;
+import org.apache.airavata.workflow.model.graph.ws.WSGraphFactory;
+import org.apache.airavata.workflow.model.wf.Workflow;
+import org.apache.airavata.xbaya.XBayaConstants;
+import org.apache.airavata.xbaya.XBayaEngine;
+import org.apache.airavata.xbaya.file.XBayaPathConstants;
+import org.apache.airavata.xbaya.ui.graph.GraphCanvas;
+import org.apache.airavata.xbaya.ui.utils.ErrorMessages;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.xmlpull.infoset.XmlElement;
+
+public class WorkflowFiler {
+
+    private static Logger logger = LoggerFactory.getLogger(WorkflowFiler.class);
+
+    private XBayaEngine engine;
+
+    private JFileChooser graphFileChooser;
+
+    private final FileFilter graphFileFilter = new FileFilter() {
+
+        @Override
+        public String getDescription() {
+            return "Workflow Files";
+        }
+
+        @Override
+        public boolean accept(File file) {
+            if (file.isDirectory()) {
+                return true;
+            }
+            String name = file.getName();
+            if (name.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
+                return true;
+            } else if (name.endsWith(XBayaConstants.WORKFLOW_FILE_SUFFIX)) {
+                return true;
+            }
+            return false;
+        }
+    };
+
+    /**
+     * Creates a FileMenu.
+     * 
+     * @param engine
+     *            the XwfClient, which is used to retrieve the current workflow graph.
+     */
+    public WorkflowFiler(XBayaEngine engine) {
+        this.engine = engine;
+
+        this.graphFileChooser = new JFileChooser(XBayaPathConstants.WORKFLOW_DIRECTORY);
+        this.graphFileChooser.addChoosableFileFilter(this.graphFileFilter);
+        this.graphFileChooser.setFileFilter(this.graphFileFilter);
+
+    }
+
+    /**
+     * Opens a current workflow from the local file.
+     */
+    public void openWorkflow() {
+        Workflow workflow = null;
+        int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());
+
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+            File file = this.graphFileChooser.getSelectedFile();
+            logger.debug(file.getPath());
+
+            try {
+                String path = file.getPath();
+
+                if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
+                    WSGraph graph = WSGraphFactory.createGraph(file);
+                    workflow = Workflow.graphToWorkflow(graph);
+                } else {
+                    XmlElement workflowElement = XMLUtil.loadXML(file);
+                    workflow = new Workflow(workflowElement);
+                }
+                GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
+                newGraphCanvas.setWorkflow(workflow);
+                //this.engine.setWorkflow(workflow);
+                engine.getGUI().getGraphCanvas().setWorkflowFile(file);
+            } catch (IOException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);
+            } catch (GraphException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+            } catch (ComponentException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+            } catch (RuntimeException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Error e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            }
+        }
+        
+    }
+
+    /**
+     * Saves a current workflow to the local file.
+     */
+    public void saveWorkflow() {
+		saveWorkflow(engine.getGUI().getGraphCanvas());
+    }
+
+    public void saveAsWorkflow() {
+		GraphCanvas graphCanvas = engine.getGUI().getGraphCanvas();
+		File saveAsWorkflowFile = saveAsWorkflow(graphCanvas);
+		if (saveAsWorkflowFile!=null){
+        	graphCanvas.setWorkflowFile(saveAsWorkflowFile);
+		}
+    }
+    
+	public void saveWorkflow(GraphCanvas graphCanvas) {
+		if (graphCanvas.getWorkflowFile()==null){
+        	File saveAsWorkflowFile = saveAsWorkflow(graphCanvas);
+        	graphCanvas.setWorkflowFile(saveAsWorkflowFile);
+        }else{
+        	saveWorkflow(graphCanvas.getWorkflow(), graphCanvas.getWorkflowFile());
+        }
+		if (graphCanvas.getWorkflowFile()!=null){
+			graphCanvas.workflowSaved();
+		}
+	}
+    
+    public void saveAllWorkflows(){
+    	List<GraphCanvas> graphCanvases = engine.getGUI().getGraphCanvases();
+    	for (GraphCanvas graphCanvas : graphCanvases) {
+    		saveWorkflow(graphCanvas);
+		}
+    }
+
+	public File saveAsWorkflow(GraphCanvas graphCanvas) {
+		int returnVal = this.graphFileChooser.showSaveDialog(this.engine.getGUI().getFrame());
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+            File file = this.graphFileChooser.getSelectedFile();
+            logger.debug(file.getPath());
+
+            // Put ".xwf" at the end of the file name
+            String path = file.getPath();
+            if (!path.endsWith(XBayaConstants.WORKFLOW_FILE_SUFFIX)) {
+                file = new File(path + XBayaConstants.WORKFLOW_FILE_SUFFIX);
+            }
+            saveWorkflow(graphCanvas.getWorkflow(),file);
+            return file;
+        }
+        return null;
+	}
+
+	private void saveWorkflow(Workflow workflow, File file) {
+		try {
+		    XMLUtil.saveXML(workflow.toXML(), file);
+		} catch (IOException e) {
+		    this.engine.getGUI().getErrorWindow().error(ErrorMessages.WRITE_FILE_ERROR, e);
+		} catch (RuntimeException e) {
+		    this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_SAVE_ERROR, e);
+		} catch (Error e) {
+		    this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+		}
+	}
+
+    /**
+     * Imports a workflow from the local file to the current workflow.
+     */
+    public void importWorkflow() {
+        int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+            File file = this.graphFileChooser.getSelectedFile();
+            try {
+
+                String path = file.getPath();
+                Workflow importedWorkflow;
+                if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
+                    WSGraph importedGraph = WSGraphFactory.createGraph(file);
+                    importedWorkflow = Workflow.graphToWorkflow(importedGraph);
+                } else {
+                    XmlElement importedWorkflowElement = XMLUtil.loadXML(file);
+                    importedWorkflow = new Workflow(importedWorkflowElement);
+                }
+                GraphCanvas newGraphCanvas = engine.getGUI().newGraphCanvas(true);
+                newGraphCanvas.setWorkflow(importedWorkflow);
+                this.engine.getGUI().setWorkflow(importedWorkflow);
+                engine.getGUI().getGraphCanvas().setWorkflowFile(file);
+
+            } catch (IOException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);
+            } catch (GraphException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+            } catch (ComponentException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+            } catch (RuntimeException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Error e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            }
+        }
+    }
+    /**
+     * @param workflow
+     * @return
+     */
+    public Workflow getWorkflow() {
+        Workflow workflow = null;
+        int returnVal = this.graphFileChooser.showOpenDialog(this.engine.getGUI().getFrame());
+
+        if (returnVal == JFileChooser.APPROVE_OPTION) {
+            File file = this.graphFileChooser.getSelectedFile();
+            logger.debug(file.getPath());
+
+            try {
+                String path = file.getPath();
+
+                if (path.endsWith(XBayaConstants.GRAPH_FILE_SUFFIX)) {
+                    WSGraph graph = WSGraphFactory.createGraph(file);
+                    workflow = Workflow.graphToWorkflow(graph);
+                } else {
+                    XmlElement workflowElement = XMLUtil.loadXML(file);
+                    workflow = new Workflow(workflowElement);
+                }
+
+            } catch (IOException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.OPEN_FILE_ERROR, e);
+            } catch (GraphException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+            } catch (ComponentException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_FORMAT_ERROR, e);
+            } catch (RuntimeException e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            } catch (Error e) {
+                this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
+            }
+        }
+        return workflow;
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/XmlBeansFiler.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/XmlBeansFiler.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/XmlBeansFiler.java
new file mode 100644
index 0000000..2bb8381
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/generators/XmlBeansFiler.java
@@ -0,0 +1,71 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.generators;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.Writer;
+import java.util.LinkedList;
+import java.util.List;
+
+public class XmlBeansFiler /* implements Filer */{
+
+    private String path;
+
+    private List<File> javaFilePaths = new LinkedList<File>();
+
+    /**
+     * Constructs a XmlBeansFiler.
+     * 
+     * @param file
+     */
+    public XmlBeansFiler(String path) {
+        this.path = path + "/generated";
+    }
+
+    /**
+     * @see org.apache.xmlbeans.Filer#createBinaryFile(java.lang.String)
+     */
+    public OutputStream createBinaryFile(String name) throws IOException {
+        name = name.replace('.', File.separatorChar);
+        String binPath = this.path + File.separatorChar + name;
+        File srcFile = new File(binPath);
+        srcFile.getParentFile().mkdirs();
+        return new FileOutputStream(new File(binPath));
+    }
+
+    /**
+     * @see org.apache.xmlbeans.Filer#createSourceFile(java.lang.String)
+     */
+    public Writer createSourceFile(String name) throws IOException {
+        name = name.replace('.', File.separatorChar);
+        String srcPath = this.path + File.separatorChar + name + ".java";
+        File srcFile = new File(srcPath);
+        srcFile.getParentFile().mkdirs();
+        javaFilePaths.add(new File(srcFile.getCanonicalPath()));
+        return new FileWriter(srcFile);
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/ide/XBayaExecutionModeListener.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/ide/XBayaExecutionModeListener.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/ide/XBayaExecutionModeListener.java
new file mode 100644
index 0000000..9ba3ac5
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/ide/XBayaExecutionModeListener.java
@@ -0,0 +1,34 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.ide;
+
+import org.apache.airavata.xbaya.XBayaConfiguration;
+
+public interface XBayaExecutionModeListener {
+	/**
+	 * Triggers when the execution mode in xbaya is changed
+	 * For possition executions modes see, 
+	 * 			XBayaConfiguration.XBayaExecutionMode
+	 * @param config - XBaya configuration object
+	 */
+	public void executionModeChanged(XBayaConfiguration config);
+}

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/workflow/ParameterListModel.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/workflow/ParameterListModel.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/workflow/ParameterListModel.java
new file mode 100644
index 0000000..7329639
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/core/workflow/ParameterListModel.java
@@ -0,0 +1,88 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.core.workflow;
+
+import java.util.Collections;
+import java.util.List;
+
+import javax.swing.AbstractListModel;
+
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.system.ParameterNode;
+
+public class ParameterListModel extends AbstractListModel {
+
+    private List<? extends ParameterNode> parameterNodes;
+
+    /**
+     * Constructs a ParameterListModel.
+     * 
+     * @param parameterNodes
+     * @param nodes
+     */
+    public ParameterListModel(List<? extends ParameterNode> parameterNodes) {
+        this.parameterNodes = parameterNodes;
+    }
+
+    /**
+     * @see javax.swing.ListModel#getElementAt(int)
+     */
+    public Object getElementAt(int index) {
+        return this.parameterNodes.get(index).getName();
+    }
+
+    /**
+     * @see javax.swing.ListModel#getSize()
+     */
+    public int getSize() {
+        return this.parameterNodes.size();
+    }
+
+    /**
+     * Moves the node at the index up.
+     * 
+     * @param index
+     */
+    public void up(int index) {
+        if (index < 1 || index >= this.parameterNodes.size()) {
+            throw new WorkflowRuntimeException("Illegal index: " + index);
+        }
+        swap(index - 1, index);
+    }
+
+    /**
+     * Moves the node at the index down.
+     * 
+     * @param index
+     */
+    public void down(int index) {
+        if (index < 0 || index >= this.parameterNodes.size() - 1) {
+            throw new WorkflowRuntimeException("Illegal index: " + index);
+        }
+        swap(index, index + 1);
+    }
+
+    private void swap(int index0, int index1) {
+        Collections.swap(this.parameterNodes, index0, index1);
+        fireContentsChanged(this, index0, index1);
+    }
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/datadriven/WorkflowHarvester.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/datadriven/WorkflowHarvester.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/datadriven/WorkflowHarvester.java
new file mode 100644
index 0000000..7202999
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/datadriven/WorkflowHarvester.java
@@ -0,0 +1,191 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.datadriven;
+
+import java.awt.Point;
+import java.util.LinkedList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+
+import org.apache.airavata.common.utils.Pair;
+import org.apache.airavata.workflow.model.component.system.InputComponent;
+import org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException;
+import org.apache.airavata.workflow.model.graph.DataPort;
+import org.apache.airavata.workflow.model.graph.GraphException;
+import org.apache.airavata.workflow.model.graph.Node;
+import org.apache.airavata.workflow.model.graph.Port;
+import org.apache.airavata.workflow.model.graph.impl.NodeImpl;
+import org.apache.airavata.workflow.model.graph.system.InputNode;
+import org.apache.airavata.workflow.model.graph.ws.WSNode;
+import org.apache.airavata.workflow.model.wf.Workflow;
+
+public class WorkflowHarvester {
+
+    public WorkflowHarvester() {
+
+    }
+
+    public Workflow[] harvest(Workflow workflow, QName dataType) {
+        LinkedList<Workflow> harvest = new LinkedList<Workflow>();
+        LinkedList<Pair<String, String>> candidates = getCandidates(workflow, dataType);
+        for (Pair<String, String> pair : candidates) {
+            Workflow clone = workflow.clone();
+
+            NodeImpl node = clone.getGraph().getNode(pair.getLeft());
+            if (null == node) {
+                throw new WorkflowRuntimeException("Specified node not found:" + pair.getLeft());
+            }
+            Port candidatePort = null;
+            List<DataPort> inPorts = node.getInputPorts();
+            for (DataPort dataPort : inPorts) {
+                if (pair.getRight().equals(dataPort.getID())) {
+                    candidatePort = dataPort;
+                    break;
+                }
+            }
+            if (null == candidatePort) {
+                throw new WorkflowRuntimeException("Specifies Port was not found:" + pair.getRight());
+            }
+            if (!(candidatePort.getFromNode() instanceof InputNode)) {
+                removeUnnecessaryNodes(node, candidatePort, clone);
+                Node input = clone.addNode(new InputComponent());
+                input.setPosition(new Point(Math.max(0, node.getPosition().x - 150), node.getPosition().y));
+
+                // the returned workflows size should be less than that of the
+                // original
+                if (clone.getGraph().getNodes().size() < workflow.getGraph().getNodes().size()
+                // if the sizes the different its a candidate, but need
+                // to make sure
+                // its not the same as one already harvested
+                        && !isWorkflowAlreadyHarvested(harvest, clone)) {
+                    try {
+                        clone.getGraph().addEdge(input.getOutputPort(0), candidatePort);
+                        cleanLeftOverInputNodes(clone);
+                    } catch (GraphException e) {
+                        throw new RuntimeException(e);
+                    }
+
+                    harvest.add(clone);
+                }
+
+            }
+        }
+        return harvest.toArray(new Workflow[0]);
+    }
+
+    /**
+     * @param clone
+     */
+    private void cleanLeftOverInputNodes(Workflow clone) {
+
+        List<NodeImpl> nodes = clone.getGraph().getNodes();
+        LinkedList<Node> removeList = new LinkedList<Node>();
+        for (Node nodeImpl : nodes) {
+            if (nodeImpl instanceof InputNode) {
+                if (nodeImpl.getOutputPort(0).getToNodes().size() == 0) {
+                    removeList.add(nodeImpl);
+                }
+            }
+        }
+        for (Node node : removeList) {
+            try {
+                clone.removeNode(node);
+            } catch (GraphException e) {
+                throw new WorkflowRuntimeException(e);
+            }
+        }
+    }
+
+    /**
+     * @param harvest
+     * @param clone
+     * @return
+     */
+    private boolean isWorkflowAlreadyHarvested(LinkedList<Workflow> harvest, Workflow clone) {
+        for (Workflow workflow : harvest) {
+            if (workflow.equals(clone)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @param pair
+     * @param clone
+     */
+    private void removeUnnecessaryNodes(Node node, Port candidatePort, Workflow workflow) {
+        if (candidatePort.getFromPort().getEdges().size() == 1) {
+            Node fromNode = candidatePort.getFromNode();
+            try {
+                List<DataPort> inputPorts = fromNode.getInputPorts();
+                for (DataPort dataPort : inputPorts) {
+                    removeUnnecessaryNodes(fromNode, dataPort, workflow);
+                }
+                workflow.removeNode(fromNode);
+            } catch (GraphException e) {
+                throw new WorkflowRuntimeException(e);
+            }
+        }
+    }
+
+    /**
+     * @param pair
+     * @return
+     */
+    private List<DataPort> getRemainderPorts(Pair<WSNode, DataPort> pair) {
+        LinkedList<DataPort> ret = new LinkedList<DataPort>();
+        List<DataPort> inputPorts = pair.getLeft().getInputPorts();
+        for (DataPort dataPort : inputPorts) {
+            if (pair.getRight() != dataPort) {
+                ret.add(dataPort);
+            }
+        }
+        return ret;
+    }
+
+    /**
+     * @param workflow
+     * @param dataType
+     * @return pair of nodeid and portid
+     */
+    private LinkedList<Pair<String, String>> getCandidates(Workflow workflow, QName dataType) {
+        LinkedList<Pair<String, String>> candidates = new LinkedList<Pair<String, String>>();
+        List<NodeImpl> nodes = workflow.getGraph().getNodes();
+        for (NodeImpl node : nodes) {
+            if (node instanceof WSNode) {
+                List<DataPort> inputPorts = ((WSNode) node).getInputPorts();
+                for (DataPort dataPort : inputPorts) {
+
+                    if (dataType.equals(dataPort.getType())) {
+                        candidates.add(new Pair<String, String>(node.getID(), dataPort.getID()));
+                    }
+
+                }
+            }
+        }
+
+        return candidates;
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/XBayaPathConstants.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/XBayaPathConstants.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/XBayaPathConstants.java
new file mode 100644
index 0000000..659b30b
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/file/XBayaPathConstants.java
@@ -0,0 +1,64 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.file;
+
+import java.io.File;
+
+public interface XBayaPathConstants {
+
+    /**
+     * Root directory of the server.
+     */
+    public static final String XBAYA_DIRECTORY = "modules" + File.separator + "xbaya-gui";
+
+    /**
+     * The path of the directory that stores component definitions.
+     */
+    public static final String WSDL_DIRECTORY = XBAYA_DIRECTORY + File.separator + "src" + File.separator + "main"
+            + File.separator + "resources" + File.separator + "wsdls";
+
+    /**
+     * The path of the directory that stores graphs.
+     */
+    public static final String WORKFLOW_DIRECTORY = XBAYA_DIRECTORY + File.separator + "workflows";
+
+    /**
+     * The path of the directory where the scripts are saved.
+     */
+    public static final String SCRIPT_DIRECTORY = XBAYA_DIRECTORY + File.separator + "scripts";
+
+    /**
+     * The path of the directory where the BPEL scripts are saved.
+     */
+    public static final String JYTHON_SCRIPT_DIRECTORY = SCRIPT_DIRECTORY + File.separator + "jython";
+
+    /**
+     * The path of the directory where the BPEL scripts are saved.
+     */
+    public static final String BPEL_SCRIPT_DIRECTORY = SCRIPT_DIRECTORY + File.separator + "bpel";
+
+    /**
+     * The path of the directory where the scufl scripts are saved.
+     */
+    public static final String SCUFL_SCRIPT_DIRECTORY = SCRIPT_DIRECTORY + File.separator + "scufl";
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/airavata/blob/9c47eec8/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java
----------------------------------------------------------------------
diff --git a/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java
new file mode 100644
index 0000000..cdb4c8a
--- /dev/null
+++ b/modules/xbaya-gui/src/main/java/org/apache/airavata/xbaya/gfac/GFacRegistryClient.java
@@ -0,0 +1,169 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+package org.apache.airavata.xbaya.gfac;
+
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import org.apache.airavata.workflow.model.component.ComponentRegistryException;
+import org.xmlpull.v1.builder.Iterable;
+import org.xmlpull.v1.builder.XmlElement;
+
+import xsul.wsif.WSIFMessage;
+import xsul.wsif.impl.WSIFMessageElement;
+
+public class GFacRegistryClient {
+
+    /**
+     * GFAC_NAMESPACE
+     */
+    public static final String GFAC_NAMESPACE = "http://www.extreme.indiana.edu/namespaces/2004/01/gFac";
+
+    private static final String SEARCH_SERVICE_INSTANCE = "searchServiceInstance";
+
+    private static final String SEARCH_SERVIE = "searchService";
+
+    private static final String QNAME = "qname";
+
+    private static final String DESC_AS_STRING = "descAsStr";
+
+    private static final String LIFE_TIME = "lifetimeAsSeconds";
+
+    private static final String RESULTS = "results";
+
+    private static final String GET_ABSTRACT_WSDL = "getAbstractWsdl";
+
+    private String wsdlURL;
+
+    private SimpleWSClient client;
+
+    /**
+     * Constructs a GFacRegistryClient.
+     * 
+     * @param wsdlURL
+     */
+    public GFacRegistryClient(URI wsdlURL) {
+        this(wsdlURL.toString());
+    }
+
+    /**
+     * Constructs a GfacRegistryClient.
+     * 
+     * @param wsdlURL
+     */
+    public GFacRegistryClient(String wsdlURL) {
+        this.wsdlURL = wsdlURL;
+        this.client = new SimpleWSClient();
+    }
+
+    /**
+     * @param appDescAsStr
+     * @throws ComponentRegistryException
+     */
+    public void registerAppDesc(String appDescAsStr) throws ComponentRegistryException {
+        this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { DESC_AS_STRING, appDescAsStr } },
+                "registerAppDesc");
+    }
+
+    /**
+     * @param wsdlAsStr
+     * @param lifetimeAsSeconds
+     * @throws ComponentRegistryException
+     */
+    public void registerConcreteWsdl(String wsdlAsStr, int lifetimeAsSeconds) throws ComponentRegistryException {
+        this.client.sendSOAPMessage(this.wsdlURL,
+                new String[][] { { DESC_AS_STRING, wsdlAsStr }, { LIFE_TIME, String.valueOf(lifetimeAsSeconds) } },
+                "registerConcreteWsdl");
+
+    }
+
+    /**
+     * @param wsdlQName
+     * @return The concrete WSDL
+     * @throws ComponentRegistryException
+     */
+    public String getConcreteWsdl(String wsdlQName) throws ComponentRegistryException {
+        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, wsdlQName } },
+                "getConcreateWsdl");
+        return (String) response.getObjectPart(DESC_AS_STRING);
+    }
+
+    /**
+     * @param wsdlQName
+     * @throws ComponentRegistryException
+     */
+    public void removeConcreteWsdl(String wsdlQName) throws ComponentRegistryException {
+        this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, wsdlQName } }, "removeConcreteWsdl");
+
+    }
+
+    /**
+     * @param serviceName
+     * @return The list of concreate WSDL QNames.
+     * @throws ComponentRegistryException
+     */
+    public String[] findService(String serviceName) throws ComponentRegistryException {
+        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, serviceName } },
+                SEARCH_SERVICE_INSTANCE);
+        return findArrayValue(RESULTS, (WSIFMessageElement) response).toArray(new String[] {});
+    }
+
+    /**
+     * @param serviceName
+     * @return The list of abstract WSDL QNames.
+     * @throws ComponentRegistryException
+     */
+    public String[] findServiceDesc(String serviceName) throws ComponentRegistryException {
+        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, serviceName } },
+                SEARCH_SERVIE);
+        return findArrayValue(RESULTS, (WSIFMessageElement) response).toArray(new String[] {});
+    }
+
+    /**
+     * @param wsdlQName
+     * @return The AWSDL.
+     * @throws ComponentRegistryException
+     */
+    public String getAbstractWsdl(String wsdlQName) throws ComponentRegistryException {
+        WSIFMessage response = this.client.sendSOAPMessage(this.wsdlURL, new String[][] { { QNAME, wsdlQName } },
+                GET_ABSTRACT_WSDL);
+        return (String) response.getObjectPart(DESC_AS_STRING);
+    }
+
+    private static ArrayList<String> findArrayValue(String name, WSIFMessageElement response) {
+        XmlElement param = response.element(null, name);
+        if (param != null) {
+            Iterable it = param.elements(null, "value");
+            if (it != null) {
+                ArrayList<String> values = new ArrayList<String>();
+
+                Iterator arrayValues = it.iterator();
+                while (arrayValues.hasNext()) {
+                    values.add(((XmlElement) arrayValues.next()).requiredTextContent());
+                }
+                return values;
+            }
+        }
+        return null;
+    }
+}