Class LevelDBAggregationRepository

java.lang.Object
org.apache.camel.support.service.BaseService
org.apache.camel.support.service.ServiceSupport
org.apache.camel.component.leveldb.LevelDBAggregationRepository
All Implemented Interfaces:
AutoCloseable, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.AggregationRepository, org.apache.camel.spi.RecoverableAggregationRepository, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

@Metadata(label="bean", description="Aggregation repository that uses LevelDB to store exchanges.", annotations="interfaceName=org.apache.camel.spi.AggregationRepository") @Configurer(metadataOnly=true) public class LevelDBAggregationRepository extends org.apache.camel.support.service.ServiceSupport implements org.apache.camel.spi.RecoverableAggregationRepository
An instance of AggregationRepository which is backed by a LevelDBFile.
  • Constructor Details

    • LevelDBAggregationRepository

      public LevelDBAggregationRepository()
      Creates an aggregation repository
    • LevelDBAggregationRepository

      public LevelDBAggregationRepository(String repositoryName)
      Creates an aggregation repository
      Parameters:
      repositoryName - the repository name
    • LevelDBAggregationRepository

      public LevelDBAggregationRepository(String repositoryName, String persistentFileName)
      Creates an aggregation repository using a new LevelDBFile that persists using the provided file.
      Parameters:
      repositoryName - the repository name
      persistentFileName - the persistent store filename
    • LevelDBAggregationRepository

      public LevelDBAggregationRepository(String repositoryName, LevelDBFile levelDBFile)
      Creates an aggregation repository using the provided LevelDBFile.
      Parameters:
      repositoryName - the repository name
      levelDBFile - the leveldb file to use as persistent store
  • Method Details

    • add

      public org.apache.camel.Exchange add(org.apache.camel.CamelContext camelContext, String key, org.apache.camel.Exchange exchange)
      Specified by:
      add in interface org.apache.camel.spi.AggregationRepository
    • get

      public org.apache.camel.Exchange get(org.apache.camel.CamelContext camelContext, String key)
      Specified by:
      get in interface org.apache.camel.spi.AggregationRepository
    • remove

      public void remove(org.apache.camel.CamelContext camelContext, String key, org.apache.camel.Exchange exchange)
      Specified by:
      remove in interface org.apache.camel.spi.AggregationRepository
    • confirm

      public void confirm(org.apache.camel.CamelContext camelContext, String exchangeId)
      Specified by:
      confirm in interface org.apache.camel.spi.AggregationRepository
    • getKeys

      public Set<String> getKeys()
      Specified by:
      getKeys in interface org.apache.camel.spi.AggregationRepository
    • scan

      public Set<String> scan(org.apache.camel.CamelContext camelContext)
      Specified by:
      scan in interface org.apache.camel.spi.RecoverableAggregationRepository
    • recover

      public org.apache.camel.Exchange recover(org.apache.camel.CamelContext camelContext, String exchangeId)
      Specified by:
      recover in interface org.apache.camel.spi.RecoverableAggregationRepository
    • getLevelDBFile

      public LevelDBFile getLevelDBFile()
    • setLevelDBFile

      public void setLevelDBFile(LevelDBFile levelDBFile)
    • getRepositoryName

      public String getRepositoryName()
    • setRepositoryName

      public void setRepositoryName(String repositoryName)
    • isSync

      public boolean isSync()
    • setSync

      public void setSync(boolean sync)
    • isReturnOldExchange

      public boolean isReturnOldExchange()
    • setReturnOldExchange

      public void setReturnOldExchange(boolean returnOldExchange)
    • setRecoveryInterval

      public void setRecoveryInterval(long interval, TimeUnit timeUnit)
      Specified by:
      setRecoveryInterval in interface org.apache.camel.spi.RecoverableAggregationRepository
    • getRecoveryInterval

      public long getRecoveryInterval()
      Specified by:
      getRecoveryInterval in interface org.apache.camel.spi.RecoverableAggregationRepository
    • setRecoveryInterval

      public void setRecoveryInterval(long interval)
      Specified by:
      setRecoveryInterval in interface org.apache.camel.spi.RecoverableAggregationRepository
    • isUseRecovery

      public boolean isUseRecovery()
      Specified by:
      isUseRecovery in interface org.apache.camel.spi.RecoverableAggregationRepository
    • setUseRecovery

      public void setUseRecovery(boolean useRecovery)
      Specified by:
      setUseRecovery in interface org.apache.camel.spi.RecoverableAggregationRepository
    • getMaximumRedeliveries

      public int getMaximumRedeliveries()
      Specified by:
      getMaximumRedeliveries in interface org.apache.camel.spi.RecoverableAggregationRepository
    • setMaximumRedeliveries

      public void setMaximumRedeliveries(int maximumRedeliveries)
      Specified by:
      setMaximumRedeliveries in interface org.apache.camel.spi.RecoverableAggregationRepository
    • getDeadLetterUri

      public String getDeadLetterUri()
      Specified by:
      getDeadLetterUri in interface org.apache.camel.spi.RecoverableAggregationRepository
    • setDeadLetterUri

      public void setDeadLetterUri(String deadLetterUri)
      Specified by:
      setDeadLetterUri in interface org.apache.camel.spi.RecoverableAggregationRepository
    • getPersistentFileName

      public String getPersistentFileName()
    • setPersistentFileName

      public void setPersistentFileName(String persistentFileName)
    • isAllowSerializedHeaders

      public boolean isAllowSerializedHeaders()
    • setAllowSerializedHeaders

      public void setAllowSerializedHeaders(boolean allowSerializedHeaders)
    • doStart

      protected 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
    • keyBuilder

      public static byte[] keyBuilder(String repo, String key)
    • asString

      public static String asString(byte[] value)
    • getSerializer

      public LevelDBSerializer getSerializer()
    • setSerializer

      public void setSerializer(LevelDBSerializer serializer)
    • codec

      public LevelDBCamelCodec codec()