de.cau.cs.kieler.kwebs.client.jeti
Class JetiClient

java.lang.Object
  extended by de.cau.cs.kieler.kwebs.client.AbstractLayoutServiceClient
      extended by de.cau.cs.kieler.kwebs.client.jeti.JetiClient
All Implemented Interfaces:
ILayoutServiceClient

public final class JetiClient
extends AbstractLayoutServiceClient

Client implementation for the jETI web service.

Rating red

Constructor Summary
JetiClient()
          Constructs a new jETI web service client.
JetiClient(ServerConfigData theserverConfig)
          Constructs a jETI based web service client pointing to the address of the given provider.
 
Method Summary
 void connect()
          Connects this client to the layout service.
 void disconnect()
          Disconnects this client from the layout service.
 byte[] getPreviewImage(String previewImage)
          Returns a byte array containing the preview image.
 String getServiceData()
          Returns the meta data from the layout service.
 String graphLayout(String serializedGraph, String format, List<GraphLayoutOption> options)
          Does the graph layout on the layout server the client is connected to.
 boolean isConnected()
          Returns whether the client is actually connected to the layout service.
 void setServerConfig(ServerConfigData theserverConfig)
          Sets a new ServerConfigData this client points to.
 
Methods inherited from class de.cau.cs.kieler.kwebs.client.AbstractLayoutServiceClient
getLastError, getLastErrorAsStringArray, getServerConfig, isAvailable, setLastError
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JetiClient

public JetiClient()
Constructs a new jETI web service client.


JetiClient

public JetiClient(ServerConfigData theserverConfig)
Constructs a jETI based web service client pointing to the address of the given provider.

Parameters:
theserverConfig - the ServerConfigData of the layout service to be used
Method Detail

isConnected

public boolean isConnected()
Returns whether the client is actually connected to the layout service.

Returns:
whether the client is actually connected to the layout service

connect

public void connect()
Connects this client to the layout service.


disconnect

public void disconnect()
Disconnects this client from the layout service.


graphLayout

public String graphLayout(String serializedGraph,
                          String format,
                          List<GraphLayoutOption> options)
Does the graph layout on the layout server the client is connected to.

Parameters:
serializedGraph - the graph to do layout on in serial representation
format - the format used to serialize the graph Formats
options - possible layout options
Returns:
the graph which was layout done on in the same serial representation as used in the call to graphLayout

getServiceData

public String getServiceData()
Returns the meta data from the layout service.

Returns:
the meta data

getPreviewImage

public byte[] getPreviewImage(String previewImage)
Returns a byte array containing the preview image.

Parameters:
previewImage - the identifier of the preview image
Returns:
a byte array containing the preview image

setServerConfig

public void setServerConfig(ServerConfigData theserverConfig)
Sets a new ServerConfigData this client points to. Resets the state of this client to disconnected.

Specified by:
setServerConfig in interface ILayoutServiceClient
Overrides:
setServerConfig in class AbstractLayoutServiceClient
Parameters:
theserverConfig - the new server configuration