WebObjects 5.4.2

com.webobjects.jndiadaptor
Class JNDIAdaptor

java.lang.Object
  extended by com.webobjects.eoaccess.EOAdaptor
      extended by com.webobjects.jndiadaptor.JNDIAdaptor

public class JNDIAdaptor
extends EOAdaptor

The JNDIAdaptor class represents a Java Naming and Directory Interface service.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.webobjects.eoaccess.EOAdaptor
EOAdaptor.Delegate
 
Field Summary
static String AuthenticationMethodKey
          A connection dictionary key representing the authentication method.
static String DefaultScopeKey
          A connection dictionary key representing the default scope.
static String InitialContextFactoryKey
          A connection dictionary key representing the initial context factory.
static String NoneKey
          A connection dictionary value representing no authentication method.
static String ObjectKey
          A connection dictionary value representing object scope.
static String OneLevelKey
          A connection dictionary value representing one-level scope.
static String PasswordKey
          A connection dictionary key representing the password.
static String PlugInClassNameKey
          A connection dictionary key representing the plug-in class name.
static String ServerUrlKey
          A connection dictionary key representing the server URL.
static String SubtreeKey
          A connection dictionary value representing subtree scope.
static String TimeoutKey
          A connection dictionary key representing the timeout.
static String UsernameKey
          A connection dictionary key representing the username.
 
Constructor Summary
JNDIAdaptor(String name)
          Creates a new instance of JNDIAdaptor.
 
Method Summary
 void assertConnectionDictionaryIsValid()
          An abstract method that should be implemented by subclasses to verify that the adaptor can connect to the database server with its connection dictionary.
 void assignExternalInfoForEntireModel(EOModel model)
          Assigns database-specific characteristics to model.
 EOAdaptorContext createAdaptorContext()
          An abstract method that should be implemented by subclasses to create and return a new EOAdaptorContext, or null if a new context can't be created.
static EOEditingContext createEditingContext(String modelName, String serverUrl, String username, String password)
          Creates a new instance of EOEditingContext with the specified model, server URL, username, and password.
 Class defaultExpressionClass()
          An abstract method that should be implemented by subclasses to return the subclass of EOSQLExpression used as the default expression class for the adaptor.
 EOSQLExpressionFactory expressionFactory()
          An abstract method that supports changes made to EOSQLExpression and related classes and interfaces.
 NSArray externalTypesWithModel(EOModel model)
          The default implementation returns an empty array.
 boolean isDroppedConnectionException(Exception exception)
          The default implementation returns false.
 boolean isValidQualifierType(String typeName, EOModel model)
          An abstract method that should be implemented by subclasses to return true if an attribute of type typeName can be used in a qualifier (an SQL WHERE clause) sent to the database server, false otherwise.
 JNDIPlugIn plugIn()
          Gets the instance of the plug-in class name specified in the connection dictionary.
 EOSchemaSynchronizationFactory schemaSynchronizationFactory()
          An abstract method that supports changes made to EOSQLExpression and related classes and interfaces.
 void setConnectionDictionary(NSDictionary dictionary)
          Sets the adaptor's connection dictionary to dictionary, which must only contain String, NSData, NSDictionary, and NSArray objects.
 EOSchemaGeneration synchronizationFactory()
          Deprecated. 
 
Methods inherited from class com.webobjects.eoaccess.EOAdaptor
adaptorWithModel, adaptorWithName, administrativeConnectionDictionaryForAdaptor, assignExternalInfoForAttribute, assignExternalInfoForEntity, assignExternalTypeForAttribute, canServiceModel, connectionDictionary, contexts, createDatabaseWithAdministrativeConnectionDictionary, defaultDelegate, delegate, dropDatabaseWithAdministrativeConnectionDictionary, expressionClass, expressionClassName, fetchedValueForDataValue, fetchedValueForDateValue, fetchedValueForNumberValue, fetchedValueForStringValue, fetchedValueForValue, handleDroppedConnection, hasOpenChannels, hasPlugIns, internalTypeForExternalType, name, plugInName, prototypeAttributes, setDefaultDelegate, setDelegate, setExpressionClassName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AuthenticationMethodKey

public static final String AuthenticationMethodKey
A connection dictionary key representing the authentication method.

See Also:
Constant Field Values

DefaultScopeKey

public static final String DefaultScopeKey
A connection dictionary key representing the default scope.

See Also:
Constant Field Values

InitialContextFactoryKey

public static final String InitialContextFactoryKey
A connection dictionary key representing the initial context factory.

See Also:
Constant Field Values

PasswordKey

public static final String PasswordKey
A connection dictionary key representing the password.

See Also:
Constant Field Values

PlugInClassNameKey

public static final String PlugInClassNameKey
A connection dictionary key representing the plug-in class name.

See Also:
Constant Field Values

ServerUrlKey

public static final String ServerUrlKey
A connection dictionary key representing the server URL.

See Also:
Constant Field Values

TimeoutKey

public static final String TimeoutKey
A connection dictionary key representing the timeout.

See Also:
Constant Field Values

UsernameKey

public static final String UsernameKey
A connection dictionary key representing the username.

See Also:
Constant Field Values

NoneKey

public static final String NoneKey
A connection dictionary value representing no authentication method.

See Also:
Constant Field Values

ObjectKey

public static final String ObjectKey
A connection dictionary value representing object scope.

See Also:
Constant Field Values

OneLevelKey

public static final String OneLevelKey
A connection dictionary value representing one-level scope.

See Also:
Constant Field Values

SubtreeKey

public static final String SubtreeKey
A connection dictionary value representing subtree scope.

See Also:
Constant Field Values
Constructor Detail

JNDIAdaptor

public JNDIAdaptor(String name)
Creates a new instance of JNDIAdaptor.

Parameters:
name - - name of adaptor
See Also:
EOAdaptor.EOAdaptor(String)
Method Detail

plugIn

public JNDIPlugIn plugIn()
Gets the instance of the plug-in class name specified in the connection dictionary.

Returns:
instance of JNDIPlugIn
See Also:
JNDIPlugIn

expressionFactory

public EOSQLExpressionFactory expressionFactory()
Description copied from class: EOAdaptor
An abstract method that supports changes made to EOSQLExpression and related classes and interfaces. Subclass implementations return the EOExpressionFactory for the adaptor.

Specified by:
expressionFactory in class EOAdaptor
Returns:
Should return the EOExpressionFactory.
See Also:
EOSQLExpression

schemaSynchronizationFactory

public EOSchemaSynchronizationFactory schemaSynchronizationFactory()
Description copied from class: EOAdaptor
An abstract method that supports changes made to EOSQLExpression and related classes and interfaces. Subclass implementations return the EOSchemaGeneration for the adaptor.

Specified by:
schemaSynchronizationFactory in class EOAdaptor
Returns:
Should return the EOSchemaGeneration for the adaptor.
See Also:
EOSQLExpression

synchronizationFactory

@Deprecated
public EOSchemaGeneration synchronizationFactory()
Deprecated. 

Description copied from class: EOAdaptor
An abstract method that supports changes made to EOSQLExpression and related classes and interfaces. Subclass implementations return the EOSynchronizationFactory for the adaptor.

Specified by:
synchronizationFactory in class EOAdaptor
Returns:
Should return the EOSynchronizationFactory for the adaptor.
See Also:
EOSQLExpression

createAdaptorContext

public EOAdaptorContext createAdaptorContext()
Description copied from class: EOAdaptor
An abstract method that should be implemented by subclasses to create and return a new EOAdaptorContext, or null if a new context can't be created. A newly created EOAdaptor has no contexts.

Specified by:
createAdaptorContext in class EOAdaptor
Returns:
Should return a new EOAdaptorContext.
See Also:
EOAdaptor.contexts()

defaultExpressionClass

public Class defaultExpressionClass()
Description copied from class: EOAdaptor
An abstract method that should be implemented by subclasses to return the subclass of EOSQLExpression used as the default expression class for the adaptor. You won't ordinarily invoke this method directly. It is invoked automatically to determine which class should be used to represent query language expressions.

Specified by:
defaultExpressionClass in class EOAdaptor
Returns:
Should return the subclass of EOSQLExpression used as the default expression class for the adaptor.
See Also:
EOAdaptor.setExpressionClassName( String sqlExpressionClassName, String adaptorClassName)

isValidQualifierType

public boolean isValidQualifierType(String typeName,
                                    EOModel model)
Description copied from class: EOAdaptor
An abstract method that should be implemented by subclasses to return true if an attribute of type typeName can be used in a qualifier (an SQL WHERE clause) sent to the database server, false otherwise. typeName is the name of a type as required by the database server. model is an optional argument that can be used to supplement the adaptor's set of type mappings with additional mappings for user-defined database types.

Specified by:
isValidQualifierType in class EOAdaptor
Parameters:
typeName - The name of a type as determined by the database server.
model - A model.
Returns:
Should return true if an attribute of type typeName can be used in a qualifier.

assertConnectionDictionaryIsValid

public void assertConnectionDictionaryIsValid()
Description copied from class: EOAdaptor
An abstract method that should be implemented by subclasses to verify that the adaptor can connect to the database server with its connection dictionary. Should briefly form a connection to the server to validate the connection dictionary and then close the connection. This method should throw a runtime exception if the connection dictionary contains invalid information, or if any error occurs.

An actual connection is made when the first adaptor channel is sent an openChannel message.

Specified by:
assertConnectionDictionaryIsValid in class EOAdaptor
See Also:
EOAdaptor.setConnectionDictionary(NSDictionary dictionary), EOAdaptorChannel.openChannel()

setConnectionDictionary

public void setConnectionDictionary(NSDictionary dictionary)
Description copied from class: EOAdaptor
Sets the adaptor's connection dictionary to dictionary, which must only contain String, NSData, NSDictionary, and NSArray objects. Connection information can not be changed while the adaptor is connected. Throws an exception if there are any open channels when this method is invoked.

Subclasses of EOAdaptor don't need to override this method. A subclass that does override this method must incorporate the superclass's version by calling super.

Overrides:
setConnectionDictionary in class EOAdaptor
Parameters:
dictionary - The adaptor's connection dictionary.
See Also:
EOAdaptor.connectionDictionary(), EOAdaptor.hasOpenChannels(), EOAdaptor.assertConnectionDictionaryIsValid()

isDroppedConnectionException

public boolean isDroppedConnectionException(Exception exception)
Description copied from class: EOAdaptor
The default implementation returns false. Subclasses that support database reconnection should implement this method to allow for automatic database reconnection. This method should return true if the exception is one that the adaptor can attempt to recover from by reconnecting to the database, false otherwise.

Invoked if an exception is thrown during fetching or saving. If the adaptor returns true, it then attempts to reconnect to the database and retries the operation. If the reconnection attempt fails, the exception from the failure is thrown as usual. If the adaptor returns false, reconnection isn't attempted and the exception is thrown.

Overrides:
isDroppedConnectionException in class EOAdaptor
Parameters:
exception - An exception object.
Returns:
false by default.
See Also:
EOAdaptor.handleDroppedConnection(), EOAdaptor.Delegate.reconnectionDictionaryForAdaptor( EOAdaptor adaptor)

externalTypesWithModel

public NSArray externalTypesWithModel(EOModel model)
Description copied from class: EOAdaptor
The default implementation returns an empty array. This method can be overridden by subclasses to return the names of the database types for use with the adaptor.

model is an optional argument that can be used to supplement the adaptor's set of database types with additional, user-defined database types. Refer to your adaptor's documentation to determine whether, and how, it uses the model for type mapping.

Overrides:
externalTypesWithModel in class EOAdaptor
Parameters:
model - An optional argument that can be used to supplement the adaptor's set of database types with additional, user-defined database types.
Returns:
An empty array by default.

assignExternalInfoForEntireModel

public void assignExternalInfoForEntireModel(EOModel model)
Description copied from class: EOAdaptor
Assigns database-specific characteristics to model. Used in EOModeler to switch a model's adaptor. This method examines each entity in model. If an entity's external name is not set and all of the entity's attribute's external names are not set, then this method uses assignExternalInfoForEntity and assignExternalInfoForAttribute to assign external names. If the entity's external name is set or if any of the entity's attributes' external names are set, then the method doesn't assign external names to the entity or any of its attributes. Regardless, this method assigns external types for all the model's attributes. Recurses through entities and their attributes calling the conversion methods above.

A subclass of EOAdaptor doesn't need to implement this method.

Overrides:
assignExternalInfoForEntireModel in class EOAdaptor
Parameters:
model - The model.
See Also:
EOAdaptor.assignExternalInfoForEntity(EOEntity entity), EOAdaptor.assignExternalInfoForAttribute(EOAttribute attribute)

createEditingContext

public static EOEditingContext createEditingContext(String modelName,
                                                    String serverUrl,
                                                    String username,
                                                    String password)
Creates a new instance of EOEditingContext with the specified model, server URL, username, and password.

Parameters:
modelName - - the name of the model
serverUrl - - the server URL of the connection dictionary
username - - the username of the connection dictionary
password - - the password of the connection dictionary
Throws:
- - JNDIAdaptorException - if modelName is null
See Also:
EOEditingContext

Last updated June 2008

Copyright © 2000-2008 Apple Inc.