Package org.apache.camel.component.slack
Class SlackEndpoint
- 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.slack.SlackEndpoint
-
- All Implemented Interfaces:
AutoCloseable
,org.apache.camel.CamelContextAware
,org.apache.camel.Endpoint
,org.apache.camel.IsSingleton
,org.apache.camel.Service
,org.apache.camel.ShutdownableService
,org.apache.camel.spi.HasId
,org.apache.camel.StatefulService
,org.apache.camel.SuspendableService
@UriEndpoint(firstVersion="2.16.0", scheme="slack", title="Slack", syntax="slack:channel", category=SOCIAL) public class SlackEndpoint extends org.apache.camel.support.ScheduledPollEndpoint
Send and receive messages to/from Slack.
-
-
Constructor Summary
Constructors Constructor Description SlackEndpoint(String uri, String channelName, SlackComponent component)
Constructor for SlackEndpoint
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.camel.Consumer
createConsumer(org.apache.camel.Processor processor)
org.apache.camel.Exchange
createExchange(org.apache.camel.ExchangePattern pattern, org.apache.camel.util.json.JsonObject object)
org.apache.camel.Exchange
createExchange(org.apache.camel.util.json.JsonObject object)
org.apache.camel.Producer
createProducer()
String
getChannel()
String
getIconEmoji()
String
getIconUrl()
String
getMaxResults()
String
getServerUrl()
String
getToken()
String
getUsername()
String
getWebhookUrl()
void
setChannel(String channel)
The channel name (syntax #name) or slackuser (syntax @userName) to send a message directly to an user.void
setIconEmoji(String iconEmoji)
Use a Slack emoji as an avatarvoid
setIconUrl(String iconUrl)
The avatar that the component will use when sending message to a channel or user.void
setMaxResults(String maxResult)
The Max Result for the pollvoid
setServerUrl(String serverUrl)
The Server URL of the Slack instancevoid
setToken(String token)
The token to usevoid
setUsername(String username)
This is the username that the bot will have when sending messages to a channel or user.void
setWebhookUrl(String webhookUrl)
The incoming webhook URL-
Methods inherited from class org.apache.camel.support.ScheduledPollEndpoint
configureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, doStart, doStop, 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, setUseFixedDelay
-
Methods inherited from class org.apache.camel.support.DefaultEndpoint
configurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, createPollingConsumer, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
-
Methods inherited from class org.apache.camel.support.service.BaseService
build, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, 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
-
-
-
-
Constructor Detail
-
SlackEndpoint
public SlackEndpoint(String uri, String channelName, SlackComponent component)
Constructor for SlackEndpoint- Parameters:
uri
- the full component urlchannelName
- the channel or username the message is directed atcomponent
- the component that was created
-
-
Method Detail
-
createConsumer
public org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor) throws Exception
- Throws:
Exception
-
setWebhookUrl
public void setWebhookUrl(String webhookUrl)
The incoming webhook URL
-
getWebhookUrl
public String getWebhookUrl()
-
getChannel
public String getChannel()
-
setChannel
public void setChannel(String channel)
The channel name (syntax #name) or slackuser (syntax @userName) to send a message directly to an user.
-
getUsername
public String getUsername()
-
setUsername
public void setUsername(String username)
This is the username that the bot will have when sending messages to a channel or user.
-
getIconUrl
public String getIconUrl()
-
setIconUrl
public void setIconUrl(String iconUrl)
The avatar that the component will use when sending message to a channel or user.
-
getIconEmoji
public String getIconEmoji()
-
setIconEmoji
public void setIconEmoji(String iconEmoji)
Use a Slack emoji as an avatar
-
getToken
public String getToken()
-
setToken
public void setToken(String token)
The token to use
-
getMaxResults
public String getMaxResults()
-
setMaxResults
public void setMaxResults(String maxResult)
The Max Result for the poll
-
getServerUrl
public String getServerUrl()
-
setServerUrl
public void setServerUrl(String serverUrl)
The Server URL of the Slack instance
-
createExchange
public org.apache.camel.Exchange createExchange(org.apache.camel.util.json.JsonObject object)
-
createExchange
public org.apache.camel.Exchange createExchange(org.apache.camel.ExchangePattern pattern, org.apache.camel.util.json.JsonObject object)
-
-