|
3.0.4: 2012-03-05 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.util.uri.ConnectionManagerUtil
public class ConnectionManagerUtil
Collects utility methods related to connection managers.
Connection manager factories should be registered as
extensions to the net.sf.basedb.core.uri.connection-manager
extension point. The methods in this class can then be used to
get information about installed connection manager factories and
to use them for retreiving external file data and information.
Field Summary | |
---|---|
static String |
EXTENSION_POINT_ID
The ID of the connection manager extension point. |
Constructor Summary | |
---|---|
ConnectionManagerUtil()
|
Method Summary | |
---|---|
private static ConnectionManagerFactory |
autoDetect(ExtensionsInvoker<ConnectionManagerFactory> invoker,
URI uri)
Use auto-detection and return the first factory that can handle the given uri. |
static ConnectionManager |
createConnectionManager(File file,
ConnectionParameters parameters)
Utility method for creating a connection manager for a file item. |
static ConnectionManager |
createConnectionManager(URI uri,
ConnectionParameters parameters)
Utility method for creating a connection manager. |
static ConnectionManagerFactory |
findFactory(URI uri)
Find a factory for the given URI. |
static List<ConnectionManagerFactory> |
getFactories()
Get a list with all connection manager factories. |
static ConnectionManagerFactory |
getFactory(String id)
Get the connection manager factory with the given extension id. |
private static ConnectionManagerFactory |
getFirst(ExtensionsInvoker<ConnectionManagerFactory> invoker)
Get the first factory returned by the invoker. |
private static ExtensionsInvoker<ConnectionManagerFactory> |
getInvoker(ClientContext context,
ExtensionsFilter filter)
Get an invoker for using the connection manager factory extensions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String EXTENSION_POINT_ID
Constructor Detail |
---|
public ConnectionManagerUtil()
Method Detail |
---|
public static List<ConnectionManagerFactory> getFactories()
public static ConnectionManagerFactory getFactory(String id)
id
- The ID of the factory
public static ConnectionManagerFactory findFactory(URI uri)
ConnectionManagerFactory.supports(URI)
for all factories that supports auto-detection. The first
one that gives a successful response is returned. If no factory
supports the given URI, null is returned.
Note to extension developers: The given uri is available to the action factory as "uri" attribute of the context.
uri
- The URI (null is not allowed)
public static ConnectionManager createConnectionManager(URI uri, ConnectionParameters parameters)
findFactory(URI)
is used for auto-detection. If no factory is found
an exception is thrown, otherwise a connection manger is created by the
factory method:
ConnectionManagerFactory.createConnectionManager(URI, ConnectionParameters)
uri
- The URI (required)parameters
- Connection parameters, such as user login/password, etc. (optional)
public static ConnectionManager createConnectionManager(File file, ConnectionParameters parameters)
findFactory(URI)
method but this time the context
information for the action factory contains the file object and
connection parameters.
file
- The (external) file (required)parameters
- Connection parameters, such as user login/password, etc. (optional)
private static ExtensionsInvoker<ConnectionManagerFactory> getInvoker(ClientContext context, ExtensionsFilter filter)
private static ConnectionManagerFactory getFirst(ExtensionsInvoker<ConnectionManagerFactory> invoker)
private static ConnectionManagerFactory autoDetect(ExtensionsInvoker<ConnectionManagerFactory> invoker, URI uri)
|
3.0.4: 2012-03-05 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |