Hitachi

In-Memory Data Grid Hitachi Elastic Application Data Store


18.2.2 FunctionContext interface

Organization of this subsection

(1) Description

This interface passes to the Function interface information needed to execute a user function.

One instance of the FunctionContext interface is created per request.

(2) Interface name

com.hitachi.software.xeads.func.FunctionContext

(3) List of methods

The following table lists and describes the methods provided by the FunctionContext interface:

Method name

Description

[Deprecated] getServerName()

[Deprecated] Acquires the name of the EADS server (management directory name) that is to execute the user function.

[Deprecated] getCacheName()

[Deprecated] Acquires the name of cache used to execute the user function.

[Deprecated] getGroupName()

[Deprecated] Acquires the name of the group specified on the EADS client when the user function is executed.

[Deprecated] getArgument()

[Deprecated] Acquires the argument specified on the EADS client when the user function is executed.

getStore()

Acquires an instance for manipulating data in the cache that was used for calling the user function.

getStore() (cache name specification)

Acquires an instance for manipulating data in the cache with a specified cache name.

getLogger()

Acquires a logger for outputting user logs.

getClientInfo()

Acquires information about the EADS client that executed the user function.

getInitConfig()

Acquires information about the function properties (information that was used to initialize the user function).

getServerInfo()

Acquires information about the EADS server that executed the user function.

getClusterInfo()

Acquires information about the cluster.

(4) [Deprecated] getServerName()

Reference note

This method is deprecated. Instead, use the getName() of the ServerInfo interface.

(a) Description

This method acquires the name of the EADS server (management directory name) that is to execute the user function.

(b) Format

public String getServerName()

(c) Return value

This method returns the name of the EADS server that executes the user function (the management directory name).

(5) [Deprecated] getCacheName()

Reference note

This method is deprecated. Instead, use the getCacheName() of the ClientInfo interface.

(a) Description

This method acquires the name of the cache used to execute the user function.

(b) Format

public String getCacheName()

(c) Return value

This method returns the name of the cache used to execute the user function.

If this method is called within init() or destroy() of the Function interface, null is returned.

(6) [Deprecated] getGroupName()

Reference note

This method is deprecated. Instead, use the getKeyOrGroupName() of the ClientInfo interface.

(a) Description

This method acquires the name of the group specified on the EADS client when the user function is executed.

(b) Format

public String getGroupName()

(c) Return value

This method returns the group name specified on the EADS client when the user function is executed.

It returns null in the following cases:

  • No group was specified on the EADS client.

  • This method was called within init() or destroy() of the Function interface.

(7) [Deprecated] getArgument()

Reference note

This method is deprecated. Instead, use the getFunctionArgument() of the ClientInfo interface.

(a) Description

This method acquires the argument specified on the EADS client when the user function is executed.

(b) Format

public Object getArgument()

(c) Return value

This method returns the argument specified on the EADS client when the user function is executed.

It returns null in the following cases:

  • null was specified in the argument on the EADS client.

  • This method was called within init() or destroy() of the Function interface.

(8) getStore()

(a) Description

This method acquires an instance for manipulating data in the cache that was used for calling the user function.

(b) Format

public Store getStore()

(c) Return value

This method returns an instance for manipulating data in the cache that was used for calling the user function.

For details about the instances for manipulating data, see 18.2.8 Store interface.

If this method is called within init() or destroy() of the Function interface, null is returned.

(9) getStore() (cache name specification)

(a) Description

This method acquires an instance for manipulating data in the cache with a specified cache name.

(b) Format

public Store getStore(String cacheName)
               throws EADsStoreException

(c) Parameters

cacheName

Specifies the name of the cache subject to processing.

For details about the data that can be specified, see 15.2.2(4) Data types that can be specified as cache names.

If the name of a cache that has not been created is specified, an error results.

(d) Return value

This method returns an instance for manipulating data in the cache with the specified cache name.

For details about the instances for manipulating data, see 18.2.8 Store interface.

If this method is called within init() or destroy() of the Function interface, null is returned.

(e) Exceptions

  • UserOperationException (illegal user operation)

  • EADsStoreException (unexpected error)

(10) getLogger()

(a) Description

This method acquires a logger for outputting user logs.

(b) Format

public UserLogger getLogger()

(c) Return value

This method returns a logger that outputs user logs.

For details about the interface used for outputting user logs, see 18.2.12 UserLogger interface.

(11) getClientInfo()

(a) Description

This method acquires information about the EADS client that executed the user function.

(b) Format

public ClientInfo getClientInfo()

(c) Return value

This method returns information about the EADS client that executed the user function. For details about the EADS client information, see 18.2.4 ClientInfo interface.

If this method is called within init() or destroy() of the Function interface, null is returned.

(12) getInitConfig()

(a) Description

This method acquires information about the function properties that were used to initialize the user function.

(b) Format

public InitConfig getInitConfig()

(c) Return value

This method returns information about the function properties that were used to initialize the user function.

For details about the function properties that were used to initialize the user function, see 18.2.3 InitConfig interface.

(13) getServerInfo()

(a) Description

This method acquires information about the EADS server that executed the user function.

(b) Format

public ServerInfo getServerInfo()

(c) Return value

This method returns information about the EADS server that executed the user function.

For information about EADS servers, see 18.2.5 ServerInfo interface.

(14) getClusterInfo()

(a) Description

This method acquires information about the cluster.

(b) Format

public ClusterInfo getClusterInfo()

(c) Return value

This method returns information about the cluster.

For information about the cluster, see 18.2.6 ClusterInfo interface.

If this method is called within init() or destroy() of the Function interface, null is returned.