public interface CacheServer
Cache to client VMs in another distributed system via a
socket. A cache server is used in conjunction with a
client Pool to connect two regions
that reside in different distributed systems.Cache.addCacheServer(),
Cache.getCacheServers()| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_BIND_ADDRESS
The default ip address or host name that the cache server's socket will
listen on for client connections.
|
static java.lang.String[] |
DEFAULT_GROUPS
Deprecated.
as of 7.0 use the groups gemfire property
|
static java.lang.String |
DEFAULT_HOSTNAME_FOR_CLIENTS
The default ip address or host name that will be given to clients
as the host this cache server is listening on.
|
static long |
DEFAULT_LOAD_POLL_INTERVAL
The default frequency at which to poll the load probe for the load
on this cache server.
|
static ServerLoadProbe |
DEFAULT_LOAD_PROBE
The default load balancing probe.
|
static int |
DEFAULT_MAX_CONNECTIONS
The default number of sockets accepted by a CacheServer.
|
static int |
DEFAULT_MAX_THREADS
The default limit to the maximum number of cache server threads that can be
created to service client requests.
|
static int |
DEFAULT_MAXIMUM_MESSAGE_COUNT
The default maximum number of messages that can be enqueued in a
client-queue.
|
static int |
DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS
The default maximum amount of time between client pings.
|
static int |
DEFAULT_MESSAGE_TIME_TO_LIVE
The default time (in seconds ) after which a message in the client queue
will expire.
|
static boolean |
DEFAULT_NOTIFY_BY_SUBSCRIPTION
The default notify-by-subscription value which tells the
CacheServer whether or not to notify clients
based on key subscription. |
static int |
DEFAULT_PORT
The default port on which a
CacheServer is
configured to serve. |
static int |
DEFAULT_SOCKET_BUFFER_SIZE
The default socket buffer size for socket buffers from the cache server
to the client.
|
static boolean |
DEFAULT_TCP_NO_DELAY
The default setting for outgoing tcp/ip connections.
|
static int |
HTTP_DEFAULT_PORT |
static java.lang.String |
HTTP_SERVICE_DEFAULT_BIND_ADDRESS |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<ClientSession> |
getAllClientSessions()
Returns a set of all
ClientSessions |
java.lang.String |
getBindAddress()
Returns a string representing the ip address or host name that this cache server
will listen on.
|
ClientSession |
getClientSession(DistributedMember member)
Returns the
ClientSession associated with the
DistributedMember |
ClientSession |
getClientSession(java.lang.String durableClientId)
Returns the
ClientSession associated with the
durable client id |
ClientSubscriptionConfig |
getClientSubscriptionConfig()
Get the ClientSubscriptionConfig for this cache server.
|
java.lang.String[] |
getGroups()
Deprecated.
as of 7.0 use the groups gemfire property
|
java.lang.String |
getHostnameForClients()
Returns a string representing the ip address or host name that server locators
will tell clients that this cache server is listening on.
|
java.util.Set<InterestRegistrationListener> |
getInterestRegistrationListeners()
Returns a read-only set of
InterestRegistrationListeners
registered with this notifier. |
long |
getLoadPollInterval()
Get the frequency in milliseconds to poll the load probe on this cache
server.
|
ServerLoadProbe |
getLoadProbe()
Get the load probe for this cache server.
|
int |
getMaxConnections()
Returns the maximum allowed client connections
|
int |
getMaximumMessageCount()
Returns the maximum number of messages that can be enqueued in a
client-queue.
|
int |
getMaximumTimeBetweenPings()
Returns the maximum amount of time between client pings.
|
int |
getMaxThreads()
Returns the maxium number of threads allowed in this cache server to service
client requests.
|
int |
getMessageTimeToLive()
Returns the time (in seconds ) after which a message in the client queue
will expire.
|
boolean |
getNotifyBySubscription()
Deprecated.
as of 6.0.1. This method is no more in use, by default
notifyBySubscription attribute is set to true.
|
int |
getPort()
Returns the port on which this cache server listens for clients.
|
int |
getSocketBufferSize()
Returns the configured buffer size of the socket connection for this
CacheServer. |
boolean |
getTcpNoDelay()
Get the outgoing connection tcp-no-delay setting.
|
boolean |
isRunning()
Returns whether or not this cache server is running
|
void |
registerInterestRegistrationListener(InterestRegistrationListener listener)
Registers a new
InterestRegistrationListener with the set of
InterestRegistrationListeners. |
void |
setBindAddress(java.lang.String address)
Sets the ip address or host name that this cache server is to listen on for
client connections.
|
void |
setGroups(java.lang.String[] groups)
Deprecated.
as of 7.0 use the groups gemfire property
|
void |
setHostnameForClients(java.lang.String name)
Sets the ip address or host name that this cache server is to listen on for
client connections.
|
void |
setLoadPollInterval(long loadPollInterval)
Set the frequency in milliseconds to poll the load probe on this cache
server
|
void |
setLoadProbe(ServerLoadProbe loadProbe)
Set the load probe for this cache server.
|
void |
setMaxConnections(int maxCons)
Sets the maxium number of client connections allowed.
|
void |
setMaximumMessageCount(int maxMessageCount)
Sets maximum number of messages that can be enqueued in a client-queue.
|
void |
setMaximumTimeBetweenPings(int maximumTimeBetweenPings)
Sets the maximum amount of time between client pings.
|
void |
setMaxThreads(int maxThreads)
Sets the maxium number of threads allowed in this cache server to service
client requests.
|
void |
setMessageTimeToLive(int messageTimeToLive)
Sets the time (in seconds ) after which a message in the client queue
will expire.
|
void |
setNotifyBySubscription(boolean b)
Deprecated.
as of 6.0.1. This method is no longer in use, by default
notifyBySubscription attribute is set to true.
|
void |
setPort(int port)
Sets the port on which this cache server listens for clients.
|
void |
setSocketBufferSize(int socketBufferSize)
Sets the buffer size in bytes of the socket connection for this
CacheServer. |
void |
setTcpNoDelay(boolean noDelay)
Configures the tcpNoDelay setting of sockets used to send messages
to clients.
|
void |
start()
Starts this cache server.
|
void |
stop()
Stops this cache server.
|
void |
unregisterInterestRegistrationListener(InterestRegistrationListener listener)
Unregisters an existing
InterestRegistrationListener from
the set of InterestRegistrationListeners. |
static final int DEFAULT_PORT
CacheServer is
configured to serve.static final int DEFAULT_MAX_CONNECTIONS
static final int DEFAULT_MAX_THREADS
0 causes a thread to be bound to every connection
and to be dedicated to detecting client requests on that connection. A selector
is not used in this default mode.
Current value: 0static final boolean DEFAULT_NOTIFY_BY_SUBSCRIPTION
CacheServer whether or not to notify clients
based on key subscription.static final int DEFAULT_SOCKET_BUFFER_SIZE
static final int DEFAULT_MAXIMUM_TIME_BETWEEN_PINGS
ClientHealthMonitor to determine the
health of this CacheServer's clients.static final int DEFAULT_MAXIMUM_MESSAGE_COUNT
static final int DEFAULT_MESSAGE_TIME_TO_LIVE
static final java.lang.String[] DEFAULT_GROUPS
static final ServerLoadProbe DEFAULT_LOAD_PROBE
static final long DEFAULT_LOAD_POLL_INTERVAL
static final java.lang.String DEFAULT_BIND_ADDRESS
static final java.lang.String DEFAULT_HOSTNAME_FOR_CLIENTS
static final boolean DEFAULT_TCP_NO_DELAY
static final int HTTP_DEFAULT_PORT
static final java.lang.String HTTP_SERVICE_DEFAULT_BIND_ADDRESS
int getPort()
void setPort(int port)
java.lang.IllegalStateException - If this cache server is runningjava.lang.String getBindAddress()
DEFAULT_BIND_ADDRESSvoid setBindAddress(java.lang.String address)
Setting a specific bind address will cause the cache server to always
use this address and ignore any address specified by "server-bind-address"
or "bind-address" in the gemfire.properties file
(see DistributedSystem
for a description of these properties).
The value "" does not override the gemfire.properties.
It will cause the local machine's default address to be listened on if the
properties file does not specify and address.
If you wish to override the properties and want to have your cache server bind to all local
addresses then use this bind address "0.0.0.0".
A null value will be treated the same as the default "".
address - the ip address or host name that this cache server is to listen onDEFAULT_BIND_ADDRESSjava.lang.String getHostnameForClients()
DEFAULT_HOSTNAME_FOR_CLIENTSvoid setHostnameForClients(java.lang.String name)
Setting a specific hostname-for-clients will cause server locators to use this value when telling clients how to connect to this cache server. This is useful in the case where the cache server may refer to itself with one hostname, but the clients need to use a different hostname to find the cache server.
The value "" causes the bind-address to be given to clients.
A null value will be treated the same as the default "".
name - the ip address or host name that will be given to clients
so they can connect to this cache serverDEFAULT_HOSTNAME_FOR_CLIENTS@Deprecated void setNotifyBySubscription(boolean b)
@Deprecated boolean getNotifyBySubscription()
void setSocketBufferSize(int socketBufferSize)
CacheServer. The default is 32768 bytes.socketBufferSize - The size in bytes of the socket bufferint getSocketBufferSize()
CacheServer. The default is 32768 bytes.CacheServervoid setMaximumTimeBetweenPings(int maximumTimeBetweenPings)
ClientHealthMonitor to determine the health
of this CacheServer's clients. The default is 60000 ms.maximumTimeBetweenPings - The maximum amount of time between client
pingsint getMaximumTimeBetweenPings()
ClientHealthMonitor to determine the health
of this CacheServer's clients. The default is 60000 ms.void start()
throws java.io.IOException
java.io.IOException - If an error occurs while starting the cache serverboolean isRunning()
void stop()
CacheServer can be reconfigured and restarted if
desired.int getMaxConnections()
void setMaxConnections(int maxCons)
DEFAULT_MAX_CONNECTIONSint getMaxThreads()
0 causes the cache server to dedicate a thread for
every client connection.void setMaxThreads(int maxThreads)
0 causes the cache server to dedicate a thread for
every client connection.DEFAULT_MAX_THREADSint getMaximumMessageCount()
void setMaximumMessageCount(int maxMessageCount)
DEFAULT_MAXIMUM_MESSAGE_COUNTint getMessageTimeToLive()
void setMessageTimeToLive(int messageTimeToLive)
DEFAULT_MESSAGE_TIME_TO_LIVEvoid setGroups(java.lang.String[] groups)
groups - possibly empty array of String where each string
is a server groups that this cache server will be a member of.DEFAULT_GROUPSjava.lang.String[] getGroups()
Strings where
each string is a server group. Modifying this array will not change the
server groups that this cache server belongs to.ServerLoadProbe getLoadProbe()
ServerLoadProbe for details on the load probe.void setLoadProbe(ServerLoadProbe loadProbe)
ServerLoadProbe for details on how to implement
a load probe.loadProbe - the load probe to use for
this cache server.long getLoadPollInterval()
void setLoadPollInterval(long loadPollInterval)
loadPollInterval - the frequency in milliseconds to poll
the load probe. Must be greater than 0.boolean getTcpNoDelay()
void setTcpNoDelay(boolean noDelay)
noDelay - if false, sets tcp-no-delay to false on out-going connectionsClientSubscriptionConfig getClientSubscriptionConfig()
ClientSubscriptionConfig for details on the client subscription configuration.ClientSession getClientSession(DistributedMember member)
ClientSession associated with the
DistributedMemberClientSession associated with the
DistributedMemberClientSession getClientSession(java.lang.String durableClientId)
ClientSession associated with the
durable client idClientSession associated with the
durablejava.util.Set<ClientSession> getAllClientSessions()
ClientSessionsClientSessionsvoid registerInterestRegistrationListener(InterestRegistrationListener listener)
InterestRegistrationListener with the set of
InterestRegistrationListeners.listener - The InterestRegistrationListener to registervoid unregisterInterestRegistrationListener(InterestRegistrationListener listener)
InterestRegistrationListener from
the set of InterestRegistrationListeners.listener - The InterestRegistrationListener to unregisterjava.util.Set<InterestRegistrationListener> getInterestRegistrationListeners()
InterestRegistrationListeners
registered with this notifier.InterestRegistrationListeners
registered with this notifier