Class GitHub2Endpoint
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.github2.GitHub2Endpoint
- 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="4.18.0",
scheme="github2",
title="GitHub2",
syntax="github2:type/branchName",
category={FILE,CLOUD,API},
headersClass=GitHub2Constants.class)
public class GitHub2Endpoint
extends org.apache.camel.support.ScheduledPollEndpoint
implements org.apache.camel.spi.EndpointServiceLocation
Interact with the GitHub API.
This component uses the kohsuke github-api library for GitHub API interactions. Available endpoint URIs include:
CONSUMERS github2://pullRequest (new pull requests) github2://pullRequestComment (new pull request comments)
github2://commit/[branch] (new commits) github2://tag (new tags) github2://event (GitHub events)
PRODUCERS github2://pullRequestComment (create a new pull request comment) github2://closePullRequest (close a pull
request) github2://pullRequestState (set commit status) github2://pullRequestFiles (get PR files)
github2://getCommitFile (get commit file content) github2://createIssue (create an issue)
The endpoints respond with org.kohsuke.github POJOs (GHPullRequest, GHCommit, GHIssue, etc.)
-
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 -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.camel.ConsumercreateConsumer(org.apache.camel.Processor processor) org.apache.camel.Producerprotected voiddoInit()getState()getType()booleanvoidGitHub API URL for GitHub Enterprise.voidsetBranchName(String branchName) Name of branchvoidsetCommitMessageAsBody(boolean commitMessageAsBody) Whether the commit consumer should store the commit message or the raw org.kohsuke.github.GHCommit object as the message body.voidsetEncoding(String encoding) To use the given encoding when getting a git commit filevoidsetEventFetchStrategy(GitHub2EventFetchStrategy eventFetchStrategy) To specify a custom strategy that configures how the EventsConsumer fetches events.voidsetOauthToken(String oauthToken) GitHub OAuth token.voidsetRepoName(String repoName) GitHub repository namevoidsetRepoOwner(String repoOwner) GitHub repository owner (organization)voidsetStartingSha(String startingSha) The starting sha to use for polling commits with the commit consumer.voidTo set git commit status statevoidsetTargetUrl(String targetUrl) To set git commit status target urlvoidsetType(GitHub2Type type) What git operation to executeMethods inherited from class org.apache.camel.support.ScheduledPollEndpoint
configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, 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, setUseFixedDelayMethods inherited from class org.apache.camel.support.DefaultEndpoint
configureExchange, configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, 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, toStringMethods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doStart, doStop, doSuspend, fail, getInternalLock, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.camel.ComponentAware
getComponentMethods inherited from interface org.apache.camel.Endpoint
getEndpointBaseUri, isRemote, isSingletonProducerMethods inherited from interface org.apache.camel.spi.EndpointServiceLocation
getServiceMetadataMethods inherited from interface org.apache.camel.Service
build, close, init, start, stopMethods inherited from interface org.apache.camel.ShutdownableService
shutdownMethods inherited from interface org.apache.camel.StatefulService
getStatus, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspendingMethods inherited from interface org.apache.camel.SuspendableService
isSuspended, resume, suspend
-
Constructor Details
-
GitHub2Endpoint
-
-
Method Details
-
getServiceUrl
- Specified by:
getServiceUrlin interfaceorg.apache.camel.spi.EndpointServiceLocation
-
getServiceProtocol
- Specified by:
getServiceProtocolin interfaceorg.apache.camel.spi.EndpointServiceLocation
-
createProducer
- Specified by:
createProducerin interfaceorg.apache.camel.Endpoint- Throws:
Exception
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception - Specified by:
createConsumerin interfaceorg.apache.camel.Endpoint- Throws:
Exception
-
getType
-
setType
What git operation to execute -
getBranchName
-
setBranchName
Name of branch -
isCommitMessageAsBody
public boolean isCommitMessageAsBody() -
setCommitMessageAsBody
public void setCommitMessageAsBody(boolean commitMessageAsBody) Whether the commit consumer should store the commit message or the raw org.kohsuke.github.GHCommit object as the message body. -
getStartingSha
-
setStartingSha
The starting sha to use for polling commits with the commit consumer. The value can either be a sha for the sha to start from, or use beginning to start from the beginning, or last to start from the last commit. -
getOauthToken
-
setOauthToken
GitHub OAuth token. Must be configured on either component or endpoint. -
getRepoOwner
-
setRepoOwner
GitHub repository owner (organization) -
getRepoName
-
setRepoName
GitHub repository name -
getState
-
setState
To set git commit status state -
getTargetUrl
-
setTargetUrl
To set git commit status target url -
getEncoding
-
setEncoding
To use the given encoding when getting a git commit file -
getEventFetchStrategy
-
setEventFetchStrategy
To specify a custom strategy that configures how the EventsConsumer fetches events. -
getApiUrl
-
setApiUrl
GitHub API URL for GitHub Enterprise. Leave empty for github.com. -
doInit
- Overrides:
doInitin classorg.apache.camel.support.DefaultEndpoint- Throws:
Exception
-