Skip to content

Commit 4a69ec5

Browse files
MINGYJkorydraughn
authored andcommitted
iRODS: Replace Jargon with irods4j
1 parent 535c8ef commit 4a69ec5

28 files changed

+1269
-616
lines changed

irods/bin/pom.xml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<!--
2+
~ Copyright (c) 2002-2016 iterate GmbH. All rights reserved.
3+
~ https://cyberduck.io/
4+
~
5+
~ This program is free software; you can redistribute it and/or modify
6+
~ it under the terms of the GNU General Public License as published by
7+
~ the Free Software Foundation; either version 2 of the License, or
8+
~ (at your option) any later version.
9+
~
10+
~ This program is distributed in the hope that it will be useful,
11+
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
~ GNU General Public License for more details.
14+
-->
15+
16+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
17+
<modelVersion>4.0.0</modelVersion>
18+
<parent>
19+
<groupId>ch.cyberduck</groupId>
20+
<artifactId>parent</artifactId>
21+
<version>9.2.0-SNAPSHOT</version>
22+
</parent>
23+
<artifactId>irods</artifactId>
24+
<packaging>jar</packaging>
25+
26+
<dependencies>
27+
<dependency>
28+
<groupId>ch.cyberduck</groupId>
29+
<artifactId>core</artifactId>
30+
<version>${project.version}</version>
31+
</dependency>
32+
<dependency>
33+
<groupId>ch.cyberduck</groupId>
34+
<artifactId>test</artifactId>
35+
<type>pom</type>
36+
<scope>test</scope>
37+
<version>${project.version}</version>
38+
</dependency>
39+
<!--
40+
<dependency>
41+
<groupId>ch.iterate.jargon</groupId>
42+
<artifactId>jargon-core</artifactId>
43+
<version>4.2.0.1</version>
44+
<exclusions>
45+
<exclusion>
46+
<groupId>com.claymoresystems</groupId>
47+
<artifactId>puretls</artifactId>
48+
</exclusion>
49+
<exclusion>
50+
<groupId>org.globus.jglobus</groupId>
51+
<artifactId>cog-jglobus</artifactId>
52+
</exclusion>
53+
<exclusion>
54+
<groupId>org.perf4j</groupId>
55+
<artifactId>perf4j</artifactId>
56+
</exclusion>
57+
<exclusion>
58+
<groupId>log4j</groupId>
59+
<artifactId>log4j</artifactId>
60+
</exclusion>
61+
</exclusions>
62+
</dependency>
63+
-->
64+
</dependencies>
65+
66+
<build>
67+
<plugins>
68+
<plugin>
69+
<groupId>org.apache.maven.plugins</groupId>
70+
<artifactId>maven-failsafe-plugin</artifactId>
71+
<configuration>
72+
<skipTests>true</skipTests>
73+
</configuration>
74+
</plugin>
75+
</plugins>
76+
</build>
77+
</project>
78+
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>Protocol</key>
6+
<string>irods</string>
7+
<key>Vendor</key>
8+
<string>iplant</string>
9+
<key>Description</key>
10+
<string>iPlant Data Store</string>
11+
<key>Hostname Configurable</key>
12+
<false/>
13+
<key>Port Configurable</key>
14+
<false/>
15+
<key>Default Hostname</key>
16+
<string>data.iplantcollaborative.org</string>
17+
<key>Region</key>
18+
<string>iplant</string>
19+
<key>Default Port</key>
20+
<string>1247</string>
21+
<key>Username Placeholder</key>
22+
<string>iPlant username</string>
23+
<key>Password Placeholder</key>
24+
<string>iPlant password</string>
25+
<key>Authorization</key>
26+
<string>STANDARD</string>
27+
</dict>
28+
</plist>

irods/output.txt

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
irods.host=172.20.0.2
2+
irods.port=1247
3+
irods.zoneName=tempZone
4+
5+
# STANDARD | PAM AUTH
6+
irods.auth.scheme=STANDARD
7+
default.storage.resource=
8+
9+
# sets jargon ssl negotiation policy for the client. Leaving to DONT_CARE defers to the server, and is recommended
10+
# NO_NEGOTIATION, CS_NEG_REFUSE, CS_NEG_REQUIRE, CS_NEG_DONT_CARE
11+
ssl.negotiation.policy=CS_NEG_REFUSE
12+
13+
##########################################################
14+
# jargon properties settings
15+
utilize.packing.streams=true
16+
17+
# jargon now supports checksum calculation for streaming uploads. This does not currently verify, but does store if set to true
18+
compute.checksum=true
19+
20+
######################################
21+
# other irods environment
22+
23+
# HTTP connection for RMD
24+
rmd.connection.timeout=500
25+
rmd.connection.port=8000
26+
27+
# Reverse DNS lookup on dashboard
28+
reverse.dns.lookup=false
29+
30+
######################################
31+
# msi props
32+
populate.msi.enabled=false
33+
illumina.msi.enabled=true
34+
35+
# MSI API version supported by this application
36+
msi.api.version=1.X.X
37+
38+
msi.metalnx.list=libmsiget_illumina_meta.so,libmsiobjget_microservices.so,libmsiobjget_version.so,libmsiobjjpeg_extract.so,libmsiobjput_mdbam.so,libmsiobjput_mdbam.so,libmsiobjput_mdmanifest.so,libmsiobjput_mdvcf.so,libmsiobjput_populate.so
39+
40+
msi.irods.list=libmsisync_to_archive.so,libmsi_update_unixfilesystem_resource_free_space.so,libmsiobjput_http.so,libmsiobjput_irods.so,libmsiobjget_irods.so,libmsiobjget_http.so,libmsiobjput_slink.so,libmsiobjget_slink.so
41+
42+
msi.irods.42.list=libmsisync_to_archive.so,libmsi_update_unixfilesystem_resource_free_space.so
43+
44+
msi.other.list=
45+
######################################
46+
# global feature flags that serve as defaults. Note that the info handling will manipulate aspects of the data profiler,
47+
# so by default some things are set to null to be turned on by the service depending on the view requested (e.g. acl, metadata, replicas) and should be left 'false' as a default,
48+
# but other aspects, such as metadata templating and mime type detection, can be globally turned on or off depending on the implmenetation.
49+
# controls access to features globally
50+
metalnx.enable.tickets=false
51+
# disable automatic detection and running of rules on upload
52+
metalnx.enable.upload.rules=false
53+
# download size limit in megabytes (6000=6GB)
54+
metalnx.download.limit=6000
55+
# show dashboard (off by default due to performance issues)
56+
metalnx.enable.dashboard=false
57+
######################################
58+
# info home page feature flags
59+
# this controls the behavior of the data profiler and what information it will gather
60+
irodsext.dataprofiler.retrieve.tickets=false
61+
# process starred or favorites
62+
irodsext.dataprofiler.retrieve.starred=true
63+
# process shared
64+
irodsext.dataprofiler.retrieve.shared=false
65+
# tags and comments
66+
irodsext.dataprofiler.retrieve.tags.and.comments=false
67+
# metadata templates (currently not implemented)
68+
irodsext.dataprofiler.retrieve.metadata.templates=false
69+
# save data type information for later use
70+
irodsext.datatyper.persist.data.types=false
71+
# perform a detailed versus a lightweight data typing, which may involve processing the file contents
72+
irodsext.datatyper.detailed.determination=false
73+
74+
#############################
75+
# misc ui configuration niceties
76+
#############################
77+
# allow translation of iRODS auth types to user friendly names in login
78+
# in the form irodstype:displaytype|
79+
metalnx.authtype.mappings=PAM:PAM|STANDARD:Standard
80+
81+
#############################
82+
# JWT configuration (necessary when using search and notification services). Otherwise can be left as-is and ignored
83+
#############################
84+
jwt.issuer=metalnx
85+
jwt.secret=thisisasecretthatisverysecretyouwillneverguessthiskey
86+
jwt.algo=HS384
87+
88+
#############################
89+
# Pluggable search configuration. Turn on and off pluggable search globally, and configure search endpoints.
90+
# N.B. pluggable search also requires provisioning of the jwt.* information above
91+
#############################
92+
# configured endpoints, comma delimited in form https://host.com/v1
93+
# Note the commented out URL which matches up to the irods-contrib/file-and-metadata-indexer docker compose assembly. In order to
94+
# utilize this assembly you need to uncomment the URL and set pluggablesearch.enabled to true
95+
pluggablesearch.endpointRegistryList=
96+
# enable pluggable search globally and show the search GUI components
97+
pluggablesearch.enabled=false
98+
# display the older file and properties search in the menu, if you are running the elasticsearch standard plugin this is probably
99+
# a menu item to turn off
100+
classicsearch.enabled=true
101+
# JWT subject claim used to access search endpoint for data gathering. User searches will utilize the name of the individual
102+
pluggablesearch.endpointAccessSubject=metalnx
103+
# timeout for info/attribute gathering, set to 0 for no timeout
104+
pluggablesearch.info.timeout=0
105+
# timeout for actual search, set to 0 for no timeout
106+
pluggablesearch.search.timeout=0
107+
108+
#############################
109+
# Pluggable shopping cart and export plugin configuration.
110+
# Turn on and off pluggable shopping cart globally, and configure export endpoints.
111+
# N.B. plugins also requires provisioning of the jwt.* information above
112+
#############################
113+
114+
# enable pluggable export globally and show the export GUI components
115+
pluggableshoppingcart.enabled=false
116+
117+
# configured endpoints, comma delimited in form https://host.com/v1
118+
pluggablepublishing.endpointRegistryList=
119+
# timeout for info/attribute gathering, set to 0 for no timeout
120+
pluggablepublishing.info.timeout=0
121+
122+
# timeout for actual publishing, set to 0 for no timeout
123+
pluggablepublishing.publishing.timeout=0
124+
125+
# server rule engine instance that will provide the galleryview listing
126+
gallery_view.rule_engine_plugin.instance_name=irods_rule_engine_plugin-irods_rule_language-instance
127+
128+
##########################################################
129+
# Metadata Masking Properties
130+
#
131+
# Excludes metadata when the attribute name starts with at least one prefix.
132+
# Multiple prefixes can be defined by separating them with the character sequence defined
133+
# by metalnx.metadata.mask.delimiter.
134+
#
135+
# For example, the configuration below will hide any metadata that contains an attribute
136+
# starting with "irods::", "metalnx-", or "_system_".
137+
#
138+
# metalnx.metadata.mask.prefixes=irods::;metalnx-;_system_
139+
# metalnx.metadata.mask.delimiter=;
140+
#
141+
# Use the iRODS Metadata Guard rule engine plugin to protect your metadata namespaces from
142+
# being modified.
143+
metalnx.metadata.mask.prefixes=
144+
metalnx.metadata.mask.delimiter=,
145+
146+
147+
##########################################################
148+
# Setting to enable/disable the "Public" sidebar link.
149+
# The default is "false" (hidden)
150+
##########################################################
151+
sidebar.show.public=false

irods/pom.xml

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@
2424
<packaging>jar</packaging>
2525

2626
<dependencies>
27+
<dependency>
28+
<groupId>org.irods</groupId>
29+
<artifactId>irods4j</artifactId>
30+
<version>0.2.0-java8</version>
31+
</dependency>
2732
<dependency>
2833
<groupId>ch.cyberduck</groupId>
2934
<artifactId>core</artifactId>
@@ -36,29 +41,6 @@
3641
<scope>test</scope>
3742
<version>${project.version}</version>
3843
</dependency>
39-
<dependency>
40-
<groupId>ch.iterate.jargon</groupId>
41-
<artifactId>jargon-core</artifactId>
42-
<version>4.2.0.1</version>
43-
<exclusions>
44-
<exclusion>
45-
<groupId>com.claymoresystems</groupId>
46-
<artifactId>puretls</artifactId>
47-
</exclusion>
48-
<exclusion>
49-
<groupId>org.globus.jglobus</groupId>
50-
<artifactId>cog-jglobus</artifactId>
51-
</exclusion>
52-
<exclusion>
53-
<groupId>org.perf4j</groupId>
54-
<artifactId>perf4j</artifactId>
55-
</exclusion>
56-
<exclusion>
57-
<groupId>log4j</groupId>
58-
<artifactId>log4j</artifactId>
59-
</exclusion>
60-
</exclusions>
61-
</dependency>
6244
</dependencies>
6345

6446
<build>
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package ch.cyberduck.core.irods;
2+
3+
import java.io.IOException;
4+
import java.io.RandomAccessFile;
5+
6+
import org.irods.irods4j.high_level.io.IRODSDataObjectInputStream;
7+
import org.irods.irods4j.high_level.io.IRODSDataObjectOutputStream;
8+
import org.irods.irods4j.high_level.io.IRODSDataObjectStream.SeekDirection;
9+
import org.irods.irods4j.low_level.api.IRODSException;
10+
11+
public class ChunkWorker implements Runnable{
12+
private final Object stream;
13+
private final RandomAccessFile file;
14+
private final long offset;
15+
private final long chunkSize;
16+
private final byte[] buffer;
17+
public ChunkWorker(Object stream, String localfilePath,long offset, long chunkSize, int bufferSize) throws IOException, IRODSException {
18+
this.stream= stream;
19+
this.file=new RandomAccessFile(localfilePath,"rw");
20+
this.offset=offset;
21+
this.chunkSize=chunkSize;
22+
this.buffer=new byte[bufferSize];
23+
24+
25+
file.seek(offset);
26+
}
27+
@Override
28+
public void run(){
29+
try {
30+
if (stream instanceof IRODSDataObjectInputStream) {
31+
IRODSDataObjectInputStream in = (IRODSDataObjectInputStream) (stream);
32+
in.seek((int) offset, SeekDirection.CURRENT);
33+
long remaining = chunkSize;
34+
while (remaining > 0) {
35+
int readLength = (int) Math.min(buffer.length, remaining);
36+
int read = in.read(buffer, 0, readLength);
37+
file.write(buffer, 0, read);
38+
remaining -= read;
39+
}
40+
41+
}else if (stream instanceof IRODSDataObjectOutputStream) {
42+
IRODSDataObjectOutputStream out = (IRODSDataObjectOutputStream) (stream);
43+
out.seek((int) offset, SeekDirection.CURRENT);
44+
long remaining = chunkSize;
45+
while (remaining > 0) {
46+
int writeLength = (int) Math.min(buffer.length, remaining);
47+
int read = file.read(buffer, 0, writeLength);
48+
if (read == -1) break;
49+
out.write(buffer, 0, read);
50+
remaining -= read;
51+
}
52+
}else {
53+
throw new IllegalArgumentException("Unsupported stream type");
54+
}
55+
} catch (IOException | IRODSException e) {
56+
e.printStackTrace();
57+
}
58+
try {
59+
close();
60+
} catch (IOException e) {
61+
e.printStackTrace();
62+
}
63+
}
64+
65+
public void close() throws IOException {
66+
file.close();
67+
if (stream instanceof IRODSDataObjectInputStream) {
68+
IRODSDataObjectInputStream in = (IRODSDataObjectInputStream) (stream);
69+
in.close();
70+
} else if (stream instanceof IRODSDataObjectOutputStream) {
71+
IRODSDataObjectOutputStream out = (IRODSDataObjectOutputStream) (stream);
72+
out.close();
73+
}
74+
}
75+
}

0 commit comments

Comments
 (0)