ASBatchOperations demonstrates how to perform batch operations on spaces.
ASBatchOperations is similar to
ASOperations, except that instead of getting or putting one data item at a time, you can get or put a list of data items at one time.
ASBatchOperations by default joins a space (
myspace) as a leech. If you try to run
ASBatchOperations using the default settings, you will get the following message asking you to start a seeder:
The following example shows the command line options that you can use when starting ASBatchOperations to have it join the security domain
exdomain and use a space with an additional encrypted field:
These command line options start ASBatchOperations 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 ASBatchOperations to put data into the space, you see the following additional prompt:
The value you enter at this prompt is stored into a field named secure_value, which is defined as a string. Any string value that you enter in response to this prompt is 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 ASBatchOperations initializes, the following options are displayed from the main loop of the program and allow you to perform actions on the space or metaspace:
p - put all, allows you to enter a sequence of data to be put into the space
pl - put all and lock the space entries, same as
p option except the space entries are locked.
g - get all, allows the user to enter a list of keys for entries to be retrieved from the space, retrieves the entries, then displays the entries.
t - take all, allows the user to enter a list of keys for entries to be removed from the space, removes the entries, then displays the removed entries.
l - lock all, allows the user to enter a list of keys for entries to be locked in a space, locks the entries, then displays the locked entries.
r - remove all entries in your list from the space
l - lock all entries in your list in the space
u - unlock all entries in your list in the space
p - put new values for your existing entries by doing a
compareAndPutAll()
s - Exit the suboptions menu