Skip to content
This repository has been archived by the owner on Jul 3, 2018. It is now read-only.

Commit

Permalink
#2 add publish mech annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-conway committed May 31, 2016
1 parent e57c3e0 commit 10e3bba
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
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.iplantc.de.publish.mechanism.api.annotations.PublicationDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand All @@ -18,6 +19,7 @@
* @author Mike Conway - DICE
*
*/
@PublicationDriver(author = "DFC", description = "Noop publisher that just logs", name = "Dummy Logging", version = "1.0.0", isAsynch = false)
public class DummyPublishMechanism implements PublishMechanism {

public static final Logger log = LoggerFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,18 @@
*/
package org.iplantc.de.publish.mechanism.api;

import org.iplantc.de.publish.mechanism.api.annotations.PublicationDriver;

/**
* Describes a publish mechanism, this is a plugin that can format and publish
* collection data sorted as an AIP in the DE/iRODS environment as a DIP in an
* arbitrary target repository. The mechanism is a simple api that is developed
* underneath this interface, and can surface a preValidate foreground method
* that can do sanity checks and pre-processing, and a sych|asynch publish
* action that actually creates the DIP in the target repository.
* <p/>
* Note that subclasses should be annotated with the {@link PublicationDriver}
* annotation to describe the driver to the publishing subsystem.
*
* @author Mike Conway - DICE, Dennis Roberts, CyVerse
*
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
*
*/
package org.iplantc.de.publish.mechanism.api.annotations;

import java.lang.annotation.Documented;

/**
* Annotation that marks up a publish mechanism for discovery
*
* @author Mike Conway - DICE
*
*/
@Documented
public @interface PublicationDriver {
/**
* Author of the publisher plugin
*
* @return <code>String</code> with author
*/
String author();

/**
* Context-dependent version string
*
* @return <code>String</code> with version string
*/
String version();

/**
* Display name of the publisher driver
*
* @return <code>String</code> with the name of the driver
*/
String name();

/**
* Description of the driver (for mouseovers or other user doc)
*
* @return <code>String</code> with the description of the driver
*/
String description();

/**
* Indicates if the publish action is asynchronous (through the app)
*
* @return
*/
boolean isAsynch() default false;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Annotations for publisher
* @author Mike Conway - DICE
*
*/
package org.iplantc.de.publish.mechanism.api.annotations;

0 comments on commit 10e3bba

Please sign in to comment.