Version: 1.1.1

org.biomoby.client
Class MobyServiceLocator

java.lang.Object
  extended by org.biomoby.client.MobyServiceLocator
Direct Known Subclasses:
ExtendedServiceLocator

public class MobyServiceLocator
extends Object

A container for information how to reach a Biomoby service.

Normally, a Biomoby service is sufficiently defined by its URL (endpoint) and by its name (which is used as a method name on that URL). See getService().

Sometimes, however, the service URL is not (yet) available, so a client has to go to a BioMoby registry and fetch it. The locator can provide, therefore, information about a registry. See getRegistryEndpoint() and getRegistryNamespace().

Version:
$Id: MobyServiceLocator.java,v 1.6 2008/12/17 14:09:00 groscurt Exp $
Author:
Martin Senger

Constructor Summary
MobyServiceLocator()
          Default constructor.
MobyServiceLocator(MobyService service)
          Another constructor, seeting also a service.
 
Method Summary
 String getPassword()
          Returns the password for the authentication
 String getRegistryEndpoint()
           
 String getRegistryNamespace()
           
 MobyService getService()
           
 int getSuggestedTimeout()
           
 String getUser()
          Returns the user for the authentication
 boolean hasAuthentication()
          Returns true if the user AND the password is set
 boolean isAsBytes()
          Return the current setting - see setAsBytes(boolean).
 void setAsBytes(boolean enabled)
          Biomoby API requested that a service must accept input data either as a String, or as an byte array.
 void setPassword(String password)
          Sets the password for authentication
 void setRegistryEndpoint(String value)
           
 void setRegistryNamespace(String value)
           
 void setService(MobyService service)
           
 void setSuggestedTimeout(int timeout)
          Set a timeout that will be used when calling the service.
 void setUser(String user)
          Sets the user for authentication
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MobyServiceLocator

public MobyServiceLocator()
Default constructor.


MobyServiceLocator

public MobyServiceLocator(MobyService service)
Another constructor, seeting also a service.

Method Detail

getService

public MobyService getService()

setService

public void setService(MobyService service)

getRegistryEndpoint

public String getRegistryEndpoint()

setRegistryEndpoint

public void setRegistryEndpoint(String value)

getRegistryNamespace

public String getRegistryNamespace()

setRegistryNamespace

public void setRegistryNamespace(String value)

getSuggestedTimeout

public int getSuggestedTimeout()

setSuggestedTimeout

public void setSuggestedTimeout(int timeout)
Set a timeout that will be used when calling the service. By default, the timeout is disabled (which is equivalent to setting timeout to zero.

Note, however, that disabling timeout in the client does not mean that the call cannot time-out: there are other players on the way to the services and back that can cause time-outing (proxies, web server, servlet container, etc.).

Parameters:
timeout - suggested timeout in milliseconds; zero or a negative value means to disable timeout

isAsBytes

public boolean isAsBytes()
Return the current setting - see setAsBytes(boolean).


setAsBytes

public void setAsBytes(boolean enabled)
Biomoby API requested that a service must accept input data either as a String, or as an byte array. By default, the string is used, but one can set it differently in this locator.

Parameters:
enabled - if true the data will be sent to the service as byte array

setUser

public void setUser(String user)
Sets the user for authentication

Parameters:
user -

setPassword

public void setPassword(String password)
Sets the password for authentication

Parameters:
password -

getUser

public String getUser()
Returns the user for the authentication

Returns:
user

getPassword

public String getPassword()
Returns the password for the authentication

Returns:
password

hasAuthentication

public boolean hasAuthentication()
Returns true if the user AND the password is set

Returns:
if authentication shall be used

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010