This repository has been archived by the owner on Jul 3, 2018. It is now read-only.
-
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
michael-conway
committed
May 27, 2016
1 parent
c7de816
commit 471a056
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
82 changes: 82 additions & 0 deletions
82
dummy-publish/src/main/java/og/iplantc/de/publish/dummy/DummyPublishMechanism.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,82 @@ | ||
/** | ||
* | ||
*/ | ||
package og.iplantc.de.publish.dummy; | ||
|
||
import org.iplantc.de.publish.mechanism.api.PublishActionDescriptor; | ||
import org.iplantc.de.publish.mechanism.api.PublishContext; | ||
import org.iplantc.de.publish.mechanism.api.PublishMechanism; | ||
import org.iplantc.de.publish.mechanism.api.PublishPhaseEnum; | ||
import org.iplantc.de.publish.mechanism.api.PublishResult; | ||
import org.iplantc.de.publish.mechanism.api.PublishStatusEnum; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Simple noop publish mechanism for testing and demonstration | ||
* | ||
* @author Mike Conway - DICE | ||
* | ||
*/ | ||
public class DummyPublishMechanism implements PublishMechanism { | ||
|
||
public static final Logger log = LoggerFactory | ||
.getLogger(DummyPublishMechanism.class); | ||
|
||
/** | ||
* | ||
*/ | ||
public DummyPublishMechanism() { | ||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see | ||
* org.iplantc.de.publish.mechanism.api.PublishMechanism#preValidate(org | ||
* .iplantc.de.publish.mechanism.api.PublishActionDescriptor, | ||
* org.iplantc.de.publish.mechanism.api.PublishContext) | ||
*/ | ||
@Override | ||
public PublishResult preValidate( | ||
PublishActionDescriptor publishActionDescriptor, | ||
PublishContext publishContext) { | ||
|
||
log.info("preValidate()"); | ||
log.info("publishActionDescriptor:{}", publishActionDescriptor); | ||
log.info("publishContext:{}", publishContext); | ||
PublishResult publishResult = new PublishResult(); | ||
publishResult.setPublishStatus(PublishStatusEnum.SUBMITTED); | ||
publishResult.setResponseCode(PublishResult.PUBLISH_RESULT_NORMAL); | ||
publishResult.setResponseMessage("preValidate successful"); | ||
publishResult.setPublishPhase(PublishPhaseEnum.PRE_VALIDATE); | ||
return publishResult; | ||
|
||
} | ||
|
||
/* | ||
* (non-Javadoc) | ||
* | ||
* @see | ||
* org.iplantc.de.publish.mechanism.api.PublishMechanism#publish(org.iplantc | ||
* .de.publish.mechanism.api.PublishActionDescriptor, | ||
* org.iplantc.de.publish.mechanism.api.PublishContext) | ||
*/ | ||
@Override | ||
public PublishResult publish( | ||
PublishActionDescriptor publishActionDescriptor, | ||
PublishContext publishContext) { | ||
|
||
log.info("publish()"); | ||
log.info("publishActionDescriptor:{}", publishActionDescriptor); | ||
log.info("publishContext:{}", publishContext); | ||
PublishResult publishResult = new PublishResult(); | ||
publishResult.setPublishStatus(PublishStatusEnum.SUBMITTED); | ||
publishResult.setResponseCode(PublishResult.PUBLISH_RESULT_NORMAL); | ||
publishResult.setResponseMessage("publish successful"); | ||
publishResult.setPublishPhase(PublishPhaseEnum.PUBLISH); | ||
return publishResult; | ||
|
||
} | ||
|
||
} |
9 changes: 9 additions & 0 deletions
9
dummy-publish/src/main/java/og/iplantc/de/publish/dummy/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,9 @@ | ||
/** | ||
* | ||
*/ | ||
/** | ||
* Base dummy publisher for testing and demonstration | ||
* @author Mike Conway - DICE | ||
* | ||
*/ | ||
package og.iplantc.de.publish.dummy; |
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