001/**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.camel.api.management.mbean;
018
019import org.apache.camel.api.management.ManagedAttribute;
020import org.apache.camel.api.management.ManagedOperation;
021import org.apache.camel.spi.StreamCachingStrategy;
022
023public interface ManagedStreamCachingStrategyMBean extends ManagedServiceMBean {
024
025    @ManagedAttribute(description = "Whether stream caching is enabled")
026    boolean isEnabled();
027
028    @ManagedAttribute(description = "Directory used when overflow and spooling to disk")
029    String getSpoolDirectory();
030
031    @ManagedAttribute(description = "Chiper used if writing with encryption")
032    String getSpoolChiper();
033
034    @ManagedAttribute(description = "Threshold in bytes when overflow and spooling to disk instead of keeping in memory")
035    void setSpoolThreshold(long threshold);
036
037    @ManagedAttribute(description = "Threshold in bytes when overflow and spooling to disk instead of keeping in memory")
038    long getSpoolThreshold();
039
040    @ManagedAttribute(description = "Percentage (1-99) of used heap memory threshold to activate spooling to disk")
041    void setSpoolUsedHeapMemoryThreshold(int percentage);
042
043    @ManagedAttribute(description = "Percentage (1-99) of used heap memory threshold to activate spooling to disk")
044    int getSpoolUsedHeapMemoryThreshold();
045
046    @ManagedAttribute(description = "Whether used heap memory limit is committed or maximum")
047    void setSpoolUsedHeapMemoryLimit(StreamCachingStrategy.SpoolUsedHeapMemoryLimit limit);
048
049    @ManagedAttribute(description = "Whether used heap memory limit is committed or maximum")
050    StreamCachingStrategy.SpoolUsedHeapMemoryLimit getSpoolUsedHeapMemoryLimit();
051
052    @ManagedAttribute(description = "Buffer size in bytes to use when coping between buffers")
053    void setBufferSize(int bufferSize);
054
055    @ManagedAttribute(description = "Buffer size in bytes to use when coping between buffers")
056    int getBufferSize();
057
058    @ManagedAttribute(description = "Whether to remove spool directory when stopping")
059    void setRemoveSpoolDirectoryWhenStopping(boolean remove);
060
061    @ManagedAttribute(description = "Whether to remove spool directory when stopping")
062    boolean isRemoveSpoolDirectoryWhenStopping();
063
064    @ManagedAttribute(description = "Whether any or all spool rules determines whether to spool")
065    void setAnySpoolRules(boolean any);
066
067    @ManagedAttribute(description = "Whether any or all spool rules determines whether to spool")
068    boolean isAnySpoolRules();
069
070    @ManagedAttribute(description = "Number of in-memory StreamCache created")
071    long getCacheMemoryCounter();
072
073    @ManagedAttribute(description = "Total accumulated number of bytes which has been stream cached for in-memory StreamCache")
074    long getCacheMemorySize();
075
076    @ManagedAttribute(description = "Average number of bytes per cached stream for in-memory stream caches.")
077    long getCacheMemoryAverageSize();
078
079    @ManagedAttribute(description = "Number of spooled (not in-memory) StreamCache created")
080    long getCacheSpoolCounter();
081
082    @ManagedAttribute(description = "Total accumulated number of bytes which has been stream cached for spooled StreamCache")
083    long getCacheSpoolSize();
084
085    @ManagedAttribute(description = "Average number of bytes per cached stream for spooled (not in-memory) stream caches.")
086    long getCacheSpoolAverageSize();
087
088    @ManagedAttribute(description = "Whether utilization statistics is enabled")
089    boolean isStatisticsEnabled();
090
091    @ManagedAttribute(description = "Whether utilization statistics is enabled")
092    void setStatisticsEnabled(boolean enabled);
093
094    @ManagedOperation(description = "Reset the utilization statistics")
095    void resetStatistics();
096
097}