001package org.apache.commons.jcs.auxiliary.remote.server.behavior;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import org.apache.commons.jcs.auxiliary.remote.behavior.ICommonRemoteCacheAttributes;
023
024/**
025 * This defines the minimal behavior for the objects that are used to configure
026 * the remote cache server.
027 */
028public interface IRemoteCacheServerAttributes
029    extends ICommonRemoteCacheAttributes
030{
031    /**
032     * Gets the localPort attribute of the IRemoteCacheAttributes object.
033     * <p>
034     * @return The localPort value
035     */
036    int getServicePort();
037
038    /**
039     * Sets the localPort attribute of the IRemoteCacheAttributes object.
040     * <p>
041     * @param p
042     *            The new localPort value
043     */
044    void setServicePort( int p );
045
046    /**
047     * Should we try to get remotely when the request does not come in from a
048     * cluster. If local L1 asks remote server R1 for element A and R1 doesn't
049     * have it, should R1 look remotely? The difference is between a local and a
050     * remote update. The local update stays local. Normal updates, removes,
051     * etc, stay local when they come from a client. If this is set to true,
052     * then they can go remote.
053     * <p>
054     * @return The localClusterConsistency value
055     */
056    boolean isAllowClusterGet();
057
058    /**
059     * Should cluster updates be propagated to the locals.
060     * <p>
061     * @param r
062     *            The new localClusterConsistency value
063     */
064    void setAllowClusterGet( boolean r );
065
066    /**
067     * Gets the ConfigFileName attribute of the IRemoteCacheAttributes object.
068     * <p>
069     * @return The configuration file name
070     */
071    String getConfigFileName();
072
073    /**
074     * Sets the ConfigFileName attribute of the IRemoteCacheAttributes object.
075     * <p>
076     * @param s
077     *            The new configuration file name
078     */
079    void setConfigFileName( String s );
080
081    /**
082     * Should we try to keep the registry alive
083     * <p>
084     * @param useRegistryKeepAlive the useRegistryKeepAlive to set
085     */
086    void setUseRegistryKeepAlive( boolean useRegistryKeepAlive );
087
088    /**
089     * Should we start the registry
090     * <p>
091     * @param startRegistry the startRegistry to set
092     * @deprecated Always true, to be removed
093     */
094    void setStartRegistry( boolean startRegistry );
095
096    /**
097     * Should we start the registry
098     * <p>
099     * @return the startRegistry
100     * @deprecated Always true, to be removed
101     */
102    boolean isStartRegistry();
103
104    /**
105     * Should we try to keep the registry alive
106     * <p>
107     * @return the useRegistryKeepAlive
108     */
109    boolean isUseRegistryKeepAlive();
110
111    /**
112     * @param registryKeepAliveDelayMillis the registryKeepAliveDelayMillis to set
113     */
114    void setRegistryKeepAliveDelayMillis( long registryKeepAliveDelayMillis );
115
116    /**
117     * @return the registryKeepAliveDelayMillis
118     */
119    long getRegistryKeepAliveDelayMillis();
120}