@ManagedOperation(description = "Clear the store") @Override public void clear() { valueOperations.getOperations().execute(new RedisCallback<List<byte[]>>() { @Override public List<byte[]> doInRedis(RedisConnection connection) throws DataAccessException { List<byte[]> binaryKeys = new ArrayList<>(); Cursor<byte[]> cursor = connection.scan(ScanOptions.scanOptions().match("*" + createRedisKey("*")).build()); while (cursor.hasNext()) { byte[] key = cursor.next(); binaryKeys.add(key); } if (binaryKeys.size() > 0) { connection.del(binaryKeys.toArray(new byte[][]{})); } return binaryKeys; } }); }
@ManagedOperation(description = "Does the store contain the given key") @Override public boolean contains(final T key) { // Run this in single transaction. Boolean rc = transactionTemplate.execute(new TransactionCallback<Boolean>() { public Boolean doInTransaction(TransactionStatus status) { int count = queryForInt(key); if (count == 0) { return Boolean.FALSE; } else { return Boolean.TRUE; } } }); return rc.booleanValue(); }
@ManagedOperation(description = "Clear the store") public void clear() { final EntityManager entityManager = getTargetEntityManager(null, entityManagerFactory, true, sharedEntityManager, true); Boolean rc = transactionTemplate.execute(new TransactionCallback<Boolean>() { public Boolean doInTransaction(TransactionStatus status) { if (isJoinTransaction()) { entityManager.joinTransaction(); } List<?> list = queryClear(entityManager); if (!list.isEmpty()) { Iterator it = list.iterator(); while (it.hasNext()) { Object item = it.next(); entityManager.remove(item); } entityManager.flush(); } return Boolean.TRUE; } }); LOG.debug("clear the store {}", MessageProcessed.class.getName()); }
@ManagedOperation(description = "Clear the store") @Override public void clear() { transactionTemplate.execute(new TransactionCallback<Boolean>() { public Boolean doInTransaction(TransactionStatus status) { delete(); return Boolean.TRUE; } }); }
@ManagedOperation(description = "Remove the key from the store") @Override public boolean remove(E key) { Document document = new Document("_id", key); DeleteResult res = collection.deleteOne(document); return res.getDeletedCount() > 0; }
@ManagedOperation(description = "Adds the key to the store") public boolean add(String key) { if (!contains(key)) { return setOperations.add(processorName, key) != null; } else { return false; } }
@ManagedOperation(description = "Reset cache statistics") void resetStatistics();
@ManagedOperation(description = "Purges the cache") void purge();
@ManagedOperation(description = "Pauses the metrics poller") public void pausePoller() { poller.pause(); }
@ManagedOperation(description = "Statistics of the endpoints which has been sent to") TabularData extendedInformation();
/** * Purges the queue */ @ManagedOperation(description = "Purges the seda queue") public void purgeQueue() { LOG.debug("Purging queue with {} exchanges", queue.size()); queue.clear(); }
@ManagedOperation(description = "Clears the cached resource, forcing to re-load the resource on next request") public void clearContentCache() { log.debug("Clearing resource: {} from the content cache", resourceUri); buffer = null; }
@ManagedOperation(description = "Dumps the state of the load balancer") String dumpState();
@ManagedOperation(description = "Statistics of the content based router for each predicate") TabularData choiceStatistics();
@ManagedOperation(description = "Reset the statistic counters") void reset();
@ManagedOperation(description = "Statistics of the content based router for each exception") TabularData exceptionStatistics();
@ManagedOperation(description = "To interrupt an exchange which may seem as stuck, to force the exchange to continue, allowing any blocking thread to be released.") void interrupt(String exchangeId);
@ManagedOperation(description = "Resets the statistics") void resetStatistics();
@ManagedOperation(description = "Dumps the routes as XML") String dumpRoutesAsXml() throws Exception;
@ManagedOperation(description = "Explain how this endpoint is configured") TabularData explain(boolean allOptions);
@ManagedOperation(description = "Starts all the routes which currently is not started") void startAllRoutes() throws Exception;
@ManagedOperation(description = "Current size of inflight exchanges which are from the given route.") int size(String routeId);
@ManagedOperation(description = "Lists all the exchanges which are currently inflight") TabularData browse();
@ManagedOperation(description = "List all the exchanges that origins from the given route, which are currently inflight, limited and sorted") TabularData browse(String fromRouteId, int limit, boolean sortByLongestDuration);
@ManagedOperation(description = "Dumps the statistics as XML") String dumpStatsAsXml(boolean fullStats);
@ManagedOperation(description = "Start Processor") void start() throws Exception;
@ManagedOperation(description = "Stop Processor") void stop() throws Exception;
@ManagedOperation(description = "Whether its possible to send to the endpoint (eg the endpoint has a producer)") boolean canSendToEndpoint(String endpointUri);
@ManagedOperation(description = "Dumps the statistics as json") String dumpStatisticsAsJson();
@ManagedOperation(description = "Reset the current count of duplicate Messages") void resetDuplicateMessageCount();
@ManagedOperation(description = "Adds the key to the store") public boolean add(String messageId) { return add(null, messageId); }
@ManagedOperation public void clearServers() { getConfiguration().getServers().clear(); }
@ManagedOperation(description = "Reset the utilization statistics") void resetStatistics();
@ManagedOperation(description = "Clears the cached schema, forcing to re-load the schema on next request") public void clearCachedSchema() { schemaReader.setSchema(null); // will cause to reload the schema }
@ManagedOperation(description = "Stop route") void stop() throws Exception;
@ManagedOperation(description = " Gets all the endpoint urls captured during runtime that are in-use") List<String> getAllEndpoints(boolean includeInputs);
@ManagedOperation(description = "Restart Camel (stop and then start)") void restart() throws Exception;
@ManagedOperation(description = "Adds or updates existing routes from XML") void addOrUpdateRoutesFromXml(String xml) throws Exception;