de.cau.cs.kieler.kwebs.client.jaxws
Class JaxWsClient

java.lang.Object
  extended by de.cau.cs.kieler.kwebs.client.AbstractLayoutServiceClient
      extended by de.cau.cs.kieler.kwebs.client.HttpBasedLayoutServiceClient
          extended by de.cau.cs.kieler.kwebs.client.jaxws.JaxWsClient
All Implemented Interfaces:
ILayoutServiceClient

public class JaxWsClient
extends HttpBasedLayoutServiceClient

Client implementation for the JAX-WS web service.

Rating red

Constructor Summary
JaxWsClient()
          Constructs a new JAX-WS web service client.
JaxWsClient(ServerConfigData theserverConfig)
          Constructs a new JAX-WS web service client pointing to the address of the given server configuration.
 
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.HttpBasedLayoutServiceClient
initSSL, releaseSSL
 
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

JaxWsClient

public JaxWsClient()
Constructs a new JAX-WS web service client.


JaxWsClient

public JaxWsClient(ServerConfigData theserverConfig)
Constructs a new JAX-WS web service client pointing to the address of the given server configuration.

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 final 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 final String getServiceData()
Returns the meta data from the layout service.

Returns:
the meta data

getPreviewImage

public final 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 final 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