Class JpaMessageIdRepository

  • All Implemented Interfaces:
    AutoCloseable, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.IdempotentRepository, org.apache.camel.StatefulService, org.apache.camel.SuspendableService

    @ManagedResource(description="JPA based message id repository")
    public class JpaMessageIdRepository
    extends org.apache.camel.support.service.ServiceSupport
    implements org.apache.camel.spi.IdempotentRepository
    • Field Detail

      • QUERY_STRING

        protected static final String QUERY_STRING
      • QUERY_CLEAR_STRING

        protected static final String QUERY_CLEAR_STRING
    • Constructor Detail

      • JpaMessageIdRepository

        public JpaMessageIdRepository​(javax.persistence.EntityManagerFactory entityManagerFactory,
                                      String processorName)
      • JpaMessageIdRepository

        public JpaMessageIdRepository​(javax.persistence.EntityManagerFactory entityManagerFactory,
                                      TransactionStrategy transactionStrategy,
                                      String processorName)
    • Method Detail

      • jpaMessageIdRepository

        public static JpaMessageIdRepository jpaMessageIdRepository​(javax.persistence.EntityManagerFactory entityManagerFactory,
                                                                    String processorName)
      • add

        @ManagedOperation(description="Adds the key to the store")
        public boolean add​(String messageId)
        Specified by:
        add in interface org.apache.camel.spi.IdempotentRepository
      • add

        public boolean add​(org.apache.camel.Exchange exchange,
                           String messageId)
        Specified by:
        add in interface org.apache.camel.spi.IdempotentRepository
      • contains

        @ManagedOperation(description="Does the store contain the given key")
        public boolean contains​(String messageId)
        Specified by:
        contains in interface org.apache.camel.spi.IdempotentRepository
      • contains

        public boolean contains​(org.apache.camel.Exchange exchange,
                                String messageId)
        Specified by:
        contains in interface org.apache.camel.spi.IdempotentRepository
      • remove

        @ManagedOperation(description="Remove the key from the store")
        public boolean remove​(String messageId)
        Specified by:
        remove in interface org.apache.camel.spi.IdempotentRepository
      • remove

        public boolean remove​(org.apache.camel.Exchange exchange,
                              String messageId)
        Specified by:
        remove in interface org.apache.camel.spi.IdempotentRepository
      • confirm

        public boolean confirm​(String messageId)
        Specified by:
        confirm in interface org.apache.camel.spi.IdempotentRepository
      • confirm

        public boolean confirm​(org.apache.camel.Exchange exchange,
                               String messageId)
        Specified by:
        confirm in interface org.apache.camel.spi.IdempotentRepository
      • clear

        @ManagedOperation(description="Clear the store")
        public void clear()
        Specified by:
        clear in interface org.apache.camel.spi.IdempotentRepository
      • getProcessorName

        @ManagedAttribute(description="The processor name")
        public String getProcessorName()
      • isJoinTransaction

        @ManagedAttribute(description="Whether to join existing transaction")
        public boolean isJoinTransaction()
      • setJoinTransaction

        public void setJoinTransaction​(boolean joinTransaction)
      • isSharedEntityManager

        @ManagedAttribute(description="Whether to use shared EntityManager")
        public boolean isSharedEntityManager()
      • setSharedEntityManager

        public void setSharedEntityManager​(boolean sharedEntityManager)
      • 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