Package com.gigaspaces.events
Class EventSessionConfig
java.lang.Object
com.gigaspaces.events.EventSessionConfig
- All Implemented Interfaces:
Textualizable,Serializable
this class is used to configure an EventSession.
it contains a set of configuration parameters that influence the way event listeners are registered with the space
and how event notifications are processed.
the names of the parameters that can be used in the properties object or file are:
batchSize - the size of the batch used when sending notifications to the client.
must be used with batchTime
batchTime - the maximum elapsed time between two batch notifications.
must be used with batchSize
reliable - whether the notification process is reliable.
renew - whether to not to automatically renew the lease of the registered listeners.
durable - whether the events are durable.
replicateNotifyTemplate - whether to replicate the registration to other spaces in the cluster triggerNotifyTemplate - whether to send notifications from all spaces in the cluster. guaranteedNotifications - whether to generate notifications that won't be lost during failover.
it contains a set of configuration parameters that influence the way event listeners are registered with the space
and how event notifications are processed.
the names of the parameters that can be used in the properties object or file are:
batchSize - the size of the batch used when sending notifications to the client.
must be used with batchTime
batchTime - the maximum elapsed time between two batch notifications.
must be used with batchSize
reliable - whether the notification process is reliable.
renew - whether to not to automatically renew the lease of the registered listeners.
durable - whether the events are durable.
replicateNotifyTemplate - whether to replicate the registration to other spaces in the cluster triggerNotifyTemplate - whether to send notifications from all spaces in the cluster. guaranteedNotifications - whether to generate notifications that won't be lost during failover.
- Since:
- 6.0
- Version:
- 1.0
- Author:
- asy ronen
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final longstatic final longDeprecated.Since 9.7 - Custom auto-renew id deprecated.static final longDeprecated.Since 9.7 - Custom auto-renew id deprecated.static final longDeprecated.Since 9.7 - Custom auto-renew id deprecated.static final booleanstatic final booleanstatic final String -
Constructor Summary
ConstructorsConstructorDescriptioncreates EventSessionConfig for farther configuration.EventSessionConfig(String schemaName) Deprecated.since 9.0 use setters insteadEventSessionConfig(Properties props) Deprecated.since 9.0 use setters instead -
Method Summary
Modifier and TypeMethodDescriptionintreturn batchPendingThreshold - number of notifications held at server before sending themintlonglonglonglongbooleanbooleanChecks if using batch notifications.booleanbooleanisFifo()Checks if the order that is in use with this config is fifo.booleanShould this template be replicated.Should notify template be triggered on replication event.setAutoRenew(boolean renew, LeaseListener listener) enable the auto renew of the notify.
use to keep getting events until client fails.voidsetAutoRenew(boolean renew, LeaseListener listener, long renewExpiration, long renewDuration, long renewRTT) Deprecated.Since 9.7 - Customizing auto renew is deprecated, use the simple setAutoRenew(boolean, LeaseListener) instead.voidsetBatch(int size, long time) set the notifications to come in batches of size.voidsetBatch(int size, long time, int pendingThreshold) set the notifications to come in batches of size.setDurableNotifications(boolean durable) Sets whether to generate notifications that won't be lost during failover and disconnectionsetFifo(boolean fifo) Set fifo order for the notifications.voidsetGuaranteedNotifications(boolean guaranteedNotifications) Deprecated.Since 9.0 usesetDurableNotifications(boolean)instead.setReplicateNotifyTemplate(boolean replicateNotifyTemplate) setTriggerNotifyTemplate(boolean triggerNotifyTemplate) toString()voidtoText(Textualizer textualizer) voidvalidate()Checks configuration validity
-
Field Details
-
USE_OLD_LEASE_RENEWAL_MANAGER_PROPERTY
- See Also:
-
USE_OLD_GUARANTEED_NOTIFICATIONS
public static final boolean USE_OLD_GUARANTEED_NOTIFICATIONS -
USE_OLD_LEASE_RENEWAL_MANAGER
public static final boolean USE_OLD_LEASE_RENEWAL_MANAGER -
DEFAULT_RENEW_EXPIRATION
Deprecated.Since 9.7 - Custom auto-renew id deprecated.- See Also:
-
DEFAULT_RENEW_DURATION
public static final long DEFAULT_RENEW_DURATIONDeprecated.Since 9.7 - Custom auto-renew id deprecated.- See Also:
-
DEFAULT_RENEW_RTT
public static final long DEFAULT_RENEW_RTTDeprecated.Since 9.7 - Custom auto-renew id deprecated.- See Also:
-
DEFAULT_DURABLE_BATCH_SIZE
public static final int DEFAULT_DURABLE_BATCH_SIZE- See Also:
-
DEFAULT_DURABLE_BATCH_PENDING_THRESHOLD
public static final int DEFAULT_DURABLE_BATCH_PENDING_THRESHOLD- See Also:
-
DEFAULT_DURABLE_BATCH_TIME
public static final long DEFAULT_DURABLE_BATCH_TIME- See Also:
-
-
Constructor Details
-
EventSessionConfig
public EventSessionConfig()creates EventSessionConfig for farther configuration. -
EventSessionConfig
Deprecated.since 9.0 use setters insteadcreates EventSessionConfig and start it's configuration from the Properties given. use properties name as keys for the given Properties.- Parameters:
props- - holds the keys and values.
-
EventSessionConfig
Deprecated.since 9.0 use setters insteadcreates EventSessionConfig from a loaded file in the given name. the file should be ".properties" in the config folder.- Parameters:
schemaName- - the file name.- Throws:
IOException- - thrown when fail to read from file.
-
-
Method Details
-
isFifo
public boolean isFifo()Checks if the order that is in use with this config is fifo.- Returns:
- true if notification comes in fifo order.
-
setFifo
Set fifo order for the notifications.- Parameters:
fifo- - true when using fifo order.
-
isBatching
public boolean isBatching()Checks if using batch notifications.- Returns:
trueif notification comes in batches both size > 0 and time > 0 were set.- See Also:
-
setBatch
public void setBatch(int size, long time) set the notifications to come in batches of size. notification can not be delay more then time ms.- Parameters:
size- - amount of notifications held at server before sending them and the amount of notification in batch.time- - maximum time to delay notification in not full batch.
-
setBatch
public void setBatch(int size, long time, int pendingThreshold) set the notifications to come in batches of size. notification can not be delay more then time ms.- Parameters:
size- - amount of notification in batch.time- - maximum time to delay notification in not full batch.pendingThreshold- - amount of notifications held at server before sending them.
-
getBatchSize
public int getBatchSize()- Returns:
- batchSize number of notifications in a batch.
-
getBatchTime
public long getBatchTime()- Returns:
- batchTime - the maximum elapsed time between two batch notifications.
-
getBatchPendingThreshold
public int getBatchPendingThreshold()return batchPendingThreshold - number of notifications held at server before sending them -
isAutoRenew
public boolean isAutoRenew() -
setAutoRenew
enable the auto renew of the notify.
use to keep getting events until client fails. same as:setAutoRenew(renew, listener, Lease.FOREVER, 20000, 10000)- Parameters:
renew- - true when autoRenew needed.listener- for events when renew fails.
-
setAutoRenew
@Deprecated public void setAutoRenew(boolean renew, LeaseListener listener, long renewExpiration, long renewDuration, long renewRTT) Deprecated.Since 9.7 - Customizing auto renew is deprecated, use the simple setAutoRenew(boolean, LeaseListener) instead.with this method the user can configure the renew time duration for the auto renew. Using the renewDuration parameter, you define the period of time that passes between the time a client failure occurred, and the time your notifications stop being sent from the space- Parameters:
renew- - true when autoRenew needed.listener- for events when renew fails.renewExpiration- the period of time your notifications stop being renewed.renewDuration- the period of time that passes between client failure, and the time your notifications stop being sent. use more than renewRTT.renewRTT- - RoundTripTime - the time that takes to reach the server and return. default 10000.
-
getLeaseListener
- Returns:
- the lease listener in case of LRM use. otherwise - returns null.
-
isDurableNotifications
public boolean isDurableNotifications()- Returns:
- whether to generate notifications that won't be lost during failover and disconnection
-
setDurableNotifications
Sets whether to generate notifications that won't be lost during failover and disconnection -
isTriggerNotifyTemplate
Should notify template be triggered on replication event.- Returns:
trueif trigger is needed on replication event.nullis returned when this value was never set.
-
setTriggerNotifyTemplate
- Parameters:
triggerNotifyTemplate-
-
isReplicateNotifyTemplate
Should this template be replicated.- Returns:
trueif this template should be replicated.nullis returned when this value was not set.
-
setReplicateNotifyTemplate
- Parameters:
replicateNotifyTemplate-
-
getRenewDuration
public long getRenewDuration()- Returns:
- the renew Duration.
-
getRenewExpiration
public long getRenewExpiration()- Returns:
- Returns the renewExpiration.
-
getRenewRTT
public long getRenewRTT()- Returns:
- Returns the renewRTT.
-
isGuaranteedNotifications
public boolean isGuaranteedNotifications()- Returns:
- whether to generate notifications that won't be lost during failover
-
setGuaranteedNotifications
Deprecated.Since 9.0 usesetDurableNotifications(boolean)instead.Sets whether to generate notifications that won't be lost during failover -
validate
public void validate()Checks configuration validity -
toString
-
toText
- Specified by:
toTextin interfaceTextualizable
-