- TIBCO BusinessEvents®
- ActiveSpaces(Deprecated)
- Metaspace
- Space

# Metaspace.Space

## Description

Space functions

## Categories

Name | Description
--- | ---
`Options` | Options functions
`Result` | Result functions

## Functions

Name | Signature and Synopsis
--- | ---
`close` | `void close (String spaceName)` Close the Space. The space name specified must be prefixed with the Metaspace name as ms.S1
`closeAll` | `void closeAll (String spaceName)` Close the Space and release all resources. The space name specified must be prefixed with the Metaspace name as ms.S1
`compareAndPut` | `Object compareAndPut (String spaceName, Tuple compareTuple, Tuple updateTuple, Object... varargs)` Compare the tuple in the space with the tuple passed as the compareTuple. If comparison result to True, set the tuple in the space with the specified tuple. Return the tuple that is currently in the space. The varargs can be PutOptions object, or individually specified value
`compareAndPutAll` | `Object compareAndPutAll (String spaceName, Object compareTuples, Object updateTuples, Object ... varags)` Batch compareAndPut operation.
`compareAndTake` | `Object compareAndTake (String spaceName, Object compareTuple, Object ... varargs)` Compare the entry with the entry passed; and if equals, then take (atomic remove) it.
`compareAndTakeAll` | `Object compareAndTakeAll (String spaceName, Object compareTuples, Object ... varargs)` Batch compareAndTake operation.
`get` | `Object get (String spaceName, Object keyTuple)` Get the value from the Space for the specified key.
`getAll` | `Object getAll (String spaceName, Object tupleList)` Batch get operation.
`getCachePolicy` | `String getCachePolicy (Object spaceDef)` Gets cache policy for provided space definition.
`getCapacity` | `long getCapacity (Object spaceDef)` Gets cache capacity for provided space definition.
`getMetaspaceName` | `String getMetaspaceName (String spaceName)` Retrieve the name of the Metaspace that the Space belongs to.
`getPersistencePolicy` | `String getPersistencePolicy (Object spaceDef)` Gets persistence policy for provided space definition.
`getPersistenceType` | `String getPersistenceType (Object spaceDef)` Gets persistence type for provided space definition.
`getReplicationCount` | `int getReplicationCount (Object spaceDef)` Gets cache replication count for provided space definition.
`getReplicationPolicy` | `String getReplicationPolicy (Object spaceDef)` Gets replication policy for provided space definition.
`getSpaceDef` | `Object getSpaceDef (String spaceName)` Retrieve the attributes used to create the Space. If requested space is not found, then a default space definition will be returned.
`getSpaceState` | `String getSpaceState (String spaceName)` Return state of space
`invoke` | `void invoke (String spaceName, Object keyTuple, String codeName, Object contextTuple, Object... varargs)` Causes execution of the invoke method from the specified class on the Member of the Space where the entry associated with the key specified in tuple is stored. If an entry for the key does not exist in the Space, the invoke method is executed on the Member of the Space where the entry would have been stored.
`invokeLeeches` | `Object invokeLeeches(String spaceName, String codeName, Object contextTuple, Object... varargs)` Invokes in parallel the appropriate invoke method of the specified class on all of the members of the Space which have a distribution role of leech.
`invokeMember` | `void invokeMember (String spaceName, Object member, String codeName, Object contextTuple, Object... varargs)` Causes execution of the invoke method of the specified class on the specific Member of the Space passed as an argument.
`invokeRemoteMembers` | `Object invokeRemoteMembers (Class arg0, Object arg1)` Causes execution of the invoke method of the specified class on all remote members.
`invokeSeeders` | `Object invokeSeeders (Class arg0, Object arg1)` Causes execution of the invoke method of the specified class on all the seeders.
`isReady` | `boolean isReady (String spaceName)` Check whether the Space is ready for operations.
`load` | `void load (String space, Object tuple)` Load behaves exactly as a put, except that it does not trigger 'Persister.onWrite(com.tibco.as.space.persistence.WriteAction)' method.
`loadAll` | `Object loadAll (String spaceName, java.util.Collection tuples)` Batch load operation.
`lock` | `Object lock (String spaceName, Object tuple, Object ... varargs)` Locks the entry stored in the Space which has the key specified in the given Tuple.
`lockAll` | `Object lockAll (String spaceName, Object tuples, Object... varargs)` Batch lock operation.
`put` | `Object put(String spaceName, Object tuple, Object... varargs)` Stores a Tuple into the Space and returns any entry already stored in the Space with the same key. This version of put allows you to specify a lock wait value, lock or unlock value, and a forget value.
`putAll` | `Object putAll (String spaceName, Object tuples, Object... varargs)` Batch put operation.
`setCachePolicy` | `String setCachePolicy (Object spaceDef, String policy)` Sets cache policy for provided space definition.
`setCapacity` | `long setCapacity (Object spaceDef, long capacity)` Sets cache capacity for provided space definition.
`setDistributionRole` | `void setDistributionRole (String spaceName, String role)` Sets the distribution role of the calling Member of the Space.
`setPersistencePolicy` | `String setPersistencePolicy (Object spaceDef, String policy)` Sets persistence policy for provided space definition.
`setPersistenceType` | `String setPersistenceType (Object spaceDef, String persistenceType)` Sets persistence type for provided space definition.
`setPersister` | `Object setPersister (String spaceName, Object persister)` Registers the given Persister object as a persister for the Space.
`setReplicationCount` | `int setReplicationCount (Object spaceDef, int replication)` Sets cache replication count for provided space definition.
`setReplicationPolicy` | `int setReplicationPolicy (Object spaceDef, String policy)` Sets replication policy for provided space definition.
`size` | `long size (String spaceName)` Retrieves the number of entries stored in the Space.
`take` | `Object take (String spaceName, Object tuple, Object... varargs)` Returns and atomically removes from the Space the entry (if one exists) whose key field matches the key field of the Tuple provided. This method allows you to specify lock wait, lock/unlock/forget options.
`takeAll` | `Object takeAll (String spaceName, Object tuples, Object... varargs)` Batch take operation.
`unlock` | `void unlock (String spaceName, Object tuple, Object ... varargs)` Unlocks the entry stored in the Space which has the key specified in the given Tuple.
`unlockAll` | `Object unlockAll (String spaceName, Object tuples, Object... varargs)` Batch unlock operation.
`waitForReady` | `boolean waitForReady (String spaceName, long time2Wait)` Causes the client code to block until the Space is ready for operations or the specified timeout is reached.