-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4c93f1b
commit d3b11ec
Showing
21 changed files
with
470 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
io-plugin-nio/src/test/java/org/irods/jargon2/core/pub/io/plugin/nio/AllTests.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.irods.jargon2.core.pub.io.plugin.nio; | ||
|
||
import org.junit.runner.RunWith; | ||
import org.junit.runners.Suite; | ||
import org.junit.runners.Suite.SuiteClasses; | ||
|
||
@RunWith(Suite.class) | ||
@SuiteClasses({ NIOFileIOOperationsImplTest.class }) | ||
public class AllTests { | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
...o/src/test/java/org/irods/jargon2/core/pub/io/plugin/nio/NIOFileIOOperationsImplTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.irods.jargon2.core.pub.io.plugin.nio; | ||
|
||
import static org.junit.Assert.fail; | ||
|
||
import org.junit.Test; | ||
|
||
public class NIOFileIOOperationsImplTest { | ||
|
||
@Test | ||
public void testTransferLocalFileToIrodsSingleBuffer() { | ||
fail("Not yet implemented"); | ||
} | ||
|
||
@Test(expected = IllegalArgumentException.class) | ||
public void testNIOFileIOOperationsImpl() { | ||
// IOContext ioContext = new IOContext(); | ||
new NIOFileIOOperationsImpl(null); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
...ore-common/src/main/java/org/irods/jargon2/common/confg/props/JargonPropertiesLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* | ||
*/ | ||
package org.irods.jargon2.common.confg.props; | ||
|
||
/** | ||
* Describes a source to produce a configured <code>JargonProperties</code>. | ||
* This can load from a properties file, database, etc | ||
* | ||
* @author mcc | ||
* | ||
*/ | ||
public interface JargonPropertiesLoader { | ||
|
||
JargonProperties loadJargonProperties(); | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
.../main/java/org/irods/jargon2/common/confg/props/PropertiesFileJargonPropertiesLoader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* | ||
*/ | ||
package org.irods.jargon2.common.confg.props; | ||
|
||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.util.Properties; | ||
|
||
import org.irods.jargon2.common.confg.enumz.EnumIoStyle; | ||
import org.irods.jargon2.exception.configuration.JargonConfigurationRuntimeException; | ||
import org.irods.jargon2.utils.exception.bundle.ExceptionResourceKeys; | ||
import org.irods.jargon2.utils.exception.bundle.MessageUtil; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Load <code>JargonProperties</code> via a provided java | ||
* <code>Properties</code> file | ||
* | ||
* @author mcc | ||
* | ||
*/ | ||
public class PropertiesFileJargonPropertiesLoader implements JargonPropertiesLoader { | ||
|
||
private final String resourcePath; | ||
public static final Logger log = LoggerFactory.getLogger(PropertiesFileJargonPropertiesLoader.class); | ||
|
||
/** | ||
* | ||
*/ | ||
public PropertiesFileJargonPropertiesLoader(final String resourcePath) { | ||
if (resourcePath == null || resourcePath.isEmpty()) { | ||
throw new IllegalArgumentException( | ||
MessageUtil.formatMessage(ExceptionResourceKeys.NULL_OR_EMPTY_PARAMETER, "resourcePath")); | ||
} | ||
this.resourcePath = resourcePath; | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see org.irods.jargon2.common.confg.props.JargonPropertiesLoader# | ||
* loadJargonProperties() | ||
*/ | ||
@Override | ||
public JargonProperties loadJargonProperties() { | ||
log.info("loadJargonProperties() using:{}", resourcePath); | ||
final Properties properties = new Properties(); | ||
try (final InputStream stream = this.getClass().getResourceAsStream(resourcePath)) { | ||
properties.load(stream); | ||
} catch (IOException e) { | ||
log.error("exception loading properties from:{}", resourcePath, e); | ||
throw new JargonConfigurationRuntimeException( | ||
MessageUtil.formatMessage(ExceptionResourceKeys.CONFIG_EXCEPT_LOAD_CONFIG), e); | ||
} | ||
|
||
JargonProperties jargonProperties = new CachedJargonProperties(); | ||
jargonProperties.setConnectionTimeoutInSeconds( | ||
Integer.parseInt(properties.getProperty(CachedJargonProperties.CONNECTION_TIMEOUT_IN_SECONDS))); | ||
jargonProperties.setEnumIoStyle(EnumIoStyle.valueOf(properties.getProperty(CachedJargonProperties.IO_STYLE))); | ||
jargonProperties.setInstrument(Boolean.valueOf(properties.getProperty(CachedJargonProperties.INSTRUMENTED))); | ||
jargonProperties.setUseFastChannelCopy( | ||
Boolean.valueOf(properties.getProperty(CachedJargonProperties.IO_FAST_CHANNEL_COPY))); | ||
jargonProperties.setUseNioDirect(Boolean.valueOf(properties.getProperty(CachedJargonProperties.IO_NIO_DIRECT))); | ||
return jargonProperties; | ||
|
||
} | ||
|
||
} |
8 changes: 8 additions & 0 deletions
8
jargon2-core-common/src/main/java/org/irods/jargon2/context/monitors/package-info.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
/** | ||
* Various utilities to monitor performance and activity | ||
* | ||
* @author mcc | ||
* | ||
*/ | ||
package org.irods.jargon2.context.monitors; |
Oops, something went wrong.