StateServerKeyAppNameToId Method (String, Boolean)

ScaleOut Software NamedCache API
Return the application ID corresponding to the application name appName and optionally register with StateServer for event callbacks for the specified application name.

Namespace:  Soss.Client
Assembly:  soss_svcdotnet (in soss_svcdotnet.dll) Version: (

public static uint AppNameToId(
	string appName,
	bool registerForEvents


Type: SystemString
The name of the application to look up.
Type: SystemBoolean
If true, ensure that this client is registered with the StateServer to receive event notifications (e.g. object expiration notifications) for objects associated with appName. If false, do not alter the existing event notification status: if event notifications were previously enabled, they remain enabled; if event notifications had never been enabled or were previously disabled, they remain disabled. To unregister for event notifications, see UnregisterForEvents(UInt32).

Return Value

Type: UInt32
The ID that StateServer assigns to correspond to appName.

Application names are used to group StateServer keys into distinct namespaces of keys. Identical object IDs refer to distinct objects if the objects are associated with different appNames. An AppID (the value returned from this method), is a handle to the namespace of objects represented by the appName.

Application ID's are managed by the StateServer across all StateServer clients. They survive client restarts.

Application names also form a grouping for StateServer's event notification facility. By setting registerForEvents to true you indicate that the currently executing application wants to be a potential recipient of StateServer event notifications for object with the collection identified by appName. To receive notifications, you must also register a handler for the ObjectExpired event.

See Also