Skip to content

Commit

Permalink
Added support to key authentication based using ssh adaptor. Added co…
Browse files Browse the repository at this point in the history
…figurable JDBC resources to better support FutureGateway. Added set methods in InfrastructureInfo to allow JSON serialization.
  • Loading branch information
mtorrisi committed Mar 25, 2016
1 parent e7720a2 commit 82cc997
Show file tree
Hide file tree
Showing 10 changed files with 267 additions and 247 deletions.
195 changes: 6 additions & 189 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,192 +9,6 @@
<property name="debuglevel" value="source,lines,vars" />
<property name="target" value="1.7" />
<property name="source" value="1.7" />
<path id="grid-and-cloud-engine.classpath">
<pathelement location="bin" />
<pathelement location="lib/activation-1.1.jar" />
<pathelement location="lib/ant-1.5.jar" />
<pathelement location="lib/antlr-2.7.6.jar" />
<pathelement location="lib/apache-mime4j-core-0.7.2.jar" />
<pathelement location="lib/axiom-api-1.2.13.jar" />
<pathelement location="lib/axiom-impl-1.2.13.jar" />
<pathelement location="lib/axis2-1.6.2.jar" />
<pathelement location="lib/axis2-kernel-1.6.2.jar" />
<pathelement location="lib/axis2-transport-http-1.6.2.jar" />
<pathelement location="lib/axis2-transport-local-1.6.2.jar" />
<pathelement location="lib/axis-1.4-patched.jar" />
<pathelement location="lib/axisg-2.0.7-custom4.jar" />
<pathelement location="lib/axis-jaxrpc-1.4.jar" />
<pathelement location="lib/axis-saaj-1.4.jar" />
<pathelement location="lib/axis-wsdl4j-1.5.1.jar" />
<pathelement location="lib/bcmail-jdk16-1.46.jar" />
<pathelement location="lib/bcprov-jdk16-1.46.jar" />
<pathelement location="lib/canl-1.3.0.jar" />
<pathelement location="lib/castor-1.0-xml.jar" />
<pathelement location="lib/classad-2.4.jar" />
<pathelement location="lib/commons-attributes-api-2.1.jar" />
<pathelement location="lib/commons-beanutils-1.7.0.jar" />
<pathelement location="lib/commons-cli-1.1.jar" />
<pathelement location="lib/commons-codec-1.6.jar" />
<pathelement location="lib/commons-collections-3.1.jar" />
<pathelement location="lib/commons-compress-1.5.jar" />
<pathelement location="lib/commons-discovery-0.2.jar" />
<pathelement location="lib/commons-fileupload-1.2.2.jar" />
<pathelement location="lib/commons-fileupload-1.2.jar" />
<pathelement location="lib/commons-httpclient-3.1.jar" />
<pathelement location="lib/commons-io-1.4.jar" />
<pathelement location="lib/commons-io-2.0.1.jar" />
<pathelement location="lib/commons-logging-1.1.1.jar" />
<pathelement location="lib/commons-logging-1.1.jar" />
<pathelement location="lib/commons-net-3.3.jar" />
<pathelement location="lib/crl-checking-1.4.jar" />
<pathelement location="lib/dom4j-1.6.1.jar" />
<pathelement location="lib/dsms-common-1.0.1.jar" />
<pathelement location="lib/ehcache-core-2.4.2.jar" />
<pathelement location="lib/ext-federated-login-ext-service.jar" />
<pathelement location="lib/file-system-java-1.0.jar" />
<pathelement location="lib/ganymed-ssh2-261.jar" />
<pathelement location="lib/geronimo-activation_1.1_spec-1.1.jar" />
<pathelement location="lib/geronimo-javamail_1.4_spec-1.7.1.jar" />
<pathelement location="lib/geronimo-jta_1.1_spec-1.1.jar" />
<pathelement location="lib/geronimo-stax-api_1.0_spec-1.0.1.jar" />
<pathelement location="lib/geronimo-ws-metadata_2.0_spec-1.1.2.jar" />
<pathelement location="lib/glite.dm-0.5.4.jar" />
<pathelement location="lib/glite-lb-api-java-3.3.2.jar" />
<pathelement location="lib/glite-security-delegation-java-1.4.4-1.jar" />
<pathelement location="lib/glite-security-trustmanager-1.8.16.jar" />
<pathelement location="lib/glite-security-trustmanager-axis-1.8.16.jar" />
<pathelement location="lib/glite-security-util-java-1.4.0.jar" />
<pathelement location="lib/glite-wms-wmproxy-api-java-3.3.2-1.jar" />
<pathelement location="lib/gram-2.0.7-custom4.jar" />
<pathelement location="lib/gridengine-threadpools-1.0.0.jar" />
<pathelement location="lib/gridftp-2.0.7-custom4.jar" />
<pathelement location="lib/groovy-all-1.7.6.jar" />
<pathelement location="lib/gss-2.0.7-custom4.jar" />
<pathelement location="lib/h2-1.2.147.jar" />
<pathelement location="lib/hamcrest-core-1.3.jar" />
<pathelement location="lib/hazelcast-1.9.1.jar" />
<pathelement location="lib/herasaf-xacml-core-1.0.0-M2.jar" />
<pathelement location="lib/hibernate3.jar" />
<pathelement location="lib/hibernate-jpa-2.0-api-1.0.1.Final.jar" />
<pathelement location="lib/hsql.jar" />
<pathelement location="lib/httpclient-4.3.jar" />
<pathelement location="lib/httpcore-4.3.jar" />
<pathelement location="lib/httpmime-4.3.jar" />
<pathelement location="lib/io-2.0.7-custom4.jar" />
<pathelement location="lib/jargon-core-3.3.1.1.jar" />
<pathelement location="lib/jaxen-1.1.3.jar" />
<pathelement location="lib/jdl-api-java-3.3.2.jar" />
<pathelement location="lib/jdom-1.0.jar" />
<pathelement location="lib/jetty-6.1.26.jar" />
<pathelement location="lib/jetty-sslengine-6.1.26.jar" />
<pathelement location="lib/jetty-util-6.1.26.jar" />
<pathelement location="lib/jline-0.9.94.jar" />
<pathelement location="lib/jsaga-adaptor-arc-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-bes-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-bes-genesis2-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-bes-unicore6-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-classic-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-cream-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-dirac-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-globus-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-irods-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptoritf-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-lfc-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-linux-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-rocci-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-secretservice-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-srm-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-ssh3-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-unicore-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-voms-1.1.0.jar" />
<pathelement location="lib/jsaga-adaptor-wms-1.1.0.jar" />
<pathelement location="lib/jsaga-engine-1.1.0.jar" />
<pathelement location="lib/jsdl-xmlbeans-2.0.2.jar" />
<pathelement location="lib/json-simple-1.1.1.jar" />
<pathelement location="lib/jsr311-api-1.0.jar" />
<pathelement location="lib/jsse-2.0.7-custom4.jar" />
<pathelement location="lib/jta-1.1.jar" />
<pathelement location="lib/jtds.jar" />
<pathelement location="lib/junit-4.11.jar" />
<pathelement location="lib/libdbus-java-2.7.jar" />
<pathelement location="lib/log4j-1.2.16.jar" />
<pathelement location="lib/mail-1.4.jar" />
<pathelement location="lib/metrix-0.5.jar" />
<pathelement location="lib/myproxy-2.0.7-custom4.jar" />
<pathelement location="lib/mysql.jar" />
<pathelement location="lib/mysql-connector-java-5.1.13.jar" />
<pathelement location="lib/neethi-3.0.2.jar" />
<pathelement location="lib/org.apache.commons.codec-1.6.jar" />
<pathelement location="lib/persistence-0.18.jar" />
<pathelement location="lib/picocontainer-2.8.jar" />
<pathelement location="lib/portal-service.jar" />
<pathelement location="lib/portlet.jar" />
<pathelement location="lib/postgresql.jar" />
<pathelement location="lib/qdox-1.5.jar" />
<pathelement location="lib/saga-api-1.1.1.jar" />
<pathelement location="lib/saga-api-test-1.1.0.jar" />
<pathelement location="lib/SAMLtypes-1.2.jar" />
<pathelement location="lib/samly2-1.3.5.jar" />
<pathelement location="lib/saxon-9.1.0.8.jar" />
<pathelement location="lib/saxon-dom-9.1.0.8.jar" />
<pathelement location="lib/saxon-xpath-9.1.0.8.jar" />
<pathelement location="lib/secret-service-api-java-0.2.jar" />
<pathelement location="lib/securityLibrary-2.0.5.jar" />
<pathelement location="lib/secutils-xfire-1.0.6.jar" />
<pathelement location="lib/serializer.jar" />
<pathelement location="lib/servlet-api-2.5.jar" />
<pathelement location="lib/servlet-api-2.5-20081211.jar" />
<pathelement location="lib/slf4j-api-1.6.1.jar" />
<pathelement location="lib/slf4j-log4j12-1.6.1.jar" />
<pathelement location="lib/spring-asm-3.0.5.RELEASE.jar" />
<pathelement location="lib/spring-core-3.0.5.RELEASE.jar" />
<pathelement location="lib/spring-expression-3.0.5.RELEASE.jar" />
<pathelement location="lib/ssl-proxies-2.0.7-custom4.jar" />
<pathelement location="lib/stax-api-1.0.jar" />
<pathelement location="lib/stax-utils-20040917.jar" />
<pathelement location="lib/sunxacml-1.2.jar" />
<pathelement location="lib/tomcat-util-3.3.2.jar" />
<pathelement location="lib/uas-client-1.4.2.jar" />
<pathelement location="lib/uas-core-1.4.2-p2.jar" />
<pathelement location="lib/uas-types-1.4.2.jar" />
<pathelement location="lib/use-aip-2.0.2.jar" />
<pathelement location="lib/use-core-2.0.2.jar" />
<pathelement location="lib/use-pdp-2.0.2.jar" />
<pathelement location="lib/use-wsrfclient-2.0.2.jar" />
<pathelement location="lib/use-wsrflite-2.0.2.jar" />
<pathelement location="lib/use-wsrftypes-2.0.2.jar" />
<pathelement location="lib/uvos-client-1.4.1.jar" />
<pathelement location="lib/uvos-common-1.4.1.jar" />
<pathelement location="lib/voms-api-java-3.0.2.jar" />
<pathelement location="lib/voms-clients-3.0.4.jar" />
<pathelement location="lib/woden-api-1.0M9.jar" />
<pathelement location="lib/woden-impl-commons-1.0M9.jar" />
<pathelement location="lib/woden-impl-dom-1.0M9.jar" />
<pathelement location="lib/wsdl4j-1.6.2.jar" />
<pathelement location="lib/wss4j-1.5.12.jar" />
<pathelement location="lib/wstx-asl-3.2.4.jar" />
<pathelement location="lib/xalan.jar" />
<pathelement location="lib/xercesImpl.jar" />
<pathelement location="lib/xfire-aegis-1.2.6.jar" />
<pathelement location="lib/xfire-annotations-1.2.6.jar" />
<pathelement location="lib/xfire-core-1.2.6.jar" />
<pathelement location="lib/xfire-java5-1.2.6.jar" />
<pathelement location="lib/xfire-jsr181-api-1.0-M1.jar" />
<pathelement location="lib/xfire-voutils-1.4.0.jar" />
<pathelement location="lib/xfire-xmlbeans-1.2.6.jar" />
<pathelement location="lib/xml-apis.jar" />
<pathelement location="lib/xmlbeans-2.4.0.jar" />
<pathelement location="lib/xmlbeans-xpath-2.4.0.jar" />
<pathelement location="lib/xmlpull-1.1.3.1.jar" />
<pathelement location="lib/XmlSchema-1.1.jar" />
<pathelement location="lib/XmlSchema-1.4.7.jar" />
<pathelement location="lib/xmlsec-1.4.6.jar" />
<pathelement location="lib/xnjs-module-core-1.5.1.jar" />
<pathelement location="lib/xpp3_min-1.1.4c.jar" />
<pathelement location="lib/xstream-1.4.3.jar" />
<pathelement location="lib/xuudb-common-1.3.2-rc1.jar" />
<pathelement location="lib/xz-1.2.jar" />
</path>
<target name="init">
<mkdir dir="bin" />
<mkdir dir="dist" />
Expand All @@ -215,14 +29,17 @@
<echo message="${ant.project.name}: ${ant.file}" />
<javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
<src path="src" />
<classpath refid="grid-and-cloud-engine.classpath" />
<classpath>
<fileset dir="lib/">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="build-jar">
<jar destfile="dist/jsaga-job-management-1.5.10.jar" basedir="bin/">
<jar destfile="dist/jsaga-job-management-1.5.11.jar" basedir="bin/">
<manifest/>
</jar>
</target>
<target name="test"/>
<target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects" />
</project>
2 changes: 2 additions & 0 deletions config/GridEngine.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
usertracking_datasource = jdbc/UserTrackingPool
hibernate_datasource = jdbc/gehibernatepool
92 changes: 92 additions & 0 deletions it/infn/ct/GridEngine/Config/GridEngineConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
package it.infn.ct.GridEngine.Config;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.log4j.Logger;

public class GridEngineConfig {

private static GridEngineConfig instance = null;
private static final Logger _log = Logger.getLogger(GridEngineConfig.class.getName());
private final String gePropertiesFile = "GridEngine.properties";

private String userstrackingDatasource = "jdbc/UserTrackingPool"; //default value
private String hibernateDatasource = "jdbc/gehibernatepool"; //default value

public static synchronized GridEngineConfig getInstance(){
if (instance == null)
instance = new GridEngineConfig();
return instance;
}

/**
* Load the given configuration file which overrides static settings
* @param configFile
*/
private GridEngineConfig() {
/*
Load a configuration file containing GridEngineDaemon settings
wich override the static settings defined in the class
*/
loadProperties();
_log.info("GridEngine config:" + this.toString());
}

private void loadProperties() {
//
InputStream inputStream=null;
Properties prop = new Properties();
try {
inputStream = this.getClass().getClassLoader().
getResourceAsStream(gePropertiesFile);

prop.load(inputStream);

/*
Retrieving configuration values
*/

// APIServer DB settings
String prop_usertrackingDatasource = prop.getProperty("usertracking_datasource");
String prop_hibernateDatasource = prop.getProperty("hibernate_datasource");

if(prop_usertrackingDatasource!=null) {
this.userstrackingDatasource = prop_usertrackingDatasource;
}
if(prop_hibernateDatasource!=null) {
this.hibernateDatasource = prop_hibernateDatasource;
}
} catch(NullPointerException e) {
_log.warn("Unable to load property file; using default settings");
} catch(IOException e) {
_log.warn("Error reading file: "+ e);
} catch(NumberFormatException e) {
_log.warn("Error while reading property file: "+ e);
}
finally {
try {
if(null != inputStream) inputStream.close();
} catch (IOException e) {
_log.error("Error closing configuration file input stream");
}
}
}

public String getUserstrackingDatasource() {
return userstrackingDatasource;
}

public String getHibernateDatasource() {
return hibernateDatasource;
}

@Override
public String toString() {
return "GridEngineConfig [gePropetiesFile=" + gePropertiesFile
+ ", userstrackingDatasource=" + userstrackingDatasource
+ ", hibernateDatasource=" + hibernateDatasource + "]";
}

}
Loading

0 comments on commit 82cc997

Please sign in to comment.