Class RemoteServiceImpl<Type extends IridaRepresentationModel & IridaThing>
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.service.remote.impl.RemoteServiceImpl<Type>
-
- Type Parameters:
Type
- The type of object to be stored in this repository (extendsIridaRepresentationModel
)
- All Implemented Interfaces:
RemoteService<Type>
- Direct Known Subclasses:
GenomeAssemblyRemoteServiceImpl
,ProjectRemoteServiceImpl
,SampleRemoteServiceImpl
,SequencingObjectRemoteServiceImpl
public abstract class RemoteServiceImpl<Type extends IridaRepresentationModel & IridaThing> extends java.lang.Object implements RemoteService<Type>
Remote service to request from remote IRIDA instances using OAuth2
-
-
Constructor Summary
Constructors Constructor Description RemoteServiceImpl(RemoteRepository<Type> repository, RemoteAPIRepository remoteAPIRepository)
Create a new remote service that interacts with the given repository
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected RemoteAPI
getRemoteApiForURI(java.lang.String uri)
Convenience method for getting theRemoteAPI
for a given string URIboolean
getServiceStatus(RemoteAPI remoteAPI)
Get the status of the remote servicejava.util.List<Type>
list(java.lang.String uri, RemoteAPI remoteAPI)
List the resources available from this serviceType
read(java.lang.String uri)
Read individual resource at the given URI.Type
read(java.lang.String uri, RemoteAPI remoteAPI)
Read an individual resource
-
-
-
Constructor Detail
-
RemoteServiceImpl
public RemoteServiceImpl(RemoteRepository<Type> repository, RemoteAPIRepository remoteAPIRepository)
Create a new remote service that interacts with the given repository- Parameters:
repository
- TheRemoteRepository
handling basic operations with the given TyperemoteAPIRepository
- repository for storing and retrievingRemoteAPI
s
-
-
Method Detail
-
read
public Type read(java.lang.String uri, RemoteAPI remoteAPI)
Read an individual resource- Specified by:
read
in interfaceRemoteService<Type extends IridaRepresentationModel & IridaThing>
- Parameters:
uri
- The URI of the resource to readremoteAPI
- the API to read from- Returns:
- An object of Type
-
read
public Type read(java.lang.String uri)
Read individual resource at the given URI. The requiredRemoteAPI
will be found using the given resource URI.- Specified by:
read
in interfaceRemoteService<Type extends IridaRepresentationModel & IridaThing>
- Parameters:
uri
- The URI of the resource- Returns:
- an object of Type
-
list
public java.util.List<Type> list(java.lang.String uri, RemoteAPI remoteAPI)
List the resources available from this service- Specified by:
list
in interfaceRemoteService<Type extends IridaRepresentationModel & IridaThing>
- Parameters:
uri
- the uri to load the resources from.remoteAPI
- The API to read from- Returns:
- A
List<Type>
of the resources available
-
getServiceStatus
public boolean getServiceStatus(RemoteAPI remoteAPI)
Get the status of the remote service- Specified by:
getServiceStatus
in interfaceRemoteService<Type extends IridaRepresentationModel & IridaThing>
- Parameters:
remoteAPI
- The API to check status for- Returns:
- true if the service is active
-
-