com.sas.util.connection
Class ConnectionFactoryBean

com.sas.util.connection.ConnectionFactoryBean

public class ConnectionFactoryBean

The ConnectionFactoryBean class is a Java bean which wraps ConnectionFactory classes in the com.sas.services.connection package. It is a wrapper which provides for an easier way to create and use a ConnectionFactory, but it is tailored for use with a customizer, the webAF IDE and accompanying BeanStateInfo.

The bean allows for a more straightforward way to define the complex sets of properties used in the construction of a factory. Once the factory has been created, connections (workspaces) can be requested from it through the requestWorkspace() method. These workspaces are wrapped in a WorkspaceBean class which provides a way for a workspace to be manipulated in an IDE.

The original design for this bean included the element of having the webAF IDE authomatically generate the configuration code for you when you drop the bean in your project and customize it. However, you can use this class and code similar to that shown below in your own application if desired. Note that in such a case, it may be more desireable to use the ConnectionFactory API directly, rather than going through this bean in a manual fashion. The following code illustrates the procedure for configuring and using the bean:

 // Create the ConnectionFactory bean
 connectionFactoryBean1 = new com.sas.util.connection.ConnectionFactoryBean(  );
 
 // Set the type of configuration to com.sas.util.connection.ConnectionFactoryBean.CONFIG_TYPE_MANUAL
 connectionFactoryBean1.setConfigType( 0 );
 
 // Set the type of server to com.sas.services.connection.BridgeServer.CLSID_SAS
 connectionFactoryBean1.setServerType( "440196d4-90f0-11d0-9f41-00a024bb830c" );
 connectionFactoryBean1.setWaitTimeOnBusyFactory( -1 );
 connectionFactoryBean1.setInitialWorkspaceCount( 0 );
 
 // Identify the user credentials to use when requesting workspaces via the 
 // requestWorkspace() method.
 connectionFactoryBean1.setRequestUsername( "userUsername" );
 connectionFactoryBean1.setRequestPassword( "userPassword" );
 
 // Add a factory account and set associated properties
 connectionFactoryBean1.addPuddleLogin( "factoryUsername", "factoryPassword" );
 connectionFactoryBean1.setEncryption( "none",null,null );
 connectionFactoryBean1.setPoolMinSize( -1 );
 connectionFactoryBean1.setPoolMinAvail( -1 );
 connectionFactoryBean1.setClusterType( 1 );
 connectionFactoryBean1.addServer( "localhost",5310,10,0,-1 );
 
 // Add a user with the specified credentials.
 connectionFactoryBean1.addUser( "userUsername","userPassword" );
 
 // Get a workspace bean from the ConnectionFactory
 com.sas.util.connection.WorkspaceBean workspaceBean1 = connectionFactoryBean1.requestWorkspace();
 


Nested Class Summary
protected  class ConnectionFactoryBean.BeanPuddle
          The internal BeanPuddle class holds the set of properties for a puddle.
 
Field Summary
protected  com.sas.services.information.metadata.LogicalServerInterface bipServer
          A handle to a BIP server for use when configType is set to CONFIG_TYPE_PLATFORM
static int CONFIG_TYPE_MANUAL
          Defines a ConnectionFactory configuration that is defined manually by the user
static int CONFIG_TYPE_PLATFORM
          Defines a ConnectionFactory configuration that is defined in a BI Platform repository
protected  int configType
          The currently assigned configuration type
protected  boolean designTime
          A flag representing whether or not this object is in design-time mode in the webAF IDE
protected  com.sas.services.connection.ConnectionFactoryInterface factory
          The actual factory itself
protected  com.sas.services.connection.ConnectionFactoryAdminInterface factoryAdmin
          An admin interface on the factory
protected  com.sas.services.connection.ConnectionFactoryConfiguration factoryConfig
          The factory configuration
protected  int initialWorkspaceCount
          The number of workspaces to obtain when the bean is instantiated at run-time
protected  ConnectionFactoryBean.BeanPuddle puddle
          An internal BeanPuddle object that represents the current puddle as a user is configuring the bean
protected  java.util.Vector puddles
          The set of all puddles for the factory
static java.lang.String RB_KEY
           
protected  java.lang.String requestPassword
          The password to use when requesting workspaces via the requestWorkspace method
protected  java.lang.String requestUsername
          The username to use when requesting workspaces via the requestWorkspace method
protected  java.lang.String serverType
          The type of server for which this factory will provide connections
protected  int waitTimeOnBusyFactory
          The time to wait (in milliseconds) for a connection when the factory has been maxed-out
protected  java.util.Vector workspaceBeans
          The set of all workspace beans generated by the factory
 
Constructor Summary
ConnectionFactoryBean()
          Default constructor.
 
Method Summary
 void addPuddleLogin(com.sas.services.connection.PasswordCredential login)
          Adds a login to a puddle for use by the factory.
 void addPuddleLogin(java.lang.String username, java.lang.String password)
          Adds a login to a puddle for use by the factory.
 void addServer(java.lang.String hostname, int port)
          Associates a server with the current puddle login in the bean.
 void addServer(java.lang.String hostname, int port, int maxClients, int reactivationLimit, int shutdownAfterMinutes)
          Associates a server with the current puddle login in the bean.
 void addServer(java.lang.String hostname, int port, int maxClients, int reactivationLimit, int shutdownAfterMinutes, java.lang.String serverName)
          Associates a server with the current puddle login in the bean.
 void addUser(java.lang.String username, java.lang.String password)
          Associates a user login with the current puddle in the bean.
 void addWorkspaceBean(WorkspaceBean workspaceBean)
          Adds a workspace bean to this bean.
 void clearPuddleLogins()
          Removes any puddle logins that may have been previously defined for the factory.
protected  java.lang.String DecodePassword(java.lang.String password)
          Decodes the specified password.
protected  java.lang.String EncodePassword(java.lang.String password)
          Encodes the specified password.
 int getClusterType(int puddle)
          Returns the type of clustering behavior defined for the specified puddle.
 int getConfigType()
          Returns the type of configuration defined for this factory.
 java.lang.String getEncryptionAlgorithms(int puddle)
          Returns the encryption algorithms for the specified puddle.
 java.lang.String getEncryptionContent(int puddle)
          Returns the encryption content for the specified puddle.
 java.lang.String getEncryptionPolicy(int puddle)
          Returns the encryption policy for the specified puddle.
static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
          Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about this ConnectionFactoryBean.
protected  void getFactory()
          Creates a set of puddles from the defined logins and servers and and then gets a ConnectionFactory.
 int getInitialWorkspaceCount()
          Returns the number of initial workspace beans to add to the IDE project.
 java.util.logging.Logger getLogger()
          Returns an instance of java.util.logging.Logger which can be used to view detailed information about the underlying ConnectionFactory.
 int getPoolMinAvail(int puddle)
          Returns the minimum number of idle connections for the specified puddle that the factory must maintain at all times.
 int getPoolMinSize(int puddle)
          Returns the minimum number of connections (idle or in-use) for the specified puddle that the factory must maintain at all times.
 com.sas.services.connection.PasswordCredential[] getPuddleLogins()
          Returns the set of PasswordCredential objects defined in the bean via the addPuddleLogin method.
 com.sas.services.connection.Puddle[] getPuddles()
          Returns the set of all puddles defined for the factory.
 java.lang.String getRequestPassword()
          Returns the password used when requesting workspaces via the requestWorkspace method.
 java.lang.String getRequestUsername()
          Returns the username used when requesting workspaces via the requestWorkspace method.
 java.util.Vector getServers(com.sas.services.connection.PasswordCredential login)
          Returns the set of servers associated with a given puddle login.
 java.lang.String getServerType()
          Returns the type of SAS server that this factory will provide.
 java.util.Vector getUsers(com.sas.services.connection.PasswordCredential login)
          Returns the set of users associated with a given puddle login.
 int getWaitTimeOnBusyFactory()
          Gets the amount of time to wait, in milliseconds, for a connection when a request is made to the factory but all available connections are currently in use.
 java.util.Vector getWorkspaceBeans()
          Returns the set of workspace beans associated with this bean.
 com.sas.services.connection.ConnectionInterface requestConnection()
          Obtains a connection from the ConnectionFactory, which can then be used to obtain an IOM workspace and return it back to the factory.
 WorkspaceBean requestWorkspace()
          Obtains an IOM workspace from the ConnectionFactory, stored in a wrapper bean.
 WorkspaceBean requestWorkspace(com.sas.services.connection.ConnectionInterface connection)
          Obtains an IOM workspace from the ConnectionFactory, stored in a wrapper bean.
 void resetFactory()
          Resets a failed factory that may have suffered a fatal error.
 void setClusterType(int type)
          Sets the type of clustering behavior to be used for the current puddle.
 void setClusterType(int puddleIx, int type)
          Sets the type of clustering behavior to be used for the current puddle.
 void setConfigDataBIP(com.sas.services.information.metadata.LogicalServerInterface bipServer)
          Sets the BI Platform-specific data for a factory configured to use the platform.
 void setConfigType(int configType)
          Sets the type of configuration to be used for this factory.
 void setDesignTime(boolean value)
          Sets whether or not the bean is in design-time mode.
 void setEncryption(int puddle, java.lang.String policy, java.lang.String content, java.lang.String algorithms)
          Sets the type of data encryption to be used in communications for the current puddle.
 void setEncryption(java.lang.String policy, java.lang.String content, java.lang.String algorithms)
          Sets the type of data encryption to be used in communications for the current puddle.
 void setInitialWorkspaceCount(int value)
          Sets the number of initial workspace beans to add to the IDE project.
 void setPoolMinAvail(int value)
          Sets the minimum number of idle connections for the current puddle that the factory must maintain at all times.
 void setPoolMinAvail(int puddle, int value)
          Sets the minimum number of idle connections for the current puddle that the factory must maintain at all times.
 void setPoolMinSize(int size)
          Sets the minimum number of connections (idle or in-use) for the current puddle that the factory must maintain at all times.
 void setPoolMinSize(int puddle, int size)
          Sets the minimum number of connections (idle or in-use) for the current puddle that the factory must maintain at all times.
 void setRequestPassword(java.lang.String password)
          The password to use when requesting workspaces via the requestWorkspace method.
 void setRequestUsername(java.lang.String username)
          The username to use when requesting workspaces via the requestWorkspace method.
 void setServerType(java.lang.String serverType)
          Sets the type of SAS server that this factory will provide.
 void setWaitTimeOnBusyFactory(int waitTimeOnFullFactory)
          Sets the amount of time to wait, in milliseconds, for a connection when a request is made to the factory but all available connections are currently in use.
 

Field Detail

RB_KEY

public static java.lang.String RB_KEY

designTime

protected boolean designTime
A flag representing whether or not this object is in design-time mode in the webAF IDE


CONFIG_TYPE_MANUAL

public static int CONFIG_TYPE_MANUAL
Defines a ConnectionFactory configuration that is defined manually by the user


CONFIG_TYPE_PLATFORM

public static int CONFIG_TYPE_PLATFORM
Defines a ConnectionFactory configuration that is defined in a BI Platform repository


configType

protected int configType
The currently assigned configuration type


bipServer

protected com.sas.services.information.metadata.LogicalServerInterface bipServer
A handle to a BIP server for use when configType is set to CONFIG_TYPE_PLATFORM


serverType

protected java.lang.String serverType
The type of server for which this factory will provide connections


waitTimeOnBusyFactory

protected int waitTimeOnBusyFactory
The time to wait (in milliseconds) for a connection when the factory has been maxed-out


initialWorkspaceCount

protected int initialWorkspaceCount
The number of workspaces to obtain when the bean is instantiated at run-time


requestUsername

protected java.lang.String requestUsername
The username to use when requesting workspaces via the requestWorkspace method


requestPassword

protected java.lang.String requestPassword
The password to use when requesting workspaces via the requestWorkspace method


puddle

protected ConnectionFactoryBean.BeanPuddle puddle
An internal BeanPuddle object that represents the current puddle as a user is configuring the bean


puddles

protected java.util.Vector puddles
The set of all puddles for the factory


workspaceBeans

protected java.util.Vector workspaceBeans
The set of all workspace beans generated by the factory


factoryConfig

protected com.sas.services.connection.ConnectionFactoryConfiguration factoryConfig
The factory configuration


factory

protected com.sas.services.connection.ConnectionFactoryInterface factory
The actual factory itself


factoryAdmin

protected com.sas.services.connection.ConnectionFactoryAdminInterface factoryAdmin
An admin interface on the factory

Constructor Detail

ConnectionFactoryBean

public ConnectionFactoryBean()
Default constructor.

Method Detail

getExtendedBeanInfo

public static com.sas.beans.ExtendedBeanInfo getExtendedBeanInfo()
Returns information used by the com.sas.beans.Introspector to augment the automatically introspected information about this ConnectionFactoryBean.

Returns:
the ExtendedBeanInfo for this class

setDesignTime

public void setDesignTime(boolean value)
Sets whether or not the bean is in design-time mode. This method should rarely be called directly by the developer. It is here merely to provide a mechanism for setting this property from within a complex environment where the design time state isn't properly set.

Parameters:
value - The boolean value to set.

getConfigType

public int getConfigType()
Returns the type of configuration defined for this factory.

Returns:
The type of configuration for this factory.
See Also:
setConfigType(int)

setConfigType

public void setConfigType(int configType)
Sets the type of configuration to be used for this factory.

Parameters:
configType - The type of configuration for the factory. Valid values are: com.sas.util.connection.ConnectionFactoryBean.CONFIG_TYPE_MANUAL (default) com.sas.util.connection.ConnectionFactoryBean.CONFIG_TYPE_PLATFORM
See Also:
getConfigType()

setConfigDataBIP

public void setConfigDataBIP(com.sas.services.information.metadata.LogicalServerInterface bipServer)
Sets the BI Platform-specific data for a factory configured to use the platform. This data only applies when the configType is set to CONFIG_TYPE_PLATFORM.

Parameters:
bipServer - An encapsulation of information about a server or group of servers in a BIP metadata repository.

getServerType

public java.lang.String getServerType()
Returns the type of SAS server that this factory will provide.

Returns:
The type of server.
See Also:
setServerType(String)

setServerType

public void setServerType(java.lang.String serverType)
Sets the type of SAS server that this factory will provide. Allowable values are defined in com.sas.services.connection.Server.

Parameters:
serverType - The type of server.
See Also:
getServerType()

getWaitTimeOnBusyFactory

public int getWaitTimeOnBusyFactory()
Gets the amount of time to wait, in milliseconds, for a connection when a request is made to the factory but all available connections are currently in use.

Returns:
The amount of time to wait.
See Also:
setWaitTimeOnBusyFactory(int)

setWaitTimeOnBusyFactory

public void setWaitTimeOnBusyFactory(int waitTimeOnFullFactory)
Sets the amount of time to wait, in milliseconds, for a connection when a request is made to the factory but all available connections are currently in use.

Parameters:
waitTimeOnFullFactory - The amount of time to wait.
See Also:
getWaitTimeOnBusyFactory()

getInitialWorkspaceCount

public int getInitialWorkspaceCount()
Returns the number of initial workspace beans to add to the IDE project.

Returns:
The number of initial workspace beans to add to the IDE project.
See Also:
setInitialWorkspaceCount(int)

setInitialWorkspaceCount

public void setInitialWorkspaceCount(int value)
Sets the number of initial workspace beans to add to the IDE project.

Parameters:
value - The number of initial workspace beans to add to the IDE project.
See Also:
getInitialWorkspaceCount()

setRequestUsername

public void setRequestUsername(java.lang.String username)
The username to use when requesting workspaces via the requestWorkspace method.

Parameters:
username - The username value.

getRequestUsername

public java.lang.String getRequestUsername()
Returns the username used when requesting workspaces via the requestWorkspace method.

Returns:
The username value.
See Also:
setRequestUsername(String)

setRequestPassword

public void setRequestPassword(java.lang.String password)
The password to use when requesting workspaces via the requestWorkspace method.

Parameters:
password - The password value. This string may be encoded if desired.

getRequestPassword

public java.lang.String getRequestPassword()
Returns the password used when requesting workspaces via the requestWorkspace method.

Returns:
The password value. This string value will be encoded.
See Also:
setRequestUsername(String)

getPuddleLogins

public com.sas.services.connection.PasswordCredential[] getPuddleLogins()
Returns the set of PasswordCredential objects defined in the bean via the addPuddleLogin method.

Returns:
the set of PasswordCredential objects.
See Also:
addPuddleLogin(PasswordCredential)

addPuddleLogin

public void addPuddleLogin(com.sas.services.connection.PasswordCredential login)
Adds a login to a puddle for use by the factory. The proper sequence of events is to add a login and then add one or more servers that are associated with this login.

Parameters:
username - The username required to access a set of servers.
password - The password required to access a set of servers.
See Also:
addServer(String, int), addServer(String, int, int, int, int)

addPuddleLogin

public void addPuddleLogin(java.lang.String username,
                           java.lang.String password)
Adds a login to a puddle for use by the factory. The proper sequence of events is to add a login and then add one or more servers that are associated with this login.

Parameters:
username - The username required to access a set of servers.
password - The password required to access a set of servers. This string may be encoded if desired.
See Also:
addServer(String, int), addServer(String, int, int, int, int)

clearPuddleLogins

public void clearPuddleLogins()
Removes any puddle logins that may have been previously defined for the factory.

See Also:
addPuddleLogin(PasswordCredential), addPuddleLogin(String, String)

getPuddles

public com.sas.services.connection.Puddle[] getPuddles()
Returns the set of all puddles defined for the factory.

Returns:
An array of Puddle objects.

getEncryptionPolicy

public java.lang.String getEncryptionPolicy(int puddle)
Returns the encryption policy for the specified puddle.

Parameters:
puddle - The index of the puddle of interest.
Returns:
The encryption policy.
See Also:
setEncryption(String, String, String)

getEncryptionContent

public java.lang.String getEncryptionContent(int puddle)
Returns the encryption content for the specified puddle.

Parameters:
puddle - The index of the puddle of interest.
Returns:
The encryption content.
See Also:
setEncryption(String, String, String)

getEncryptionAlgorithms

public java.lang.String getEncryptionAlgorithms(int puddle)
Returns the encryption algorithms for the specified puddle.

Parameters:
puddle - The index of the puddle of interest.
Returns:
The encryption algorithms.
See Also:
setEncryption(String, String, String)

setEncryption

public void setEncryption(java.lang.String policy,
                          java.lang.String content,
                          java.lang.String algorithms)
Sets the type of data encryption to be used in communications for the current puddle.

Parameters:
policy - Valid values are as follows: none - no communication with the server will be encrypted. If the server requires encryption, the connection will fail. This is the default value. If this is the value of this attribute, then the values for encryptionContent and encryptionAlgorithms will be ignored. optional - communication with the server will be encrypted if the server supports an encryption algorithm supported by the client. Otherwise no communication with the server will be encrypted. required - communication with the server will be encrypted if the server supports an encryption algorithm supported by the client. Otherwise the connection will fail.
content - Valid values are as follows: all - all communication is encrypted. This is the default. authentication - only user name and password information is encrypted.
algorithms - Valid values are sasproprietary, rc2, rc4, des, and tripledes.

setEncryption

public void setEncryption(int puddle,
                          java.lang.String policy,
                          java.lang.String content,
                          java.lang.String algorithms)
Sets the type of data encryption to be used in communications for the current puddle.

Parameters:
puddle - The index of the puddle of interest.
policy - Valid values are as follows: none - no communication with the server will be encrypted. If the server requires encryption, the connection will fail. This is the default value. If this is the value of this attribute, then the values for encryptionContent and encryptionAlgorithms will be ignored. optional - communication with the server will be encrypted if the server supports an encryption algorithm supported by the client. Otherwise no communication with the server will be encrypted. required - communication with the server will be encrypted if the server supports an encryption algorithm supported by the client. Otherwise the connection will fail.
content - Valid values are as follows: all - all communication is encrypted. This is the default. authentication - only user name and password information is encrypted.
algorithms - Valid values are sasproprietary, rc2, rc4, des, and tripledes.

getClusterType

public int getClusterType(int puddle)
Returns the type of clustering behavior defined for the specified puddle.

Parameters:
puddle - The index of the puddle of interest.
Returns:
The type of cluster.
See Also:
Cluster

setClusterType

public void setClusterType(int type)
Sets the type of clustering behavior to be used for the current puddle. By default, no clustering behavior is used.

Parameters:
type - The type of cluster to use. Valid values are as follows: com.sas.services.connection.Cluster.TYPE_FAILOVER com.sas.services.connection.Cluster.TYPE_LOAD_BALANCING
See Also:
Cluster

setClusterType

public void setClusterType(int puddleIx,
                           int type)
Sets the type of clustering behavior to be used for the current puddle. By default, no clustering behavior is used.

Parameters:
puddle - The index of the puddle of interest.
type - The type of cluster to use. Valid values are as follows: com.sas.services.connection.Cluster.TYPE_FAILOVER com.sas.services.connection.Cluster.TYPE_LOAD_BALANCING
See Also:
Cluster

getServers

public java.util.Vector getServers(com.sas.services.connection.PasswordCredential login)
Returns the set of servers associated with a given puddle login.

Parameters:
login - The PasswordCredential added to the bean via the addLogin method.
Returns:
The set of servers associated with a given login.

addServer

public void addServer(java.lang.String hostname,
                      int port)
Associates a server with the current puddle login in the bean. The proper sequence is to add a puddle login and then add one or more servers that are associated with the login.

Parameters:
hostname - The hostname of the server.
port - The port number of the server.
See Also:
addServer(String, int, int, int, int)

addServer

public void addServer(java.lang.String hostname,
                      int port,
                      int maxClients,
                      int reactivationLimit,
                      int shutdownAfterMinutes)
Associates a server with the current puddle login in the bean. The proper sequence is to add a puddle login and then add one or more servers that are associated with the login.

Parameters:
hostname - The hostname of the server.
port - The port number of the server.
maxClients - The maximum number of clients allowed to use this server.
reactivationLimit - The maximum number of clients that will be allowed to use the connection before it is destroyed (and reconnected if necessary). The value must be greater than or equal to 0. If it is equal to 0, then any number of clients will allowed to use the connection before it is destroyed.
shutdownAfterMinutes - The number of minutes the connection will be allowed to exist with no clients before it is destroyed. -1 means the connection will be allowed to exist with no clients until connection factory shutdown.

addServer

public void addServer(java.lang.String hostname,
                      int port,
                      int maxClients,
                      int reactivationLimit,
                      int shutdownAfterMinutes,
                      java.lang.String serverName)
Associates a server with the current puddle login in the bean. The proper sequence is to add a puddle login and then add one or more servers that are associated with the login.

Parameters:
hostname - The hostname of the server.
port - The port number of the server.
maxClients - The maximum number of clients allowed to use this server.
reactivationLimit - The maximum number of clients that will be allowed to use the connection before it is destroyed (and reconnected if necessary). The value must be greater than or equal to 0. If it is equal to 0, then any number of clients will allowed to use the connection before it is destroyed.
shutdownAfterMinutes - The number of minutes the connection will be allowed to exist with no clients before it is destroyed. -1 means the connection will be allowed to exist with no clients until connection factory shutdown.
serverName - Specifies the serverName to use when multiple servers are available

getUsers

public java.util.Vector getUsers(com.sas.services.connection.PasswordCredential login)
Returns the set of users associated with a given puddle login.

Parameters:
login - The PasswordCredential added to the bean via the addLogin method.
Returns:
The set of authorized users associated with a given login.

addUser

public void addUser(java.lang.String username,
                    java.lang.String password)
Associates a user login with the current puddle in the bean. This user will be able to request a connection from the factory, and the connection will come from the currently defined puddle.

Parameters:
username - The username of the user to add.
password - The password of the user to add. This string may be encoded if desired.

getWorkspaceBeans

public java.util.Vector getWorkspaceBeans()
Returns the set of workspace beans associated with this bean.

Returns:
The set of workspace beans associated with this bean.

addWorkspaceBean

public void addWorkspaceBean(WorkspaceBean workspaceBean)
Adds a workspace bean to this bean.

Parameters:
workspaceBean - The workspace bean to add.

requestConnection

public com.sas.services.connection.ConnectionInterface requestConnection()
                                                                  throws com.sas.services.connection.ConnectionFactoryException
Obtains a connection from the ConnectionFactory, which can then be used to obtain an IOM workspace and return it back to the factory.

Throws:
com.sas.services.connection.ConnectionFactoryException

requestWorkspace

public WorkspaceBean requestWorkspace(com.sas.services.connection.ConnectionInterface connection)
                               throws com.sas.services.connection.ConnectionFactoryException
Obtains an IOM workspace from the ConnectionFactory, stored in a wrapper bean.

Parameters:
connection - The connection obtained from the requestConnection() method call.
Returns:
The WorkspaceBean containing the IOM workspace.
Throws:
com.sas.services.connection.ConnectionFactoryException

requestWorkspace

public WorkspaceBean requestWorkspace()
                               throws com.sas.services.connection.ConnectionFactoryException
Obtains an IOM workspace from the ConnectionFactory, stored in a wrapper bean.

This is a convenience method which is equivalent to the following:

 ConnectionInterface connection = requestConnection();
 return requestWorkspace(connection);
 

Returns:
The WorkspaceBean containing the IOM workspace.
Throws:
com.sas.services.connection.ConnectionFactoryException

getPoolMinSize

public int getPoolMinSize(int puddle)
Returns the minimum number of connections (idle or in-use) for the specified puddle that the factory must maintain at all times.

Parameters:
puddle - The index of the puddle of interest.
Returns:
The minimum number of connections.
See Also:
setPoolMinSize(int)

setPoolMinSize

public void setPoolMinSize(int size)
Sets the minimum number of connections (idle or in-use) for the current puddle that the factory must maintain at all times.

Parameters:
size - The minimum number of connections.
See Also:
getPoolMinSize(int)

setPoolMinSize

public void setPoolMinSize(int puddle,
                           int size)
Sets the minimum number of connections (idle or in-use) for the current puddle that the factory must maintain at all times.

Parameters:
puddle - The index of the puddle of interest.
size - The minimum number of connections.
See Also:
getPoolMinSize(int)

getPoolMinAvail

public int getPoolMinAvail(int puddle)
Returns the minimum number of idle connections for the specified puddle that the factory must maintain at all times.

Parameters:
puddle - The index of the puddle of interest.
Returns:
The minimum number of idle connections.
See Also:
setPoolMinAvail(int)

setPoolMinAvail

public void setPoolMinAvail(int value)
Sets the minimum number of idle connections for the current puddle that the factory must maintain at all times.

Parameters:
value - The minimum number of idle connections.
See Also:
getPoolMinAvail(int)

setPoolMinAvail

public void setPoolMinAvail(int puddle,
                            int value)
Sets the minimum number of idle connections for the current puddle that the factory must maintain at all times.

Parameters:
puddle - The index of the puddle of interest.
value - The minimum number of idle connections.
See Also:
getPoolMinAvail(int)

getLogger

public java.util.logging.Logger getLogger()
                                   throws com.sas.services.connection.ConnectionFactoryException
Returns an instance of java.util.logging.Logger which can be used to view detailed information about the underlying ConnectionFactory.

Returns:
A logger instance.
Throws:
com.sas.services.connection.ConnectionFactoryException

resetFactory

public void resetFactory()
Resets a failed factory that may have suffered a fatal error. After calling this method, subsequent calls to requestWorkspace() will attempt to obtain another factory. This method will typically not be used, but in cases such as the customizer where testing a factory occurs often and within the same VM, this is necessary.


getFactory

protected void getFactory()
                   throws com.sas.services.connection.ConnectionFactoryException
Creates a set of puddles from the defined logins and servers and and then gets a ConnectionFactory.

Throws:
com.sas.services.connection.ConnectionFactoryException

EncodePassword

protected java.lang.String EncodePassword(java.lang.String password)
Encodes the specified password.

Parameters:
password - The password to encode.
Returns:
The encoded password.

DecodePassword

protected java.lang.String DecodePassword(java.lang.String password)
Decodes the specified password.

Parameters:
password - The password to decode.
Returns:
The decoded password.



Copyright © 2009 SAS Institute Inc. All Rights Reserved.