Package org.intermine.client.core
Class ServiceFactory
- java.lang.Object
- 
- org.intermine.client.core.ServiceFactory
 
- 
 public class ServiceFactory extends java.lang.ObjectThe Class that should be used for creating services. You should never need to create instances of service classes directly with their constructors - it is simpler to use this factory. This factory deals with constructing services with the correct relative paths.Usage:ServiceFactory serviceFactory = new ServiceFactory("https://www.flymine.org/flymine/service", "MyApp") QueryService queryService = serviceFactory.getQueryService() ...Proxy settings:To configure access through a proxy, ensure that the following Java system properties have been set:- http.proxyServer(eg: "123.456.78.90")
- http.proxyPort(eg: "8080", Optional)
 
- 
- 
Constructor SummaryConstructors Constructor Description ServiceFactory(java.lang.String rootUrl)Construct a service factory with a default application name.ServiceFactory(java.lang.String rootUrl, java.lang.String token)Construct a factory for gaining access to specific resources.ServiceFactory(java.lang.String rootUrl, java.lang.String userName, java.lang.String userPass)Deprecated.This method causes username and password information to be insecurely transmitted over HTTP connections.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description ListServicegetListService()Return a new ListService for getting getting list information from.org.intermine.metadata.ModelgetModel()A convenience method to getting a model (used widely throughout the API).ModelServicegetModelService()Return a new ModelService for retrieving the data model.QueryServicegetQueryService()Return a new QueryService for getting query results from.ServicegetService(java.lang.String serviceRelativeUrl, java.lang.String name)Creates a new service for general use.TemplateServicegetTemplateService()Return a new QueryService for getting query results from.WidgetServicegetWidgetService()Return the WidgetService for retrieving widget information.voidsetApplicationName(java.lang.String name)Set the application name used to identify your requests to the server.
 
- 
- 
- 
Constructor Detail- 
ServiceFactorypublic ServiceFactory(java.lang.String rootUrl) Construct a service factory with a default application name. (defaults to "InterMine-WS-Client-Java-$VERSION")- Parameters:
- rootUrl- the base URL for all services, it is the prefix common to all services. Example: http://www.flymine.org/flymine/service
 
 - 
ServiceFactorypublic ServiceFactory(java.lang.String rootUrl, java.lang.String token)Construct a factory for gaining access to specific resources. Allows you to set the root url and the authorization token. Use this constructor if you need to access private restricted-access resources.- Parameters:
- rootUrl- the base URL for all services, it is the prefix common to all services. Example: http://www.flymine.org/flymine/service
- token- the authorization token.
 
 - 
ServiceFactory@Deprecated public ServiceFactory(java.lang.String rootUrl, java.lang.String userName, java.lang.String userPass)Deprecated.This method causes username and password information to be insecurely transmitted over HTTP connections. Use the token authentication mechanism instead.Construct a factory for gaining access to specific resources. Allows you to set the root url and the authorization token. Use this constructor if you need to access private restricted-access resources.- Parameters:
- rootUrl- the base URL for all services, it is the prefix common to all services. Example: http://www.flymine.org/flymine/service
- userName- your user account name (usually an email address)
- userPass- your user account password, in plain text. Please do not use this constructor unless you absolutely have to. Token identification is preferred
 
 
- 
 - 
Method Detail- 
setApplicationNamepublic void setApplicationName(java.lang.String name) Set the application name used to identify your requests to the server. * @param name application name
 - 
getQueryServicepublic QueryService getQueryService() Return a new QueryService for getting query results from.- Returns:
- query service
 
 - 
getTemplateServicepublic TemplateService getTemplateService() Return a new QueryService for getting query results from.- Returns:
- template service
 
 - 
getListServicepublic ListService getListService() Return a new ListService for getting getting list information from.- Returns:
- list service
 
 - 
getModelServicepublic ModelService getModelService() Return a new ModelService for retrieving the data model.- Returns:
- model service
 
 - 
getModelpublic org.intermine.metadata.Model getModel() A convenience method to getting a model (used widely throughout the API). This method also allows us to not violate the law of Demeter in many ugly ways.- Returns:
- the data model for the service we are attached to.
 
 - 
getServicepublic Service getService(java.lang.String serviceRelativeUrl, java.lang.String name) Creates a new service for general use. You very likely won't want to use this, unless you know exactly what resource you are requesting.- Parameters:
- serviceRelativeUrl- the part of the URL specific to this service Example: query/results
- name- application name, information for server which application uses this service
- Returns:
- the created service
 
 - 
getWidgetServicepublic WidgetService getWidgetService() Return the WidgetService for retrieving widget information.- Returns:
- widget service
 
 
- 
 
-