public class ValidateFriend extends Object implements ResourceRequest<org.eclipse.core.runtime.IStatus>
This class requires org.eclipse.equinox.common plug-in to be on classpath.
Constructor and Description |
---|
ValidateFriend(Friend friend)
Creates an instance of request to validate the connection to an OSLC server.
|
ValidateFriend(Friend friend,
List<Locale> locales)
Creates an instance of request to validate the connection to an OSLC server.
|
Modifier and Type | Method and Description |
---|---|
org.eclipse.core.runtime.IStatus |
call()
Validates the friend information allows connecting to a remote OSLC application.
|
protected org.eclipse.core.runtime.IStatus |
call(RootServices rootServices)
Allow subclasses refining the validation given the obtained root services.
|
protected org.eclipse.core.runtime.IStatus |
validatePublisher(RootServices 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 ValidateFriend(Friend friend)
friend
- the friend information of the OSLC application.public org.eclipse.core.runtime.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.
If the friend information is valid, this method invokes the call(RootServices)
which subclasses may override to perform additional validation given the loaded root services.
call
in interface ResourceRequest<org.eclipse.core.runtime.IStatus>
call
in interface Callable<org.eclipse.core.runtime.IStatus>
call(RootServices)
protected org.eclipse.core.runtime.IStatus call(RootServices rootServices)
OK
.
Subclasses may for example call the validatePublisher
method to assert the type of OSLC server.rootServices
- the root services of the remote OSLC server.protected final org.eclipse.core.runtime.IStatus validatePublisher(RootServices 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"
)