General FAQ
Configuration FAQ
JSAGA is an implementation of the SAGA specification, so it is supposed to be used as any other implementation of this specification.
Please refer to the Open Grid Forum documentation to learn more about SAGA specification and how to use it.
You can also see sample code here.
See the following example (list entries under specified URL):
import org.ogf.saga.file.FileFactory; import org.ogf.saga.url.URL; import org.ogf.saga.url.URLFactory; public class List { public static void main(String[] args) throws Exception { System.setProperty("saga.factory", "fr.in2p3.jsaga.impl.SagaFactoryImpl"); if (args.length != 1) { throw new Exception("usage: List <URL>"); } for (URL url : FileFactory.createDirectory(URLFactory.createURL(args[0])).list()) { System.out.println(url.getString()); } } }
Download and install JSAGA.
Set the JSAGA_HOME environment variable to your JSAGA installation path.
Compile your grid application:
javac -d . -classpath $JSAGA_HOME/lib/saga-api-1.1.1.jar List.java
Run your grid application:
java -cp .:$JSAGA_HOME/lib/'*' -DJSAGA_HOME=$JSAGA_HOME List file:///
Add to your profiles, settings or project file the CC-IN2P3 maven repository:
<repositories> <repository> <id>CC-IN2P3 maven repository</id> <url>http://maven.in2p3.fr/</url> </repository> </repositories>
Add to your project file the dependencies needed for build:
<dependency> <groupId>org.ogf.saga</groupId> <artifactId>saga-api</artifactId> <version>1.1.1</version> <scope>compile</scope> </dependency>
Add to your project file the dependencies needed for runtime or for testing:
<dependency> <groupId>fr.in2p3.jsaga</groupId> <artifactId>jsaga-engine</artifactId> <version>${version}</version> <scope>runtime</scope> </dependency> <!-- add all the adaptors that you expect to use (for example, add jsaga-adaptor-classic for file://) --> <dependency> <groupId>fr.in2p3.jsaga.adaptor</groupId> <artifactId>jsaga-adaptor-classic</artifactId> <version>${version}</version> <scope>runtime</scope> </dependency>
where ${version} is the version of JSAGA you want to compile with.
Rather than trying to connect to grid resource with several security contexts, in JSAGA we prefer to rely on configuration in order to have more predictible behaviors.
This choice allows to prevent from:
If your SAGA session contains several security contexts, then you must provide to JSAGA the information needed to select the right context for each service. You can do this:
If your SAGA session contains only one security context, then neither configuration, nor URL prefix (or scheme aliases), are required.
The configuration can be done:
The jsaga-default-contexts.xml configuration file is composed of two parts:
A <context> element may contains several occurences of each of the following elements:
A <include>/<exclude> element contains optional attributes:
In order to enable configuring sessions through the SAGA API, JSAGA adds non-standard attribute names to the context objects:
Tips: you can generate the SAGA attribute values from the XML configuration file with command line
jsaga-help --config
You can see an example configuration file for each adaptor: see item "Example" in each adaptor menu.
Some command line interfaces provide information useful to solve configuration problems: