-
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.
#1 working on nio impl and start of exception hierarchy
- Loading branch information
michael-conway
committed
Mar 29, 2017
1 parent
e315575
commit 23fc1f1
Showing
15 changed files
with
275 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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"> | ||
<parent> | ||
<groupId>org.irods</groupId> | ||
<artifactId>jargon2</artifactId> | ||
<version>4.3.0.0-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>io-plugin-nio</artifactId> | ||
<packaging>jar</packaging> | ||
<description>NIO plugin for local file access</description> | ||
<name>io-plugin-nio</name> | ||
<dependencies> | ||
<dependency> | ||
<groupId>org.irods</groupId> | ||
<artifactId>jargon2-core-if</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
</dependencies> | ||
</project> | ||
|
Empty file.
10 changes: 10 additions & 0 deletions
10
io-plugin-nio/src/main/java/org/irods/jargon2/core/pub/io/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,10 @@ | ||
/** | ||
* | ||
*/ | ||
/** | ||
* Implementation of core i/o plugin interfaces | ||
* | ||
* @author mconway | ||
* | ||
*/ | ||
package org.irods.jargon2.core.pub.io; |
57 changes: 57 additions & 0 deletions
57
...n-nio/src/main/java/org/irods/jargon2/core/pub/io/plugin/nio/NIOFileIOOperationsImpl.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,57 @@ | ||
/**() | ||
* | ||
*/ | ||
package org.irods.jargon2.core.pub.io.plugin.nio; | ||
|
||
import java.nio.channels.Channel; | ||
import java.nio.channels.FileChannel; | ||
import java.nio.file.Path; | ||
|
||
import org.irods.jargon2.core.ioplugin.FileIOOperations; | ||
import org.irods.jargon2.core.ioplugin.IOContext; | ||
import org.irods.jargon2.core.ioplugin.IOMonitor; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* NIO implementation of file operations. These plug into protocol operations to | ||
* manage access to the local file system and the streaming of the actual bytes | ||
* between the client and iRODS. This sits below the actual protocol operations | ||
* | ||
* @author mconway | ||
* | ||
*/ | ||
public class NIOFileIOOperationsImpl implements FileIOOperations { | ||
|
||
public static final Logger log = LoggerFactory.getLogger(NIOFileIOOperationsImpl.class); | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see org.irods.jargon2.core.ioplugin.FileIOOperations# | ||
* transferLocalFileToIrodsSingleBuffer(java.nio.file.Path, | ||
* java.nio.channels.Channel, org.irods.jargon2.core.ioplugin.IOMonitor, | ||
* org.irods.jargon2.core.ioplugin.IOContext) | ||
*/ | ||
@Override | ||
public void transferLocalFileToIrodsSingleBuffer(Path path, Channel channel, IOMonitor ioMonitor, | ||
IOContext ioContext) { | ||
log.info("transferLocalFileToIrodsSingleBuffer()"); | ||
if (path == null) { | ||
throw new IllegalArgumentException("null path"); | ||
} | ||
|
||
if (channel == null) { | ||
throw new IllegalArgumentException("null channel"); | ||
} | ||
|
||
log.info("path:{}", path); | ||
log.info("channel:{}", channel); | ||
log.info("ioMonitor:{}", ioMonitor); | ||
log.info("ioContext:{}", ioContext); | ||
|
||
FileChannel.open(path); | ||
|
||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
io-plugin-nio/src/main/java/org/irods/jargon2/core/pub/io/plugin/nio/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,11 @@ | ||
/** | ||
* | ||
*/ | ||
/** | ||
* Plugin for nio implementation of operations between irods and local file | ||
* system | ||
* | ||
* @author mconway | ||
* | ||
*/ | ||
package org.irods.jargon2.core.pub.io.plugin.nio; |
Empty file.
Empty file.
Empty file.
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
57 changes: 57 additions & 0 deletions
57
jargon2-core-util/src/main/java/org/irods/jargon2/exception/JargonException.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,57 @@ | ||
/** | ||
* | ||
*/ | ||
package org.irods.jargon2.exception; | ||
|
||
/** | ||
* Root of checked Jargon exception hierarchy | ||
* | ||
* @author mconway | ||
* | ||
*/ | ||
public class JargonException extends Exception { | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 4061550775957048060L; | ||
|
||
/** | ||
* | ||
*/ | ||
public JargonException() { | ||
} | ||
|
||
/** | ||
* @param arg0 | ||
*/ | ||
public JargonException(String arg0) { | ||
super(arg0); | ||
} | ||
|
||
/** | ||
* @param arg0 | ||
*/ | ||
public JargonException(Throwable arg0) { | ||
super(arg0); | ||
} | ||
|
||
/** | ||
* @param arg0 | ||
* @param arg1 | ||
*/ | ||
public JargonException(String arg0, Throwable arg1) { | ||
super(arg0, arg1); | ||
} | ||
|
||
/** | ||
* @param arg0 | ||
* @param arg1 | ||
* @param arg2 | ||
* @param arg3 | ||
*/ | ||
public JargonException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { | ||
super(arg0, arg1, arg2, arg3); | ||
} | ||
|
||
} |
70 changes: 70 additions & 0 deletions
70
jargon2-core-util/src/main/java/org/irods/jargon2/exception/JargonRuntimeException.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.exception; | ||
|
||
/** | ||
* Base of runtime exception hierarchy | ||
* | ||
* @author mconway | ||
* | ||
*/ | ||
public class JargonRuntimeException extends RuntimeException { | ||
|
||
/** | ||
* iRODS error code, if available | ||
*/ | ||
private int irodsErrorCode = 0; | ||
|
||
/** | ||
* | ||
*/ | ||
private static final long serialVersionUID = 3540887186451328323L; | ||
|
||
/** | ||
* | ||
*/ | ||
public JargonRuntimeException() { | ||
} | ||
|
||
/** | ||
* @param arg0 | ||
*/ | ||
public JargonRuntimeException(String arg0) { | ||
super(arg0); | ||
} | ||
|
||
/** | ||
* @param arg0 | ||
*/ | ||
public JargonRuntimeException(Throwable arg0) { | ||
super(arg0); | ||
} | ||
|
||
/** | ||
* @param arg0 | ||
* @param arg1 | ||
*/ | ||
public JargonRuntimeException(String arg0, Throwable arg1) { | ||
super(arg0, arg1); | ||
} | ||
|
||
/** | ||
* @param arg0 | ||
* @param arg1 | ||
* @param arg2 | ||
* @param arg3 | ||
*/ | ||
public JargonRuntimeException(String arg0, Throwable arg1, boolean arg2, boolean arg3) { | ||
super(arg0, arg1, arg2, arg3); | ||
} | ||
|
||
public int getIrodsErrorCode() { | ||
return irodsErrorCode; | ||
} | ||
|
||
public void setIrodsErrorCode(int irodsErrorCode) { | ||
this.irodsErrorCode = irodsErrorCode; | ||
} | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
jargon2-core-util/src/main/java/org/irods/jargon2/exception/io/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,10 @@ | ||
/** | ||
* | ||
*/ | ||
/** | ||
* I/O exceptions for file and network i/o conditions | ||
* | ||
* @author mconway | ||
* | ||
*/ | ||
package org.irods.jargon2.exception.io; |
8 changes: 8 additions & 0 deletions
8
jargon2-core-util/src/main/java/org/irods/jargon2/exception/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 @@ | ||
|
||
/** | ||
* Root of Jargon2 exception hierarchy | ||
* | ||
* @author mconway | ||
* | ||
*/ | ||
package org.irods.jargon2.exception; |
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