Package com.sodius.oslc.client.requests
Class ValidateFriend
- java.lang.Object
-
- com.sodius.oslc.client.requests.ValidateFriend
-
- All Implemented Interfaces:
ResourceRequest<IStatus>
,Callable<IStatus>
public class ValidateFriend extends Object implements ResourceRequest<IStatus>
Validates a friend information allows connecting to a remote OSLC application.This class requires org.eclipse.equinox.common plug-in to be on classpath.
- Since:
- 1.3.0
-
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IStatus
call()
Validates the friend information allows connecting to a remote OSLC application.protected IStatus
call(RootServices rootServices)
Allow subclasses refining the validation given the obtained root services.protected 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.
-
-
-
Constructor Detail
-
ValidateFriend
public ValidateFriend(Friend friend)
Creates an instance of request to validate the connection to an OSLC server.- Parameters:
friend
- the friend information of the OSLC application.
-
-
Method Detail
-
call
public IStatus call()
Validates the friend information allows connecting to a remote OSLC application.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.- Specified by:
call
in interfaceCallable<IStatus>
- Specified by:
call
in interfaceResourceRequest<IStatus>
- Returns:
- a status indicating whether the connection is validated or not.
- See Also:
call(RootServices)
-
call
protected IStatus call(RootServices rootServices)
Allow subclasses refining the validation given the obtained root services. Default implementation does nothing, i.e. it returnsOK
. Subclasses may for example call thevalidatePublisher
method to assert the type of OSLC server.- Parameters:
rootServices
- the root services of the remote OSLC server.- Returns:
- a status indicating whether the friend is validated or not.
-
validatePublisher
protected final 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.- Parameters:
rootServices
- the root services of the remote OSLC server.identifier
- the expected OSLC application identifier (e.g."http://jazz.net/application/rm"
)- Returns:
- a status indicating whether the publisher is validated or not.
-
-