A QUICK sample/snippet on reading from a pipe.....
...
/**
* Reads all the data from the underlying server connection.
*
- @param success A block object to be executed when the request operation finishes successfully.
/** | |
* AGPipe represents a server connection. An object of this class is responsible to | |
* communicate with the server and perfoms read/write operations. | |
*/ | |
@protocol AGPipe <NSObject> | |
/** | |
* Returns the type of the underlying 'pipe implementation' | |
*/ | |
@property (nonatomic, readonly) NSString* type; |
... | |
// get access to the 'projects' pipe.. | |
... | |
// query all records, by invoking the read function on the actual pipe/connection: | |
[projectPipe read:^(id responseObject) { | |
// get's invoked when the response returns.... | |
// do something with the data.... or just log it to the console..... | |
NSLog(@"Projects: %@", responseObject); | |
} failure:^(NSError *error) { |
/* | |
* JBoss, Home of Professional Open Source | |
* Copyright 2012, Red Hat, Inc., and individual contributors | |
* by the @authors tag. See the copyright.txt in the distribution for a | |
* full listing of individual contributors. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* http://www.apache.org/licenses/LICENSE-2.0 |
... | |
// get access to the projects pipe | |
projectsPipe = [todoPipeline get:@"projects"]; | |
... | |
__block id dataStructure = nil; | |
[projectsPipe read:^(id responseObject) { | |
// store the received data inside of | |
// the running application: |
var baseURL = "http://todo-aerogear.rhcloud.com/todo-server/"; | |
var endpoint = "tasks"; | |
console.log(baseURL+endpoint); |
/** | |
* AGStore represents an abstraction layer for a storage system. | |
*/ | |
@protocol AGStore <NSObject> | |
/** | |
* Reads all the data from the underlying storage system. | |
* | |
* @param success A block object to be executed when the operation finishes successfully. | |
* This block has no return value and takes one argument: A collection, containing all stored |
/** | |
* AGDataManager manages different AGStore implementations. It is basically a | |
* factory that hides the concrete instanciation of a specific AGStore implementation. | |
* The class offers simple APIs to add, remove or get access to a 'data store'. | |
* | |
* NOTE: Right now, there is NO automatic data sync. This is up to the user. | |
*/ | |
@interface AGDataManager : NSObject | |