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

The PWMultipartEventPublisher class is an implementation of PWNamedEventPublisher that manages event subscription and notifications for multipart messages received from the service application.

Public Functions

(BOOL) - addHandler:path:target:action:
 
(BOOL) - addSubscriber:target:action:
 
(NSUInteger) - count
 
(BOOL) - fireEvent:object:
 
(BOOL) - fireEvent:path:object:
 
(BOOL) - fireEventOnMainThread:object:
 
(BOOL) - handlerExistsForType:path:
 
(NSString *) - keyForType:path:
 
(BOOL) - removeHandler:path:target:action:
 
(BOOL) - removeSubscriber:target:action:
 
(void) - removeSubscribersForTarget:
 
(BOOL) - subscriberExists:
 

Public Static Functions

(PWNamedEventPublisher *) + publisher
 

Methods Descriptions

- (BOOL) addHandler: (NSString *)  type
path: (NSString *)  path
target: (id)  target
action: (SEL)  action 

Adds a handler (observer) for a multipart type and path. Returns YES if handler was added, NO if it was not.

Parameters
typeThe multipart.
pathThe multipart path.
targetThe target object to be notified of the event.
actionThe selector to be called when the event occurs.
- (BOOL) addSubscriber: (NSString *)  key
target: (id)  target
action: (SEL)  action 

Adds a handler (observer) for the specified key. Returns YES if a handler was added, or NO if it was not.

Parameters
keyThe key.
targetThe target object to be notified of the event.
actionThe selector to be called when the event occurs.
- (NSUInteger) count

Returns the total number of subscribers.

- (BOOL) fireEvent: (NSString *)  key
object: (id)  object 

Executes the handler for the specified key. Returns YES if event was found and executed, or NO if it was not.

Parameters
keyThe key.
objectThe object to pass to target/action.
- (BOOL) fireEvent: (NSString *)  type
path: (NSString *)  path
object: (id)  object 

Executes the handler for the specified multipart type and path. Returns YES if handler was found and executed, or NO if it was not.

Parameters
typeThe multipart type.
pathThe multipart path.
objectThe object to pass to to the target/action.
- (BOOL) fireEventOnMainThread: (NSString *)  key
object: (id)  object 

Executes the handler for the specified key on the main thread. Returns YES if event was found and executed, or NO if the handler was not found.

Parameters
keyThe key.
objectThe object to pass to target/action.
- (BOOL) handlerExistsForType: (NSString *)  type
path: (NSString *)  path 

Tests to see if handler exists for specified multipart type and path. Returns YES if handler was found, NO if it was not.

- (NSString*) keyForType: (NSString *)  type
path: (NSString *)  path 

Helper method that returns the key for the specified type and path.

+ (PWNamedEventPublisher *) publisher

Returns an autoreleased publisher.

- (BOOL) removeHandler: (NSString *)  type
path: (NSString *)  path
target: (id)  target
action: (SEL)  action 

Removes a handler (observer) for a multipart type and path. Returns YES if handler was removed, NO if it was not.

Parameters
typeThe multipart type.
pathThe multipart path.
targetThe target object to be notified of the event.
actionThe selector to be called when the event occurs.
- (BOOL) removeSubscriber: (NSString *)  key
target: (id)  target
action: (SEL)  action 

Removes a handler (observer) for the specified key. Returns YES if a handler was removed, or NO if it was not.

Parameters
keyThe key.
targetThe target object to be notified of the event.
actionThe selector to be called when the event occurs.
- (void) removeSubscribersForTarget: (id)  target

Removes all handlers for the specified target.

- (BOOL) subscriberExists: (NSString *)  key

Returns a Boolean value indicating whether the specified subscriber exists.