Objective-C API Library Reference  4.3.0-42-g45f162a
 All Classes Functions Typedefs Properties Pages
Public Functions | List of all members
PWSessionStorage Class Reference

The PWSessionStorage class provides an automatically synchronized and subscribable key/value store, private between this client and the service application. Obtain one from a PWWebClient using the getSessionStorage member.

This class can be used to set/get values into the session store, and you can register a selector to listen for changes to particular keys in the store.

Public Functions

(void) - addValueChangedHandler:target:action:
 
(BOOL) - containsKey:
 
(NSArray *) - getKeys
 
(NSString *) - getValue:
 
(instancetype) - initWithClient:
 
(void) - removeAllValueChangedHandlers:
 
(void) - removeValue:
 
(void) - removeValue:withSuppression:
 
(void) - removeValueChangedHandler:target:action:
 
(void) - setKey:toValue:
 
(void) - setKey:toValue:withSuppression:
 

Methods Descriptions

- (void) addValueChangedHandler: (NSString *)  key
target: (id)  target
action: (SEL)  action 

Registers a changed handler for a value in session storage. When the specified value changes, the associated handling function will be called.

Parameters
keyThe key whose corresponding value you want to watch for changes.
targetThe object to notify of the event.
actionThe handling function to execute when the value changes.
- (BOOL) containsKey: (NSString *)  key

Determines if a given key exists in session storage.

Parameters
keyThe key that will be tested for its presence.
- (NSArray*) getKeys

Returns an array of all the keys in session storage.

- (NSString*) getValue: (NSString *)  key

Gets the value for a particular key from session storage.

Parameters
keyThe key for which the corresponding value will be returned.
- (instancetype) initWithClient: (PWWebClient *)  client

Initializes a new instance of PWSessionStorage.

Parameters
clientAn instance of PWWebClient.
- (void) removeAllValueChangedHandlers: (NSString *)  key

Unregisters all value changed handlers associated with the specified key in session storage.

Parameters
keyThe key
- (void) removeValue: (NSString *)  key

Removes a key/value pair from session storage.

Parameters
keyThe key which will be removed, along with the corresponding value.
- (void) removeValue: (NSString *)  key
withSuppression: (BOOL)  suppressHandlers 

Removes a key/value pair from session storage, with the option of suppressing change handlers once it is removed.

Parameters
keykey The key which will be removed, along with the corresponding value.
suppressHandlersSet to YES to suppress change handlers, or set to NO otherwise.
- (void) removeValueChangedHandler: (NSString *)  key
target: (id)  target
action: (SEL)  action 

Unregisters the specified value changed handler for session storage.

Parameters
keyThe key to the value in session storage.
targetThe object to notify of the event.
actionThe handler that you are unregistering.
- (void) setKey: (NSString *)  key
toValue: (NSString *)  value 

Sets the value for a particular key in session storage. If the key doesn't exist, it will be added.

Parameters
keyThe key under which to store the value.
valueThe value to store.
- (void) setKey: (NSString *)  key
toValue: (NSString *)  value
withSuppression: (BOOL)  suppressHandlers 

Sets the value for a particular key in session storage, with the option of suppressing change handlers when the value is set.

Parameters
keyThe key under which to store the value.
valueThe value to store.
suppressHandlersSet to yes to suppress the change handlers for this change, or set to no otherwise.