Class 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.
    • 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
    • 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 avatar
      void 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 poll
      void setServerUrl​(String serverUrl)
      The Server URL of the Slack instance
      void setToken​(String token)
      The token to use
      void 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 interface org.apache.camel.Endpoint

        getEndpointBaseUri, 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 Detail

      • SlackEndpoint

        public SlackEndpoint​(String uri,
                             String channelName,
                             SlackComponent component)
        Constructor for SlackEndpoint
        Parameters:
        uri - the full component url
        channelName - the channel or username the message is directed at
        component - the component that was created
    • Method Detail

      • createProducer

        public org.apache.camel.Producer createProducer()
                                                 throws Exception
        Throws:
        Exception
      • 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)