Class ValidateFriend

    • 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.
      • ValidateFriend

        public ValidateFriend​(Friend friend,
                              List<Locale> locales)
        Creates an instance of request to validate the connection to an OSLC server.
        Parameters:
        friend - the friend information of the OSLC application.
        locales - the languages to use for error messages, in order of preference.
    • 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 interface Callable<IStatus>
        Specified by:
        call in interface ResourceRequest<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 returns OK. Subclasses may for example call the validatePublisher 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.