-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Santhosh Gandhe <[email protected]>
- Loading branch information
Showing
2 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
.../jira-source/src/main/java/org/opensearch/dataprepper/plugins/source/jira/JiraClient.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,45 @@ | ||
package org.opensearch.dataprepper.plugins.source.jira; | ||
|
||
import org.opensearch.dataprepper.model.buffer.Buffer; | ||
import org.opensearch.dataprepper.model.event.Event; | ||
import org.opensearch.dataprepper.model.record.Record; | ||
import org.opensearch.dataprepper.plugins.source.source_crawler.base.CrawlerClient; | ||
import org.opensearch.dataprepper.plugins.source.source_crawler.base.CrawlerSourceConfig; | ||
import org.opensearch.dataprepper.plugins.source.source_crawler.coordination.state.SaasWorkerProgressState; | ||
import org.opensearch.dataprepper.plugins.source.source_crawler.model.ItemInfo; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
import javax.inject.Named; | ||
import java.time.Instant; | ||
import java.util.Iterator; | ||
|
||
/** | ||
* This class represents a Jira client. | ||
*/ | ||
@Named | ||
public class JiraClient implements CrawlerClient { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(JiraClient.class); | ||
private Instant lastPollTime; | ||
|
||
public JiraClient() { | ||
} | ||
|
||
|
||
@Override | ||
public Iterator<ItemInfo> listItems() { | ||
return null; | ||
} | ||
|
||
@Override | ||
public void setLastPollTime(Instant lastPollTime) { | ||
log.info("Setting the lastPollTime: {}", lastPollTime); | ||
this.lastPollTime = lastPollTime; | ||
} | ||
|
||
@Override | ||
public void executePartition(SaasWorkerProgressState state, Buffer<Record<Event>> buffer, CrawlerSourceConfig configuration) { | ||
log.info("Logic for executing the partitions"); | ||
} | ||
} |
57 changes: 57 additions & 0 deletions
57
.../jira-source/src/main/java/org/opensearch/dataprepper/plugins/source/jira/JiraSource.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.opensearch.dataprepper.plugins.source.jira; | ||
|
||
|
||
import org.opensearch.dataprepper.metrics.PluginMetrics; | ||
import org.opensearch.dataprepper.model.acknowledgements.AcknowledgementSetManager; | ||
import org.opensearch.dataprepper.model.annotations.DataPrepperPlugin; | ||
import org.opensearch.dataprepper.model.annotations.DataPrepperPluginConstructor; | ||
import org.opensearch.dataprepper.model.buffer.Buffer; | ||
import org.opensearch.dataprepper.model.codec.ByteDecoder; | ||
import org.opensearch.dataprepper.model.event.Event; | ||
import org.opensearch.dataprepper.model.plugin.PluginFactory; | ||
import org.opensearch.dataprepper.model.record.Record; | ||
import org.opensearch.dataprepper.model.source.Source; | ||
import org.opensearch.dataprepper.plugins.source.source_crawler.CrawlerApplicationContextMarker; | ||
import org.opensearch.dataprepper.plugins.source.source_crawler.base.Crawler; | ||
import org.opensearch.dataprepper.plugins.source.source_crawler.base.PluginExecutorServiceProvider; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
|
||
/** | ||
* JiraConnector connector entry point. | ||
*/ | ||
|
||
@DataPrepperPlugin(name = "jira", | ||
pluginType = Source.class, | ||
packagesToScan = {CrawlerApplicationContextMarker.class, JiraSource.class} | ||
) | ||
public class JiraSource implements Source<Record<Event>> { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(JiraSource.class); | ||
|
||
|
||
@DataPrepperPluginConstructor | ||
public JiraSource(final PluginMetrics pluginMetrics, | ||
final PluginFactory pluginFactory, | ||
final AcknowledgementSetManager acknowledgementSetManager, | ||
Crawler crawler, | ||
PluginExecutorServiceProvider executorServiceProvider) { | ||
log.info("Create Jira Source Connector"); | ||
} | ||
|
||
public void start(Buffer<Record<Event>> buffer) { | ||
log.info("Starting Jira Source Plugin... "); | ||
} | ||
|
||
@Override | ||
public void stop() { | ||
|
||
} | ||
|
||
@Override | ||
public ByteDecoder getDecoder() { | ||
return Source.super.getDecoder(); | ||
} | ||
|
||
} |