org.opentox.client
Class opentoxClient
java.lang.Object
org.opentox.client.opentoxClient
- All Implemented Interfaces:
- IClient
public class opentoxClient
- extends java.lang.Object
- implements IClient
This class is used to make HTTP requests to other servers.
- Author:
- OpenTox - http://www.opentox.org, Sopasakis Pantelis, Kolotouros Dimitris, Sarimveis Harry
Method Summary |
private static opentoxClient |
getInstance()
|
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
instanceOfThis
private static opentoxClient instanceOfThis
INSTANCE
public static opentoxClient INSTANCE
opentoxClient
private opentoxClient()
getInstance
private static opentoxClient getInstance()
isServerAlive
public boolean isServerAlive(java.net.URI serverUri,
int attempts)
throws java.lang.InterruptedException
- Description copied from interface:
IClient
- Checks if a server is alive.
- Specified by:
isServerAlive
in interface IClient
- 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
public boolean IsMimeAvailable(java.net.URI serviceUri,
org.restlet.data.MediaType mime,
boolean followRedirects)
- Description copied from interface:
IClient
- Checks if the specified MIME is available at the given URI.
- Specified by:
IsMimeAvailable
in interface IClient
- Parameters:
serviceUri
- URI of the service.mime
- Prefered MIME type.followRedirects
- Whether to follow redirections.
- Returns:
- True if the prefered MIME is supported.