T
- the type of RootServices to extract from the remote server.public abstract class ValidateConnection<T extends RootServices> extends Object implements ResourceRequest<IStatus>
Constructor and Description |
---|
ValidateConnection(OslcClient client,
URI rootServices,
Class<T> rootServicesType)
Creates an instance of request to validate the connection to an OSLC server.
|
ValidateConnection(OslcClient client,
URI rootServices,
Class<T> rootServicesType,
IProgressMonitor monitor)
Creates an instance of request to validate the connection to an OSLC server, with progress reporting.
|
Modifier and Type | Method and Description |
---|---|
IStatus |
call()
Validates the connection to the server by requesting the root services.
|
protected abstract IStatus |
call(T rootServices)
Allow subclasses refining the validation given the obtained root services.
|
protected OslcClient |
getClient() |
protected IProgressMonitor |
getProgressMonitor() |
protected IStatus |
validatePublisher(T rootServices,
String identifier)
Allow subclasses to request the validation of the root services publisher,
to ensure the OSLC server matches the expected application type.
|
public ValidateConnection(OslcClient client, URI rootServices, Class<T> rootServicesType)
client
- the REST client used to execute requests.rootServices
- the location of the root services.rootServicesType
- the type of response to extract from the root services execution (usually RootServices
, but can be extended).public ValidateConnection(OslcClient client, URI rootServices, Class<T> rootServicesType, IProgressMonitor monitor)
client
- the REST client used to execute requests.rootServices
- the location of the root services.rootServicesType
- the type of response to extract from the root services execution (usually RootServices
, but can be extended).monitor
- the monitor on which progress can be reported and cancellation be checked.protected final OslcClient getClient()
protected final IProgressMonitor getProgressMonitor()
public IStatus call()
Unlike any other ResourceRequest
subclass, this implementation guarantees no exception shall be thrown during the executions. The
returned status contains the thrown exception, if any.
protected abstract IStatus call(T rootServices)
rootServices
- the root services of the remote OSLC server.protected final IStatus validatePublisher(T rootServices, String identifier)
rootServices
- the root services of the remote OSLC server.identifier
- the expected OSLC application identifier (e.g. "http://jazz.net/application/rm"
)