diff --git a/src/main/java/org/iplantc/de/publish/mechanism/api/PublishContext.java b/src/main/java/org/iplantc/de/publish/mechanism/api/PublishContext.java new file mode 100644 index 0000000..39610ef --- /dev/null +++ b/src/main/java/org/iplantc/de/publish/mechanism/api/PublishContext.java @@ -0,0 +1,21 @@ +/** + * + */ +package org.iplantc.de.publish.mechanism.api; + +/** + * Provides callbacks and context from DE publish service to the underlying + * foreground mechanism. This allows the preValidate and synchronous parts of + * the publish methods the ability to manipulate iRODS or call DE based services + * that are selectively exposed. + * + * @author Mike Conway - DICE + * + */ +public interface PublishContext { + + /* + * TODO: enumerate appropriate context and callback hooks + */ + +} diff --git a/src/main/java/org/iplantc/de/publish/mechanism/api/PublishMechanism.java b/src/main/java/org/iplantc/de/publish/mechanism/api/PublishMechanism.java index e7df15a..2b7a3a7 100644 --- a/src/main/java/org/iplantc/de/publish/mechanism/api/PublishMechanism.java +++ b/src/main/java/org/iplantc/de/publish/mechanism/api/PublishMechanism.java @@ -34,11 +34,15 @@ public interface PublishMechanism { * @param publishActionDescriptor * {@link PublishActionDescriptor} that provides the necessary * context for the mechanism to find and do the publishing. + * @param publishContext + * {@link PublishContext} with callbacks and hooks to call DE and + * iRODS services * @return {@link PublishResult} That represents the status and any error or * validation information */ public PublishResult preValidate( - final PublishActionDescriptor publishActionDescriptor); + final PublishActionDescriptor publishActionDescriptor, + final PublishContext publishContext); /** * This method will be called after success in the preValidate @@ -52,12 +56,16 @@ public PublishResult preValidate( * @param publishActionDescriptor * {@link PublishDescriptor} with the necessary context for an * individual publicastion action + * @param publishContext + * {@link PublishContext} with callbacks and hooks to call DE and + * iRODS services * @return {@link PublishResult} with the result of this publish action. For * synchronous actions, this may be the failure or completion * success, for an asynchyronous action, it would represent the * success or failure in enquing the the publish action. */ public PublishResult publish( - final PublishActionDescriptor publishActionDescriptor); + final PublishActionDescriptor publishActionDescriptor, + final PublishContext publishContext); }