Class JiraEndpoint

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.support.DefaultEndpoint
org.apache.camel.support.ScheduledPollEndpoint
org.apache.camel.component.jira.JiraEndpoint
All Implemented Interfaces:
AutoCloseable, org.apache.camel.CamelContextAware, org.apache.camel.ComponentAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.EndpointServiceLocation, org.apache.camel.spi.HasCamelContext, org.apache.camel.spi.HasId, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

@UriEndpoint(firstVersion="3.0", scheme="jira", title="Jira", syntax="jira:type", category=DOCUMENT, headersClass=JiraConstants.class) public class JiraEndpoint extends org.apache.camel.support.ScheduledPollEndpoint implements org.apache.camel.spi.EndpointServiceLocation
Interact with JIRA issue tracker.

The endpoint encapsulates portions of the JIRA API, relying on the jira-rest-java-client SDK. Available endpoint URIs include:

CONSUMERS jira://newIssues (retrieve only new issues after the route is started) jira://newComments (retrieve only new comments after the route is started) jira://watchChanges (retrieve only defined changes in issues picked base on provided jql)

PRODUCERS jira://addIssue (add an issue) jira://addComment (add a comment on a given issue) jira://attach (add an attachment on a given issue) jira://deleteIssue (delete a given issue) jira://updateIssue (update fields of a given issue) jira://transitionIssue (transition a status of a given issue) jira://watchers (add/remove watchers of a given issue)

The endpoints will respond with jira-rest-java-client POJOs (Issue, Comment, etc.)

Note: Rather than webhooks, this endpoint relies on simple polling. Reasons include: - concerned about reliability/stability if this somehow relied on an exposed, embedded server (Jetty?) - the types of payloads we're polling aren't typically large (plus, paging is available in the API) - need to support apps running somewhere not publicly accessible where a webhook would fail

  • Field Summary

    Fields inherited from class org.apache.camel.support.service.BaseService

    BUILT, FAILED, INITIALIZED, INITIALIZING, lock, NEW, SHUTDOWN, SHUTTING_DOWN, STARTED, STARTING, status, STOPPED, STOPPING, SUSPENDED, SUSPENDING
  • Constructor Summary

    Constructors
    Constructor
    Description
    JiraEndpoint(String uri, JiraComponent component, JiraConfiguration configuration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    org.apache.camel.Consumer
    createConsumer(org.apache.camel.Processor processor)
     
    org.apache.camel.Producer
     
    void
     
    void
     
    protected void
     
    com.atlassian.jira.rest.client.api.JiraRestClient
     
     
    long
     
    JQL is the query language from JIRA which allows you to retrieve the data you want.
     
     
     
     
     
    Comma separated list of fields to watch for changes.
    boolean
    Indicator for sending only changed fields in exchange body or issue object.
    void
    setClient(com.atlassian.jira.rest.client.api.JiraRestClient client)
     
    void
     
    void
    setMaxResults(Integer maxResults)
    Max number of issues to search for
    void
    setSendOnlyUpdatedField(boolean sendOnlyUpdatedField)
     
    void
    Operation to perform.
    void
    setWatchedFields(String watchChange)
     

    Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint

    configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelay

    Methods inherited from class org.apache.camel.support.DefaultEndpoint

    configureExchange, configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toString

    Methods inherited from class org.apache.camel.support.service.BaseService

    build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.camel.ComponentAware

    getComponent

    Methods inherited from interface org.apache.camel.Endpoint

    getEndpointBaseUri, isRemote, isSingletonProducer

    Methods inherited from interface org.apache.camel.Service

    build, close, init, start, stop

    Methods inherited from interface org.apache.camel.ShutdownableService

    shutdown

    Methods inherited from interface org.apache.camel.StatefulService

    getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspending

    Methods inherited from interface org.apache.camel.SuspendableService

    isSuspended, resume, suspend
  • Constructor Details

  • Method Details

    • getServiceUrl

      public String getServiceUrl()
      Specified by:
      getServiceUrl in interface org.apache.camel.spi.EndpointServiceLocation
    • getServiceProtocol

      public String getServiceProtocol()
      Specified by:
      getServiceProtocol in interface org.apache.camel.spi.EndpointServiceLocation
    • getServiceMetadata

      public Map<String,String> getServiceMetadata()
      Specified by:
      getServiceMetadata in interface org.apache.camel.spi.EndpointServiceLocation
    • getConfiguration

      public JiraConfiguration getConfiguration()
    • doStart

      public void doStart() throws Exception
      Overrides:
      doStart in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • doStop

      protected void doStop() throws Exception
      Overrides:
      doStop in class org.apache.camel.support.service.BaseService
      Throws:
      Exception
    • connect

      public void connect()
    • disconnect

      public void disconnect() throws Exception
      Throws:
      Exception
    • createProducer

      public org.apache.camel.Producer createProducer()
      Specified by:
      createProducer in interface org.apache.camel.Endpoint
    • createConsumer

      public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
      Specified by:
      createConsumer in interface org.apache.camel.Endpoint
      Throws:
      Exception
    • getType

      public JiraType getType()
    • setType

      public void setType(JiraType type)
      Operation to perform. Consumers: NewIssues, NewComments. Producers: AddIssue, AttachFile, DeleteIssue, TransitionIssue, UpdateIssue, Watchers. See this class javadoc description for more information.
    • getJql

      public String getJql()
      JQL is the query language from JIRA which allows you to retrieve the data you want. For example jql=project=MyProject Where MyProject is the product key in Jira. It is important to use the RAW() and set the JQL inside it to prevent camel parsing it, example: RAW(project in (MYP, COM) AND resolution = Unresolved)
    • setJql

      public void setJql(String jql)
    • getDelay

      public long getDelay()
      Overrides:
      getDelay in class org.apache.camel.support.ScheduledPollEndpoint
    • getClient

      public com.atlassian.jira.rest.client.api.JiraRestClient getClient()
    • setClient

      public void setClient(com.atlassian.jira.rest.client.api.JiraRestClient client)
    • getMaxResults

      public Integer getMaxResults()
    • setMaxResults

      public void setMaxResults(Integer maxResults)
      Max number of issues to search for
    • getWatchedFields

      public String getWatchedFields()
      Comma separated list of fields to watch for changes. "Status,Priority" are the defaults.
    • setWatchedFields

      public void setWatchedFields(String watchChange)
    • isSendOnlyUpdatedField

      public boolean isSendOnlyUpdatedField()
      Indicator for sending only changed fields in exchange body or issue object. By default consumer sends only changed fields.
    • setSendOnlyUpdatedField

      public void setSendOnlyUpdatedField(boolean sendOnlyUpdatedField)