com.apama.services.scenario
Class ScenarioServiceConfig

java.lang.Object
  extended by com.apama.services.scenario.ScenarioServiceConfig

public class ScenarioServiceConfig
extends java.lang.Object

ScenarioServiceConfig is a helper class that assists in building a properies map for use when creating a new ScenarioService via the ScenarioServiceFactory.

Note that EventServiceChannel configuration properties are also valid configuration properties for a ScenarioService, and will be applied to any channel created by the ScenarioService.

Any configuration property not explicitly specified will take its default value. Defaults are available for all configuration properties, in the same interface as the property.

See Also:
ChannelConfig

Method Summary
static void setAckDataTimeout(java.util.Map<java.lang.String,java.lang.Object> properties, long timeout)
          Set the timeout for operations to wait for the Data channel to catch up.
static void setAutoInstanceDiscovery(java.util.Map<java.lang.String,java.lang.Object> properties, boolean autoInstanceDiscovery)
          Set the boolean configuration property to indicate if the service should discover instances automatically.
static void setDisconnectIfSlow(java.util.Map<java.lang.String,java.lang.Object> properties, boolean disconnectIfSlow)
          Set the boolean configuration property to indicate if our event receiver should be disconnected if slow.
static void setReconnectPeriod(java.util.Map<java.lang.String,java.lang.Object> properties, long time)
          Set the float configuration property to indicate how long to wait between reconections
static void setScenarioExclusionFilter(java.util.Map<java.lang.String,java.lang.Object> properties, java.util.Set<java.lang.String> scenarioExclusionFilter)
          Set the configuration property to the Set of ScenarioID's that the client wishes to ignore.
static void setScenarioInclusionFilter(java.util.Map<java.lang.String,java.lang.Object> properties, java.util.Set<java.lang.String> scenarioInclusionFilter)
          Set the configuration property to the Set of ScenarioID's in which the client is interested.
static void setStrongDataInboundEventQueue(java.util.Map<java.lang.String,java.lang.Object> properties, boolean strong)
          Set the boolean configuration property to indicate if the 'Data' channels (EventServiceChannel's), created for listening to scenario instance output variable updates, should use strong or soft references to events in the inbound event queue.
static void setUseRawDataChannel(java.util.Map<java.lang.String,java.lang.Object> properties, boolean useRawData)
          Set the boolean configuration property to indicate if the 'Data' channels (EventServiceChannel's), created for listening to scenario instance output variable updates, should be subscribed to the normal Data channel (possibly throttled), or the Raw Data channel (always unthrottled).
static void setUsernameFilter(java.util.Map<java.lang.String,java.lang.Object> properties, java.lang.String owner)
          Set the configuration property to filter by a given user If present, the scenario(s) listened for must have the ConfigureUpdates property sendRawUser or sendThrottledUser set to true.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setScenarioInclusionFilter

public static void setScenarioInclusionFilter(java.util.Map<java.lang.String,java.lang.Object> properties,
                                              java.util.Set<java.lang.String> scenarioInclusionFilter)
Set the configuration property to the Set of ScenarioID's in which the client is interested. Note that if this property is used, any exclusion filter will be ignored.

Parameters:
properties - The Map in which the configuration properties should be updated.
scenarioInclusionFilter - The new value of the property.
See Also:
IScenarioService.CONFIG_SCENARIO_INCLUSION_FILTER, IScenarioService.DEFAULT_SCENARIO_INCLUSION_FILTER, setScenarioExclusionFilter(Map, Set)

setScenarioExclusionFilter

public static void setScenarioExclusionFilter(java.util.Map<java.lang.String,java.lang.Object> properties,
                                              java.util.Set<java.lang.String> scenarioExclusionFilter)
Set the configuration property to the Set of ScenarioID's that the client wishes to ignore. Note that this property is ignored if an inclusion filter is used.

Parameters:
properties - The Map in which the configuration properties should be updated.
scenarioExclusionFilter - The new value of the property.
See Also:
IScenarioService.CONFIG_SCENARIO_EXCLUSION_FILTER, IScenarioService.DEFAULT_SCENARIO_EXCLUSION_FILTER, setScenarioInclusionFilter(Map, Set)

setStrongDataInboundEventQueue

public static void setStrongDataInboundEventQueue(java.util.Map<java.lang.String,java.lang.Object> properties,
                                                  boolean strong)
Set the boolean configuration property to indicate if the 'Data' channels (EventServiceChannel's), created for listening to scenario instance output variable updates, should use strong or soft references to events in the inbound event queue.

Note that this property would apply ONLY to 'Data' channels, and not to any other channels. For 'Data' channels, this setting overrides IEventServiceChannel.CONFIG_INBOUND_EVENT_QUEUE_SOFT_REFERENCE_PREFIXES.

Parameters:
properties - The Map in which the configuration properties should be updated.
strong - The new value of the property.
See Also:
IScenarioService.CONFIG_STRONG_DATA_INBOUND_EVENT_QUEUE, IScenarioService.DEFAULT_STRONG_DATA_INBOUND_EVENT_QUEUE

setUseRawDataChannel

public static void setUseRawDataChannel(java.util.Map<java.lang.String,java.lang.Object> properties,
                                        boolean useRawData)
Set the boolean configuration property to indicate if the 'Data' channels (EventServiceChannel's), created for listening to scenario instance output variable updates, should be subscribed to the normal Data channel (possibly throttled), or the Raw Data channel (always unthrottled).

The event throttling mechanism is global within a correlator, so if the throttling mechanism is used, all scenarios will emit throttled output variable updates on the normal Data channel. However, for some applications the complete (unthrottled) output is required. For this reason, there is also a 'Raw' output channel that clients may choose to consume. This configuration property simply instructs a ScenarioService if it should use the alternative Raw channel instead of the normal Data channel.

Note that this property would apply ONLY to 'Data' channels, and not to any other channels.

Parameters:
properties - The Map in which the configuration properties should be updated.
useRawData - The new value of the property.
See Also:
IScenarioService.CONFIG_USE_RAW_DATA_CHANNEL, IScenarioService.DEFAULT_USE_RAW_DATA_CHANNEL

setAckDataTimeout

public static void setAckDataTimeout(java.util.Map<java.lang.String,java.lang.Object> properties,
                                     long timeout)
Set the timeout for operations to wait for the Data channel to catch up.

Operations (Create, Edit, Delete) only complete once the Updates from the Data channel have been processed up to the point of that operation. Thus, if there are a lot of updates from scenario instances, a number of updates will be queued up, and any from before the operation will be processed before the update from the operation. This wait will time out if the data channel is too congested - the changes will still be seen, but after the operation has completed

Note that operations are "fail fast" - if an operation fails, the failure notification is delivered on the control channel, so the operation call will return quickly. Other operations can also be performed while waiting for the operation to complete.

Parameters:
properties - The Map in which the configuration properties should be updated.
timeout - the new value for the timeout
See Also:
IScenarioService.CONFIG_ACKDATA_TIMEOUT, IScenarioService.DEFAULT_ACKDATA_TIMEOUT

setDisconnectIfSlow

public static void setDisconnectIfSlow(java.util.Map<java.lang.String,java.lang.Object> properties,
                                       boolean disconnectIfSlow)
Set the boolean configuration property to indicate if our event receiver should be disconnected if slow.

The disconnect if slow property is only set when a connection is made between components; thus if any receiver, via scenario service, event service or other API, from this process (more exactly, this classloader) has been made, then that connection's disconnect if slow property will be used.

It is not (currently) possible to change the disconnect if slow property of a connection.

Connections to different correlators can use different values of this property.

Parameters:
properties - The Map in which the configuration properties should be updated.
disconnectIfSlow - The new value of the property.
See Also:
IScenarioService.CONFIG_DISCONNECT_IF_SLOW, IScenarioService.DEFAULT_DISCONNECT_IF_SLOW

setReconnectPeriod

public static void setReconnectPeriod(java.util.Map<java.lang.String,java.lang.Object> properties,
                                      long time)
Set the float configuration property to indicate how long to wait between reconections

The scenario service will wait at least this many milliseconds between a disconnect and attempting to reconnect

Parameters:
properties - The Map in which the configuration properties should be updated.
time - the time in milliseconds to wait between reconnections.
See Also:
IScenarioService.CONFIG_RECONNECT_PERIOD, IScenarioService.DEFAULT_RECONNECT_PERIOD

setAutoInstanceDiscovery

public static void setAutoInstanceDiscovery(java.util.Map<java.lang.String,java.lang.Object> properties,
                                            boolean autoInstanceDiscovery)
Set the boolean configuration property to indicate if the service should discover instances automatically.

Parameters:
properties - The Map in which the configuration properties should be updated.
autoInstanceDiscovery - The new value of the property.
See Also:
IScenarioService.CONFIG_AUTO_INSTANCE_DISCOVERY, IScenarioService.DEFAULT_AUTO_INSTANCE_DISCOVERY

setUsernameFilter

public static void setUsernameFilter(java.util.Map<java.lang.String,java.lang.Object> properties,
                                     java.lang.String owner)
Set the configuration property to filter by a given user If present, the scenario(s) listened for must have the ConfigureUpdates property sendRawUser or sendThrottledUser set to true.

Parameters:
properties - The Map in which the configuration properties should be updated.
owner - the username to filter for
See Also:
IScenarioService.CONFIG_FILTER_USER


Submit a bug or feature
Copyright (c) 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG