public interface

WebClusterAdmin

com.microstrategy.web.objects.WebClusterAdmin

Class Overview

WebClusterAdmin is an interface from which a user can connect to or disconnect from an Intelligence Server Cluster, monitor the Intelligence Server Clusters the API is currently connecting to, monitor the connection pool used to connect the API and the Intelligence Servers and set the connection pool size to tune the performance.

Summary

Public Methods
abstract WebClusterNode connect(String nodeName, int port, int initialPoolSize, int maxPoolSize)
Connects the Web API to an Intelligence Server cluster.
abstract WebClusterNode connect(String nodeName, int port, int initialPoolSize)
abstract WebClusterNode connect(String nodeName, int port)
abstract void disconnect(String nodeName)
This method is used to disconnect from an Intelligence Server Cluster.
abstract boolean getAutoConnect()
Returns the current autoConnect setting on the XMLAPI.
abstract WebCluster getCluster(String nodeName)
This method returns a WebCluster interface for a given node name.
abstract WebClusterInfos getClusterInfos()
abstract WebClusterNode getClusterNode(String nodeName)
Returns an WebClusterNode interface for a given node name.
abstract WebClusters getClusters()
This method returns a collection of Intelligence Server Clusters representing all clusters that the API is connected to.
abstract boolean getEncryption()
Returns whether the API is set to use encryption when talking to the Intelligence Server.
abstract EncryptionMode getEncryptionMode()
Returns the current EncryptionMode configured.
abstract boolean getKeepAlive()
Returns the keepAlive setting on the XMLAPI.
abstract int getRequestTimeOutMillis()
Returns the number of milliseconds that the Web API will wait for a Server to respond to a request.
abstract int getServerBusyTimeOutMillis()
Returns the number of milliseconds that a request waits for a "free" connection before returning the "Server too busy" error message.
abstract void refreshAllClusters()
Refreshes all clusters that the Web API is connected to.
abstract void refreshCluster(String nodeName)
Refreshes the cluster information that the API returns.
abstract void setAutoConnect(boolean autoConnect)
Sets the autoConnect setting on the XMLAPI.
abstract void setEncryption(boolean encryption)
Sets whether the API should use encryption when talking to the Intelligence Server.
abstract void setEncryptionMode(EncryptionMode mode)
Sets whether the API should use encryption when talking to the Intelligence Server, and the nature of the encryption mode.
abstract void setInitConnectionPoolFailureTolerance(int connectionFailureTolerance)
sets the number of times that the Web API could fail for initialize the connection pool.
abstract void setKeepAlive(boolean keepAlive)
Sets the keepAlive setting on the XMLAPI.
abstract void setRequestTimeOutMillis(int newTimeoutMillis)
Sets the number of milliseconds that the Web API will wait for a Server to respond to a request.
abstract void setServerBusyTimeOutMillis(int newTimeout)
Sets the number of milliseconds that a request waits for a "free" connection before returning the "Server too busy" error message.

Public Methods

public abstract WebClusterNode connect (String nodeName, int port, int initialPoolSize, int maxPoolSize)

Connects the Web API to an Intelligence Server cluster.

A connection is a TCP/IP connection between a Web API and a DSS Server. It is used by the API to pass a request (create session request, execute report request etc.) to and retrieve the response from the DSS Server.

The method establishes the connection pool for a given DSS Server Cluster. The NodeName is the name of a DSS Server in the Cluster. All the servers in the cluster should use the same port number. The InitialPoolSize is for each server in the cluster. If the default values are used, this method will create four connections to each server initially.

Before the Web API can handle any request, a connection pool needs to be established. When a Web request comes in, the API gets a connection from the connection pool to serve the request. Connections in the connection pool are initially in free status. Once used to serve a Web request, they are in busy status. Once a request is completed (session ID returned for create session, messageID returned after executing a report for example), the connection is returned to the connection pool in free status.

When the API detects that the free connections in a connection pool is too low (less than two connections) and the connection pool has not reached the maximum pool size, it dynamically expands the connection pool. In the case when the connection pool reaches its maximum pool size, if a Web request comes in when all connections are busy, the request waits for a free connection. The time to wait is configurable through this admin interface. When the waiting time is up and there is still no free connections, a Server too busy error is returned. Through this admin interface, an administrator can monitor the status of the connection pool. When all the connections in the connection pool are always stay in busy status, that means a lot of the Web users receives Server too busy messages. This is when the administrator needs to either adjust the max-wait time out setting or increase the connection pool size.

The API also balances the load among cluster nodes. The load is currently measured as the number of logins to a server.

Parameters
nodeName The name of the cluster node(Intelligence Server name).
port The port number that the Intelligence Server is listening on. [Default=0]
initialPoolSize The initial size of the connection pool. [Default=4]
maxPoolSize The maximum size of the connection pool. [Default=100]
Returns
Throws
WebObjectsException Signals an error condition while connecting to an Intelligence Server cluster.

public abstract WebClusterNode connect (String nodeName, int port, int initialPoolSize)

Parameters
nodeName The name of the cluster node(Intelligence Server name).
port The port number that the Intelligence Server is listening on. [Default=0]
initialPoolSize The initial size of the connection pool. [Default=4]
Returns
Throws
WebObjectsException Signals an error condition while connecting to an Intelligence Server cluster.

public abstract WebClusterNode connect (String nodeName, int port)

Parameters
nodeName The name of the cluster node(Intelligence Server name).
port The port number that the Intelligence Server is listening on. [Default=0]
Returns
Throws
WebObjectsException Signals an error condition while connecting to an Intelligence Server cluster.

public abstract void disconnect (String nodeName)

This method is used to disconnect from an Intelligence Server Cluster.

This method will disconnect the API from a DSS Server Cluster. The nodeName is the name of a server in the cluster. The "busy" connections will not be disconnected and destroyed until they are returned to the "free" status. This means that this method will disconnect the connections gracefully. All ongoing requests will have a chance to be completed.

Parameters
nodeName The name of the Intelligence Server.

public abstract boolean getAutoConnect ()

Returns the current autoConnect setting on the XMLAPI. This setting is a global flag; it will affect all threads contacting the Intelligence Server.

Returns
  • The current autoConnect setting.

public abstract WebCluster getCluster (String nodeName)

This method returns a WebCluster interface for a given node name. The returned WebCluster interface is a collection of Cluster Nodes(Intelligence Servers) that the given cluster node belongs to.

The cluster information returned by this method may not be the latest. To get the latest cluster membership or the load for each cluster node, you need to call RefreshCluster(nodeName) first.

Parameters
nodeName The name of an Intelligence Server that the API is currently connected to.
Returns
  • A collection of WebClusterNode. It will return a null object if the node was not found.
Throws
WebObjectsException Signals an error condition while getting the cluster.

public abstract WebClusterInfos getClusterInfos ()

public abstract WebClusterNode getClusterNode (String nodeName)

Returns an WebClusterNode interface for a given node name. The returned WebClusterNode interface contains the properties of the cluster node. Through this interface, a user can get the node name, load, connection pool size, the number of busy connections and the number of free connections. The connection pool size can also be set through this interface.

The load of the cluster node returned by this method may not be the latest. To get the latest load for this cluster node, you need to call RefreshCluster(NodeName) first.

Parameters
nodeName The name of the Intelligence Server. The API must be connected to this server.
Returns
  • The interface to the Intelligence Server. It will return null if the node was not found.
Throws
WebObjectsException Signals an error condition while getting the cluster node.

public abstract WebClusters getClusters ()

This method returns a collection of Intelligence Server Clusters representing all clusters that the API is connected to.

The cluster information returned by this method may not be the latest. To get the latest cluster membership or the load for each cluster node, you need to call RefreshCluster first.

Returns
  • The cluster collection.
Throws
WebObjectsException Signals an error condition while getting the clusters.

public abstract boolean getEncryption ()

Returns whether the API is set to use encryption when talking to the Intelligence Server.

Returns
See Also
  • {@link #setEncryption(boolean)}
  • {@link #setEncryptionMode(EncryptionMode)}

public abstract EncryptionMode getEncryptionMode ()

Returns the current EncryptionMode configured.

public abstract boolean getKeepAlive ()

Returns the keepAlive setting on the XMLAPI. By default, this is false. When keep alive on this interface is true, all connections between web server and Intelligence Servers will be kept alive. When keep alive on this interface is false, the keep alive property of a particular connection will be determined by the keep alive setting on WebClusterNode interface.

Returns
  • The current keepAlive setting.

public abstract int getRequestTimeOutMillis ()

Returns the number of milliseconds that the Web API will wait for a Server to respond to a request.

Returns
  • The timeout, in milliseconds, for requests to the Intelligence Server.

public abstract int getServerBusyTimeOutMillis ()

Returns the number of milliseconds that a request waits for a "free" connection before returning the "Server too busy" error message.

Returns
  • The timeout, in milliseconds, that the API will wait for a free connection.

public abstract void refreshAllClusters ()

Refreshes all clusters that the Web API is connected to.

Throws
WebObjectsException Signals an error condition while refreshing the cluster.

public abstract void refreshCluster (String nodeName)

Refreshes the cluster information that the API returns. It only refreshes the cluster that the given node belongs to. This method should be called if you want to get the latest cluster membership information or the load for each cluster node.

Parameters
nodeName The name of a node in the cluster to refresh.
Throws
WebObjectsException Signals an error condition while refreshing the cluster.

public abstract void setAutoConnect (boolean autoConnect)

Sets the autoConnect setting on the XMLAPI. By default, this is true; if it is false, then the XMLAPI will never connect to a server unless the connect method is called explicitly. This setting affects the whole web application - it does not have to be set on a per-server basis.

Parameters
autoConnect The new value to use for the auto-reconnect setting.

public abstract void setEncryption (boolean encryption)

Sets whether the API should use encryption when talking to the Intelligence Server. If set to true, we will configure setEncryptionMode(EncryptionMode) to use AES. It is recommended to use setEncryptionMode(EncryptionMode) instead of this method.

Parameters
encryption True if encryption should be used, false otherwise.
See Also
  • {@link #setEncryptionMode(EncryptionMode)}

public abstract void setEncryptionMode (EncryptionMode mode)

Sets whether the API should use encryption when talking to the Intelligence Server, and the nature of the encryption mode. Some encryption modes like SSL may require some additional configuration - also see EncryptionModeConfigurationSSL.

public abstract void setInitConnectionPoolFailureTolerance (int connectionFailureTolerance)

sets the number of times that the Web API could fail for initialize the connection pool.

public abstract void setKeepAlive (boolean keepAlive)

Sets the keepAlive setting on the XMLAPI. By default, this is false. When keep alive on this interface is true, all connections between web server and Intelligence Servers will be kept alive. When keep alive on this interface is false, the keep alive property of a particular connection will be determined by the keep alive setting on WebClusterNode interface.

Parameters
keepAlive The new value to use for the keep alive setting.

public abstract void setRequestTimeOutMillis (int newTimeoutMillis)

Sets the number of milliseconds that the Web API will wait for a Server to respond to a request.

Parameters
newTimeoutMillis The timeout, in milliseconds, for requests to the Intelligence Server.

public abstract void setServerBusyTimeOutMillis (int newTimeout)

Sets the number of milliseconds that a request waits for a "free" connection before returning the "Server too busy" error message.

Parameters
newTimeout The new value for this timeout.