diff --git a/publisher-api/pom.xml b/publisher-api/pom.xml index 446d844..9ad8d67 100644 --- a/publisher-api/pom.xml +++ b/publisher-api/pom.xml @@ -11,7 +11,7 @@ publisher-api 1.0.0-SNAPSHOT jar - publisher framework for DE - API + publisher api org.irods.jargon diff --git a/publisher-api/src/main/java/org/iplantc/de/publish/mechanism/api/exception/PublicationException.java b/publisher-api/src/main/java/org/iplantc/de/publish/mechanism/api/exception/PublicationException.java new file mode 100644 index 0000000..cae5591 --- /dev/null +++ b/publisher-api/src/main/java/org/iplantc/de/publish/mechanism/api/exception/PublicationException.java @@ -0,0 +1,70 @@ +/** + * + */ +package org.iplantc.de.publish.mechanism.api.exception; + +import org.irods.jargon.core.exception.JargonException; + +/** + * General exception in publication + * + * @author Mike Conway - DICE + * + */ +public class PublicationException extends JargonException { + + /** + * + */ + private static final long serialVersionUID = -1724154819199402955L; + + /** + * @param message + */ + public PublicationException(String message) { + super(message); + } + + /** + * @param cause + */ + public PublicationException(Throwable cause) { + super(cause); + } + + /** + * @param message + * @param cause + */ + public PublicationException(String message, Throwable cause) { + super(message, cause); + } + + /** + * @param cause + * @param underlyingIRODSExceptionCode + */ + public PublicationException(Throwable cause, + int underlyingIRODSExceptionCode) { + super(cause, underlyingIRODSExceptionCode); + } + + /** + * @param message + * @param underlyingIRODSExceptionCode + */ + public PublicationException(String message, int underlyingIRODSExceptionCode) { + super(message, underlyingIRODSExceptionCode); + } + + /** + * @param message + * @param cause + * @param underlyingIRODSExceptionCode + */ + public PublicationException(String message, Throwable cause, + int underlyingIRODSExceptionCode) { + super(message, cause, underlyingIRODSExceptionCode); + } + +} diff --git a/publisher-api/src/main/java/org/iplantc/de/publish/mechanism/api/exception/package-info.java b/publisher-api/src/main/java/org/iplantc/de/publish/mechanism/api/exception/package-info.java new file mode 100644 index 0000000..2d0e88c --- /dev/null +++ b/publisher-api/src/main/java/org/iplantc/de/publish/mechanism/api/exception/package-info.java @@ -0,0 +1,6 @@ +/** + * Exceptions arising from publication + * @author Mike Conway - DICE + * + */ +package org.iplantc.de.publish.mechanism.api.exception; \ No newline at end of file diff --git a/publisher-sandbox/pom.xml b/publisher-sandbox/pom.xml index c284bf7..dab9e71 100644 --- a/publisher-sandbox/pom.xml +++ b/publisher-sandbox/pom.xml @@ -11,12 +11,17 @@ publisher-sandbox 1.0.0-SNAPSHOT jar - publisher framework for DE - API + publisher sandbox org.iplantc.de publisher-api -${project.version} + ${project.version} + + + org.reflections + reflections + 0.9.10 diff --git a/publisher-sandbox/src/main/java/org/iplantc/de/publish/sandbox/PublisherEmulator.java b/publisher-sandbox/src/main/java/org/iplantc/de/publish/sandbox/PublisherEmulator.java new file mode 100644 index 0000000..ef99387 --- /dev/null +++ b/publisher-sandbox/src/main/java/org/iplantc/de/publish/sandbox/PublisherEmulator.java @@ -0,0 +1,61 @@ +/** + * + */ +package org.iplantc.de.publish.sandbox; + +import org.iplantc.de.publish.mechanism.api.exception.PublicationException; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Black box host of publishing mechanisms for testing and validation purposes + * + * @author Mike Conway - DICE + * + */ +public class PublisherEmulator { + + private SandboxConfiguration sandboxConfiguration; + + public static final Logger log = LoggerFactory + .getLogger(PublisherEmulator.class); + + /** + * Default (no values) constructor, note that sandboxConfiguration must be + * provided, and init() must be called + */ + public PublisherEmulator() { + + } + + /** + * @return the sandboxConfiguration + */ + public SandboxConfiguration getSandboxConfiguration() { + return sandboxConfiguration; + } + + /** + * @param sandboxConfiguration + * the sandboxConfiguration to set + */ + public void setSandboxConfiguration( + SandboxConfiguration sandboxConfiguration) { + this.sandboxConfiguration = sandboxConfiguration; + } + + /** + * Initialize publisher based on (required) sandbox configuration + * + * @throws PublicationException + */ + public void init() throws PublicationException { + log.info("init()"); + if (sandboxConfiguration == null) { + throw new PublicationException( + "init() cannot be called, no provided sandboxConfiguration"); + } + + } + +} diff --git a/publisher-sandbox/src/main/java/org/iplantc/de/publish/sandbox/SandboxConfiguration.java b/publisher-sandbox/src/main/java/org/iplantc/de/publish/sandbox/SandboxConfiguration.java new file mode 100644 index 0000000..7a79841 --- /dev/null +++ b/publisher-sandbox/src/main/java/org/iplantc/de/publish/sandbox/SandboxConfiguration.java @@ -0,0 +1,14 @@ +/** + * + */ +package org.iplantc.de.publish.sandbox; + +/** + * Configuration information for sandbox + * + * @author Mike Conway - DICE + * + */ +public class SandboxConfiguration { + +}