org.semispace.ws
Class WsSpaceImpl

java.lang.Object
  extended by org.semispace.ws.WsSpaceImpl
All Implemented Interfaces:
WsSpace

public class WsSpaceImpl
extends Object
implements WsSpace

Implementation of unauthenticated space access.

You need to set the space.


Constructor Summary
WsSpaceImpl()
           
 
Method Summary
 String read(String template, long queryLifeMs)
          Supply an XML template, which will be matched on the first.
 String readIfExists(String template)
          Read without any timeout; You get an answer immediately
protected  Holder retrievePropertiesFromXml(String xmlsource)
          Protected for the benefit of junit test(s)
 void setSpace(SemiSpace space)
          For the benefit of spring
 String take(String template, long queryLifeMs)
          Same as read, except that the entry is removed from the space.
 String takeIfExists(String template)
           
 void write(String contents, long timeToLiveMs)
          Put XML structured data into space with given lifetime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WsSpaceImpl

public WsSpaceImpl()
Method Detail

setSpace

public void setSpace(SemiSpace space)
For the benefit of spring


write

public void write(String contents,
                  long timeToLiveMs)
Description copied from interface: WsSpace
Put XML structured data into space with given lifetime

Specified by:
write in interface WsSpace
Parameters:
contents - XML data

read

public String read(String template,
                   long queryLifeMs)
Description copied from interface: WsSpace
Supply an XML template, which will be matched on the first. In other words, the following template will be matched on firstname only:
 
   Erlend
   
      SemiSpace
   
 
The entry is left in the space

Specified by:
read in interface WsSpace
Parameters:
template - XML template
queryLifeMs - Life of query in milliseconds. Notice that you will want to repeatedly read instead of having a very long timeout (i.e. more than 30 seconds)

readIfExists

public String readIfExists(String template)
Description copied from interface: WsSpace
Read without any timeout; You get an answer immediately

Specified by:
readIfExists in interface WsSpace
See Also:
WsSpace.read(String, long)

take

public String take(String template,
                   long queryLifeMs)
Description copied from interface: WsSpace
Same as read, except that the entry is removed from the space.

Specified by:
take in interface WsSpace
See Also:
WsSpace.read(String, long)

takeIfExists

public String takeIfExists(String template)
Specified by:
takeIfExists in interface WsSpace
See Also:
WsSpace.take(String, long)

retrievePropertiesFromXml

protected Holder retrievePropertiesFromXml(String xmlsource)
Protected for the benefit of junit test(s)

Returns:
A temporary holder object containing the relevant elements found in the source.
See Also:
WsSpaceImpl#retrievePropertiesFromObject


Copyright © 2008-2012. All Rights Reserved.