Class ICFactory
- java.lang.Object
-
- org.gcube.resources.discovery.icclient.ICFactory
-
public class ICFactory extends Object
Factory ofXQuerys andDiscoveryClients for the Information Collector service.- Author:
- Fabio Simeoni
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classICFactory.ParameterBuilder
-
Field Summary
Fields Modifier and Type Field Description static StringinstancesNSDeclarationstatic StringnsDeclaration
-
Constructor Summary
Constructors Constructor Description ICFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.gcube.resources.discovery.client.api.DiscoveryClient<String>client()Returns aDiscoveryClientthat submits queries to the Information Collector service without parsing the results.static <R> org.gcube.resources.discovery.client.api.DiscoveryClient<R>clientFor(Class<R> type)Returns aDiscoveryClientthat submits queries to the Information Collector service and parses query results with a given resource type.static <R> org.gcube.resources.discovery.client.api.DiscoveryClient<R>clientWith(org.gcube.resources.discovery.client.api.ResultParser<R> parser)Returns aDiscoveryClientthat submits queries to the Information Collector service and parses query results with a givenResultParser.static ICFactory.ParameterBuilderparams()static org.gcube.resources.discovery.client.queries.impl.XQueryqueryFor(Class<?> type)Returns aXQueryfor a given resource type.
-
-
-
Field Detail
-
nsDeclaration
public static final String nsDeclaration
- See Also:
- Constant Field Values
-
instancesNSDeclaration
public static final String instancesNSDeclaration
- See Also:
- Constant Field Values
-
-
Method Detail
-
queryFor
public static org.gcube.resources.discovery.client.queries.impl.XQuery queryFor(Class<?> type) throws IllegalStateException
Returns aXQueryfor a given resource type.- Parameters:
type- the resource type- Returns:
- the query
- Throws:
IllegalStateException- if a query for the resource type has not been previously registered
-
clientFor
public static <R> org.gcube.resources.discovery.client.api.DiscoveryClient<R> clientFor(Class<R> type)
Returns aDiscoveryClientthat submits queries to the Information Collector service and parses query results with a given resource type.- Parameters:
type- the resource type- Returns:
- the client
-
client
public static org.gcube.resources.discovery.client.api.DiscoveryClient<String> client()
Returns aDiscoveryClientthat submits queries to the Information Collector service without parsing the results.- Returns:
- the client
-
clientWith
public static <R> org.gcube.resources.discovery.client.api.DiscoveryClient<R> clientWith(org.gcube.resources.discovery.client.api.ResultParser<R> parser)
Returns aDiscoveryClientthat submits queries to the Information Collector service and parses query results with a givenResultParser.- Parameters:
parser- the resource parser- Returns:
- the client
-
params
public static ICFactory.ParameterBuilder params()
-
-