Package com.dtolabs.rundeck.core.plugins
Class AdapterService<S,T>
- java.lang.Object
-
- com.dtolabs.rundeck.core.plugins.AdapterService<S,T>
-
- All Implemented Interfaces:
FrameworkSupportService
,ProviderService<T>
,DescribableService
,PluggableProviderService<T>
,PluggableService<T>
public class AdapterService<S,T> extends java.lang.Object implements PluggableProviderService<T>
AdapterService adapts one service provider type to another.
-
-
Constructor Summary
Constructors Constructor Description AdapterService(PluggableProviderService<S> sourceService, Converter<S,T> converter)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <X,Y>
AdapterService<X,Y>adaptFor(PluggableProviderService<X> sourceService, Converter<X,Y> converter)
CloseableProvider<T>
closeableProviderOfType(java.lang.String providerName)
Converter<S,T>
getConverter()
java.lang.String
getName()
ProviderService<S>
getSourceService()
java.util.List<ProviderIdent>
listDescribableProviders()
java.util.List<Description>
listDescriptions()
java.util.List<ProviderIdent>
listProviders()
T
providerOfType(java.lang.String providerName)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.dtolabs.rundeck.core.plugins.PluggableProviderService
adapter
-
Methods inherited from interface com.dtolabs.rundeck.core.plugins.PluggableService
canLoadWithLoader, loadCloseableWithLoader, loadWithLoader
-
-
-
-
Constructor Detail
-
AdapterService
public AdapterService(PluggableProviderService<S> sourceService, Converter<S,T> converter)
-
-
Method Detail
-
providerOfType
public T providerOfType(java.lang.String providerName) throws ExecutionServiceException
- Specified by:
providerOfType
in interfaceProviderService<S>
- Parameters:
providerName
- name of the service provider- Returns:
- the provider instance of the given name.
- Throws:
ExecutionServiceException
- on error
-
closeableProviderOfType
public CloseableProvider<T> closeableProviderOfType(java.lang.String providerName) throws ExecutionServiceException
- Specified by:
closeableProviderOfType
in interfaceProviderService<S>
- Throws:
ExecutionServiceException
-
listProviders
public java.util.List<ProviderIdent> listProviders()
- Specified by:
listProviders
in interfaceProviderService<S>
-
listDescribableProviders
public java.util.List<ProviderIdent> listDescribableProviders()
- Specified by:
listDescribableProviders
in interfaceDescribableService
-
listDescriptions
public java.util.List<Description> listDescriptions()
- Specified by:
listDescriptions
in interfaceDescribableService
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceFrameworkSupportService
- Returns:
- the name used to identify the service
-
getSourceService
public ProviderService<S> getSourceService()
-
adaptFor
public static <X,Y> AdapterService<X,Y> adaptFor(PluggableProviderService<X> sourceService, Converter<X,Y> converter)
- Type Parameters:
X
- provider typeY
- destination type- Parameters:
converter
- convertersourceService
- source- Returns:
- Create an AdapterService given a source service and a Converter.
-
-