AGPipeline Class Reference
Inherits from | NSObject |
Declared in | AGPipeline.h AGPipeline.m |
Overview
AGPipeline represents a ‘collection’ of server connections (aka Pipes). It provides a standard way to communicate with the server no matter the data format or transport expected. It contains some simple management APIs to create and remove Pipe objects.
Creating a Pipeline and a Pipe object
Below is an example that creates a Pipeline to AeroGear TODO server application and adds a Pipe to it, that points to the projects REST endpoint.
NSString* baseURL = @"http://todo-aerogear.rhcloud.com/todo-server/";
// create the 'todo' pipeline, which points to the baseURL of the REST application
AGPipeline* todo = [AGPipeline pipelineWithBaseURL:[NSURL URLWithString:baseURL]];
// Add a REST pipe for the 'projects' endpoint
id<AGPipe> projects = [todo pipe:^(id<AGPipeConfig> config) {
[config setName:@"projects"];
[config setType:@"REST"]; // this is the default, can be emitted
}];
Class Methods
Instance Methods
init
An initializer method to instantiate an empty AGPipeline.
- (id)init
Return Value
the AGPipeline object.
Discussion
An initializer method to instantiate an empty AGPipeline.
Declared In
AGPipeline.h
initWithBaseURL:
An initializer method to instantiate an empty AGPipeline.
- (id)initWithBaseURL:(NSURL *)baseURL
Parameters
- baseURL
the URL of the server.
Return Value
the AGPipeline object.
Discussion
An initializer method to instantiate an empty AGPipeline.
Declared In
AGPipeline.h
pipe:
Adds a new AGPipe object, based on the given configuration object.
- (id<AGPipe>)pipe:(void ( ^ ) ( id<AGPipeConfig> config ))config
Parameters
- config
A block object which passes in an implementation of the AGPipeConfig protocol that is used to configure the AGPipe object.
Return Value
the newly created AGPipe object.
Discussion
Adds a new AGPipe object, based on the given configuration object.
Declared In
AGPipeline.h
pipeWithName:
Look up for a pipe object.
- (id<AGPipe>)pipeWithName:(NSString *)name
Parameters
- name
the name of the actual pipe.
Return Value
the new created AGPipe object.
Discussion
Look up for a pipe object.
Declared In
AGPipeline.h
remove:
Removes a pipe from the AGPipeline object.
- (id<AGPipe>)remove:(NSString *)name
Parameters
- name
the name of the actual pipe.
Return Value
the new created AGPipe object.
Discussion
Removes a pipe from the AGPipeline object.
Declared In
AGPipeline.h