The first example program you should examine is the ASOperations example.
ASOperations defines and joins (as a leech) a space called
myspace that has a very basic definition consisting of three fields.
ASOperations is a basic example that demonstrates how to connect to a metaspace, define and join a space, and invoke the basic methods of the API for performing operations on the space, such as put and get.
ASOperations is the first example that you should examine and run to get familiar with ActiveSpaces.
ASOperations is also sometimes run with other examples, so it is a good idea to become familiar with it first.
ASOperations by default joins a space (
myspace) as a leech. If you try to run
ASOperations using the default settings, you will get the following message asking you to start a seeder:
The following is an example of the command line options that you can use when starting ASOperations to have it join the security domain
exdomain and to use a space with an additional encrypted field:
These command line options start ASOperations using the default metaspace named
ms and allow it to connect to a security domain controller that has been started using the example security policy file
example_policy.txt. When you use
ASOperations to put data into the space, you will see the following additional prompt:
The value you enter at this prompt is stored into a field named secure_value that is defined as a string. Any string value that you enter in response to this prompt will be encrypted when it is stored in the space or when it is persisted. See the section
Data Encryption in Chapter 4, “Implementing ActiveSpaces Security” for information on encrypting data fields.
After ASOperations initializes, the following options are displayed, which allow you to perform actions on the space or metaspace:
s - Displays the number of entries in the space.
br - Displays the entries in the space. If no filter is specified, all entries in the space will be displayed.
p - put a tuple into a space
pm - put a list of tuples into a space
cp - do a compare and put of a tuple into a space
g - get a tuple from a space
t - take a tuple from a space
l - lock a tuple in a space
u - unlock a tuple in a space
You might also be prompted for a value. A value is a string. When prompted for a value, if you press Return instead of entering a string, the value is considered null. For example, the following key/value pairs are valid:
See Shared-Nothing Persistence for detailed information on how to run
ASOperations using the built-in shared-nothing persistence feature.