MemcachedSOAP
Class MemcachedSOAPClient

java.lang.Object
  extended by MemcachedSOAP.MemcachedSOAPClient

public class MemcachedSOAPClient
extends java.lang.Object

A memcached Java SOAP client.

This class is used to access a distant Memcached deamon.
The client connects itself to a MemcachedSOAP.cgi webservice hosted on a server somewhere that relays the requests of the client direcly to the Memcached deamon via the Apache::Session::Memorycached interface.

This is Open Source software released under the GNU/GPL license.
It is provided "as is" without warranty of any kind.
Copyright 2007: Nicolas Grevet & Younes Mohmoh, France.

Version history:
2007-06-01: first release
2007-06-04: various improvements and fixes.

Author:
Nicolas GREVET, Younes MOHMOH

Constructor Summary
MemcachedSOAPClient()
          Basic constructor without arguments.
MemcachedSOAPClient(java.lang.String prefix, java.lang.String namespace, java.lang.String service)
          Basic constructor with arguments.
 
Method Summary
 java.lang.String getNamespace()
          Getter for the namespace of the webservice
 java.lang.String getPrefix()
          Getter for the namespace's prefix of the webservice
 java.util.HashMap<java.lang.String,java.lang.Object> getSession(java.lang.String session)
          getSession sends a query to the remote webservice in order to gather all the informations associated to a specific session number (passed in parameter).
 java.lang.String getURI()
          Getter for the webservice's URI
 boolean serverStatusOK()
          serverStatusOK checks if the remote SOAP server is up and able to answer to our SOAP requests.
 void setNamespace(java.lang.String namespace)
          Setter for the namespace of the webservice
 void setPrefix(java.lang.String prefix)
          Setter for the namespace's prefix of the webservice
 void setProxy(java.lang.String host, java.lang.String port)
          This method allows a user/tester to specify a proxy host and port.
 java.lang.String setSession(java.util.HashMap session)
          setSession sends a query to the remote webservice in order to create a new session.
 void setURI(java.lang.String service)
          Getter for the webservice's URI
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemcachedSOAPClient

public MemcachedSOAPClient()
Basic constructor without arguments.
Uses the default MemcachedSOAP webservice.


MemcachedSOAPClient

public MemcachedSOAPClient(java.lang.String prefix,
                           java.lang.String namespace,
                           java.lang.String service)
Basic constructor with arguments.
Can be used to change the default webservice namespace and/or uri.

Parameters:
prefix - The prefix of the namespace (default to urn)
namespace - The namespace of the webservice (default to MemcachedSOAPClass)
service - The URI of the webservice
Method Detail

setProxy

public void setProxy(java.lang.String host,
                     java.lang.String port)
This method allows a user/tester to specify a proxy host and port.

Parameters:
host - The hostname or IP of the proxy server
port - The port number of the proxy server

serverStatusOK

public boolean serverStatusOK()
serverStatusOK checks if the remote SOAP server is up and able to answer to our SOAP requests. Basicaly, it just sends a SOAP request and see if the server answers to it.

Returns:
true if the remote SOAP server is up and able to answer to our SOAP requests or false if it isn't.

getSession

public java.util.HashMap<java.lang.String,java.lang.Object> getSession(java.lang.String session)
                                                                throws java.lang.UnsupportedOperationException,
                                                                       javax.xml.soap.SOAPException,
                                                                       java.net.MalformedURLException
getSession sends a query to the remote webservice in order to gather all the informations associated to a specific session number (passed in parameter).

Parameters:
session - A string containing the number of the session to gather.
Returns:
A HashMap containing pairs of key and values representing the session or an empty HashMap if query failed.
Throws:
javax.xml.soap.SOAPException
java.lang.UnsupportedOperationException
java.net.MalformedURLException

setSession

public java.lang.String setSession(java.util.HashMap session)
                            throws javax.xml.soap.SOAPException,
                                   java.net.MalformedURLException
setSession sends a query to the remote webservice in order to create a new session. The method is expecting a HashMap parameter containing a succession of key/value pairs representing the session's informations.

Parameters:
session - A HashMap containing pairs of keys and values representing the session's informations.
Returns:
a string containing the ID of this new session or null if query failed.
Throws:
javax.xml.soap.SOAPException
java.net.MalformedURLException

getNamespace

public java.lang.String getNamespace()
Getter for the namespace of the webservice

Returns:
the webservice's namespace

getPrefix

public java.lang.String getPrefix()
Getter for the namespace's prefix of the webservice

Returns:
the prefix of the webservice's namespace

getURI

public java.lang.String getURI()
Getter for the webservice's URI

Returns:
the webservice URI

setNamespace

public void setNamespace(java.lang.String namespace)
Setter for the namespace of the webservice

Parameters:
namespace - the webservice's namespace

setPrefix

public void setPrefix(java.lang.String prefix)
Setter for the namespace's prefix of the webservice

Parameters:
prefix - the prefix of the webservice's namespace

setURI

public void setURI(java.lang.String service)
Getter for the webservice's URI

Parameters:
service - the webservice URI