Package org.jspace
Class RemoteSpace
java.lang.Object
org.jspace.RemoteSpace
- All Implemented Interfaces:
Space
public class RemoteSpace extends java.lang.Object implements Space
-
Constructor Summary
Constructors Constructor Description RemoteSpace(java.lang.String uri)RemoteSpace(java.net.URI uri) -
Method Summary
Modifier and Type Method Description voidclose()java.lang.Object[]get(TemplateField... fields)Retrieves (and remove) a tuple matching the requested template.java.util.List<java.lang.Object[]>getAll(TemplateField... fields)Retrieves (and remove) all the tuples matching a template.ClientGategetGate()java.lang.Object[]getp(TemplateField... fields)Retrieves (and remove) a tuple matching the requested template.java.net.URIgetUri()booleanput(java.lang.Object... fields)Adds a tuple in the space.java.lang.Object[]query(TemplateField... fields)Reads (without removing) a tuple matching the requested template.java.util.List<java.lang.Object[]>queryAll(TemplateField... fields)Reads (without removing) all the tuples matching the requested template.java.lang.Object[]queryp(TemplateField... fields)Reads (without removing) a tuple matching the requested template.intsize()Returns the number of tuples that are stored in the space.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
RemoteSpace
public RemoteSpace(java.net.URI uri) throws java.net.UnknownHostException, java.io.IOException- Throws:
java.net.UnknownHostExceptionjava.io.IOException
-
RemoteSpace
public RemoteSpace(java.lang.String uri) throws java.net.UnknownHostException, java.io.IOException- Throws:
java.net.UnknownHostExceptionjava.io.IOException
-
-
Method Details
-
size
public int size()Description copied from interface:SpaceReturns the number of tuples that are stored in the space. -
put
public boolean put(java.lang.Object... fields) throws java.lang.InterruptedExceptionDescription copied from interface:SpaceAdds a tuple in the space. -
get
Description copied from interface:SpaceRetrieves (and remove) a tuple matching the requested template. A template is rendered as an array ofTemplateField. The returned, sayresultwill satisfy the following properties:-
result.length==fields.length; - for any
i,fields[i].match(return[i])==true.
-
-
getp
Description copied from interface:SpaceRetrieves (and remove) a tuple matching the requested template. A template is rendered as an array ofTemplateField. The returned, sayresultwill satisfy the following properties:-
result.length==fields.length; - for any
i,fields[i].match(return[i])==true.
nullis returned.- Specified by:
getpin interfaceSpace- Parameters:
fields- an array of template fields representing a template- Returns:
- a tuple matching the template or
nullif no tuple matches the template - Throws:
java.lang.InterruptedException- if any thread interrupted the current thread before the action is executed.
-
-
getAll
public java.util.List<java.lang.Object[]> getAll(TemplateField... fields) throws java.lang.InterruptedExceptionDescription copied from interface:SpaceRetrieves (and remove) all the tuples matching a template. If no matching tuple is found, the empty list is returned. -
query
Description copied from interface:SpaceReads (without removing) a tuple matching the requested template. A template is rendered as an array ofTemplateField. The returned, sayresultwill satisfy the following properties:-
result.length==fields.length; - for any
i,fields[i].match(return[i])==true.
-
-
queryp
Description copied from interface:SpaceReads (without removing) a tuple matching the requested template. A template is rendered as an array ofTemplateField. The returned, sayresultwill satisfy the following properties:-
result.length==fields.length; - for any
i,fields[i].match(return[i])==true.
nullis returned if no matching tuple is found.- Specified by:
querypin interfaceSpace- Parameters:
fields- an array of template fields representing the requested template- Returns:
- a list containing all the tuples matching the template
- Throws:
java.lang.InterruptedException- if any thread interrupted the current thread before the action is executed.
-
-
queryAll
public java.util.List<java.lang.Object[]> queryAll(TemplateField... fields) throws java.lang.InterruptedExceptionDescription copied from interface:SpaceReads (without removing) all the tuples matching the requested template. A template is rendered as an array ofTemplateField. The returned, sayresultwill satisfy the following properties:-
result.length==fields.length; - for any
i,fields[i].match(return[i])==true.
- Specified by:
queryAllin interfaceSpace- Parameters:
fields- an array of template fields representing the requested template- Returns:
- a list containing all the tuples matching the template
- Throws:
java.lang.InterruptedException- if any thread interrupted the current thread before the action is executed.
-
-
getUri
public java.net.URI getUri() -
getGate
-
close
public void close() throws java.io.IOException- Throws:
java.io.IOException
-