Author: samindaw
Date: Wed Oct 23 19:42:56 2013
New Revision: 1535133
URL: http://svn.apache.org/r1535133
Log:
removing phoebus from gfac-core and updating the phoebus-integration library
Removed:
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/phoebus/
airavata/trunk/modules/gfac-core/src/main/java/org/apache/airavata/gfac/utils/PhoebusUtils.java
Modified:
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/phoebus/impl/PhoebusGridConfigurationHandler.java
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java
Modified:
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/phoebus/impl/PhoebusGridConfigurationHandler.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/phoebus/impl/PhoebusGridConfigurationHandler.java?rev=1535133&r1=1535132&r2=1535133&view=diff
==============================================================================
---
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/phoebus/impl/PhoebusGridConfigurationHandler.java
(original)
+++
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/phoebus/impl/PhoebusGridConfigurationHandler.java
Wed Oct 23 19:42:56 2013
@@ -21,25 +21,52 @@
package org.apache.airavata.core.gfac.phoebus.impl;
-//import org.apache.airavata.core.gfac.external.GridConfigurationHandler;
+import org.apache.airavata.common.utils.Version;
+import org.apache.airavata.common.utils.Version.BuildType;
import org.apache.airavata.core.gfac.utils.PhoebusUtils;
+import org.apache.airavata.gfac.utils.GridConfigurationHandler;
import org.globus.ftp.DataChannelAuthentication;
import org.globus.ftp.GridFTPClient;
//
-public class PhoebusGridConfigurationHandler {
-//
-// @Override
-// public void handleSourceFTPClient(GridFTPClient client) throws
Exception {
-// if
(PhoebusUtils.isPhoebusDriverConfigurationsDefined(client.getHost())) {
-//
client.setDataChannelAuthentication(DataChannelAuthentication.NONE);
-// client.site("SITE SETNETSTACK phoebus:" +
PhoebusUtils.getPhoebusDataChannelXIODriverParameters(client.getHost()));
-// }
-// }
-//
-// @Override
-// public void handleDestinationFTPClient(GridFTPClient client)
-// throws Exception {
-//
-// }
+public class PhoebusGridConfigurationHandler implements
GridConfigurationHandler{
+ private static String HANDLER_NAME="PHOEBUS";
+
+ public void handleFileTransferFTPClientConfigurations(GridFTPClient
source, GridFTPClient destination) throws GridConfigurationHandlerException {
+ try {
+ if (source!=null &&
PhoebusUtils.isPhoebusDriverConfigurationsDefined(source.getHost())) {
+
source.setDataChannelAuthentication(DataChannelAuthentication.NONE);
+ source.site("SITE SETNETSTACK phoebus:" +
PhoebusUtils.getPhoebusDataChannelXIODriverParameters(source.getHost()));
+ }
+ } catch (Exception e) {
+ throw new GridConfigurationHandlerException("Error
configuring for Phoebus handler: "+e.getLocalizedMessage(),e);
+ }
+ }
+
+ public void handleMakeDirFTPClientConfigurations(GridFTPClient client,
String dirPath)
+ throws GridConfigurationHandlerException {
+ //nothing to do
+ }
+
+ @Override
+ public void handleListDirFTPClientConfigurations(GridFTPClient client,
String dirPath)
+ throws GridConfigurationHandlerException {
+ //nothing to do
+ }
+
+ @Override
+ public void handleFTPClientConfigurations(GridFTPClient client,
+ String taskDescription) throws
GridConfigurationHandlerException {
+ //nothing to do
+ }
+
+ @Override
+ public String getHandlerName() {
+ return HANDLER_NAME;
+ }
+
+ @Override
+ public Version getHandlerVersion() {
+ return new Version(HANDLER_NAME, 1, 0, 0, null, BuildType.RC);
+ }
}
Modified:
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java
URL:
http://svn.apache.org/viewvc/airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java?rev=1535133&r1=1535132&r2=1535133&view=diff
==============================================================================
---
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java
(original)
+++
airavata/trunk/tools/phoebus-integration/src/main/java/org/apache/airavata/core/gfac/utils/PhoebusUtils.java
Wed Oct 23 19:42:56 2013
@@ -25,30 +25,29 @@ import org.apache.airavata.common.except
import org.apache.airavata.common.utils.ServerSettings;
public class PhoebusUtils {
-
private static String
PHOEBUS_DC_XIO_DRIVERS="dc.phoebus.xio_driver_configurations";
-
- public static boolean isPhoebusDriverConfigurationsDefined(String
hostAddress) throws Exception{
- try {
- return
getPhoebusDataChannelXIODriverParameters(hostAddress)!=null;
- } catch (UnspecifiedApplicationSettingsException e) {
- return false;
- }
- }
-
- public static String getPhoebusDataChannelXIODriverParameters(String
hostAddress) throws Exception{
- String driverString =
ServerSettings.getSetting(PHOEBUS_DC_XIO_DRIVERS);
- String[] hostList = driverString.split(";");
- for (String hostString : hostList) {
- String[] driverData = hostString.split("=");
- if (driverData.length!=2){
- throw new Exception("Invalid Phoebus XIO
drivers settings!!!");
- }
- if (hostAddress.equalsIgnoreCase(driverData[0])){
- return driverData[1];
- }
- }
- throw new Exception("Phoebus XIO drivers not defined for
"+hostAddress);
- }
+
+ public static boolean isPhoebusDriverConfigurationsDefined(String
hostAddress) throws Exception{
+ try {
+ return getPhoebusDataChannelXIODriverParameters(hostAddress)!=null;
+ } catch (UnspecifiedApplicationSettingsException e) {
+ return false;
+ }
+ }
+
+ public static String getPhoebusDataChannelXIODriverParameters(String
hostAddress) throws Exception{
+ String driverString =
ServerSettings.getSetting(PHOEBUS_DC_XIO_DRIVERS);
+ String[] hostList = driverString.split(";");
+ for (String hostString : hostList) {
+ String[] driverData = hostString.split("=");
+ if (driverData.length!=2){
+ throw new Exception("Invalid Phoebus XIO drivers settings!!!");
+ }
+ if (hostAddress.equalsIgnoreCase(driverData[0])){
+ return driverData[1];
+ }
+ }
+ throw new Exception("Phoebus XIO drivers not defined for
"+hostAddress);
+ }
}