de.cau.cs.kieler.kwebs.client
Interface ILayoutServiceClient

All Known Implementing Classes:
AbstractLayoutServiceClient, HttpBasedLayoutServiceClient, JaxWsClient, JetiClient

public interface ILayoutServiceClient

Interface for a web service client. Every implementation needs to provide a default constructor so that the LayoutServiceClients class can initialize it.

Rating proposed yellow
(2011-08-02) reviewed by ckru, mri, msp

Method Summary
 void connect()
          Connects this client to the layout service.
 void disconnect()
          Disconnects this client from the layout service.
 Throwable getLastError()
          Returns the last error occurred.
 String[] getLastErrorAsStringArray()
          Returns a string array containing the messages of the the last exception occurred.
 byte[] getPreviewImage(String previewImage)
          Returns a byte array containing the preview image.
 ServerConfigData getServerConfig()
          Returns the ServerConfigData this client currently points to.
 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 isAvailable()
          Checks whether the layout service this clients service address points to is currently available.
 boolean isConnected()
          Returns whether the client is actually connected to the layout service.
 void setLastError(Throwable thelastError)
          Sets the last error occurred.
 void setServerConfig(ServerConfigData theserverConfig)
          Sets a new ServerConfigData this client points to.
 

Method Detail

graphLayout

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

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

Returns:
the meta data

getPreviewImage

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

isAvailable

boolean isAvailable()
Checks whether the layout service this clients service address points to is currently available.

Returns:
whether the layout service is currently available

isConnected

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

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


disconnect

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


getServerConfig

ServerConfigData getServerConfig()
Returns the ServerConfigData this client currently points to.

Returns:
the server configuration

setServerConfig

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

Parameters:
theserverConfig - the new server configuration

getLastErrorAsStringArray

String[] getLastErrorAsStringArray()
Returns a string array containing the messages of the the last exception occurred.

Returns:
string array containing the messages of the last thrown exception or null if everything went fine

getLastError

Throwable getLastError()
Returns the last error occurred.

Returns:
the last error occurred as throwable or null if everything went fine

setLastError

void setLastError(Throwable thelastError)
Sets the last error occurred.

Parameters:
thelastError - the last error occurred