org.gcube.resources.discovery.icclient
Class ICFactory

java.lang.Object
  extended by org.gcube.resources.discovery.icclient.ICFactory

public class ICFactory
extends Object

Factory of XQuerys and DiscoveryClients for the Information Collector service.

Author:
Fabio Simeoni

Nested Class Summary
static class ICFactory.ParameterBuilder
           
 
Field Summary
static String instancesNSDeclaration
           
static String nsDeclaration
           
 
Constructor Summary
ICFactory()
           
 
Method Summary
static org.gcube.resources.discovery.client.api.DiscoveryClient<String> client()
          Returns a DiscoveryClient that 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 a DiscoveryClient that 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 a DiscoveryClient that submits queries to the Information Collector service and parses query results with a given ResultParser.
static ICFactory.ParameterBuilder params()
           
static org.gcube.resources.discovery.client.queries.impl.XQuery queryFor(Class<?> type)
          Returns a XQuery for a given resource type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nsDeclaration

public static final String nsDeclaration
See Also:
Constant Field Values

instancesNSDeclaration

public static final String instancesNSDeclaration
See Also:
Constant Field Values
Constructor Detail

ICFactory

public ICFactory()
Method Detail

queryFor

public static org.gcube.resources.discovery.client.queries.impl.XQuery queryFor(Class<?> type)
                                                                         throws IllegalStateException
Returns a XQuery for 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 a DiscoveryClient that 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 a DiscoveryClient that 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 a DiscoveryClient that submits queries to the Information Collector service and parses query results with a given ResultParser.

Parameters:
parser - the resource parser
Returns:
the client

params

public static ICFactory.ParameterBuilder params()


Copyright © 2013. All Rights Reserved.