com.simba.dsi.core.impl
Class DSIEnvironment

java.lang.Object
  extended by com.simba.dsi.core.impl.DSIEnvironment
All Implemented Interfaces:
IEnvironment

public abstract class DSIEnvironment
extends java.lang.Object
implements IEnvironment

Abstract implementation of IEnvironment that initializes and manages environment properties.


Constructor Summary
DSIEnvironment(IDriver parent)
          Constructs a DSIEnvironment with default properties.
 
Method Summary
 IConnection createConnection(com.simba.support.security.ICredentials credentials)
          Factory method for creating IConnections with integrated security.
 AttributeDataMap getAllProperties()
          Gets all the environment properties.
 com.simba.support.ILogger getLog()
          Gets the driver-wide logger.
 com.simba.support.IMessageSource getMessageSource()
          Gets the message source associated with this environment.
 IDriver getParentDriver()
          Gets the parent driver.
 Variant getProperty(int propKey)
          Gets the property as identified by the given property key.
 com.simba.support.IWarningListener getWarningListener()
          Gets the warning listener of this environment.
 void registerWarningListener(com.simba.support.IWarningListener listener)
          Registers a warning listener for allowing the IEnvironment to post warnings.
 void setProperty(int propKey, Variant propValue)
          Sets a property, as identified by the given property key, with the given property value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.simba.dsi.core.interfaces.IEnvironment
close, createConnection
 

Constructor Detail

DSIEnvironment

public DSIEnvironment(IDriver parent)
               throws com.simba.support.exceptions.ErrorException
Constructs a DSIEnvironment with default properties.

Parameters:
parent - The parent IDriver.
Throws:
com.simba.support.exceptions.ErrorException - If an error occurs while setting up default property values.
Method Detail

createConnection

public IConnection createConnection(com.simba.support.security.ICredentials credentials)
                             throws com.simba.support.exceptions.ErrorException,
                                    javax.naming.OperationNotSupportedException
Factory method for creating IConnections with integrated security.

This will only be called when integrated security is turned on via the DSI_DRIVER_SUPPORTS_INTEGRATED_SECURITY driver property. See the documentation for that property for details on how this method gets called.

Specified by:
createConnection in interface IEnvironment
Parameters:
credentials - Integrated security credentials.
Returns:
the created IConnection.
Throws:
com.simba.support.exceptions.ErrorException - If an error occurs.
javax.naming.OperationNotSupportedException - If this method is called when DSII has not implemented this method.
See Also:
IConnection

getMessageSource

public com.simba.support.IMessageSource getMessageSource()
Gets the message source associated with this environment.

Specified by:
getMessageSource in interface IEnvironment
Returns:
The message source.

getAllProperties

public AttributeDataMap getAllProperties()
Gets all the environment properties.

Returns:
all the environment properties.

getProperty

public Variant getProperty(int propKey)
                    throws BadPropertyKeyException,
                           com.simba.support.exceptions.ErrorException
Gets the property as identified by the given property key.

Specified by:
getProperty in interface IEnvironment
Parameters:
propKey - Property key associated with an environment property.
Returns:
Property value associated with the given property key.
Throws:
BadPropertyKeyException - If the input key is not valid.
com.simba.support.exceptions.ErrorException - If an unspecified error occurs.
See Also:
Variant

registerWarningListener

public void registerWarningListener(com.simba.support.IWarningListener listener)
Registers a warning listener for allowing the IEnvironment to post warnings.

Specified by:
registerWarningListener in interface IEnvironment
Parameters:
listener - The listener to register with this IEnvironment.

setProperty

public void setProperty(int propKey,
                        Variant propValue)
                 throws OptionalFeatureNotImplementedException,
                        com.simba.support.exceptions.ErrorException
Sets a property, as identified by the given property key, with the given property value. If the value is substituted with another value before storage, an OPT_VAL_CHANGED_WARNING warning should be posted in the warnings holder. For properties which accept more than just a discrete set of values, this method should throw a BadAttrValException if an illegal value is given which can't be substituted with another value.

Specified by:
setProperty in interface IEnvironment
Parameters:
propKey - Property key associated with an environment property.
propValue - Property value to be set on the environment property associated with the given property key.
Throws:
OptionalFeatureNotImplementedException - If the key is EnvPropertyKey.DSI_ENV_OUTPUT_NTS and the value is EnvPropertyValues.DSI_PROP_FALSE.
com.simba.support.exceptions.ErrorException - If an unspecified error occurs.
See Also:
Variant

getLog

public com.simba.support.ILogger getLog()
Gets the driver-wide logger.

Returns:
Log for driver-wide logging.

getParentDriver

public IDriver getParentDriver()
Gets the parent driver.

Returns:
The parent IDriver.
See Also:
IDriver

getWarningListener

public com.simba.support.IWarningListener getWarningListener()
Gets the warning listener of this environment.

Specified by:
getWarningListener in interface IEnvironment
Returns:
The warning listener of this environment.


Copyright © 2006-2014 Simba Technologies Incorporated. All Rights Reserved.