All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gemstone.gemfire.cache.server.ClientSubscriptionConfig Maven / Gradle / Ivy

/*
 * Copyright (c) 2010-2015 Pivotal Software, Inc. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you
 * may not use this file except in compliance with the License. You
 * may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied. See the License for the specific language governing
 * permissions and limitations under the License. See accompanying
 * LICENSE file.
 */

package com.gemstone.gemfire.cache.server;

/**
 * Used to configure queuing on a cache server for client subscriptions.
 * 

*

    *
  • * For eviction-policy none client queue entries are not evicted to disk
  • *
  • For eviction-policy mem client queue entries are evicted to disk when limit is * reached, defined by capacity
  • *
  • For eviction-policy entry HA entries are evicted to disk when limit is * reached, defined by capacity
  • *
*
* * The capacity limits the total amount of memory or entries for all client queues * on held on this server. If this server hosts multiple client queues, they will * all share the same capacity. * *

* Configuration: *

* The client queue is configurable declaratively or * programmatically. Declarative configuration is achieved through defining the * configuration parameters in a cache.xml file. Programmatic * configuration may be achieved by first instantiating a * CacheServer object and get {@link CacheServer#getClientSubscriptionConfig} * ClientSubscriptionConfig object and modify each desired parameter and value. *

*

* * If you are using a cache.xml file to create a * CacheServer declaratively, you can do the following to configure * ClientSubscriptionConfig and to have none eviction policy * no need to specify client-subscription tag as it is a default one. *

* *
 *
 * <cache-server port=4444>
 *   <client-subscription eviction-policy="entry | mem" capacity=35 overflow-directory="OverflowDir"></client-subscription>
 * </cache-server>
 * 
 *
* @see #getEvictionPolicy * @see #getCapacity * * * @since 5.7 * @author aingle */ public interface ClientSubscriptionConfig { /** * The default limit that is assigned to client subscription. */ public static final int DEFAULT_CAPACITY = 1; /** * The default eviction policy that is assigned to client subscription. */ public static final String DEFAULT_EVICTION_POLICY = "none"; /** * The default overflow directory that is assigned to client subscription. */ public static final String DEFAULT_OVERFLOW_DIRECTORY = "."; /** * Returns the capacity of the client queue. * will be in MB for eviction-policy mem else * number of entries * @see #DEFAULT_CAPACITY * @since 5.7 */ public int getCapacity(); /** * Sets the capacity of the client queue. * will be in MB for eviction-policy mem else * number of entries * @see #DEFAULT_CAPACITY * @since 5.7 */ public void setCapacity(int capacity); /** * Returns the eviction policy that is executed when capacity of the client queue is reached. * @see #DEFAULT_EVICTION_POLICY * @since 5.7 */ public String getEvictionPolicy(); /** * Sets the eviction policy that is executed when capacity of the client queue is reached. * @see #DEFAULT_EVICTION_POLICY * @since 5.7 */ public void setEvictionPolicy(String policy); /** * Sets the overflow directory for a client queue * @param overflowDirectory the overflow directory for a client queue's overflowed entries * @since 5.7 * @deprecated as of 6.5 use {@link #setDiskStoreName(String)} instead */ public void setOverflowDirectory(String overflowDirectory); /** * Answers the overflow directory for a client queue's * overflowed client queue entries. * @return the overflow directory for a client queue's * overflowed entries * @since 5.7 * @deprecated as of 6.5 use {@link #getDiskStoreName} instead */ public String getOverflowDirectory(); /** * Sets the disk store name for overflow * @param diskStoreName * @since 6.5 */ public void setDiskStoreName(String diskStoreName); /** * get the diskStoreName for overflow * @since 6.5 */ public String getDiskStoreName(); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy