org.sourceid.saml20.adapter.gui
Class JdbcDatastoreFieldDescriptor

java.lang.Object
  extended by org.sourceid.saml20.adapter.gui.FieldDescriptor
      extended by org.sourceid.saml20.adapter.gui.AbstractSelectionFieldDescriptor
          extended by org.sourceid.saml20.adapter.gui.SelectFieldDescriptor
              extended by org.sourceid.saml20.adapter.gui.JdbcDatastoreFieldDescriptor
All Implemented Interfaces:
java.io.Serializable

public class JdbcDatastoreFieldDescriptor
extends SelectFieldDescriptor

A field descriptor that will render (in GUI configuration screen) a drop down selection of all the configured JDBC data stores.

The value of this field in the Configuration will be the JNDI name of the Data Store (datasource).

To access a Connection object that is created from the JNDI name, you can use the DataSourceAccessor class. You can also use this JNDI name to perform your own lookup. Here is some example code if you want to do it on your own:

FieldDescriptor jdbcFieldDescriptor = conf.getField( "MyJDBCDatastoreFieldDescriptorName" );
String jndiName = jdbcFieldDescriptor.getValue();

InitialContext initialContext = new InitialContext();
DataSource dataSource = (DataSource)initialContext.lookup("java:/" + jndiName);

Connection conn = dataSource.getConnection();
...

Author:
Brian Campbell
See Also:
DataSourceAccessor.getConnection(String), AdapterConfigurationGuiDescriptor.addField(FieldDescriptor), AdapterConfigurationGuiDescriptor.addAdvancedField(FieldDescriptor), TableDescriptor.addRowField(FieldDescriptor), Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.sourceid.saml20.adapter.gui.AbstractSelectionFieldDescriptor
AbstractSelectionFieldDescriptor.OptionValue
 
Nested classes/interfaces inherited from class org.sourceid.saml20.adapter.gui.FieldDescriptor
FieldDescriptor.FieldValidationWrapper
 
Field Summary
 
Fields inherited from class org.sourceid.saml20.adapter.gui.SelectFieldDescriptor
SELECT_ONE
 
Fields inherited from class org.sourceid.saml20.adapter.gui.AbstractSelectionFieldDescriptor
optionValues
 
Constructor Summary
JdbcDatastoreFieldDescriptor(java.lang.String name, java.lang.String description)
          Create a new JdbcDatastoreFieldDescriptor.
 
Method Summary
 java.util.List<AbstractSelectionFieldDescriptor.OptionValue> getOptionValues()
          Gets the option values list constructed from all the JDBC data sources configured in the system.
 
Methods inherited from class org.sourceid.saml20.adapter.gui.FieldDescriptor
addValidator, addValidator, getDefaultValue, getDescription, getName, getValidationChain, setDefaultValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcDatastoreFieldDescriptor

public JdbcDatastoreFieldDescriptor(java.lang.String name,
                                    java.lang.String description)
Create a new JdbcDatastoreFieldDescriptor.

Parameters:
name - the field name (must be unique per AdapterConfigurationGuiDescriptor or TableDescriptor).
description - a helpful description of the field.
Method Detail

getOptionValues

public java.util.List<AbstractSelectionFieldDescriptor.OptionValue> getOptionValues()
Gets the option values list constructed from all the JDBC data sources configured in the system.

Overrides:
getOptionValues in class AbstractSelectionFieldDescriptor
Returns:
the option value list.


Copyright 2007 Ping Identity Corp. All rights reserved.