org.opentox.interfaces
Interface IClient

All Known Implementing Classes:
opentoxClient

public interface IClient

Interface for a general use client which manages the access to other web resources.

Author:
OpenTox - http://www.opentox.org, Sopasakis Pantelis, Sarimveis Harry

Method Summary
 boolean IsMimeAvailable(java.net.URI serviceUri, org.restlet.data.MediaType mime, boolean followRedirects)
          Checks if the specified MIME is available at the given URI.
 boolean isServerAlive(java.net.URI serverUri, int attempts)
          Checks if a server is alive.
 

Method Detail

isServerAlive

boolean isServerAlive(java.net.URI serverUri,
                      int attempts)
                      throws java.lang.InterruptedException
Checks if a server is alive.

Parameters:
serverUri - The URI of the server as a URI
attempts - Number of attempts. In case of failure on the first try , defines how many times the client should repeat the request (if possible) until a positive response is returned from the server, otherwise the method returns Boolean.FALSE.
Returns:
True if the server identified by the provided URI is alive; false otherwise.
Throws:
java.lang.InterruptedException

IsMimeAvailable

boolean IsMimeAvailable(java.net.URI serviceUri,
                        org.restlet.data.MediaType mime,
                        boolean followRedirects)
Checks if the specified MIME is available at the given URI.

Parameters:
serviceUri - URI of the service.
mime - Prefered MIME type.
followRedirects - Whether to follow redirections.
Returns:
True if the prefered MIME is supported.