diff --git a/CHANGELOG.md b/CHANGELOG.md
index 255dde7a1..23438935e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,7 +1,14 @@
-Xenon 2.6.1
+Xenon 2.6.2
-----------
-This is release 2.6.1 of Xenon.
+This is release 2.6.2 of Xenon.
+
+Notable changes compared to v2.6.1:
+-----------------------------------
+
+- added support for temp space in JobDescription.
+- added support stdout, stderr and stdin to Torque.
+- fixed several unit tests that failed on OS
Notable changes compared to v2.6.0:
-----------------------------------
diff --git a/README.md b/README.md
index 94f3982a6..000cee95d 100644
--- a/README.md
+++ b/README.md
@@ -87,7 +87,7 @@ and
```gradle
dependencies {
- compile 'nl.esciencecenter.xenon:xenon:2.6.1'
+ compile 'nl.esciencecenter.xenon:xenon:2.6.2'
}
```
@@ -110,7 +110,7 @@ and
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final int |
+GIGA |
+1073741824 |
+
+
+private static final int |
+KILO |
+1024 |
+
+
+private static final int |
+MEGA |
+1048576 |
+
+
+private static final java.lang.String |
+NAME |
+"XenonProperties" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ADAPTORS_PREFIX |
+"xenon.adaptors.filesystems." |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+EXEC_GROUP |
+8 |
+
+
+public static final int |
+EXEC_OTHERS |
+1 |
+
+
+public static final int |
+EXEC_OWNER |
+64 |
+
+
+public static final int |
+READ_GROUP |
+32 |
+
+
+public static final int |
+READ_OTHERS |
+4 |
+
+
+public static final int |
+READ_OWNER |
+256 |
+
+
+public static final int |
+WRITE_GROUP |
+16 |
+
+
+public static final int |
+WRITE_OTHERS |
+2 |
+
+
+public static final int |
+WRITE_OWNER |
+128 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"The FTP adaptor implements file access on remote ftp servers." |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"ftp" |
+
+
+public static final java.lang.String |
+BUFFER_SIZE |
+"xenon.adaptors.filesystems.ftp.bufferSize" |
+
+
+protected static final int |
+DEFAULT_PORT |
+21 |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.filesystems.ftp." |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"Adaptor for the Apache Hadoop file system" |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"hdfs" |
+
+
+public static final java.lang.String |
+BUFFER_SIZE |
+"xenon.adaptors.filesystems.hdfs.bufferSize" |
+
+
+protected static final int |
+DEFAULT_PORT |
+21 |
+
+
+public static final java.lang.String |
+HADOOP_SETTINGS_FILE |
+"xenon.adaptors.filesystems.hdfs.hadoopSettingsFile" |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.filesystems.hdfs." |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private final java.lang.String |
+ERROR_MSG |
+"Error in HDFS connector" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+NOT_EMPTY |
+"___not__empty___" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"This is the local file adaptor that implements file functionality for local access." |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"file" |
+
+
+public static final java.lang.String |
+BUFFER_SIZE |
+"xenon.adaptors.filesystems.file.bufferSize" |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.filesystems.file." |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"The JClouds adaptor uses Apache JClouds to talk to s3 and others" |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"s3" |
+
+
+public static final java.lang.String |
+BUFFER_SIZE |
+"xenon.adaptors.filesystems.s3.bufferSize" |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.filesystems.s3." |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"The SFTP adaptor implements all file access functionality to remote SFTP servers" |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"sftp" |
+
+
+public static final java.lang.String |
+AGENT |
+"xenon.adaptors.filesystems.sftp.agent" |
+
+
+public static final java.lang.String |
+AGENT_FORWARDING |
+"xenon.adaptors.filesystems.sftp.agentForwarding" |
+
+
+public static final java.lang.String |
+AUTOMATICALLY_ADD_HOST_KEY |
+"xenon.adaptors.filesystems.sftp.autoAddHostKey" |
+
+
+public static final java.lang.String |
+BUFFER_SIZE |
+"xenon.adaptors.filesystems.sftp.bufferSize" |
+
+
+public static final java.lang.String |
+CONNECTION_TIMEOUT |
+"xenon.adaptors.filesystems.sftp.connection.timeout" |
+
+
+public static final int |
+DEFAULT_PORT |
+22 |
+
+
+public static final java.lang.String |
+GATEWAY |
+"xenon.adaptors.filesystems.sftp.gateway" |
+
+
+public static final java.lang.String |
+LOAD_SSH_CONFIG |
+"xenon.adaptors.filesystems.sftp.loadSshConfig" |
+
+
+public static final java.lang.String |
+LOAD_STANDARD_KNOWN_HOSTS |
+"xenon.adaptors.filesystems.sftp.loadKnownHosts" |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.filesystems.sftp." |
+
+
+public static final java.lang.String |
+SSH_CONFIG_FILE |
+"xenon.adaptors.filesystems.sftp.sshConfigFile" |
+
+
+public static final java.lang.String |
+STRICT_HOST_KEY_CHECKING |
+"xenon.adaptors.filesystems.sftp.strictHostKeyChecking" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"The webdav file adaptor implements file access to remote webdav servers." |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"webdav" |
+
+
+public static final java.lang.String |
+BUFFER_SIZE |
+"xenon.adaptors.filesystems.webdav.bufferSize" |
+
+
+public static final int |
+OK_CODE |
+200 |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.filesystems.webdav." |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+TERMINATION_DELAY |
+1000L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+DONE_STATE |
+"DONE" |
+
+
+private static final java.lang.String |
+ERROR_STATE |
+"ERROR" |
+
+
+private static final java.lang.String |
+KILLED_STATE |
+"KILLED" |
+
+
+private static final long |
+MILLISECONDS_PER_MINUTE |
+60000L |
+
+
+private static final java.lang.String |
+PENDING_STATE |
+"PENDING" |
+
+
+private static final long |
+POLLING_DELAY |
+1000L |
+
+
+private static final java.lang.String |
+RUNNING_STATE |
+"RUNNING" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+MAX_POLLING_DELAY |
+60000 |
+
+
+public static final int |
+MIN_POLLING_DELAY |
+100 |
+
+
+private static final java.lang.String |
+MULTI_QUEUE_NAME |
+"multi" |
+
+
+private static final java.lang.String |
+SINGLE_QUEUE_NAME |
+"single" |
+
+
+private static final java.lang.String |
+UNLIMITED_QUEUE_NAME |
+"unlimited" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ADAPTORS_PREFIX |
+"xenon.adaptors.schedulers." |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ACCOUNTING_GRACE_TIME_PROPERTY |
+"xenon.adaptors.schedulers.gridengine.accounting.grace.time" |
+
+
+public static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"The SGE Adaptor submits jobs to a (Sun/Oracle/Univa) Grid Engine scheduler. This adaptor uses either the local or the ssh scheduler adaptor to run commands on the machine running Grid Engine, and the file or the stfp filesystem adaptor to gain access to the filesystem of that machine." |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"gridengine" |
+
+
+public static final java.lang.String |
+IGNORE_VERSION_PROPERTY |
+"xenon.adaptors.schedulers.gridengine.ignore.version" |
+
+
+public static final java.lang.String |
+POLL_DELAY_PROPERTY |
+"xenon.adaptors.schedulers.gridengine.poll.delay" |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.schedulers.gridengine." |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+JOB_OPTION_JOB_SCRIPT |
+"job.script" |
+
+
+public static final java.lang.String |
+JOB_OPTION_PARALLEL_ENVIRONMENT |
+"parallel.environment" |
+
+
+public static final java.lang.String |
+JOB_OPTION_PARALLEL_SLOTS |
+"parallel.slots" |
+
+
+public static final java.lang.String |
+JOB_OPTION_RESOURCES |
+"resources" |
+
+
+private static final int |
+MINUTES_PER_HOUR |
+60 |
+
+
+public static final java.lang.String |
+QACCT_HEADER |
+"==============================================================" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+SGE62_SCHEMA_ATTRIBUTE |
+"xmlns:xsd" |
+
+
+private static final java.lang.String |
+SGE62_SCHEMA_VALUE |
+"http://gridengine.sunsource.net/source/browse/*checkout*/gridengine/source/dist/util/resources/schemas/qstat/qstat.xsd?revision=1.11" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+ALLOCATION_FILL_UP |
+"$fill_up" |
+
+
+private static final java.lang.String |
+ALLOCATION_PE_SLOTS |
+"$pe_slots" |
+
+
+private static final java.lang.String |
+ALLOCATION_ROUND_ROBIN |
+"$round_robin" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"The local jobs adaptor implements all functionality by emulating a local queue." |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"local" |
+
+
+public static final java.lang.String |
+INFO |
+"xenon.adaptors.schedulers.local.info." |
+
+
+public static final java.lang.String |
+JOBS |
+"xenon.adaptors.schedulers.local.info.jobs." |
+
+
+public static final java.lang.String |
+MAX_HISTORY |
+"xenon.adaptors.schedulers.local.queue.historySize" |
+
+
+public static final java.lang.String |
+MULTIQ |
+"xenon.adaptors.schedulers.local.queue.multi." |
+
+
+public static final java.lang.String |
+MULTIQ_MAX_CONCURRENT |
+"xenon.adaptors.schedulers.local.queue.multi.maxConcurrentJobs" |
+
+
+public static final java.lang.String |
+POLLING_DELAY |
+"xenon.adaptors.schedulers.local.queue.pollingDelay" |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.schedulers.local." |
+
+
+public static final java.lang.String |
+QUEUE |
+"xenon.adaptors.schedulers.local.queue." |
+
+
+public static final java.lang.String |
+SUBMITTED |
+"xenon.adaptors.schedulers.local.info.jobs.submitted" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"The Slurm Adaptor submits jobs to a Slurm scheduler. This adaptor uses either the local or the ssh scheduler adaptor to run commands on the machine running Slurm, and the file or the stfp filesystem adaptor to gain access to the filesystem of that machine." |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"slurm" |
+
+
+public static final java.lang.String |
+DISABLE_ACCOUNTING_USAGE |
+"xenon.adaptors.schedulers.slurm.disable.accounting.usage" |
+
+
+public static final java.lang.String |
+POLL_DELAY_PROPERTY |
+"xenon.adaptors.schedulers.slurm.poll.delay" |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.schedulers.slurm." |
+
+
+public static final long |
+SLURM_UPDATE_SLEEP |
+1000L |
+
+
+public static final long |
+SLURM_UPDATE_TIMEOUT |
+60000L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+DONE_STATE |
+"COMPLETED" |
+
+
+public static final java.lang.String |
+JOB_OPTION_JOB_SCRIPT |
+"job.script" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"The SSH job adaptor implements all functionality to start jobs on ssh servers." |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"ssh" |
+
+
+public static final java.lang.String |
+AGENT |
+"xenon.adaptors.schedulers.ssh.agent" |
+
+
+public static final java.lang.String |
+AGENT_FORWARDING |
+"xenon.adaptors.schedulers.ssh.agentForwarding" |
+
+
+public static final java.lang.String |
+AUTOMATICALLY_ADD_HOST_KEY |
+"xenon.adaptors.schedulers.ssh.autoAddHostKey" |
+
+
+public static final int |
+DEFAULT_PORT |
+22 |
+
+
+public static final java.lang.String |
+GATEWAY |
+"xenon.adaptors.schedulers.ssh.gateway" |
+
+
+public static final java.lang.String |
+INFO |
+"xenon.adaptors.schedulers.ssh.info." |
+
+
+public static final java.lang.String |
+JOBS |
+"xenon.adaptors.schedulers.ssh.info.jobs." |
+
+
+public static final java.lang.String |
+LOAD_SSH_CONFIG |
+"xenon.adaptors.schedulers.ssh.loadSshConfig" |
+
+
+public static final java.lang.String |
+LOAD_STANDARD_KNOWN_HOSTS |
+"xenon.adaptors.schedulers.ssh.loadKnownHosts" |
+
+
+public static final java.lang.String |
+MAX_HISTORY |
+"xenon.adaptors.schedulers.ssh.queue.historySize" |
+
+
+public static final java.lang.String |
+MULTIQ |
+"xenon.adaptors.schedulers.ssh.queue.multi." |
+
+
+public static final java.lang.String |
+MULTIQ_MAX_CONCURRENT |
+"xenon.adaptors.schedulers.ssh.queue.multi.maxConcurrentJobs" |
+
+
+public static final java.lang.String |
+POLLING_DELAY |
+"xenon.adaptors.schedulers.ssh.queue.pollingDelay" |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.schedulers.ssh." |
+
+
+public static final java.lang.String |
+QUEUE |
+"xenon.adaptors.schedulers.ssh.queue." |
+
+
+public static final java.lang.String |
+SSH_CONFIG_FILE |
+"xenon.adaptors.schedulers.ssh.sshConfigFile" |
+
+
+public static final java.lang.String |
+STRICT_HOST_KEY_CHECKING |
+"xenon.adaptors.schedulers.ssh.strictHostKeyChecking" |
+
+
+public static final java.lang.String |
+SUBMITTED |
+"xenon.adaptors.schedulers.ssh.info.jobs.submitted" |
+
+
+public static final java.lang.String |
+TIMEOUT |
+"xenon.adaptors.schedulers.ssh.timeout" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+ACCOUNTING_GRACE_TIME_PROPERTY |
+"xenon.adaptors.schedulers.torque.accounting.grace.time" |
+
+
+public static final java.lang.String |
+ADAPTOR_DESCRIPTION |
+"The Torque Adaptor submits jobs to a TORQUE batch system. This adaptor uses either the local or the ssh scheduler adaptor to run commands on the machine running TORQUE, and the file or the stfp filesystem adaptor to gain access to the filesystem of that machine." |
+
+
+public static final java.lang.String |
+ADAPTOR_NAME |
+"torque" |
+
+
+public static final java.lang.String |
+IGNORE_VERSION_PROPERTY |
+"xenon.adaptors.schedulers.torque.ignore.version" |
+
+
+public static final java.lang.String |
+POLL_DELAY_PROPERTY |
+"xenon.adaptors.schedulers.torque.poll.delay" |
+
+
+public static final java.lang.String |
+PREFIX |
+"xenon.adaptors.schedulers.torque." |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final java.lang.String |
+JOB_OPTION_JOB_CONTENTS |
+"job.contents" |
+
+
+public static final java.lang.String |
+JOB_OPTION_JOB_SCRIPT |
+"job.script" |
+
+
+public static final java.lang.String |
+JOB_OPTION_RESOURCES |
+"job.resources" |
+
+
+private static final int |
+MINUTES_PER_HOUR |
+60 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+DEFAULT_SSH_PORT |
+22 |
+
+
+private static final java.lang.String |
+VIA_TAG |
+" via:" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+COMPONENT_NAME |
+"FileSystem" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final char |
+DEFAULT_SEPARATOR |
+47 |
+
+
+private static final int |
+PATH_ELEMENT_LENGTH |
+25 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+DEFAULT_MAX_RUN_TIME_IN_MINUTES |
+15 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+COMPONENT_NAME |
+"Scheduler" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final long |
+serialVersionUID |
+1L |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final java.lang.String |
+OS_PROPERTY |
+"os.name" |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final int |
+BUFFER_SIZE |
+1024 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+private static final int |
+DEFAULT_BUFFER_SIZE |
+1024 |
+
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Each annotation type has its own separate page with the following sections:
+Each enum has its own separate page with the following sections:
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+These links take you to the next or previous class, interface, package, or related page.
+These links show and hide the HTML frames. All pages are available with or without frames.
+The All Classes link shows all classes and interfaces except non-static nested types.
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+The Constant Field Values page lists the static final fields and their values.
+OutputStream
to append data to this file.InteractiveProcess
to emulate a batch process.CertificateCredential
out of a username, a certificate file containing a private key, and an optional passphrase.queueName
is presents in queueNames
.String
s using a StringBuilder
.SshClient
to the server at location
and authenticate using the given credential
.PosixFilePermission
s contains a specific option.key
is stored in this CredentialMap.adaptor
that connects to a data store at location
using the credentials
to get
+ access.adaptor
that connects to a data store at location
using the credentials
to get
+ access.adaptor
that connects to a data store at location
using the default credentials to get
+ access.adaptor
that connects to a data store at the default location using the default credentials to get access.adaptor
connecting to the location
using credentials
to get access.adaptor
connecting to the location
using credentials
to get access.adaptor
connecting to the location
using the default credentials to get access.adaptor
connecting to the default location and using the default credentials to get access.SshClient
with a default configuration similar to a stand-alone SSH client.SshClient
with the desired configuration.Credential
consisting of a collection of Credentials each uniquely identified by a String (typically a host name or host alias).null
as the default credential.CredentialMap
and set the default credential to defaultCredential
.user.home
property.UserCredential
stored using the key
.String
representation of this Path interpreted as an absolute path.PathAttributes
of an existing path.UserCredential
.null
if hasException()
returns false
.null
if hasException()
returns false
.null
if the Path is empty.String
, or null
if the Path is empty.FileSystem
used internally by this Scheduler
.jobs
.String
representation of an absolute path.null
if this Path does not have a parent.queue
.queues
.String
representation of this Path interpreted as a relative path.InputStream
as a byte array.InputStream
as a String
.String
to an OutputStream
.content
to the destination
.root
only contains a valid Linux root element, which is "/".root
contains a locally valid root element, such as "C:" on Windows or "/" on Linux and OSX.root
contains a valid OSX root element, which is "/".root
only contains a valid Windows root element such as "C:".Iterator
that returns all possible sub Paths of this Path, in order of increasing length.Scheduler
.Set
view of the keys contained in this map.dir
.dir
.Files
adaptor for local file operations.InteractiveProcess
for local interactive processes.Jobs
adaptor for local job operations.InputStream
and buffer this data.source
.path
using the default separator.path
using the provided separator.destinationFS
.Credential
to the CredentialMap using key
as a unique key.InputStream
to read from this file.directory
.InteractiveProcess
for local batch processes.in
to out
using a buffer size of buffersize
.InputStream
and write it to a OutputStream
.OutputStream
to write to this file.OutputStream
to write to this file.supportedProperties
.public interface AdaptorDescription
+Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getDescription()
+Get the description of the adaptor.
+ |
+
java.lang.String |
+getName()
+Get the name of the adaptor.
+ |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
java.lang.String[] |
+getSupportedLocations()
+Get the supported locations for this adaptor.
+ |
+
XenonPropertyDescription[] |
+getSupportedProperties()
+Returns an array containing all properties this adaptor supports.
+ |
+
java.lang.String getName()+
java.lang.String getDescription()+
java.lang.String[] getSupportedLocations()+
java.lang.Class[] getSupportedCredentials()+
XenonPropertyDescription[] getSupportedProperties()+
public class InvalidCredentialException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
InvalidCredentialException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidCredentialException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public InvalidCredentialException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidCredentialException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidLocationException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
InvalidLocationException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidLocationException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public InvalidLocationException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidLocationException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidPropertyException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
InvalidPropertyException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidPropertyException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public InvalidPropertyException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidPropertyException(java.lang.String adaptorName, + java.lang.String message)+
public class PropertyTypeException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
PropertyTypeException(java.lang.String adaptorName,
+ java.lang.String message) |
+
PropertyTypeException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public PropertyTypeException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public PropertyTypeException(java.lang.String adaptorName, + java.lang.String message)+
public class UnknownAdaptorException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
UnknownAdaptorException(java.lang.String adaptorName,
+ java.lang.String message) |
+
UnknownAdaptorException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public UnknownAdaptorException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public UnknownAdaptorException(java.lang.String adaptorName, + java.lang.String message)+
public class UnknownPropertyException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
UnknownPropertyException(java.lang.String adaptorName,
+ java.lang.String message) |
+
UnknownPropertyException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public UnknownPropertyException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public UnknownPropertyException(java.lang.String adaptorName, + java.lang.String message)+
public class UnsupportedOperationException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
UnsupportedOperationException(java.lang.String adaptorName,
+ java.lang.String message) |
+
UnsupportedOperationException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public UnsupportedOperationException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public UnsupportedOperationException(java.lang.String adaptorName, + java.lang.String message)+
public class XenonException
+extends java.lang.Exception
+Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+adaptorName |
+
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
XenonException(java.lang.String adaptorName,
+ java.lang.String message) |
+
XenonException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getMessage() |
+
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
private final java.lang.String adaptorName+
public static enum XenonPropertyDescription.Type +extends java.lang.Enum<XenonPropertyDescription.Type>+
Enum Constant and Description | +
---|
BOOLEAN
+Properties of type
+BOOLEAN can be either "true" or "false" . |
+
DOUBLE
+Properties of type
+DOUBLE can be converted into a 64-bit floating point number using
+ Double.valueOf(String) . |
+
INTEGER
+Properties of type
+INTEGER can be converted into a 32-bit signed integer using
+ Integer.valueOf(String) . |
+
LONG
+Properties of type
+LONG can be converted into a 64-bit signed long using
+ Long.valueOf(String) . |
+
NATURAL
+Properties of type
+NATURAL may contain only positive values, including 0 . |
+
SIZE
+Properties of type
+SIZE can be converted into a 64-bit signed long using
+ Long.valueOf(String) . |
+
STRING
+Properties of type
+STRING are directly stored in a String without conversion. |
+
Modifier and Type | +Method and Description | +
---|---|
static XenonPropertyDescription.Type |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static XenonPropertyDescription.Type[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final XenonPropertyDescription.Type BOOLEAN+
BOOLEAN
can be either "true"
or "false"
.public static final XenonPropertyDescription.Type INTEGER+
INTEGER
can be converted into a 32-bit signed integer using
+ Integer.valueOf(String)
.public static final XenonPropertyDescription.Type LONG+
LONG
can be converted into a 64-bit signed long using
+ Long.valueOf(String)
.public static final XenonPropertyDescription.Type NATURAL+
NATURAL
may contain only positive values, including 0
.
+ They will be converted into a 64-bit signed long using Long.valueOf(String)
.public static final XenonPropertyDescription.Type DOUBLE+
DOUBLE
can be converted into a 64-bit floating point number using
+ Double.valueOf(String)
.public static final XenonPropertyDescription.Type STRING+
STRING
are directly stored in a String without conversion.public static final XenonPropertyDescription.Type SIZE+
SIZE
can be converted into a 64-bit signed long using
+ Long.valueOf(String)
. In addition, the postfixes "K"
, "M"
and "G"
may
+ be used to multiply the value by 1024
, 1024*1024
, or 1024*1024*1024
+ respectively.public static XenonPropertyDescription.Type[] values()+
+for (XenonPropertyDescription.Type c : XenonPropertyDescription.Type.values()) + System.out.println(c); +
public static XenonPropertyDescription.Type valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic class XenonPropertyDescription
+extends java.lang.Object
+XenonPropertyDescription contains all necessary information about a property that is recognized by Xenon
+ +Each XenonPropertyDescription contains the following information:
+ +Map
.
+ XenonPropertyDescription.Type
enum).
+ Even though it is customary to pass the values of properties as String
s, the user should ensure the values can be
+ converted into the expected type.
+ Modifier and Type | +Class and Description | +
---|---|
static class |
+XenonPropertyDescription.Type
+This Type enumeration lists all possible types of properties recognized by Xenon.
+ |
+
Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+defaultValue |
+
private java.lang.String |
+description |
+
private java.lang.String |
+name |
+
private XenonPropertyDescription.Type |
+type |
+
Constructor and Description | +
---|
XenonPropertyDescription(java.lang.String name,
+ XenonPropertyDescription.Type type,
+ java.lang.String defaultValue,
+ java.lang.String description) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getDefaultValue()
+Returns the default value for this property.
+ |
+
java.lang.String |
+getDescription()
+Returns a human readable description of this property.
+ |
+
java.lang.String |
+getName()
+Returns the name of the property.
+ |
+
XenonPropertyDescription.Type |
+getType()
+Returns the type of the property.
+ |
+
java.lang.String |
+toString() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private final java.lang.String name+
private final XenonPropertyDescription.Type type+
private final java.lang.String defaultValue+
private final java.lang.String description+
public XenonPropertyDescription(java.lang.String name, + XenonPropertyDescription.Type type, + java.lang.String defaultValue, + java.lang.String description)+
public java.lang.String getName()+
public XenonPropertyDescription.Type getType()+
public java.lang.String getDefaultValue()+
null
is no default is set.public java.lang.String getDescription()+
public java.lang.String toString()+
toString
in class java.lang.Object
public class XenonRuntimeException
+extends java.lang.RuntimeException
+Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+adaptorName |
+
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
XenonRuntimeException(java.lang.String adaptorName,
+ java.lang.String message) |
+
XenonRuntimeException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getMessage() |
+
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
private final java.lang.String adaptorName+
public XenonRuntimeException(java.lang.String adaptorName, + java.lang.String message)+
public XenonRuntimeException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public abstract class Adaptor +extends java.lang.Object +implements AdaptorDescription+
Modifier and Type | +Field and Description | +
---|---|
private static int |
+currentID |
+
private java.lang.String |
+description |
+
private java.lang.String |
+name |
+
private java.lang.String[] |
+supportedLocations |
+
private XenonPropertyDescription[] |
+supportedProperties |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+Adaptor(java.lang.String name,
+ java.lang.String description,
+ java.lang.String[] locations,
+ XenonPropertyDescription[] properties) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getDescription()
+Get the description of the adaptor.
+ |
+
java.lang.String |
+getName()
+Get the name of the adaptor.
+ |
+
protected java.lang.String |
+getNewUniqueID() |
+
java.lang.String[] |
+getSupportedLocations()
+Get the supported locations for this adaptor.
+ |
+
XenonPropertyDescription[] |
+getSupportedProperties()
+Returns an array containing all properties this adaptor supports.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSupportedCredentials
private static int currentID+
private final java.lang.String name+
private final java.lang.String description+
private final java.lang.String[] supportedLocations+
private final XenonPropertyDescription[] supportedProperties+
protected Adaptor(java.lang.String name, + java.lang.String description, + java.lang.String[] locations, + XenonPropertyDescription[] properties)+
protected java.lang.String getNewUniqueID()+
public java.lang.String getName()+
AdaptorDescription
getName
in interface AdaptorDescription
public java.lang.String getDescription()+
AdaptorDescription
getDescription
in interface AdaptorDescription
public java.lang.String[] getSupportedLocations()+
AdaptorDescription
getSupportedLocations
in interface AdaptorDescription
public XenonPropertyDescription[] getSupportedProperties()+
AdaptorDescription
getSupportedProperties
in interface AdaptorDescription
public class NotConnectedException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
NotConnectedException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NotConnectedException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public NotConnectedException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public NotConnectedException(java.lang.String adaptorName, + java.lang.String message)+
public class XenonProperties
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private static int |
+GIGA
+One giga is a kilo*kilo*kilo
+ |
+
private static int |
+KILO
+One kilo is 1024
+ |
+
private static int |
+MEGA
+One mega is a kilo*kilo
+ |
+
private static java.lang.String |
+NAME |
+
private java.util.Map<java.lang.String,java.lang.String> |
+properties
+The properties that are actually set.
+ |
+
private java.util.Map<java.lang.String,XenonPropertyDescription> |
+propertyDescriptions
+Contains a description of all properties this XenonProperties should accept, including their type, default, etc.
+ |
+
Modifier | +Constructor and Description | +
---|---|
|
+XenonProperties()
+Creates an empty XenonProperties.
+ |
+
private |
+XenonProperties(java.util.Map<java.lang.String,XenonPropertyDescription> propertyDescriptions,
+ java.util.Map<java.lang.String,java.lang.String> properties)
+Private constructor for XenonProperties using in copying and filtering.
+ |
+
|
+XenonProperties(XenonPropertyDescription[] propertyDescriptions,
+ java.util.Map<java.lang.String,java.lang.String> properties)
+Create a new XenonProperties that will support the properties in
+supportedProperties . |
+
Modifier and Type | +Method and Description | +
---|---|
private void |
+addProperties(java.util.Map<java.lang.String,java.lang.String> properties)
+Adds the specified properties to the current ones and checks if their names and types are correct.
+ |
+
private void |
+checkType(XenonPropertyDescription description,
+ java.lang.String key,
+ java.lang.String value) |
+
XenonProperties |
+clear(java.lang.String prefix)
+Returns a copy of this XenonProperties that contains all properties but clears the properties that start with the given prefix.
+ |
+
static <K,V> java.util.Map<K,V> |
+emptyMap(int capacity)
+Creates empty mutable Map with sufficient initial capacity.
+ |
+
XenonProperties |
+exclude(java.lang.String prefix)
+Returns a copy of this XenonProperties that contains all properties except the properties that start with the given prefix.
+ |
+
XenonProperties |
+filter(java.lang.String prefix)
+Returns a new XenonProperties that contains only the properties whose key start with a certain prefix.
+ |
+
private <K,V> java.util.Map<K,V> |
+filterOnKey(java.util.Map<K,V> map,
+ java.util.function.Predicate<K> predicate) |
+
private XenonProperties |
+filterUsingPredicate(java.util.function.Predicate<java.lang.String> predicate) |
+
boolean |
+getBooleanProperty(java.lang.String name)
+Retrieves the value of a boolean property with the given name.
+ |
+
double |
+getDoubleProperty(java.lang.String name)
+Retrieves the value of an double property with the given name.
+ |
+
int |
+getIntegerProperty(java.lang.String name)
+Retrieves the value of an integer property with the given name.
+ |
+
int |
+getIntegerProperty(java.lang.String name,
+ int defaultValue)
+Retrieves the value of an integer property with the given name.
+ |
+
long |
+getLongProperty(java.lang.String name)
+Retrieves the value of an long property with the given name.
+ |
+
long |
+getNaturalProperty(java.lang.String name)
+Retrieves the value of an natural number property (e.g.
+ |
+
java.lang.String |
+getProperty(java.lang.String name)
+Retrieves the value of a property with the given name without checking its type.
+ |
+
private java.lang.String |
+getProperty(java.lang.String name,
+ XenonPropertyDescription.Type type) |
+
java.lang.String[] |
+getPropertyNames()
+Returns a sorted list of all supported property names.
+ |
+
long |
+getSizeProperty(java.lang.String name)
+Retrieves the value of a size property with the given name.
+ |
+
java.lang.String |
+getStringProperty(java.lang.String name)
+Retrieves the value of a string property with the given name.
+ |
+
XenonPropertyDescription[] |
+getSupportedProperties()
+Returns the descriptions of all supported properties.
+ |
+
private long |
+parseSizeValue(java.lang.String value) |
+
void |
+printProperties(java.io.PrintStream out,
+ java.lang.String prefix)
+Prints properties (including default properties) to a stream.
+ |
+
boolean |
+propertySet(java.lang.String name)
+Check if the property with the given name is set.
+ |
+
boolean |
+supportsProperty(java.lang.String name)
+Check if this XenonProperties supports a property with the given name.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+toMap()
+Returns all properties that are set in a new Map.
+ |
+
java.lang.String |
+toString() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final java.lang.String NAME+
private static final int KILO+
private static final int MEGA+
private static final int GIGA+
private final java.util.Map<java.lang.String,XenonPropertyDescription> propertyDescriptions+
private final java.util.Map<java.lang.String,java.lang.String> properties+
private XenonProperties(java.util.Map<java.lang.String,XenonPropertyDescription> propertyDescriptions, + java.util.Map<java.lang.String,java.lang.String> properties)+
properties
parameter is assumed to only contain valid supported
+ properties and have values of the correct type.propertyDescriptions
- a map containing a description of all supported properties.properties
- a map containing valid properties and their values.public XenonProperties()+
public XenonProperties(XenonPropertyDescription[] propertyDescriptions, + java.util.Map<java.lang.String,java.lang.String> properties) + throws UnknownPropertyException, + InvalidPropertyException+
supportedProperties
. All properties in properties
will be
+ added.propertyDescriptions
- the properties to supportproperties
- the set of properties to storeUnknownPropertyException
- if key is found in properties
that is not listed in supportedProperties
InvalidPropertyException
- if a key from properties
has a value that does not match the type as listed in supportedProperties
public static <K,V> java.util.Map<K,V> emptyMap(int capacity)+
K
- key typeV
- value typecapacity
- maximum size without resizing underlying data structureprivate void addProperties(java.util.Map<java.lang.String,java.lang.String> properties) + throws UnknownPropertyException, + InvalidPropertyException+
properties
- the properties to add.UnknownPropertyException
- if the property can not be fonudInvalidPropertyException
- if the type of the value does not match the expected typeprivate void checkType(XenonPropertyDescription description, + java.lang.String key, + java.lang.String value) + throws InvalidPropertyException+
InvalidPropertyException
public boolean supportsProperty(java.lang.String name)+
name
- the name of the property.true
if this XenonProperties supports a property with the given name, false
otherwise.public boolean propertySet(java.lang.String name) + throws UnknownPropertyException+
name
- the name of the property.true
if the property with the given name is set, false
otherwise.UnknownPropertyException
- if the given name is not a supported property.public java.lang.String getProperty(java.lang.String name) + throws UnknownPropertyException+
String
representation
+ is always returned.name
- the name of the property.UnknownPropertyException
- if the given name is not a supported property.private java.lang.String getProperty(java.lang.String name, + XenonPropertyDescription.Type type) + throws UnknownPropertyException, + PropertyTypeException+
UnknownPropertyException
PropertyTypeException
public boolean getBooleanProperty(java.lang.String name) + throws UnknownPropertyException, + PropertyTypeException, + InvalidPropertyException+
name
- the name of the propertyUnknownPropertyException
- if the given name is not a supported property.PropertyTypeException
- if the property is not of type boolean.InvalidPropertyException
- if the property value cannot be converted into a boolean.public int getIntegerProperty(java.lang.String name) + throws UnknownPropertyException, + PropertyTypeException, + InvalidPropertyException+
name
- the name of the propertyUnknownPropertyException
- if the given name is not a supported property.PropertyTypeException
- if the property is not of type integer.InvalidPropertyException
- if the property value cannot be converted into a integer.public int getIntegerProperty(java.lang.String name, + int defaultValue) + throws UnknownPropertyException, + PropertyTypeException, + InvalidPropertyException+
name
- the name of the propertydefaultValue
- the value to return if the property is not foundUnknownPropertyException
- if the given name is not a supported property.PropertyTypeException
- if the property is not of type integer.InvalidPropertyException
- if the property value cannot be converted into a integer.public long getLongProperty(java.lang.String name) + throws UnknownPropertyException, + PropertyTypeException, + InvalidPropertyException+
name
- the name of the propertyUnknownPropertyException
- if the given name is not a supported property.PropertyTypeException
- if the property is not of type long.InvalidPropertyException
- if the property value cannot be converted into a long.public long getNaturalProperty(java.lang.String name) + throws UnknownPropertyException, + PropertyTypeException, + InvalidPropertyException+
name
- the name of the propertyUnknownPropertyException
- if the given name is not a supported property.PropertyTypeException
- if the property is not of type long.InvalidPropertyException
- if the property value cannot be converted into a long.public double getDoubleProperty(java.lang.String name) + throws UnknownPropertyException, + PropertyTypeException, + InvalidPropertyException+
name
- the name of the propertyUnknownPropertyException
- if the given name is not a supported property.PropertyTypeException
- if the property is not of type double.InvalidPropertyException
- if the property value cannot be converted into a double.public java.lang.String getStringProperty(java.lang.String name) + throws UnknownPropertyException, + PropertyTypeException+
name
- the name of the propertyUnknownPropertyException
- if the given name is not a supported property.PropertyTypeException
- if the property is not of type string.private long parseSizeValue(java.lang.String value) + throws InvalidPropertyException+
InvalidPropertyException
public long getSizeProperty(java.lang.String name) + throws UnknownPropertyException, + PropertyTypeException, + InvalidPropertyException+
name
- the name of the propertyUnknownPropertyException
- if the given name is not a supported property.PropertyTypeException
- if the property is not of type size.InvalidPropertyException
- if the property value cannot be converted into a long.public XenonProperties filter(java.lang.String prefix)+
prefix
- the desired prefixpublic XenonProperties exclude(java.lang.String prefix)+
prefix
- the prefix of the properties to excludeprivate XenonProperties filterUsingPredicate(java.util.function.Predicate<java.lang.String> predicate)+
private <K,V> java.util.Map<K,V> filterOnKey(java.util.Map<K,V> map, + java.util.function.Predicate<K> predicate)+
public XenonProperties clear(java.lang.String prefix)+
prefix
- the prefix of the properties to excludepublic XenonPropertyDescription[] getSupportedProperties()+
public java.lang.String[] getPropertyNames()+
public java.util.Map<java.lang.String,java.lang.String> toMap()+
public void printProperties(java.io.PrintStream out, + java.lang.String prefix)+
out
- The stream to write output to.prefix
- Only print properties which start with the given prefix. If null, will print all propertiespublic java.lang.String toString()+
toString
in class java.lang.Object
public class ConnectionLostException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
ConnectionLostException(java.lang.String adaptorName,
+ java.lang.String message) |
+
ConnectionLostException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public ConnectionLostException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public ConnectionLostException(java.lang.String adaptorName, + java.lang.String message)+
public class EndOfFileException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
EndOfFileException(java.lang.String adaptorName,
+ java.lang.String message) |
+
EndOfFileException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public abstract class FileAdaptor +extends Adaptor +implements FileSystemAdaptorDescription+
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ADAPTORS_PREFIX |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+FileAdaptor(java.lang.String name,
+ java.lang.String description,
+ java.lang.String[] locations,
+ XenonPropertyDescription[] properties) |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+canAppend() |
+
boolean |
+canCreateSymboliclinks()
+Can this adaptor create symbolic links ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
boolean |
+canReadSymboliclinks()
+Can this adaptor read symbolic links ?
+ |
+
abstract FileSystem |
+createFileSystem(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
boolean |
+isConnectionless() |
+
boolean |
+needsSizeBeforehand() |
+
boolean |
+supportsReadingPosixPermissions() |
+
boolean |
+supportsRename() |
+
boolean |
+supportsSettingPosixPermissions() |
+
boolean |
+supportsThirdPartyCopy()
+Does this adaptor support third party copy ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedCredentials, getSupportedLocations, getSupportedProperties
public static final java.lang.String ADAPTORS_PREFIX+
protected FileAdaptor(java.lang.String name, + java.lang.String description, + java.lang.String[] locations, + XenonPropertyDescription[] properties)+
public boolean supportsThirdPartyCopy()+
FileSystemAdaptorDescription
supportsThirdPartyCopy
in interface FileSystemAdaptorDescription
public boolean canReadSymboliclinks()+
FileSystemAdaptorDescription
canReadSymboliclinks
in interface FileSystemAdaptorDescription
public boolean canCreateSymboliclinks()+
FileSystemAdaptorDescription
canCreateSymboliclinks
in interface FileSystemAdaptorDescription
public boolean isConnectionless()+
isConnectionless
in interface FileSystemAdaptorDescription
public boolean supportsReadingPosixPermissions()+
supportsReadingPosixPermissions
in interface FileSystemAdaptorDescription
public boolean supportsSettingPosixPermissions()+
supportsSettingPosixPermissions
in interface FileSystemAdaptorDescription
public boolean supportsRename()+
supportsRename
in interface FileSystemAdaptorDescription
public boolean canAppend()+
canAppend
in interface FileSystemAdaptorDescription
public boolean needsSizeBeforehand()+
needsSizeBeforehand
in interface FileSystemAdaptorDescription
public abstract FileSystem createFileSystem(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
XenonException
public class NoSpaceException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
NoSpaceException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NoSpaceException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public class PathAttributesImplementation +extends java.lang.Object +implements PathAttributes+
Modifier and Type | +Field and Description | +
---|---|
private long |
+creationTime
+The creation time of this file
+ |
+
private boolean |
+executable
+Is the file executable ?
+ |
+
private java.lang.String |
+group
+The group of this file
+ |
+
private boolean |
+hidden
+Is the file hidden ?
+ |
+
private boolean |
+isDirectory
+Is this a directory ?
+ |
+
private boolean |
+isOther
+Is this an other type of file ?
+ |
+
private boolean |
+isRegular
+Is this a regular file ?
+ |
+
private boolean |
+isSymbolicLink
+Is this a symbolic link ?
+ |
+
private long |
+lastAccessTime
+The last access time of this file
+ |
+
private long |
+lastModifiedTime
+The last modified time of this file
+ |
+
private java.lang.String |
+owner
+The owner of this file
+ |
+
private Path |
+path
+The path these attributes belong to
+ |
+
private java.util.Set<PosixFilePermission> |
+permissions
+The permissions of this file (POSIX only)
+ |
+
private boolean |
+readable
+Is the file readable ?
+ |
+
private long |
+size
+The size of this file
+ |
+
private boolean |
+writable
+Is the file writable ?
+ |
+
Constructor and Description | +
---|
PathAttributesImplementation() |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
long |
+getCreationTime()
+Get the creation time for this file.
+ |
+
java.lang.String |
+getGroup()
+Get the group of this file.
+ |
+
long |
+getLastAccessTime()
+Get the last access time for this file.
+ |
+
long |
+getLastModifiedTime()
+Get the last modified time for this file.
+ |
+
java.lang.String |
+getOwner()
+Get the owner of this file.
+ |
+
Path |
+getPath()
+Get the path these attributes belong to.
+ |
+
java.util.Set<PosixFilePermission> |
+getPermissions()
+Get the permissions of this file.
+ |
+
long |
+getSize()
+Get the size of this file in bytes.
+ |
+
int |
+hashCode() |
+
boolean |
+isDirectory()
+Does the path refer to a directory ?
+ |
+
boolean |
+isExecutable()
+Does the path refer to an executable file ?
+ |
+
boolean |
+isHidden()
+Does the path refer to an hidden file ?
+ |
+
boolean |
+isOther()
+Is the path not a file, link or directory ?
+ |
+
boolean |
+isReadable()
+Does the path refer to an readable file ?
+ |
+
boolean |
+isRegular()
+Does the path refer to a regular file ?
+ |
+
boolean |
+isSymbolicLink()
+Does the path refer to a symbolic link ?
+ |
+
boolean |
+isWritable()
+Does the path refer to a writable file ?
+ |
+
void |
+setCreationTime(long creationTime) |
+
void |
+setDirectory(boolean isDirectory) |
+
void |
+setExecutable(boolean executable) |
+
void |
+setGroup(java.lang.String group) |
+
void |
+setHidden(boolean hidden) |
+
void |
+setLastAccessTime(long lastAccessTime) |
+
void |
+setLastModifiedTime(long lastModifiedTime) |
+
void |
+setOther(boolean isOther) |
+
void |
+setOwner(java.lang.String owner) |
+
void |
+setPath(Path path) |
+
void |
+setPermissions(java.util.Set<PosixFilePermission> permissions) |
+
void |
+setReadable(boolean readable) |
+
void |
+setRegular(boolean isRegular) |
+
void |
+setSize(long size) |
+
void |
+setSymbolicLink(boolean isSymbolicLink) |
+
void |
+setWritable(boolean writable) |
+
java.lang.String |
+toString() |
+
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private Path path+
private boolean isDirectory+
private boolean isRegular+
private boolean isSymbolicLink+
private boolean isOther+
private boolean executable+
private boolean readable+
private boolean writable+
private boolean hidden+
private long creationTime+
private long lastAccessTime+
private long lastModifiedTime+
private long size+
private java.lang.String owner+
private java.lang.String group+
private java.util.Set<PosixFilePermission> permissions+
public PathAttributesImplementation()+
public Path getPath()+
getPath
in interface PathAttributes
public void setPath(Path path)+
public boolean isDirectory()+
isDirectory
in interface PathAttributes
public void setDirectory(boolean isDirectory)+
public boolean isRegular()+
isRegular
in interface PathAttributes
public void setRegular(boolean isRegular)+
public boolean isSymbolicLink()+
isSymbolicLink
in interface PathAttributes
public void setSymbolicLink(boolean isSymbolicLink)+
public boolean isOther()+
isOther
in interface PathAttributes
public void setOther(boolean isOther)+
public boolean isExecutable()+
isExecutable
in interface PathAttributes
public void setExecutable(boolean executable)+
public boolean isReadable()+
isReadable
in interface PathAttributes
public void setReadable(boolean readable)+
public boolean isWritable()+
isWritable
in interface PathAttributes
public void setWritable(boolean writable)+
public boolean isHidden()+
isHidden
in interface PathAttributes
public void setHidden(boolean hidden)+
public long getCreationTime()+
getLastModifiedTime()
will be returned instead.getCreationTime
in interface PathAttributes
public void setCreationTime(long creationTime)+
public long getLastAccessTime()+
getLastModifiedTime()
will be returned instead.getLastAccessTime
in interface PathAttributes
public void setLastAccessTime(long lastAccessTime)+
public long getLastModifiedTime()+
0
will be returned instead.getLastModifiedTime
in interface PathAttributes
public void setLastModifiedTime(long lastModifiedTime)+
public long getSize()+
0
will be returned.getSize
in interface PathAttributes
public void setSize(long size)+
public java.lang.String getOwner() + throws AttributeNotSupportedException+
getOwner
in interface PathAttributes
AttributeNotSupportedException
- If the attribute is not supported by the adaptor.public void setOwner(java.lang.String owner)+
public java.lang.String getGroup() + throws AttributeNotSupportedException+
getGroup
in interface PathAttributes
AttributeNotSupportedException
- If the attribute is not supported by the adaptor.public void setGroup(java.lang.String group)+
public java.util.Set<PosixFilePermission> getPermissions() + throws AttributeNotSupportedException+
getPermissions
in interface PathAttributes
AttributeNotSupportedException
- If the attribute is not supported by the adaptor.public void setPermissions(java.util.Set<PosixFilePermission> permissions)+
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public java.lang.String toString()+
toString
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public class PermissionDeniedException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
PermissionDeniedException(java.lang.String adaptorName,
+ java.lang.String message) |
+
PermissionDeniedException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public PermissionDeniedException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public PermissionDeniedException(java.lang.String adaptorName, + java.lang.String message)+
public class PosixFileUtils
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
static int |
+EXEC_GROUP
+execute/search by group
+ |
+
static int |
+EXEC_OTHERS
+execute/search by others
+ |
+
static int |
+EXEC_OWNER
+execute/search by owner
+ |
+
static int |
+READ_GROUP
+read by group
+ |
+
static int |
+READ_OTHERS
+read by others
+ |
+
static int |
+READ_OWNER
+read by owner
+ |
+
static int |
+WRITE_GROUP
+write by group
+ |
+
static int |
+WRITE_OTHERS
+write by others
+ |
+
static int |
+WRITE_OWNER
+write by owner
+ |
+
Modifier | +Constructor and Description | +
---|---|
private |
+PosixFileUtils() |
+
Modifier and Type | +Method and Description | +
---|---|
static java.util.Set<PosixFilePermission> |
+bitsToPermissions(int bit) |
+
static boolean |
+isExecutable(int permissions) |
+
static boolean |
+isReadable(int permissions) |
+
static boolean |
+isWritable(int permissions) |
+
static int |
+permissionsToBits(java.util.Set<PosixFilePermission> permissions) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final int READ_OWNER+
public static final int WRITE_OWNER+
public static final int EXEC_OWNER+
public static final int READ_GROUP+
public static final int WRITE_GROUP+
public static final int EXEC_GROUP+
public static final int READ_OTHERS+
public static final int WRITE_OTHERS+
public static final int EXEC_OTHERS+
public static java.util.Set<PosixFilePermission> bitsToPermissions(int bit)+
public static int permissionsToBits(java.util.Set<PosixFilePermission> permissions)+
public static boolean isExecutable(int permissions)+
public static boolean isReadable(int permissions)+
public static boolean isWritable(int permissions)+
public class RecursiveListIterator +extends java.lang.Object +implements java.util.Iterator<PathAttributes>+
Modifier and Type | +Field and Description | +
---|---|
(package private) java.util.function.Function<Path,java.util.Iterator<PathAttributes>> |
+list |
+
(package private) java.util.Stack<java.util.Iterator<PathAttributes>> |
+stack |
+
Constructor and Description | +
---|
RecursiveListIterator(java.util.function.Function<Path,java.util.Iterator<PathAttributes>> list,
+ Path path) |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+hasNext() |
+
PathAttributes |
+next() |
+
(package private) void |
+popEmpties() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
final java.util.Stack<java.util.Iterator<PathAttributes>> stack+
final java.util.function.Function<Path,java.util.Iterator<PathAttributes>> list+
public RecursiveListIterator(java.util.function.Function<Path,java.util.Iterator<PathAttributes>> list, + Path path)+
void popEmpties()+
public boolean hasNext()+
hasNext
in interface java.util.Iterator<PathAttributes>
public PathAttributes next()+
next
in interface java.util.Iterator<PathAttributes>
public class FtpFileAdaptor +extends FileAdaptor+
Modifier and Type | +Field and Description | +
---|---|
private static java.lang.String |
+ADAPTOR_DESCRIPTION
+A description of this adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by this adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+The name of this adaptor
+ |
+
static java.lang.String |
+BUFFER_SIZE
+The buffer size to use when copying data.
+ |
+
protected static int |
+DEFAULT_PORT
+The default SSH port
+ |
+
private static org.slf4j.Logger |
+LOGGER |
+
static java.lang.String |
+PREFIX
+All our own properties start with this prefix.
+ |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+List of properties supported by this FTP adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
FtpFileAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+canAppend() |
+
protected org.apache.commons.net.ftp.FTPClient |
+connect(java.lang.String location,
+ Credential credential) |
+
private void |
+connectToServer(java.lang.String host,
+ int port,
+ org.apache.commons.net.ftp.FTPClient ftp) |
+
FileSystem |
+createFileSystem(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
private java.lang.String |
+getCurrentWorkingDirectory(org.apache.commons.net.ftp.FTPClient ftpClient,
+ java.lang.String location) |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
private void |
+login(Credential credential,
+ org.apache.commons.net.ftp.FTPClient ftp) |
+
private void |
+loginWithCredentialOrDefault(org.apache.commons.net.ftp.FTPClient ftp,
+ Credential credential) |
+
boolean |
+supportsReadingPosixPermissions() |
+
private void |
+verifyLoginSuccess(int replyCode) |
+
canCreateSymboliclinks, canReadSymboliclinks, isConnectionless, needsSizeBeforehand, supportsRename, supportsSettingPosixPermissions, supportsThirdPartyCopy
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
private static final org.slf4j.Logger LOGGER+
public static final java.lang.String ADAPTOR_NAME+
protected static final int DEFAULT_PORT+
private static final java.lang.String ADAPTOR_DESCRIPTION+
public static final java.lang.String PREFIX+
public static final java.lang.String BUFFER_SIZE+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
protected org.apache.commons.net.ftp.FTPClient connect(java.lang.String location, + Credential credential) + throws XenonException+
XenonException
public FileSystem createFileSystem(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createFileSystem
in class FileAdaptor
XenonException
private java.lang.String getCurrentWorkingDirectory(org.apache.commons.net.ftp.FTPClient ftpClient, + java.lang.String location) + throws XenonException+
XenonException
private void connectToServer(java.lang.String host, + int port, + org.apache.commons.net.ftp.FTPClient ftp) + throws XenonException+
XenonException
private void login(Credential credential, + org.apache.commons.net.ftp.FTPClient ftp) + throws XenonException+
XenonException
private void verifyLoginSuccess(int replyCode) + throws XenonException+
XenonException
private void loginWithCredentialOrDefault(org.apache.commons.net.ftp.FTPClient ftp, + Credential credential) + throws java.io.IOException+
java.io.IOException
public boolean supportsReadingPosixPermissions()+
supportsReadingPosixPermissions
in interface FileSystemAdaptorDescription
supportsReadingPosixPermissions
in class FileAdaptor
public boolean canAppend()+
canAppend
in interface FileSystemAdaptorDescription
canAppend
in class FileAdaptor
public java.lang.Class[] getSupportedCredentials()+
AdaptorDescription
public class FtpFileSystem +extends FileSystem+
Modifier and Type | +Field and Description | +
---|---|
private FtpFileAdaptor |
+adaptor |
+
private Credential |
+credential |
+
private org.apache.commons.net.ftp.FTPClient |
+ftpClient |
+
private static org.slf4j.Logger |
+LOGGER |
+
private static int[] |
+PERMISSION_TYPES |
+
private static int[] |
+USER_TYPES |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+FtpFileSystem(java.lang.String uniqueID,
+ java.lang.String name,
+ java.lang.String location,
+ Path entryPath,
+ int bufferSize,
+ org.apache.commons.net.ftp.FTPClient ftpClient,
+ Credential credential,
+ FtpFileAdaptor adaptor,
+ XenonProperties properties) |
+
Modifier and Type | +Method and Description | +
---|---|
java.io.OutputStream |
+appendToFile(Path path)
+Open an existing file and return an
+OutputStream to append data to this file. |
+
private void |
+checkClientReply(org.apache.commons.net.ftp.FTPClient client,
+ java.lang.String message) |
+
private void |
+checkClientReply(java.lang.String message) |
+
void |
+close()
+Close this FileSystem.
+ |
+
private PathAttributes |
+convertAttributes(Path path,
+ org.apache.commons.net.ftp.FTPFile attributes) |
+
void |
+createDirectory(Path path)
+Creates a new directory, failing if the directory already exists.
+ |
+
void |
+createFile(Path path)
+Creates a new empty file, failing if the file already exists.
+ |
+
void |
+createSymbolicLink(Path link,
+ Path path)
+Creates a new symbolic link, failing if the link already exists (optional operation).
+ |
+
protected void |
+deleteDirectory(Path path)
+Delete an empty directory.
+ |
+
protected void |
+deleteFile(Path path)
+Delete a file.
+ |
+
boolean |
+exists(Path path)
+Tests if a path exists.
+ |
+
private org.apache.commons.net.ftp.FTPFile |
+findFTPFile(org.apache.commons.net.ftp.FTPFile[] files,
+ Path path) |
+
PathAttributes |
+getAttributes(Path path)
+Get the
+PathAttributes of an existing path. |
+
private org.apache.commons.net.ftp.FTPFile |
+getFTPFileInfo(Path path) |
+
private java.util.HashSet<PosixFilePermission> |
+getPermissions(org.apache.commons.net.ftp.FTPFile attributes) |
+
private PosixFilePermission |
+getPosixFilePermission(int userType,
+ int permissionType) |
+
boolean |
+isOpen()
+Return if the connection to the FileSystem is open.
+ |
+
protected java.util.List<PathAttributes> |
+listDirectory(Path path)
+Return the list of entries in a directory.
+ |
+
java.io.InputStream |
+readFromFile(Path path)
+Open an existing file and return an
+InputStream to read from this file. |
+
Path |
+readSymbolicLink(Path path)
+Reads the target of a symbolic link (optional operation).
+ |
+
void |
+rename(Path source,
+ Path target)
+Rename an existing source path to a non-existing target path (optional operation).
+ |
+
void |
+setPosixFilePermissions(Path path,
+ java.util.Set<PosixFilePermission> permissions)
+Sets the POSIX permissions of a path (optional operation).
+ |
+
java.io.OutputStream |
+writeToFile(Path path)
+Open a file and return an
+OutputStream to write to this file. |
+
java.io.OutputStream |
+writeToFile(Path path,
+ long size)
+Open a file and return an
+OutputStream to write to this file. |
+
areSamePaths, assertDirectoryExists, assertFileExists, assertFileIsSymbolicLink, assertIsOpen, assertNotNull, assertParentDirectoryExists, assertPathExists, assertPathIsDirectory, assertPathIsFile, assertPathIsNotDirectory, assertPathNotExists, cancel, copy, copyFile, copySymbolicLink, create, create, create, create, createDirectories, delete, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getLocation, getPathSeparator, getProperties, getStatus, getWorkingDirectory, hashCode, isDotDot, list, list, performCopy, setWorkingDirectory, streamCopy, toAbsolutePath, waitUntilDone
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private static final int[] PERMISSION_TYPES+
private static final int[] USER_TYPES+
private final org.apache.commons.net.ftp.FTPClient ftpClient+
private final Credential credential+
private final FtpFileAdaptor adaptor+
protected FtpFileSystem(java.lang.String uniqueID, + java.lang.String name, + java.lang.String location, + Path entryPath, + int bufferSize, + org.apache.commons.net.ftp.FTPClient ftpClient, + Credential credential, + FtpFileAdaptor adaptor, + XenonProperties properties)+
public void close() + throws XenonException+
FileSystem
close
in interface java.lang.AutoCloseable
close
in class FileSystem
XenonException
- If the FileSystem failed to close or if an I/O error occurred.public boolean isOpen() + throws XenonException+
FileSystem
isOpen
in class FileSystem
XenonException
- if the test failed or an I/O error occurred.private java.util.HashSet<PosixFilePermission> getPermissions(org.apache.commons.net.ftp.FTPFile attributes)+
private PosixFilePermission getPosixFilePermission(int userType, + int permissionType)+
private PathAttributes convertAttributes(Path path, + org.apache.commons.net.ftp.FTPFile attributes)+
private void checkClientReply(org.apache.commons.net.ftp.FTPClient client, + java.lang.String message) + throws XenonException+
XenonException
private void checkClientReply(java.lang.String message) + throws XenonException+
XenonException
public void rename(Path source, + Path target) + throws XenonException+
FileSystem
+
+ This method only implements a rename operation, not a move operation. Hence, this method will not copy files and should return (almost)
+ instantaneously.
+
+ The parent of the target path (e.g. target.getParent
) must exist.
+
+ If the target is equal to the source this method has no effect.
+
+ If the source is a link, the link itself will be renamed, not the path to which it refers.
+
+ If the source is a directory, it will be renamed to the target. This implies that a moving a directory between physical locations may fail.
+
rename
in class FileSystem
source
- the existing source path.target
- the non existing target path.UnsupportedOperationException
- If the adapter does not support renaming.NoSuchPathException
- If the source file does not exist or the target parent directory does not exist.PathAlreadyExistsException
- If the target file already exists.NotConnectedException
- If file system is closed.XenonException
- If the move failed.public void createDirectory(Path path) + throws XenonException+
FileSystem
createDirectory
in class FileSystem
path
- the directory to create.PathAlreadyExistsException
- If the directory already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createFile(Path path) + throws XenonException+
FileSystem
createFile
in class FileSystem
path
- a path referring to the file to create.PathAlreadyExistsException
- If the file already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createSymbolicLink(Path link, + Path path) + throws XenonException+
FileSystem
createSymbolicLink
in class FileSystem
link
- the symbolic link to create.path
- the target the symbolic link should refer to.PathAlreadyExistsException
- If the link already exists.NoSuchPathException
- If the target or parent directory of link does not existInvalidPathException
- If parent of link is not a directoryNotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.protected void deleteDirectory(Path path) + throws XenonException+
FileSystem
rmdir
in Linux).
+
+ This operation must be implemented by the various implementations of FileSystem.deleteDirectory
in class FileSystem
path
- the directory to removeInvalidPathException
- if the provided path is not a directory.NoSuchPathException
- if the provided path does not exist.XenonException
- If the directory could not be removed.protected void deleteFile(Path path) + throws XenonException+
FileSystem
deleteFile
in class FileSystem
path
- the file to removeInvalidPathException
- if the provided path is not a file.NoSuchPathException
- if the provided file does not exist.XenonException
- If the file could not be removed.public boolean exists(Path path) + throws XenonException+
FileSystem
exists
in class FileSystem
path
- the path to test.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.private org.apache.commons.net.ftp.FTPFile findFTPFile(org.apache.commons.net.ftp.FTPFile[] files, + Path path) + throws NoSuchPathException+
NoSuchPathException
private org.apache.commons.net.ftp.FTPFile getFTPFileInfo(Path path) + throws XenonException+
XenonException
public PathAttributes getAttributes(Path path) + throws XenonException+
FileSystem
PathAttributes
of an existing path.getAttributes
in class FileSystem
path
- the existing path.NoSuchPathException
- If the file does not exists.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.protected java.util.List<PathAttributes> listDirectory(Path path) + throws XenonException+
FileSystem
dir
will be returned as part of the list, but they will not be listed themselves.
+
+ This operation must be implemented by the various implementations of FileSystem.listDirectory
in class FileSystem
path
- the directory to listIterable
that iterates over all entries in dir
XenonException
- If the list could not be retrieved.public java.io.InputStream readFromFile(Path path) + throws XenonException+
FileSystem
InputStream
to read from this file.readFromFile
in class FileSystem
path
- the to read.InputStream
to read from the file.NoSuchPathException
- If the file does not exists.InvalidPathException
- If the file is not regular file.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path path, + long size) + throws XenonException+
FileSystem
OutputStream
to write to this file.
+
+
+ The size of the file (once all data has been written) must be specified using the size
parameter. This is required by some implementations
+ (typically blob-stores).
+
+
writeToFile
in class FileSystem
path
- the target file for the OutputStream.size
- the size of the file once fully written.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path path) + throws XenonException+
FileSystem
OutputStream
to write to this file. (optional operation)
+ + If the file already exists it will be replaced and its data will be lost. + + The amount of data that will be written to the file is not specified in advance. This operation may not be supported by all implementations. + +
writeToFile
in class FileSystem
path
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream appendToFile(Path path) + throws XenonException+
FileSystem
OutputStream
to append data to this file. (optional operation)
+ + If the file does not exist, an exception will be thrown. + + This operation may not be supported by all implementations. + +
appendToFile
in class FileSystem
path
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.InvalidPathException
- if not a regular fileNotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.UnsupportedOperationException
- if the adaptor does not support appendingpublic Path readSymbolicLink(Path path) + throws XenonException+
FileSystem
readSymbolicLink
in class FileSystem
path
- the link to read.NoSuchPathException
- If the link does not exists.InvalidPathException
- If the source is not a link.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public void setPosixFilePermissions(Path path, + java.util.Set<PosixFilePermission> permissions) + throws XenonException+
FileSystem
setPosixFilePermissions
in class FileSystem
path
- the target path.permissions
- the permissions to set.NoSuchPathException
- If the target path does not exists.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public class FtpInputStream
+extends java.io.InputStream
+Modifier and Type | +Field and Description | +
---|---|
private boolean |
+completedPendingFtpCommand |
+
private org.apache.commons.net.ftp.FTPClient |
+ftpClient |
+
private java.io.InputStream |
+inputStream |
+
Constructor and Description | +
---|
FtpInputStream(java.io.InputStream inputStream,
+ org.apache.commons.net.ftp.FTPClient ftpClient) |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+available() |
+
void |
+close() |
+
void |
+mark(int readlimit) |
+
boolean |
+markSupported() |
+
int |
+read() |
+
int |
+read(byte[] b) |
+
int |
+read(byte[] b,
+ int off,
+ int len) |
+
void |
+reset() |
+
long |
+skip(long n) |
+
java.lang.String |
+toString() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private final java.io.InputStream inputStream+
private final org.apache.commons.net.ftp.FTPClient ftpClient+
private boolean completedPendingFtpCommand+
public FtpInputStream(java.io.InputStream inputStream, + org.apache.commons.net.ftp.FTPClient ftpClient)+
public int read() + throws java.io.IOException+
read
in class java.io.InputStream
java.io.IOException
public void close() + throws java.io.IOException+
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.InputStream
java.io.IOException
public int available() + throws java.io.IOException+
available
in class java.io.InputStream
java.io.IOException
public void mark(int readlimit)+
mark
in class java.io.InputStream
public boolean markSupported()+
markSupported
in class java.io.InputStream
public int read(byte[] b) + throws java.io.IOException+
read
in class java.io.InputStream
java.io.IOException
public int read(byte[] b, + int off, + int len) + throws java.io.IOException+
read
in class java.io.InputStream
java.io.IOException
public void reset() + throws java.io.IOException+
reset
in class java.io.InputStream
java.io.IOException
public long skip(long n) + throws java.io.IOException+
skip
in class java.io.InputStream
java.io.IOException
public java.lang.String toString()+
toString
in class java.lang.Object
public class FtpOutputStream
+extends java.io.OutputStream
+Modifier and Type | +Field and Description | +
---|---|
private boolean |
+completedPendingFtpCommand |
+
private org.apache.commons.net.ftp.FTPClient |
+ftpClient |
+
private java.io.OutputStream |
+outputStream |
+
Constructor and Description | +
---|
FtpOutputStream(java.io.OutputStream outputStream,
+ org.apache.commons.net.ftp.FTPClient ftpClient) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+close() |
+
void |
+flush() |
+
java.lang.String |
+toString() |
+
void |
+write(byte[] b) |
+
void |
+write(byte[] b,
+ int off,
+ int len) |
+
void |
+write(int b) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private final java.io.OutputStream outputStream+
private final org.apache.commons.net.ftp.FTPClient ftpClient+
private boolean completedPendingFtpCommand+
public FtpOutputStream(java.io.OutputStream outputStream, + org.apache.commons.net.ftp.FTPClient ftpClient)+
public void write(int b) + throws java.io.IOException+
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) + throws java.io.IOException+
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, + int off, + int len) + throws java.io.IOException+
write
in class java.io.OutputStream
java.io.IOException
public void close() + throws java.io.IOException+
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.OutputStream
java.io.IOException
public void flush() + throws java.io.IOException+
flush
in interface java.io.Flushable
flush
in class java.io.OutputStream
java.io.IOException
public java.lang.String toString()+
toString
in class java.lang.Object
Class | +Description | +
---|---|
FtpFileAdaptor | ++ |
FtpFileSystem | ++ |
FtpInputStream | +
+ Wraps an InputStream instance.
+ |
+
FtpOutputStream | +
+ Wraps an OutputStream instance.
+ |
+
public class HDFSFileAdaptor +extends FileAdaptor+
Modifier and Type | +Field and Description | +
---|---|
private static java.lang.String |
+ADAPTOR_DESCRIPTION
+A description of this adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by this adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+The name of this adaptor
+ |
+
static java.lang.String |
+BUFFER_SIZE
+The buffer size to use when copying data.
+ |
+
protected static int |
+DEFAULT_PORT
+The default SSH port
+ |
+
static java.lang.String |
+HADOOP_SETTINGS_FILE |
+
static java.lang.String |
+PREFIX
+All our own properties start with this prefix.
+ |
+
protected static XenonPropertyDescription[] |
+VALID_PROPERTIES |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
HDFSFileAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+canCreateSymboliclinks()
+Can this adaptor create symbolic links ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
boolean |
+canReadSymboliclinks()
+Can this adaptor read symbolic links ?
+ |
+
FileSystem |
+createFileSystem(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
canAppend, isConnectionless, needsSizeBeforehand, supportsReadingPosixPermissions, supportsRename, supportsSettingPosixPermissions, supportsThirdPartyCopy
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
public static final java.lang.String ADAPTOR_NAME+
protected static final int DEFAULT_PORT+
private static final java.lang.String ADAPTOR_DESCRIPTION+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
public static final java.lang.String PREFIX+
public static final java.lang.String HADOOP_SETTINGS_FILE+
public static final java.lang.String BUFFER_SIZE+
protected static final XenonPropertyDescription[] VALID_PROPERTIES+
public FileSystem createFileSystem(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createFileSystem
in class FileAdaptor
XenonException
public boolean canReadSymboliclinks()+
FileSystemAdaptorDescription
canReadSymboliclinks
in interface FileSystemAdaptorDescription
canReadSymboliclinks
in class FileAdaptor
public boolean canCreateSymboliclinks()+
FileSystemAdaptorDescription
canCreateSymboliclinks
in interface FileSystemAdaptorDescription
canCreateSymboliclinks
in class FileAdaptor
public java.lang.Class[] getSupportedCredentials()+
AdaptorDescription
public class HDFSFileSystem +extends FileSystem+
Modifier and Type | +Field and Description | +
---|---|
(package private) boolean |
+closed |
+
private java.lang.String |
+ERROR_MSG |
+
(package private) org.apache.hadoop.fs.FileSystem |
+fs |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+HDFSFileSystem(java.lang.String uniqueID,
+ java.lang.String endPoint,
+ Credential credential,
+ org.apache.hadoop.fs.FileSystem fs,
+ int bufferSize,
+ XenonProperties properties) |
+
Modifier and Type | +Method and Description | +
---|---|
java.io.OutputStream |
+appendToFile(Path path)
+Open an existing file and return an
+OutputStream to append data to this file. |
+
(package private) void |
+checkClosed() |
+
void |
+close()
+Close this FileSystem.
+ |
+
void |
+createDirectory(Path dir)
+Creates a new directory, failing if the directory already exists.
+ |
+
void |
+createFile(Path file)
+Creates a new empty file, failing if the file already exists.
+ |
+
void |
+createSymbolicLink(Path link,
+ Path target)
+Creates a new symbolic link, failing if the link already exists (optional operation).
+ |
+
void |
+delete(Path path,
+ boolean recursive)
+Deletes an existing path.
+ |
+
protected void |
+deleteDirectory(Path path)
+Delete an empty directory.
+ |
+
protected void |
+deleteFile(Path file)
+Delete a file.
+ |
+
boolean |
+exists(Path path)
+Tests if a path exists.
+ |
+
(package private) static Path |
+fromHDFSPath(org.apache.hadoop.fs.Path p) |
+
PathAttributes |
+getAttributes(Path path)
+Get the
+PathAttributes of an existing path. |
+
boolean |
+isOpen()
+Return if the connection to the FileSystem is open.
+ |
+
java.lang.Iterable<PathAttributes> |
+list(Path dir,
+ boolean recursive)
+List all entries in the directory
+dir . |
+
protected java.lang.Iterable<PathAttributes> |
+listDirectory(Path dir)
+Return the list of entries in a directory.
+ |
+
private java.util.Iterator<PathAttributes> |
+listIterator(Path dir) |
+
private java.util.Iterator<PathAttributes> |
+listIteratorNoException(Path dir) |
+
java.io.InputStream |
+readFromFile(Path path)
+Open an existing file and return an
+InputStream to read from this file. |
+
Path |
+readSymbolicLink(Path link)
+Reads the target of a symbolic link (optional operation).
+ |
+
void |
+rename(Path source,
+ Path target)
+Rename an existing source path to a non-existing target path (optional operation).
+ |
+
void |
+setPosixFilePermissions(Path path,
+ java.util.Set<PosixFilePermission> permissions)
+Sets the POSIX permissions of a path (optional operation).
+ |
+
(package private) org.apache.hadoop.fs.Path |
+toHDFSPath(Path p) |
+
private PathAttributes |
+toPathAttributes(org.apache.hadoop.fs.FileStatus s) |
+
private java.util.Set<PosixFilePermission> |
+toPermissionSet(org.apache.hadoop.fs.permission.FsPermission permission) |
+
java.io.OutputStream |
+writeToFile(Path path)
+Open a file and return an
+OutputStream to write to this file. |
+
java.io.OutputStream |
+writeToFile(Path path,
+ long size)
+Open a file and return an
+OutputStream to write to this file. |
+
areSamePaths, assertDirectoryExists, assertFileExists, assertFileIsSymbolicLink, assertIsOpen, assertNotNull, assertParentDirectoryExists, assertPathExists, assertPathIsDirectory, assertPathIsFile, assertPathIsNotDirectory, assertPathNotExists, cancel, copy, copyFile, copySymbolicLink, create, create, create, create, createDirectories, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getLocation, getPathSeparator, getProperties, getStatus, getWorkingDirectory, hashCode, isDotDot, list, performCopy, setWorkingDirectory, streamCopy, toAbsolutePath, waitUntilDone
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
final org.apache.hadoop.fs.FileSystem fs+
boolean closed+
private final java.lang.String ERROR_MSG+
protected HDFSFileSystem(java.lang.String uniqueID, + java.lang.String endPoint, + Credential credential, + org.apache.hadoop.fs.FileSystem fs, + int bufferSize, + XenonProperties properties)+
void checkClosed() + throws XenonException+
XenonException
public void close() + throws XenonException+
FileSystem
close
in interface java.lang.AutoCloseable
close
in class FileSystem
XenonException
- If the FileSystem failed to close or if an I/O error occurred.public boolean isOpen() + throws XenonException+
FileSystem
isOpen
in class FileSystem
XenonException
- if the test failed or an I/O error occurred.public void rename(Path source, + Path target) + throws XenonException+
FileSystem
+
+ This method only implements a rename operation, not a move operation. Hence, this method will not copy files and should return (almost)
+ instantaneously.
+
+ The parent of the target path (e.g. target.getParent
) must exist.
+
+ If the target is equal to the source this method has no effect.
+
+ If the source is a link, the link itself will be renamed, not the path to which it refers.
+
+ If the source is a directory, it will be renamed to the target. This implies that a moving a directory between physical locations may fail.
+
rename
in class FileSystem
source
- the existing source path.target
- the non existing target path.UnsupportedOperationException
- If the adapter does not support renaming.NoSuchPathException
- If the source file does not exist or the target parent directory does not exist.PathAlreadyExistsException
- If the target file already exists.NotConnectedException
- If file system is closed.XenonException
- If the move failed.public void createDirectory(Path dir) + throws XenonException+
FileSystem
createDirectory
in class FileSystem
dir
- the directory to create.PathAlreadyExistsException
- If the directory already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createFile(Path file) + throws XenonException+
FileSystem
createFile
in class FileSystem
file
- a path referring to the file to create.PathAlreadyExistsException
- If the file already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createSymbolicLink(Path link, + Path target) + throws XenonException+
FileSystem
createSymbolicLink
in class FileSystem
link
- the symbolic link to create.target
- the target the symbolic link should refer to.PathAlreadyExistsException
- If the link already exists.NoSuchPathException
- If the target or parent directory of link does not existInvalidPathException
- If parent of link is not a directoryNotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void delete(Path path, + boolean recursive) + throws XenonException+
FileSystem
recursive
is set to true, the contents of the directory will also be deleted. If recursive
is
+ set to false
, a directory will only be removed if it is empty.delete
in class FileSystem
path
- the path to delete.recursive
- if the delete must be done recursivelyDirectoryNotEmptyException
- if the directory was not empty (and the delete was not recursive).NoSuchPathException
- if the provided path does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public boolean exists(Path path) + throws XenonException+
FileSystem
exists
in class FileSystem
path
- the path to test.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.lang.Iterable<PathAttributes> list(Path dir, + boolean recursive) + throws XenonException+
FileSystem
dir
.
+
+ All entries in the directory are returned, but subdirectories will not be traversed by default. Set recursive
to true
, include
+ the listing of all subdirectories.
+
+ Symbolic links are not followed.list
in class FileSystem
dir
- the target directory.recursive
- should the list recursively traverse the subdirectories ?List
of PathAttributes
that iterates over all entries in the directory dir
.NoSuchPathException
- If a directory does not exists.InvalidPathException
- If dir
is not a directory.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.private java.util.Iterator<PathAttributes> listIteratorNoException(Path dir)+
private java.util.Iterator<PathAttributes> listIterator(Path dir) + throws XenonException+
XenonException
public java.io.InputStream readFromFile(Path path) + throws XenonException+
FileSystem
InputStream
to read from this file.readFromFile
in class FileSystem
path
- the to read.InputStream
to read from the file.NoSuchPathException
- If the file does not exists.InvalidPathException
- If the file is not regular file.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path path, + long size) + throws XenonException+
FileSystem
OutputStream
to write to this file.
+
+
+ The size of the file (once all data has been written) must be specified using the size
parameter. This is required by some implementations
+ (typically blob-stores).
+
+
writeToFile
in class FileSystem
path
- the target file for the OutputStream.size
- the size of the file once fully written.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path path) + throws XenonException+
FileSystem
OutputStream
to write to this file. (optional operation)
+ + If the file already exists it will be replaced and its data will be lost. + + The amount of data that will be written to the file is not specified in advance. This operation may not be supported by all implementations. + +
writeToFile
in class FileSystem
path
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream appendToFile(Path path) + throws XenonException+
FileSystem
OutputStream
to append data to this file. (optional operation)
+ + If the file does not exist, an exception will be thrown. + + This operation may not be supported by all implementations. + +
appendToFile
in class FileSystem
path
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.InvalidPathException
- if not a regular fileNotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.UnsupportedOperationException
- if the adaptor does not support appendingpublic PathAttributes getAttributes(Path path) + throws XenonException+
FileSystem
PathAttributes
of an existing path.getAttributes
in class FileSystem
path
- the existing path.NoSuchPathException
- If the file does not exists.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.protected void deleteFile(Path file) + throws XenonException+
FileSystem
deleteFile
in class FileSystem
file
- the file to removeInvalidPathException
- if the provided path is not a file.NoSuchPathException
- if the provided file does not exist.XenonException
- If the file could not be removed.protected void deleteDirectory(Path path) + throws XenonException+
FileSystem
rmdir
in Linux).
+
+ This operation must be implemented by the various implementations of FileSystem.deleteDirectory
in class FileSystem
path
- the directory to removeInvalidPathException
- if the provided path is not a directory.NoSuchPathException
- if the provided path does not exist.XenonException
- If the directory could not be removed.protected java.lang.Iterable<PathAttributes> listDirectory(Path dir) + throws XenonException+
FileSystem
dir
will be returned as part of the list, but they will not be listed themselves.
+
+ This operation must be implemented by the various implementations of FileSystem.listDirectory
in class FileSystem
dir
- the directory to listIterable
that iterates over all entries in dir
XenonException
- If the list could not be retrieved.org.apache.hadoop.fs.Path toHDFSPath(Path p)+
static Path fromHDFSPath(org.apache.hadoop.fs.Path p)+
private PathAttributes toPathAttributes(org.apache.hadoop.fs.FileStatus s)+
private java.util.Set<PosixFilePermission> toPermissionSet(org.apache.hadoop.fs.permission.FsPermission permission)+
public Path readSymbolicLink(Path link) + throws XenonException+
FileSystem
readSymbolicLink
in class FileSystem
link
- the link to read.NoSuchPathException
- If the link does not exists.InvalidPathException
- If the source is not a link.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public void setPosixFilePermissions(Path path, + java.util.Set<PosixFilePermission> permissions) + throws XenonException+
FileSystem
setPosixFilePermissions
in class FileSystem
path
- the target path.permissions
- the permissions to set.NoSuchPathException
- If the target path does not exists.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.Class | +Description | +
---|---|
HDFSFileAdaptor | +
+ Created by atze on 3-7-17.
+ |
+
HDFSFileSystem | ++ |
class JCloudsFileSytem.ListingIterator +extends java.lang.Object +implements java.util.Iterator<PathAttributes>+
Modifier and Type | +Field and Description | +
---|---|
(package private) java.util.Iterator<? extends org.jclouds.blobstore.domain.StorageMetadata> |
+curIterator |
+
(package private) org.jclouds.blobstore.domain.PageSet<? extends org.jclouds.blobstore.domain.StorageMetadata> |
+curPageSet |
+
(package private) org.jclouds.blobstore.domain.StorageMetadata |
+nxt |
+
private org.jclouds.blobstore.options.ListContainerOptions |
+options |
+
Constructor and Description | +
---|
ListingIterator(org.jclouds.blobstore.options.ListContainerOptions options,
+ org.jclouds.blobstore.domain.PageSet<? extends org.jclouds.blobstore.domain.StorageMetadata> pageSet) |
+
Modifier and Type | +Method and Description | +
---|---|
(package private) void |
+getNext() |
+
boolean |
+hasNext() |
+
PathAttributes |
+next() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
private final org.jclouds.blobstore.options.ListContainerOptions options+
java.util.Iterator<? extends org.jclouds.blobstore.domain.StorageMetadata> curIterator+
org.jclouds.blobstore.domain.PageSet<? extends org.jclouds.blobstore.domain.StorageMetadata> curPageSet+
org.jclouds.blobstore.domain.StorageMetadata nxt+
ListingIterator(org.jclouds.blobstore.options.ListContainerOptions options, + org.jclouds.blobstore.domain.PageSet<? extends org.jclouds.blobstore.domain.StorageMetadata> pageSet)+
void getNext()+
public boolean hasNext()+
hasNext
in interface java.util.Iterator<PathAttributes>
public PathAttributes next() + throws java.util.NoSuchElementException+
next
in interface java.util.Iterator<PathAttributes>
java.util.NoSuchElementException
private class JCloudsFileSytem.RecursiveListIterator +extends java.lang.Object +implements java.util.Iterator<PathAttributes>+
Modifier and Type | +Field and Description | +
---|---|
(package private) java.util.Deque<java.util.Iterator<PathAttributes>> |
+stack |
+
Constructor and Description | +
---|
RecursiveListIterator(java.util.Iterator<PathAttributes> root) |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+hasNext() |
+
PathAttributes |
+next() |
+
(package private) void |
+popEmpties() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
final java.util.Deque<java.util.Iterator<PathAttributes>> stack+
public RecursiveListIterator(java.util.Iterator<PathAttributes> root)+
void popEmpties()+
public boolean hasNext()+
hasNext
in interface java.util.Iterator<PathAttributes>
public PathAttributes next() + throws java.util.NoSuchElementException+
next
in interface java.util.Iterator<PathAttributes>
java.util.NoSuchElementException
public class JCloudsFileSytem +extends FileSystem+
Modifier and Type | +Class and Description | +
---|---|
(package private) class |
+JCloudsFileSytem.ListingIterator |
+
private class |
+JCloudsFileSytem.RecursiveListIterator |
+
Modifier and Type | +Field and Description | +
---|---|
(package private) java.lang.String |
+adaptorName |
+
(package private) java.lang.String |
+bucket |
+
(package private) org.jclouds.blobstore.BlobStoreContext |
+context |
+
private static java.lang.String |
+NOT_EMPTY |
+
(package private) boolean |
+open |
+
Constructor and Description | +
---|
JCloudsFileSytem(java.lang.String uniqueID,
+ java.lang.String adaptorName,
+ java.lang.String endPoint,
+ Credential credential,
+ Path workingDir,
+ org.jclouds.blobstore.BlobStoreContext context,
+ java.lang.String bucket,
+ int bufferSize,
+ XenonProperties properties) |
+
Modifier and Type | +Method and Description | +
---|---|
java.io.OutputStream |
+appendToFile(Path file)
+Open an existing file and return an
+OutputStream to append data to this file. |
+
(package private) void |
+checkClosed() |
+
void |
+close()
+Close this FileSystem.
+ |
+
void |
+createDirectory(Path dir)
+Creates a new directory, failing if the directory already exists.
+ |
+
void |
+createFile(Path file)
+Creates a new empty file, failing if the file already exists.
+ |
+
void |
+createSymbolicLink(Path link,
+ Path target)
+Creates a new symbolic link, failing if the link already exists (optional operation).
+ |
+
protected void |
+deleteDirectory(Path dir)
+Delete an empty directory.
+ |
+
void |
+deleteFile(Path file)
+Delete a file.
+ |
+
private boolean |
+dirExists(Path path) |
+
private void |
+ensureDirectoryExists(Path dir) |
+
boolean |
+exists(Path path)
+Tests if a path exists.
+ |
+
private boolean |
+fileExists(Path path) |
+
PathAttributes |
+getAttributes(Path path)
+Get the
+PathAttributes of an existing path. |
+
boolean |
+isOpen()
+Return if the connection to the FileSystem is open.
+ |
+
java.lang.Iterable<PathAttributes> |
+list(Path path,
+ boolean recursive)
+List all entries in the directory
+dir . |
+
protected java.lang.Iterable<PathAttributes> |
+listDirectory(Path dir)
+Return the list of entries in a directory.
+ |
+
(package private) java.util.Iterator<PathAttributes> |
+listNonRecursiveIterator(java.lang.String bucketEntry) |
+
private java.lang.Iterable<PathAttributes> |
+listPrefix(java.lang.String prefix,
+ boolean recursive) |
+
private PathAttributes |
+makeBlobAttributes(java.lang.String name) |
+
(package private) PathAttributes |
+makeDirAttributes(org.jclouds.blobstore.domain.StorageMetadata m) |
+
private void |
+makeDirectoryPlaceholder(Path dir) |
+
java.io.InputStream |
+readFromFile(Path path)
+Open an existing file and return an
+InputStream to read from this file. |
+
Path |
+readSymbolicLink(Path link)
+Reads the target of a symbolic link (optional operation).
+ |
+
private void |
+removeDirectoryPlaceholder(Path dir) |
+
void |
+rename(Path source,
+ Path target)
+Rename an existing source path to a non-existing target path (optional operation).
+ |
+
void |
+setPosixFilePermissions(Path path,
+ java.util.Set<PosixFilePermission> permissions)
+Sets the POSIX permissions of a path (optional operation).
+ |
+
(package private) java.lang.String |
+toBucketEntry(Path path) |
+
(package private) PathAttributes |
+toPathAttributes(org.jclouds.blobstore.domain.StorageMetadata m) |
+
java.io.OutputStream |
+writeToFile(Path file)
+Open a file and return an
+OutputStream to write to this file. |
+
java.io.OutputStream |
+writeToFile(Path path,
+ long size)
+Open a file and return an
+OutputStream to write to this file. |
+
areSamePaths, assertDirectoryExists, assertFileExists, assertFileIsSymbolicLink, assertIsOpen, assertNotNull, assertParentDirectoryExists, assertPathExists, assertPathIsDirectory, assertPathIsFile, assertPathIsNotDirectory, assertPathNotExists, cancel, copy, copyFile, copySymbolicLink, create, create, create, create, createDirectories, delete, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getLocation, getPathSeparator, getProperties, getStatus, getWorkingDirectory, hashCode, isDotDot, list, performCopy, setWorkingDirectory, streamCopy, toAbsolutePath, waitUntilDone
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final java.lang.String NOT_EMPTY+
final java.lang.String bucket+
final org.jclouds.blobstore.BlobStoreContext context+
final java.lang.String adaptorName+
boolean open+
public JCloudsFileSytem(java.lang.String uniqueID, + java.lang.String adaptorName, + java.lang.String endPoint, + Credential credential, + Path workingDir, + org.jclouds.blobstore.BlobStoreContext context, + java.lang.String bucket, + int bufferSize, + XenonProperties properties)+
java.lang.String toBucketEntry(Path path)+
public void close() + throws XenonException+
FileSystem
close
in interface java.lang.AutoCloseable
close
in class FileSystem
XenonException
- If the FileSystem failed to close or if an I/O error occurred.public boolean isOpen() + throws XenonException+
FileSystem
isOpen
in class FileSystem
XenonException
- if the test failed or an I/O error occurred.public void rename(Path source, + Path target) + throws XenonException+
FileSystem
+
+ This method only implements a rename operation, not a move operation. Hence, this method will not copy files and should return (almost)
+ instantaneously.
+
+ The parent of the target path (e.g. target.getParent
) must exist.
+
+ If the target is equal to the source this method has no effect.
+
+ If the source is a link, the link itself will be renamed, not the path to which it refers.
+
+ If the source is a directory, it will be renamed to the target. This implies that a moving a directory between physical locations may fail.
+
rename
in class FileSystem
source
- the existing source path.target
- the non existing target path.UnsupportedOperationException
- If the adapter does not support renaming.NoSuchPathException
- If the source file does not exist or the target parent directory does not exist.PathAlreadyExistsException
- If the target file already exists.NotConnectedException
- If file system is closed.XenonException
- If the move failed.void checkClosed() + throws XenonException+
XenonException
public void createDirectory(Path dir) + throws XenonException+
FileSystem
createDirectory
in class FileSystem
dir
- the directory to create.PathAlreadyExistsException
- If the directory already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.private void makeDirectoryPlaceholder(Path dir)+
private void removeDirectoryPlaceholder(Path dir)+
public void createFile(Path file) + throws XenonException+
FileSystem
createFile
in class FileSystem
file
- a path referring to the file to create.PathAlreadyExistsException
- If the file already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createSymbolicLink(Path link, + Path target) + throws XenonException+
FileSystem
createSymbolicLink
in class FileSystem
link
- the symbolic link to create.target
- the target the symbolic link should refer to.PathAlreadyExistsException
- If the link already exists.NoSuchPathException
- If the target or parent directory of link does not existInvalidPathException
- If parent of link is not a directoryNotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.private void ensureDirectoryExists(Path dir)+
public void deleteFile(Path file) + throws XenonException+
FileSystem
deleteFile
in class FileSystem
file
- the file to removeInvalidPathException
- if the provided path is not a file.NoSuchPathException
- if the provided file does not exist.XenonException
- If the file could not be removed.protected void deleteDirectory(Path dir) + throws XenonException+
FileSystem
rmdir
in Linux).
+
+ This operation must be implemented by the various implementations of FileSystem.deleteDirectory
in class FileSystem
dir
- the directory to removeInvalidPathException
- if the provided path is not a directory.NoSuchPathException
- if the provided path does not exist.XenonException
- If the directory could not be removed.protected java.lang.Iterable<PathAttributes> listDirectory(Path dir) + throws XenonException+
FileSystem
dir
will be returned as part of the list, but they will not be listed themselves.
+
+ This operation must be implemented by the various implementations of FileSystem.listDirectory
in class FileSystem
dir
- the directory to listIterable
that iterates over all entries in dir
XenonException
- If the list could not be retrieved.private boolean dirExists(Path path)+
private boolean fileExists(Path path)+
public boolean exists(Path path) + throws XenonException+
FileSystem
exists
in class FileSystem
path
- the path to test.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.PathAttributes makeDirAttributes(org.jclouds.blobstore.domain.StorageMetadata m)+
private PathAttributes makeBlobAttributes(java.lang.String name)+
PathAttributes toPathAttributes(org.jclouds.blobstore.domain.StorageMetadata m)+
java.util.Iterator<PathAttributes> listNonRecursiveIterator(java.lang.String bucketEntry)+
public java.lang.Iterable<PathAttributes> list(Path path, + boolean recursive) + throws XenonException+
FileSystem
dir
.
+
+ All entries in the directory are returned, but subdirectories will not be traversed by default. Set recursive
to true
, include
+ the listing of all subdirectories.
+
+ Symbolic links are not followed.list
in class FileSystem
path
- the target directory.recursive
- should the list recursively traverse the subdirectories ?List
of PathAttributes
that iterates over all entries in the directory dir
.NoSuchPathException
- If a directory does not exists.InvalidPathException
- If dir
is not a directory.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.private java.lang.Iterable<PathAttributes> listPrefix(java.lang.String prefix, + boolean recursive)+
public java.io.InputStream readFromFile(Path path) + throws XenonException+
FileSystem
InputStream
to read from this file.readFromFile
in class FileSystem
path
- the to read.InputStream
to read from the file.NoSuchPathException
- If the file does not exists.InvalidPathException
- If the file is not regular file.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path path, + long size) + throws XenonException+
FileSystem
OutputStream
to write to this file.
+
+
+ The size of the file (once all data has been written) must be specified using the size
parameter. This is required by some implementations
+ (typically blob-stores).
+
+
writeToFile
in class FileSystem
path
- the target file for the OutputStream.size
- the size of the file once fully written.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path file) + throws XenonException+
FileSystem
OutputStream
to write to this file. (optional operation)
+ + If the file already exists it will be replaced and its data will be lost. + + The amount of data that will be written to the file is not specified in advance. This operation may not be supported by all implementations. + +
writeToFile
in class FileSystem
file
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream appendToFile(Path file) + throws XenonException+
FileSystem
OutputStream
to append data to this file. (optional operation)
+ + If the file does not exist, an exception will be thrown. + + This operation may not be supported by all implementations. + +
appendToFile
in class FileSystem
file
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.InvalidPathException
- if not a regular fileNotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.UnsupportedOperationException
- if the adaptor does not support appendingpublic PathAttributes getAttributes(Path path) + throws XenonException+
FileSystem
PathAttributes
of an existing path.getAttributes
in class FileSystem
path
- the existing path.NoSuchPathException
- If the file does not exists.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public Path readSymbolicLink(Path link) + throws XenonException+
FileSystem
readSymbolicLink
in class FileSystem
link
- the link to read.NoSuchPathException
- If the link does not exists.InvalidPathException
- If the source is not a link.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public void setPosixFilePermissions(Path path, + java.util.Set<PosixFilePermission> permissions) + throws XenonException+
FileSystem
setPosixFilePermissions
in class FileSystem
path
- the target path.permissions
- the permissions to set.NoSuchPathException
- If the target path does not exists.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.Class | +Description | +
---|---|
JCloudsFileSytem | ++ |
public class LocalFileAdaptor +extends FileAdaptor+
Files
adaptor for local file operations.Files
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ADAPTOR_DESCRIPTION
+Description of the adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by the adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+Name of the local adaptor is defined in the engine.
+ |
+
static java.lang.String |
+BUFFER_SIZE
+The buffer size to use when copying data.
+ |
+
static java.lang.String |
+PREFIX
+Local properties start with this prefix.
+ |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+List of properties supported by this FTP adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
LocalFileAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+canCreateSymboliclinks()
+Can this adaptor create symbolic links ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
FileSystem |
+createFileSystem(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
boolean |
+isConnectionless() |
+
boolean |
+supportsReadingPosixPermissions() |
+
boolean |
+supportsSettingPosixPermissions() |
+
canAppend, canReadSymboliclinks, needsSizeBeforehand, supportsRename, supportsThirdPartyCopy
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
public static final java.lang.String ADAPTOR_NAME+
public static final java.lang.String PREFIX+
public static final java.lang.String ADAPTOR_DESCRIPTION+
public static final java.lang.String BUFFER_SIZE+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
public boolean canCreateSymboliclinks()+
FileSystemAdaptorDescription
canCreateSymboliclinks
in interface FileSystemAdaptorDescription
canCreateSymboliclinks
in class FileAdaptor
public boolean supportsReadingPosixPermissions()+
supportsReadingPosixPermissions
in interface FileSystemAdaptorDescription
supportsReadingPosixPermissions
in class FileAdaptor
public boolean supportsSettingPosixPermissions()+
supportsSettingPosixPermissions
in interface FileSystemAdaptorDescription
supportsSettingPosixPermissions
in class FileAdaptor
public boolean isConnectionless()+
isConnectionless
in interface FileSystemAdaptorDescription
isConnectionless
in class FileAdaptor
public java.lang.Class[] getSupportedCredentials()+
AdaptorDescription
public FileSystem createFileSystem(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createFileSystem
in class FileAdaptor
XenonException
public class LocalFileSystem +extends FileSystem+
Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+root |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+LocalFileSystem(java.lang.String uniqueID,
+ java.lang.String location,
+ Credential credential,
+ java.lang.String root,
+ Path entryPath,
+ int bufferSize,
+ XenonProperties properties) |
+
Modifier and Type | +Method and Description | +
---|---|
java.io.OutputStream |
+appendToFile(Path path)
+Open an existing file and return an
+OutputStream to append data to this file. |
+
void |
+createDirectory(Path dir)
+Creates a new directory, failing if the directory already exists.
+ |
+
void |
+createFile(Path file)
+Creates a new empty file, failing if the file already exists.
+ |
+
void |
+createSymbolicLink(Path link,
+ Path path)
+Creates a new symbolic link, failing if the link already exists (optional operation).
+ |
+
protected void |
+deleteDirectory(Path path)
+Delete an empty directory.
+ |
+
protected void |
+deleteFile(Path path)
+Delete a file.
+ |
+
(package private) void |
+deleteLocal(Path path) |
+
boolean |
+exists(Path path)
+Tests if a path exists.
+ |
+
PathAttributes |
+getAttributes(Path path)
+Get the
+PathAttributes of an existing path. |
+
(package private) PathAttributes |
+getLocalFileAttributes(Path path) |
+
(package private) PathAttributes |
+getLocalFileAttributes(Path p,
+ java.nio.file.Path path) |
+
boolean |
+isOpen()
+Return if the connection to the FileSystem is open.
+ |
+
(package private) java.nio.file.Path |
+javaPath(Path path) |
+
(package private) java.util.Set<java.nio.file.attribute.PosixFilePermission> |
+javaPermissions(java.util.Set<PosixFilePermission> permissions) |
+
protected java.util.List<PathAttributes> |
+listDirectory(Path dir)
+Return the list of entries in a directory.
+ |
+
java.io.InputStream |
+readFromFile(Path path)
+Open an existing file and return an
+InputStream to read from this file. |
+
Path |
+readSymbolicLink(Path link)
+Reads the target of a symbolic link (optional operation).
+ |
+
void |
+rename(Path source,
+ Path target)
+Rename an existing source path to a non-existing target path (optional operation).
+ |
+
void |
+setPosixFilePermissions(Path path,
+ java.util.Set<PosixFilePermission> permissions)
+Sets the POSIX permissions of a path (optional operation).
+ |
+
java.io.OutputStream |
+writeToFile(Path path)
+Open a file and return an
+OutputStream to write to this file. |
+
java.io.OutputStream |
+writeToFile(Path path,
+ long size)
+Open a file and return an
+OutputStream to write to this file. |
+
(package private) java.util.Set<PosixFilePermission> |
+xenonPermissions(java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions) |
+
areSamePaths, assertDirectoryExists, assertFileExists, assertFileIsSymbolicLink, assertIsOpen, assertNotNull, assertParentDirectoryExists, assertPathExists, assertPathIsDirectory, assertPathIsFile, assertPathIsNotDirectory, assertPathNotExists, cancel, close, copy, copyFile, copySymbolicLink, create, create, create, create, createDirectories, delete, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getLocation, getPathSeparator, getProperties, getStatus, getWorkingDirectory, hashCode, isDotDot, list, list, performCopy, setWorkingDirectory, streamCopy, toAbsolutePath, waitUntilDone
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
protected LocalFileSystem(java.lang.String uniqueID, + java.lang.String location, + Credential credential, + java.lang.String root, + Path entryPath, + int bufferSize, + XenonProperties properties)+
java.nio.file.Path javaPath(Path path)+
java.util.Set<PosixFilePermission> xenonPermissions(java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions)+
java.util.Set<java.nio.file.attribute.PosixFilePermission> javaPermissions(java.util.Set<PosixFilePermission> permissions)+
void deleteLocal(Path path) + throws XenonException+
XenonException
PathAttributes getLocalFileAttributes(Path path) + throws XenonException+
XenonException
PathAttributes getLocalFileAttributes(Path p, + java.nio.file.Path path) + throws XenonException+
XenonException
public boolean isOpen() + throws XenonException+
FileSystem
isOpen
in class FileSystem
XenonException
- if the test failed or an I/O error occurred.public void rename(Path source, + Path target) + throws XenonException+
FileSystem
+
+ This method only implements a rename operation, not a move operation. Hence, this method will not copy files and should return (almost)
+ instantaneously.
+
+ The parent of the target path (e.g. target.getParent
) must exist.
+
+ If the target is equal to the source this method has no effect.
+
+ If the source is a link, the link itself will be renamed, not the path to which it refers.
+
+ If the source is a directory, it will be renamed to the target. This implies that a moving a directory between physical locations may fail.
+
rename
in class FileSystem
source
- the existing source path.target
- the non existing target path.UnsupportedOperationException
- If the adapter does not support renaming.NoSuchPathException
- If the source file does not exist or the target parent directory does not exist.PathAlreadyExistsException
- If the target file already exists.NotConnectedException
- If file system is closed.XenonException
- If the move failed.public void createDirectory(Path dir) + throws XenonException+
FileSystem
createDirectory
in class FileSystem
dir
- the directory to create.PathAlreadyExistsException
- If the directory already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createFile(Path file) + throws XenonException+
FileSystem
createFile
in class FileSystem
file
- a path referring to the file to create.PathAlreadyExistsException
- If the file already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createSymbolicLink(Path link, + Path path) + throws XenonException+
FileSystem
createSymbolicLink
in class FileSystem
link
- the symbolic link to create.path
- the target the symbolic link should refer to.PathAlreadyExistsException
- If the link already exists.NoSuchPathException
- If the target or parent directory of link does not existInvalidPathException
- If parent of link is not a directoryNotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.protected void deleteFile(Path path) + throws XenonException+
FileSystem
deleteFile
in class FileSystem
path
- the file to removeInvalidPathException
- if the provided path is not a file.NoSuchPathException
- if the provided file does not exist.XenonException
- If the file could not be removed.protected void deleteDirectory(Path path) + throws XenonException+
FileSystem
rmdir
in Linux).
+
+ This operation must be implemented by the various implementations of FileSystem.deleteDirectory
in class FileSystem
path
- the directory to removeInvalidPathException
- if the provided path is not a directory.NoSuchPathException
- if the provided path does not exist.XenonException
- If the directory could not be removed.public boolean exists(Path path) + throws XenonException+
FileSystem
exists
in class FileSystem
path
- the path to test.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.protected java.util.List<PathAttributes> listDirectory(Path dir) + throws XenonException+
FileSystem
dir
will be returned as part of the list, but they will not be listed themselves.
+
+ This operation must be implemented by the various implementations of FileSystem.listDirectory
in class FileSystem
dir
- the directory to listIterable
that iterates over all entries in dir
XenonException
- If the list could not be retrieved.public java.io.InputStream readFromFile(Path path) + throws XenonException+
FileSystem
InputStream
to read from this file.readFromFile
in class FileSystem
path
- the to read.InputStream
to read from the file.NoSuchPathException
- If the file does not exists.InvalidPathException
- If the file is not regular file.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path path, + long size) + throws XenonException+
FileSystem
OutputStream
to write to this file.
+
+
+ The size of the file (once all data has been written) must be specified using the size
parameter. This is required by some implementations
+ (typically blob-stores).
+
+
writeToFile
in class FileSystem
path
- the target file for the OutputStream.size
- the size of the file once fully written.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path path) + throws XenonException+
FileSystem
OutputStream
to write to this file. (optional operation)
+ + If the file already exists it will be replaced and its data will be lost. + + The amount of data that will be written to the file is not specified in advance. This operation may not be supported by all implementations. + +
writeToFile
in class FileSystem
path
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream appendToFile(Path path) + throws XenonException+
FileSystem
OutputStream
to append data to this file. (optional operation)
+ + If the file does not exist, an exception will be thrown. + + This operation may not be supported by all implementations. + +
appendToFile
in class FileSystem
path
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.InvalidPathException
- if not a regular fileNotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.UnsupportedOperationException
- if the adaptor does not support appendingpublic PathAttributes getAttributes(Path path) + throws XenonException+
FileSystem
PathAttributes
of an existing path.getAttributes
in class FileSystem
path
- the existing path.NoSuchPathException
- If the file does not exists.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public Path readSymbolicLink(Path link) + throws XenonException+
FileSystem
readSymbolicLink
in class FileSystem
link
- the link to read.NoSuchPathException
- If the link does not exists.InvalidPathException
- If the source is not a link.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public void setPosixFilePermissions(Path path, + java.util.Set<PosixFilePermission> permissions) + throws XenonException+
FileSystem
setPosixFilePermissions
in class FileSystem
path
- the target path.permissions
- the permissions to set.NoSuchPathException
- If the target path does not exists.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.Class | +Description | +
---|---|
LocalFileAdaptor | +
+ LocalFiles implements an Xenon
+Files adaptor for local file operations. |
+
LocalFileSystem | ++ |
Class | +Description | +
---|---|
FileAdaptor | ++ |
PathAttributesImplementation | +
+ FileAttributes represents a set of attributes of a path.
+ |
+
PosixFileUtils | +
+ PosixFileUtils contains several utility functions related to Posix files.
+ |
+
RecursiveListIterator | ++ |
Exception | +Description | +
---|---|
ConnectionLostException | +
+ Signals that a connection was lost.
+ |
+
EndOfFileException | +
+ Signals that an end-of-file was encountered.
+ |
+
NoSpaceException | +
+ Signals that an end-of-file was encountered.
+ |
+
PermissionDeniedException | +
+ Signals that the user does not have sufficient permissions to perform the operation.
+ |
+
public class S3FileAdaptor +extends FileAdaptor+
Modifier and Type | +Field and Description | +
---|---|
private static java.lang.String |
+ADAPTOR_DESCRIPTION
+A description of this adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by this adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+The name of this adaptor
+ |
+
static java.lang.String |
+BUFFER_SIZE
+The buffer size to use when copying data.
+ |
+
static java.lang.String |
+PREFIX
+All our own properties start with this prefix.
+ |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+List of properties supported by this FTP adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
S3FileAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+canAppend() |
+
boolean |
+canCreateSymboliclinks()
+Can this adaptor create symbolic links ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
boolean |
+canReadSymboliclinks()
+Can this adaptor read symbolic links ?
+ |
+
FileSystem |
+createFileSystem(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
boolean |
+isConnectionless() |
+
boolean |
+needsSizeBeforehand() |
+
boolean |
+supportsReadingPosixPermissions() |
+
boolean |
+supportsRename() |
+
boolean |
+supportsSettingPosixPermissions() |
+
supportsThirdPartyCopy
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
public static final java.lang.String ADAPTOR_NAME+
private static final java.lang.String ADAPTOR_DESCRIPTION+
public static final java.lang.String PREFIX+
public static final java.lang.String BUFFER_SIZE+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
public FileSystem createFileSystem(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createFileSystem
in class FileAdaptor
XenonException
public boolean supportsReadingPosixPermissions()+
supportsReadingPosixPermissions
in interface FileSystemAdaptorDescription
supportsReadingPosixPermissions
in class FileAdaptor
public boolean supportsSettingPosixPermissions()+
supportsSettingPosixPermissions
in interface FileSystemAdaptorDescription
supportsSettingPosixPermissions
in class FileAdaptor
public boolean canAppend()+
canAppend
in interface FileSystemAdaptorDescription
canAppend
in class FileAdaptor
public boolean canReadSymboliclinks()+
FileSystemAdaptorDescription
canReadSymboliclinks
in interface FileSystemAdaptorDescription
canReadSymboliclinks
in class FileAdaptor
public boolean canCreateSymboliclinks()+
FileSystemAdaptorDescription
canCreateSymboliclinks
in interface FileSystemAdaptorDescription
canCreateSymboliclinks
in class FileAdaptor
public boolean needsSizeBeforehand()+
needsSizeBeforehand
in interface FileSystemAdaptorDescription
needsSizeBeforehand
in class FileAdaptor
public boolean supportsRename()+
supportsRename
in interface FileSystemAdaptorDescription
supportsRename
in class FileAdaptor
public boolean isConnectionless()+
isConnectionless
in interface FileSystemAdaptorDescription
isConnectionless
in class FileAdaptor
public java.lang.Class[] getSupportedCredentials()+
AdaptorDescription
Class | +Description | +
---|---|
S3FileAdaptor | +
+ Created by atze on 29-6-17.
+ |
+
public class SftpFileAdaptor +extends FileAdaptor+
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ADAPTOR_DESCRIPTION
+A description of this adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by this adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+The name of this adaptor
+ |
+
static java.lang.String |
+AGENT
+Enable the use of an ssh-agent
+ |
+
static java.lang.String |
+AGENT_FORWARDING
+Enable the use of ssh-agent-forwarding
+ |
+
static java.lang.String |
+AUTOMATICALLY_ADD_HOST_KEY
+Enable strict host key checking.
+ |
+
static java.lang.String |
+BUFFER_SIZE
+The buffer size to use when copying data.
+ |
+
static java.lang.String |
+CONNECTION_TIMEOUT
+Property for maximum history length for finished jobs
+ |
+
static int |
+DEFAULT_PORT
+The default SSH port
+ |
+
static java.lang.String |
+GATEWAY
+Add gateway to access machine.
+ |
+
static java.lang.String |
+LOAD_SSH_CONFIG
+Load the OpenSSH config file by default.
+ |
+
static java.lang.String |
+LOAD_STANDARD_KNOWN_HOSTS
+Load the known_hosts file by default.
+ |
+
private static org.slf4j.Logger |
+LOGGER |
+
static java.lang.String |
+PREFIX
+All our own properties start with this prefix.
+ |
+
static java.lang.String |
+SSH_CONFIG_FILE
+OpenSSH config filename.
+ |
+
static java.lang.String |
+STRICT_HOST_KEY_CHECKING
+Enable strict host key checking.
+ |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+List of properties supported by this SSH adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
SftpFileAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+canCreateSymboliclinks()
+Can this adaptor create symbolic links ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
FileSystem |
+createFileSystem(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
private java.lang.String |
+getCurrentWorkingDirectory(org.apache.sshd.client.subsystem.sftp.SftpClient sftpClient,
+ java.lang.String location) |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
boolean |
+supportsReadingPosixPermissions() |
+
boolean |
+supportsSettingPosixPermissions() |
+
canAppend, canReadSymboliclinks, isConnectionless, needsSizeBeforehand, supportsRename, supportsThirdPartyCopy
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
private static final org.slf4j.Logger LOGGER+
public static final java.lang.String ADAPTOR_NAME+
public static final int DEFAULT_PORT+
public static final java.lang.String ADAPTOR_DESCRIPTION+
public static final java.lang.String PREFIX+
public static final java.lang.String STRICT_HOST_KEY_CHECKING+
public static final java.lang.String AGENT+
public static final java.lang.String AGENT_FORWARDING+
public static final java.lang.String LOAD_STANDARD_KNOWN_HOSTS+
public static final java.lang.String LOAD_SSH_CONFIG+
public static final java.lang.String SSH_CONFIG_FILE+
public static final java.lang.String AUTOMATICALLY_ADD_HOST_KEY+
public static final java.lang.String GATEWAY+
public static final java.lang.String CONNECTION_TIMEOUT+
public static final java.lang.String BUFFER_SIZE+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
public boolean canCreateSymboliclinks()+
FileSystemAdaptorDescription
canCreateSymboliclinks
in interface FileSystemAdaptorDescription
canCreateSymboliclinks
in class FileAdaptor
public FileSystem createFileSystem(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createFileSystem
in class FileAdaptor
XenonException
private java.lang.String getCurrentWorkingDirectory(org.apache.sshd.client.subsystem.sftp.SftpClient sftpClient, + java.lang.String location) + throws XenonException+
XenonException
public boolean supportsReadingPosixPermissions()+
supportsReadingPosixPermissions
in interface FileSystemAdaptorDescription
supportsReadingPosixPermissions
in class FileAdaptor
public boolean supportsSettingPosixPermissions()+
supportsSettingPosixPermissions
in interface FileSystemAdaptorDescription
supportsSettingPosixPermissions
in class FileAdaptor
public java.lang.Class[] getSupportedCredentials()+
AdaptorDescription
public class SftpFileSystem +extends FileSystem+
Modifier and Type | +Field and Description | +
---|---|
private org.apache.sshd.client.subsystem.sftp.SftpClient |
+client |
+
private SSHConnection |
+connection |
+
private static org.slf4j.Logger |
+LOGGER |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+SftpFileSystem(java.lang.String uniqueID,
+ java.lang.String name,
+ java.lang.String location,
+ Credential credential,
+ Path entryPath,
+ int bufferSize,
+ SSHConnection connection,
+ org.apache.sshd.client.subsystem.sftp.SftpClient client,
+ XenonProperties properties) |
+
Modifier and Type | +Method and Description | +
---|---|
java.io.OutputStream |
+appendToFile(Path path)
+Open an existing file and return an
+OutputStream to append data to this file. |
+
void |
+close()
+Close this FileSystem.
+ |
+
private static PathAttributes |
+convertAttributes(Path path,
+ org.apache.sshd.client.subsystem.sftp.SftpClient.Attributes attributes) |
+
private static long |
+convertTime(java.nio.file.attribute.FileTime time) |
+
void |
+createDirectory(Path dir)
+Creates a new directory, failing if the directory already exists.
+ |
+
void |
+createFile(Path file)
+Creates a new empty file, failing if the file already exists.
+ |
+
void |
+createSymbolicLink(Path link,
+ Path path)
+Creates a new symbolic link, failing if the link already exists (optional operation).
+ |
+
protected void |
+deleteDirectory(Path dir)
+Delete an empty directory.
+ |
+
protected void |
+deleteFile(Path file)
+Delete a file.
+ |
+
boolean |
+exists(Path path)
+Tests if a path exists.
+ |
+
PathAttributes |
+getAttributes(Path path)
+Get the
+PathAttributes of an existing path. |
+
boolean |
+isOpen()
+Return if the connection to the FileSystem is open.
+ |
+
protected java.util.List<PathAttributes> |
+listDirectory(Path path)
+Return the list of entries in a directory.
+ |
+
java.io.InputStream |
+readFromFile(Path path)
+Open an existing file and return an
+InputStream to read from this file. |
+
Path |
+readSymbolicLink(Path link)
+Reads the target of a symbolic link (optional operation).
+ |
+
void |
+rename(Path source,
+ Path target)
+Rename an existing source path to a non-existing target path (optional operation).
+ |
+
void |
+setPosixFilePermissions(Path path,
+ java.util.Set<PosixFilePermission> permissions)
+Sets the POSIX permissions of a path (optional operation).
+ |
+
(package private) static XenonException |
+sftpExceptionToXenonException(java.io.IOException e,
+ java.lang.String message) |
+
private org.apache.sshd.client.subsystem.sftp.SftpClient.Attributes |
+stat(Path path) |
+
java.io.OutputStream |
+writeToFile(Path path)
+Open a file and return an
+OutputStream to write to this file. |
+
java.io.OutputStream |
+writeToFile(Path path,
+ long size)
+Open a file and return an
+OutputStream to write to this file. |
+
areSamePaths, assertDirectoryExists, assertFileExists, assertFileIsSymbolicLink, assertIsOpen, assertNotNull, assertParentDirectoryExists, assertPathExists, assertPathIsDirectory, assertPathIsFile, assertPathIsNotDirectory, assertPathNotExists, cancel, copy, copyFile, copySymbolicLink, create, create, create, create, createDirectories, delete, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getLocation, getPathSeparator, getProperties, getStatus, getWorkingDirectory, hashCode, isDotDot, list, list, performCopy, setWorkingDirectory, streamCopy, toAbsolutePath, waitUntilDone
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final org.apache.sshd.client.subsystem.sftp.SftpClient client+
private final SSHConnection connection+
protected SftpFileSystem(java.lang.String uniqueID, + java.lang.String name, + java.lang.String location, + Credential credential, + Path entryPath, + int bufferSize, + SSHConnection connection, + org.apache.sshd.client.subsystem.sftp.SftpClient client, + XenonProperties properties)+
public void close() + throws XenonException+
FileSystem
close
in interface java.lang.AutoCloseable
close
in class FileSystem
XenonException
- If the FileSystem failed to close or if an I/O error occurred.public boolean isOpen() + throws XenonException+
FileSystem
isOpen
in class FileSystem
XenonException
- if the test failed or an I/O error occurred.public void rename(Path source, + Path target) + throws XenonException+
FileSystem
+
+ This method only implements a rename operation, not a move operation. Hence, this method will not copy files and should return (almost)
+ instantaneously.
+
+ The parent of the target path (e.g. target.getParent
) must exist.
+
+ If the target is equal to the source this method has no effect.
+
+ If the source is a link, the link itself will be renamed, not the path to which it refers.
+
+ If the source is a directory, it will be renamed to the target. This implies that a moving a directory between physical locations may fail.
+
rename
in class FileSystem
source
- the existing source path.target
- the non existing target path.UnsupportedOperationException
- If the adapter does not support renaming.NoSuchPathException
- If the source file does not exist or the target parent directory does not exist.PathAlreadyExistsException
- If the target file already exists.NotConnectedException
- If file system is closed.XenonException
- If the move failed.public void createDirectory(Path dir) + throws XenonException+
FileSystem
createDirectory
in class FileSystem
dir
- the directory to create.PathAlreadyExistsException
- If the directory already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createFile(Path file) + throws XenonException+
FileSystem
createFile
in class FileSystem
file
- a path referring to the file to create.PathAlreadyExistsException
- If the file already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createSymbolicLink(Path link, + Path path) + throws XenonException+
FileSystem
createSymbolicLink
in class FileSystem
link
- the symbolic link to create.path
- the target the symbolic link should refer to.PathAlreadyExistsException
- If the link already exists.NoSuchPathException
- If the target or parent directory of link does not existInvalidPathException
- If parent of link is not a directoryNotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.protected void deleteFile(Path file) + throws XenonException+
FileSystem
deleteFile
in class FileSystem
file
- the file to removeInvalidPathException
- if the provided path is not a file.NoSuchPathException
- if the provided file does not exist.XenonException
- If the file could not be removed.protected void deleteDirectory(Path dir) + throws XenonException+
FileSystem
rmdir
in Linux).
+
+ This operation must be implemented by the various implementations of FileSystem.deleteDirectory
in class FileSystem
dir
- the directory to removeInvalidPathException
- if the provided path is not a directory.NoSuchPathException
- if the provided path does not exist.XenonException
- If the directory could not be removed.private org.apache.sshd.client.subsystem.sftp.SftpClient.Attributes stat(Path path) + throws XenonException+
XenonException
public boolean exists(Path path) + throws XenonException+
FileSystem
exists
in class FileSystem
path
- the path to test.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.protected java.util.List<PathAttributes> listDirectory(Path path) + throws XenonException+
FileSystem
dir
will be returned as part of the list, but they will not be listed themselves.
+
+ This operation must be implemented by the various implementations of FileSystem.listDirectory
in class FileSystem
path
- the directory to listIterable
that iterates over all entries in dir
XenonException
- If the list could not be retrieved.public java.io.InputStream readFromFile(Path path) + throws XenonException+
FileSystem
InputStream
to read from this file.readFromFile
in class FileSystem
path
- the to read.InputStream
to read from the file.NoSuchPathException
- If the file does not exists.InvalidPathException
- If the file is not regular file.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path path, + long size) + throws XenonException+
FileSystem
OutputStream
to write to this file.
+
+
+ The size of the file (once all data has been written) must be specified using the size
parameter. This is required by some implementations
+ (typically blob-stores).
+
+
writeToFile
in class FileSystem
path
- the target file for the OutputStream.size
- the size of the file once fully written.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path path) + throws XenonException+
FileSystem
OutputStream
to write to this file. (optional operation)
+ + If the file already exists it will be replaced and its data will be lost. + + The amount of data that will be written to the file is not specified in advance. This operation may not be supported by all implementations. + +
writeToFile
in class FileSystem
path
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream appendToFile(Path path) + throws XenonException+
FileSystem
OutputStream
to append data to this file. (optional operation)
+ + If the file does not exist, an exception will be thrown. + + This operation may not be supported by all implementations. + +
appendToFile
in class FileSystem
path
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.InvalidPathException
- if not a regular fileNotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.UnsupportedOperationException
- if the adaptor does not support appendingpublic PathAttributes getAttributes(Path path) + throws XenonException+
FileSystem
PathAttributes
of an existing path.getAttributes
in class FileSystem
path
- the existing path.NoSuchPathException
- If the file does not exists.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public Path readSymbolicLink(Path link) + throws XenonException+
FileSystem
readSymbolicLink
in class FileSystem
link
- the link to read.NoSuchPathException
- If the link does not exists.InvalidPathException
- If the source is not a link.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public void setPosixFilePermissions(Path path, + java.util.Set<PosixFilePermission> permissions) + throws XenonException+
FileSystem
setPosixFilePermissions
in class FileSystem
path
- the target path.permissions
- the permissions to set.NoSuchPathException
- If the target path does not exists.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.private static long convertTime(java.nio.file.attribute.FileTime time)+
private static PathAttributes convertAttributes(Path path, + org.apache.sshd.client.subsystem.sftp.SftpClient.Attributes attributes)+
static XenonException sftpExceptionToXenonException(java.io.IOException e, + java.lang.String message)+
Class | +Description | +
---|---|
SftpFileAdaptor | ++ |
SftpFileSystem | ++ |
public class WebdavFileAdaptor +extends FileAdaptor+
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ADAPTOR_DESCRIPTION
+A description of this adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by this adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+The name of this adaptor
+ |
+
static java.lang.String |
+BUFFER_SIZE
+The buffer size to use when copying data.
+ |
+
private static org.slf4j.Logger |
+LOGGER |
+
static int |
+OK_CODE |
+
static java.lang.String |
+PREFIX
+All our own properties start with this prefix.
+ |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+List of properties supported by this FTP adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
WebdavFileAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+canAppend() |
+
boolean |
+canReadSymboliclinks()
+Can this adaptor read symbolic links ?
+ |
+
FileSystem |
+createFileSystem(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
boolean |
+isConnectionless() |
+
canCreateSymboliclinks, needsSizeBeforehand, supportsReadingPosixPermissions, supportsRename, supportsSettingPosixPermissions, supportsThirdPartyCopy
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
private static final org.slf4j.Logger LOGGER+
public static final java.lang.String ADAPTOR_NAME+
public static final java.lang.String ADAPTOR_DESCRIPTION+
public static final java.lang.String PREFIX+
public static final java.lang.String BUFFER_SIZE+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
public static final int OK_CODE+
public boolean canReadSymboliclinks()+
FileSystemAdaptorDescription
canReadSymboliclinks
in interface FileSystemAdaptorDescription
canReadSymboliclinks
in class FileAdaptor
public boolean isConnectionless()+
isConnectionless
in interface FileSystemAdaptorDescription
isConnectionless
in class FileAdaptor
public boolean canAppend()+
canAppend
in interface FileSystemAdaptorDescription
canAppend
in class FileAdaptor
public java.lang.Class[] getSupportedCredentials()+
AdaptorDescription
public FileSystem createFileSystem(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createFileSystem
in class FileAdaptor
XenonException
class WebdavFileSystem.StreamToFileWriter
+extends java.lang.Thread
+java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
Modifier and Type | +Field and Description | +
---|---|
private java.io.InputStream |
+in |
+
private java.lang.String |
+url |
+
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description | +
---|
StreamToFileWriter(java.lang.String url,
+ java.io.InputStream in) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+run() |
+
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class WebdavFileSystem +extends FileSystem+
Modifier and Type | +Class and Description | +
---|---|
(package private) class |
+WebdavFileSystem.StreamToFileWriter |
+
Modifier and Type | +Field and Description | +
---|---|
private com.github.sardine.Sardine |
+client |
+
private static org.slf4j.Logger |
+LOGGER |
+
private java.lang.String |
+server |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+WebdavFileSystem(java.lang.String uniqueID,
+ java.lang.String name,
+ java.lang.String location,
+ Credential credential,
+ java.lang.String server,
+ Path entryPath,
+ int bufferSize,
+ com.github.sardine.Sardine client,
+ XenonProperties properties) |
+
Modifier and Type | +Method and Description | +
---|---|
java.io.OutputStream |
+appendToFile(Path file)
+Open an existing file and return an
+OutputStream to append data to this file. |
+
void |
+createDirectory(Path dir)
+Creates a new directory, failing if the directory already exists.
+ |
+
void |
+createFile(Path file)
+Creates a new empty file, failing if the file already exists.
+ |
+
void |
+createSymbolicLink(Path link,
+ Path path)
+Creates a new symbolic link, failing if the link already exists (optional operation).
+ |
+
protected void |
+deleteDirectory(Path path)
+Delete an empty directory.
+ |
+
protected void |
+deleteFile(Path path)
+Delete a file.
+ |
+
boolean |
+exists(Path path)
+Tests if a path exists.
+ |
+
PathAttributes |
+getAttributes(Path path)
+Get the
+PathAttributes of an existing path. |
+
private PathAttributes |
+getAttributes(Path path,
+ com.github.sardine.DavResource p) |
+
private java.lang.String |
+getDirectoryPath(Path path) |
+
private java.lang.String |
+getFilePath(Path path) |
+
boolean |
+isOpen()
+Return if the connection to the FileSystem is open.
+ |
+
protected java.util.List<PathAttributes> |
+listDirectory(Path path)
+Return the list of entries in a directory.
+ |
+
java.io.InputStream |
+readFromFile(Path path)
+Open an existing file and return an
+InputStream to read from this file. |
+
Path |
+readSymbolicLink(Path link)
+Reads the target of a symbolic link (optional operation).
+ |
+
void |
+rename(Path source,
+ Path target)
+Rename an existing source path to a non-existing target path (optional operation).
+ |
+
void |
+setPosixFilePermissions(Path path,
+ java.util.Set<PosixFilePermission> permissions)
+Sets the POSIX permissions of a path (optional operation).
+ |
+
java.io.OutputStream |
+writeToFile(Path file)
+Open a file and return an
+OutputStream to write to this file. |
+
java.io.OutputStream |
+writeToFile(Path file,
+ long size)
+Open a file and return an
+OutputStream to write to this file. |
+
areSamePaths, assertDirectoryExists, assertFileExists, assertFileIsSymbolicLink, assertIsOpen, assertNotNull, assertParentDirectoryExists, assertPathExists, assertPathIsDirectory, assertPathIsFile, assertPathIsNotDirectory, assertPathNotExists, cancel, close, copy, copyFile, copySymbolicLink, create, create, create, create, createDirectories, delete, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getLocation, getPathSeparator, getProperties, getStatus, getWorkingDirectory, hashCode, isDotDot, list, list, performCopy, setWorkingDirectory, streamCopy, toAbsolutePath, waitUntilDone
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final com.github.sardine.Sardine client+
private final java.lang.String server+
protected WebdavFileSystem(java.lang.String uniqueID, + java.lang.String name, + java.lang.String location, + Credential credential, + java.lang.String server, + Path entryPath, + int bufferSize, + com.github.sardine.Sardine client, + XenonProperties properties)+
private java.lang.String getFilePath(Path path)+
private java.lang.String getDirectoryPath(Path path)+
private PathAttributes getAttributes(Path path, + com.github.sardine.DavResource p)+
protected java.util.List<PathAttributes> listDirectory(Path path) + throws XenonException+
FileSystem
dir
will be returned as part of the list, but they will not be listed themselves.
+
+ This operation must be implemented by the various implementations of FileSystem.listDirectory
in class FileSystem
path
- the directory to listIterable
that iterates over all entries in dir
XenonException
- If the list could not be retrieved.public boolean isOpen() + throws XenonException+
FileSystem
isOpen
in class FileSystem
XenonException
- if the test failed or an I/O error occurred.public void rename(Path source, + Path target) + throws XenonException+
FileSystem
+
+ This method only implements a rename operation, not a move operation. Hence, this method will not copy files and should return (almost)
+ instantaneously.
+
+ The parent of the target path (e.g. target.getParent
) must exist.
+
+ If the target is equal to the source this method has no effect.
+
+ If the source is a link, the link itself will be renamed, not the path to which it refers.
+
+ If the source is a directory, it will be renamed to the target. This implies that a moving a directory between physical locations may fail.
+
rename
in class FileSystem
source
- the existing source path.target
- the non existing target path.UnsupportedOperationException
- If the adapter does not support renaming.NoSuchPathException
- If the source file does not exist or the target parent directory does not exist.PathAlreadyExistsException
- If the target file already exists.NotConnectedException
- If file system is closed.XenonException
- If the move failed.public void createDirectory(Path dir) + throws XenonException+
FileSystem
createDirectory
in class FileSystem
dir
- the directory to create.PathAlreadyExistsException
- If the directory already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createFile(Path file) + throws XenonException+
FileSystem
createFile
in class FileSystem
file
- a path referring to the file to create.PathAlreadyExistsException
- If the file already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.public void createSymbolicLink(Path link, + Path path) + throws XenonException+
FileSystem
createSymbolicLink
in class FileSystem
link
- the symbolic link to create.path
- the target the symbolic link should refer to.PathAlreadyExistsException
- If the link already exists.NoSuchPathException
- If the target or parent directory of link does not existInvalidPathException
- If parent of link is not a directoryNotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.protected void deleteFile(Path path) + throws XenonException+
FileSystem
deleteFile
in class FileSystem
path
- the file to removeInvalidPathException
- if the provided path is not a file.NoSuchPathException
- if the provided file does not exist.XenonException
- If the file could not be removed.protected void deleteDirectory(Path path) + throws XenonException+
FileSystem
rmdir
in Linux).
+
+ This operation must be implemented by the various implementations of FileSystem.deleteDirectory
in class FileSystem
path
- the directory to removeInvalidPathException
- if the provided path is not a directory.NoSuchPathException
- if the provided path does not exist.XenonException
- If the directory could not be removed.public boolean exists(Path path) + throws XenonException+
FileSystem
exists
in class FileSystem
path
- the path to test.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.InputStream readFromFile(Path path) + throws XenonException+
FileSystem
InputStream
to read from this file.readFromFile
in class FileSystem
path
- the to read.InputStream
to read from the file.NoSuchPathException
- If the file does not exists.InvalidPathException
- If the file is not regular file.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream writeToFile(Path file, + long size) + throws XenonException+
FileSystem
OutputStream
to write to this file.
+
+
+ The size of the file (once all data has been written) must be specified using the size
parameter. This is required by some implementations
+ (typically blob-stores).
+
+
writeToFile
in class FileSystem
file
- the target file for the OutputStream.size
- the size of the file once fully written.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public java.io.OutputStream appendToFile(Path file) + throws XenonException+
FileSystem
OutputStream
to append data to this file. (optional operation)
+ + If the file does not exist, an exception will be thrown. + + This operation may not be supported by all implementations. + +
appendToFile
in class FileSystem
file
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.InvalidPathException
- if not a regular fileNotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.UnsupportedOperationException
- if the adaptor does not support appendingpublic java.io.OutputStream writeToFile(Path file) + throws XenonException+
FileSystem
OutputStream
to write to this file. (optional operation)
+ + If the file already exists it will be replaced and its data will be lost. + + The amount of data that will be written to the file is not specified in advance. This operation may not be supported by all implementations. + +
writeToFile
in class FileSystem
file
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public PathAttributes getAttributes(Path path) + throws XenonException+
FileSystem
PathAttributes
of an existing path.getAttributes
in class FileSystem
path
- the existing path.NoSuchPathException
- If the file does not exists.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public Path readSymbolicLink(Path link) + throws XenonException+
FileSystem
readSymbolicLink
in class FileSystem
link
- the link to read.NoSuchPathException
- If the link does not exists.InvalidPathException
- If the source is not a link.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public void setPosixFilePermissions(Path path, + java.util.Set<PosixFilePermission> permissions) + throws XenonException+
FileSystem
setPosixFilePermissions
in class FileSystem
path
- the target path.permissions
- the permissions to set.NoSuchPathException
- If the target path does not exists.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.Class | +Description | +
---|---|
WebdavFileAdaptor | ++ |
WebdavFileSystem | ++ |
Class | +Description | +
---|---|
Adaptor | ++ |
XenonProperties | +
+ Read-only properties implementation.
+ |
+
Exception | +Description | +
---|---|
NotConnectedException | +
+ Signals that there was no connection.
+ |
+
public class BadParameterException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
BadParameterException(java.lang.String adaptorName,
+ java.lang.String message) |
+
BadParameterException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public BadParameterException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public BadParameterException(java.lang.String adaptorName, + java.lang.String message)+
class BatchProcess +extends java.lang.Object +implements Process+
InteractiveProcess
to emulate a batch process.Modifier and Type | +Field and Description | +
---|---|
private InteractiveProcess |
+process |
+
private StreamForwarder |
+stderrForwarder |
+
private StreamForwarder |
+stdinForwarder |
+
private StreamForwarder |
+stdoutForwarder |
+
private static long |
+TERMINATION_DELAY
+Time to wait for a StreamForwarder to terminate (in ms.)
+ |
+
Constructor and Description | +
---|
BatchProcess(FileSystem filesystem,
+ Path workdir,
+ JobDescription description,
+ java.lang.String jobIdentifier,
+ InteractiveProcessFactory factory,
+ long startupTimeout) |
+
Modifier and Type | +Method and Description | +
---|---|
private void |
+closeStreams() |
+
private java.io.OutputStream |
+createOutputStream(FileSystem filesystem,
+ Path workdir,
+ java.lang.String filename) |
+
void |
+destroy() |
+
int |
+getExitStatus() |
+
boolean |
+isDone() |
+
private Path |
+processPath(Path root,
+ java.lang.String path) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final long TERMINATION_DELAY+
private final InteractiveProcess process+
private StreamForwarder stdinForwarder+
private StreamForwarder stdoutForwarder+
private StreamForwarder stderrForwarder+
public BatchProcess(FileSystem filesystem, + Path workdir, + JobDescription description, + java.lang.String jobIdentifier, + InteractiveProcessFactory factory, + long startupTimeout) + throws XenonException, + java.io.IOException+
XenonException
java.io.IOException
private java.io.OutputStream createOutputStream(FileSystem filesystem, + Path workdir, + java.lang.String filename) + throws XenonException+
XenonException
private void closeStreams()+
public int getExitStatus()+
getExitStatus
in interface Process
public final class CommandLineUtils
+extends java.lang.Object
+Modifier | +Constructor and Description | +
---|---|
private |
+CommandLineUtils() |
+
Modifier and Type | +Method and Description | +
---|---|
static java.lang.String |
+asCSList(java.lang.String[] values)
+Create a single comma separated string out of a list of strings.
+ |
+
static java.lang.String |
+concat(java.lang.String... strings)
+Concatinate a series of
+String s using a StringBuilder . |
+
static java.lang.String |
+protectAgainstShellMetas(java.lang.String argument)
+Escapes and quotes command line arguments to keep shells from expanding/interpreting them.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static java.lang.String concat(java.lang.String... strings)+
String
s using a StringBuilder
.strings
- Strings to concatinate. Any Strings that are null
will be ignored.public static java.lang.String asCSList(java.lang.String[] values)+
values
- an array of values.public static java.lang.String protectAgainstShellMetas(java.lang.String argument)+
argument
- the argument to protect.public class Deadline
+extends java.lang.Object
+Constructor and Description | +
---|
Deadline()
+No need to use this constructor, use static methods instead.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static long |
+getDeadline(long timeout)
+Calculate the epoch timestamp when a timeout will expire.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public Deadline()+
public static long getDeadline(long timeout)+
timeout
to System.currentTimeMillis()
. This computation is protected against overflow,
+ that is, the deadline will never exceed Long.MAX_VALUE
.
+
+ This allows the user to simply test if the deadline has passed by performing a check against the current epoch time:
+
+ if (deadline <= System.currentTimeMillis()) { // deadline has passed }
timeout
- the timeout to compute the deadline with. Must be >= 0 or an IllegalArgumentException will be thrown.Long.MAX_VALUE
if the timeout causes an overflow.public class IncompatibleVersionException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
IncompatibleVersionException(java.lang.String adaptorName,
+ java.lang.String message) |
+
IncompatibleVersionException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public IncompatibleVersionException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public IncompatibleVersionException(java.lang.String adaptorName, + java.lang.String message)+
public interface InteractiveProcess +extends Process+
Modifier and Type | +Method and Description | +
---|---|
Streams |
+getStreams() |
+
destroy, getExitStatus, isDone
public interface InteractiveProcessFactory
+Modifier and Type | +Method and Description | +
---|---|
void |
+close() |
+
InteractiveProcess |
+createInteractiveProcess(JobDescription description,
+ java.lang.String workdir,
+ java.lang.String jobIdentifier,
+ long timeoutInMillis) |
+
boolean |
+isOpen() |
+
InteractiveProcess createInteractiveProcess(JobDescription description, + java.lang.String workdir, + java.lang.String jobIdentifier, + long timeoutInMillis) + throws XenonException+
XenonException
void close() + throws XenonException+
XenonException
boolean isOpen() + throws XenonException+
XenonException
public class JobCanceledException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
JobCanceledException(java.lang.String adaptorName,
+ java.lang.String message) |
+
JobCanceledException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public JobCanceledException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public JobCanceledException(java.lang.String adaptorName, + java.lang.String message)+
public class JobExecutor
+extends java.lang.Object
+implements java.lang.Runnable
+Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+adaptorName |
+
private JobDescription |
+description |
+
private boolean |
+done |
+
private static java.lang.String |
+DONE_STATE |
+
private XenonException |
+error |
+
private static java.lang.String |
+ERROR_STATE |
+
private java.lang.Integer |
+exitStatus |
+
private InteractiveProcessFactory |
+factory |
+
private FileSystem |
+filesystem |
+
private boolean |
+hasRun |
+
private boolean |
+interactive |
+
private boolean |
+isRunning |
+
private java.lang.String |
+jobIdentifier |
+
private boolean |
+killed |
+
private static java.lang.String |
+KILLED_STATE |
+
private static long |
+MILLISECONDS_PER_MINUTE
+Number of ms.
+ |
+
private static java.lang.String |
+PENDING_STATE |
+
private static long |
+POLLING_DELAY
+Polling delay in ms.
+ |
+
private long |
+pollingDelay |
+
private static java.lang.String |
+RUNNING_STATE |
+
private long |
+startupTimeout |
+
private java.lang.String |
+state |
+
private Streams |
+streams |
+
private boolean |
+updateSignal |
+
private Path |
+workingDirectory |
+
Constructor and Description | +
---|
JobExecutor(java.lang.String adaptorName,
+ FileSystem filesystem,
+ Path workingDirectory,
+ InteractiveProcessFactory factory,
+ JobDescription description,
+ java.lang.String jobIdentifier,
+ boolean interactive,
+ long pollingDelay,
+ long startupTimeout) |
+
Modifier and Type | +Method and Description | +
---|---|
private void |
+clearUpdateRequest()
+Clear the update signal and wake up any waiting threads
+ |
+
java.lang.Exception |
+getError() |
+
JobDescription |
+getJobDescription() |
+
java.lang.String |
+getJobIdentifier() |
+
private boolean |
+getKilled() |
+
java.lang.String |
+getState() |
+
JobStatus |
+getStatus() |
+
Streams |
+getStreams() |
+
boolean |
+hasRun() |
+
boolean |
+isDone() |
+
boolean |
+kill() |
+
private Path |
+processPath(Path root,
+ java.lang.String path) |
+
void |
+run() |
+
private void |
+setStreams(Streams streams) |
+
private void |
+sleep(long maxDelay)
+Sleep for a certain amount of time, provide the job is not done, and no one requested an update.
+ |
+
private void |
+triggerStatusUpdate()
+Signal the polling thread to produce a status update.
+ |
+
private void |
+updateState(java.lang.String state,
+ int exitStatus,
+ XenonException e) |
+
private void |
+waitForStatusUpdate(long maxDelay)
+Wait for a certain amount of time for an update.
+ |
+
JobStatus |
+waitUntilDone(long timeout) |
+
JobStatus |
+waitUntilRunning(long timeout) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final java.lang.String PENDING_STATE+
private static final java.lang.String RUNNING_STATE+
private static final java.lang.String DONE_STATE+
private static final java.lang.String ERROR_STATE+
private static final java.lang.String KILLED_STATE+
private static final long POLLING_DELAY+
private static final long MILLISECONDS_PER_MINUTE+
private final JobDescription description+
private final java.lang.String jobIdentifier+
private final boolean interactive+
private final InteractiveProcessFactory factory+
private final long pollingDelay+
private final long startupTimeout+
private final java.lang.String adaptorName+
private final FileSystem filesystem+
private final Path workingDirectory+
private Streams streams+
private java.lang.Integer exitStatus+
private boolean updateSignal+
private boolean isRunning+
private boolean killed+
private boolean done+
private boolean hasRun+
private java.lang.String state+
private XenonException error+
public JobExecutor(java.lang.String adaptorName, + FileSystem filesystem, + Path workingDirectory, + InteractiveProcessFactory factory, + JobDescription description, + java.lang.String jobIdentifier, + boolean interactive, + long pollingDelay, + long startupTimeout)+
public boolean hasRun()+
public boolean kill()+
public boolean isDone()+
public java.lang.String getJobIdentifier()+
public JobDescription getJobDescription()+
public JobStatus getStatus()+
public java.lang.String getState()+
public java.lang.Exception getError()+
private void updateState(java.lang.String state, + int exitStatus, + XenonException e)+
private boolean getKilled()+
private void setStreams(Streams streams)+
public Streams getStreams() + throws XenonException+
XenonException
public JobStatus waitUntilRunning(long timeout)+
public JobStatus waitUntilDone(long timeout)+
private void triggerStatusUpdate()+
private void waitForStatusUpdate(long maxDelay)+
maxDelay
- the maximum time to waitprivate void clearUpdateRequest()+
private void sleep(long maxDelay)+
maxDelay
- the maximum amount of time to waitpublic void run()+
run
in interface java.lang.Runnable
private class JobQueueScheduler.DaemonThreadFactory
+extends java.lang.Object
+implements java.util.concurrent.ThreadFactory
+Modifier | +Constructor and Description | +
---|---|
private |
+DaemonThreadFactory() |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.Thread |
+newThread(java.lang.Runnable runnable) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public class JobQueueScheduler +extends Scheduler+
Modifier and Type | +Class and Description | +
---|---|
private class |
+JobQueueScheduler.DaemonThreadFactory
+Simple thread factory which returns daemon threads instead of normal threads
+ |
+
Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+adaptorName |
+
private InteractiveProcessFactory |
+factory |
+
private FileSystem |
+filesystem |
+
private java.util.concurrent.atomic.AtomicLong |
+jobID |
+
private static org.slf4j.Logger |
+LOGGER |
+
static int |
+MAX_POLLING_DELAY
+The maximum allowed value for the polling delay
+ |
+
static int |
+MIN_POLLING_DELAY
+The minimal allowed value for the polling delay
+ |
+
private static java.lang.String |
+MULTI_QUEUE_NAME |
+
private java.util.concurrent.ExecutorService |
+multiExecutor |
+
private java.util.List<JobExecutor> |
+multiQ |
+
private long |
+pollingDelay |
+
private java.util.ArrayList<java.util.List<JobExecutor>> |
+queues |
+
private static java.lang.String |
+SINGLE_QUEUE_NAME |
+
private java.util.concurrent.ExecutorService |
+singleExecutor |
+
private java.util.List<JobExecutor> |
+singleQ |
+
private long |
+startupTimeout |
+
private static java.lang.String |
+UNLIMITED_QUEUE_NAME |
+
private java.util.concurrent.ExecutorService |
+unlimitedExecutor |
+
private java.util.List<JobExecutor> |
+unlimitedQ |
+
private Path |
+workingDirectory |
+
properties
Constructor and Description | +
---|
JobQueueScheduler(java.lang.String uniqueID,
+ java.lang.String adaptorName,
+ java.lang.String location,
+ Credential credential,
+ InteractiveProcessFactory factory,
+ FileSystem filesystem,
+ Path workingDirectory,
+ int multiQThreads,
+ long pollingDelay,
+ long startupTimeout,
+ XenonProperties properties) |
+
Modifier and Type | +Method and Description | +
---|---|
JobStatus |
+cancelJob(java.lang.String jobIdentifier)
+Cancel a job.
+ |
+
private boolean |
+cleanupJob(java.util.List<JobExecutor> queue,
+ java.lang.String jobIdentifier) |
+
private void |
+cleanupJob(java.lang.String jobIdentifier) |
+
void |
+close()
+Close this Scheduler.
+ |
+
void |
+end() |
+
private JobExecutor |
+findJob(java.util.List<JobExecutor> queue,
+ java.lang.String jobIdentifier) |
+
private JobExecutor |
+findJob(java.lang.String jobIdentifier) |
+
long |
+getCurrentJobID() |
+
java.lang.String |
+getDefaultQueueName()
+Get the name of the default queue.
+ |
+
FileSystem |
+getFileSystem()
+Retrieve the
+FileSystem used internally by this Scheduler . |
+
private void |
+getJobs(java.util.List<JobExecutor> list,
+ java.util.List<java.lang.String> out) |
+
java.lang.String[] |
+getJobs(java.lang.String... queueNames)
+Get all job identifier of jobs currently in (one ore more) queues.
+ |
+
JobStatus |
+getJobStatus(java.lang.String jobIdentifier)
+Get the status of a Job.
+ |
+
java.lang.String[] |
+getQueueNames()
+Get the queue names supported by this Scheduler.
+ |
+
QueueStatus |
+getQueueStatus(java.lang.String queueName)
+Get the status of the
+queue . |
+
QueueStatus[] |
+getQueueStatuses(java.lang.String... queueNames)
+Get the status of all
+queues . |
+
boolean |
+isOpen()
+Test if the connection of this Scheduler is open.
+ |
+
private JobExecutor |
+submit(JobDescription description,
+ boolean interactive) |
+
java.lang.String |
+submitBatchJob(JobDescription description)
+Submit a batch job.
+ |
+
Streams |
+submitInteractiveJob(JobDescription description)
+Submit an interactive job (optional operation).
+ |
+
private void |
+verifyJobDescription(JobDescription description,
+ boolean interactive) |
+
JobStatus |
+waitUntilDone(java.lang.String jobIdentifier,
+ long timeout)
+Wait until a job is done or until a timeout expires.
+ |
+
JobStatus |
+waitUntilRunning(java.lang.String jobIdentifier,
+ long timeout)
+Wait until a job starts running, or until a timeout expires.
+ |
+
assertNonNullOrEmpty, assertPositive, create, create, create, create, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getJobStatuses, getLocation, getProperties, hashCode
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private static final java.lang.String SINGLE_QUEUE_NAME+
private static final java.lang.String MULTI_QUEUE_NAME+
private static final java.lang.String UNLIMITED_QUEUE_NAME+
public static final int MIN_POLLING_DELAY+
public static final int MAX_POLLING_DELAY+
private final java.lang.String adaptorName+
private final FileSystem filesystem+
private final Path workingDirectory+
private final java.util.List<JobExecutor> singleQ+
private final java.util.List<JobExecutor> multiQ+
private final java.util.List<JobExecutor> unlimitedQ+
private final java.util.concurrent.ExecutorService singleExecutor+
private final java.util.concurrent.ExecutorService multiExecutor+
private final java.util.concurrent.ExecutorService unlimitedExecutor+
private final long pollingDelay+
private final long startupTimeout+
private final InteractiveProcessFactory factory+
private final java.util.concurrent.atomic.AtomicLong jobID+
private final java.util.ArrayList<java.util.List<JobExecutor>> queues+
public JobQueueScheduler(java.lang.String uniqueID, + java.lang.String adaptorName, + java.lang.String location, + Credential credential, + InteractiveProcessFactory factory, + FileSystem filesystem, + Path workingDirectory, + int multiQThreads, + long pollingDelay, + long startupTimeout, + XenonProperties properties) + throws BadParameterException+
BadParameterException
public long getCurrentJobID()+
private void getJobs(java.util.List<JobExecutor> list, + java.util.List<java.lang.String> out)+
public java.lang.String getDefaultQueueName() + throws XenonException+
Scheduler
getDefaultQueueName
in class Scheduler
null
if no default queue is available.NotConnectedException
- If scheduler is closed.XenonException
- If an I/O error occurred.public java.lang.String[] getJobs(java.lang.String... queueNames) + throws NoSuchQueueException+
Scheduler
getJobs
in class Scheduler
queueNames
- the names of the queues.NoSuchQueueException
- If the queue does not exist in the scheduler.private JobExecutor findJob(java.util.List<JobExecutor> queue, + java.lang.String jobIdentifier) + throws XenonException+
XenonException
private JobExecutor findJob(java.lang.String jobIdentifier) + throws XenonException+
XenonException
private boolean cleanupJob(java.util.List<JobExecutor> queue, + java.lang.String jobIdentifier)+
private void cleanupJob(java.lang.String jobIdentifier)+
public JobStatus getJobStatus(java.lang.String jobIdentifier) + throws XenonException+
Scheduler
getJobStatus
in class Scheduler
jobIdentifier
- the job identifier of the job to get the status for.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public JobStatus waitUntilDone(java.lang.String jobIdentifier, + long timeout) + throws XenonException+
Scheduler
+ This method will wait until a job is done (either gracefully or by being killed or producing an error), or until the timeout expires, whichever comes + first. If the timeout expires, the job will continue to run. +
++ The timeout is in milliseconds and must be >= 0. When timeout is 0, it will be ignored and this method will wait until the jobs is done. +
++ A JobStatus is returned that can be used to determine why the call returned. +
waitUntilDone
in class Scheduler
jobIdentifier
- the identifier of the to wait for.timeout
- the maximum time to wait for the job in milliseconds.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public JobStatus waitUntilRunning(java.lang.String jobIdentifier, + long timeout) + throws XenonException+
Scheduler
+ This method will return as soon as the job is no longer waiting in the queue, or when the timeout expires, whichever comes first. If the job is no longer + waiting in the queue, it may be running, but it may also be killed, finished or have produced an error. If the timeout expires, the job will continue to + be queued normally. +
++ The timeout is in milliseconds and must be >= 0. When timeout is 0, it will be ignored and this method will wait until the job is no longer queued. +
++ A JobStatus is returned that can be used to determine why the call returned. +
waitUntilRunning
in class Scheduler
jobIdentifier
- the identifier of the to wait for.timeout
- the maximum time to wait in milliseconds.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.private void verifyJobDescription(JobDescription description, + boolean interactive) + throws XenonException+
XenonException
private JobExecutor submit(JobDescription description, + boolean interactive) + throws XenonException+
XenonException
public java.lang.String submitBatchJob(JobDescription description) + throws XenonException+
Scheduler
submitBatchJob
in class Scheduler
description
- the description of the batch job to submit.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public Streams submitInteractiveJob(JobDescription description) + throws XenonException+
Scheduler
submitInteractiveJob
in class Scheduler
description
- the description of the interactive job to submit.Streams
object containing the job identifier and the standard streams of a job.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public JobStatus cancelJob(java.lang.String jobIdentifier) + throws XenonException+
Scheduler
+ A status is returned that indicates the state of the job after the cancel. If the job was already done it cannot be cancelled. +
+
+ A JobStatus
is returned that can be used to determine the state of the job after cancelJob returns. Note that it may take some time before the
+ job has actually terminated. The waitUntilDone
method can be used to wait until the job is terminated.
+
cancelJob
in class Scheduler
jobIdentifier
- the identifier of job to kill.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public QueueStatus getQueueStatus(java.lang.String queueName) + throws XenonException+
Scheduler
queue
.getQueueStatus
in class Scheduler
queueName
- the name of the queue.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get its status.public java.lang.String[] getQueueNames()+
Scheduler
getQueueNames
in class Scheduler
public QueueStatus[] getQueueStatuses(java.lang.String... queueNames) + throws XenonException+
Scheduler
queues
.
+
+ Note that this method will only throw an exception when this exception will influence all status requests. For example, if the scheduler is no longer
+ connected.
+
+ Exceptions that only refer to a single queue are returned in the QueueStatus returned for that queue.getQueueStatuses
in class Scheduler
queueNames
- the names of the queues.XenonException
- If the Scheduler failed to get the statuses.public void end()+
public FileSystem getFileSystem() + throws XenonException+
Scheduler
FileSystem
used internally by this Scheduler
.
+
+ Often, a Scheduler
needs to access files or directories on the machine it will schedule jobs. For example, to ensure a working directory
+ exists, or to redirect the stdin, stdout or stderr streams used by a job.
+
+ This method returns this FileSystem
so it can also be used by the application to prepare input files for the jobs, or retrieve the output
+ files produced by the jobs.
+
getFileSystem
in class Scheduler
FileSystem
used by this Scheduler.XenonException
- if this Scheduler does not use a FileSystem
internally.public void close() + throws XenonException+
Scheduler
close
in interface java.lang.AutoCloseable
close
in class Scheduler
XenonException
- If the Scheduler failed to close.public boolean isOpen() + throws XenonException+
Scheduler
isOpen
in class Scheduler
true
if the connection of this Scheduler is still open, false
otherwise.XenonException
- If an I/O error occurred.Modifier and Type | +Field and Description | +
---|---|
private boolean |
+done |
+
private XenonException |
+exception |
+
private java.lang.Integer |
+exitCode |
+
private java.lang.String |
+jobIdentifier |
+
private java.lang.String |
+name |
+
private boolean |
+running |
+
private java.util.Map<java.lang.String,java.lang.String> |
+schedulerSpecificInformation |
+
private java.lang.String |
+state |
+
Constructor and Description | +
---|
JobStatusImplementation(java.lang.String jobIdentifier,
+ java.lang.String name,
+ java.lang.String state,
+ java.lang.Integer exitCode,
+ XenonException exception,
+ boolean running,
+ boolean done,
+ java.util.Map<java.lang.String,java.lang.String> schedulerSpecificInformation)
+Create a JobStatus.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
XenonException |
+getException()
+Get the exception produced by the Job or while retrieving the status.
+ |
+
java.lang.Integer |
+getExitCode()
+Get the exit code for the Job.
+ |
+
java.lang.String |
+getJobIdentifier()
+Get the job identifier of the Job for which this JobStatus was created.
+ |
+
java.lang.String |
+getName()
+Get the name of the Job for which this JobStatus was created.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getSchedulerSpecificInformation()
+Get scheduler specific information on the Job.
+ |
+
java.lang.String |
+getState()
+Get the state of the Job.
+ |
+
boolean |
+hasException()
+Has the Job or job retrieval produced a exception ?
+ |
+
int |
+hashCode() |
+
boolean |
+isDone()
+Is the Job done.
+ |
+
boolean |
+isRunning()
+Is the Job running.
+ |
+
void |
+maybeThrowException()
+Throws the exception produced by the Job or while retrieving the status, if it exists.
+ |
+
java.lang.String |
+toString() |
+
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private final java.lang.String jobIdentifier+
private final java.lang.String name+
private final java.lang.String state+
private final java.lang.Integer exitCode+
private final XenonException exception+
private final boolean running+
private final boolean done+
private final java.util.Map<java.lang.String,java.lang.String> schedulerSpecificInformation+
public JobStatusImplementation(java.lang.String jobIdentifier, + java.lang.String name, + java.lang.String state, + java.lang.Integer exitCode, + XenonException exception, + boolean running, + boolean done, + java.util.Map<java.lang.String,java.lang.String> schedulerSpecificInformation)+
jobIdentifier
- the identifier of the job for which this status was created.name
- the name of the job for which this status was created.state
- the state of the Job
at the time this status was created.exitCode
- the exit code of the Job
(if the jobs has finished).exception
- the exception produced when running Job
(if the jobs has failed).running
- is the Job
running ?done
- is the Job
finished ?schedulerSpecificInformation
- a map of scheduler implementation specific information on the job.public java.lang.String getJobIdentifier()+
getJobIdentifier
in interface JobStatus
public java.lang.String getName()+
public java.lang.String getState()+
public java.lang.Integer getExitCode()+
getExitCode
in interface JobStatus
public XenonException getException()+
getException
in interface JobStatus
public void maybeThrowException() + throws XenonException+
JobStatus
maybeThrowException
in interface JobStatus
JobCanceledException
- if the job was cancelledNoSuchJobException
- if the job of which the status was requested does not existXenonException
- if an I/O error occurred.public boolean isRunning()+
public boolean isDone()+
public boolean hasException()+
hasException
in interface JobStatus
public java.util.Map<java.lang.String,java.lang.String> getSchedulerSpecificInformation()+
getSchedulerSpecificInformation
in interface JobStatus
public java.lang.String toString()+
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public interface Process
+Modifier and Type | +Method and Description | +
---|---|
void |
+destroy() |
+
int |
+getExitStatus() |
+
boolean |
+isDone() |
+
public class QueueStatusImplementation +extends java.lang.Object +implements QueueStatus+
Modifier and Type | +Field and Description | +
---|---|
private XenonException |
+exception |
+
private java.lang.String |
+queueName |
+
private Scheduler |
+scheduler |
+
private java.util.Map<java.lang.String,java.lang.String> |
+schedulerSpecificInformation |
+
Constructor and Description | +
---|
QueueStatusImplementation(Scheduler scheduler,
+ java.lang.String queueName,
+ XenonException exception,
+ java.util.Map<java.lang.String,java.lang.String> schedulerSpecificInformation)
+Create a Queue status.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
XenonException |
+getException()
+Get the exception produced by the queue, or
+null if hasException() returns false . |
+
java.lang.String |
+getQueueName()
+Get the queue name.
+ |
+
Scheduler |
+getScheduler()
+Get the Scheduler that produced this QueueStatus.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getSchedulerSpecificInformation()
+Get scheduler specific information on the queue.
+ |
+
boolean |
+hasException()
+Did the queue produce an exception ?
+ |
+
void |
+maybeThrowException()
+Throws the exception produced by the queue if it exists.
+ |
+
java.lang.String |
+toString() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private final Scheduler scheduler+
private final java.lang.String queueName+
private final XenonException exception+
private final java.util.Map<java.lang.String,java.lang.String> schedulerSpecificInformation+
public QueueStatusImplementation(Scheduler scheduler, + java.lang.String queueName, + XenonException exception, + java.util.Map<java.lang.String,java.lang.String> schedulerSpecificInformation)+
scheduler
- the Scheduler
to which the queue belongs.queueName
- the name of the queue.exception
- the exception produced when retrieving the queue status (if any).schedulerSpecificInformation
- scheduler implementation specific information on the status of the queue.public Scheduler getScheduler()+
getScheduler
in interface QueueStatus
public java.lang.String getQueueName()+
getQueueName
in interface QueueStatus
public boolean hasException()+
hasException
in interface QueueStatus
public XenonException getException()+
null
if hasException()
returns false
.getException
in interface QueueStatus
public void maybeThrowException() + throws XenonException+
QueueStatus
maybeThrowException
in interface QueueStatus
NoSuchQueueException
- if the requested queue does not existXenonException
- if an I/O error occurred.public java.util.Map<java.lang.String,java.lang.String> getSchedulerSpecificInformation()+
getSchedulerSpecificInformation
in interface QueueStatus
public java.lang.String toString()+
toString
in class java.lang.Object
public class RemoteCommandRunner
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+error |
+
private int |
+exitCode |
+
private static org.slf4j.Logger |
+LOGGER |
+
private java.lang.String |
+output |
+
Constructor and Description | +
---|
RemoteCommandRunner(Scheduler scheduler,
+ java.lang.String stdin,
+ java.lang.String executable,
+ java.lang.String... arguments)
+Run a command remotely, and save stdout, stderr, and exit code for later processing.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
int |
+getExitCode() |
+
java.lang.String |
+getStderr() |
+
java.lang.String |
+getStdout() |
+
boolean |
+success() |
+
java.lang.String |
+toString() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final int exitCode+
private final java.lang.String output+
private final java.lang.String error+
public RemoteCommandRunner(Scheduler scheduler, + java.lang.String stdin, + java.lang.String executable, + java.lang.String... arguments) + throws XenonException+
scheduler
- the scheduler to submit the job tostdin
- input to feed to the commandexecutable
- command to runarguments
- arguments for the commandXenonException
- if the job could not be run successfully.public java.lang.String getStdout()+
public java.lang.String getStderr()+
public int getExitCode()+
public boolean success()+
public java.lang.String toString()+
toString
in class java.lang.Object
public abstract class SchedulerAdaptor +extends Adaptor +implements SchedulerAdaptorDescription+
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ADAPTORS_PREFIX |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+SchedulerAdaptor(java.lang.String name,
+ java.lang.String description,
+ java.lang.String[] locations,
+ XenonPropertyDescription[] properties) |
+
Modifier and Type | +Method and Description | +
---|---|
abstract Scheduler |
+createScheduler(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
boolean |
+isEmbedded()
+Is this an embedded scheduler ?
+
+ Embedded schedulers are implemented inside the Xenon process itself.
+ |
+
boolean |
+supportsBatch()
+Does this Scheduler support the submission of batch jobs ?
+
+ For batch jobs the standard streams of the jobs are redirected from and to files.
+ |
+
boolean |
+supportsInteractive()
+Does this Scheduler supports the submission of interactive jobs ?
+
+ For interactive jobs the standard streams of the job must be handled by the submitting process.
+ |
+
boolean |
+usesFileSystem()
+Does this Scheduler create a FileSystem to support the submission of jobs ?
+
+ Many scheduler implementations use a FileSystem internally to handle job submission, for example to store submission scripts or handle the standard I/O
+ streams of a process.
+ |
+
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedCredentials, getSupportedLocations, getSupportedProperties
public static final java.lang.String ADAPTORS_PREFIX+
protected SchedulerAdaptor(java.lang.String name, + java.lang.String description, + java.lang.String[] locations, + XenonPropertyDescription[] properties)+
public boolean isEmbedded()+
SchedulerAdaptorDescription
isEmbedded
in interface SchedulerAdaptorDescription
public boolean supportsBatch()+
SchedulerAdaptorDescription
supportsBatch
in interface SchedulerAdaptorDescription
public boolean supportsInteractive()+
SchedulerAdaptorDescription
supportsInteractive
in interface SchedulerAdaptorDescription
public boolean usesFileSystem()+
SchedulerAdaptorDescription
Scheduler.getFileSystem()
method.usesFileSystem
in interface SchedulerAdaptorDescription
Scheduler
create a FileSystem to support the submission of jobs ?public abstract Scheduler createScheduler(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
XenonException
public class SchedulerClosedException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
SchedulerClosedException(java.lang.String adaptorName,
+ java.lang.String message) |
+
SchedulerClosedException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public SchedulerClosedException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public SchedulerClosedException(java.lang.String adaptorName, + java.lang.String message)+
public final class ScriptingParser
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
static java.util.regex.Pattern |
+BAR_REGEX |
+
static java.util.regex.Pattern |
+EQUALS_REGEX |
+
static java.util.regex.Pattern |
+HORIZONTAL_LINE_REGEX |
+
static java.util.regex.Pattern |
+NEWLINE_REGEX |
+
static java.util.regex.Pattern |
+WHITESPACE_REGEX |
+
Modifier | +Constructor and Description | +
---|---|
private |
+ScriptingParser() |
+
Modifier and Type | +Method and Description | +
---|---|
static int |
+checkIfContains(java.lang.String input,
+ java.lang.String adaptorName,
+ java.lang.String... options)
+Checks if the given text contains any of the given options.
+ |
+
static java.lang.String |
+cleanValue(java.lang.String value,
+ java.lang.String... suffixes)
+Remove suffix from a string if present.
+ |
+
static boolean |
+containsAny(java.lang.String input,
+ java.lang.String... options)
+Returns if the given input String contains any of the option Strings given.
+ |
+
private static java.lang.String[] |
+mergeTuples(java.lang.String[] values) |
+
static java.lang.String |
+parseJobIDFromLine(java.lang.String input,
+ java.lang.String adaptorName,
+ java.lang.String... possiblePrefixes)
+Get a JobID (number) from a line of input.
+ |
+
static java.util.Map<java.lang.String,java.lang.String> |
+parseKeyValueLines(java.lang.String input,
+ java.util.regex.Pattern separatorRegEx,
+ java.lang.String adaptorName,
+ java.lang.String... ignoredLines)
+Parses lines containing single key/value pairs separated by the given separator, possibly surrounded by whitespace.
+ |
+
static java.util.Map<java.lang.String,java.lang.String> |
+parseKeyValuePairs(java.lang.String input,
+ java.lang.String adaptorName,
+ java.lang.String... ignoredLines)
+Parses a output with key=value pairs separated by whitespace, on one or more lines.
+ |
+
static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+parseKeyValueRecords(java.lang.String input,
+ java.lang.String keyField,
+ java.util.regex.Pattern separatorRegEx,
+ java.lang.String adaptorName,
+ java.lang.String... ignoredLines)
+Parses multiple key value records.
+ |
+
static java.lang.String[] |
+parseList(java.lang.String input)
+Parses a list of strings, separated by whitespace (including newlines)
+ Trailing empty strings are not included.
+ |
+
static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+parseTable(java.lang.String input,
+ java.lang.String keyField,
+ java.util.regex.Pattern fieldSeparatorRegEx,
+ java.lang.String adaptorName,
+ java.lang.String... valueSuffixes)
+Parses lines containing multiple values.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static final java.util.regex.Pattern WHITESPACE_REGEX+
public static final java.util.regex.Pattern BAR_REGEX+
public static final java.util.regex.Pattern NEWLINE_REGEX+
public static final java.util.regex.Pattern EQUALS_REGEX+
public static final java.util.regex.Pattern HORIZONTAL_LINE_REGEX+
public static java.util.Map<java.lang.String,java.lang.String> parseKeyValuePairs(java.lang.String input, + java.lang.String adaptorName, + java.lang.String... ignoredLines) + throws XenonException+
input
- the text to parse.adaptorName
- the adaptor name reported in case an exception occurs.ignoredLines
- lines exactly matching one of these strings will be ignored.XenonException
- if the input cannot be parsed.public static boolean containsAny(java.lang.String input, + java.lang.String... options)+
input
- String to check onoptions
- Strings to check forpublic static java.util.Map<java.lang.String,java.lang.String> parseKeyValueLines(java.lang.String input, + java.util.regex.Pattern separatorRegEx, + java.lang.String adaptorName, + java.lang.String... ignoredLines) + throws XenonException+
input
- the input to parseseparatorRegEx
- a regular expression for the separator between key and valueadaptorName
- the adaptor name to report in case parsing failedignoredLines
- lines containing any of the given strings will be ignored.XenonException
- if the input cannot be parsedpublic static java.lang.String parseJobIDFromLine(java.lang.String input, + java.lang.String adaptorName, + java.lang.String... possiblePrefixes) + throws XenonException+
input
- the line containing the jobIDadaptorName
- the adaptor name to report in case parsing failedpossiblePrefixes
- a number of possible prefixes before the job ID.XenonException
- if the input could not be parsed.public static java.lang.String cleanValue(java.lang.String value, + java.lang.String... suffixes)+
value
- the text to cleansuffixes
- the possible suffixes to removepublic static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> parseTable(java.lang.String input, + java.lang.String keyField, + java.util.regex.Pattern fieldSeparatorRegEx, + java.lang.String adaptorName, + java.lang.String... valueSuffixes) + throws XenonException+
input
- the input to parsekeyField
- the field to use as the key in the result map. This field is mandatory in the output.fieldSeparatorRegEx
- a regular expression of the separator between fields. Usually whitespace.adaptorName
- the adaptor name to report in case parsing failedvalueSuffixes
- suffixes to be removed from values in the table. Useful if the output contains special markers for defaults,
+ disabled queues, broken nodes, etcXenonException
- when parsing failsprivate static java.lang.String[] mergeTuples(java.lang.String[] values)+
public static int checkIfContains(java.lang.String input, + java.lang.String adaptorName, + java.lang.String... options) + throws XenonException+
input
- the input text to checkadaptorName
- the adaptor name to report in case no match was foundoptions
- all possible options the input could containXenonException
- in case the input does not contain any of the options given.public static java.lang.String[] parseList(java.lang.String input)+
input
- the input to parsepublic static java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> parseKeyValueRecords(java.lang.String input, + java.lang.String keyField, + java.util.regex.Pattern separatorRegEx, + java.lang.String adaptorName, + java.lang.String... ignoredLines) + throws XenonException+
input
- the input to parse.separatorRegEx
- a regular expression for the separator between key and valueadaptorName
- the adaptor name to report in case parsing failedignoredLines
- lines containing any of the given strings will be ignored.keyField
- the header field which triggers a new record. the first line of the output must contain this keyXenonException
- in case the output does not match the expected formatpublic abstract class ScriptingScheduler +extends Scheduler+
Modifier and Type | +Field and Description | +
---|---|
private static org.slf4j.Logger |
+LOGGER |
+
protected long |
+pollDelay |
+
protected FileSystem |
+subFileSystem |
+
protected Scheduler |
+subScheduler |
+
properties
Modifier | +Constructor and Description | +
---|---|
protected |
+ScriptingScheduler(java.lang.String uniqueID,
+ java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> prop,
+ XenonPropertyDescription[] validProperties,
+ java.lang.String pollDelayProperty) |
+
Modifier and Type | +Method and Description | +
---|---|
protected void |
+checkQueue(java.lang.String[] queueNames,
+ java.lang.String queueName)
+Check if the given
+queueName is presents in queueNames . |
+
protected void |
+checkQueueNames(java.lang.String[] givenQueueNames)
+Checks if the queue names given are valid, and throw an exception otherwise.
+ |
+
protected void |
+checkWorkingDirectory(java.lang.String workingDirectory)
+Check if the given working directory exists.
+ |
+
void |
+close()
+Close this Scheduler.
+ |
+
FileSystem |
+getFileSystem()
+Retrieve the
+FileSystem used internally by this Scheduler . |
+
protected QueueStatus[] |
+getQueueStatuses(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> all,
+ java.lang.String... queueNames) |
+
protected Path |
+getWorkingDirectory() |
+
boolean |
+isOpen()
+Test if the connection of this Scheduler is open.
+ |
+
java.lang.String |
+runCheckedCommand(java.lang.String stdin,
+ java.lang.String executable,
+ java.lang.String... arguments)
+Run a command until completion.
+ |
+
RemoteCommandRunner |
+runCommand(java.lang.String stdin,
+ java.lang.String executable,
+ java.lang.String... arguments)
+Run a command on the remote scheduler machine.
+ |
+
protected boolean |
+sleep(long pollDelay) |
+
Streams |
+startInteractiveCommand(java.lang.String executable,
+ java.lang.String... arguments)
+Start an interactive command on the remote machine (usually via ssh).
+ |
+
protected void |
+translateError(RemoteCommandRunner runner,
+ java.lang.String stdin,
+ java.lang.String executable,
+ java.lang.String... arguments) |
+
JobStatus |
+waitUntilDone(java.lang.String jobIdentifier,
+ long timeout)
+Wait until a Job is done, or until the give timeout expires (whichever comes first).
+ |
+
JobStatus |
+waitUntilRunning(java.lang.String jobIdentifier,
+ long timeout)
+Wait until a Job is running (or already done), or until the given timeout expires, whichever comes first.
+ |
+
assertNonNullOrEmpty, assertPositive, cancelJob, create, create, create, create, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getDefaultQueueName, getJobs, getJobStatus, getJobStatuses, getLocation, getProperties, getQueueNames, getQueueStatus, getQueueStatuses, hashCode, submitBatchJob, submitInteractiveJob
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
protected final Scheduler subScheduler+
protected final FileSystem subFileSystem+
protected final long pollDelay+
protected ScriptingScheduler(java.lang.String uniqueID, + java.lang.String adaptor, + java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> prop, + XenonPropertyDescription[] validProperties, + java.lang.String pollDelayProperty) + throws XenonException+
XenonException
protected Path getWorkingDirectory()+
protected QueueStatus[] getQueueStatuses(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> all, + java.lang.String... queueNames)+
public RemoteCommandRunner runCommand(java.lang.String stdin, + java.lang.String executable, + java.lang.String... arguments) + throws XenonException+
stdin
- the text to write to the input of the executable.executable
- the executable to runarguments
- the arguments to the executableRemoteCommandRunner
that can be used to monitor the running commandXenonException
- if an error occursprotected void translateError(RemoteCommandRunner runner, + java.lang.String stdin, + java.lang.String executable, + java.lang.String... arguments) + throws XenonException+
XenonException
public java.lang.String runCheckedCommand(java.lang.String stdin, + java.lang.String executable, + java.lang.String... arguments) + throws XenonException+
stdin
- the text to write to the input of the executable.executable
- the executable to runarguments
- the arguments to the executableXenonException
- if an error occurredpublic Streams startInteractiveCommand(java.lang.String executable, + java.lang.String... arguments) + throws XenonException+
executable
- the executable to startarguments
- the arguments to pass to the executableXenonException
- if an error occurredprotected void checkQueueNames(java.lang.String[] givenQueueNames) + throws XenonException+
givenQueueNames
- the queue names to check for validityNoSuchQueueException
- if one or more of the queue names is not known in the schedulerXenonException
protected boolean sleep(long pollDelay)+
public JobStatus waitUntilDone(java.lang.String jobIdentifier, + long timeout) + throws XenonException+
waitUntilDone
in class Scheduler
jobIdentifier
- the Job to wait fortimeout
- the maximum number of milliseconds to wait, 0 to wait forever, or negative to return immediately.java.lang.IllegalArgumentException
- if the value to timeout is negativeXenonException
- if an error occurspublic JobStatus waitUntilRunning(java.lang.String jobIdentifier, + long timeout) + throws XenonException+
waitUntilRunning
in class Scheduler
jobIdentifier
- the Job to wait fortimeout
- the maximum number of milliseconds to wait, 0 to wait forever, or negative to return immediately.java.lang.IllegalArgumentException
- if the value of timeout was negativeXenonException
- if an error occursprotected void checkQueue(java.lang.String[] queueNames, + java.lang.String queueName) + throws NoSuchQueueException+
queueName
is presents in queueNames
.
+
+ If queueName
is null
or queueName
is present in queueNames
this method will return. Otherwise it will
+ throw a NoSuchQueueException
.queueNames
- the valid queue names.queueName
- the queueName to check.NoSuchQueueException
- if workingDirectory does not exist, or an error occurred.protected void checkWorkingDirectory(java.lang.String workingDirectory) + throws XenonException+
workingDirectory
- the working directory (either absolute or relative) as given by the user.XenonException
- if workingDirectory does not exist, or an error occurred.public boolean isOpen() + throws XenonException+
Scheduler
isOpen
in class Scheduler
true
if the connection of this Scheduler is still open, false
otherwise.XenonException
- If an I/O error occurred.public void close() + throws XenonException+
Scheduler
close
in interface java.lang.AutoCloseable
close
in class Scheduler
XenonException
- If the Scheduler failed to close.public FileSystem getFileSystem() + throws XenonException+
Scheduler
FileSystem
used internally by this Scheduler
.
+
+ Often, a Scheduler
needs to access files or directories on the machine it will schedule jobs. For example, to ensure a working directory
+ exists, or to redirect the stdin, stdout or stderr streams used by a job.
+
+ This method returns this FileSystem
so it can also be used by the application to prepare input files for the jobs, or retrieve the output
+ files produced by the jobs.
+
getFileSystem
in class Scheduler
FileSystem
used by this Scheduler.XenonException
- if this Scheduler does not use a FileSystem
internally.public abstract class ScriptingSchedulerAdaptor +extends SchedulerAdaptor+
ADAPTORS_PREFIX
Modifier | +Constructor and Description | +
---|---|
protected |
+ScriptingSchedulerAdaptor(java.lang.String name,
+ java.lang.String description,
+ java.lang.String[] locations,
+ XenonPropertyDescription[] properties) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
createScheduler, isEmbedded, supportsBatch, supportsInteractive, usesFileSystem
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
protected ScriptingSchedulerAdaptor(java.lang.String name, + java.lang.String description, + java.lang.String[] locations, + XenonPropertyDescription[] properties) + throws XenonException+
XenonException
public java.lang.Class[] getSupportedCredentials()+
AdaptorDescription
public class ScriptingUtils
+extends java.lang.Object
+Modifier | +Constructor and Description | +
---|---|
private |
+ScriptingUtils() |
+
Modifier and Type | +Method and Description | +
---|---|
static XenonProperties |
+getProperties(XenonPropertyDescription[] validProperties,
+ java.lang.String location,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
static boolean |
+isLocal(java.lang.String location) |
+
static boolean |
+isSSH(java.lang.String location) |
+
static XenonPropertyDescription[] |
+mergeValidProperties(XenonPropertyDescription[]... prop) |
+
static void |
+verifyJobDescription(JobDescription description,
+ java.lang.String adaptorName)
+Do some checks on a job description.
+ |
+
static void |
+verifyJobInfo(java.util.Map<java.lang.String,java.lang.String> jobInfo,
+ java.lang.String jobIdentifier,
+ java.lang.String adaptorName,
+ java.lang.String jobIDField,
+ java.lang.String... additionalFields)
+Check if the info map for a job exists, contains the expected job ID, and contains the given additional fields
+ |
+
static void |
+verifyJobOptions(java.util.Map<java.lang.String,java.lang.String> options,
+ java.lang.String[] validOptions,
+ java.lang.String adaptorName) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static boolean isLocal(java.lang.String location)+
public static boolean isSSH(java.lang.String location)+
public static XenonPropertyDescription[] mergeValidProperties(XenonPropertyDescription[]... prop)+
public static XenonProperties getProperties(XenonPropertyDescription[] validProperties, + java.lang.String location, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
XenonException
public static void verifyJobDescription(JobDescription description, + java.lang.String adaptorName) + throws XenonException+
description
- the job description to checkadaptorName
- the name of the adaptor. Used when an exception is thrownIncompleteJobDescriptionException
- if the description is missing a mandatory value.InvalidJobDescriptionException
- if the description contains illegal values.XenonException
public static void verifyJobOptions(java.util.Map<java.lang.String,java.lang.String> options, + java.lang.String[] validOptions, + java.lang.String adaptorName) + throws InvalidJobDescriptionException+
InvalidJobDescriptionException
public static void verifyJobInfo(java.util.Map<java.lang.String,java.lang.String> jobInfo, + java.lang.String jobIdentifier, + java.lang.String adaptorName, + java.lang.String jobIDField, + java.lang.String... additionalFields) + throws XenonException+
jobInfo
- the info map to check.jobIdentifier
- the unique identifier of the job.adaptorName
- name of the current adaptor for error reporting.jobIDField
- the field which contains the job id.additionalFields
- any additional fields to check the presence of.XenonException
- if any fields are missing or incorrectModifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+jobIdentifier |
+
private java.io.InputStream |
+stderr |
+
private java.io.OutputStream |
+stdin |
+
private java.io.InputStream |
+stdout |
+
Constructor and Description | +
---|
StreamsImplementation(java.lang.String jobIdentifier,
+ java.io.InputStream stdout,
+ java.io.OutputStream stdin,
+ java.io.InputStream stderr)
+Create a Streams containing the job and its standard streams.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
java.lang.String |
+getJobIdentifier()
+Get the identifier of the job for which this Streams was created.
+ |
+
java.io.InputStream |
+getStderr()
+Returns the standard error stream of job.
+ |
+
java.io.OutputStream |
+getStdin()
+Returns the standard input stream of job.
+ |
+
java.io.InputStream |
+getStdout()
+Returns the standard output stream of job.
+ |
+
int |
+hashCode() |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private final java.lang.String jobIdentifier+
private final java.io.InputStream stdout+
private final java.io.InputStream stderr+
private final java.io.OutputStream stdin+
public StreamsImplementation(java.lang.String jobIdentifier, + java.io.InputStream stdout, + java.io.OutputStream stdin, + java.io.InputStream stderr)+
jobIdentifier
- the identifier of the job.stdout
- the standard output stream.stdin
- the standard input stream.stderr
- the standard error stream.public java.lang.String getJobIdentifier()+
getJobIdentifier
in interface Streams
public java.io.InputStream getStdout()+
public java.io.InputStream getStderr()+
public java.io.OutputStream getStdin()+
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public class GridEngineScheduler +extends ScriptingScheduler+
Modifier and Type | +Field and Description | +
---|---|
private long |
+accountingGraceTime |
+
private java.util.Set<java.lang.Long> |
+deletedJobs |
+
private java.util.Map<java.lang.String,java.lang.Long> |
+lastSeenMap
+Map with the last seen time of jobs.
+ |
+
private static org.slf4j.Logger |
+LOGGER |
+
private GridEngineXmlParser |
+parser |
+
private GridEngineSetup |
+setupInfo |
+
pollDelay, subFileSystem, subScheduler
properties
Modifier | +Constructor and Description | +
---|---|
protected |
+GridEngineScheduler(java.lang.String uniqueID,
+ java.lang.String location,
+ Credential credential,
+ XenonPropertyDescription[] valid,
+ java.util.Map<java.lang.String,java.lang.String> prop) |
+
Modifier and Type | +Method and Description | +
---|---|
private void |
+addDeletedJob(java.lang.String jobIdentifier) |
+
JobStatus |
+cancelJob(java.lang.String jobIdentifier)
+Cancel a job.
+ |
+
java.lang.String |
+getDefaultQueueName()
+Get the name of the default queue.
+ |
+
java.lang.String[] |
+getJobs(java.lang.String... queueNames)
+Get all job identifier of jobs currently in (one ore more) queues.
+ |
+
private JobStatus |
+getJobStatus(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> qstatInfo,
+ java.lang.String jobIdentifier)
+Get job status.
+ |
+
JobStatus |
+getJobStatus(java.lang.String jobIdentifier)
+Get the status of a Job.
+ |
+
JobStatus[] |
+getJobStatuses(java.lang.String... jobs)
+Get the status of all specified
+jobs . |
+
private java.util.Map<java.lang.String,java.lang.String> |
+getQacctInfo(java.lang.String jobIdentifier) |
+
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+getQstatInfo() |
+
java.lang.String[] |
+getQueueNames()
+Get the queue names supported by this Scheduler.
+ |
+
QueueStatus |
+getQueueStatus(java.lang.String queueName)
+Get the status of the
+queue . |
+
QueueStatus[] |
+getQueueStatuses(java.lang.String... queueNames)
+Get the status of all
+queues . |
+
private boolean |
+haveRecentlySeen(java.lang.String identifier) |
+
private void |
+jobsFromStatus(java.lang.String statusOutput,
+ java.util.List<java.lang.String> result) |
+
private boolean |
+jobWasDeleted(java.lang.String jobIdentifier) |
+
java.lang.String |
+submitBatchJob(JobDescription description)
+Submit a batch job.
+ |
+
Streams |
+submitInteractiveJob(JobDescription description)
+Submit an interactive job (optional operation).
+ |
+
private void |
+updateJobsSeenMap(java.util.Set<java.lang.String> identifiers) |
+
checkQueue, checkQueueNames, checkWorkingDirectory, close, getFileSystem, getQueueStatuses, getWorkingDirectory, isOpen, runCheckedCommand, runCommand, sleep, startInteractiveCommand, translateError, waitUntilDone, waitUntilRunning
assertNonNullOrEmpty, assertPositive, create, create, create, create, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getLocation, getProperties, hashCode
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final long accountingGraceTime+
private final java.util.Map<java.lang.String,java.lang.Long> lastSeenMap+
private final java.util.Set<java.lang.Long> deletedJobs+
private final GridEngineXmlParser parser+
private final GridEngineSetup setupInfo+
protected GridEngineScheduler(java.lang.String uniqueID, + java.lang.String location, + Credential credential, + XenonPropertyDescription[] valid, + java.util.Map<java.lang.String,java.lang.String> prop) + throws XenonException+
XenonException
public java.lang.String[] getQueueNames()+
Scheduler
getQueueNames
in class Scheduler
public java.lang.String getDefaultQueueName()+
Scheduler
getDefaultQueueName
in class Scheduler
null
if no default queue is available.private void updateJobsSeenMap(java.util.Set<java.lang.String> identifiers)+
private boolean haveRecentlySeen(java.lang.String identifier)+
private void addDeletedJob(java.lang.String jobIdentifier)+
private boolean jobWasDeleted(java.lang.String jobIdentifier)+
private void jobsFromStatus(java.lang.String statusOutput, + java.util.List<java.lang.String> result) + throws XenonException+
XenonException
public java.lang.String[] getJobs(java.lang.String... queueNames) + throws XenonException+
Scheduler
getJobs
in class Scheduler
queueNames
- the names of the queues.NotConnectedException
- If scheduler is closed.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get jobs.public QueueStatus getQueueStatus(java.lang.String queueName) + throws XenonException+
Scheduler
queue
.getQueueStatus
in class Scheduler
queueName
- the name of the queue.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get its status.public QueueStatus[] getQueueStatuses(java.lang.String... queueNames) + throws XenonException+
Scheduler
queues
.
+
+ Note that this method will only throw an exception when this exception will influence all status requests. For example, if the scheduler is no longer
+ connected.
+
+ Exceptions that only refer to a single queue are returned in the QueueStatus returned for that queue.getQueueStatuses
in class Scheduler
queueNames
- the names of the queues.XenonException
- If the Scheduler failed to get the statuses.public Streams submitInteractiveJob(JobDescription description) + throws XenonException+
Scheduler
submitInteractiveJob
in class Scheduler
description
- the description of the interactive job to submit.Streams
object containing the job identifier and the standard streams of a job.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public java.lang.String submitBatchJob(JobDescription description) + throws XenonException+
Scheduler
submitBatchJob
in class Scheduler
description
- the description of the batch job to submit.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public JobStatus cancelJob(java.lang.String jobIdentifier) + throws XenonException+
Scheduler
+ A status is returned that indicates the state of the job after the cancel. If the job was already done it cannot be cancelled. +
+
+ A JobStatus
is returned that can be used to determine the state of the job after cancelJob returns. Note that it may take some time before the
+ job has actually terminated. The waitUntilDone
method can be used to wait until the job is terminated.
+
cancelJob
in class Scheduler
jobIdentifier
- the identifier of job to kill.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getQstatInfo() + throws XenonException+
XenonException
private java.util.Map<java.lang.String,java.lang.String> getQacctInfo(java.lang.String jobIdentifier) + throws XenonException+
XenonException
private JobStatus getJobStatus(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> qstatInfo, + java.lang.String jobIdentifier) + throws XenonException+
qstatInfo
- the info to get the job status from.jobIdentifier
- the job to get the status for.XenonException
- in case the info is not valid.XenonException
- in case an additional command fails to run.public JobStatus getJobStatus(java.lang.String jobIdentifier) + throws XenonException+
Scheduler
getJobStatus
in class Scheduler
jobIdentifier
- the job identifier of the job to get the status for.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public JobStatus[] getJobStatuses(java.lang.String... jobs) + throws XenonException+
Scheduler
jobs
.
+
+ The array of JobStatus
contains one entry for each of the jobs
. The order of the elements in the returned
+ JobStatus
array corresponds to the order in which the jobs
are passed as parameters. If a job
is
+ null
, the corresponding entry in the JobStatus
array will also be null
. If the retrieval of the
+ JobStatus
fails for a job, the exception will be stored in the corresponding JobsStatus
entry.
+
getJobStatuses
in class Scheduler
jobs
- the job identifiers for which to retrieve the status.XenonException
- If an I/O error occurredpublic class GridEngineSchedulerAdaptor +extends ScriptingSchedulerAdaptor+
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ACCOUNTING_GRACE_TIME_PROPERTY
+Timeout for waiting for the accounting info of a job to appear
+ |
+
static java.lang.String |
+ADAPTOR_DESCRIPTION
+Human readable description of this adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by this adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+The name of this adaptor
+ |
+
static java.lang.String |
+IGNORE_VERSION_PROPERTY
+Should the grid engine version on the target machine be ignored ?
+ |
+
static java.lang.String |
+POLL_DELAY_PROPERTY
+Polling delay for jobs started by this adaptor.
+ |
+
static java.lang.String |
+PREFIX
+The prefix used by all properties related to this adaptor
+ |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+List of all properties supported by this adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
GridEngineSchedulerAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
Scheduler |
+createScheduler(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
getSupportedCredentials
isEmbedded, supportsBatch, supportsInteractive, usesFileSystem
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
public static final java.lang.String ADAPTOR_NAME+
public static final java.lang.String PREFIX+
public static final java.lang.String IGNORE_VERSION_PROPERTY+
public static final java.lang.String ACCOUNTING_GRACE_TIME_PROPERTY+
public static final java.lang.String POLL_DELAY_PROPERTY+
public static final java.lang.String ADAPTOR_DESCRIPTION+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
public GridEngineSchedulerAdaptor() + throws XenonException+
XenonException
public Scheduler createScheduler(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createScheduler
in class SchedulerAdaptor
XenonException
public class GridEngineSetup
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private static org.slf4j.Logger |
+LOGGER |
+
private java.util.Map<java.lang.String,ParallelEnvironmentInfo> |
+parallelEnvironments |
+
private java.lang.String[] |
+queueNames |
+
private java.util.Map<java.lang.String,QueueInfo> |
+queues |
+
Constructor and Description | +
---|
GridEngineSetup(GridEngineScheduler scheduler) |
+
GridEngineSetup(java.lang.String[] queueNames,
+ java.util.Map<java.lang.String,QueueInfo> queues,
+ java.util.Map<java.lang.String,ParallelEnvironmentInfo> parallelEnvironments)
+Testing constructor.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
protected int |
+calculateSlots(java.lang.String parallelEnvironmentName,
+ java.lang.String queueName,
+ int nodeCount) |
+
private static java.util.Map<java.lang.String,ParallelEnvironmentInfo> |
+getParallelEnvironments(GridEngineScheduler scheduler) |
+
java.lang.String[] |
+getQueueNames() |
+
private static java.lang.String[] |
+getQueueNames(GridEngineScheduler scheduler) |
+
private static java.util.Map<java.lang.String,QueueInfo> |
+getQueues(java.lang.String[] queueNames,
+ GridEngineScheduler scheduler) |
+
protected static java.lang.String[] |
+qconfPeDetailsArguments(java.lang.String[] parallelEnvironmentNames)
+generate arguments to list details of all parallel environments given
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final java.lang.String[] queueNames+
private final java.util.Map<java.lang.String,QueueInfo> queues+
private final java.util.Map<java.lang.String,ParallelEnvironmentInfo> parallelEnvironments+
public GridEngineSetup(GridEngineScheduler scheduler) + throws XenonException+
XenonException
GridEngineSetup(java.lang.String[] queueNames, + java.util.Map<java.lang.String,QueueInfo> queues, + java.util.Map<java.lang.String,ParallelEnvironmentInfo> parallelEnvironments)+
queueNames
- queue names to use.queues
- queues to use.parallelEnvironments
- parallel environments to use.protected static java.lang.String[] qconfPeDetailsArguments(java.lang.String[] parallelEnvironmentNames)+
parallelEnvironmentNames
- names of parallel environments to listprivate static java.lang.String[] getQueueNames(GridEngineScheduler scheduler) + throws XenonException+
XenonException
private static java.util.Map<java.lang.String,QueueInfo> getQueues(java.lang.String[] queueNames, + GridEngineScheduler scheduler) + throws XenonException+
XenonException
private static java.util.Map<java.lang.String,ParallelEnvironmentInfo> getParallelEnvironments(GridEngineScheduler scheduler) + throws XenonException+
XenonException
public java.lang.String[] getQueueNames()+
protected int calculateSlots(java.lang.String parallelEnvironmentName, + java.lang.String queueName, + int nodeCount) + throws XenonException+
XenonException
final class GridEngineUtils
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+JOB_OPTION_JOB_SCRIPT |
+
static java.lang.String |
+JOB_OPTION_PARALLEL_ENVIRONMENT |
+
static java.lang.String |
+JOB_OPTION_PARALLEL_SLOTS |
+
static java.lang.String |
+JOB_OPTION_RESOURCES |
+
private static org.slf4j.Logger |
+LOGGER |
+
private static int |
+MINUTES_PER_HOUR |
+
static java.lang.String |
+QACCT_HEADER |
+
private static java.lang.String[] |
+VALID_JOB_OPTIONS |
+
Modifier | +Constructor and Description | +
---|---|
private |
+GridEngineUtils() |
+
Modifier and Type | +Method and Description | +
---|---|
protected static java.lang.String |
+generate(JobDescription description,
+ Path fsEntryPath,
+ GridEngineSetup setup) |
+
protected static void |
+generateParallelEnvironmentSpecification(JobDescription description,
+ GridEngineSetup setup,
+ java.util.Formatter script) |
+
protected static void |
+generateParallelScriptContent(JobDescription description,
+ java.util.Formatter script) |
+
protected static void |
+generateSerialScriptContent(JobDescription description,
+ java.util.Formatter script) |
+
protected static JobStatus |
+getJobStatusFromQacctInfo(java.util.Map<java.lang.String,java.lang.String> info,
+ java.lang.String jobIdentifier) |
+
protected static JobStatus |
+getJobStatusFromQstatInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info,
+ java.lang.String jobIdentifier) |
+
protected static void |
+verifyJobDescription(JobDescription description) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
public static final java.lang.String JOB_OPTION_JOB_SCRIPT+
public static final java.lang.String JOB_OPTION_PARALLEL_ENVIRONMENT+
public static final java.lang.String JOB_OPTION_PARALLEL_SLOTS+
public static final java.lang.String JOB_OPTION_RESOURCES+
private static final java.lang.String[] VALID_JOB_OPTIONS+
public static final java.lang.String QACCT_HEADER+
private static final int MINUTES_PER_HOUR+
protected static void generateParallelEnvironmentSpecification(JobDescription description, + GridEngineSetup setup, + java.util.Formatter script) + throws XenonException+
XenonException
protected static void generateSerialScriptContent(JobDescription description, + java.util.Formatter script)+
protected static void generateParallelScriptContent(JobDescription description, + java.util.Formatter script)+
protected static java.lang.String generate(JobDescription description, + Path fsEntryPath, + GridEngineSetup setup) + throws XenonException+
XenonException
protected static void verifyJobDescription(JobDescription description) + throws XenonException+
XenonException
protected static JobStatus getJobStatusFromQacctInfo(java.util.Map<java.lang.String,java.lang.String> info, + java.lang.String jobIdentifier) + throws XenonException+
XenonException
protected static JobStatus getJobStatusFromQstatInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info, + java.lang.String jobIdentifier) + throws XenonException+
XenonException
public class GridEngineXmlParser
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private javax.xml.parsers.DocumentBuilder |
+documentBuilder |
+
private boolean |
+ignoreVersion |
+
private static org.slf4j.Logger |
+LOGGER |
+
private static java.lang.String |
+SGE62_SCHEMA_ATTRIBUTE |
+
private static java.lang.String |
+SGE62_SCHEMA_VALUE |
+
Constructor and Description | +
---|
GridEngineXmlParser(boolean ignoreVersion) |
+
Modifier and Type | +Method and Description | +
---|---|
private void |
+checkVersion(org.w3c.dom.Document document) |
+
private java.util.Map<java.lang.String,java.lang.String> |
+mapFromElement(org.w3c.dom.Element root) |
+
protected org.w3c.dom.Document |
+parseDocument(java.lang.String data) |
+
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+parseJobInfos(java.lang.String data)
+Parses job info from "qstat -xml"
+ |
+
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+parseQueueInfos(java.lang.String input)
+Parses queue info from "qstat -g c -xml"
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private static final java.lang.String SGE62_SCHEMA_ATTRIBUTE+
private static final java.lang.String SGE62_SCHEMA_VALUE+
private final javax.xml.parsers.DocumentBuilder documentBuilder+
private final boolean ignoreVersion+
GridEngineXmlParser(boolean ignoreVersion) + throws XenonException+
XenonException
private void checkVersion(org.w3c.dom.Document document) + throws IncompatibleVersionException+
IncompatibleVersionException
protected org.w3c.dom.Document parseDocument(java.lang.String data) + throws XenonException+
XenonException
private java.util.Map<java.lang.String,java.lang.String> mapFromElement(org.w3c.dom.Element root)+
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> parseQueueInfos(java.lang.String input) + throws XenonException+
input
- the stream to get the xml data fromXenonException
- if the file could not be parsedXenonException
- if the server version is not compatible with this adaptorprotected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> parseJobInfos(java.lang.String data) + throws XenonException+
data
- the stream to get the xml data fromXenonException
- if the file could not be parsedXenonException
- if the server version is not compatible with this adaptorpublic static enum ParallelEnvironmentInfo.AllocationRule +extends java.lang.Enum<ParallelEnvironmentInfo.AllocationRule>+
Enum Constant and Description | +
---|
FILL_UP |
+
INTEGER |
+
PE_SLOTS |
+
ROUND_ROBIN |
+
Modifier and Type | +Method and Description | +
---|---|
static ParallelEnvironmentInfo.AllocationRule |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static ParallelEnvironmentInfo.AllocationRule[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final ParallelEnvironmentInfo.AllocationRule INTEGER+
public static final ParallelEnvironmentInfo.AllocationRule PE_SLOTS+
public static final ParallelEnvironmentInfo.AllocationRule ROUND_ROBIN+
public static final ParallelEnvironmentInfo.AllocationRule FILL_UP+
public static ParallelEnvironmentInfo.AllocationRule[] values()+
+for (ParallelEnvironmentInfo.AllocationRule c : ParallelEnvironmentInfo.AllocationRule.values()) + System.out.println(c); +
public static ParallelEnvironmentInfo.AllocationRule valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullclass ParallelEnvironmentInfo
+extends java.lang.Object
+Modifier and Type | +Class and Description | +
---|---|
static class |
+ParallelEnvironmentInfo.AllocationRule |
+
Modifier and Type | +Field and Description | +
---|---|
private static java.lang.String |
+ALLOCATION_FILL_UP |
+
private static java.lang.String |
+ALLOCATION_PE_SLOTS |
+
private static java.lang.String |
+ALLOCATION_ROUND_ROBIN |
+
private ParallelEnvironmentInfo.AllocationRule |
+allocationRule |
+
private java.lang.String |
+name |
+
private int |
+ppn |
+
private int |
+slots |
+
Constructor and Description | +
---|
ParallelEnvironmentInfo(java.util.Map<java.lang.String,java.lang.String> info) |
+
ParallelEnvironmentInfo(java.lang.String name,
+ int slots,
+ ParallelEnvironmentInfo.AllocationRule allocationRule,
+ int ppn) |
+
Modifier and Type | +Method and Description | +
---|---|
ParallelEnvironmentInfo.AllocationRule |
+getAllocationRule() |
+
java.lang.String |
+getName() |
+
int |
+getPpn() |
+
int |
+getSlots() |
+
java.lang.String |
+toString() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final java.lang.String ALLOCATION_PE_SLOTS+
private static final java.lang.String ALLOCATION_ROUND_ROBIN+
private static final java.lang.String ALLOCATION_FILL_UP+
private final java.lang.String name+
private final int slots+
private final ParallelEnvironmentInfo.AllocationRule allocationRule+
private final int ppn+
ParallelEnvironmentInfo(java.util.Map<java.lang.String,java.lang.String> info) + throws XenonException+
XenonException
ParallelEnvironmentInfo(java.lang.String name, + int slots, + ParallelEnvironmentInfo.AllocationRule allocationRule, + int ppn)+
public java.lang.String getName()+
public int getSlots()+
public ParallelEnvironmentInfo.AllocationRule getAllocationRule()+
public int getPpn()+
public java.lang.String toString()+
toString
in class java.lang.Object
class QueueInfo
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+name |
+
private java.lang.String[] |
+parallelEnvironments |
+
private int |
+slots |
+
Constructor and Description | +
---|
QueueInfo(java.util.Map<java.lang.String,java.lang.String> info) |
+
QueueInfo(java.lang.String name,
+ int slots,
+ java.lang.String... parallelEnvironments)
+Testing constructor
+ |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getName() |
+
java.lang.String[] |
+getParallelEnvironments() |
+
int |
+getSlots() |
+
java.lang.String |
+toString() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private final java.lang.String name+
private final int slots+
private final java.lang.String[] parallelEnvironments+
QueueInfo(java.util.Map<java.lang.String,java.lang.String> info) + throws XenonException+
XenonException
QueueInfo(java.lang.String name, + int slots, + java.lang.String... parallelEnvironments)+
name
- name of the queueslots
- number of slotsparallelEnvironments
- parallel environment namespublic java.lang.String getName()+
public int getSlots()+
public java.lang.String[] getParallelEnvironments()+
public java.lang.String toString()+
toString
in class java.lang.Object
Class | +Description | +
---|---|
GridEngineScheduler | +
+ Interface to the GridEngine command line tools.
+ |
+
GridEngineSchedulerAdaptor | ++ |
GridEngineSetup | +
+ Holds some info on the specifics of the machine we are connected to, such as queues and parallel environments.
+ |
+
GridEngineUtils | +
+ Generator for GridEngine job script.
+ |
+
GridEngineXmlParser | +
+ Parses xml output from various grid engine command line tools.
+ |
+
ParallelEnvironmentInfo | +
+ Class that holds some info on parallel environments used in Grid Engine.
+ |
+
QueueInfo | +
+ Class that holds some info on queues used in Grid Engine.
+ |
+
Enum | +Description | +
---|---|
ParallelEnvironmentInfo.AllocationRule | ++ |
public class CommandNotFoundException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
CommandNotFoundException(java.lang.String adaptorName,
+ java.lang.String message) |
+
CommandNotFoundException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public CommandNotFoundException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public CommandNotFoundException(java.lang.String adaptorName, + java.lang.String message)+
public class CommandRunner
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private OutputReader |
+err |
+
private int |
+exitCode |
+
private static org.slf4j.Logger |
+LOGGER |
+
private OutputReader |
+out |
+
Constructor and Description | +
---|
CommandRunner(java.lang.String... command) |
+
CommandRunner(java.lang.String stdin,
+ java.io.File workingDir,
+ java.lang.String... command) |
+
Modifier and Type | +Method and Description | +
---|---|
private static java.lang.String |
+getExeFile(java.lang.String exe) |
+
int |
+getExitCode() |
+
java.lang.String |
+getStderr() |
+
java.lang.String |
+getStdout() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final int exitCode+
private final OutputReader out+
private final OutputReader err+
public CommandRunner(java.lang.String... command) + throws XenonException+
XenonException
public CommandRunner(java.lang.String stdin, + java.io.File workingDir, + java.lang.String... command) + throws CommandNotFoundException+
CommandNotFoundException
class LocalInteractiveProcess +extends java.lang.Object +implements InteractiveProcess+
InteractiveProcess
for local interactive processes.Modifier and Type | +Field and Description | +
---|---|
private boolean |
+done |
+
private int |
+exitCode |
+
private java.lang.Process |
+process |
+
private Streams |
+streams |
+
Constructor and Description | +
---|
LocalInteractiveProcess(JobDescription description,
+ java.lang.String workdir,
+ java.lang.String jobIdentifier) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+destroy()
+Destroy (stop) process.
+ |
+
int |
+getExitStatus() |
+
Streams |
+getStreams() |
+
boolean |
+isDone() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private final java.lang.Process process+
private int exitCode+
private boolean done+
private final Streams streams+
LocalInteractiveProcess(JobDescription description, + java.lang.String workdir, + java.lang.String jobIdentifier) + throws XenonException+
XenonException
public Streams getStreams()+
getStreams
in interface InteractiveProcess
public int getExitStatus()+
getExitStatus
in interface Process
public void destroy()+
public class LocalInteractiveProcessFactory +extends java.lang.Object +implements InteractiveProcessFactory+
Modifier and Type | +Field and Description | +
---|---|
private boolean |
+open |
+
Constructor and Description | +
---|
LocalInteractiveProcessFactory() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+close() |
+
InteractiveProcess |
+createInteractiveProcess(JobDescription description,
+ java.lang.String workdir,
+ java.lang.String jobIdentifier,
+ long timeoutInMillis) |
+
boolean |
+isOpen() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public LocalInteractiveProcessFactory()+
public InteractiveProcess createInteractiveProcess(JobDescription description, + java.lang.String workdir, + java.lang.String jobIdentifier, + long timeoutInMillis) + throws XenonException+
createInteractiveProcess
in interface InteractiveProcessFactory
XenonException
public void close() + throws XenonException+
close
in interface InteractiveProcessFactory
XenonException
public boolean isOpen() + throws XenonException+
isOpen
in interface InteractiveProcessFactory
XenonException
public class LocalSchedulerAdaptor +extends SchedulerAdaptor+
Jobs
adaptor for local job operations.Scheduler
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ADAPTOR_DESCRIPTION
+Description of the adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by the adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+Name of the local adaptor is defined in the engine.
+ |
+
static java.lang.String |
+INFO
+Local queue information start with this prefix.
+ |
+
static java.lang.String |
+JOBS
+Local job information start with this prefix.
+ |
+
static java.lang.String |
+MAX_HISTORY
+Property for maximum history length for finished jobs
+ |
+
static java.lang.String |
+MULTIQ
+Local multi queue properties start with this prefix.
+ |
+
static java.lang.String |
+MULTIQ_MAX_CONCURRENT
+Property for the maximum number of concurrent jobs in the multi queue.
+ |
+
static java.lang.String |
+POLLING_DELAY
+Property for maximum history length for finished jobs
+ |
+
static java.lang.String |
+PREFIX
+Local properties start with this prefix.
+ |
+
static java.lang.String |
+QUEUE
+Local queue properties start with this prefix.
+ |
+
static java.lang.String |
+SUBMITTED
+How many jobs have been submitted locally.
+ |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+The properties supported by this adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
LocalSchedulerAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
Scheduler |
+createScheduler(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
boolean |
+isEmbedded()
+Is this an embedded scheduler ?
+
+ Embedded schedulers are implemented inside the Xenon process itself.
+ |
+
boolean |
+supportsInteractive()
+Does this Scheduler supports the submission of interactive jobs ?
+
+ For interactive jobs the standard streams of the job must be handled by the submitting process.
+ |
+
supportsBatch, usesFileSystem
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
public static final java.lang.String ADAPTOR_NAME+
public static final java.lang.String PREFIX+
public static final java.lang.String ADAPTOR_DESCRIPTION+
public static final java.lang.String QUEUE+
public static final java.lang.String MAX_HISTORY+
public static final java.lang.String POLLING_DELAY+
public static final java.lang.String MULTIQ+
public static final java.lang.String MULTIQ_MAX_CONCURRENT+
public static final java.lang.String INFO+
public static final java.lang.String JOBS+
public static final java.lang.String SUBMITTED+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
public boolean isEmbedded()+
SchedulerAdaptorDescription
isEmbedded
in interface SchedulerAdaptorDescription
isEmbedded
in class SchedulerAdaptor
public boolean supportsInteractive()+
SchedulerAdaptorDescription
supportsInteractive
in interface SchedulerAdaptorDescription
supportsInteractive
in class SchedulerAdaptor
public java.lang.Class[] getSupportedCredentials()+
AdaptorDescription
public Scheduler createScheduler(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createScheduler
in class SchedulerAdaptor
XenonException
Class | +Description | +
---|---|
CommandRunner | +
+ Runs a command.
+ |
+
LocalInteractiveProcess | +
+ LocalInteractiveProcess implements a
+InteractiveProcess for local interactive processes. |
+
LocalInteractiveProcessFactory | ++ |
LocalSchedulerAdaptor | +
+ LocalFiles implements an Xenon
+Jobs adaptor for local job operations. |
+
Exception | +Description | +
---|---|
CommandNotFoundException | +
+ Signals that a command could not be found.
+ |
+
Interface | +Description | +
---|---|
InteractiveProcess | ++ |
InteractiveProcessFactory | ++ |
Process | ++ |
Class | +Description | +
---|---|
BatchProcess | +
+ BatchProcess wraps an
+InteractiveProcess to emulate a batch process. |
+
CommandLineUtils | +
+ Some simple utilities for handling and creating scripts and command lines.
+ |
+
Deadline | ++ |
JobExecutor | ++ |
JobQueueScheduler | ++ |
JobStatusImplementation | +
+ JobStatus contains status information for a specific job.
+ |
+
QueueStatusImplementation | +
+ QueueStatus contains status information for a specific queue.
+ |
+
RemoteCommandRunner | +
+ Runs a command.
+ |
+
SchedulerAdaptor | ++ |
ScriptingParser | ++ |
ScriptingScheduler | +
+ Connection to a remote scheduler, implemented by calling command line commands over a ssh connection.
+ |
+
ScriptingSchedulerAdaptor | ++ |
ScriptingUtils | ++ |
StreamsImplementation | +
+ Streams is a container for the standard input, output and error streams of a job.
+ |
+
Exception | +Description | +
---|---|
BadParameterException | +
+ Signals that a parameter has an invalid value.
+ |
+
IncompatibleVersionException | +
+ Signals that an adaptor is unable to connect to a resource due to version problems.
+ |
+
JobCanceledException | +
+ Signals that a jobs has been canceled by the user.
+ |
+
SchedulerClosedException | +
+ Signals that a unknown Copy handle was provided.
+ |
+
public class SlurmScheduler +extends ScriptingScheduler+
Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+defaultQueueName |
+
private static org.slf4j.Logger |
+LOGGER |
+
private java.lang.String[] |
+queueNames |
+
private SlurmSetup |
+setup |
+
pollDelay, subFileSystem, subScheduler
properties
Modifier | +Constructor and Description | +
---|---|
protected |
+SlurmScheduler(java.lang.String uniqueID,
+ java.lang.String location,
+ Credential credential,
+ XenonPropertyDescription[] valid,
+ java.util.Map<java.lang.String,java.lang.String> prop) |
+
Modifier and Type | +Method and Description | +
---|---|
JobStatus |
+cancelJob(java.lang.String jobIdentifier)
+Cancel a job.
+ |
+
private java.lang.String |
+findInteractiveJob(java.lang.String tag) |
+
private java.lang.String |
+findInteractiveJobInMap(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> queueInfo,
+ java.lang.String tag) |
+
java.lang.String |
+getDefaultQueueName()
+Get the name of the default queue.
+ |
+
java.lang.String[] |
+getJobs(java.lang.String... queueNames)
+Get all job identifier of jobs currently in (one ore more) queues.
+ |
+
JobStatus |
+getJobStatus(java.lang.String jobIdentifier)
+Get the status of a Job.
+ |
+
java.lang.String[] |
+getQueueNames()
+Get the queue names supported by this Scheduler.
+ |
+
QueueStatus |
+getQueueStatus(java.lang.String queueName)
+Get the status of the
+queue . |
+
QueueStatus[] |
+getQueueStatuses(java.lang.String... requestedQueueNames)
+Get the status of all
+queues . |
+
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+getSacctInfo(java.lang.String... jobs) |
+
private java.util.Map<java.lang.String,java.lang.String> |
+getSControlInfo(java.lang.String jobIdentifier) |
+
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+getSinfoInfo(java.lang.String... partitions) |
+
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+getSqueueInfo(java.lang.String... jobs) |
+
java.lang.String |
+submitBatchJob(JobDescription description)
+Submit a batch job.
+ |
+
Streams |
+submitInteractiveJob(JobDescription description)
+Submit an interactive job (optional operation).
+ |
+
protected void |
+translateError(RemoteCommandRunner runner,
+ java.lang.String stdin,
+ java.lang.String executable,
+ java.lang.String... arguments) |
+
checkQueue, checkQueueNames, checkWorkingDirectory, close, getFileSystem, getQueueStatuses, getWorkingDirectory, isOpen, runCheckedCommand, runCommand, sleep, startInteractiveCommand, waitUntilDone, waitUntilRunning
assertNonNullOrEmpty, assertPositive, create, create, create, create, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getJobStatuses, getLocation, getProperties, hashCode
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final java.lang.String[] queueNames+
private final java.lang.String defaultQueueName+
private final SlurmSetup setup+
protected SlurmScheduler(java.lang.String uniqueID, + java.lang.String location, + Credential credential, + XenonPropertyDescription[] valid, + java.util.Map<java.lang.String,java.lang.String> prop) + throws XenonException+
XenonException
public java.lang.String[] getQueueNames()+
Scheduler
getQueueNames
in class Scheduler
public java.lang.String getDefaultQueueName()+
Scheduler
getDefaultQueueName
in class Scheduler
null
if no default queue is available.protected void translateError(RemoteCommandRunner runner, + java.lang.String stdin, + java.lang.String executable, + java.lang.String... arguments) + throws XenonException+
translateError
in class ScriptingScheduler
XenonException
public java.lang.String submitBatchJob(JobDescription description) + throws XenonException+
Scheduler
submitBatchJob
in class Scheduler
description
- the description of the batch job to submit.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.private java.lang.String findInteractiveJobInMap(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> queueInfo, + java.lang.String tag)+
private java.lang.String findInteractiveJob(java.lang.String tag) + throws XenonException+
XenonException
public Streams submitInteractiveJob(JobDescription description) + throws XenonException+
Scheduler
submitInteractiveJob
in class Scheduler
description
- the description of the interactive job to submit.Streams
object containing the job identifier and the standard streams of a job.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public JobStatus cancelJob(java.lang.String jobIdentifier) + throws XenonException+
Scheduler
+ A status is returned that indicates the state of the job after the cancel. If the job was already done it cannot be cancelled. +
+
+ A JobStatus
is returned that can be used to determine the state of the job after cancelJob returns. Note that it may take some time before the
+ job has actually terminated. The waitUntilDone
method can be used to wait until the job is terminated.
+
cancelJob
in class Scheduler
jobIdentifier
- the identifier of job to kill.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public java.lang.String[] getJobs(java.lang.String... queueNames) + throws XenonException+
Scheduler
getJobs
in class Scheduler
queueNames
- the names of the queues.NotConnectedException
- If scheduler is closed.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get jobs.private java.util.Map<java.lang.String,java.lang.String> getSControlInfo(java.lang.String jobIdentifier) + throws XenonException+
XenonException
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getSqueueInfo(java.lang.String... jobs) + throws XenonException+
XenonException
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getSinfoInfo(java.lang.String... partitions) + throws XenonException+
XenonException
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getSacctInfo(java.lang.String... jobs) + throws XenonException+
XenonException
public JobStatus getJobStatus(java.lang.String jobIdentifier) + throws XenonException+
Scheduler
getJobStatus
in class Scheduler
jobIdentifier
- the job identifier of the job to get the status for.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public QueueStatus getQueueStatus(java.lang.String queueName) + throws XenonException+
Scheduler
queue
.getQueueStatus
in class Scheduler
queueName
- the name of the queue.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get its status.public QueueStatus[] getQueueStatuses(java.lang.String... requestedQueueNames) + throws XenonException+
Scheduler
queues
.
+
+ Note that this method will only throw an exception when this exception will influence all status requests. For example, if the scheduler is no longer
+ connected.
+
+ Exceptions that only refer to a single queue are returned in the QueueStatus returned for that queue.getQueueStatuses
in class Scheduler
requestedQueueNames
- the names of the queues.XenonException
- If the Scheduler failed to get the statuses.public class SlurmSchedulerAdaptor +extends ScriptingSchedulerAdaptor+
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ADAPTOR_DESCRIPTION
+Human readable description of this adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by this adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+The name of this adaptor
+ |
+
static java.lang.String |
+DISABLE_ACCOUNTING_USAGE
+Should the accounting usage be disabled?
+ |
+
static java.lang.String |
+POLL_DELAY_PROPERTY
+Polling delay for jobs started by this adaptor.
+ |
+
static java.lang.String |
+PREFIX
+The prefix used by all properties related to this adaptor
+ |
+
static long |
+SLURM_UPDATE_SLEEP |
+
static long |
+SLURM_UPDATE_TIMEOUT |
+
protected static java.lang.String[] |
+SUPPORTED_VERSIONS |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+List of all properties supported by this adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
SlurmSchedulerAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
Scheduler |
+createScheduler(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
boolean |
+supportsInteractive()
+Does this Scheduler supports the submission of interactive jobs ?
+
+ For interactive jobs the standard streams of the job must be handled by the submitting process.
+ |
+
getSupportedCredentials
isEmbedded, supportsBatch, usesFileSystem
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
public static final java.lang.String ADAPTOR_NAME+
public static final java.lang.String PREFIX+
public static final java.lang.String DISABLE_ACCOUNTING_USAGE+
public static final java.lang.String POLL_DELAY_PROPERTY+
public static final java.lang.String ADAPTOR_DESCRIPTION+
public static final long SLURM_UPDATE_TIMEOUT+
public static final long SLURM_UPDATE_SLEEP+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
protected static final java.lang.String[] SUPPORTED_VERSIONS+
public SlurmSchedulerAdaptor() + throws XenonException+
XenonException
public boolean supportsInteractive()+
SchedulerAdaptorDescription
supportsInteractive
in interface SchedulerAdaptorDescription
supportsInteractive
in class SchedulerAdaptor
public Scheduler createScheduler(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createScheduler
in class SchedulerAdaptor
XenonException
public class SlurmSetup
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private boolean |
+accountingAvailable |
+
private static org.slf4j.Logger |
+LOGGER |
+
private java.lang.String |
+version |
+
Constructor and Description | +
---|
SlurmSetup(java.util.Map<java.lang.String,java.lang.String> info,
+ boolean disableAccounting) |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+accountingAvailable() |
+
boolean |
+checkVersion() |
+
java.lang.String |
+version() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final boolean accountingAvailable+
private final java.lang.String version+
SlurmSetup(java.util.Map<java.lang.String,java.lang.String> info, + boolean disableAccounting) + throws XenonException+
XenonException
public final class SlurmUtils
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private static java.lang.String |
+DONE_STATE
+In completed state, the job has terminated and all processes have returned exit code 0.
+ |
+
private static java.lang.String[] |
+FAILED_STATES
+These are the states a job can be in when it has failed: FAILED: the job terminated with non-zero exit code or other failure condition.
+ |
+
static java.lang.String |
+JOB_OPTION_JOB_SCRIPT |
+
private static org.slf4j.Logger |
+LOGGER |
+
private static java.lang.String[] |
+PENDING_STATES
+These are the states a job can be in when it is pending:
+
+ PENDING: the job is awaiting resource allocation.
+ |
+
private static java.lang.String[] |
+RUNNING_STATES
+These are the states a job can be in when it is running:
+
+ CONFIGURING: the resources are available and being preparing to run the job (for example by booting).
+ |
+
private static java.lang.String[] |
+VALID_JOB_OPTIONS |
+
Modifier | +Constructor and Description | +
---|---|
private |
+SlurmUtils() |
+
Modifier and Type | +Method and Description | +
---|---|
protected static java.lang.Integer |
+exitcodeFromString(java.lang.String value) |
+
static java.lang.String |
+generate(JobDescription description,
+ Path fsEntryPath) |
+
static java.lang.String[] |
+generateInteractiveArguments(JobDescription description,
+ Path fsEntryPath,
+ java.util.UUID tag) |
+
protected static JobStatus |
+getJobStatusFromSacctInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info,
+ java.lang.String jobIdentifier) |
+
protected static JobStatus |
+getJobStatusFromScontrolInfo(java.util.Map<java.lang.String,java.lang.String> jobInfo,
+ java.lang.String jobIdentifier) |
+
protected static JobStatus |
+getJobStatusFromSqueueInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info,
+ java.lang.String jobIdentifier) |
+
protected static QueueStatus |
+getQueueStatusFromSInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info,
+ java.lang.String queueName,
+ Scheduler scheduler) |
+
private static java.lang.String |
+getWorkingDirPath(JobDescription description,
+ Path fsEntryPath) |
+
protected static java.lang.String |
+identifiersAsCSList(java.lang.String[] jobs) |
+
protected static boolean |
+isDoneOrFailedState(java.lang.String state)
+Is the given state a done or failed state ?
+ |
+
protected static boolean |
+isDoneState(java.lang.String state)
+Is the given state a done state ?
+ |
+
protected static boolean |
+isFailedState(java.lang.String state)
+Is the given state a failed state ?
+ |
+
protected static boolean |
+isPendingState(java.lang.String state)
+Is the given state a pending state ?
+ |
+
protected static boolean |
+isRunningState(java.lang.String state)
+Is the given state a running state ?
+ |
+
protected static void |
+verifyJobDescription(JobDescription description,
+ boolean interactive) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
public static final java.lang.String JOB_OPTION_JOB_SCRIPT+
private static final java.lang.String[] VALID_JOB_OPTIONS+
private static final java.lang.String[] FAILED_STATES+
private static final java.lang.String[] RUNNING_STATES+
private static final java.lang.String[] PENDING_STATES+
private static final java.lang.String DONE_STATE+
protected static java.lang.String identifiersAsCSList(java.lang.String[] jobs)+
protected static java.lang.Integer exitcodeFromString(java.lang.String value) + throws XenonException+
XenonException
protected static JobStatus getJobStatusFromSacctInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info, + java.lang.String jobIdentifier) + throws XenonException+
XenonException
protected static JobStatus getJobStatusFromScontrolInfo(java.util.Map<java.lang.String,java.lang.String> jobInfo, + java.lang.String jobIdentifier) + throws XenonException+
XenonException
protected static JobStatus getJobStatusFromSqueueInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info, + java.lang.String jobIdentifier) + throws XenonException+
XenonException
protected static QueueStatus getQueueStatusFromSInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info, + java.lang.String queueName, + Scheduler scheduler)+
protected static boolean isRunningState(java.lang.String state)+
state
- the state to checkprotected static boolean isPendingState(java.lang.String state)+
state
- the state to checkprotected static boolean isDoneOrFailedState(java.lang.String state)+
state
- the state to checkprotected static boolean isDoneState(java.lang.String state)+
state
- the state to checkprotected static boolean isFailedState(java.lang.String state)+
state
- the state to checkprotected static void verifyJobDescription(JobDescription description, + boolean interactive) + throws XenonException+
XenonException
private static java.lang.String getWorkingDirPath(JobDescription description, + Path fsEntryPath)+
public static java.lang.String[] generateInteractiveArguments(JobDescription description, + Path fsEntryPath, + java.util.UUID tag)+
public static java.lang.String generate(JobDescription description, + Path fsEntryPath)+
Class | +Description | +
---|---|
SlurmScheduler | +
+ Interface to the GridEngine command line tools.
+ |
+
SlurmSchedulerAdaptor | +
+ Adaptor for Slurm scheduler.
+ |
+
SlurmSetup | ++ |
SlurmUtils | ++ |
class SshInteractiveProcess +extends java.lang.Object +implements InteractiveProcess+
InteractiveProcess
for local batch processes.Modifier and Type | +Field and Description | +
---|---|
private org.apache.sshd.client.channel.ChannelExec |
+channel |
+
private boolean |
+done |
+
private static org.slf4j.Logger |
+LOGGER |
+
private org.apache.sshd.client.session.ClientSession |
+session |
+
private Streams |
+streams |
+
Constructor and Description | +
---|
SshInteractiveProcess(org.apache.sshd.client.session.ClientSession session,
+ JobDescription description,
+ java.lang.String jobIdentifier,
+ long timeoutInMillis) |
+
Modifier and Type | +Method and Description | +
---|---|
private static java.lang.String |
+buildCommand(JobDescription description) |
+
private void |
+cleanup() |
+
void |
+destroy() |
+
int |
+getExitStatus() |
+
Streams |
+getStreams() |
+
boolean |
+isDone() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final org.apache.sshd.client.session.ClientSession session+
private final org.apache.sshd.client.channel.ChannelExec channel+
private final Streams streams+
private boolean done+
SshInteractiveProcess(org.apache.sshd.client.session.ClientSession session, + JobDescription description, + java.lang.String jobIdentifier, + long timeoutInMillis) + throws XenonException+
XenonException
private static java.lang.String buildCommand(JobDescription description)+
public Streams getStreams()+
getStreams
in interface InteractiveProcess
private void cleanup()+
public int getExitStatus()+
getExitStatus
in interface Process
public class SshInteractiveProcessFactory +extends java.lang.Object +implements InteractiveProcessFactory+
Modifier and Type | +Field and Description | +
---|---|
private SSHConnection |
+connection |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+SshInteractiveProcessFactory(SSHConnection session) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+close() |
+
InteractiveProcess |
+createInteractiveProcess(JobDescription description,
+ java.lang.String workdir,
+ java.lang.String jobIdentifier,
+ long timeoutInMillis) |
+
boolean |
+isOpen() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private final SSHConnection connection+
protected SshInteractiveProcessFactory(SSHConnection session)+
public InteractiveProcess createInteractiveProcess(JobDescription description, + java.lang.String workdir, + java.lang.String jobIdentifier, + long timeoutInMillis) + throws XenonException+
createInteractiveProcess
in interface InteractiveProcessFactory
XenonException
public void close() + throws XenonException+
close
in interface InteractiveProcessFactory
XenonException
public boolean isOpen() + throws XenonException+
isOpen
in interface InteractiveProcessFactory
XenonException
public class SshSchedulerAdaptor +extends SchedulerAdaptor+
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ADAPTOR_DESCRIPTION
+A description of this adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by this adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+The name of this adaptor
+ |
+
static java.lang.String |
+AGENT
+Enable the use of an ssh-agent
+ |
+
static java.lang.String |
+AGENT_FORWARDING
+Enable the use of ssh-agent-forwarding
+ |
+
static java.lang.String |
+AUTOMATICALLY_ADD_HOST_KEY
+Enable strict host key checking.
+ |
+
static int |
+DEFAULT_PORT
+The default SSH port
+ |
+
static java.lang.String |
+GATEWAY
+Add gateway to access machine.
+ |
+
static java.lang.String |
+INFO
+Ssh adaptor information start with this prefix.
+ |
+
static java.lang.String |
+JOBS
+Ssh job information start with this prefix.
+ |
+
static java.lang.String |
+LOAD_SSH_CONFIG
+Load the OpenSSH config file by default.
+ |
+
static java.lang.String |
+LOAD_STANDARD_KNOWN_HOSTS
+Load the known_hosts file by default.
+ |
+
private static org.slf4j.Logger |
+LOGGER |
+
static java.lang.String |
+MAX_HISTORY
+Maximum history length for finished jobs
+ |
+
static java.lang.String |
+MULTIQ
+Local multi queue properties start with this prefix.
+ |
+
static java.lang.String |
+MULTIQ_MAX_CONCURRENT
+Property for the maximum number of concurrent jobs in the multi queue.
+ |
+
static java.lang.String |
+POLLING_DELAY
+Property for maximum history length for finished jobs
+ |
+
static java.lang.String |
+PREFIX
+All our own properties start with this prefix.
+ |
+
static java.lang.String |
+QUEUE
+All our own queue properties start with this prefix.
+ |
+
static java.lang.String |
+SSH_CONFIG_FILE
+OpenSSH config filename.
+ |
+
static java.lang.String |
+STRICT_HOST_KEY_CHECKING
+Enable strict host key checking.
+ |
+
static java.lang.String |
+SUBMITTED
+How many jobs have been submitted using this adaptor.
+ |
+
static java.lang.String |
+TIMEOUT
+Add gateway to access machine.
+ |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+List of properties supported by this SSH adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
SshSchedulerAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
Scheduler |
+createScheduler(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
boolean |
+isEmbedded()
+Is this an embedded scheduler ?
+
+ Embedded schedulers are implemented inside the Xenon process itself.
+ |
+
boolean |
+supportsInteractive()
+Does this Scheduler supports the submission of interactive jobs ?
+
+ For interactive jobs the standard streams of the job must be handled by the submitting process.
+ |
+
supportsBatch, usesFileSystem
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
private static final org.slf4j.Logger LOGGER+
public static final java.lang.String ADAPTOR_NAME+
public static final int DEFAULT_PORT+
public static final java.lang.String ADAPTOR_DESCRIPTION+
public static final java.lang.String PREFIX+
public static final java.lang.String STRICT_HOST_KEY_CHECKING+
public static final java.lang.String AGENT+
public static final java.lang.String AGENT_FORWARDING+
public static final java.lang.String LOAD_STANDARD_KNOWN_HOSTS+
public static final java.lang.String LOAD_SSH_CONFIG+
public static final java.lang.String SSH_CONFIG_FILE+
public static final java.lang.String AUTOMATICALLY_ADD_HOST_KEY+
public static final java.lang.String GATEWAY+
public static final java.lang.String TIMEOUT+
public static final java.lang.String QUEUE+
public static final java.lang.String MAX_HISTORY+
public static final java.lang.String POLLING_DELAY+
public static final java.lang.String MULTIQ+
public static final java.lang.String MULTIQ_MAX_CONCURRENT+
public static final java.lang.String INFO+
public static final java.lang.String JOBS+
public static final java.lang.String SUBMITTED+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
public boolean isEmbedded()+
SchedulerAdaptorDescription
isEmbedded
in interface SchedulerAdaptorDescription
isEmbedded
in class SchedulerAdaptor
public boolean supportsInteractive()+
SchedulerAdaptorDescription
supportsInteractive
in interface SchedulerAdaptorDescription
supportsInteractive
in class SchedulerAdaptor
public java.lang.Class[] getSupportedCredentials()+
AdaptorDescription
public Scheduler createScheduler(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createScheduler
in class SchedulerAdaptor
XenonException
Class | +Description | +
---|---|
SshInteractiveProcess | +
+ LocalBatchProcess implements a
+InteractiveProcess for local batch processes. |
+
SshInteractiveProcessFactory | ++ |
SshSchedulerAdaptor | ++ |
public class TorqueScheduler +extends ScriptingScheduler+
Modifier and Type | +Field and Description | +
---|---|
private long |
+accountingGraceTime |
+
private java.util.Set<java.lang.String> |
+deletedJobs |
+
private java.util.Map<java.lang.String,java.lang.Long> |
+lastSeenMap
+Map with the last seen time of jobs.
+ |
+
private static org.slf4j.Logger |
+LOGGER |
+
private TorqueXmlParser |
+parser |
+
private java.lang.String[] |
+queueNames |
+
pollDelay, subFileSystem, subScheduler
properties
Constructor and Description | +
---|
TorqueScheduler(java.lang.String uniqueID,
+ java.lang.String location,
+ Credential credential,
+ XenonPropertyDescription[] valid,
+ java.util.Map<java.lang.String,java.lang.String> prop) |
+
Modifier and Type | +Method and Description | +
---|---|
private void |
+addDeletedJob(java.lang.String jobIdentifier) |
+
JobStatus |
+cancelJob(java.lang.String jobIdentifier)
+Cancel a job.
+ |
+
java.lang.String |
+getDefaultQueueName()
+Get the name of the default queue.
+ |
+
java.lang.String[] |
+getJobs(java.lang.String... queueNames)
+Get all job identifier of jobs currently in (one ore more) queues.
+ |
+
private JobStatus |
+getJobStatus(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> qstatInfo,
+ java.lang.String job)
+Get job status.
+ |
+
JobStatus |
+getJobStatus(java.lang.String jobIdentifier)
+Get the status of a Job.
+ |
+
JobStatus[] |
+getJobStatuses(java.lang.String... jobs)
+Get the status of all specified
+jobs . |
+
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+getQstatInfo() |
+
java.lang.String[] |
+getQueueNames()
+Get the queue names supported by this Scheduler.
+ |
+
QueueStatus |
+getQueueStatus(java.lang.String queueName)
+Get the status of the
+queue . |
+
QueueStatus[] |
+getQueueStatuses(java.lang.String... queueNames)
+Get the status of all
+queues . |
+
private boolean |
+haveRecentlySeen(java.lang.String identifier) |
+
private void |
+jobsFromStatus(java.lang.String statusOutput,
+ java.util.List<java.lang.String> result) |
+
private boolean |
+jobWasDeleted(java.lang.String jobIdentifier) |
+
private java.lang.String[] |
+queryQueueNames() |
+
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+queryQueues(java.lang.String... queueNames) |
+
java.lang.String |
+submitBatchJob(JobDescription description)
+Submit a batch job.
+ |
+
Streams |
+submitInteractiveJob(JobDescription description)
+Submit an interactive job (optional operation).
+ |
+
private void |
+updateJobsSeenMap(java.util.Set<java.lang.String> identifiers) |
+
checkQueue, checkQueueNames, checkWorkingDirectory, close, getFileSystem, getQueueStatuses, getWorkingDirectory, isOpen, runCheckedCommand, runCommand, sleep, startInteractiveCommand, translateError, waitUntilDone, waitUntilRunning
assertNonNullOrEmpty, assertPositive, create, create, create, create, equals, getAdaptorDescription, getAdaptorDescriptions, getAdaptorName, getAdaptorNames, getCredential, getLocation, getProperties, hashCode
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final long accountingGraceTime+
private final java.util.Map<java.lang.String,java.lang.Long> lastSeenMap+
private final java.util.Set<java.lang.String> deletedJobs+
private final TorqueXmlParser parser+
private final java.lang.String[] queueNames+
TorqueScheduler(java.lang.String uniqueID, + java.lang.String location, + Credential credential, + XenonPropertyDescription[] valid, + java.util.Map<java.lang.String,java.lang.String> prop) + throws XenonException+
XenonException
private java.lang.String[] queryQueueNames() + throws XenonException+
XenonException
public java.lang.String[] getQueueNames()+
Scheduler
getQueueNames
in class Scheduler
public java.lang.String getDefaultQueueName()+
Scheduler
getDefaultQueueName
in class Scheduler
null
if no default queue is available.private void updateJobsSeenMap(java.util.Set<java.lang.String> identifiers)+
private boolean haveRecentlySeen(java.lang.String identifier)+
private void addDeletedJob(java.lang.String jobIdentifier)+
private boolean jobWasDeleted(java.lang.String jobIdentifier)+
private void jobsFromStatus(java.lang.String statusOutput, + java.util.List<java.lang.String> result) + throws XenonException+
XenonException
public java.lang.String[] getJobs(java.lang.String... queueNames) + throws XenonException+
Scheduler
getJobs
in class Scheduler
queueNames
- the names of the queues.NotConnectedException
- If scheduler is closed.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get jobs.public QueueStatus getQueueStatus(java.lang.String queueName) + throws XenonException+
Scheduler
queue
.getQueueStatus
in class Scheduler
queueName
- the name of the queue.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get its status.public QueueStatus[] getQueueStatuses(java.lang.String... queueNames) + throws XenonException+
Scheduler
queues
.
+
+ Note that this method will only throw an exception when this exception will influence all status requests. For example, if the scheduler is no longer
+ connected.
+
+ Exceptions that only refer to a single queue are returned in the QueueStatus returned for that queue.getQueueStatuses
in class Scheduler
queueNames
- the names of the queues.XenonException
- If the Scheduler failed to get the statuses.protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> queryQueues(java.lang.String... queueNames) + throws XenonException+
XenonException
public java.lang.String submitBatchJob(JobDescription description) + throws XenonException+
Scheduler
submitBatchJob
in class Scheduler
description
- the description of the batch job to submit.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public Streams submitInteractiveJob(JobDescription description) + throws XenonException+
Scheduler
submitInteractiveJob
in class Scheduler
description
- the description of the interactive job to submit.Streams
object containing the job identifier and the standard streams of a job.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public JobStatus cancelJob(java.lang.String jobIdentifier) + throws XenonException+
Scheduler
+ A status is returned that indicates the state of the job after the cancel. If the job was already done it cannot be cancelled. +
+
+ A JobStatus
is returned that can be used to determine the state of the job after cancelJob returns. Note that it may take some time before the
+ job has actually terminated. The waitUntilDone
method can be used to wait until the job is terminated.
+
cancelJob
in class Scheduler
jobIdentifier
- the identifier of job to kill.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> getQstatInfo() + throws XenonException+
XenonException
private JobStatus getJobStatus(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> qstatInfo, + java.lang.String job) + throws XenonException+
qstatInfo
- the info to get the job status from.job
- the job to get the status for.XenonException
- in case the info is not valid.XenonException
- in case an additional command fails to run.public JobStatus getJobStatus(java.lang.String jobIdentifier) + throws XenonException+
Scheduler
getJobStatus
in class Scheduler
jobIdentifier
- the job identifier of the job to get the status for.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public JobStatus[] getJobStatuses(java.lang.String... jobs) + throws XenonException+
Scheduler
jobs
.
+
+ The array of JobStatus
contains one entry for each of the jobs
. The order of the elements in the returned
+ JobStatus
array corresponds to the order in which the jobs
are passed as parameters. If a job
is
+ null
, the corresponding entry in the JobStatus
array will also be null
. If the retrieval of the
+ JobStatus
fails for a job, the exception will be stored in the corresponding JobsStatus
entry.
+
getJobStatuses
in class Scheduler
jobs
- the job identifiers for which to retrieve the status.XenonException
- If an I/O error occurredpublic class TorqueSchedulerAdaptor +extends ScriptingSchedulerAdaptor+
Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+ACCOUNTING_GRACE_TIME_PROPERTY
+Timeout for waiting for the accounting info of a job to appear
+ |
+
static java.lang.String |
+ADAPTOR_DESCRIPTION
+Human readable description of this adaptor
+ |
+
private static java.lang.String[] |
+ADAPTOR_LOCATIONS
+The locations supported by this adaptor
+ |
+
static java.lang.String |
+ADAPTOR_NAME
+The name of this adaptor
+ |
+
static java.lang.String |
+IGNORE_VERSION_PROPERTY
+Should the grid engine version on the target machine be ignored ?
+ |
+
static java.lang.String |
+POLL_DELAY_PROPERTY
+Polling delay for jobs started by this adaptor.
+ |
+
static java.lang.String |
+PREFIX
+The prefix used by all properties related to this adaptor
+ |
+
private static XenonPropertyDescription[] |
+VALID_PROPERTIES
+List of all properties supported by this adaptor
+ |
+
ADAPTORS_PREFIX
Constructor and Description | +
---|
TorqueSchedulerAdaptor() |
+
Modifier and Type | +Method and Description | +
---|---|
Scheduler |
+createScheduler(java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties) |
+
getSupportedCredentials
isEmbedded, supportsBatch, supportsInteractive, usesFileSystem
getDescription, getName, getNewUniqueID, getSupportedLocations, getSupportedProperties
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDescription, getName, getSupportedLocations, getSupportedProperties
public static final java.lang.String ADAPTOR_NAME+
public static final java.lang.String PREFIX+
public static final java.lang.String IGNORE_VERSION_PROPERTY+
public static final java.lang.String ACCOUNTING_GRACE_TIME_PROPERTY+
public static final java.lang.String POLL_DELAY_PROPERTY+
public static final java.lang.String ADAPTOR_DESCRIPTION+
private static final java.lang.String[] ADAPTOR_LOCATIONS+
private static final XenonPropertyDescription[] VALID_PROPERTIES+
public TorqueSchedulerAdaptor() + throws XenonException+
XenonException
public Scheduler createScheduler(java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
createScheduler
in class SchedulerAdaptor
XenonException
final class TorqueUtils
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
static java.lang.String |
+JOB_OPTION_JOB_CONTENTS |
+
static java.lang.String |
+JOB_OPTION_JOB_SCRIPT |
+
static java.lang.String |
+JOB_OPTION_RESOURCES |
+
private static org.slf4j.Logger |
+LOGGER |
+
private static int |
+MINUTES_PER_HOUR |
+
static java.util.regex.Pattern |
+QUEUE_INFO_NAME |
+
private static java.lang.String[] |
+VALID_JOB_OPTIONS |
+
Modifier | +Constructor and Description | +
---|---|
private |
+TorqueUtils() |
+
Modifier and Type | +Method and Description | +
---|---|
static java.lang.String |
+generate(JobDescription description,
+ Path workdir) |
+
static void |
+generateScriptContent(JobDescription description,
+ java.util.Formatter script) |
+
protected static JobStatus |
+getJobStatusFromQstatInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info,
+ java.lang.String jobIdentifier) |
+
static void |
+verifyJobDescription(JobDescription description) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private static final int MINUTES_PER_HOUR+
public static final java.util.regex.Pattern QUEUE_INFO_NAME+
public static final java.lang.String JOB_OPTION_JOB_SCRIPT+
public static final java.lang.String JOB_OPTION_JOB_CONTENTS+
public static final java.lang.String JOB_OPTION_RESOURCES+
private static final java.lang.String[] VALID_JOB_OPTIONS+
public static void verifyJobDescription(JobDescription description) + throws XenonException+
XenonException
protected static JobStatus getJobStatusFromQstatInfo(java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> info, + java.lang.String jobIdentifier) + throws XenonException+
XenonException
public static void generateScriptContent(JobDescription description, + java.util.Formatter script)+
public static java.lang.String generate(JobDescription description, + Path workdir)+
final class TorqueXmlParser
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private javax.xml.parsers.DocumentBuilder |
+documentBuilder |
+
private static org.slf4j.Logger |
+LOGGER |
+
Constructor and Description | +
---|
TorqueXmlParser() |
+
Modifier and Type | +Method and Description | +
---|---|
protected org.w3c.dom.Document |
+parseDocument(java.lang.String data) |
+
protected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
+parseJobInfos(java.lang.String data)
+Parses job info from "qstat -x"
+ |
+
protected void |
+recursiveMapFromElement(org.w3c.dom.Node root,
+ java.util.Map<java.lang.String,java.lang.String> result)
+Create a Map from the tag names and text values of child nodes.
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final javax.xml.parsers.DocumentBuilder documentBuilder+
TorqueXmlParser() + throws XenonException+
XenonException
protected org.w3c.dom.Document parseDocument(java.lang.String data) + throws XenonException+
XenonException
protected void recursiveMapFromElement(org.w3c.dom.Node root, + java.util.Map<java.lang.String,java.lang.String> result)+
root
- XML element of which the children will be added to the mapresult
- a mutable map that will have added to it tag names as keys and text values as valuesjava.lang.IllegalArgumentException
- if root is not an XML elementprotected java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> parseJobInfos(java.lang.String data) + throws XenonException+
data
- the stream to get the xml data fromXenonException
- if the file could not be parsedXenonException
- if the server version is not compatible with this adaptorClass | +Description | +
---|---|
TorqueScheduler | +
+ Interface to the TORQUE command line tools.
+ |
+
TorqueSchedulerAdaptor | +
+ Adaptor for TORQUE batch system.
+ |
+
TorqueUtils | +
+ Generator for GridEngine job script.
+ |
+
TorqueXmlParser | +
+ Parses xml output from TORQUE batch system.
+ |
+
public class CertificateNotFoundException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
CertificateNotFoundException(java.lang.String adaptorName,
+ java.lang.String message) |
+
CertificateNotFoundException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public CertificateNotFoundException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public CertificateNotFoundException(java.lang.String adaptorName, + java.lang.String message)+
public class CredentialNotFoundException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
CredentialNotFoundException(java.lang.String adaptorName,
+ java.lang.String message) |
+
CredentialNotFoundException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public CredentialNotFoundException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public CredentialNotFoundException(java.lang.String adaptorName, + java.lang.String message)+
public class SSHConnection
+extends java.lang.Object
+implements java.lang.AutoCloseable
+Modifier and Type | +Field and Description | +
---|---|
private boolean |
+closed |
+
private int |
+hops |
+
private org.apache.sshd.client.session.ClientSession |
+session |
+
private org.apache.sshd.client.session.ClientSession[] |
+sessions |
+
private SSHUtil.Tunnel[] |
+tunnels |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+SSHConnection(int hops) |
+
Modifier and Type | +Method and Description | +
---|---|
protected void |
+addHop(int hop,
+ org.apache.sshd.client.session.ClientSession session,
+ SSHUtil.Tunnel tunnel) |
+
void |
+close() |
+
org.apache.sshd.client.subsystem.sftp.SftpClient |
+createSftpClient() |
+
org.apache.sshd.client.session.ClientSession |
+getSession() |
+
boolean |
+isClosed() |
+
boolean |
+isOpen() |
+
protected void |
+setSession(org.apache.sshd.client.session.ClientSession session) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private org.apache.sshd.client.session.ClientSession[] sessions+
private SSHUtil.Tunnel[] tunnels+
private final int hops+
private boolean closed+
private org.apache.sshd.client.session.ClientSession session+
protected void addHop(int hop, + org.apache.sshd.client.session.ClientSession session, + SSHUtil.Tunnel tunnel)+
protected void setSession(org.apache.sshd.client.session.ClientSession session)+
public org.apache.sshd.client.subsystem.sftp.SftpClient createSftpClient() + throws java.io.IOException+
java.io.IOException
public org.apache.sshd.client.session.ClientSession getSession()+
public boolean isClosed()+
public boolean isOpen()+
public void close()+
close
in interface java.lang.AutoCloseable
static class SSHUtil.PasswordProvider
+extends java.lang.Object
+implements org.apache.sshd.common.config.keys.FilePasswordProvider
+Modifier and Type | +Field and Description | +
---|---|
private char[] |
+password |
+
EMPTY
Constructor and Description | +
---|
PasswordProvider(char[] password) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getPassword(java.lang.String resourceKey) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
of
static class SSHUtil.Tunnel
+extends java.lang.Thread
+java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
Modifier and Type | +Field and Description | +
---|---|
private int |
+bufferSize |
+
private org.apache.sshd.client.channel.ChannelDirectTcpip |
+channel |
+
private java.lang.Exception |
+ex |
+
private java.net.ServerSocket |
+server |
+
private java.net.Socket |
+socket |
+
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description | +
---|
Tunnel(java.net.ServerSocket ss,
+ org.apache.sshd.client.channel.ChannelDirectTcpip tmp,
+ int bufferSize) |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+close() |
+
private void |
+closeServer() |
+
java.lang.Exception |
+getException() |
+
void |
+run() |
+
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private final java.net.ServerSocket server+
private final org.apache.sshd.client.channel.ChannelDirectTcpip channel+
private final int bufferSize+
private java.net.Socket socket+
private java.lang.Exception ex+
Tunnel(java.net.ServerSocket ss, + org.apache.sshd.client.channel.ChannelDirectTcpip tmp, + int bufferSize)+
public java.lang.Exception getException()+
public void close()+
private void closeServer()+
public void run()+
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public class SSHUtil
+extends java.lang.Object
+Modifier and Type | +Class and Description | +
---|---|
(package private) static class |
+SSHUtil.PasswordProvider |
+
(package private) static class |
+SSHUtil.Tunnel |
+
Modifier and Type | +Field and Description | +
---|---|
static int |
+DEFAULT_SSH_PORT |
+
private static org.slf4j.Logger |
+LOGGER |
+
private static java.lang.String |
+VIA_TAG |
+
Constructor and Description | +
---|
SSHUtil()
+This constructor is only needed for testing.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static SSHConnection |
+connect(java.lang.String adaptorName,
+ org.apache.sshd.client.SshClient client,
+ java.lang.String location,
+ Credential credential,
+ int bufferSize,
+ long timeout)
+Connect an existing
+SshClient to the server at location and authenticate using the given credential . |
+
private static org.apache.sshd.client.session.ClientSession |
+connectAndAuthenticate(java.lang.String adaptorName,
+ org.apache.sshd.client.SshClient client,
+ java.lang.String host,
+ int port,
+ UserCredential credential,
+ long timeout) |
+
static org.apache.sshd.client.SshClient |
+createSSHClient()
+Create a new
+SshClient with a default configuration similar to a stand-alone SSH client. |
+
static org.apache.sshd.client.SshClient |
+createSSHClient(boolean useKnownHosts,
+ boolean loadSSHConfig,
+ boolean stricHostCheck,
+ boolean useSSHAgent,
+ boolean useAgentForwarding)
+Create a new
+SshClient with the desired configuration. |
+
static UserCredential |
+extractCredential(org.apache.sshd.common.util.net.SshdSocketAddress location,
+ Credential credential) |
+
static UserCredential[] |
+extractCredentials(java.lang.String adaptorName,
+ org.apache.sshd.common.util.net.SshdSocketAddress[] locations,
+ Credential credentials) |
+
static org.apache.sshd.common.util.net.SshdSocketAddress[] |
+extractLocations(java.lang.String adaptorName,
+ java.lang.String location)
+Extract a series of locations from a location string.
+ |
+
private static org.apache.sshd.common.util.net.SshdSocketAddress |
+extractSocketAddress(java.lang.String adaptorName,
+ java.lang.String location) |
+
static java.lang.String |
+getHost(java.lang.String adaptorName,
+ java.lang.String location) |
+
static int |
+getPort(java.lang.String adaptorName,
+ java.lang.String location) |
+
static java.util.Map<java.lang.String,java.lang.String> |
+translateProperties(java.util.Map<java.lang.String,java.lang.String> providedProperties,
+ java.lang.String orginalPrefix,
+ XenonPropertyDescription[] supportedProperties,
+ java.lang.String newPrefix) |
+
static java.lang.String |
+validateHost(java.lang.String adaptorName,
+ java.lang.String host)
+Weak validation of a host string containing either a hostame of IP adres.
+ |
+
static java.util.Set<java.lang.String> |
+validProperties(XenonPropertyDescription[] properties) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private static final java.lang.String VIA_TAG+
public static final int DEFAULT_SSH_PORT+
public SSHUtil()+
public static org.apache.sshd.client.SshClient createSSHClient()+
SshClient
with a default configuration similar to a stand-alone SSH client.
+ + The default configuration loads the SSH known_hosts and config file and uses strict host key checking. +
SshClient
public static org.apache.sshd.client.SshClient createSSHClient(boolean useKnownHosts, + boolean loadSSHConfig, + boolean stricHostCheck, + boolean useSSHAgent, + boolean useAgentForwarding)+
SshClient
with the desired configuration.
+
+ SSH clients have a significant number of options. This method will create a SshClient
providing the most important settings.
+
useKnownHosts
- Load the SSH known_hosts file from the default location (for OpenSSH this is typically found in $HOME/.ssh/known_hosts).loadSSHConfig
- Load the SSH config file from the default location (for OpenSSH this is typically found in $HOME/.ssh/config).stricHostCheck
- Perform a strict host key check. When setting up a connection, the key presented by the server is compared to the default known_hosts file
+ (for OpenSSH this is typically found in $HOME/.ssh/known_hosts).useSSHAgent
- When setting up a connection, handoff authentication to a separate SSH agent process.useAgentForwarding
- Support agent forwarding, allowing remote SSH servers to use the local SSH agent process to authenticate connections to other servers.SshClient
public static java.lang.String validateHost(java.lang.String adaptorName, + java.lang.String host) + throws InvalidLocationException+
adaptorName
- the name of the adaptor using this method.host
- the hostname to validatehost
if the validation succeeded.InvalidLocationException
- if the validation failedpublic static java.lang.String getHost(java.lang.String adaptorName, + java.lang.String location) + throws InvalidLocationException+
InvalidLocationException
public static int getPort(java.lang.String adaptorName, + java.lang.String location) + throws InvalidLocationException+
InvalidLocationException
public static UserCredential extractCredential(org.apache.sshd.common.util.net.SshdSocketAddress location, + Credential credential)+
public static UserCredential[] extractCredentials(java.lang.String adaptorName, + org.apache.sshd.common.util.net.SshdSocketAddress[] locations, + Credential credentials) + throws CredentialNotFoundException+
CredentialNotFoundException
public static org.apache.sshd.common.util.net.SshdSocketAddress[] extractLocations(java.lang.String adaptorName, + java.lang.String location) + throws InvalidLocationException+
+ "host[:port][/workdir] [via:otherhost[:port]]*" +
+ The locations will be returned in connection setup order, which is the reverse order in which they are listed in the location string.adaptorName
- the adaptor calling this method (used in exceptions).location
- the location to parseInvalidLocationException
- if the provided location is could not be parsed.private static org.apache.sshd.common.util.net.SshdSocketAddress extractSocketAddress(java.lang.String adaptorName, + java.lang.String location) + throws InvalidLocationException+
InvalidLocationException
private static org.apache.sshd.client.session.ClientSession connectAndAuthenticate(java.lang.String adaptorName, + org.apache.sshd.client.SshClient client, + java.lang.String host, + int port, + UserCredential credential, + long timeout) + throws XenonException+
XenonException
public static SSHConnection connect(java.lang.String adaptorName, + org.apache.sshd.client.SshClient client, + java.lang.String location, + Credential credential, + int bufferSize, + long timeout) + throws XenonException+
SshClient
to the server at location
and authenticate using the given credential
.adaptorName
- the adaptor where this method was called from.client
- the client to connect.location
- the server to connect tocredential
- the credential to authenticate with.bufferSize
- the buffer size used for the (optional) SSH tunnels.timeout
- the timeout to use in connection setup (in milliseconds).ClientSession
XenonException
- if the connection setup or authentication failed.public static java.util.Map<java.lang.String,java.lang.String> translateProperties(java.util.Map<java.lang.String,java.lang.String> providedProperties, + java.lang.String orginalPrefix, + XenonPropertyDescription[] supportedProperties, + java.lang.String newPrefix)+
public static java.util.Set<java.lang.String> validProperties(XenonPropertyDescription[] properties)+
Class | +Description | +
---|---|
SSHConnection | ++ |
SSHUtil | ++ |
SSHUtil.PasswordProvider | ++ |
SSHUtil.Tunnel | ++ |
Exception | +Description | +
---|---|
CertificateNotFoundException | +
+ Signals that a certificate file could not be found.
+ |
+
CredentialNotFoundException | +
+ Signals that a credential could not be found.
+ |
+
public class CertificateCredential +extends PasswordCredential+
Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+certfile
+This member variables holds the URI of the file containing the certificate.
+ |
+
Constructor and Description | +
---|
CertificateCredential(java.lang.String username,
+ java.lang.String certfile,
+ char[] passphrase)
+Constructs a
+CertificateCredential out of a username, a certificate file containing a private key, and an optional passphrase. |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
java.lang.String |
+getCertificateFile()
+Returns the certificate file.
+ |
+
int |
+hashCode() |
+
java.lang.String |
+toString() |
+
getPassword, getUsername
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private java.lang.String certfile+
public CertificateCredential(java.lang.String username, + java.lang.String certfile, + char[] passphrase)+
CertificateCredential
out of a username, a certificate file containing a private key, and an optional passphrase.username
- the username for this certificatecertfile
- the certification filepassphrase
- the optional passphrase needed to decrypt for this certificatepublic java.lang.String getCertificateFile()+
public java.lang.String toString()+
toString
in class PasswordCredential
public boolean equals(java.lang.Object o)+
equals
in class PasswordCredential
public int hashCode()+
hashCode
in class PasswordCredential
public interface Credential
+public class CredentialMap +extends java.lang.Object +implements Credential+
Credential
consisting of a collection of Credentials each uniquely identified by a String (typically a host name or host alias).
+
+ A default Credential can be set that will be returned if by get
if a key is not found.Modifier and Type | +Field and Description | +
---|---|
private UserCredential |
+defaultCredential |
+
private java.util.HashMap<java.lang.String,UserCredential> |
+map |
+
Constructor and Description | +
---|
CredentialMap()
+Create a new CredentialMap using
+null as the default credential. |
+
CredentialMap(UserCredential defaultCredential)
+Creates a new
+CredentialMap and set the default credential to defaultCredential . |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+containsCredential(java.lang.String key)
+Check if the
+key is stored in this CredentialMap. |
+
boolean |
+equals(java.lang.Object obj) |
+
UserCredential |
+get(java.lang.String key)
+Retrieve the
+UserCredential stored using the key . |
+
UserCredential |
+getDefault()
+Returns the default
+UserCredential . |
+
int |
+hashCode() |
+
java.util.Set<java.lang.String> |
+keySet()
+Returns a
+Set view of the keys contained in this map. |
+
UserCredential |
+put(java.lang.String key,
+ UserCredential credential)
+Add a
+Credential to the CredentialMap using key as a unique key. |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private final java.util.HashMap<java.lang.String,UserCredential> map+
private UserCredential defaultCredential+
public CredentialMap()+
null
as the default credential.public CredentialMap(UserCredential defaultCredential)+
CredentialMap
and set the default credential to defaultCredential
.defaultCredential
- the default credential to return by get
if a key is not found.public UserCredential put(java.lang.String key, + UserCredential credential)+
Credential
to the CredentialMap using key
as a unique key.
+
+ If the key
already exists in the CredentialMap, the stored UserCredential
will be replaced by credential
.key
- the unique key used to store the credential.credential
- the UserCredential to store.UserCredential
previously stored using the key
or null
if the key was not used before.public boolean containsCredential(java.lang.String key)+
key
is stored in this CredentialMap.key
- the key to check.key
is stored in this CredentialMappublic UserCredential get(java.lang.String key)+
UserCredential
stored using the key
.
+
+ If the key is not found in the map, the default credential is returned (if provided when the CredentialMap was created) or null
if no
+ default is set.key
- the key of the UserCredential
to retrieve.UserCredential
stored using key
or the default credential if the key is not found.public java.util.Set<java.lang.String> keySet()+
Set
view of the keys contained in this map.public UserCredential getDefault()+
UserCredential
.get
if a key is not found.public int hashCode()+
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public class DefaultCredential +extends java.lang.Object +implements UserCredential+
Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+username |
+
Constructor and Description | +
---|
DefaultCredential() |
+
DefaultCredential(java.lang.String username) |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
java.lang.String |
+getUsername()
+Returns the user name associated with this credential.
+ |
+
int |
+hashCode() |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
public DefaultCredential()+
public DefaultCredential(java.lang.String username)+
public java.lang.String getUsername()+
UserCredential
getUsername
in interface UserCredential
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public class KeytabCredential +extends java.lang.Object +implements UserCredential+
Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+keytabFile |
+
private java.lang.String |
+username |
+
Constructor and Description | +
---|
KeytabCredential(java.lang.String username,
+ java.lang.String keytabFile) |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
java.lang.String |
+getKeytabFile() |
+
java.lang.String |
+getUsername()
+Returns the user name associated with this credential.
+ |
+
int |
+hashCode() |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private final java.lang.String username+
private final java.lang.String keytabFile+
public KeytabCredential(java.lang.String username, + java.lang.String keytabFile)+
public java.lang.String getUsername()+
UserCredential
getUsername
in interface UserCredential
public java.lang.String getKeytabFile()+
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public class PasswordCredential +extends java.lang.Object +implements UserCredential+
Modifier and Type | +Field and Description | +
---|---|
private char[] |
+password
+Must be char array for security!! (Strings end up in the constant pool, etc.)
+ |
+
private java.lang.String |
+username
+The user name associated with the credential.
+ |
+
Constructor and Description | +
---|
PasswordCredential(java.lang.String username,
+ char[] password)
+Create a new PasswordCredential using a char array as password.
+ |
+
PasswordCredential(java.lang.String username,
+ java.lang.String password)
+Create a new PasswordCredential using a String as password.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
char[] |
+getPassword()
+Gets the password.
+ |
+
java.lang.String |
+getUsername()
+Returns the user name associated with this credential.
+ |
+
int |
+hashCode() |
+
java.lang.String |
+toString() |
+
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private final java.lang.String username+
private final char[] password+
public PasswordCredential(java.lang.String username, + java.lang.String password)+
username
- the user name of the credential.password
- the password of the credential.public PasswordCredential(java.lang.String username, + char[] password)+
username
- the user name of the credential.password
- the password of the credential.public char[] getPassword()+
public java.lang.String getUsername()+
UserCredential
getUsername
in interface UserCredential
public java.lang.String toString()+
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public interface UserCredential +extends Credential+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getUsername()
+Returns the user name associated with this credential.
+ |
+
See: Description
+Interface | +Description | +
---|---|
Credential | +
+ Credential represents a user credential uses to gain access to a resource.
+ |
+
UserCredential | ++ |
Class | +Description | +
---|---|
CertificateCredential | +
+ A container for security Information based upon certificates.
+ |
+
CredentialMap | +
+ A
+Credential consisting of a collection of Credentials each uniquely identified by a String (typically a host name or host alias). |
+
DefaultCredential | +
+ This class represents the default credential that may be used by the various adaptors.
+ |
+
KeytabCredential | ++ |
PasswordCredential | +
+ A Credential consisting of a username + password combination.
+ |
+
public class AttributeNotSupportedException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
AttributeNotSupportedException(java.lang.String adaptorName,
+ java.lang.String message) |
+
AttributeNotSupportedException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public AttributeNotSupportedException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public AttributeNotSupportedException(java.lang.String adaptorName, + java.lang.String message)+
public class CopyCancelledException +extends XenonException+
Constructor and Description | +
---|
CopyCancelledException(java.lang.String adaptorName,
+ java.lang.String s) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public enum CopyMode +extends java.lang.Enum<CopyMode>+
CREATE
, REPLACE
and IGNORE
options are mutually exclusive.Enum Constant and Description | +
---|
CREATE
+Copy to a new destination file, failing if the file already exists.
+ |
+
IGNORE
+Skip the copy if the destination file if it already exists.
+ |
+
REPLACE
+If the source and destination are a regular file, the destination file will be replaced.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static CopyMode |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static CopyMode[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final CopyMode CREATE+
public static final CopyMode REPLACE+
public static final CopyMode IGNORE+
public static CopyMode[] values()+
+for (CopyMode c : CopyMode.values()) + System.out.println(c); +
public static CopyMode valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic interface CopyStatus
+Modifier and Type | +Method and Description | +
---|---|
long |
+bytesCopied()
+Get the number of bytes that have been copied.
+ |
+
long |
+bytesToCopy()
+Get the number of bytes that need to be copied for the entire copy operation.
+ |
+
java.lang.String |
+getCopyIdentifier()
+Get the copy identifier for which this CopyStatus was created.
+ |
+
XenonException |
+getException()
+Get the exception produced by the Copy or while retrieving the status.
+ |
+
java.lang.String |
+getState()
+Get the state of the Copy operation.
+ |
+
boolean |
+hasException()
+Has the Copy or status retrieval produced a exception ?
+ |
+
boolean |
+isDone()
+Is the Copy done?
+ |
+
boolean |
+isRunning()
+Is the Copy still running?
+ |
+
void |
+maybeThrowException()
+Throws the exception that occured during copying, if it exists.
+ |
+
java.lang.String getCopyIdentifier()+
java.lang.String getState()+
XenonException getException()+
null
will be returned.
+
+ See maybeThrowException()
for the possible exceptions.void maybeThrowException() + throws XenonException+
PathAlreadyExistsException
- If the target already exists and the mode is CopyMode.CREATE
.CopyCancelledException
- If the copy was cancelled via FileSystem.cancel(String)
NoSuchPathException
- If the source does not exist or the target's parent does not existNotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.boolean isRunning()+
boolean isDone()+
boolean hasException()+
long bytesToCopy()+
long bytesCopied()+
public class DirectoryNotEmptyException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
DirectoryNotEmptyException(java.lang.String adaptorName,
+ java.lang.String message) |
+
DirectoryNotEmptyException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public DirectoryNotEmptyException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public DirectoryNotEmptyException(java.lang.String adaptorName, + java.lang.String message)+
class FileSystem.CopyCallback
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
(package private) long |
+bytesCopied |
+
(package private) long |
+bytesToCopy |
+
(package private) boolean |
+cancelled |
+
(package private) boolean |
+started |
+
Constructor and Description | +
---|
CopyCallback() |
+
Modifier and Type | +Method and Description | +
---|---|
(package private) void |
+addBytesCopied(long bytes) |
+
(package private) void |
+cancel() |
+
(package private) boolean |
+isCancelled() |
+
(package private) boolean |
+isStarted() |
+
(package private) void |
+start(long bytesToCopy) |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
static class FileSystem.CopyStatusImplementation +extends java.lang.Object +implements CopyStatus+
Modifier and Type | +Field and Description | +
---|---|
private long |
+bytesCopied |
+
private long |
+bytesToCopy |
+
private java.lang.String |
+copyIdentifier |
+
private XenonException |
+exception |
+
private java.lang.String |
+state |
+
Constructor and Description | +
---|
CopyStatusImplementation(java.lang.String copyIdentifier,
+ java.lang.String state,
+ long bytesToCopy,
+ long bytesCopied,
+ XenonException exception) |
+
Modifier and Type | +Method and Description | +
---|---|
long |
+bytesCopied()
+Get the number of bytes that have been copied.
+ |
+
long |
+bytesToCopy()
+Get the number of bytes that need to be copied for the entire copy operation.
+ |
+
boolean |
+equals(java.lang.Object o) |
+
java.lang.String |
+getCopyIdentifier()
+Get the copy identifier for which this CopyStatus was created.
+ |
+
XenonException |
+getException()
+Get the exception produced by the Copy or while retrieving the status.
+ |
+
java.lang.String |
+getState()
+Get the state of the Copy operation.
+ |
+
boolean |
+hasException()
+Has the Copy or status retrieval produced a exception ?
+ |
+
int |
+hashCode() |
+
boolean |
+isDone()
+Is the Copy done?
+ |
+
boolean |
+isRunning()
+Is the Copy still running?
+ |
+
void |
+maybeThrowException()
+Throws the exception that occured during copying, if it exists.
+ |
+
java.lang.String |
+toString() |
+
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private final java.lang.String copyIdentifier+
private final java.lang.String state+
private final XenonException exception+
private final long bytesToCopy+
private final long bytesCopied+
public CopyStatusImplementation(java.lang.String copyIdentifier, + java.lang.String state, + long bytesToCopy, + long bytesCopied, + XenonException exception)+
public java.lang.String getCopyIdentifier()+
CopyStatus
getCopyIdentifier
in interface CopyStatus
public java.lang.String getState()+
CopyStatus
getState
in interface CopyStatus
public XenonException getException()+
CopyStatus
null
will be returned.
+
+ See CopyStatus.maybeThrowException()
for the possible exceptions.getException
in interface CopyStatus
public void maybeThrowException() + throws XenonException+
CopyStatus
maybeThrowException
in interface CopyStatus
PathAlreadyExistsException
- If the target already exists and the mode is CopyMode.CREATE
.CopyCancelledException
- If the copy was cancelled via FileSystem.cancel(String)
NoSuchPathException
- If the source does not exist or the target's parent does not existNotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.public boolean isRunning()+
CopyStatus
isRunning
in interface CopyStatus
public boolean isDone()+
CopyStatus
isDone
in interface CopyStatus
public boolean hasException()+
CopyStatus
hasException
in interface CopyStatus
public long bytesToCopy()+
CopyStatus
bytesToCopy
in interface CopyStatus
public long bytesCopied()+
CopyStatus
bytesCopied
in interface CopyStatus
public java.lang.String toString()+
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
private class FileSystem.PendingCopy
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
(package private) FileSystem.CopyCallback |
+callback |
+
(package private) java.util.concurrent.Future<java.lang.Void> |
+future |
+
Constructor and Description | +
---|
PendingCopy(java.util.concurrent.Future<java.lang.Void> future,
+ FileSystem.CopyCallback callback) |
+
java.util.concurrent.Future<java.lang.Void> future+
FileSystem.CopyCallback callback+
public PendingCopy(java.util.concurrent.Future<java.lang.Void> future, + FileSystem.CopyCallback callback)+
public abstract class FileSystem
+extends java.lang.Object
+implements java.lang.AutoCloseable
+Modifier and Type | +Class and Description | +
---|---|
(package private) class |
+FileSystem.CopyCallback |
+
(package private) static class |
+FileSystem.CopyStatusImplementation
+CopyStatus contains status information for a specific copy operation.
+ |
+
private class |
+FileSystem.PendingCopy |
+
Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+adaptor |
+
private static java.util.HashMap<java.lang.String,FileAdaptor> |
+adaptors |
+
private int |
+bufferSize |
+
private static java.lang.String |
+COMPONENT_NAME
+The name of this component, for use in exceptions
+ |
+
private Credential |
+credential |
+
private java.lang.String |
+location |
+
private long |
+nextCopyID |
+
private java.util.HashMap<java.lang.String,FileSystem.PendingCopy> |
+pendingCopies |
+
private java.util.concurrent.ExecutorService |
+pool |
+
private XenonProperties |
+properties |
+
private java.lang.String |
+uniqueID |
+
private Path |
+workingDirectory |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+FileSystem(java.lang.String uniqueID,
+ java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential,
+ Path workDirectory,
+ int bufferSize,
+ XenonProperties properties) |
+
Modifier and Type | +Method and Description | +
---|---|
private static void |
+addAdaptor(FileAdaptor adaptor) |
+
abstract java.io.OutputStream |
+appendToFile(Path file)
+Open an existing file and return an
+OutputStream to append data to this file. |
+
protected boolean |
+areSamePaths(Path source,
+ Path target) |
+
protected void |
+assertDirectoryExists(Path dir) |
+
protected void |
+assertFileExists(Path file) |
+
protected void |
+assertFileIsSymbolicLink(Path link) |
+
protected void |
+assertIsOpen() |
+
protected void |
+assertNotNull(Path path) |
+
protected void |
+assertParentDirectoryExists(Path path) |
+
protected void |
+assertPathExists(Path path) |
+
protected void |
+assertPathIsDirectory(Path path) |
+
protected void |
+assertPathIsFile(Path path) |
+
protected void |
+assertPathIsNotDirectory(Path path) |
+
protected void |
+assertPathNotExists(Path path) |
+
CopyStatus |
+cancel(java.lang.String copyIdentifier)
+Cancel a copy operation.
+ |
+
void |
+close()
+Close this FileSystem.
+ |
+
java.lang.String |
+copy(Path source,
+ FileSystem destinationFS,
+ Path destination,
+ CopyMode mode,
+ boolean recursive)
+Asynchronously Copy an existing source path to a target path on a different file system.
+ |
+
protected void |
+copyFile(Path source,
+ FileSystem destinationFS,
+ Path destination,
+ CopyMode mode,
+ FileSystem.CopyCallback callback)
+Copy a single file to another file system.
+ |
+
private void |
+copyRecursive(Path source,
+ FileSystem destinationFS,
+ Path destination,
+ CopyMode mode,
+ FileSystem.CopyCallback callback) |
+
protected void |
+copySymbolicLink(Path source,
+ FileSystem destinationFS,
+ Path destination,
+ CopyMode mode,
+ FileSystem.CopyCallback callback)
+Copy a symbolic link to another file system (optional operation).
+ |
+
static FileSystem |
+create(java.lang.String adaptor)
+Create a new FileSystem using the
+adaptor that connects to a data store at the default location using the default credentials to get access. |
+
static FileSystem |
+create(java.lang.String adaptor,
+ java.lang.String location)
+Create a new FileSystem using the
+adaptor that connects to a data store at location using the default credentials to get
+ access. |
+
static FileSystem |
+create(java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential)
+Create a new FileSystem using the
+adaptor that connects to a data store at location using the credentials to get
+ access. |
+
static FileSystem |
+create(java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties)
+Create a new FileSystem using the
+adaptor that connects to a data store at location using the credentials to get
+ access. |
+
void |
+createDirectories(Path dir)
+Creates a new directory, failing if the directory already exists.
+ |
+
abstract void |
+createDirectory(Path dir)
+Creates a new directory, failing if the directory already exists.
+ |
+
abstract void |
+createFile(Path file)
+Creates a new empty file, failing if the file already exists.
+ |
+
abstract void |
+createSymbolicLink(Path link,
+ Path target)
+Creates a new symbolic link, failing if the link already exists (optional operation).
+ |
+
void |
+delete(Path path,
+ boolean recursive)
+Deletes an existing path.
+ |
+
protected abstract void |
+deleteDirectory(Path path)
+Delete an empty directory.
+ |
+
protected abstract void |
+deleteFile(Path file)
+Delete a file.
+ |
+
boolean |
+equals(java.lang.Object o) |
+
abstract boolean |
+exists(Path path)
+Tests if a path exists.
+ |
+
private static FileAdaptor |
+getAdaptorByName(java.lang.String adaptorName) |
+
static FileSystemAdaptorDescription |
+getAdaptorDescription(java.lang.String adaptorName)
+Gives the description of the adaptor with the given name.
+ |
+
static FileSystemAdaptorDescription[] |
+getAdaptorDescriptions()
+Gives a list of the descriptions of the available adaptors.
+ |
+
java.lang.String |
+getAdaptorName()
+Get the name of the adaptor that created this FileSystem.
+ |
+
static java.lang.String[] |
+getAdaptorNames()
+Gives a list names of the available adaptors.
+ |
+
abstract PathAttributes |
+getAttributes(Path path)
+Get the
+PathAttributes of an existing path. |
+
Credential |
+getCredential()
+Get the credential that this FileSystem is using.
+ |
+
java.lang.String |
+getLocation()
+Get the location of the FileSystem.
+ |
+
private java.lang.String |
+getNextCopyID() |
+
java.lang.String |
+getPathSeparator()
+Get the path separator used by this file system.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getProperties()
+Get the properties used to create this FileSystem.
+ |
+
CopyStatus |
+getStatus(java.lang.String copyIdentifier)
+Retrieve the status of an copy.
+ |
+
Path |
+getWorkingDirectory()
+Get the current working directory of this file system.
+ |
+
int |
+hashCode() |
+
protected boolean |
+isDotDot(Path path) |
+
abstract boolean |
+isOpen()
+Return if the connection to the FileSystem is open.
+ |
+
protected void |
+list(Path dir,
+ java.util.ArrayList<PathAttributes> list,
+ boolean recursive)
+Returns an (optionally recursive) listing of the entries in a directory
+dir . |
+
java.lang.Iterable<PathAttributes> |
+list(Path dir,
+ boolean recursive)
+List all entries in the directory
+dir . |
+
protected abstract java.lang.Iterable<PathAttributes> |
+listDirectory(Path dir)
+Return the list of entries in a directory.
+ |
+
protected void |
+performCopy(Path source,
+ FileSystem destinationFS,
+ Path destination,
+ CopyMode mode,
+ boolean recursive,
+ FileSystem.CopyCallback callback)
+Perform a (possibly) recursive copy from a path on this filesystem to a path on
+destinationFS . |
+
abstract java.io.InputStream |
+readFromFile(Path file)
+Open an existing file and return an
+InputStream to read from this file. |
+
abstract Path |
+readSymbolicLink(Path link)
+Reads the target of a symbolic link (optional operation).
+ |
+
abstract void |
+rename(Path source,
+ Path target)
+Rename an existing source path to a non-existing target path (optional operation).
+ |
+
abstract void |
+setPosixFilePermissions(Path path,
+ java.util.Set<PosixFilePermission> permissions)
+Sets the POSIX permissions of a path (optional operation).
+ |
+
void |
+setWorkingDirectory(Path directory)
+Set the current working directory of this file system to
+directory . |
+
protected void |
+streamCopy(java.io.InputStream in,
+ java.io.OutputStream out,
+ int buffersize,
+ FileSystem.CopyCallback callback)
+Copy data from
+in to out using a buffer size of buffersize . |
+
protected Path |
+toAbsolutePath(Path path)
+Convert the provided path to an absolute path by (if necessary) resolving a relative path against the working directory of this FileSystem.
+ |
+
CopyStatus |
+waitUntilDone(java.lang.String copyIdentifier,
+ long timeout)
+Wait until a copy operation is done or until a timeout expires.
+ |
+
abstract java.io.OutputStream |
+writeToFile(Path file)
+Open a file and return an
+OutputStream to write to this file. |
+
abstract java.io.OutputStream |
+writeToFile(Path path,
+ long size)
+Open a file and return an
+OutputStream to write to this file. |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final java.lang.String COMPONENT_NAME+
private static final java.util.HashMap<java.lang.String,FileAdaptor> adaptors+
private final java.lang.String uniqueID+
private final java.lang.String adaptor+
private final java.lang.String location+
private final Credential credential+
private final XenonProperties properties+
private final java.util.concurrent.ExecutorService pool+
private Path workingDirectory+
private long nextCopyID+
private int bufferSize+
private final java.util.HashMap<java.lang.String,FileSystem.PendingCopy> pendingCopies+
protected FileSystem(java.lang.String uniqueID, + java.lang.String adaptor, + java.lang.String location, + Credential credential, + Path workDirectory, + int bufferSize, + XenonProperties properties)+
private static void addAdaptor(FileAdaptor adaptor)+
private static FileAdaptor getAdaptorByName(java.lang.String adaptorName) + throws UnknownAdaptorException+
UnknownAdaptorException
public static java.lang.String[] getAdaptorNames()+
public static FileSystemAdaptorDescription getAdaptorDescription(java.lang.String adaptorName) + throws UnknownAdaptorException+
adaptorName
- the type of file system to connect to (e.g. "sftp" or "webdav")UnknownAdaptorException
- If the adaptor name is absent in getAdaptorNames()
.public static FileSystemAdaptorDescription[] getAdaptorDescriptions()+
public static FileSystem create(java.lang.String adaptor, + java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
adaptor
that connects to a data store at location
using the credentials
to get
+ access. Use properties
to (optionally) configure the FileSystem when it is created.
+
+ Make sure to always close FileSystem
instances by calling close(FileSystem)
when you no longer need them, otherwise their associated
+ resources remain allocated.adaptor
- the type of file system to connect to (e.g. "sftp" or "webdav")location
- the location of the FileSystem.credential
- the Credentials to use to get access to the FileSystem.properties
- optional properties to use when creating the FileSystem.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.UnknownAdaptorException
- If the adaptor was invalid.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the FileSystem failed.java.lang.IllegalArgumentException
- If adaptor is null.public static FileSystem create(java.lang.String adaptor, + java.lang.String location, + Credential credential) + throws XenonException+
adaptor
that connects to a data store at location
using the credentials
to get
+ access.
+
+ Make sure to always close FileSystem
instances by calling close(FileSystem)
when you no longer need them, otherwise their associated
+ resources remain allocated.adaptor
- the type of file system to connect to (e.g. "sftp" or "webdav")location
- the location of the FileSystem.credential
- the Credentials to use to get access to the FileSystem.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.UnknownAdaptorException
- If the adaptor was invalid.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the FileSystem failed.java.lang.IllegalArgumentException
- If adaptor is null.public static FileSystem create(java.lang.String adaptor, + java.lang.String location) + throws XenonException+
adaptor
that connects to a data store at location
using the default credentials to get
+ access.
+
+ Make sure to always close FileSystem
instances by calling close(FileSystem)
when you no longer need them, otherwise their associated
+ resources remain allocated.adaptor
- the type of file system to connect to (e.g. "sftp" or "webdav")location
- the location of the FileSystem.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.UnknownAdaptorException
- If the adaptor was invalid.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the FileSystem failed.java.lang.IllegalArgumentException
- If adaptor is null.public static FileSystem create(java.lang.String adaptor) + throws XenonException+
adaptor
that connects to a data store at the default location using the default credentials to get access.
+
+ Note that there are very few filesystem adaptors that support a default location. The local filesystem adaptor is the prime example.
+
+ Make sure to always close FileSystem
instances by calling close(FileSystem)
when you no longer need them, otherwise their associated
+ resources remain allocated.adaptor
- the type of file system to connect to (e.g. "sftp" or "webdav")UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.UnknownAdaptorException
- If the adaptor was invalid.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the FileSystem failed.java.lang.IllegalArgumentException
- If adaptor is null.private java.lang.String getNextCopyID()+
public java.lang.String getAdaptorName()+
public java.lang.String getLocation()+
public Credential getCredential()+
public java.util.Map<java.lang.String,java.lang.String> getProperties()+
public Path getWorkingDirectory()+
"/home/username"
.public java.lang.String getPathSeparator()+
public void setWorkingDirectory(Path directory) + throws XenonException+
directory
.
+
+ The provided directory
must exist and be a directory. Both an absolute or relative path may be provided. In the latter case, the path will
+ be resolved against the current working directory.directory
- a path to which the current working directory must be set.NoSuchPathException
- if the directory
does not existInvalidPathException
- if directory
is not a directoryNotConnectedException
- if file system is closed.java.lang.IllegalArgumentException
- if the argument is null.XenonException
- if an I/O error occurredpublic void close() + throws XenonException+
close
in interface java.lang.AutoCloseable
XenonException
- If the FileSystem failed to close or if an I/O error occurred.public abstract boolean isOpen() + throws XenonException+
XenonException
- if the test failed or an I/O error occurred.public abstract void rename(Path source, + Path target) + throws XenonException+
+
+ This method only implements a rename operation, not a move operation. Hence, this method will not copy files and should return (almost)
+ instantaneously.
+
+ The parent of the target path (e.g. target.getParent
) must exist.
+
+ If the target is equal to the source this method has no effect.
+
+ If the source is a link, the link itself will be renamed, not the path to which it refers.
+
+ If the source is a directory, it will be renamed to the target. This implies that a moving a directory between physical locations may fail.
+
source
- the existing source path.target
- the non existing target path.UnsupportedOperationException
- If the adapter does not support renaming.NoSuchPathException
- If the source file does not exist or the target parent directory does not exist.PathAlreadyExistsException
- If the target file already exists.NotConnectedException
- If file system is closed.XenonException
- If the move failed.java.lang.IllegalArgumentException
- If one or both of the arguments are null.public void createDirectories(Path dir) + throws XenonException+
dir
- the directory to create.PathAlreadyExistsException
- If the directory already exists or if a parent directory could not be created because a file with the same name already exists.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.java.lang.IllegalArgumentException
- If one or both of the arguments are null.public abstract void createDirectory(Path dir) + throws XenonException+
dir
- the directory to create.PathAlreadyExistsException
- If the directory already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.java.lang.IllegalArgumentException
- If the argument is null.public abstract void createFile(Path file) + throws XenonException+
file
- a path referring to the file to create.PathAlreadyExistsException
- If the file already exists.NoSuchPathException
- If the parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.java.lang.IllegalArgumentException
- If one or both of the arguments are null.public abstract void createSymbolicLink(Path link, + Path target) + throws XenonException+
link
- the symbolic link to create.target
- the target the symbolic link should refer to.PathAlreadyExistsException
- If the link already exists.NoSuchPathException
- If the target or parent directory of link does not existInvalidPathException
- If parent of link is not a directoryNotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.java.lang.IllegalArgumentException
- If one or both of the arguments are null.public void delete(Path path, + boolean recursive) + throws XenonException+
recursive
is set to true, the contents of the directory will also be deleted. If recursive
is
+ set to false
, a directory will only be removed if it is empty.path
- the path to delete.recursive
- if the delete must be done recursivelyDirectoryNotEmptyException
- if the directory was not empty (and the delete was not recursive).NoSuchPathException
- if the provided path does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract boolean exists(Path path) + throws XenonException+
path
- the path to test.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public java.lang.Iterable<PathAttributes> list(Path dir, + boolean recursive) + throws XenonException+
dir
.
+
+ All entries in the directory are returned, but subdirectories will not be traversed by default. Set recursive
to true
, include
+ the listing of all subdirectories.
+
+ Symbolic links are not followed.dir
- the target directory.recursive
- should the list recursively traverse the subdirectories ?List
of PathAttributes
that iterates over all entries in the directory dir
.NoSuchPathException
- If a directory does not exists.InvalidPathException
- If dir
is not a directory.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract java.io.InputStream readFromFile(Path file) + throws XenonException+
InputStream
to read from this file.file
- the to read.InputStream
to read from the file.NoSuchPathException
- If the file does not exists.InvalidPathException
- If the file is not regular file.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract java.io.OutputStream writeToFile(Path path, + long size) + throws XenonException+
OutputStream
to write to this file.
+
+
+ The size of the file (once all data has been written) must be specified using the size
parameter. This is required by some implementations
+ (typically blob-stores).
+
+
path
- the target file for the OutputStream.size
- the size of the file once fully written.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract java.io.OutputStream writeToFile(Path file) + throws XenonException+
OutputStream
to write to this file. (optional operation)
+ + If the file already exists it will be replaced and its data will be lost. + + The amount of data that will be written to the file is not specified in advance. This operation may not be supported by all implementations. + +
file
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract java.io.OutputStream appendToFile(Path file) + throws XenonException+
OutputStream
to append data to this file. (optional operation)
+ + If the file does not exist, an exception will be thrown. + + This operation may not be supported by all implementations. + +
file
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.InvalidPathException
- if not a regular fileNotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.UnsupportedOperationException
- if the adaptor does not support appendingpublic abstract PathAttributes getAttributes(Path path) + throws XenonException+
PathAttributes
of an existing path.path
- the existing path.NoSuchPathException
- If the file does not exists.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract Path readSymbolicLink(Path link) + throws XenonException+
link
- the link to read.NoSuchPathException
- If the link does not exists.InvalidPathException
- If the source is not a link.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract void setPosixFilePermissions(Path path, + java.util.Set<PosixFilePermission> permissions) + throws XenonException+
path
- the target path.permissions
- the permissions to set.NoSuchPathException
- If the target path does not exists.UnsupportedOperationException
- If this FileSystem does not support symbolic links.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.protected Path toAbsolutePath(Path path)+
path
- the path to convertjava.lang.IllegalArgumentException
- if path is null.protected void streamCopy(java.io.InputStream in, + java.io.OutputStream out, + int buffersize, + FileSystem.CopyCallback callback) + throws java.io.IOException, + CopyCancelledException+
in
to out
using a buffer size of buffersize
.
+
+ After each buffersize
block of data, callback.addBytesCopied
will be invoked to report the number of bytes copied and
+ callback.isCancelled
will be invoked to determine if the copy should continue.in
- the stream to copy the data from.out
- the stream to copy the data to.buffersize
- the buffer size to use for copying.callback
- the callback to report bytes copied to and check cancellation from.java.io.IOException
- if an I/O exception occurred.CopyCancelledException
- if the copy was cancelled by the user.protected void copySymbolicLink(Path source, + FileSystem destinationFS, + Path destination, + CopyMode mode, + FileSystem.CopyCallback callback) + throws XenonException+
source
- the link to copy.destinationFS
- the destination FileSystem
to copy to.destination
- the destination link on the destination file system.mode
- selects what should happen if the destination link already existscallback
- a FileSystem.CopyCallback
used to update the status of the copy, or cancel it while in progress.InvalidPathException
- if the provide source is not a link.NoSuchPathException
- if the source link does not exist or the destination parent directory does not exist.PathAlreadyExistsException
- if the destination link already exists.UnsupportedOperationException
- if the destination FileSystem does not support symbolic links.XenonException
- if the link could not be copied.protected void copyFile(Path source, + FileSystem destinationFS, + Path destination, + CopyMode mode, + FileSystem.CopyCallback callback) + throws XenonException+
source
- the file to copy.destinationFS
- the destination FileSystem
to copy to.destination
- the destination file on the destination file system.mode
- selects what should happen if the destination file already existscallback
- a FileSystem.CopyCallback
used to update the status of the copy, or cancel it while in progress.InvalidPathException
- if the provide source is not a regular file.NoSuchPathException
- if the source file does not exist or the destination parent directory does not exist.PathAlreadyExistsException
- if the destination file already exists.XenonException
- If the file could not be copied.protected void performCopy(Path source, + FileSystem destinationFS, + Path destination, + CopyMode mode, + boolean recursive, + FileSystem.CopyCallback callback) + throws XenonException+
destinationFS
.source
- the source path on this FileSystem.destinationFS
- the destination FileSystem.destination
- the destination path.mode
- the copy mode that determines how to react if the destination already exists.recursive
- should the copy be performed recursively ?callback
- a FileSystem.CopyCallback
used to return status information on the copy.XenonException
- if an error occurred.private void copyRecursive(Path source, + FileSystem destinationFS, + Path destination, + CopyMode mode, + FileSystem.CopyCallback callback) + throws XenonException+
XenonException
protected abstract void deleteFile(Path file) + throws XenonException+
file
- the file to removeInvalidPathException
- if the provided path is not a file.NoSuchPathException
- if the provided file does not exist.XenonException
- If the file could not be removed.protected abstract void deleteDirectory(Path path) + throws XenonException+
rmdir
in Linux).
+
+ This operation must be implemented by the various implementations of FileSystem.path
- the directory to removeInvalidPathException
- if the provided path is not a directory.NoSuchPathException
- if the provided path does not exist.XenonException
- If the directory could not be removed.protected abstract java.lang.Iterable<PathAttributes> listDirectory(Path dir) + throws XenonException+
dir
will be returned as part of the list, but they will not be listed themselves.
+
+ This operation must be implemented by the various implementations of FileSystem.dir
- the directory to listIterable
that iterates over all entries in dir
XenonException
- If the list could not be retrieved.protected void list(Path dir, + java.util.ArrayList<PathAttributes> list, + boolean recursive) + throws XenonException+
dir
.
+
+ This is a generic implementation which relies on listDirectory
to provide listings of individual directories.dir
- the directory to list.list
- the list to which the directory entries will be added.recursive
- if the listing should be done recursively.XenonException
- If the list could not be retrieved.public java.lang.String copy(Path source, + FileSystem destinationFS, + Path destination, + CopyMode mode, + boolean recursive)+
recursive
is set to true
. Otherwise, an exception will be thrown.
+ When copying recursively, the directory and its content (both files and subdirectories with content), will be copied to destination
.
+
+ Exceptions that occur during copying will not be thrown by this function, but instead are contained in a CopyStatus
object which can be obtained
+ with getStatus(String)
source
- the source path (on this filesystem) to copy from.destinationFS
- the destination filesystem to copy to.destination
- the destination path (on the destination filesystem) to copy to.mode
- how to react if the destination already exists.recursive
- if the copy should be recursive.String
that identifies this copy and be used to inspect its progress.java.lang.IllegalArgumentException
- If source, destinationFS, destination or mode is null.public CopyStatus cancel(java.lang.String copyIdentifier) + throws XenonException+
NoSuchCopyException
copyIdentifier
- the identifier of the copy operation which to cancel.CopyStatus
containing the status of the copy.NoSuchCopyException
- If the copy is not known.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If the copyIdentifier is null.public CopyStatus waitUntilDone(java.lang.String copyIdentifier, + long timeout) + throws XenonException+
+ This method will wait until a copy operation is done (either gracefully or by producing an error), or until the timeout expires, whichever comes first. + If the timeout expires, the copy operation will continue to run. +
++ The timeout is in milliseconds and must be >= 0. When timeout is 0, it will be ignored and this method will wait until the copy operation is done. +
+ After this operation, the copy is forgotten and subsequent queries with this copy string will lead toNoSuchCopyException
+
+ A CopyStatus
is returned that can be used to determine why the call returned.
+
copyIdentifier
- the identifier of the copy operation to wait for.timeout
- the maximum time to wait for the copy operation in milliseconds.CopyStatus
containing the status of the copy.java.lang.IllegalArgumentException
- If argument is illegal.NoSuchCopyException
- If the copy handle is not known.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If the copyIdentifier is null or if the value of timeout is negative.public CopyStatus getStatus(java.lang.String copyIdentifier) + throws XenonException+
NoSuchCopyException
.copyIdentifier
- the identifier of the copy for which to retrieve the status.CopyStatus
containing the status of the asynchronous copy.NoSuchCopyException
- If the copy is not known.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If the copyIdentifier is null.protected void assertNotNull(Path path)+
protected void assertPathExists(Path path) + throws XenonException+
XenonException
protected void assertPathNotExists(Path path) + throws XenonException+
XenonException
protected void assertPathIsNotDirectory(Path path) + throws XenonException+
XenonException
protected void assertPathIsFile(Path path) + throws XenonException+
XenonException
protected void assertPathIsDirectory(Path path) + throws XenonException+
XenonException
protected void assertFileExists(Path file) + throws XenonException+
XenonException
protected void assertDirectoryExists(Path dir) + throws XenonException+
XenonException
protected void assertParentDirectoryExists(Path path) + throws XenonException+
XenonException
protected void assertFileIsSymbolicLink(Path link) + throws XenonException+
XenonException
protected void assertIsOpen() + throws XenonException+
XenonException
protected boolean isDotDot(Path path)+
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public interface FileSystemAdaptorDescription +extends AdaptorDescription+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+canAppend() |
+
boolean |
+canCreateSymboliclinks()
+Can this adaptor create symbolic links ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
boolean |
+canReadSymboliclinks()
+Can this adaptor read symbolic links ?
+ |
+
boolean |
+isConnectionless() |
+
boolean |
+needsSizeBeforehand() |
+
boolean |
+supportsReadingPosixPermissions() |
+
boolean |
+supportsRename() |
+
boolean |
+supportsSettingPosixPermissions() |
+
boolean |
+supportsThirdPartyCopy()
+Does this adaptor support third party copy ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
getDescription, getName, getSupportedCredentials, getSupportedLocations, getSupportedProperties
boolean supportsThirdPartyCopy()+
boolean canReadSymboliclinks()+
boolean canCreateSymboliclinks()+
boolean isConnectionless()+
boolean supportsReadingPosixPermissions()+
boolean supportsSettingPosixPermissions()+
boolean supportsRename()+
boolean canAppend()+
boolean needsSizeBeforehand()+
public class FileSystemClosedException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
FileSystemClosedException(java.lang.String adaptorName,
+ java.lang.String message) |
+
FileSystemClosedException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public FileSystemClosedException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public FileSystemClosedException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidOptionsException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
InvalidOptionsException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidOptionsException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public InvalidOptionsException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidOptionsException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidPathException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
InvalidPathException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidPathException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public InvalidPathException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidPathException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidResumeTargetException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
InvalidResumeTargetException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidResumeTargetException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public InvalidResumeTargetException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidResumeTargetException(java.lang.String adaptorName, + java.lang.String message)+
public class NoSuchCopyException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
NoSuchCopyException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NoSuchCopyException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public class NoSuchPathException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
NoSuchPathException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NoSuchPathException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
Modifier and Type | +Field and Description | +
---|---|
private int |
+index |
+
Modifier | +Constructor and Description | +
---|---|
private |
+PathIterator() |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+hasNext() |
+
Path |
+next() |
+
void |
+remove() |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
Modifier and Type | +Class and Description | +
---|---|
private class |
+Path.PathIterator |
+
Modifier and Type | +Field and Description | +
---|---|
static char |
+DEFAULT_SEPARATOR
+The default separator to use.
+ |
+
private java.util.List<java.lang.String> |
+elements
+The path elements in this path
+ |
+
private boolean |
+isAbsolute
+Does path start with / ?
+ |
+
private static int |
+PATH_ELEMENT_LENGTH
+Estimate of path element String length.
+ |
+
private char |
+separator
+The separator used in this path
+ |
+
Constructor and Description | +
---|
Path()
+Create a new empty Path using the default separator.
+ |
+
Path(boolean isAbsolute,
+ java.util.List<java.lang.String> elements)
+Create a new Path using the given path elements and the default separator.
+ |
+
Path(boolean isAbsolute,
+ java.lang.String... elements)
+Create a new Path using the given path elements and the default separator.
+ |
+
Path(char separator,
+ boolean isAbsolute,
+ java.util.List<java.lang.String> elements)
+Create a new Path using the given path separator, absoluteness, and elements.
+ |
+
Path(char separator,
+ boolean isAbsolute,
+ java.lang.String... elements)
+Create a new Path using the given path elements and the provided separator.
+ |
+
Path(char separator,
+ java.lang.String path)
+Create a new Path by parsing
+path using the provided separator. |
+
Path(java.lang.String path)
+Create a new Path by parsing
+path using the default separator. |
+
Modifier and Type | +Method and Description | +
---|---|
protected static java.util.List<java.lang.String> |
+checkForNullAndSeparator(char separator,
+ java.util.List<java.lang.String> elements) |
+
boolean |
+endsWith(Path other)
+Tests if this Path ends with the given Path.
+ |
+
boolean |
+endsWith(java.lang.String other)
+Tests if this Path ends with the given Path represented as a String.
+ |
+
boolean |
+equals(java.lang.Object obj) |
+
private java.lang.String |
+getAbsolutePath()
+Return a
+String representation of this Path interpreted as an absolute path. |
+
Path |
+getFileName()
+Get the file name or
+null if the Path is empty. |
+
java.lang.String |
+getFileNameAsString()
+Get the file name as a
+String , or null if the Path is empty. |
+
Path |
+getName(int index)
+Get an element of this Path.
+ |
+
int |
+getNameCount()
+Get the number of elements in the Path.
+ |
+
Path |
+getParent()
+Get the parent Path, or
+null if this Path does not have a parent. |
+
private java.lang.String |
+getRelativePath()
+Return a
+String representation of this Path interpreted as a relative path. |
+
char |
+getSeparator()
+Get the separator.
+ |
+
int |
+hashCode() |
+
boolean |
+isAbsolute() |
+
boolean |
+isEmpty()
+Is this Path empty ?
+ |
+
java.util.Iterator<Path> |
+iterator()
+Create an
+Iterator that returns all possible sub Paths of this Path, in order of increasing length. |
+
Path |
+normalize()
+Normalize this Path by removing as many redundant path elements as possible.
+ |
+
Path |
+relativize(Path other)
+Create a relative Path between the given Path and this Path.
+ |
+
Path |
+resolve(Path other)
+Resolve a Path against this Path.
+ |
+
Path |
+resolve(java.lang.String other)
+Resolve a Path represented as a String against this path.
+ |
+
Path |
+resolveSibling(Path other)
+Resolves the given Path to this paths parent Path, thereby creating a sibling to this Path.
+ |
+
boolean |
+startsWith(Path other)
+Tests if this Path starts with the given Path.
+ |
+
boolean |
+startsWith(java.lang.String other)
+Tests if this Path starts with the given Path represented as a String.
+ |
+
Path |
+subpath(int beginIndex,
+ int endIndex)
+Returns a Path that is a subsequence of the name elements of this path.
+ |
+
Path |
+toAbsolutePath() |
+
Path |
+toRelativePath() |
+
java.lang.String |
+toString() |
+
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final char DEFAULT_SEPARATOR+
private final java.util.List<java.lang.String> elements+
private final char separator+
private boolean isAbsolute+
private static final int PATH_ELEMENT_LENGTH+
public Path()+
public Path(java.lang.String path)+
path
using the default separator.
+
+ If path
is null
or an empty String, the resulting Path is empty and relative. Otherwise it will be split into multiple elements
+ using the default separator. If path
starts with a separator, the resulting path will be absolute. Otherwise, it will be relative.path
- the path to parsepublic Path(char separator, + java.lang.String path)+
path
using the provided separator.
+
+ If path
is null
or an empty String, the resulting Path is empty and relative. Otherwise it will be split into multiple elements
+ using the provided separator. If path
starts with a separator, the resulting path will be absolute. Otherwise, it will be relative.separator
- the separator to usepath
- the path to parsepublic Path(boolean isAbsolute, + java.lang.String... elements)+
elements
is null
or empty, the resulting Path is empty. The elements
may not contain null
or empty
+ Strings. The elements will not be parsed individually, and may not contain the separator character.isAbsolute
- should the resulting path must be absolute?elements
- the path elements to use.public Path(char separator, + boolean isAbsolute, + java.lang.String... elements)+
elements
is null
or empty, the resulting Path is empty. The elements
may not contain null
or empty
+ Strings. The elements will not be parsed individually, and may not contain the separator character.separator
- the separator to use.isAbsolute
- should the resulting path must be absolute?elements
- the path elements to use.public Path(boolean isAbsolute, + java.util.List<java.lang.String> elements)+
elements
is null
or empty, the resulting Path is empty. The elements
list may not contain null
or
+ empty Strings, or Strings that contain the separator character. If they do, an IllegalArgumentException
will be thrown.isAbsolute
- should the resulting path must be absolute?elements
- the path elements to use.public Path(char separator, + boolean isAbsolute, + java.util.List<java.lang.String> elements)+
elements
is null
or empty, the resulting Path is empty. The elements
list may not contain null
or
+ empty Strings, or Strings that contain the separator character. If they do, an IllegalArgumentException
will be thrown.separator
- the separator to use.isAbsolute
- should the resulting path should be absolute ?elements
- the path elements to use.protected static java.util.List<java.lang.String> checkForNullAndSeparator(char separator, + java.util.List<java.lang.String> elements)+
public Path getFileName()+
null
if the Path is empty.
+
+ The file name is the last element of the Path.null
.public java.lang.String getFileNameAsString()+
String
, or null
if the Path is empty.
+
+ The file name is the last element of the Path.null
.public char getSeparator()+
public Path getParent()+
null
if this Path does not have a parent.
+
+ The parent path will contain all path elements in this pasth except the last one.public int getNameCount()+
public Path getName(int index)+
index
- the index of the elementjava.lang.IndexOutOfBoundsException
- If the index is negative or greater or equal to the number of elements in the path.public Path subpath(int beginIndex, + int endIndex)+
beginIndex
- the index of the first element, inclusiveendIndex
- the index of the last element, exclusivejava.lang.IllegalArgumentException
- If beginIndex is larger than or equal to the endIndex.java.lang.ArrayIndexOutOfBoundsException
- If beginIndex < 0 or beginIndex > elements.lengthpublic boolean startsWith(Path other)+
true
if this Path starts with the same sequence of the name elements as the given Path. In addition, the absoluteness of
+ this Path should match the absoluteness of the given Path.
+
+ False is returned if the given Path starts with a different sequence of elements, has more name elements than this path, or has a different absoluteness
+ than this path.other
- the Path to compare to.public boolean endsWith(Path other)+
true
if this Path end with the name elements in the given Path. If the given Path has more name elements than this Path
+ then false is returned.other
- the Path to compare to.public boolean startsWith(java.lang.String other)+
other
into a Path
using Path(String)
and then uses startsWith(Path)
to compare the
+ result to this Path.other
- the path to test.other
.public boolean endsWith(java.lang.String other)+
other
into a Path
using Path(String)
and then uses endsWith(Path)
to compare the
+ result to this path.other
- the path to test.other
.public Path resolve(Path other)+
other
. The resulting path will use the separator and absoluteness
+ of this path.other
- the Path to concatenate with.public Path resolve(java.lang.String other)+
other
into a Path
using Path(char, String)
and the separator of the this path. Next, resolve(Path)
+ is used to resolve the result against this path.other
- the path to concatenate with.public boolean isEmpty()+
public Path resolveSibling(Path other)+
other
will be returned, unless other is null
in which case an empty Path is returned.
+
+ If this Path is not empty, but other
is null
or empty, the parent of this Path will be returned.
+
+ If neither this Path and other are empty, getParent.resolve(other)
will be returned.other
- the Path to resolve as sibling.java.lang.IllegalArgumentException
- If the Path can not be resolved as a sibling to this Path.public Path relativize(Path other)+
other
.other
- the Path to relativize.java.lang.IllegalArgumentException
- If the path can not be relativized to this path.public java.util.Iterator<Path> iterator()+
Iterator
that returns all possible sub Paths of this Path, in order of increasing length.
+
+ For example, for the Path "/a/b/c/d" the iterator returns "/a", "/a/b", "/a/b/c", "/a/b/c/d".iterator
in interface java.lang.Iterable<Path>
private java.lang.String getRelativePath()+
String
representation of this Path interpreted as a relative path.
+
+ A relative path does not start with a separator.private java.lang.String getAbsolutePath()+
String
representation of this Path interpreted as an absolute path.
+
+ An absolute path starts with a separator.public Path normalize()+
"."
(indicating the current directory) and ".."
(indicating the parent directory).
+
+ Note that the resulting normalized path does may still contain ".."
elements which are not redundant.public int hashCode()+
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public java.lang.String toString()+
toString
in class java.lang.Object
public boolean isAbsolute()+
public Path toRelativePath()+
public Path toAbsolutePath()+
public class PathAlreadyExistsException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
PathAlreadyExistsException(java.lang.String adaptorName,
+ java.lang.String message) |
+
PathAlreadyExistsException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public PathAlreadyExistsException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public PathAlreadyExistsException(java.lang.String adaptorName, + java.lang.String message)+
public interface PathAttributes
+Modifier and Type | +Method and Description | +
---|---|
long |
+getCreationTime()
+Get the creation time for this file.
+ |
+
java.lang.String |
+getGroup()
+Get the group of this file (optional operation).
+ |
+
long |
+getLastAccessTime()
+Get the last access time for this file.
+ |
+
long |
+getLastModifiedTime()
+Get the last modified time for this file.
+ |
+
java.lang.String |
+getOwner()
+Get the owner of this file (optional operation).
+ |
+
Path |
+getPath()
+Get the path these attributes belong to.
+ |
+
java.util.Set<PosixFilePermission> |
+getPermissions()
+Get the permissions of this file (optional operation).
+ |
+
long |
+getSize()
+Get the size of this file in bytes.
+ |
+
boolean |
+isDirectory()
+Does the path refer to a directory ?
+ |
+
boolean |
+isExecutable()
+Does the path refer to an executable file ?
+ |
+
boolean |
+isHidden()
+Does the path refer to an hidden file ?
+ |
+
boolean |
+isOther()
+Is the path not a file, link or directory ?
+ |
+
boolean |
+isReadable()
+Does the path refer to an readable file ?
+ |
+
boolean |
+isRegular()
+Does the path refer to a regular file ?
+ |
+
boolean |
+isSymbolicLink()
+Does the path refer to a symbolic link ?
+ |
+
boolean |
+isWritable()
+Does the path refer to a writable file ?
+ |
+
Path getPath()+
boolean isDirectory()+
boolean isRegular()+
boolean isSymbolicLink()+
boolean isOther()+
boolean isExecutable()+
boolean isReadable()+
boolean isWritable()+
boolean isHidden()+
long getCreationTime()+
getLastModifiedTime()
will be returned instead.long getLastAccessTime()+
getLastModifiedTime()
will be returned instead.long getLastModifiedTime()+
0
will be returned instead.long getSize()+
0
will be returned.java.lang.String getOwner() + throws AttributeNotSupportedException+
AttributeNotSupportedException
- If the attribute is not supported by the adaptor.java.lang.String getGroup() + throws AttributeNotSupportedException+
AttributeNotSupportedException
- If the attribute is not supported by the adaptor.java.util.Set<PosixFilePermission> getPermissions() + throws AttributeNotSupportedException+
AttributeNotSupportedException
- If the attribute is not supported by the adaptor.public enum PosixFilePermission +extends java.lang.Enum<PosixFilePermission>+
Enum Constant and Description | +
---|
GROUP_EXECUTE
+Execute/search permission, group.
+ |
+
GROUP_READ
+Read permission, group.
+ |
+
GROUP_WRITE
+Write permission, group.
+ |
+
OTHERS_EXECUTE
+Execute/search permission, others.
+ |
+
OTHERS_READ
+Read permission, others.
+ |
+
OTHERS_WRITE
+Write permission, others.
+ |
+
OWNER_EXECUTE
+Execute/search permission, owner.
+ |
+
OWNER_READ
+Read permission, owner.
+ |
+
OWNER_WRITE
+Write permission, owner.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static boolean |
+contains(PosixFilePermission toFind,
+ PosixFilePermission... options)
+Check if a sequence of
+PosixFilePermission s contains a specific option. |
+
static PosixFilePermission |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static PosixFilePermission[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final PosixFilePermission GROUP_EXECUTE+
public static final PosixFilePermission GROUP_READ+
public static final PosixFilePermission GROUP_WRITE+
public static final PosixFilePermission OTHERS_EXECUTE+
public static final PosixFilePermission OTHERS_READ+
public static final PosixFilePermission OTHERS_WRITE+
public static final PosixFilePermission OWNER_EXECUTE+
public static final PosixFilePermission OWNER_READ+
public static final PosixFilePermission OWNER_WRITE+
public static PosixFilePermission[] values()+
+for (PosixFilePermission c : PosixFilePermission.values()) + System.out.println(c); +
public static PosixFilePermission valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static boolean contains(PosixFilePermission toFind, + PosixFilePermission... options)+
PosixFilePermission
s contains a specific option.
+
+ If option
or options
is null
, false
will be returned.toFind
- the option to find.options
- the options to check.options
contains option
.See: Description
+Interface | +Description | +
---|---|
CopyStatus | +
+ CopyStatus contains status information for a specific copy operation.
+ |
+
FileSystemAdaptorDescription | ++ |
PathAttributes | +
+ FileAttributes represents a set of attributes of a path.
+ |
+
Class | +Description | +
---|---|
FileSystem | +
+ FileSystem represent a (possibly remote) file system that can be used to access data.
+ |
+
FileSystem.CopyStatusImplementation | +
+ CopyStatus contains status information for a specific copy operation.
+ |
+
Path | +
+ Path contains a sequence of path elements separated by a separator.
+ |
+
Enum | +Description | +
---|---|
CopyMode | +
+ CopyOption is an enumeration containing all possible options for copying a file.
+ |
+
PosixFilePermission | +
+ PosixFilePermission is an enumeration containing all supported Posix file permissions.
+ |
+
Exception | +Description | +
---|---|
AttributeNotSupportedException | +
+ Signals that a requested file attribute is not supported by the underlying file system implementation.
+ |
+
CopyCancelledException | ++ |
DirectoryNotEmptyException | +
+ Signals that directory is not empty.
+ |
+
FileSystemClosedException | +
+ Signals that a unknown Copy handle was provided.
+ |
+
InvalidOptionsException | +
+ Signals that an invalid combination of OpenOptions have been specified.
+ |
+
InvalidPathException | +
+ Signals that an end-of-file was encountered.
+ |
+
InvalidResumeTargetException | +
+ Signals that the data in the target of a resume does not match the data in the source.
+ |
+
NoSuchCopyException | +
+ Signals that a unknown Copy handle was provided.
+ |
+
NoSuchPathException | +
+ Signals that a path does not exists.
+ |
+
PathAlreadyExistsException | +
+ Signals that a path already exists.
+ |
+
See: Description
+Interface | +Description | +
---|---|
AdaptorDescription | +
+ AdaptorStatus contains information on a specific adaptor.
+ |
+
Class | +Description | +
---|---|
XenonPropertyDescription | +
+ XenonPropertyDescription contains all necessary information about a property that is recognized by Xenon
+ |
+
Enum | +Description | +
---|---|
XenonPropertyDescription.Type | +
+ This Type enumeration lists all possible types of properties recognized by Xenon.
+ |
+
Exception | +Description | +
---|---|
InvalidCredentialException | +
+ Signals that an invalid credential was used to access a resource.
+ |
+
InvalidLocationException | +
+ Signals that an invalid location was provided.
+ |
+
InvalidPropertyException | +
+ Signals that a property has a different type than the get method it was retrieved with.
+ |
+
PropertyTypeException | +
+ Signals that a property has a different type than the get method it was retrieved with.
+ |
+
UnknownAdaptorException | +
+ Thrown when an unknown adaptor name is provided.
+ |
+
UnknownPropertyException | +
+ Signals that a property has a different type than the get method it was retrieved with.
+ |
+
UnsupportedOperationException | +
+ Throw when an unsupported optional operation is called.
+ |
+
XenonException | +
+ XenonException is the parent exception for all exceptions raised in Xenon.
+ |
+
XenonRuntimeException | +
+ XenonRuntimeException is the parent for all runtime exceptions raised in Xenon.
+ |
+
public class IncompleteJobDescriptionException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
IncompleteJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message) |
+
IncompleteJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public IncompleteJobDescriptionException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public IncompleteJobDescriptionException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidJobDescriptionException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
InvalidJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public InvalidJobDescriptionException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidJobDescriptionException(java.lang.String adaptorName, + java.lang.String message)+
public class JobDescription
+extends java.lang.Object
+Scheduler
.Modifier and Type | +Field and Description | +
---|---|
private java.util.List<java.lang.String> |
+arguments
+The arguments to pass to the executable.
+ |
+
static int |
+DEFAULT_MAX_RUN_TIME_IN_MINUTES
+The default maximum run time
+ |
+
private java.util.Map<java.lang.String,java.lang.String> |
+environment
+The environment variables and their values
+ |
+
private java.lang.String |
+executable
+The executable to run.
+ |
+
private java.util.Map<java.lang.String,java.lang.String> |
+jobOptions
+The job options of this job
+ |
+
private int |
+maxMemory
+The maximum amount of memory needed (in MB) on each node/process.
+ |
+
private int |
+maxRuntime
+The maximum run time in minutes.
+ |
+
private java.lang.String |
+name
+The name of the job.
+ |
+
private int |
+nodeCount
+The number of nodes to run the job on.
+ |
+
private int |
+processesPerNode
+The number of processes to start/reserve per node.
+ |
+
private java.lang.String |
+queueName
+The queue to submit to.
+ |
+
private java.util.List<java.lang.String> |
+schedulerArguments
+The arguments to pass to the scheduler.
+ |
+
private boolean |
+startSingleProcess
+If true, only a single process is started on the first node aquired, instead of nodeCount * processesPerNode.
+ |
+
private java.lang.String |
+stderr
+The location file which to redirect stderr to.
+ |
+
private java.lang.String |
+stdin
+The location file from which to redirect stdin.
+ |
+
private java.lang.String |
+stdout
+The location file which to redirect stdout to.
+ |
+
private int |
+tempSpace
+The tempspace needed (in MB) on each node/process.
+ |
+
private int |
+threadsPerProcess
+The number of threads the executable will use per processes
+ |
+
private java.lang.String |
+workingDirectory
+The working directory for the job.
+ |
+
Constructor and Description | +
---|
JobDescription()
+Create a JobDescription.
+ |
+
JobDescription(JobDescription original)
+Create a JobDescription by copying an existing one.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addArgument(java.lang.String argument)
+Add a command line argument for the executable.
+ |
+
void |
+addEnvironment(java.lang.String key,
+ java.lang.String value)
+Add a variable to the environment of the executable.
+ |
+
void |
+addJobOption(java.lang.String key,
+ java.lang.String value)
+Add a job option to the job.
+ |
+
void |
+addSchedulerArgument(java.lang.String argument)
+Add a scheduler specific argument.
+ |
+
boolean |
+equals(java.lang.Object obj) |
+
java.util.List<java.lang.String> |
+getArguments()
+Get the command line arguments of the executable.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getEnvironment()
+Get the environment of the executable.
+ |
+
java.lang.String |
+getExecutable()
+Get the path to the executable.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getJobOptions()
+Get a copy of the job options of this job.
+ |
+
int |
+getMaxMemory()
+Get the amount of memory needed for process (in MBytes).
+ |
+
int |
+getMaxRuntime()
+Get the maximum job duration time in minutes.
+ |
+
java.lang.String |
+getName()
+Get the job name.
+ |
+
int |
+getNodeCount()
+Get the number of nodes.
+ |
+
int |
+getProcessesPerNode()
+Get the number of processes to start on each node.
+ |
+
java.lang.String |
+getQueueName()
+Get the queue name;
+ |
+
java.util.List<java.lang.String> |
+getSchedulerArguments()
+Get the scheduler specific arguments.
+ |
+
java.lang.String |
+getStderr()
+Gets the path to the file to which the executable must redirect stderr.
+ |
+
java.lang.String |
+getStdin()
+Gets the path to the file from which the executable must redirect stdin.
+ |
+
java.lang.String |
+getStdout()
+Gets the path to the file to which the executable must redirect stdout.
+ |
+
int |
+getTempSpace()
+Get the amount of temp space needed for process (in MBytes).
+ |
+
int |
+getThreadsPerProcess()
+Get the number of threads needed per process.
+ |
+
java.lang.String |
+getWorkingDirectory()
+Gets the path of the working directory for the executable.
+ |
+
int |
+hashCode() |
+
boolean |
+isStartSingleProcess()
+Is only a single process started?
+ |
+
void |
+setArguments(java.lang.String... arguments)
+Sets the command line arguments of the executable.
+ |
+
void |
+setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
+Sets the environment of the executable.
+ |
+
void |
+setExecutable(java.lang.String executable)
+Sets the path to the executable.
+ |
+
void |
+setJobOptions(java.util.Map<java.lang.String,java.lang.String> options)
+Sets the job options of the job.
+ |
+
void |
+setMaxMemory(int maxMemoryInMB)
+Set the amount of memory needed for process (in MBytes).
+ |
+
void |
+setMaxRuntime(int minutes)
+Set the maximum job duration in minutes.
+ |
+
void |
+setName(java.lang.String name)
+Set the name of the job.
+ |
+
void |
+setNodeCount(int nodeCount)
+Set the number of nodes.
+ |
+
void |
+setProcessesPerNode(int processesPerNode)
+Set the number of processes started on each node.
+ |
+
void |
+setQueueName(java.lang.String queueName)
+Set the queue name;
+ |
+
void |
+setSchedulerArguments(java.lang.String... arguments)
+Sets the scheduler specific arguments for this job.
+ |
+
void |
+setStartSingleProcess(boolean startSingleProcess)
+Set if only a single process is started, instead of nodeCount * processesPerNode.
+ |
+
void |
+setStderr(java.lang.String stderr)
+Sets the path to the file to which the executable must redirect stderr.
+ |
+
void |
+setStdin(java.lang.String stdin)
+Sets the path to the file from which the executable must redirect stdin.
+ |
+
void |
+setStdout(java.lang.String stdout)
+Sets the path to the file to which the executable must redirect stdout.
+ |
+
void |
+setTempSpace(int tempSpaceInMB)
+Set the amount of memory needed for process (in MBytes).
+ |
+
void |
+setThreadsPerProcess(int threadsPerProcess)
+Set the number of threads needed per process.
+ |
+
void |
+setWorkingDirectory(java.lang.String workingDirectory)
+Sets the path of the working directory for the executable.
+ |
+
java.lang.String |
+toString() |
+
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public static final int DEFAULT_MAX_RUN_TIME_IN_MINUTES+
private java.lang.String queueName+
private java.lang.String executable+
private java.lang.String name+
private final java.util.List<java.lang.String> arguments+
private final java.util.List<java.lang.String> schedulerArguments+
private java.lang.String stdin+
private java.lang.String stdout+
private java.lang.String stderr+
private java.lang.String workingDirectory+
private final java.util.Map<java.lang.String,java.lang.String> environment+
private final java.util.Map<java.lang.String,java.lang.String> jobOptions+
private int nodeCount+
private int processesPerNode+
private int threadsPerProcess+
private int maxMemory+
private int tempSpace+
private boolean startSingleProcess+
private int maxRuntime+
public JobDescription()+
public JobDescription(JobDescription original)+
original
- JobDescription to copypublic java.lang.String getName()+
public void setName(java.lang.String name)+
name
- the name of the job;public int getNodeCount()+
public void setNodeCount(int nodeCount)+
nodeCount
- the number of nodes;public int getProcessesPerNode()+
public void setProcessesPerNode(int processesPerNode)+
processesPerNode
- the number of processes started on each node.public int getThreadsPerProcess()+
public void setThreadsPerProcess(int threadsPerProcess)+
threadsPerProcess
- the number of threads needed per process.public int getMaxMemory()+
public void setMaxMemory(int maxMemoryInMB)+
maxMemoryInMB
- the amount of memory needed per node/process.public int getTempSpace()+
public void setTempSpace(int tempSpaceInMB)+
tempSpaceInMB
- the amount of temp space needed per node/process.public boolean isStartSingleProcess()+
public void setStartSingleProcess(boolean startSingleProcess)+
startSingleProcess
- if only a single process is started.public java.lang.String getQueueName()+
public void setQueueName(java.lang.String queueName)+
queueName
- the queue name;public int getMaxRuntime()+
public void setMaxRuntime(int minutes)+
minutes
- the maximum job duration in minutes.public java.lang.String getExecutable()+
public void setExecutable(java.lang.String executable)+
executable
- the path to the executable.public java.util.List<java.lang.String> getArguments()+
public void setArguments(java.lang.String... arguments)+
arguments
- the command line arguments of the executable.public void addArgument(java.lang.String argument)+
null
or empty.argument
- the command line argument to add.public java.util.List<java.lang.String> getSchedulerArguments()+
public void setSchedulerArguments(java.lang.String... arguments)+
arguments
- the scheduler specific arguments.public void addSchedulerArgument(java.lang.String argument)+
null
or empty.argument
- the scheduler specific argument.public java.util.Map<java.lang.String,java.lang.String> getEnvironment()+
Map
of environment variables with their values (for example: "JAVA_HOME", "/path/to/java").public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)+
Map
of environment variables with their values (for example: "JAVA_HOME", "/path/to/java").environment
- environment of the executable.public void addEnvironment(java.lang.String key, + java.lang.String value)+
Map
of environment variables with their values (for example: "JAVA_HOME", "/path/to/java").
+
+ The key of an environment variable may not be null
or empty.key
- the unique key under which to store the value.value
- the value to store the value.public java.util.Map<java.lang.String,java.lang.String> getJobOptions()+
Map
of options variables with their values (for example: "PE", "MPI").public void setJobOptions(java.util.Map<java.lang.String,java.lang.String> options)+
Map
of options variables with their values (for example: "PE", "MPI").options
- job options of the job.public void addJobOption(java.lang.String key, + java.lang.String value)+
null
or empty.key
- the unique key under which to store the job option.value
- the value of the option to store.public void setStdin(java.lang.String stdin)+
stdin
- the path.public void setStdout(java.lang.String stdout)+
stdout
- the path.public void setStderr(java.lang.String stderr)+
stderr
- the path.public void setWorkingDirectory(java.lang.String workingDirectory)+
workingDirectory
- path of the working directory.public java.lang.String getStdin()+
public java.lang.String getStdout()+
public java.lang.String getStderr()+
public java.lang.String getWorkingDirectory()+
public java.lang.String toString()+
toString
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public interface JobStatus
+Modifier and Type | +Method and Description | +
---|---|
XenonException |
+getException()
+Get the exception produced by the Job or while retrieving the status.
+ |
+
java.lang.Integer |
+getExitCode()
+Get the exit code for the Job.
+ |
+
java.lang.String |
+getJobIdentifier()
+Get the job identifier of the Job for which this JobStatus was created.
+ |
+
java.lang.String |
+getName()
+Get the name of the Job for which this JobStatus was created.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getSchedulerSpecificInformation()
+Get scheduler specific information on the Job.
+ |
+
java.lang.String |
+getState()
+Get the state of the Job.
+ |
+
boolean |
+hasException()
+Has the Job or job retrieval produced a exception ?
+ |
+
boolean |
+isDone()
+Is the Job done.
+ |
+
boolean |
+isRunning()
+Is the Job running.
+ |
+
void |
+maybeThrowException()
+Throws the exception produced by the Job or while retrieving the status, if it exists.
+ |
+
java.lang.String getJobIdentifier()+
java.lang.String getName()+
java.lang.String getState()+
isRunning()
, isDone()
or hasException()
instead.java.lang.Integer getExitCode()+
XenonException getException()+
null
will be returned.
+
+ See maybeThrowException()
for the possible exceptions.void maybeThrowException() + throws XenonException+
JobCanceledException
- if the job was cancelledNoSuchJobException
- if the job of which the status was requested does not existXenonException
- if an I/O error occurred.boolean isRunning()+
boolean isDone()+
boolean hasException()+
java.util.Map<java.lang.String,java.lang.String> getSchedulerSpecificInformation()+
public class NoSuchJobException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
NoSuchJobException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NoSuchJobException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public class NoSuchQueueException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
NoSuchQueueException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NoSuchQueueException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public NoSuchQueueException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public NoSuchQueueException(java.lang.String adaptorName, + java.lang.String message)+
public interface QueueStatus
+Modifier and Type | +Method and Description | +
---|---|
XenonException |
+getException()
+Get the exception produced by the queue, or
+null if hasException() returns false . |
+
java.lang.String |
+getQueueName()
+Get the queue name.
+ |
+
Scheduler |
+getScheduler()
+Get the Scheduler that produced this QueueStatus.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getSchedulerSpecificInformation()
+Get scheduler specific information on the queue.
+ |
+
boolean |
+hasException()
+Did the queue produce an exception ?
+ |
+
void |
+maybeThrowException()
+Throws the exception produced by the queue if it exists.
+ |
+
Scheduler getScheduler()+
java.lang.String getQueueName()+
boolean hasException()+
XenonException getException()+
null
if hasException()
returns false
.
+
+ See maybeThrowException()
for the possible exceptions.void maybeThrowException() + throws XenonException+
NoSuchQueueException
- if the requested queue does not existXenonException
- if an I/O error occurred.java.util.Map<java.lang.String,java.lang.String> getSchedulerSpecificInformation()+
public abstract class Scheduler
+extends java.lang.Object
+implements java.lang.AutoCloseable
+Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+adaptor |
+
private static java.util.HashMap<java.lang.String,SchedulerAdaptor> |
+adaptors |
+
private static java.lang.String |
+COMPONENT_NAME
+The name of this component, for use in exceptions
+ |
+
private Credential |
+credential |
+
private java.lang.String |
+location |
+
protected XenonProperties |
+properties |
+
private java.lang.String |
+uniqueID |
+
Modifier | +Constructor and Description | +
---|---|
protected |
+Scheduler(java.lang.String uniqueID,
+ java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential,
+ XenonProperties properties) |
+
Modifier and Type | +Method and Description | +
---|---|
private static void |
+addAdaptor(SchedulerAdaptor adaptor) |
+
protected void |
+assertNonNullOrEmpty(java.lang.String s,
+ java.lang.String message) |
+
protected void |
+assertPositive(long value,
+ java.lang.String message) |
+
abstract JobStatus |
+cancelJob(java.lang.String jobIdentifier)
+Cancel a job.
+ |
+
abstract void |
+close()
+Close this Scheduler.
+ |
+
static Scheduler |
+create(java.lang.String adaptor)
+Create a new Scheduler using the
+adaptor connecting to the default location and using the default credentials to get access. |
+
static Scheduler |
+create(java.lang.String adaptor,
+ java.lang.String location)
+Create a new Scheduler using the
+adaptor connecting to the location using the default credentials to get access. |
+
static Scheduler |
+create(java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential)
+Create a new Scheduler using the
+adaptor connecting to the location using credentials to get access. |
+
static Scheduler |
+create(java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties)
+Create a new Scheduler using the
+adaptor connecting to the location using credentials to get access. |
+
boolean |
+equals(java.lang.Object o) |
+
private static SchedulerAdaptor |
+getAdaptorByName(java.lang.String adaptorName) |
+
static SchedulerAdaptorDescription |
+getAdaptorDescription(java.lang.String adaptorName)
+Gives the description of the adaptor with the given name.
+ |
+
static SchedulerAdaptorDescription[] |
+getAdaptorDescriptions()
+Gives a list of the descriptions of the available adaptors.
+ |
+
java.lang.String |
+getAdaptorName()
+Get the name of the adaptor that created this Scheduler.
+ |
+
static java.lang.String[] |
+getAdaptorNames()
+Gives a list names of the available adaptors.
+ |
+
Credential |
+getCredential()
+Get the credential that this Scheduler is using.
+ |
+
abstract java.lang.String |
+getDefaultQueueName()
+Get the name of the default queue.
+ |
+
abstract FileSystem |
+getFileSystem()
+Retrieve the
+FileSystem used internally by this Scheduler . |
+
abstract java.lang.String[] |
+getJobs(java.lang.String... queueNames)
+Get all job identifier of jobs currently in (one ore more) queues.
+ |
+
abstract JobStatus |
+getJobStatus(java.lang.String jobIdentifier)
+Get the status of a Job.
+ |
+
JobStatus[] |
+getJobStatuses(java.lang.String... jobIdentifiers)
+Get the status of all specified
+jobs . |
+
java.lang.String |
+getLocation()
+Get the location that this Scheduler is connected to.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getProperties()
+Get the properties used to create this Scheduler.
+ |
+
abstract java.lang.String[] |
+getQueueNames()
+Get the queue names supported by this Scheduler.
+ |
+
abstract QueueStatus |
+getQueueStatus(java.lang.String queueName)
+Get the status of the
+queue . |
+
abstract QueueStatus[] |
+getQueueStatuses(java.lang.String... queueNames)
+Get the status of all
+queues . |
+
int |
+hashCode() |
+
abstract boolean |
+isOpen()
+Test if the connection of this Scheduler is open.
+ |
+
abstract java.lang.String |
+submitBatchJob(JobDescription description)
+Submit a batch job.
+ |
+
abstract Streams |
+submitInteractiveJob(JobDescription description)
+Submit an interactive job (optional operation).
+ |
+
abstract JobStatus |
+waitUntilDone(java.lang.String jobIdentifier,
+ long timeout)
+Wait until a job is done or until a timeout expires.
+ |
+
abstract JobStatus |
+waitUntilRunning(java.lang.String jobIdentifier,
+ long timeout)
+Wait until a job starts running, or until a timeout expires.
+ |
+
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
private static final java.lang.String COMPONENT_NAME+
private static final java.util.HashMap<java.lang.String,SchedulerAdaptor> adaptors+
private final java.lang.String uniqueID+
private final java.lang.String adaptor+
private final java.lang.String location+
private final Credential credential+
protected final XenonProperties properties+
protected Scheduler(java.lang.String uniqueID, + java.lang.String adaptor, + java.lang.String location, + Credential credential, + XenonProperties properties)+
private static void addAdaptor(SchedulerAdaptor adaptor)+
private static SchedulerAdaptor getAdaptorByName(java.lang.String adaptorName) + throws UnknownAdaptorException+
UnknownAdaptorException
public static java.lang.String[] getAdaptorNames()+
public static SchedulerAdaptorDescription getAdaptorDescription(java.lang.String adaptorName) + throws UnknownAdaptorException+
adaptorName
- the type of scheduler to connect to (e.g. "slurm" or "torque")UnknownAdaptorException
- If the adaptor name is absent in getAdaptorNames()
.public static SchedulerAdaptorDescription[] getAdaptorDescriptions()+
public static Scheduler create(java.lang.String adaptor, + java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
adaptor
connecting to the location
using credentials
to get access. Use
+ properties
to (optionally) configure the scheduler when it is created.
+
+ Make sure to always close Scheduler
instances by calling Scheduler.close()
when you no longer need them, otherwise their associated
+ resources may remain allocated.adaptor
- the adaptor used to access the Scheduler.location
- the location of the Scheduler.credential
- the Credentials to use to get access to the Scheduler.properties
- optional properties to configure the Scheduler when it is created.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the Scheduler failed.java.lang.IllegalArgumentException
- If adaptor is null.public static Scheduler create(java.lang.String adaptor, + java.lang.String location, + Credential credential) + throws XenonException+
adaptor
connecting to the location
using credentials
to get access.
+
+ Make sure to always close Scheduler
instances by calling Scheduler.close()
when you no longer need them, otherwise their associated
+ resources may remain allocated.adaptor
- the adaptor used to access the Scheduler.location
- the location of the Scheduler.credential
- the Credentials to use to get access to the Scheduler.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the Scheduler failed.java.lang.IllegalArgumentException
- If adaptor is null.public static Scheduler create(java.lang.String adaptor, + java.lang.String location) + throws XenonException+
adaptor
connecting to the location
using the default credentials to get access.
+
+ Make sure to always close Scheduler
instances by calling Scheduler.close()
when you no longer need them, otherwise their associated
+ resources may remain allocated.adaptor
- the adaptor used to access the Scheduler.location
- the location of the Scheduler.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the Scheduler failed.java.lang.IllegalArgumentException
- If adaptor is null.public static Scheduler create(java.lang.String adaptor) + throws XenonException+
adaptor
connecting to the default location and using the default credentials to get access.
+
+ Note that there are very few adaptors that support a default scheduler location. The local scheduler adaptor is the prime example.
+
+ Make sure to always close Scheduler
instances by calling Scheduler.close()
when you no longer need them, otherwise their associated
+ resources may remain allocated.adaptor
- the adaptor used to access the Scheduler.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the Scheduler failed.java.lang.IllegalArgumentException
- If adaptor is null.public java.lang.String getAdaptorName()+
public java.lang.String getLocation()+
public Credential getCredential()+
public java.util.Map<java.lang.String,java.lang.String> getProperties()+
public abstract java.lang.String[] getQueueNames() + throws XenonException+
NotConnectedException
- If scheduler is closed.XenonException
- If an I/O error occurred.public abstract void close() + throws XenonException+
close
in interface java.lang.AutoCloseable
XenonException
- If the Scheduler failed to close.public abstract boolean isOpen() + throws XenonException+
true
if the connection of this Scheduler is still open, false
otherwise.XenonException
- If an I/O error occurred.public abstract java.lang.String getDefaultQueueName() + throws XenonException+
null
if no default queue is available.NotConnectedException
- If scheduler is closed.XenonException
- If an I/O error occurred.public abstract java.lang.String[] getJobs(java.lang.String... queueNames) + throws XenonException+
queueNames
- the names of the queues.NotConnectedException
- If scheduler is closed.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get jobs.public abstract QueueStatus getQueueStatus(java.lang.String queueName) + throws XenonException+
queue
.queueName
- the name of the queue.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get its status.public abstract QueueStatus[] getQueueStatuses(java.lang.String... queueNames) + throws XenonException+
queues
.
+
+ Note that this method will only throw an exception when this exception will influence all status requests. For example, if the scheduler is no longer
+ connected.
+
+ Exceptions that only refer to a single queue are returned in the QueueStatus returned for that queue.queueNames
- the names of the queues.XenonException
- If the Scheduler failed to get the statuses.public abstract java.lang.String submitBatchJob(JobDescription description) + throws XenonException+
description
- the description of the batch job to submit.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public abstract Streams submitInteractiveJob(JobDescription description) + throws XenonException+
description
- the description of the interactive job to submit.Streams
object containing the job identifier and the standard streams of a job.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public abstract JobStatus getJobStatus(java.lang.String jobIdentifier) + throws XenonException+
jobIdentifier
- the job identifier of the job to get the status for.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public JobStatus[] getJobStatuses(java.lang.String... jobIdentifiers) + throws XenonException+
jobs
.
+
+ The array of JobStatus
contains one entry for each of the jobs
. The order of the elements in the returned
+ JobStatus
array corresponds to the order in which the jobs
are passed as parameters. If a job
is
+ null
, the corresponding entry in the JobStatus
array will also be null
. If the retrieval of the
+ JobStatus
fails for a job, the exception will be stored in the corresponding JobsStatus
entry.
+
jobIdentifiers
- the job identifiers for which to retrieve the status.XenonException
- If an I/O error occurredpublic abstract JobStatus cancelJob(java.lang.String jobIdentifier) + throws XenonException+
+ A status is returned that indicates the state of the job after the cancel. If the job was already done it cannot be cancelled. +
+
+ A JobStatus
is returned that can be used to determine the state of the job after cancelJob returns. Note that it may take some time before the
+ job has actually terminated. The waitUntilDone
method can be used to wait until the job is terminated.
+
jobIdentifier
- the identifier of job to kill.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public abstract JobStatus waitUntilDone(java.lang.String jobIdentifier, + long timeout) + throws XenonException+
+ This method will wait until a job is done (either gracefully or by being killed or producing an error), or until the timeout expires, whichever comes + first. If the timeout expires, the job will continue to run. +
++ The timeout is in milliseconds and must be >= 0. When timeout is 0, it will be ignored and this method will wait until the jobs is done. +
++ A JobStatus is returned that can be used to determine why the call returned. +
jobIdentifier
- the identifier of the to wait for.timeout
- the maximum time to wait for the job in milliseconds.java.lang.IllegalArgumentException
- If the value of timeout is negativeNoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public abstract JobStatus waitUntilRunning(java.lang.String jobIdentifier, + long timeout) + throws XenonException+
+ This method will return as soon as the job is no longer waiting in the queue, or when the timeout expires, whichever comes first. If the job is no longer + waiting in the queue, it may be running, but it may also be killed, finished or have produced an error. If the timeout expires, the job will continue to + be queued normally. +
++ The timeout is in milliseconds and must be >= 0. When timeout is 0, it will be ignored and this method will wait until the job is no longer queued. +
++ A JobStatus is returned that can be used to determine why the call returned. +
jobIdentifier
- the identifier of the to wait for.timeout
- the maximum time to wait in milliseconds.java.lang.IllegalArgumentException
- If the value of timeout is negativeNoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public abstract FileSystem getFileSystem() + throws XenonException+
FileSystem
used internally by this Scheduler
.
+
+ Often, a Scheduler
needs to access files or directories on the machine it will schedule jobs. For example, to ensure a working directory
+ exists, or to redirect the stdin, stdout or stderr streams used by a job.
+
+ This method returns this FileSystem
so it can also be used by the application to prepare input files for the jobs, or retrieve the output
+ files produced by the jobs.
+
FileSystem
used by this Scheduler.XenonException
- if this Scheduler does not use a FileSystem
internally.protected void assertNonNullOrEmpty(java.lang.String s, + java.lang.String message)+
protected void assertPositive(long value, + java.lang.String message)+
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public interface SchedulerAdaptorDescription +extends AdaptorDescription+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+isEmbedded()
+Is this an embedded scheduler ?
+
+ Embedded schedulers are implemented inside the Xenon process itself.
+ |
+
boolean |
+supportsBatch()
+Does this Scheduler support the submission of batch jobs ?
+
+ For batch jobs the standard streams of the jobs are redirected from and to files.
+ |
+
boolean |
+supportsInteractive()
+Does this Scheduler supports the submission of interactive jobs ?
+
+ For interactive jobs the standard streams of the job must be handled by the submitting process.
+ |
+
boolean |
+usesFileSystem()
+Does this Scheduler create a FileSystem to support the submission of jobs ?
+
+ Many scheduler implementations use a FileSystem internally to handle job submission, for example to store submission scripts or handle the standard I/O
+ streams of a process.
+ |
+
getDescription, getName, getSupportedCredentials, getSupportedLocations, getSupportedProperties
boolean isEmbedded()+
boolean supportsBatch()+
boolean supportsInteractive()+
boolean usesFileSystem()+
Scheduler.getFileSystem()
method.Scheduler
create a FileSystem to support the submission of jobs ?public interface Streams
+Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getJobIdentifier()
+Get the identifier of the job for which this Streams was created.
+ |
+
java.io.InputStream |
+getStderr()
+Returns the standard error stream of job.
+ |
+
java.io.OutputStream |
+getStdin()
+Returns the standard input stream of job.
+ |
+
java.io.InputStream |
+getStdout()
+Returns the standard output stream of job.
+ |
+
java.lang.String getJobIdentifier()+
java.io.InputStream getStdout()+
java.io.InputStream getStderr()+
java.io.OutputStream getStdin()+
public class UnsupportedJobDescriptionException +extends XenonException+
Modifier and Type | +Field and Description | +
---|---|
private static long |
+serialVersionUID |
+
Constructor and Description | +
---|
UnsupportedJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message) |
+
UnsupportedJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final long serialVersionUID+
public UnsupportedJobDescriptionException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public UnsupportedJobDescriptionException(java.lang.String adaptorName, + java.lang.String message)+
See: Description
+Interface | +Description | +
---|---|
JobStatus | +
+ JobStatus contains status information for a specific job.
+ |
+
QueueStatus | +
+ QueueStatus contains status information for a specific queue.
+ |
+
SchedulerAdaptorDescription | ++ |
Streams | +
+ Streams is a container for the standard input, output and error streams of a job.
+ |
+
Class | +Description | +
---|---|
JobDescription | +
+ JobDescription contains a description of a job that can be submitted to a
+Scheduler . |
+
Scheduler | +
+ Scheduler represents a (possibly remote) scheduler that can be used to submit jobs and retrieve queue information.
+ |
+
Exception | +Description | +
---|---|
IncompleteJobDescriptionException | +
+ Signals that a JobDescription is missing required options.
+ |
+
InvalidJobDescriptionException | +
+ Signals that a JobDescription contains invalid values for certain options.
+ |
+
NoSuchJobException | +
+ Signals that a Job was not found.
+ |
+
NoSuchQueueException | +
+ Signals that a unknown queue was provided.
+ |
+
UnsupportedJobDescriptionException | +
+ Signals that a combination of options used in a JobDescription is not supported by a resource.
+ |
+
public final class InputWriter
+extends java.lang.Thread
+String
to an OutputStream
.
+ Once the end of the string is reached, the destination stream will be closed.java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
Modifier and Type | +Field and Description | +
---|---|
private java.lang.String |
+content |
+
private java.io.OutputStream |
+destination |
+
private boolean |
+finished |
+
private static org.slf4j.Logger |
+LOGGER |
+
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description | +
---|
InputWriter(java.lang.String content,
+ java.io.OutputStream destination)
+Create a new InputWriter that writes
+content to the destination . |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+isFinished()
+Poll if the InputWriter has finished writing.
+ |
+
void |
+run()
+Entry point for the Daemon thread.
+ |
+
private void |
+setFinished() |
+
void |
+waitUntilFinished()
+Wait until the InputWriter has finished writing.
+ |
+
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private final java.lang.String content+
private final java.io.OutputStream destination+
private boolean finished+
public InputWriter(java.lang.String content, + java.io.OutputStream destination)+
content
to the destination
.content
- the data to write to the destination.destination
- the destination to write to.private void setFinished()+
public boolean isFinished()+
public void waitUntilFinished()+
public void run()+
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public class JavaJobDescription +extends JobDescription+
Modifier and Type | +Field and Description | +
---|---|
private java.util.List<java.lang.String> |
+javaArguments |
+
private java.util.List<java.lang.String> |
+javaClasspath |
+
private java.lang.String |
+javaMain |
+
private java.util.List<java.lang.String> |
+javaOptions |
+
private java.util.Map<java.lang.String,java.lang.String> |
+javaSystemProperties |
+
DEFAULT_MAX_RUN_TIME_IN_MINUTES
Constructor and Description | +
---|
JavaJobDescription() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addJavaArgument(java.lang.String javaArgument) |
+
void |
+addJavaClasspathElement(java.lang.String element) |
+
void |
+addJavaOption(java.lang.String option)
+Adds a JVM option.
+ |
+
void |
+addJavaSystemProperty(java.lang.String key,
+ java.lang.String value)
+Adds a system property to the current set of system properties.
+ |
+
boolean |
+equals(java.lang.Object obj) |
+
java.util.List<java.lang.String> |
+getArguments()
+Constructs the command line arguments from the class path, the JVM options, the system properties, the main and the java arguments.
+ |
+
java.util.List<java.lang.String> |
+getArguments(char pathSeparator)
+Constructs the command line arguments from the class path, the JVM options, the system properties, the main and the java arguments.
+ |
+
java.lang.String |
+getExecutable()
+Returns the executable.
+ |
+
java.util.List<java.lang.String> |
+getJavaArguments()
+Returns the arguments for the main class.
+ |
+
java.util.List<java.lang.String> |
+getJavaClasspath()
+Returns the java class path.
+ |
+
java.lang.String |
+getJavaMain()
+Returns the main class of the java application.
+ |
+
java.util.List<java.lang.String> |
+getJavaOptions()
+Returns the JVM options.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getJavaSystemProperties()
+Returns the java system properties.
+ |
+
int |
+hashCode() |
+
void |
+setArguments(java.lang.String... arguments)
+This method should not be used.
+ |
+
void |
+setJavaArguments(java.lang.String... javaArguments)
+Sets the arguments of the java main class.
+ |
+
void |
+setJavaClasspath(java.lang.String... javaClasspath)
+Sets the java class path.
+ |
+
void |
+setJavaMain(java.lang.String main)
+Sets the main class.
+ |
+
void |
+setJavaOptions(java.lang.String... options)
+Sets the JVM options.
+ |
+
void |
+setJavaSystemProperties(java.util.Map<java.lang.String,java.lang.String> systemProperties)
+Sets the system properties.
+ |
+
java.lang.String |
+toString() |
+
addArgument, addEnvironment, addJobOption, addSchedulerArgument, getEnvironment, getJobOptions, getMaxMemory, getMaxRuntime, getName, getNodeCount, getProcessesPerNode, getQueueName, getSchedulerArguments, getStderr, getStdin, getStdout, getTempSpace, getThreadsPerProcess, getWorkingDirectory, isStartSingleProcess, setEnvironment, setExecutable, setJobOptions, setMaxMemory, setMaxRuntime, setName, setNodeCount, setProcessesPerNode, setQueueName, setSchedulerArguments, setStartSingleProcess, setStderr, setStdin, setStdout, setTempSpace, setThreadsPerProcess, setWorkingDirectory
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
private final java.util.List<java.lang.String> javaOptions+
private final java.util.Map<java.lang.String,java.lang.String> javaSystemProperties+
private java.lang.String javaMain+
private final java.util.List<java.lang.String> javaArguments+
private final java.util.List<java.lang.String> javaClasspath+
public java.util.List<java.lang.String> getJavaOptions()+
public void setJavaOptions(java.lang.String... options)+
options
- the JVM options.public void addJavaOption(java.lang.String option)+
option
- the JVM option.public java.util.Map<java.lang.String,java.lang.String> getJavaSystemProperties()+
public void setJavaSystemProperties(java.util.Map<java.lang.String,java.lang.String> systemProperties)+
systemProperties
- the system properties.public void addJavaSystemProperty(java.lang.String key, + java.lang.String value)+
key
- the key of the system property to be addedvalue
- the value belonging to the key of the system property to be addedpublic java.lang.String getJavaMain()+
public void setJavaMain(java.lang.String main)+
main
- the main class.public java.util.List<java.lang.String> getJavaArguments()+
public void setJavaArguments(java.lang.String... javaArguments)+
javaArguments
- the arguments of the java main class.public void addJavaArgument(java.lang.String javaArgument)+
public void setArguments(java.lang.String... arguments)+
setJavaClasspath(String...)
,
+ setJavaOptions(String[])
, setJavaSystemProperties(Map)
, setJavaMain(String)
and setJavaArguments(String[])
should be
+ used to construct the command line arguments.setArguments
in class JobDescription
arguments
- do not usepublic java.util.List<java.lang.String> getArguments()+
getArguments
in class JobDescription
public java.util.List<java.lang.String> getArguments(char pathSeparator)+
pathSeparator
- the seperator to use in the classpath. Defaults to the unix path seperator ':'public java.lang.String getExecutable()+
getExecutable
in class JobDescription
public java.util.List<java.lang.String> getJavaClasspath()+
public void setJavaClasspath(java.lang.String... javaClasspath)+
javaClasspath
- the class path to be set.public void addJavaClasspathElement(java.lang.String element)+
public java.lang.String toString()+
toString
in class JobDescription
public int hashCode()+
hashCode
in class JobDescription
public boolean equals(java.lang.Object obj)+
equals
in class JobDescription
public class LocalFileSystemUtils
+extends java.lang.Object
+Modifier and Type | +Field and Description | +
---|---|
private static java.lang.String |
+OS_PROPERTY |
+
Modifier | +Constructor and Description | +
---|---|
private |
+LocalFileSystemUtils() |
+
Modifier and Type | +Method and Description | +
---|---|
static java.lang.String |
+expandTilde(java.lang.String path)
+Expand the tilde in a String representation of a path by the users home directory, as provided by the
+user.home property. |
+
static FileSystem[] |
+getLocalFileSystems()
+Returns all local FileSystems.
+ |
+
static java.lang.String |
+getLocalRoot(java.lang.String p)
+Return the locally valid root element of an
+String representation of an absolute path. |
+
static java.lang.String |
+getLocalRootlessPath(java.lang.String path)
+Return the local root less path of an absolute path.
+ |
+
static char |
+getLocalSeparator()
+Returns the local file system path separator character.
+ |
+
static boolean |
+isLinux()
+Returns if we are currently running on Linux.
+ |
+
static boolean |
+isLinuxRoot(java.lang.String root)
+Check if
+root only contains a valid Linux root element, which is "/". |
+
static boolean |
+isLocalRoot(java.lang.String root)
+Check if
+root contains a locally valid root element, such as "C:" on Windows or "/" on Linux and OSX. |
+
static boolean |
+isOSX()
+Returns if we are currently running on OSX.
+ |
+
static boolean |
+isOSXRoot(java.lang.String root)
+Check if
+root contains a valid OSX root element, which is "/". |
+
static boolean |
+isWindows()
+Returns if we are currently running on Windows.
+ |
+
static boolean |
+isWindowsRoot(java.lang.String root)
+Check if
+root only contains a valid Windows root element such as "C:". |
+
static boolean |
+startsWithLinuxRoot(java.lang.String path)
+Checks if the provide path starts with a valid Linux root, that is "/".
+ |
+
static boolean |
+startWithRoot(java.lang.String path)
+Checks if the provide path starts with a valid root, such as "/" or "C:".
+ |
+
static boolean |
+startWithWindowsRoot(java.lang.String path)
+Checks if the provide path starts with a valid Windows root, for example "C:".
+ |
+
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final java.lang.String OS_PROPERTY+
public static boolean isWindows()+
public static boolean isOSX()+
public static boolean isLinux()+
public static boolean isWindowsRoot(java.lang.String root)+
root
only contains a valid Windows root element such as "C:".
+
+ If root
is null
or empty, false
will be returned. If root
contains more than just a root element,
+ false
will be returned.root
- The root to check.root
only contains a valid Windows root element.public static boolean isLinuxRoot(java.lang.String root)+
root
only contains a valid Linux root element, which is "/".
+
+ If root
is null
or empty, false
will be returned. If root
contains more than just a root element,
+ false
will be returned.root
- The root to check.root
only contains a valid Linux root element.public static boolean isOSXRoot(java.lang.String root)+
root
contains a valid OSX root element, which is "/".
+
+ If root
is null
or empty, false
will be returned. If root
contains more than just a root element,
+ false
will be returned.root
- The root to check.root
only contains a valid OSX root element.public static boolean isLocalRoot(java.lang.String root)+
root
contains a locally valid root element, such as "C:" on Windows or "/" on Linux and OSX.
+
+ If root
is null
or empty, false
will be returned. If root
contains more than just a root element,
+ false
will be returned.
+
+ Note that the result of this method depends on the OS the application is running on.root
- The root to check.root
only contains a valid OSX root element.public static boolean startsWithLinuxRoot(java.lang.String path)+
path
- The path to check.public static boolean startWithWindowsRoot(java.lang.String path)+
path
- The path to check.public static boolean startWithRoot(java.lang.String path)+
path
- The path to check.public static java.lang.String getLocalRoot(java.lang.String p) + throws InvalidLocationException+
String
representation of an absolute path.
+
+ Examples of a root elements are "/" or "C:". If the provided path does not contain a locally valid root element, an exception will be thrown. For
+ example, providing "/user/local" will return "/" on Linux or OSX, but throw an exception on Windows; providing "C:\test" will return "C:" on Windows but
+ throw an exception on Linux or OSX.
+
+ If the provided string is null
or empty, the default root element for this OS will be returned, i.e,. "/" on Linux or OSX and "C:" on
+ windows.p
- The absolute path for which to determine the root element.InvalidLocationException
- If the provided path
is not absolute, or does not contain a locally valid root.public static java.lang.String expandTilde(java.lang.String path)+
user.home
property.
+
+ The tilde will only be replaced if it is the first character in the path and either the only character in the path or directly followed by the local
+ separator character or directly followed by the local user name (as provided by the user.name
property).
+
+ For example, if user.name
is set to "john" and user.home
is set to "/home/john", then "~" will be expanded to "/home/john",
+ "~/foo" or "~john/foo" will be expanded to "/home/john/foo".
+
+ However, in paths like "/foo/bar", "~matt/foo" or "/foo/~" the tilde will not be expanded, and the provided path is returned unchanged. This includes a
+ path that is null
.
+
+ If the user.home
property is not set, the tilde will not be expanded and the provided path will be returned unchanged. If the
+ user.name
property is not set, the combined tilde-username expansion will not be performed.path
- the path in which to replace the tilde (if possible).public static java.lang.String getLocalRootlessPath(java.lang.String path)+
path
- The absolute path from which to remove the root element.public static char getLocalSeparator()+
public static FileSystem[] getLocalFileSystems() + throws XenonException+
FileSystems
representing each of these roots.XenonException
- If the creation of the FileSystem failed.public final class OutputReader
+extends java.lang.Thread
+InputStream
and buffer this data. Once
+ end-of-stream is reached, this data will be made available as a String
.
+
+ Note that since the data is buffered in memory, so it is not advisable to use this OutputReader to read large amounts of data.java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
Modifier and Type | +Field and Description | +
---|---|
private java.nio.ByteBuffer |
+buffer |
+
private static int |
+BUFFER_SIZE |
+
private boolean |
+finished |
+
private java.io.InputStream |
+source |
+
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description | +
---|
OutputReader(java.io.InputStream source)
+Create an OutputReader that reads from
+source . |
+
Modifier and Type | +Method and Description | +
---|---|
private void |
+addToBuffer(byte[] bytes,
+ int length) |
+
byte[] |
+getResult()
+Returns the data that has been read from the
+InputStream as a byte array. |
+
java.lang.String |
+getResultAsString()
+Returns the data that has been read from the
+InputStream as a String . |
+
boolean |
+isFinished()
+Returns if the OutputReader has finished (i.e., has reached the end-of-stream on the input).
+ |
+
void |
+run()
+Entry method for daemon thread.
+ |
+
private void |
+setFinished() |
+
void |
+waitUntilFinished()
+Waits until the OutputReader has finished (i.e., has reached the end-of-stream on the input).
+ |
+
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final int BUFFER_SIZE+
private final java.io.InputStream source+
private java.nio.ByteBuffer buffer+
private boolean finished+
public OutputReader(java.io.InputStream source)+
source
.source
- the {#link InputStream} to read from.private void setFinished()+
public boolean isFinished()+
getResultAsString()
.public void waitUntilFinished()+
getResultAsString()
.private void addToBuffer(byte[] bytes, + int length)+
public void run()+
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.lang.String getResultAsString()+
InputStream
as a String
. If the
+ OutputReader has not finished reading, this method will block until end-of-stream has been reached.public byte[] getResult()+
InputStream
as a byte array. If the
+ OutputReader has not finished reading, this method will block until end-of-stream has been reached.public final class StreamForwarder
+extends java.lang.Thread
+InputStream
and write it to a OutputStream
. A small
+ buffer is used (typically 1 KB) to improve performance. Any exceptions will be ignored.java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
Modifier and Type | +Field and Description | +
---|---|
private int |
+bufferSize |
+
private static int |
+DEFAULT_BUFFER_SIZE |
+
private boolean |
+done |
+
private java.io.InputStream |
+in |
+
private static org.slf4j.Logger |
+LOGGER |
+
private java.io.OutputStream |
+out |
+
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description | +
---|
StreamForwarder(java.io.InputStream in,
+ java.io.OutputStream out)
+Create a new StreamForwarder and start it immediately.
+ |
+
StreamForwarder(java.lang.String name,
+ java.io.InputStream in,
+ java.io.OutputStream out,
+ int bufferSize)
+Create a new StreamForwarder and start it immediately.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
private void |
+close(java.io.Closeable c,
+ java.lang.String error)
+Closes the input stream, thereby stopping the stream forwarder, and closing the output stream.
+ |
+
private void |
+done()
+Tell the daemon thread that we are done.
+ |
+
void |
+run()
+Main entry method for the daemon thread.
+ |
+
void |
+terminate(long timeout)
+Wait for a given timeout for the StreamForwarder to terminate by reading an end-of-stream on the input.
+ |
+
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
private static final org.slf4j.Logger LOGGER+
private static final int DEFAULT_BUFFER_SIZE+
private final java.io.InputStream in+
private final java.io.OutputStream out+
private final int bufferSize+
private boolean done+
public StreamForwarder(java.lang.String name, + java.io.InputStream in, + java.io.OutputStream out, + int bufferSize)+
name
- the name of the threadin
- the InputStream
to read from.out
- the OutputStream
to write to, or null
to discard the output.bufferSize
- the buffer size to use, or 0 to use the default.public StreamForwarder(java.io.InputStream in, + java.io.OutputStream out)+
in
- the InputStream
to read from.out
- the OutputStream
to write to.private void close(java.io.Closeable c, + java.lang.String error)+
c
- The Closeable
to close (i.e., the InputStream
or OutputStream
)error
- The error message to print if the close results in an Exceptionprivate void done()+
public void terminate(long timeout)+
timeout
- The number of milliseconds to wait for termination.public void run()+
run
in interface java.lang.Runnable
run
in class java.lang.Thread
See: Description
+Class | +Description | +
---|---|
InputWriter | +
+ A simple input writer that uses a daemon thread to write from an
+String to an OutputStream . |
+
JavaJobDescription | +
+ A JobDescription specialized in Java applications.
+ |
+
LocalFileSystemUtils | ++ |
OutputReader | +
+ A simple output reader that uses a daemon thread to read from an
+InputStream and buffer this data. |
+
StreamForwarder | +
+ A simple stream forwarder that uses a daemon thread to read from an
+InputStream and write it to a OutputStream . |
+
+ + diff --git a/docs/versions/2.6.2/javadoc-devel/overview-summary.html b/docs/versions/2.6.2/javadoc-devel/overview-summary.html new file mode 100644 index 000000000..5efaadefb --- /dev/null +++ b/docs/versions/2.6.2/javadoc-devel/overview-summary.html @@ -0,0 +1,804 @@ + + + + + +
See: Description
+The main entry points are
+This section contains the adaptor documentation which is generated from the information provided by the adaptors themselves.
+The local jobs adaptor implements all functionality by emulating a local queue.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.local.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.local.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq. | +INTEGER | +4 | +
The SSH job adaptor implements all functionality to start jobs on ssh servers.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.ssh.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.agentForwarding |
+Use ssh-agent forwarding | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.timeout |
+The timeout for the connection setup and authetication (in milliseconds). | +LONG | +10000 | +
xenon.adaptors.schedulers.ssh.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq.. | +INTEGER | +4 | +
The SGE Adaptor submits jobs to a (Sun/Oracle/Univa) Grid Engine scheduler. This adaptor uses either the local or the ssh scheduler adaptor to run commands on the machine running Grid Engine, and the file or the stfp filesystem adaptor to gain access to the filesystem of that machine.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.gridengine.ignore.version |
+Skip version check is skipped when connecting to remote machines. WARNING: it is not recommended to use this setting in production environments! | +BOOLEAN | +false | +
xenon.adaptors.schedulers.gridengine.accounting.grace.time |
+Number of milliseconds a job is allowed to take going from the queue to the qacct output. | +LONG | +60000 | +
xenon.adaptors.schedulers.gridengine.poll.delay |
+Number of milliseconds between polling the status of a job. | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.agentForwarding |
+Use ssh-agent forwarding | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.timeout |
+The timeout for the connection setup and authetication (in milliseconds). | +LONG | +10000 | +
xenon.adaptors.schedulers.ssh.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq.. | +INTEGER | +4 | +
xenon.adaptors.schedulers.local.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.local.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq. | +INTEGER | +4 | +
The Slurm Adaptor submits jobs to a Slurm scheduler. This adaptor uses either the local or the ssh scheduler adaptor to run commands on the machine running Slurm, and the file or the stfp filesystem adaptor to gain access to the filesystem of that machine.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.slurm.disable.accounting.usage |
+Do not use accounting info of slurm, even when available. Mostly for testing purposes | +BOOLEAN | +false | +
xenon.adaptors.schedulers.slurm.poll.delay |
+Number of milliseconds between polling the status of a job. | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.agentForwarding |
+Use ssh-agent forwarding | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.timeout |
+The timeout for the connection setup and authetication (in milliseconds). | +LONG | +10000 | +
xenon.adaptors.schedulers.ssh.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq.. | +INTEGER | +4 | +
xenon.adaptors.schedulers.local.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.local.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq. | +INTEGER | +4 | +
The Torque Adaptor submits jobs to a TORQUE batch system. This adaptor uses either the local or the ssh scheduler adaptor to run commands on the machine running TORQUE, and the file or the stfp filesystem adaptor to gain access to the filesystem of that machine.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.torque.ignore.version |
+Skip version check is skipped when connecting to remote machines. WARNING: it is not recommended to use this setting in production environments! | +BOOLEAN | +false | +
xenon.adaptors.schedulers.torque.accounting.grace.time |
+Number of milliseconds a job is allowed to take going from the queue to the accinfo output. | +LONG | +60000 | +
xenon.adaptors.schedulers.torque.poll.delay |
+Number of milliseconds between polling the status of a job. | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.agentForwarding |
+Use ssh-agent forwarding | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.timeout |
+The timeout for the connection setup and authetication (in milliseconds). | +LONG | +10000 | +
xenon.adaptors.schedulers.ssh.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq.. | +INTEGER | +4 | +
xenon.adaptors.schedulers.local.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.local.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq. | +INTEGER | +4 | +
This is the local file adaptor that implements file functionality for local access.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.file.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
The FTP adaptor implements file access on remote ftp servers.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.ftp.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
The SFTP adaptor implements all file access functionality to remote SFTP servers
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.sftp.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.filesystems.sftp.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.filesystems.sftp.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.filesystems.sftp.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.filesystems.sftp.agentForwarding |
+Use ssh-agent forwarding when setting up a connection. | +BOOLEAN | +false | +
xenon.adaptors.filesystems.sftp.connection.timeout |
+The timeout for creating and authenticating connections (in milliseconds). | +NATURAL | +10000 | +
xenon.adaptors.filesystems.sftp.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
The webdav file adaptor implements file access to remote webdav servers.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.webdav.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
The JClouds adaptor uses Apache JClouds to talk to s3 and others
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.s3.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
Adaptor for the Apache Hadoop file system
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.hdfs.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
xenon.adaptors.filesystems.hdfs.hadoopSettingsFile |
+The path to the file with the hadoop settings, i.e. "/home/xenon/core-site.xml". | +STRING | ++ |
java.lang.String adaptorName+
java.lang.String adaptorName+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final char |
+DEFAULT_SEPARATOR |
+47 |
+
Modifier and Type | +Constant Field | +Value | +
---|---|---|
+
+public static final int |
+DEFAULT_MAX_RUN_TIME_IN_MINUTES |
+15 |
+
The Overview page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.
+Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain six categories:
+Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:
+Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.
+Each annotation type has its own separate page with the following sections:
+Each enum has its own separate page with the following sections:
+There is a Class Hierarchy page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object
. The interfaces do not inherit from java.lang.Object
.
The Deprecated API page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.
+The Index contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.
+These links take you to the next or previous class, interface, package, or related page.
+These links show and hide the HTML frames. All pages are available with or without frames.
+The All Classes link shows all classes and interfaces except non-static nested types.
+Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
+The Constant Field Values page lists the static final fields and their values.
+OutputStream
to append data to this file.CertificateCredential
out of a username, a certificate file containing a private key, and an optional passphrase.PosixFilePermission
s contains a specific option.key
is stored in this CredentialMap.adaptor
that connects to a data store at location
using the credentials
to get
+ access.adaptor
that connects to a data store at location
using the credentials
to get
+ access.adaptor
that connects to a data store at location
using the default credentials to get
+ access.adaptor
that connects to a data store at the default location using the default credentials to get access.adaptor
connecting to the location
using credentials
to get access.adaptor
connecting to the location
using credentials
to get access.adaptor
connecting to the location
using the default credentials to get access.adaptor
connecting to the default location and using the default credentials to get access.Credential
consisting of a collection of Credentials each uniquely identified by a String (typically a host name or host alias).null
as the default credential.CredentialMap
and set the default credential to defaultCredential
.user.home
property.UserCredential
stored using the key
.PathAttributes
of an existing path.UserCredential
.null
if hasException()
returns false
.null
if the Path is empty.String
, or null
if the Path is empty.FileSystem
used internally by this Scheduler
.jobs
.String
representation of an absolute path.null
if this Path does not have a parent.queue
.queues
.InputStream
as a byte array.InputStream
as a String
.String
to an OutputStream
.content
to the destination
.root
only contains a valid Linux root element, which is "/".root
contains a locally valid root element, such as "C:" on Windows or "/" on Linux and OSX.root
contains a valid OSX root element, which is "/".root
only contains a valid Windows root element such as "C:".Iterator
that returns all possible sub Paths of this Path, in order of increasing length.Scheduler
.Set
view of the keys contained in this map.dir
.InputStream
and buffer this data.source
.path
using the default separator.path
using the provided separator.Credential
to the CredentialMap using key
as a unique key.InputStream
to read from this file.directory
.InputStream
and write it to a OutputStream
.OutputStream
to write to this file.OutputStream
to write to this file.This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. Link to Non-frame version.
+public interface AdaptorDescription
+Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getDescription()
+Get the description of the adaptor.
+ |
+
java.lang.String |
+getName()
+Get the name of the adaptor.
+ |
+
java.lang.Class[] |
+getSupportedCredentials()
+Get the supported credential types for this adaptor.
+ |
+
java.lang.String[] |
+getSupportedLocations()
+Get the supported locations for this adaptor.
+ |
+
XenonPropertyDescription[] |
+getSupportedProperties()
+Returns an array containing all properties this adaptor supports.
+ |
+
java.lang.String getName()+
java.lang.String getDescription()+
java.lang.String[] getSupportedLocations()+
java.lang.Class[] getSupportedCredentials()+
XenonPropertyDescription[] getSupportedProperties()+
public class InvalidCredentialException +extends XenonException+
Constructor and Description | +
---|
InvalidCredentialException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidCredentialException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public InvalidCredentialException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidCredentialException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidLocationException +extends XenonException+
Constructor and Description | +
---|
InvalidLocationException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidLocationException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public InvalidLocationException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidLocationException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidPropertyException +extends XenonException+
Constructor and Description | +
---|
InvalidPropertyException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidPropertyException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public InvalidPropertyException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidPropertyException(java.lang.String adaptorName, + java.lang.String message)+
public class PropertyTypeException +extends XenonException+
Constructor and Description | +
---|
PropertyTypeException(java.lang.String adaptorName,
+ java.lang.String message) |
+
PropertyTypeException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public PropertyTypeException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public PropertyTypeException(java.lang.String adaptorName, + java.lang.String message)+
public class UnknownAdaptorException +extends XenonException+
Constructor and Description | +
---|
UnknownAdaptorException(java.lang.String adaptorName,
+ java.lang.String message) |
+
UnknownAdaptorException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public UnknownAdaptorException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public UnknownAdaptorException(java.lang.String adaptorName, + java.lang.String message)+
public class UnknownPropertyException +extends XenonException+
Constructor and Description | +
---|
UnknownPropertyException(java.lang.String adaptorName,
+ java.lang.String message) |
+
UnknownPropertyException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public UnknownPropertyException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public UnknownPropertyException(java.lang.String adaptorName, + java.lang.String message)+
public class UnsupportedOperationException +extends XenonException+
Constructor and Description | +
---|
UnsupportedOperationException(java.lang.String adaptorName,
+ java.lang.String message) |
+
UnsupportedOperationException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public UnsupportedOperationException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public UnsupportedOperationException(java.lang.String adaptorName, + java.lang.String message)+
public class XenonException
+extends java.lang.Exception
+Constructor and Description | +
---|
XenonException(java.lang.String adaptorName,
+ java.lang.String message) |
+
XenonException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getMessage() |
+
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public static enum XenonPropertyDescription.Type +extends java.lang.Enum<XenonPropertyDescription.Type>+
Enum Constant and Description | +
---|
BOOLEAN
+Properties of type
+BOOLEAN can be either "true" or "false" . |
+
DOUBLE
+Properties of type
+DOUBLE can be converted into a 64-bit floating point number using
+ Double.valueOf(String) . |
+
INTEGER
+Properties of type
+INTEGER can be converted into a 32-bit signed integer using
+ Integer.valueOf(String) . |
+
LONG
+Properties of type
+LONG can be converted into a 64-bit signed long using
+ Long.valueOf(String) . |
+
NATURAL
+Properties of type
+NATURAL may contain only positive values, including 0 . |
+
SIZE
+Properties of type
+SIZE can be converted into a 64-bit signed long using
+ Long.valueOf(String) . |
+
STRING
+Properties of type
+STRING are directly stored in a String without conversion. |
+
Modifier and Type | +Method and Description | +
---|---|
static XenonPropertyDescription.Type |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static XenonPropertyDescription.Type[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final XenonPropertyDescription.Type BOOLEAN+
BOOLEAN
can be either "true"
or "false"
.public static final XenonPropertyDescription.Type INTEGER+
INTEGER
can be converted into a 32-bit signed integer using
+ Integer.valueOf(String)
.public static final XenonPropertyDescription.Type LONG+
LONG
can be converted into a 64-bit signed long using
+ Long.valueOf(String)
.public static final XenonPropertyDescription.Type NATURAL+
NATURAL
may contain only positive values, including 0
.
+ They will be converted into a 64-bit signed long using Long.valueOf(String)
.public static final XenonPropertyDescription.Type DOUBLE+
DOUBLE
can be converted into a 64-bit floating point number using
+ Double.valueOf(String)
.public static final XenonPropertyDescription.Type STRING+
STRING
are directly stored in a String without conversion.public static final XenonPropertyDescription.Type SIZE+
SIZE
can be converted into a 64-bit signed long using
+ Long.valueOf(String)
. In addition, the postfixes "K"
, "M"
and "G"
may
+ be used to multiply the value by 1024
, 1024*1024
, or 1024*1024*1024
+ respectively.public static XenonPropertyDescription.Type[] values()+
+for (XenonPropertyDescription.Type c : XenonPropertyDescription.Type.values()) + System.out.println(c); +
public static XenonPropertyDescription.Type valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic class XenonPropertyDescription
+extends java.lang.Object
+XenonPropertyDescription contains all necessary information about a property that is recognized by Xenon
+ +Each XenonPropertyDescription contains the following information:
+ +Map
.
+ XenonPropertyDescription.Type
enum).
+ Even though it is customary to pass the values of properties as String
s, the user should ensure the values can be
+ converted into the expected type.
+ Modifier and Type | +Class and Description | +
---|---|
static class |
+XenonPropertyDescription.Type
+This Type enumeration lists all possible types of properties recognized by Xenon.
+ |
+
Constructor and Description | +
---|
XenonPropertyDescription(java.lang.String name,
+ XenonPropertyDescription.Type type,
+ java.lang.String defaultValue,
+ java.lang.String description) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getDefaultValue()
+Returns the default value for this property.
+ |
+
java.lang.String |
+getDescription()
+Returns a human readable description of this property.
+ |
+
java.lang.String |
+getName()
+Returns the name of the property.
+ |
+
XenonPropertyDescription.Type |
+getType()
+Returns the type of the property.
+ |
+
java.lang.String |
+toString() |
+
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public XenonPropertyDescription(java.lang.String name, + XenonPropertyDescription.Type type, + java.lang.String defaultValue, + java.lang.String description)+
public java.lang.String getName()+
public XenonPropertyDescription.Type getType()+
public java.lang.String getDefaultValue()+
null
is no default is set.public java.lang.String getDescription()+
public java.lang.String toString()+
toString
in class java.lang.Object
public class XenonRuntimeException
+extends java.lang.RuntimeException
+Constructor and Description | +
---|
XenonRuntimeException(java.lang.String adaptorName,
+ java.lang.String message) |
+
XenonRuntimeException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getMessage() |
+
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public XenonRuntimeException(java.lang.String adaptorName, + java.lang.String message)+
public XenonRuntimeException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public class CertificateCredential +extends PasswordCredential+
Constructor and Description | +
---|
CertificateCredential(java.lang.String username,
+ java.lang.String certfile,
+ char[] passphrase)
+Constructs a
+CertificateCredential out of a username, a certificate file containing a private key, and an optional passphrase. |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
java.lang.String |
+getCertificateFile()
+Returns the certificate file.
+ |
+
int |
+hashCode() |
+
java.lang.String |
+toString() |
+
getPassword, getUsername
getClass, notify, notifyAll, wait, wait, wait
public CertificateCredential(java.lang.String username, + java.lang.String certfile, + char[] passphrase)+
CertificateCredential
out of a username, a certificate file containing a private key, and an optional passphrase.username
- the username for this certificatecertfile
- the certification filepassphrase
- the optional passphrase needed to decrypt for this certificatepublic java.lang.String getCertificateFile()+
public java.lang.String toString()+
toString
in class PasswordCredential
public boolean equals(java.lang.Object o)+
equals
in class PasswordCredential
public int hashCode()+
hashCode
in class PasswordCredential
public interface Credential
+public class CredentialMap +extends java.lang.Object +implements Credential+
Credential
consisting of a collection of Credentials each uniquely identified by a String (typically a host name or host alias).
+
+ A default Credential can be set that will be returned if by get
if a key is not found.Constructor and Description | +
---|
CredentialMap()
+Create a new CredentialMap using
+null as the default credential. |
+
CredentialMap(UserCredential defaultCredential)
+Creates a new
+CredentialMap and set the default credential to defaultCredential . |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+containsCredential(java.lang.String key)
+Check if the
+key is stored in this CredentialMap. |
+
boolean |
+equals(java.lang.Object obj) |
+
UserCredential |
+get(java.lang.String key)
+Retrieve the
+UserCredential stored using the key . |
+
UserCredential |
+getDefault()
+Returns the default
+UserCredential . |
+
int |
+hashCode() |
+
java.util.Set<java.lang.String> |
+keySet()
+Returns a
+Set view of the keys contained in this map. |
+
UserCredential |
+put(java.lang.String key,
+ UserCredential credential)
+Add a
+Credential to the CredentialMap using key as a unique key. |
+
getClass, notify, notifyAll, toString, wait, wait, wait
public CredentialMap()+
null
as the default credential.public CredentialMap(UserCredential defaultCredential)+
CredentialMap
and set the default credential to defaultCredential
.defaultCredential
- the default credential to return by get
if a key is not found.public UserCredential put(java.lang.String key, + UserCredential credential)+
Credential
to the CredentialMap using key
as a unique key.
+
+ If the key
already exists in the CredentialMap, the stored UserCredential
will be replaced by credential
.key
- the unique key used to store the credential.credential
- the UserCredential to store.UserCredential
previously stored using the key
or null
if the key was not used before.public boolean containsCredential(java.lang.String key)+
key
is stored in this CredentialMap.key
- the key to check.key
is stored in this CredentialMappublic UserCredential get(java.lang.String key)+
UserCredential
stored using the key
.
+
+ If the key is not found in the map, the default credential is returned (if provided when the CredentialMap was created) or null
if no
+ default is set.key
- the key of the UserCredential
to retrieve.UserCredential
stored using key
or the default credential if the key is not found.public java.util.Set<java.lang.String> keySet()+
Set
view of the keys contained in this map.public UserCredential getDefault()+
UserCredential
.get
if a key is not found.public int hashCode()+
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public class DefaultCredential +extends java.lang.Object +implements UserCredential+
Constructor and Description | +
---|
DefaultCredential() |
+
DefaultCredential(java.lang.String username) |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
java.lang.String |
+getUsername()
+Returns the user name associated with this credential.
+ |
+
int |
+hashCode() |
+
getClass, notify, notifyAll, toString, wait, wait, wait
public DefaultCredential()+
public DefaultCredential(java.lang.String username)+
public java.lang.String getUsername()+
UserCredential
getUsername
in interface UserCredential
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public class KeytabCredential +extends java.lang.Object +implements UserCredential+
Constructor and Description | +
---|
KeytabCredential(java.lang.String username,
+ java.lang.String keytabFile) |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
java.lang.String |
+getKeytabFile() |
+
java.lang.String |
+getUsername()
+Returns the user name associated with this credential.
+ |
+
int |
+hashCode() |
+
getClass, notify, notifyAll, toString, wait, wait, wait
public KeytabCredential(java.lang.String username, + java.lang.String keytabFile)+
public java.lang.String getUsername()+
UserCredential
getUsername
in interface UserCredential
public java.lang.String getKeytabFile()+
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public class PasswordCredential +extends java.lang.Object +implements UserCredential+
Constructor and Description | +
---|
PasswordCredential(java.lang.String username,
+ char[] password)
+Create a new PasswordCredential using a char array as password.
+ |
+
PasswordCredential(java.lang.String username,
+ java.lang.String password)
+Create a new PasswordCredential using a String as password.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+equals(java.lang.Object o) |
+
char[] |
+getPassword()
+Gets the password.
+ |
+
java.lang.String |
+getUsername()
+Returns the user name associated with this credential.
+ |
+
int |
+hashCode() |
+
java.lang.String |
+toString() |
+
getClass, notify, notifyAll, wait, wait, wait
public PasswordCredential(java.lang.String username, + java.lang.String password)+
username
- the user name of the credential.password
- the password of the credential.public PasswordCredential(java.lang.String username, + char[] password)+
username
- the user name of the credential.password
- the password of the credential.public char[] getPassword()+
public java.lang.String getUsername()+
UserCredential
getUsername
in interface UserCredential
public java.lang.String toString()+
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public interface UserCredential +extends Credential+
Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getUsername()
+Returns the user name associated with this credential.
+ |
+
See: Description
+Interface | +Description | +
---|---|
Credential | +
+ Credential represents a user credential uses to gain access to a resource.
+ |
+
UserCredential | ++ |
Class | +Description | +
---|---|
CertificateCredential | +
+ A container for security Information based upon certificates.
+ |
+
CredentialMap | +
+ A
+Credential consisting of a collection of Credentials each uniquely identified by a String (typically a host name or host alias). |
+
DefaultCredential | +
+ This class represents the default credential that may be used by the various adaptors.
+ |
+
KeytabCredential | ++ |
PasswordCredential | +
+ A Credential consisting of a username + password combination.
+ |
+
public class AttributeNotSupportedException +extends XenonException+
Constructor and Description | +
---|
AttributeNotSupportedException(java.lang.String adaptorName,
+ java.lang.String message) |
+
AttributeNotSupportedException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public AttributeNotSupportedException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public AttributeNotSupportedException(java.lang.String adaptorName, + java.lang.String message)+
public class CopyCancelledException +extends XenonException+
Constructor and Description | +
---|
CopyCancelledException(java.lang.String adaptorName,
+ java.lang.String s) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public enum CopyMode +extends java.lang.Enum<CopyMode>+
CREATE
, REPLACE
and IGNORE
options are mutually exclusive.Enum Constant and Description | +
---|
CREATE
+Copy to a new destination file, failing if the file already exists.
+ |
+
IGNORE
+Skip the copy if the destination file if it already exists.
+ |
+
REPLACE
+If the source and destination are a regular file, the destination file will be replaced.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static CopyMode |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static CopyMode[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final CopyMode CREATE+
public static final CopyMode REPLACE+
public static final CopyMode IGNORE+
public static CopyMode[] values()+
+for (CopyMode c : CopyMode.values()) + System.out.println(c); +
public static CopyMode valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic interface CopyStatus
+Modifier and Type | +Method and Description | +
---|---|
long |
+bytesCopied()
+Get the number of bytes that have been copied.
+ |
+
long |
+bytesToCopy()
+Get the number of bytes that need to be copied for the entire copy operation.
+ |
+
java.lang.String |
+getCopyIdentifier()
+Get the copy identifier for which this CopyStatus was created.
+ |
+
XenonException |
+getException()
+Get the exception produced by the Copy or while retrieving the status.
+ |
+
java.lang.String |
+getState()
+Get the state of the Copy operation.
+ |
+
boolean |
+hasException()
+Has the Copy or status retrieval produced a exception ?
+ |
+
boolean |
+isDone()
+Is the Copy done?
+ |
+
boolean |
+isRunning()
+Is the Copy still running?
+ |
+
void |
+maybeThrowException()
+Throws the exception that occured during copying, if it exists.
+ |
+
java.lang.String getCopyIdentifier()+
java.lang.String getState()+
XenonException getException()+
null
will be returned.
+
+ See maybeThrowException()
for the possible exceptions.void maybeThrowException() + throws XenonException+
PathAlreadyExistsException
- If the target already exists and the mode is CopyMode.CREATE
.CopyCancelledException
- If the copy was cancelled via FileSystem.cancel(String)
NoSuchPathException
- If the source does not exist or the target's parent does not existnl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.boolean isRunning()+
boolean isDone()+
boolean hasException()+
long bytesToCopy()+
long bytesCopied()+
public class DirectoryNotEmptyException +extends XenonException+
Constructor and Description | +
---|
DirectoryNotEmptyException(java.lang.String adaptorName,
+ java.lang.String message) |
+
DirectoryNotEmptyException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public DirectoryNotEmptyException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public DirectoryNotEmptyException(java.lang.String adaptorName, + java.lang.String message)+
public abstract class FileSystem
+extends java.lang.Object
+implements java.lang.AutoCloseable
+Modifier and Type | +Method and Description | +
---|---|
abstract java.io.OutputStream |
+appendToFile(Path file)
+Open an existing file and return an
+OutputStream to append data to this file. |
+
CopyStatus |
+cancel(java.lang.String copyIdentifier)
+Cancel a copy operation.
+ |
+
void |
+close()
+Close this FileSystem.
+ |
+
java.lang.String |
+copy(Path source,
+ FileSystem destinationFS,
+ Path destination,
+ CopyMode mode,
+ boolean recursive)
+Asynchronously Copy an existing source path to a target path on a different file system.
+ |
+
static FileSystem |
+create(java.lang.String adaptor)
+Create a new FileSystem using the
+adaptor that connects to a data store at the default location using the default credentials to get access. |
+
static FileSystem |
+create(java.lang.String adaptor,
+ java.lang.String location)
+Create a new FileSystem using the
+adaptor that connects to a data store at location using the default credentials to get
+ access. |
+
static FileSystem |
+create(java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential)
+Create a new FileSystem using the
+adaptor that connects to a data store at location using the credentials to get
+ access. |
+
static FileSystem |
+create(java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties)
+Create a new FileSystem using the
+adaptor that connects to a data store at location using the credentials to get
+ access. |
+
void |
+createDirectories(Path dir)
+Creates a new directory, failing if the directory already exists.
+ |
+
abstract void |
+createDirectory(Path dir)
+Creates a new directory, failing if the directory already exists.
+ |
+
abstract void |
+createFile(Path file)
+Creates a new empty file, failing if the file already exists.
+ |
+
abstract void |
+createSymbolicLink(Path link,
+ Path target)
+Creates a new symbolic link, failing if the link already exists (optional operation).
+ |
+
void |
+delete(Path path,
+ boolean recursive)
+Deletes an existing path.
+ |
+
boolean |
+equals(java.lang.Object o) |
+
abstract boolean |
+exists(Path path)
+Tests if a path exists.
+ |
+
static FileSystemAdaptorDescription |
+getAdaptorDescription(java.lang.String adaptorName)
+Gives the description of the adaptor with the given name.
+ |
+
static FileSystemAdaptorDescription[] |
+getAdaptorDescriptions()
+Gives a list of the descriptions of the available adaptors.
+ |
+
java.lang.String |
+getAdaptorName()
+Get the name of the adaptor that created this FileSystem.
+ |
+
static java.lang.String[] |
+getAdaptorNames()
+Gives a list names of the available adaptors.
+ |
+
abstract PathAttributes |
+getAttributes(Path path)
+Get the
+PathAttributes of an existing path. |
+
Credential |
+getCredential()
+Get the credential that this FileSystem is using.
+ |
+
java.lang.String |
+getLocation()
+Get the location of the FileSystem.
+ |
+
java.lang.String |
+getPathSeparator()
+Get the path separator used by this file system.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getProperties()
+Get the properties used to create this FileSystem.
+ |
+
CopyStatus |
+getStatus(java.lang.String copyIdentifier)
+Retrieve the status of an copy.
+ |
+
Path |
+getWorkingDirectory()
+Get the current working directory of this file system.
+ |
+
int |
+hashCode() |
+
abstract boolean |
+isOpen()
+Return if the connection to the FileSystem is open.
+ |
+
java.lang.Iterable<PathAttributes> |
+list(Path dir,
+ boolean recursive)
+List all entries in the directory
+dir . |
+
abstract java.io.InputStream |
+readFromFile(Path file)
+Open an existing file and return an
+InputStream to read from this file. |
+
abstract Path |
+readSymbolicLink(Path link)
+Reads the target of a symbolic link (optional operation).
+ |
+
abstract void |
+rename(Path source,
+ Path target)
+Rename an existing source path to a non-existing target path (optional operation).
+ |
+
abstract void |
+setPosixFilePermissions(Path path,
+ java.util.Set<PosixFilePermission> permissions)
+Sets the POSIX permissions of a path (optional operation).
+ |
+
void |
+setWorkingDirectory(Path directory)
+Set the current working directory of this file system to
+directory . |
+
CopyStatus |
+waitUntilDone(java.lang.String copyIdentifier,
+ long timeout)
+Wait until a copy operation is done or until a timeout expires.
+ |
+
abstract java.io.OutputStream |
+writeToFile(Path file)
+Open a file and return an
+OutputStream to write to this file. |
+
abstract java.io.OutputStream |
+writeToFile(Path path,
+ long size)
+Open a file and return an
+OutputStream to write to this file. |
+
getClass, notify, notifyAll, toString, wait, wait, wait
public static java.lang.String[] getAdaptorNames()+
public static FileSystemAdaptorDescription getAdaptorDescription(java.lang.String adaptorName) + throws UnknownAdaptorException+
adaptorName
- the type of file system to connect to (e.g. "sftp" or "webdav")UnknownAdaptorException
- If the adaptor name is absent in getAdaptorNames()
.public static FileSystemAdaptorDescription[] getAdaptorDescriptions()+
public static FileSystem create(java.lang.String adaptor, + java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
adaptor
that connects to a data store at location
using the credentials
to get
+ access. Use properties
to (optionally) configure the FileSystem when it is created.
+
+ Make sure to always close FileSystem
instances by calling close(FileSystem)
when you no longer need them, otherwise their associated
+ resources remain allocated.adaptor
- the type of file system to connect to (e.g. "sftp" or "webdav")location
- the location of the FileSystem.credential
- the Credentials to use to get access to the FileSystem.properties
- optional properties to use when creating the FileSystem.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.UnknownAdaptorException
- If the adaptor was invalid.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the FileSystem failed.java.lang.IllegalArgumentException
- If adaptor is null.public static FileSystem create(java.lang.String adaptor, + java.lang.String location, + Credential credential) + throws XenonException+
adaptor
that connects to a data store at location
using the credentials
to get
+ access.
+
+ Make sure to always close FileSystem
instances by calling close(FileSystem)
when you no longer need them, otherwise their associated
+ resources remain allocated.adaptor
- the type of file system to connect to (e.g. "sftp" or "webdav")location
- the location of the FileSystem.credential
- the Credentials to use to get access to the FileSystem.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.UnknownAdaptorException
- If the adaptor was invalid.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the FileSystem failed.java.lang.IllegalArgumentException
- If adaptor is null.public static FileSystem create(java.lang.String adaptor, + java.lang.String location) + throws XenonException+
adaptor
that connects to a data store at location
using the default credentials to get
+ access.
+
+ Make sure to always close FileSystem
instances by calling close(FileSystem)
when you no longer need them, otherwise their associated
+ resources remain allocated.adaptor
- the type of file system to connect to (e.g. "sftp" or "webdav")location
- the location of the FileSystem.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.UnknownAdaptorException
- If the adaptor was invalid.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the FileSystem failed.java.lang.IllegalArgumentException
- If adaptor is null.public static FileSystem create(java.lang.String adaptor) + throws XenonException+
adaptor
that connects to a data store at the default location using the default credentials to get access.
+
+ Note that there are very few filesystem adaptors that support a default location. The local filesystem adaptor is the prime example.
+
+ Make sure to always close FileSystem
instances by calling close(FileSystem)
when you no longer need them, otherwise their associated
+ resources remain allocated.adaptor
- the type of file system to connect to (e.g. "sftp" or "webdav")UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.UnknownAdaptorException
- If the adaptor was invalid.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the FileSystem failed.java.lang.IllegalArgumentException
- If adaptor is null.public java.lang.String getAdaptorName()+
public java.lang.String getLocation()+
public Credential getCredential()+
public java.util.Map<java.lang.String,java.lang.String> getProperties()+
public Path getWorkingDirectory()+
"/home/username"
.public java.lang.String getPathSeparator()+
public void setWorkingDirectory(Path directory) + throws XenonException+
directory
.
+
+ The provided directory
must exist and be a directory. Both an absolute or relative path may be provided. In the latter case, the path will
+ be resolved against the current working directory.directory
- a path to which the current working directory must be set.NoSuchPathException
- if the directory
does not existInvalidPathException
- if directory
is not a directorynl.esciencecenter.xenon.adaptors.NotConnectedException
- if file system is closed.java.lang.IllegalArgumentException
- if the argument is null.XenonException
- if an I/O error occurredpublic void close() + throws XenonException+
close
in interface java.lang.AutoCloseable
XenonException
- If the FileSystem failed to close or if an I/O error occurred.public abstract boolean isOpen() + throws XenonException+
XenonException
- if the test failed or an I/O error occurred.public abstract void rename(Path source, + Path target) + throws XenonException+
+
+ This method only implements a rename operation, not a move operation. Hence, this method will not copy files and should return (almost)
+ instantaneously.
+
+ The parent of the target path (e.g. target.getParent
) must exist.
+
+ If the target is equal to the source this method has no effect.
+
+ If the source is a link, the link itself will be renamed, not the path to which it refers.
+
+ If the source is a directory, it will be renamed to the target. This implies that a moving a directory between physical locations may fail.
+
source
- the existing source path.target
- the non existing target path.UnsupportedOperationException
- If the adapter does not support renaming.NoSuchPathException
- If the source file does not exist or the target parent directory does not exist.PathAlreadyExistsException
- If the target file already exists.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- If the move failed.java.lang.IllegalArgumentException
- If one or both of the arguments are null.public void createDirectories(Path dir) + throws XenonException+
dir
- the directory to create.PathAlreadyExistsException
- If the directory already exists or if a parent directory could not be created because a file with the same name already exists.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.java.lang.IllegalArgumentException
- If one or both of the arguments are null.public abstract void createDirectory(Path dir) + throws XenonException+
dir
- the directory to create.PathAlreadyExistsException
- If the directory already exists.NoSuchPathException
- If the parent directory does not exist.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.java.lang.IllegalArgumentException
- If the argument is null.public abstract void createFile(Path file) + throws XenonException+
file
- a path referring to the file to create.PathAlreadyExistsException
- If the file already exists.NoSuchPathException
- If the parent directory does not exist.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.java.lang.IllegalArgumentException
- If one or both of the arguments are null.public abstract void createSymbolicLink(Path link, + Path target) + throws XenonException+
link
- the symbolic link to create.target
- the target the symbolic link should refer to.PathAlreadyExistsException
- If the link already exists.NoSuchPathException
- If the target or parent directory of link does not existInvalidPathException
- If parent of link is not a directorynl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- If an I/O error occurred.java.lang.IllegalArgumentException
- If one or both of the arguments are null.public void delete(Path path, + boolean recursive) + throws XenonException+
recursive
is set to true, the contents of the directory will also be deleted. If recursive
is
+ set to false
, a directory will only be removed if it is empty.path
- the path to delete.recursive
- if the delete must be done recursivelyDirectoryNotEmptyException
- if the directory was not empty (and the delete was not recursive).NoSuchPathException
- if the provided path does not exist.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract boolean exists(Path path) + throws XenonException+
path
- the path to test.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public java.lang.Iterable<PathAttributes> list(Path dir, + boolean recursive) + throws XenonException+
dir
.
+
+ All entries in the directory are returned, but subdirectories will not be traversed by default. Set recursive
to true
, include
+ the listing of all subdirectories.
+
+ Symbolic links are not followed.dir
- the target directory.recursive
- should the list recursively traverse the subdirectories ?List
of PathAttributes
that iterates over all entries in the directory dir
.NoSuchPathException
- If a directory does not exists.InvalidPathException
- If dir
is not a directory.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract java.io.InputStream readFromFile(Path file) + throws XenonException+
InputStream
to read from this file.file
- the to read.InputStream
to read from the file.NoSuchPathException
- If the file does not exists.InvalidPathException
- If the file is not regular file.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract java.io.OutputStream writeToFile(Path path, + long size) + throws XenonException+
OutputStream
to write to this file.
+
+
+ The size of the file (once all data has been written) must be specified using the size
parameter. This is required by some implementations
+ (typically blob-stores).
+
+
path
- the target file for the OutputStream.size
- the size of the file once fully written.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract java.io.OutputStream writeToFile(Path file) + throws XenonException+
OutputStream
to write to this file. (optional operation)
+ + If the file already exists it will be replaced and its data will be lost. + + The amount of data that will be written to the file is not specified in advance. This operation may not be supported by all implementations. + +
file
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract java.io.OutputStream appendToFile(Path file) + throws XenonException+
OutputStream
to append data to this file. (optional operation)
+ + If the file does not exist, an exception will be thrown. + + This operation may not be supported by all implementations. + +
file
- the target file for the OutputStream.OutputStream
to write to the file.PathAlreadyExistsException
- If the target existed.NoSuchPathException
- if a parent directory does not exist.InvalidPathException
- if not a regular filenl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.UnsupportedOperationException
- if the adaptor does not support appendingpublic abstract PathAttributes getAttributes(Path path) + throws XenonException+
PathAttributes
of an existing path.path
- the existing path.NoSuchPathException
- If the file does not exists.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract Path readSymbolicLink(Path link) + throws XenonException+
link
- the link to read.NoSuchPathException
- If the link does not exists.InvalidPathException
- If the source is not a link.UnsupportedOperationException
- If this FileSystem does not support symbolic links.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public abstract void setPosixFilePermissions(Path path, + java.util.Set<PosixFilePermission> permissions) + throws XenonException+
path
- the target path.permissions
- the permissions to set.NoSuchPathException
- If the target path does not exists.UnsupportedOperationException
- If this FileSystem does not support symbolic links.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If path is null.public java.lang.String copy(Path source, + FileSystem destinationFS, + Path destination, + CopyMode mode, + boolean recursive)+
recursive
is set to true
. Otherwise, an exception will be thrown.
+ When copying recursively, the directory and its content (both files and subdirectories with content), will be copied to destination
.
+
+ Exceptions that occur during copying will not be thrown by this function, but instead are contained in a CopyStatus
object which can be obtained
+ with getStatus(String)
source
- the source path (on this filesystem) to copy from.destinationFS
- the destination filesystem to copy to.destination
- the destination path (on the destination filesystem) to copy to.mode
- how to react if the destination already exists.recursive
- if the copy should be recursive.String
that identifies this copy and be used to inspect its progress.java.lang.IllegalArgumentException
- If source, destinationFS, destination or mode is null.public CopyStatus cancel(java.lang.String copyIdentifier) + throws XenonException+
NoSuchCopyException
copyIdentifier
- the identifier of the copy operation which to cancel.CopyStatus
containing the status of the copy.NoSuchCopyException
- If the copy is not known.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If the copyIdentifier is null.public CopyStatus waitUntilDone(java.lang.String copyIdentifier, + long timeout) + throws XenonException+
+ This method will wait until a copy operation is done (either gracefully or by producing an error), or until the timeout expires, whichever comes first. + If the timeout expires, the copy operation will continue to run. +
++ The timeout is in milliseconds and must be >= 0. When timeout is 0, it will be ignored and this method will wait until the copy operation is done. +
+ After this operation, the copy is forgotten and subsequent queries with this copy string will lead toNoSuchCopyException
+
+ A CopyStatus
is returned that can be used to determine why the call returned.
+
copyIdentifier
- the identifier of the copy operation to wait for.timeout
- the maximum time to wait for the copy operation in milliseconds.CopyStatus
containing the status of the copy.java.lang.IllegalArgumentException
- If argument is illegal.NoSuchCopyException
- If the copy handle is not known.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If the copyIdentifier is null or if the value of timeout is negative.public CopyStatus getStatus(java.lang.String copyIdentifier) + throws XenonException+
NoSuchCopyException
.copyIdentifier
- the identifier of the copy for which to retrieve the status.CopyStatus
containing the status of the asynchronous copy.NoSuchCopyException
- If the copy is not known.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If file system is closed.XenonException
- if an I/O error occurred.java.lang.IllegalArgumentException
- If the copyIdentifier is null.public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public interface FileSystemAdaptorDescription +extends AdaptorDescription+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+canAppend() |
+
boolean |
+canCreateSymboliclinks()
+Can this adaptor create symbolic links ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
boolean |
+canReadSymboliclinks()
+Can this adaptor read symbolic links ?
+ |
+
boolean |
+isConnectionless() |
+
boolean |
+needsSizeBeforehand() |
+
boolean |
+supportsReadingPosixPermissions() |
+
boolean |
+supportsRename() |
+
boolean |
+supportsSettingPosixPermissions() |
+
boolean |
+supportsThirdPartyCopy()
+Does this adaptor support third party copy ?
+
+ In third party copy, a file is copied between two remote locations, without passing through the local machine first.
+ |
+
getDescription, getName, getSupportedCredentials, getSupportedLocations, getSupportedProperties
boolean supportsThirdPartyCopy()+
boolean canReadSymboliclinks()+
boolean canCreateSymboliclinks()+
boolean isConnectionless()+
boolean supportsReadingPosixPermissions()+
boolean supportsSettingPosixPermissions()+
boolean supportsRename()+
boolean canAppend()+
boolean needsSizeBeforehand()+
public class FileSystemClosedException +extends XenonException+
Constructor and Description | +
---|
FileSystemClosedException(java.lang.String adaptorName,
+ java.lang.String message) |
+
FileSystemClosedException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public FileSystemClosedException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public FileSystemClosedException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidOptionsException +extends XenonException+
Constructor and Description | +
---|
InvalidOptionsException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidOptionsException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public InvalidOptionsException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidOptionsException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidPathException +extends XenonException+
Constructor and Description | +
---|
InvalidPathException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidPathException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public InvalidPathException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidPathException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidResumeTargetException +extends XenonException+
Constructor and Description | +
---|
InvalidResumeTargetException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidResumeTargetException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public InvalidResumeTargetException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidResumeTargetException(java.lang.String adaptorName, + java.lang.String message)+
public class NoSuchCopyException +extends XenonException+
Constructor and Description | +
---|
NoSuchCopyException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NoSuchCopyException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class NoSuchPathException +extends XenonException+
Constructor and Description | +
---|
NoSuchPathException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NoSuchPathException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Modifier and Type | +Field and Description | +
---|---|
static char |
+DEFAULT_SEPARATOR
+The default separator to use.
+ |
+
Constructor and Description | +
---|
Path()
+Create a new empty Path using the default separator.
+ |
+
Path(boolean isAbsolute,
+ java.util.List<java.lang.String> elements)
+Create a new Path using the given path elements and the default separator.
+ |
+
Path(boolean isAbsolute,
+ java.lang.String... elements)
+Create a new Path using the given path elements and the default separator.
+ |
+
Path(char separator,
+ boolean isAbsolute,
+ java.util.List<java.lang.String> elements)
+Create a new Path using the given path separator, absoluteness, and elements.
+ |
+
Path(char separator,
+ boolean isAbsolute,
+ java.lang.String... elements)
+Create a new Path using the given path elements and the provided separator.
+ |
+
Path(char separator,
+ java.lang.String path)
+Create a new Path by parsing
+path using the provided separator. |
+
Path(java.lang.String path)
+Create a new Path by parsing
+path using the default separator. |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+endsWith(Path other)
+Tests if this Path ends with the given Path.
+ |
+
boolean |
+endsWith(java.lang.String other)
+Tests if this Path ends with the given Path represented as a String.
+ |
+
boolean |
+equals(java.lang.Object obj) |
+
Path |
+getFileName()
+Get the file name or
+null if the Path is empty. |
+
java.lang.String |
+getFileNameAsString()
+Get the file name as a
+String , or null if the Path is empty. |
+
Path |
+getName(int index)
+Get an element of this Path.
+ |
+
int |
+getNameCount()
+Get the number of elements in the Path.
+ |
+
Path |
+getParent()
+Get the parent Path, or
+null if this Path does not have a parent. |
+
char |
+getSeparator()
+Get the separator.
+ |
+
int |
+hashCode() |
+
boolean |
+isAbsolute() |
+
boolean |
+isEmpty()
+Is this Path empty ?
+ |
+
java.util.Iterator<Path> |
+iterator()
+Create an
+Iterator that returns all possible sub Paths of this Path, in order of increasing length. |
+
Path |
+normalize()
+Normalize this Path by removing as many redundant path elements as possible.
+ |
+
Path |
+relativize(Path other)
+Create a relative Path between the given Path and this Path.
+ |
+
Path |
+resolve(Path other)
+Resolve a Path against this Path.
+ |
+
Path |
+resolve(java.lang.String other)
+Resolve a Path represented as a String against this path.
+ |
+
Path |
+resolveSibling(Path other)
+Resolves the given Path to this paths parent Path, thereby creating a sibling to this Path.
+ |
+
boolean |
+startsWith(Path other)
+Tests if this Path starts with the given Path.
+ |
+
boolean |
+startsWith(java.lang.String other)
+Tests if this Path starts with the given Path represented as a String.
+ |
+
Path |
+subpath(int beginIndex,
+ int endIndex)
+Returns a Path that is a subsequence of the name elements of this path.
+ |
+
Path |
+toAbsolutePath() |
+
Path |
+toRelativePath() |
+
java.lang.String |
+toString() |
+
getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public static final char DEFAULT_SEPARATOR+
public Path()+
public Path(java.lang.String path)+
path
using the default separator.
+
+ If path
is null
or an empty String, the resulting Path is empty and relative. Otherwise it will be split into multiple elements
+ using the default separator. If path
starts with a separator, the resulting path will be absolute. Otherwise, it will be relative.path
- the path to parsepublic Path(char separator, + java.lang.String path)+
path
using the provided separator.
+
+ If path
is null
or an empty String, the resulting Path is empty and relative. Otherwise it will be split into multiple elements
+ using the provided separator. If path
starts with a separator, the resulting path will be absolute. Otherwise, it will be relative.separator
- the separator to usepath
- the path to parsepublic Path(boolean isAbsolute, + java.lang.String... elements)+
elements
is null
or empty, the resulting Path is empty. The elements
may not contain null
or empty
+ Strings. The elements will not be parsed individually, and may not contain the separator character.isAbsolute
- should the resulting path must be absolute?elements
- the path elements to use.public Path(char separator, + boolean isAbsolute, + java.lang.String... elements)+
elements
is null
or empty, the resulting Path is empty. The elements
may not contain null
or empty
+ Strings. The elements will not be parsed individually, and may not contain the separator character.separator
- the separator to use.isAbsolute
- should the resulting path must be absolute?elements
- the path elements to use.public Path(boolean isAbsolute, + java.util.List<java.lang.String> elements)+
elements
is null
or empty, the resulting Path is empty. The elements
list may not contain null
or
+ empty Strings, or Strings that contain the separator character. If they do, an IllegalArgumentException
will be thrown.isAbsolute
- should the resulting path must be absolute?elements
- the path elements to use.public Path(char separator, + boolean isAbsolute, + java.util.List<java.lang.String> elements)+
elements
is null
or empty, the resulting Path is empty. The elements
list may not contain null
or
+ empty Strings, or Strings that contain the separator character. If they do, an IllegalArgumentException
will be thrown.separator
- the separator to use.isAbsolute
- should the resulting path should be absolute ?elements
- the path elements to use.public Path getFileName()+
null
if the Path is empty.
+
+ The file name is the last element of the Path.null
.public java.lang.String getFileNameAsString()+
String
, or null
if the Path is empty.
+
+ The file name is the last element of the Path.null
.public char getSeparator()+
public Path getParent()+
null
if this Path does not have a parent.
+
+ The parent path will contain all path elements in this pasth except the last one.public int getNameCount()+
public Path getName(int index)+
index
- the index of the elementjava.lang.IndexOutOfBoundsException
- If the index is negative or greater or equal to the number of elements in the path.public Path subpath(int beginIndex, + int endIndex)+
beginIndex
- the index of the first element, inclusiveendIndex
- the index of the last element, exclusivejava.lang.IllegalArgumentException
- If beginIndex is larger than or equal to the endIndex.java.lang.ArrayIndexOutOfBoundsException
- If beginIndex < 0 or beginIndex > elements.lengthpublic boolean startsWith(Path other)+
true
if this Path starts with the same sequence of the name elements as the given Path. In addition, the absoluteness of
+ this Path should match the absoluteness of the given Path.
+
+ False is returned if the given Path starts with a different sequence of elements, has more name elements than this path, or has a different absoluteness
+ than this path.other
- the Path to compare to.public boolean endsWith(Path other)+
true
if this Path end with the name elements in the given Path. If the given Path has more name elements than this Path
+ then false is returned.other
- the Path to compare to.public boolean startsWith(java.lang.String other)+
other
into a Path
using Path(String)
and then uses startsWith(Path)
to compare the
+ result to this Path.other
- the path to test.other
.public boolean endsWith(java.lang.String other)+
other
into a Path
using Path(String)
and then uses endsWith(Path)
to compare the
+ result to this path.other
- the path to test.other
.public Path resolve(Path other)+
other
. The resulting path will use the separator and absoluteness
+ of this path.other
- the Path to concatenate with.public Path resolve(java.lang.String other)+
other
into a Path
using Path(char, String)
and the separator of the this path. Next, resolve(Path)
+ is used to resolve the result against this path.other
- the path to concatenate with.public boolean isEmpty()+
public Path resolveSibling(Path other)+
other
will be returned, unless other is null
in which case an empty Path is returned.
+
+ If this Path is not empty, but other
is null
or empty, the parent of this Path will be returned.
+
+ If neither this Path and other are empty, getParent.resolve(other)
will be returned.other
- the Path to resolve as sibling.java.lang.IllegalArgumentException
- If the Path can not be resolved as a sibling to this Path.public Path relativize(Path other)+
other
.other
- the Path to relativize.java.lang.IllegalArgumentException
- If the path can not be relativized to this path.public java.util.Iterator<Path> iterator()+
Iterator
that returns all possible sub Paths of this Path, in order of increasing length.
+
+ For example, for the Path "/a/b/c/d" the iterator returns "/a", "/a/b", "/a/b/c", "/a/b/c/d".iterator
in interface java.lang.Iterable<Path>
public Path normalize()+
"."
(indicating the current directory) and ".."
(indicating the parent directory).
+
+ Note that the resulting normalized path does may still contain ".."
elements which are not redundant.public int hashCode()+
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public java.lang.String toString()+
toString
in class java.lang.Object
public boolean isAbsolute()+
public Path toRelativePath()+
public Path toAbsolutePath()+
public class PathAlreadyExistsException +extends XenonException+
Constructor and Description | +
---|
PathAlreadyExistsException(java.lang.String adaptorName,
+ java.lang.String message) |
+
PathAlreadyExistsException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public PathAlreadyExistsException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public PathAlreadyExistsException(java.lang.String adaptorName, + java.lang.String message)+
public interface PathAttributes
+Modifier and Type | +Method and Description | +
---|---|
long |
+getCreationTime()
+Get the creation time for this file.
+ |
+
java.lang.String |
+getGroup()
+Get the group of this file (optional operation).
+ |
+
long |
+getLastAccessTime()
+Get the last access time for this file.
+ |
+
long |
+getLastModifiedTime()
+Get the last modified time for this file.
+ |
+
java.lang.String |
+getOwner()
+Get the owner of this file (optional operation).
+ |
+
Path |
+getPath()
+Get the path these attributes belong to.
+ |
+
java.util.Set<PosixFilePermission> |
+getPermissions()
+Get the permissions of this file (optional operation).
+ |
+
long |
+getSize()
+Get the size of this file in bytes.
+ |
+
boolean |
+isDirectory()
+Does the path refer to a directory ?
+ |
+
boolean |
+isExecutable()
+Does the path refer to an executable file ?
+ |
+
boolean |
+isHidden()
+Does the path refer to an hidden file ?
+ |
+
boolean |
+isOther()
+Is the path not a file, link or directory ?
+ |
+
boolean |
+isReadable()
+Does the path refer to an readable file ?
+ |
+
boolean |
+isRegular()
+Does the path refer to a regular file ?
+ |
+
boolean |
+isSymbolicLink()
+Does the path refer to a symbolic link ?
+ |
+
boolean |
+isWritable()
+Does the path refer to a writable file ?
+ |
+
Path getPath()+
boolean isDirectory()+
boolean isRegular()+
boolean isSymbolicLink()+
boolean isOther()+
boolean isExecutable()+
boolean isReadable()+
boolean isWritable()+
boolean isHidden()+
long getCreationTime()+
getLastModifiedTime()
will be returned instead.long getLastAccessTime()+
getLastModifiedTime()
will be returned instead.long getLastModifiedTime()+
0
will be returned instead.long getSize()+
0
will be returned.java.lang.String getOwner() + throws AttributeNotSupportedException+
AttributeNotSupportedException
- If the attribute is not supported by the adaptor.java.lang.String getGroup() + throws AttributeNotSupportedException+
AttributeNotSupportedException
- If the attribute is not supported by the adaptor.java.util.Set<PosixFilePermission> getPermissions() + throws AttributeNotSupportedException+
AttributeNotSupportedException
- If the attribute is not supported by the adaptor.public enum PosixFilePermission +extends java.lang.Enum<PosixFilePermission>+
Enum Constant and Description | +
---|
GROUP_EXECUTE
+Execute/search permission, group.
+ |
+
GROUP_READ
+Read permission, group.
+ |
+
GROUP_WRITE
+Write permission, group.
+ |
+
OTHERS_EXECUTE
+Execute/search permission, others.
+ |
+
OTHERS_READ
+Read permission, others.
+ |
+
OTHERS_WRITE
+Write permission, others.
+ |
+
OWNER_EXECUTE
+Execute/search permission, owner.
+ |
+
OWNER_READ
+Read permission, owner.
+ |
+
OWNER_WRITE
+Write permission, owner.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
static boolean |
+contains(PosixFilePermission toFind,
+ PosixFilePermission... options)
+Check if a sequence of
+PosixFilePermission s contains a specific option. |
+
static PosixFilePermission |
+valueOf(java.lang.String name)
+Returns the enum constant of this type with the specified name.
+ |
+
static PosixFilePermission[] |
+values()
+Returns an array containing the constants of this enum type, in
+the order they are declared.
+ |
+
compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
getClass, notify, notifyAll, wait, wait, wait
public static final PosixFilePermission GROUP_EXECUTE+
public static final PosixFilePermission GROUP_READ+
public static final PosixFilePermission GROUP_WRITE+
public static final PosixFilePermission OTHERS_EXECUTE+
public static final PosixFilePermission OTHERS_READ+
public static final PosixFilePermission OTHERS_WRITE+
public static final PosixFilePermission OWNER_EXECUTE+
public static final PosixFilePermission OWNER_READ+
public static final PosixFilePermission OWNER_WRITE+
public static PosixFilePermission[] values()+
+for (PosixFilePermission c : PosixFilePermission.values()) + System.out.println(c); +
public static PosixFilePermission valueOf(java.lang.String name)+
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static boolean contains(PosixFilePermission toFind, + PosixFilePermission... options)+
PosixFilePermission
s contains a specific option.
+
+ If option
or options
is null
, false
will be returned.toFind
- the option to find.options
- the options to check.options
contains option
.See: Description
+Interface | +Description | +
---|---|
CopyStatus | +
+ CopyStatus contains status information for a specific copy operation.
+ |
+
FileSystemAdaptorDescription | ++ |
PathAttributes | +
+ FileAttributes represents a set of attributes of a path.
+ |
+
Class | +Description | +
---|---|
FileSystem | +
+ FileSystem represent a (possibly remote) file system that can be used to access data.
+ |
+
Path | +
+ Path contains a sequence of path elements separated by a separator.
+ |
+
Enum | +Description | +
---|---|
CopyMode | +
+ CopyOption is an enumeration containing all possible options for copying a file.
+ |
+
PosixFilePermission | +
+ PosixFilePermission is an enumeration containing all supported Posix file permissions.
+ |
+
Exception | +Description | +
---|---|
AttributeNotSupportedException | +
+ Signals that a requested file attribute is not supported by the underlying file system implementation.
+ |
+
CopyCancelledException | ++ |
DirectoryNotEmptyException | +
+ Signals that directory is not empty.
+ |
+
FileSystemClosedException | +
+ Signals that a unknown Copy handle was provided.
+ |
+
InvalidOptionsException | +
+ Signals that an invalid combination of OpenOptions have been specified.
+ |
+
InvalidPathException | +
+ Signals that an end-of-file was encountered.
+ |
+
InvalidResumeTargetException | +
+ Signals that the data in the target of a resume does not match the data in the source.
+ |
+
NoSuchCopyException | +
+ Signals that a unknown Copy handle was provided.
+ |
+
NoSuchPathException | +
+ Signals that a path does not exists.
+ |
+
PathAlreadyExistsException | +
+ Signals that a path already exists.
+ |
+
See: Description
+Interface | +Description | +
---|---|
AdaptorDescription | +
+ AdaptorStatus contains information on a specific adaptor.
+ |
+
Class | +Description | +
---|---|
XenonPropertyDescription | +
+ XenonPropertyDescription contains all necessary information about a property that is recognized by Xenon
+ |
+
Enum | +Description | +
---|---|
XenonPropertyDescription.Type | +
+ This Type enumeration lists all possible types of properties recognized by Xenon.
+ |
+
Exception | +Description | +
---|---|
InvalidCredentialException | +
+ Signals that an invalid credential was used to access a resource.
+ |
+
InvalidLocationException | +
+ Signals that an invalid location was provided.
+ |
+
InvalidPropertyException | +
+ Signals that a property has a different type than the get method it was retrieved with.
+ |
+
PropertyTypeException | +
+ Signals that a property has a different type than the get method it was retrieved with.
+ |
+
UnknownAdaptorException | +
+ Thrown when an unknown adaptor name is provided.
+ |
+
UnknownPropertyException | +
+ Signals that a property has a different type than the get method it was retrieved with.
+ |
+
UnsupportedOperationException | +
+ Throw when an unsupported optional operation is called.
+ |
+
XenonException | +
+ XenonException is the parent exception for all exceptions raised in Xenon.
+ |
+
XenonRuntimeException | +
+ XenonRuntimeException is the parent for all runtime exceptions raised in Xenon.
+ |
+
public class IncompleteJobDescriptionException +extends XenonException+
Constructor and Description | +
---|
IncompleteJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message) |
+
IncompleteJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public IncompleteJobDescriptionException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public IncompleteJobDescriptionException(java.lang.String adaptorName, + java.lang.String message)+
public class InvalidJobDescriptionException +extends XenonException+
Constructor and Description | +
---|
InvalidJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message) |
+
InvalidJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public InvalidJobDescriptionException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public InvalidJobDescriptionException(java.lang.String adaptorName, + java.lang.String message)+
public class JobDescription
+extends java.lang.Object
+Scheduler
.Modifier and Type | +Field and Description | +
---|---|
static int |
+DEFAULT_MAX_RUN_TIME_IN_MINUTES
+The default maximum run time
+ |
+
Constructor and Description | +
---|
JobDescription()
+Create a JobDescription.
+ |
+
JobDescription(JobDescription original)
+Create a JobDescription by copying an existing one.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addArgument(java.lang.String argument)
+Add a command line argument for the executable.
+ |
+
void |
+addEnvironment(java.lang.String key,
+ java.lang.String value)
+Add a variable to the environment of the executable.
+ |
+
void |
+addJobOption(java.lang.String key,
+ java.lang.String value)
+Add a job option to the job.
+ |
+
void |
+addSchedulerArgument(java.lang.String argument)
+Add a scheduler specific argument.
+ |
+
boolean |
+equals(java.lang.Object obj) |
+
java.util.List<java.lang.String> |
+getArguments()
+Get the command line arguments of the executable.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getEnvironment()
+Get the environment of the executable.
+ |
+
java.lang.String |
+getExecutable()
+Get the path to the executable.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getJobOptions()
+Get a copy of the job options of this job.
+ |
+
int |
+getMaxMemory()
+Get the amount of memory needed for process (in MBytes).
+ |
+
int |
+getMaxRuntime()
+Get the maximum job duration time in minutes.
+ |
+
java.lang.String |
+getName()
+Get the job name.
+ |
+
int |
+getNodeCount()
+Get the number of nodes.
+ |
+
int |
+getProcessesPerNode()
+Get the number of processes to start on each node.
+ |
+
java.lang.String |
+getQueueName()
+Get the queue name;
+ |
+
java.util.List<java.lang.String> |
+getSchedulerArguments()
+Get the scheduler specific arguments.
+ |
+
java.lang.String |
+getStderr()
+Gets the path to the file to which the executable must redirect stderr.
+ |
+
java.lang.String |
+getStdin()
+Gets the path to the file from which the executable must redirect stdin.
+ |
+
java.lang.String |
+getStdout()
+Gets the path to the file to which the executable must redirect stdout.
+ |
+
int |
+getTempSpace()
+Get the amount of temp space needed for process (in MBytes).
+ |
+
int |
+getThreadsPerProcess()
+Get the number of threads needed per process.
+ |
+
java.lang.String |
+getWorkingDirectory()
+Gets the path of the working directory for the executable.
+ |
+
int |
+hashCode() |
+
boolean |
+isStartSingleProcess()
+Is only a single process started?
+ |
+
void |
+setArguments(java.lang.String... arguments)
+Sets the command line arguments of the executable.
+ |
+
void |
+setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)
+Sets the environment of the executable.
+ |
+
void |
+setExecutable(java.lang.String executable)
+Sets the path to the executable.
+ |
+
void |
+setJobOptions(java.util.Map<java.lang.String,java.lang.String> options)
+Sets the job options of the job.
+ |
+
void |
+setMaxMemory(int maxMemoryInMB)
+Set the amount of memory needed for process (in MBytes).
+ |
+
void |
+setMaxRuntime(int minutes)
+Set the maximum job duration in minutes.
+ |
+
void |
+setName(java.lang.String name)
+Set the name of the job.
+ |
+
void |
+setNodeCount(int nodeCount)
+Set the number of nodes.
+ |
+
void |
+setProcessesPerNode(int processesPerNode)
+Set the number of processes started on each node.
+ |
+
void |
+setQueueName(java.lang.String queueName)
+Set the queue name;
+ |
+
void |
+setSchedulerArguments(java.lang.String... arguments)
+Sets the scheduler specific arguments for this job.
+ |
+
void |
+setStartSingleProcess(boolean startSingleProcess)
+Set if only a single process is started, instead of nodeCount * processesPerNode.
+ |
+
void |
+setStderr(java.lang.String stderr)
+Sets the path to the file to which the executable must redirect stderr.
+ |
+
void |
+setStdin(java.lang.String stdin)
+Sets the path to the file from which the executable must redirect stdin.
+ |
+
void |
+setStdout(java.lang.String stdout)
+Sets the path to the file to which the executable must redirect stdout.
+ |
+
void |
+setTempSpace(int tempSpaceInMB)
+Set the amount of memory needed for process (in MBytes).
+ |
+
void |
+setThreadsPerProcess(int threadsPerProcess)
+Set the number of threads needed per process.
+ |
+
void |
+setWorkingDirectory(java.lang.String workingDirectory)
+Sets the path of the working directory for the executable.
+ |
+
java.lang.String |
+toString() |
+
getClass, notify, notifyAll, wait, wait, wait
public static final int DEFAULT_MAX_RUN_TIME_IN_MINUTES+
public JobDescription()+
public JobDescription(JobDescription original)+
original
- JobDescription to copypublic java.lang.String getName()+
public void setName(java.lang.String name)+
name
- the name of the job;public int getNodeCount()+
public void setNodeCount(int nodeCount)+
nodeCount
- the number of nodes;public int getProcessesPerNode()+
public void setProcessesPerNode(int processesPerNode)+
processesPerNode
- the number of processes started on each node.public int getThreadsPerProcess()+
public void setThreadsPerProcess(int threadsPerProcess)+
threadsPerProcess
- the number of threads needed per process.public int getMaxMemory()+
public void setMaxMemory(int maxMemoryInMB)+
maxMemoryInMB
- the amount of memory needed per node/process.public int getTempSpace()+
public void setTempSpace(int tempSpaceInMB)+
tempSpaceInMB
- the amount of temp space needed per node/process.public boolean isStartSingleProcess()+
public void setStartSingleProcess(boolean startSingleProcess)+
startSingleProcess
- if only a single process is started.public java.lang.String getQueueName()+
public void setQueueName(java.lang.String queueName)+
queueName
- the queue name;public int getMaxRuntime()+
public void setMaxRuntime(int minutes)+
minutes
- the maximum job duration in minutes.public java.lang.String getExecutable()+
public void setExecutable(java.lang.String executable)+
executable
- the path to the executable.public java.util.List<java.lang.String> getArguments()+
public void setArguments(java.lang.String... arguments)+
arguments
- the command line arguments of the executable.public void addArgument(java.lang.String argument)+
null
or empty.argument
- the command line argument to add.public java.util.List<java.lang.String> getSchedulerArguments()+
public void setSchedulerArguments(java.lang.String... arguments)+
arguments
- the scheduler specific arguments.public void addSchedulerArgument(java.lang.String argument)+
null
or empty.argument
- the scheduler specific argument.public java.util.Map<java.lang.String,java.lang.String> getEnvironment()+
Map
of environment variables with their values (for example: "JAVA_HOME", "/path/to/java").public void setEnvironment(java.util.Map<java.lang.String,java.lang.String> environment)+
Map
of environment variables with their values (for example: "JAVA_HOME", "/path/to/java").environment
- environment of the executable.public void addEnvironment(java.lang.String key, + java.lang.String value)+
Map
of environment variables with their values (for example: "JAVA_HOME", "/path/to/java").
+
+ The key of an environment variable may not be null
or empty.key
- the unique key under which to store the value.value
- the value to store the value.public java.util.Map<java.lang.String,java.lang.String> getJobOptions()+
Map
of options variables with their values (for example: "PE", "MPI").public void setJobOptions(java.util.Map<java.lang.String,java.lang.String> options)+
Map
of options variables with their values (for example: "PE", "MPI").options
- job options of the job.public void addJobOption(java.lang.String key, + java.lang.String value)+
null
or empty.key
- the unique key under which to store the job option.value
- the value of the option to store.public void setStdin(java.lang.String stdin)+
stdin
- the path.public void setStdout(java.lang.String stdout)+
stdout
- the path.public void setStderr(java.lang.String stderr)+
stderr
- the path.public void setWorkingDirectory(java.lang.String workingDirectory)+
workingDirectory
- path of the working directory.public java.lang.String getStdin()+
public java.lang.String getStdout()+
public java.lang.String getStderr()+
public java.lang.String getWorkingDirectory()+
public java.lang.String toString()+
toString
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)+
equals
in class java.lang.Object
public interface JobStatus
+Modifier and Type | +Method and Description | +
---|---|
XenonException |
+getException()
+Get the exception produced by the Job or while retrieving the status.
+ |
+
java.lang.Integer |
+getExitCode()
+Get the exit code for the Job.
+ |
+
java.lang.String |
+getJobIdentifier()
+Get the job identifier of the Job for which this JobStatus was created.
+ |
+
java.lang.String |
+getName()
+Get the name of the Job for which this JobStatus was created.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getSchedulerSpecificInformation()
+Get scheduler specific information on the Job.
+ |
+
java.lang.String |
+getState()
+Get the state of the Job.
+ |
+
boolean |
+hasException()
+Has the Job or job retrieval produced a exception ?
+ |
+
boolean |
+isDone()
+Is the Job done.
+ |
+
boolean |
+isRunning()
+Is the Job running.
+ |
+
void |
+maybeThrowException()
+Throws the exception produced by the Job or while retrieving the status, if it exists.
+ |
+
java.lang.String getJobIdentifier()+
java.lang.String getName()+
java.lang.String getState()+
isRunning()
, isDone()
or hasException()
instead.java.lang.Integer getExitCode()+
XenonException getException()+
null
will be returned.
+
+ See maybeThrowException()
for the possible exceptions.void maybeThrowException() + throws XenonException+
nl.esciencecenter.xenon.adaptors.schedulers.JobCanceledException
- if the job was cancelledNoSuchJobException
- if the job of which the status was requested does not existXenonException
- if an I/O error occurred.boolean isRunning()+
boolean isDone()+
boolean hasException()+
java.util.Map<java.lang.String,java.lang.String> getSchedulerSpecificInformation()+
public class NoSuchJobException +extends XenonException+
Constructor and Description | +
---|
NoSuchJobException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NoSuchJobException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public class NoSuchQueueException +extends XenonException+
Constructor and Description | +
---|
NoSuchQueueException(java.lang.String adaptorName,
+ java.lang.String message) |
+
NoSuchQueueException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public NoSuchQueueException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public NoSuchQueueException(java.lang.String adaptorName, + java.lang.String message)+
public interface QueueStatus
+Modifier and Type | +Method and Description | +
---|---|
XenonException |
+getException()
+Get the exception produced by the queue, or
+null if hasException() returns false . |
+
java.lang.String |
+getQueueName()
+Get the queue name.
+ |
+
Scheduler |
+getScheduler()
+Get the Scheduler that produced this QueueStatus.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getSchedulerSpecificInformation()
+Get scheduler specific information on the queue.
+ |
+
boolean |
+hasException()
+Did the queue produce an exception ?
+ |
+
void |
+maybeThrowException()
+Throws the exception produced by the queue if it exists.
+ |
+
Scheduler getScheduler()+
java.lang.String getQueueName()+
boolean hasException()+
XenonException getException()+
null
if hasException()
returns false
.
+
+ See maybeThrowException()
for the possible exceptions.void maybeThrowException() + throws XenonException+
NoSuchQueueException
- if the requested queue does not existXenonException
- if an I/O error occurred.java.util.Map<java.lang.String,java.lang.String> getSchedulerSpecificInformation()+
public abstract class Scheduler
+extends java.lang.Object
+implements java.lang.AutoCloseable
+Modifier and Type | +Method and Description | +
---|---|
abstract JobStatus |
+cancelJob(java.lang.String jobIdentifier)
+Cancel a job.
+ |
+
abstract void |
+close()
+Close this Scheduler.
+ |
+
static Scheduler |
+create(java.lang.String adaptor)
+Create a new Scheduler using the
+adaptor connecting to the default location and using the default credentials to get access. |
+
static Scheduler |
+create(java.lang.String adaptor,
+ java.lang.String location)
+Create a new Scheduler using the
+adaptor connecting to the location using the default credentials to get access. |
+
static Scheduler |
+create(java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential)
+Create a new Scheduler using the
+adaptor connecting to the location using credentials to get access. |
+
static Scheduler |
+create(java.lang.String adaptor,
+ java.lang.String location,
+ Credential credential,
+ java.util.Map<java.lang.String,java.lang.String> properties)
+Create a new Scheduler using the
+adaptor connecting to the location using credentials to get access. |
+
boolean |
+equals(java.lang.Object o) |
+
static SchedulerAdaptorDescription |
+getAdaptorDescription(java.lang.String adaptorName)
+Gives the description of the adaptor with the given name.
+ |
+
static SchedulerAdaptorDescription[] |
+getAdaptorDescriptions()
+Gives a list of the descriptions of the available adaptors.
+ |
+
java.lang.String |
+getAdaptorName()
+Get the name of the adaptor that created this Scheduler.
+ |
+
static java.lang.String[] |
+getAdaptorNames()
+Gives a list names of the available adaptors.
+ |
+
Credential |
+getCredential()
+Get the credential that this Scheduler is using.
+ |
+
abstract java.lang.String |
+getDefaultQueueName()
+Get the name of the default queue.
+ |
+
abstract FileSystem |
+getFileSystem()
+Retrieve the
+FileSystem used internally by this Scheduler . |
+
abstract java.lang.String[] |
+getJobs(java.lang.String... queueNames)
+Get all job identifier of jobs currently in (one ore more) queues.
+ |
+
abstract JobStatus |
+getJobStatus(java.lang.String jobIdentifier)
+Get the status of a Job.
+ |
+
JobStatus[] |
+getJobStatuses(java.lang.String... jobIdentifiers)
+Get the status of all specified
+jobs . |
+
java.lang.String |
+getLocation()
+Get the location that this Scheduler is connected to.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getProperties()
+Get the properties used to create this Scheduler.
+ |
+
abstract java.lang.String[] |
+getQueueNames()
+Get the queue names supported by this Scheduler.
+ |
+
abstract QueueStatus |
+getQueueStatus(java.lang.String queueName)
+Get the status of the
+queue . |
+
abstract QueueStatus[] |
+getQueueStatuses(java.lang.String... queueNames)
+Get the status of all
+queues . |
+
int |
+hashCode() |
+
abstract boolean |
+isOpen()
+Test if the connection of this Scheduler is open.
+ |
+
abstract java.lang.String |
+submitBatchJob(JobDescription description)
+Submit a batch job.
+ |
+
abstract Streams |
+submitInteractiveJob(JobDescription description)
+Submit an interactive job (optional operation).
+ |
+
abstract JobStatus |
+waitUntilDone(java.lang.String jobIdentifier,
+ long timeout)
+Wait until a job is done or until a timeout expires.
+ |
+
abstract JobStatus |
+waitUntilRunning(java.lang.String jobIdentifier,
+ long timeout)
+Wait until a job starts running, or until a timeout expires.
+ |
+
getClass, notify, notifyAll, toString, wait, wait, wait
public static java.lang.String[] getAdaptorNames()+
public static SchedulerAdaptorDescription getAdaptorDescription(java.lang.String adaptorName) + throws UnknownAdaptorException+
adaptorName
- the type of scheduler to connect to (e.g. "slurm" or "torque")UnknownAdaptorException
- If the adaptor name is absent in getAdaptorNames()
.public static SchedulerAdaptorDescription[] getAdaptorDescriptions()+
public static Scheduler create(java.lang.String adaptor, + java.lang.String location, + Credential credential, + java.util.Map<java.lang.String,java.lang.String> properties) + throws XenonException+
adaptor
connecting to the location
using credentials
to get access. Use
+ properties
to (optionally) configure the scheduler when it is created.
+
+ Make sure to always close Scheduler
instances by calling Scheduler.close()
when you no longer need them, otherwise their associated
+ resources may remain allocated.adaptor
- the adaptor used to access the Scheduler.location
- the location of the Scheduler.credential
- the Credentials to use to get access to the Scheduler.properties
- optional properties to configure the Scheduler when it is created.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the Scheduler failed.java.lang.IllegalArgumentException
- If adaptor is null.public static Scheduler create(java.lang.String adaptor, + java.lang.String location, + Credential credential) + throws XenonException+
adaptor
connecting to the location
using credentials
to get access.
+
+ Make sure to always close Scheduler
instances by calling Scheduler.close()
when you no longer need them, otherwise their associated
+ resources may remain allocated.adaptor
- the adaptor used to access the Scheduler.location
- the location of the Scheduler.credential
- the Credentials to use to get access to the Scheduler.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the Scheduler failed.java.lang.IllegalArgumentException
- If adaptor is null.public static Scheduler create(java.lang.String adaptor, + java.lang.String location) + throws XenonException+
adaptor
connecting to the location
using the default credentials to get access.
+
+ Make sure to always close Scheduler
instances by calling Scheduler.close()
when you no longer need them, otherwise their associated
+ resources may remain allocated.adaptor
- the adaptor used to access the Scheduler.location
- the location of the Scheduler.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the Scheduler failed.java.lang.IllegalArgumentException
- If adaptor is null.public static Scheduler create(java.lang.String adaptor) + throws XenonException+
adaptor
connecting to the default location and using the default credentials to get access.
+
+ Note that there are very few adaptors that support a default scheduler location. The local scheduler adaptor is the prime example.
+
+ Make sure to always close Scheduler
instances by calling Scheduler.close()
when you no longer need them, otherwise their associated
+ resources may remain allocated.adaptor
- the adaptor used to access the Scheduler.UnknownPropertyException
- If a unknown property was provided.InvalidPropertyException
- If a known property was provided with an invalid value.InvalidLocationException
- If the location was invalid.InvalidCredentialException
- If the credential is invalid to access the location.XenonException
- If the creation of the Scheduler failed.java.lang.IllegalArgumentException
- If adaptor is null.public java.lang.String getAdaptorName()+
public java.lang.String getLocation()+
public Credential getCredential()+
public java.util.Map<java.lang.String,java.lang.String> getProperties()+
public abstract java.lang.String[] getQueueNames() + throws XenonException+
nl.esciencecenter.xenon.adaptors.NotConnectedException
- If scheduler is closed.XenonException
- If an I/O error occurred.public abstract void close() + throws XenonException+
close
in interface java.lang.AutoCloseable
XenonException
- If the Scheduler failed to close.public abstract boolean isOpen() + throws XenonException+
true
if the connection of this Scheduler is still open, false
otherwise.XenonException
- If an I/O error occurred.public abstract java.lang.String getDefaultQueueName() + throws XenonException+
null
if no default queue is available.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If scheduler is closed.XenonException
- If an I/O error occurred.public abstract java.lang.String[] getJobs(java.lang.String... queueNames) + throws XenonException+
queueNames
- the names of the queues.nl.esciencecenter.xenon.adaptors.NotConnectedException
- If scheduler is closed.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get jobs.public abstract QueueStatus getQueueStatus(java.lang.String queueName) + throws XenonException+
queue
.queueName
- the name of the queue.NoSuchQueueException
- If the queue does not exist in the scheduler.XenonException
- If the Scheduler failed to get its status.public abstract QueueStatus[] getQueueStatuses(java.lang.String... queueNames) + throws XenonException+
queues
.
+
+ Note that this method will only throw an exception when this exception will influence all status requests. For example, if the scheduler is no longer
+ connected.
+
+ Exceptions that only refer to a single queue are returned in the QueueStatus returned for that queue.queueNames
- the names of the queues.XenonException
- If the Scheduler failed to get the statuses.public abstract java.lang.String submitBatchJob(JobDescription description) + throws XenonException+
description
- the description of the batch job to submit.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public abstract Streams submitInteractiveJob(JobDescription description) + throws XenonException+
description
- the description of the interactive job to submit.Streams
object containing the job identifier and the standard streams of a job.IncompleteJobDescriptionException
- If the description did not contain the required information.InvalidJobDescriptionException
- If the description contains illegal or conflicting values.UnsupportedJobDescriptionException
- If the description is not legal for this scheduler.XenonException
- If the Scheduler failed to get submit the job.public abstract JobStatus getJobStatus(java.lang.String jobIdentifier) + throws XenonException+
jobIdentifier
- the job identifier of the job to get the status for.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public JobStatus[] getJobStatuses(java.lang.String... jobIdentifiers) + throws XenonException+
jobs
.
+
+ The array of JobStatus
contains one entry for each of the jobs
. The order of the elements in the returned
+ JobStatus
array corresponds to the order in which the jobs
are passed as parameters. If a job
is
+ null
, the corresponding entry in the JobStatus
array will also be null
. If the retrieval of the
+ JobStatus
fails for a job, the exception will be stored in the corresponding JobsStatus
entry.
+
jobIdentifiers
- the job identifiers for which to retrieve the status.XenonException
- If an I/O error occurredpublic abstract JobStatus cancelJob(java.lang.String jobIdentifier) + throws XenonException+
+ A status is returned that indicates the state of the job after the cancel. If the job was already done it cannot be cancelled. +
+
+ A JobStatus
is returned that can be used to determine the state of the job after cancelJob returns. Note that it may take some time before the
+ job has actually terminated. The waitUntilDone
method can be used to wait until the job is terminated.
+
jobIdentifier
- the identifier of job to kill.NoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public abstract JobStatus waitUntilDone(java.lang.String jobIdentifier, + long timeout) + throws XenonException+
+ This method will wait until a job is done (either gracefully or by being killed or producing an error), or until the timeout expires, whichever comes + first. If the timeout expires, the job will continue to run. +
++ The timeout is in milliseconds and must be >= 0. When timeout is 0, it will be ignored and this method will wait until the jobs is done. +
++ A JobStatus is returned that can be used to determine why the call returned. +
jobIdentifier
- the identifier of the to wait for.timeout
- the maximum time to wait for the job in milliseconds.java.lang.IllegalArgumentException
- If the value of timeout is negativeNoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public abstract JobStatus waitUntilRunning(java.lang.String jobIdentifier, + long timeout) + throws XenonException+
+ This method will return as soon as the job is no longer waiting in the queue, or when the timeout expires, whichever comes first. If the job is no longer + waiting in the queue, it may be running, but it may also be killed, finished or have produced an error. If the timeout expires, the job will continue to + be queued normally. +
++ The timeout is in milliseconds and must be >= 0. When timeout is 0, it will be ignored and this method will wait until the job is no longer queued. +
++ A JobStatus is returned that can be used to determine why the call returned. +
jobIdentifier
- the identifier of the to wait for.timeout
- the maximum time to wait in milliseconds.java.lang.IllegalArgumentException
- If the value of timeout is negativeNoSuchJobException
- If the job is not known.XenonException
- If the status of the job could not be retrieved.public abstract FileSystem getFileSystem() + throws XenonException+
FileSystem
used internally by this Scheduler
.
+
+ Often, a Scheduler
needs to access files or directories on the machine it will schedule jobs. For example, to ensure a working directory
+ exists, or to redirect the stdin, stdout or stderr streams used by a job.
+
+ This method returns this FileSystem
so it can also be used by the application to prepare input files for the jobs, or retrieve the output
+ files produced by the jobs.
+
FileSystem
used by this Scheduler.XenonException
- if this Scheduler does not use a FileSystem
internally.public boolean equals(java.lang.Object o)+
equals
in class java.lang.Object
public int hashCode()+
hashCode
in class java.lang.Object
public interface SchedulerAdaptorDescription +extends AdaptorDescription+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+isEmbedded()
+Is this an embedded scheduler ?
+
+ Embedded schedulers are implemented inside the Xenon process itself.
+ |
+
boolean |
+supportsBatch()
+Does this Scheduler support the submission of batch jobs ?
+
+ For batch jobs the standard streams of the jobs are redirected from and to files.
+ |
+
boolean |
+supportsInteractive()
+Does this Scheduler supports the submission of interactive jobs ?
+
+ For interactive jobs the standard streams of the job must be handled by the submitting process.
+ |
+
boolean |
+usesFileSystem()
+Does this Scheduler create a FileSystem to support the submission of jobs ?
+
+ Many scheduler implementations use a FileSystem internally to handle job submission, for example to store submission scripts or handle the standard I/O
+ streams of a process.
+ |
+
getDescription, getName, getSupportedCredentials, getSupportedLocations, getSupportedProperties
boolean isEmbedded()+
boolean supportsBatch()+
boolean supportsInteractive()+
boolean usesFileSystem()+
Scheduler.getFileSystem()
method.Scheduler
create a FileSystem to support the submission of jobs ?public interface Streams
+Modifier and Type | +Method and Description | +
---|---|
java.lang.String |
+getJobIdentifier()
+Get the identifier of the job for which this Streams was created.
+ |
+
java.io.InputStream |
+getStderr()
+Returns the standard error stream of job.
+ |
+
java.io.OutputStream |
+getStdin()
+Returns the standard input stream of job.
+ |
+
java.io.InputStream |
+getStdout()
+Returns the standard output stream of job.
+ |
+
java.lang.String getJobIdentifier()+
java.io.InputStream getStdout()+
java.io.InputStream getStderr()+
java.io.OutputStream getStdin()+
public class UnsupportedJobDescriptionException +extends XenonException+
Constructor and Description | +
---|
UnsupportedJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message) |
+
UnsupportedJobDescriptionException(java.lang.String adaptorName,
+ java.lang.String message,
+ java.lang.Throwable t) |
+
getMessage
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public UnsupportedJobDescriptionException(java.lang.String adaptorName, + java.lang.String message, + java.lang.Throwable t)+
public UnsupportedJobDescriptionException(java.lang.String adaptorName, + java.lang.String message)+
See: Description
+Interface | +Description | +
---|---|
JobStatus | +
+ JobStatus contains status information for a specific job.
+ |
+
QueueStatus | +
+ QueueStatus contains status information for a specific queue.
+ |
+
SchedulerAdaptorDescription | ++ |
Streams | +
+ Streams is a container for the standard input, output and error streams of a job.
+ |
+
Class | +Description | +
---|---|
JobDescription | +
+ JobDescription contains a description of a job that can be submitted to a
+Scheduler . |
+
Scheduler | +
+ Scheduler represents a (possibly remote) scheduler that can be used to submit jobs and retrieve queue information.
+ |
+
Exception | +Description | +
---|---|
IncompleteJobDescriptionException | +
+ Signals that a JobDescription is missing required options.
+ |
+
InvalidJobDescriptionException | +
+ Signals that a JobDescription contains invalid values for certain options.
+ |
+
NoSuchJobException | +
+ Signals that a Job was not found.
+ |
+
NoSuchQueueException | +
+ Signals that a unknown queue was provided.
+ |
+
UnsupportedJobDescriptionException | +
+ Signals that a combination of options used in a JobDescription is not supported by a resource.
+ |
+
public final class InputWriter
+extends java.lang.Thread
+String
to an OutputStream
.
+ Once the end of the string is reached, the destination stream will be closed.java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description | +
---|
InputWriter(java.lang.String content,
+ java.io.OutputStream destination)
+Create a new InputWriter that writes
+content to the destination . |
+
Modifier and Type | +Method and Description | +
---|---|
boolean |
+isFinished()
+Poll if the InputWriter has finished writing.
+ |
+
void |
+run()
+Entry point for the Daemon thread.
+ |
+
void |
+waitUntilFinished()
+Wait until the InputWriter has finished writing.
+ |
+
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public InputWriter(java.lang.String content, + java.io.OutputStream destination)+
content
to the destination
.content
- the data to write to the destination.destination
- the destination to write to.public boolean isFinished()+
public void waitUntilFinished()+
public void run()+
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public class JavaJobDescription +extends JobDescription+
DEFAULT_MAX_RUN_TIME_IN_MINUTES
Constructor and Description | +
---|
JavaJobDescription() |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+addJavaArgument(java.lang.String javaArgument) |
+
void |
+addJavaClasspathElement(java.lang.String element) |
+
void |
+addJavaOption(java.lang.String option)
+Adds a JVM option.
+ |
+
void |
+addJavaSystemProperty(java.lang.String key,
+ java.lang.String value)
+Adds a system property to the current set of system properties.
+ |
+
boolean |
+equals(java.lang.Object obj) |
+
java.util.List<java.lang.String> |
+getArguments()
+Constructs the command line arguments from the class path, the JVM options, the system properties, the main and the java arguments.
+ |
+
java.util.List<java.lang.String> |
+getArguments(char pathSeparator)
+Constructs the command line arguments from the class path, the JVM options, the system properties, the main and the java arguments.
+ |
+
java.lang.String |
+getExecutable()
+Returns the executable.
+ |
+
java.util.List<java.lang.String> |
+getJavaArguments()
+Returns the arguments for the main class.
+ |
+
java.util.List<java.lang.String> |
+getJavaClasspath()
+Returns the java class path.
+ |
+
java.lang.String |
+getJavaMain()
+Returns the main class of the java application.
+ |
+
java.util.List<java.lang.String> |
+getJavaOptions()
+Returns the JVM options.
+ |
+
java.util.Map<java.lang.String,java.lang.String> |
+getJavaSystemProperties()
+Returns the java system properties.
+ |
+
int |
+hashCode() |
+
void |
+setArguments(java.lang.String... arguments)
+This method should not be used.
+ |
+
void |
+setJavaArguments(java.lang.String... javaArguments)
+Sets the arguments of the java main class.
+ |
+
void |
+setJavaClasspath(java.lang.String... javaClasspath)
+Sets the java class path.
+ |
+
void |
+setJavaMain(java.lang.String main)
+Sets the main class.
+ |
+
void |
+setJavaOptions(java.lang.String... options)
+Sets the JVM options.
+ |
+
void |
+setJavaSystemProperties(java.util.Map<java.lang.String,java.lang.String> systemProperties)
+Sets the system properties.
+ |
+
java.lang.String |
+toString() |
+
addArgument, addEnvironment, addJobOption, addSchedulerArgument, getEnvironment, getJobOptions, getMaxMemory, getMaxRuntime, getName, getNodeCount, getProcessesPerNode, getQueueName, getSchedulerArguments, getStderr, getStdin, getStdout, getTempSpace, getThreadsPerProcess, getWorkingDirectory, isStartSingleProcess, setEnvironment, setExecutable, setJobOptions, setMaxMemory, setMaxRuntime, setName, setNodeCount, setProcessesPerNode, setQueueName, setSchedulerArguments, setStartSingleProcess, setStderr, setStdin, setStdout, setTempSpace, setThreadsPerProcess, setWorkingDirectory
getClass, notify, notifyAll, wait, wait, wait
public java.util.List<java.lang.String> getJavaOptions()+
public void setJavaOptions(java.lang.String... options)+
options
- the JVM options.public void addJavaOption(java.lang.String option)+
option
- the JVM option.public java.util.Map<java.lang.String,java.lang.String> getJavaSystemProperties()+
public void setJavaSystemProperties(java.util.Map<java.lang.String,java.lang.String> systemProperties)+
systemProperties
- the system properties.public void addJavaSystemProperty(java.lang.String key, + java.lang.String value)+
key
- the key of the system property to be addedvalue
- the value belonging to the key of the system property to be addedpublic java.lang.String getJavaMain()+
public void setJavaMain(java.lang.String main)+
main
- the main class.public java.util.List<java.lang.String> getJavaArguments()+
public void setJavaArguments(java.lang.String... javaArguments)+
javaArguments
- the arguments of the java main class.public void addJavaArgument(java.lang.String javaArgument)+
public void setArguments(java.lang.String... arguments)+
setJavaClasspath(String...)
,
+ setJavaOptions(String[])
, setJavaSystemProperties(Map)
, setJavaMain(String)
and setJavaArguments(String[])
should be
+ used to construct the command line arguments.setArguments
in class JobDescription
arguments
- do not usepublic java.util.List<java.lang.String> getArguments()+
getArguments
in class JobDescription
public java.util.List<java.lang.String> getArguments(char pathSeparator)+
pathSeparator
- the seperator to use in the classpath. Defaults to the unix path seperator ':'public java.lang.String getExecutable()+
getExecutable
in class JobDescription
public java.util.List<java.lang.String> getJavaClasspath()+
public void setJavaClasspath(java.lang.String... javaClasspath)+
javaClasspath
- the class path to be set.public void addJavaClasspathElement(java.lang.String element)+
public java.lang.String toString()+
toString
in class JobDescription
public int hashCode()+
hashCode
in class JobDescription
public boolean equals(java.lang.Object obj)+
equals
in class JobDescription
public class LocalFileSystemUtils
+extends java.lang.Object
+Modifier and Type | +Method and Description | +
---|---|
static java.lang.String |
+expandTilde(java.lang.String path)
+Expand the tilde in a String representation of a path by the users home directory, as provided by the
+user.home property. |
+
static FileSystem[] |
+getLocalFileSystems()
+Returns all local FileSystems.
+ |
+
static java.lang.String |
+getLocalRoot(java.lang.String p)
+Return the locally valid root element of an
+String representation of an absolute path. |
+
static java.lang.String |
+getLocalRootlessPath(java.lang.String path)
+Return the local root less path of an absolute path.
+ |
+
static char |
+getLocalSeparator()
+Returns the local file system path separator character.
+ |
+
static boolean |
+isLinux()
+Returns if we are currently running on Linux.
+ |
+
static boolean |
+isLinuxRoot(java.lang.String root)
+Check if
+root only contains a valid Linux root element, which is "/". |
+
static boolean |
+isLocalRoot(java.lang.String root)
+Check if
+root contains a locally valid root element, such as "C:" on Windows or "/" on Linux and OSX. |
+
static boolean |
+isOSX()
+Returns if we are currently running on OSX.
+ |
+
static boolean |
+isOSXRoot(java.lang.String root)
+Check if
+root contains a valid OSX root element, which is "/". |
+
static boolean |
+isWindows()
+Returns if we are currently running on Windows.
+ |
+
static boolean |
+isWindowsRoot(java.lang.String root)
+Check if
+root only contains a valid Windows root element such as "C:". |
+
static boolean |
+startsWithLinuxRoot(java.lang.String path)
+Checks if the provide path starts with a valid Linux root, that is "/".
+ |
+
static boolean |
+startWithRoot(java.lang.String path)
+Checks if the provide path starts with a valid root, such as "/" or "C:".
+ |
+
static boolean |
+startWithWindowsRoot(java.lang.String path)
+Checks if the provide path starts with a valid Windows root, for example "C:".
+ |
+
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public static boolean isWindows()+
public static boolean isOSX()+
public static boolean isLinux()+
public static boolean isWindowsRoot(java.lang.String root)+
root
only contains a valid Windows root element such as "C:".
+
+ If root
is null
or empty, false
will be returned. If root
contains more than just a root element,
+ false
will be returned.root
- The root to check.root
only contains a valid Windows root element.public static boolean isLinuxRoot(java.lang.String root)+
root
only contains a valid Linux root element, which is "/".
+
+ If root
is null
or empty, false
will be returned. If root
contains more than just a root element,
+ false
will be returned.root
- The root to check.root
only contains a valid Linux root element.public static boolean isOSXRoot(java.lang.String root)+
root
contains a valid OSX root element, which is "/".
+
+ If root
is null
or empty, false
will be returned. If root
contains more than just a root element,
+ false
will be returned.root
- The root to check.root
only contains a valid OSX root element.public static boolean isLocalRoot(java.lang.String root)+
root
contains a locally valid root element, such as "C:" on Windows or "/" on Linux and OSX.
+
+ If root
is null
or empty, false
will be returned. If root
contains more than just a root element,
+ false
will be returned.
+
+ Note that the result of this method depends on the OS the application is running on.root
- The root to check.root
only contains a valid OSX root element.public static boolean startsWithLinuxRoot(java.lang.String path)+
path
- The path to check.public static boolean startWithWindowsRoot(java.lang.String path)+
path
- The path to check.public static boolean startWithRoot(java.lang.String path)+
path
- The path to check.public static java.lang.String getLocalRoot(java.lang.String p) + throws InvalidLocationException+
String
representation of an absolute path.
+
+ Examples of a root elements are "/" or "C:". If the provided path does not contain a locally valid root element, an exception will be thrown. For
+ example, providing "/user/local" will return "/" on Linux or OSX, but throw an exception on Windows; providing "C:\test" will return "C:" on Windows but
+ throw an exception on Linux or OSX.
+
+ If the provided string is null
or empty, the default root element for this OS will be returned, i.e,. "/" on Linux or OSX and "C:" on
+ windows.p
- The absolute path for which to determine the root element.InvalidLocationException
- If the provided path
is not absolute, or does not contain a locally valid root.public static java.lang.String expandTilde(java.lang.String path)+
user.home
property.
+
+ The tilde will only be replaced if it is the first character in the path and either the only character in the path or directly followed by the local
+ separator character or directly followed by the local user name (as provided by the user.name
property).
+
+ For example, if user.name
is set to "john" and user.home
is set to "/home/john", then "~" will be expanded to "/home/john",
+ "~/foo" or "~john/foo" will be expanded to "/home/john/foo".
+
+ However, in paths like "/foo/bar", "~matt/foo" or "/foo/~" the tilde will not be expanded, and the provided path is returned unchanged. This includes a
+ path that is null
.
+
+ If the user.home
property is not set, the tilde will not be expanded and the provided path will be returned unchanged. If the
+ user.name
property is not set, the combined tilde-username expansion will not be performed.path
- the path in which to replace the tilde (if possible).public static java.lang.String getLocalRootlessPath(java.lang.String path)+
path
- The absolute path from which to remove the root element.public static char getLocalSeparator()+
public static FileSystem[] getLocalFileSystems() + throws XenonException+
FileSystems
representing each of these roots.XenonException
- If the creation of the FileSystem failed.public final class OutputReader
+extends java.lang.Thread
+InputStream
and buffer this data. Once
+ end-of-stream is reached, this data will be made available as a String
.
+
+ Note that since the data is buffered in memory, so it is not advisable to use this OutputReader to read large amounts of data.java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description | +
---|
OutputReader(java.io.InputStream source)
+Create an OutputReader that reads from
+source . |
+
Modifier and Type | +Method and Description | +
---|---|
byte[] |
+getResult()
+Returns the data that has been read from the
+InputStream as a byte array. |
+
java.lang.String |
+getResultAsString()
+Returns the data that has been read from the
+InputStream as a String . |
+
boolean |
+isFinished()
+Returns if the OutputReader has finished (i.e., has reached the end-of-stream on the input).
+ |
+
void |
+run()
+Entry method for daemon thread.
+ |
+
void |
+waitUntilFinished()
+Waits until the OutputReader has finished (i.e., has reached the end-of-stream on the input).
+ |
+
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public OutputReader(java.io.InputStream source)+
source
.source
- the {#link InputStream} to read from.public boolean isFinished()+
getResultAsString()
.public void waitUntilFinished()+
getResultAsString()
.public void run()+
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public java.lang.String getResultAsString()+
InputStream
as a String
. If the
+ OutputReader has not finished reading, this method will block until end-of-stream has been reached.public byte[] getResult()+
InputStream
as a byte array. If the
+ OutputReader has not finished reading, this method will block until end-of-stream has been reached.public final class StreamForwarder
+extends java.lang.Thread
+InputStream
and write it to a OutputStream
. A small
+ buffer is used (typically 1 KB) to improve performance. Any exceptions will be ignored.java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description | +
---|
StreamForwarder(java.io.InputStream in,
+ java.io.OutputStream out)
+Create a new StreamForwarder and start it immediately.
+ |
+
StreamForwarder(java.lang.String name,
+ java.io.InputStream in,
+ java.io.OutputStream out,
+ int bufferSize)
+Create a new StreamForwarder and start it immediately.
+ |
+
Modifier and Type | +Method and Description | +
---|---|
void |
+run()
+Main entry method for the daemon thread.
+ |
+
void |
+terminate(long timeout)
+Wait for a given timeout for the StreamForwarder to terminate by reading an end-of-stream on the input.
+ |
+
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public StreamForwarder(java.lang.String name, + java.io.InputStream in, + java.io.OutputStream out, + int bufferSize)+
name
- the name of the threadin
- the InputStream
to read from.out
- the OutputStream
to write to, or null
to discard the output.bufferSize
- the buffer size to use, or 0 to use the default.public StreamForwarder(java.io.InputStream in, + java.io.OutputStream out)+
in
- the InputStream
to read from.out
- the OutputStream
to write to.public void terminate(long timeout)+
timeout
- The number of milliseconds to wait for termination.public void run()+
run
in interface java.lang.Runnable
run
in class java.lang.Thread
See: Description
+Class | +Description | +
---|---|
InputWriter | +
+ A simple input writer that uses a daemon thread to write from an
+String to an OutputStream . |
+
JavaJobDescription | +
+ A JobDescription specialized in Java applications.
+ |
+
LocalFileSystemUtils | ++ |
OutputReader | +
+ A simple output reader that uses a daemon thread to read from an
+InputStream and buffer this data. |
+
StreamForwarder | +
+ A simple stream forwarder that uses a daemon thread to read from an
+InputStream and write it to a OutputStream . |
+
+ + diff --git a/docs/versions/2.6.2/javadoc/overview-summary.html b/docs/versions/2.6.2/javadoc/overview-summary.html new file mode 100644 index 000000000..b65ac62b4 --- /dev/null +++ b/docs/versions/2.6.2/javadoc/overview-summary.html @@ -0,0 +1,740 @@ + + + + + +
See: Description
+Package | +Description | +
---|---|
nl.esciencecenter.xenon | +
+ This package is the main entry point into the Xenon API.
+ |
+
nl.esciencecenter.xenon.credentials | +
+ This package contains classes and interfaces for managing credentials.
+ |
+
nl.esciencecenter.xenon.filesystems | +
+ This package contains classes and interfaces for manipulating files.
+ |
+
nl.esciencecenter.xenon.schedulers | +
+ This package contains the classes and interfaces used to run jobs.
+ |
+
nl.esciencecenter.xenon.utils | +
+ This package is contains several utility classes.
+ |
+
The main entry points are
+This section contains the adaptor documentation which is generated from the information provided by the adaptors themselves.
+The local jobs adaptor implements all functionality by emulating a local queue.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.local.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.local.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq. | +INTEGER | +4 | +
The SSH job adaptor implements all functionality to start jobs on ssh servers.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.ssh.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.agentForwarding |
+Use ssh-agent forwarding | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.timeout |
+The timeout for the connection setup and authetication (in milliseconds). | +LONG | +10000 | +
xenon.adaptors.schedulers.ssh.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq.. | +INTEGER | +4 | +
The SGE Adaptor submits jobs to a (Sun/Oracle/Univa) Grid Engine scheduler. This adaptor uses either the local or the ssh scheduler adaptor to run commands on the machine running Grid Engine, and the file or the stfp filesystem adaptor to gain access to the filesystem of that machine.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.gridengine.ignore.version |
+Skip version check is skipped when connecting to remote machines. WARNING: it is not recommended to use this setting in production environments! | +BOOLEAN | +false | +
xenon.adaptors.schedulers.gridengine.accounting.grace.time |
+Number of milliseconds a job is allowed to take going from the queue to the qacct output. | +LONG | +60000 | +
xenon.adaptors.schedulers.gridengine.poll.delay |
+Number of milliseconds between polling the status of a job. | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.agentForwarding |
+Use ssh-agent forwarding | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.timeout |
+The timeout for the connection setup and authetication (in milliseconds). | +LONG | +10000 | +
xenon.adaptors.schedulers.ssh.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq.. | +INTEGER | +4 | +
xenon.adaptors.schedulers.local.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.local.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq. | +INTEGER | +4 | +
The Slurm Adaptor submits jobs to a Slurm scheduler. This adaptor uses either the local or the ssh scheduler adaptor to run commands on the machine running Slurm, and the file or the stfp filesystem adaptor to gain access to the filesystem of that machine.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.slurm.disable.accounting.usage |
+Do not use accounting info of slurm, even when available. Mostly for testing purposes | +BOOLEAN | +false | +
xenon.adaptors.schedulers.slurm.poll.delay |
+Number of milliseconds between polling the status of a job. | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.agentForwarding |
+Use ssh-agent forwarding | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.timeout |
+The timeout for the connection setup and authetication (in milliseconds). | +LONG | +10000 | +
xenon.adaptors.schedulers.ssh.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq.. | +INTEGER | +4 | +
xenon.adaptors.schedulers.local.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.local.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq. | +INTEGER | +4 | +
The Torque Adaptor submits jobs to a TORQUE batch system. This adaptor uses either the local or the ssh scheduler adaptor to run commands on the machine running TORQUE, and the file or the stfp filesystem adaptor to gain access to the filesystem of that machine.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.schedulers.torque.ignore.version |
+Skip version check is skipped when connecting to remote machines. WARNING: it is not recommended to use this setting in production environments! | +BOOLEAN | +false | +
xenon.adaptors.schedulers.torque.accounting.grace.time |
+Number of milliseconds a job is allowed to take going from the queue to the accinfo output. | +LONG | +60000 | +
xenon.adaptors.schedulers.torque.poll.delay |
+Number of milliseconds between polling the status of a job. | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.schedulers.ssh.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.agentForwarding |
+Use ssh-agent forwarding | +BOOLEAN | +false | +
xenon.adaptors.schedulers.ssh.timeout |
+The timeout for the connection setup and authetication (in milliseconds). | +LONG | +10000 | +
xenon.adaptors.schedulers.ssh.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.ssh.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq.. | +INTEGER | +4 | +
xenon.adaptors.schedulers.local.queue.pollingDelay |
+The polling delay for monitoring running jobs (in milliseconds). | +LONG | +1000 | +
xenon.adaptors.schedulers.local.queue.multi.maxConcurrentJobs |
+The maximum number of concurrent jobs in the multiq. | +INTEGER | +4 | +
This is the local file adaptor that implements file functionality for local access.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.file.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
The FTP adaptor implements file access on remote ftp servers.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.ftp.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
The SFTP adaptor implements all file access functionality to remote SFTP servers
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.sftp.strictHostKeyChecking |
+Enable strict host key checking. | +BOOLEAN | +true | +
xenon.adaptors.filesystems.sftp.loadKnownHosts |
+Load the standard known_hosts file. | +BOOLEAN | +true | +
xenon.adaptors.filesystems.sftp.loadSshConfig |
+Load the OpenSSH config file. | +BOOLEAN | +true | +
xenon.adaptors.filesystems.sftp.agent |
+Use a (local) ssh-agent. | +BOOLEAN | +false | +
xenon.adaptors.filesystems.sftp.agentForwarding |
+Use ssh-agent forwarding when setting up a connection. | +BOOLEAN | +false | +
xenon.adaptors.filesystems.sftp.connection.timeout |
+The timeout for creating and authenticating connections (in milliseconds). | +NATURAL | +10000 | +
xenon.adaptors.filesystems.sftp.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
The webdav file adaptor implements file access to remote webdav servers.
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.webdav.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
The JClouds adaptor uses Apache JClouds to talk to s3 and others
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.s3.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
Adaptor for the Apache Hadoop file system
+Name | Description | Expected type | Default |
---|---|---|---|
xenon.adaptors.filesystems.hdfs.bufferSize |
+The buffer size to use when copying files (in bytes). | +SIZE | +64K | +
xenon.adaptors.filesystems.hdfs.hadoopSettingsFile |
+The path to the file with the hadoop settings, i.e. "/home/xenon/core-site.xml". | +STRING | ++ |
java.lang.String adaptorName+
java.lang.String adaptorName+