public PushRequest(AbstractClient client, string collection, ICache <T> cache, ISyncQueue queue, WritePolicy policy) : base(client, collection, cache, queue, policy) { }
static internal void Initialize(string channelGroup, string publishKey, string subscribeKey, string authKey, AbstractClient client, RealtimeReconnectionPolicy realtimeReconnectionPolicy) { if (instance == null) { lock (lockObject) { if (instance == null) { instance = new RealtimeRouter(); if (instance.pubnubClient == null) { PubnubApi.PNConfiguration PNconfig = new PubnubApi.PNConfiguration(); PNconfig.SubscribeKey = subscribeKey; PNconfig.PublishKey = publishKey; PNconfig.AuthKey = authKey; PNconfig.Secure = true; PNconfig.ReconnectionPolicy = realtimeReconnectionPolicy.ConvertToPNReconnectionPolicy(); instance.pubnubClient = new PubnubApi.Pubnub(PNconfig); instance.subscribeCallback = new PubnubApi.SubscribeCallbackExt( (pubnubObj, message) => { instance.SubscribeCallback(message.Channel, message.Message as string); }, (pubnubObj, presence) => { /* presence not currently supported */ }, // TODO Support PubNub presence (pubnubObj, status) => { instance.HandleStatusMessage(status); } ); instance.pubnubClient.AddListener(instance.subscribeCallback); instance.ChannelGroup = channelGroup; instance.pubnubClient.Subscribe <string>().ChannelGroups(new string[] { instance.ChannelGroup }).Execute(); //FOR UNIQUE DEVICE GUID GENERATION --> Guid deviceGUID = pubnubClient.GenerateGuid(); string deviceID = deviceGUID.ToString(); instance.KinveyClient = client; instance.mapChannelToCallback = new Dictionary <string, KinveyRealtimeDelegate>(); } } } } }
/// <summary> /// Initializes a new instance of the <see cref="RemoveRequest{T}"/> class. /// </summary> /// <param name="query">Query.</param> /// <param name="client">Client that the user is logged in.</param> /// <param name="collection">Collection name.</param> /// <param name="cache">Cache.</param> /// <param name="sync">Synchronization queue.</param> /// <param name="policy">Write policy.</param> public RemoveRequest(IQueryable <object> query, AbstractClient client, string collection, ICache <T> cache, ISyncQueue sync, WritePolicy policy) : base(client, collection, cache, sync, policy) { _query = query; }
/// <summary> /// Initializes a new instance of the <see cref="PagedPullRequest{T}"/> class. /// </summary> /// <param name="client">Client that the user is logged in.</param> /// <param name="collection">Collection name.</param> /// <param name="cache">Cache.</param> /// <param name="deltaSetFetchingEnabled">If set to <c>true</c> delta set fetching enabled.</param> /// <param name="query">Query.</param> /// <param name="count">Limit of entities.</param> /// <param name="isInitial">If <c>true</c> then entities received from backend are expected to be not existing in Cache, otherwise <c>false</c>.</param> public PagedPullRequest(AbstractClient client, string collection, ICache <T> cache, bool deltaSetFetchingEnabled, IQueryable <object> query, int count, bool isInitial) : base(client, collection, cache, query, ReadPolicy.FORCE_NETWORK, deltaSetFetchingEnabled) { this.count = count; this.isInitial = isInitial; }
/// <summary> /// Initializes a new instance of the <see cref="T:KinveyXamarin.CustomEndpoint`2"/> class. /// </summary> /// <param name="client">Client.</param> public CustomEndpoint(AbstractClient client) { this.client = client; customRequestProperties = client.GetCustomRequestProperties(); }
public Request(AbstractClient client) { this.Client = client; }
internal UploadMetaDataRequest(FileMetaData meta, Dictionary <string, string> urlProperties, AbstractClient client) : base(client, "PUT", REST_PATH, meta, urlProperties) { this.fileID = urlProperties["fileID"]; }
public AbstractDataRequest(AbstractClient client, string method, string template, Object httpContent, string collection) : base(client, method, template, httpContent, new Dictionary <string, string>()) { this.CollectionName = collection; uriResourceParameters.Add("appKey", ((KinveyClientRequestInitializer)client.RequestInitializer).AppKey); uriResourceParameters.Add("collectionName", collection); }
public GetCountRequest(AbstractClient client, string collection, ICache <T> cache, ReadPolicy policy, bool deltaSetFetchingEnabled, KinveyDelegate <uint> cacheDelegate, IQueryable <object> query) : base(client, collection, cache, query, policy, deltaSetFetchingEnabled) { this.cacheDelegate = cacheDelegate; }
internal UploadFileWithMetaDataRequest(FileMetaData meta, string mode, Dictionary <string, string> urlProperties, AbstractClient client) : base(client, mode, REST_PATH, meta, urlProperties) { if (mode.Equals("PUT")) { this.fileID = urlProperties["fileID"]; this.uriTemplate += "/{fileID}"; } }
/// <summary> /// Gets an instance of the <see cref="DataStore{T}"/>. /// </summary> /// <returns>The DataStore instance.</returns> /// <param name="type">The <see cref="DataStoreType"/> of this DataStore instance</param> /// <param name="collectionName">Collection name of the Kinvey collection backing this DataStore</param> /// <param name="client">[optional] Kinvey Client used by this DataStore. If the client is not specified, the <see cref="Client.SharedClient"/> is used.</param> public static DataStore <T> Collection(string collectionName, DataStoreType type, AbstractClient client = null) { // TODO do we need to make this a singleton based on collection, store type and store ID? return(new DataStore <T> (type, collectionName, client)); }
public static DataStore <T> Collection(string collectionName, AbstractClient client = null) { return(new DataStore <T>(DataStoreType.CACHE, collectionName, client)); }
/// <summary> /// Initializes a new instance of the <see cref="KinveyXamarin.AbstractKinveyClientRequest`1"/> class. /// </summary> /// <param name="client">Client.</param> /// <param name="requestMethod">Request method.</param> /// <param name="uriTemplate">URI template.</param> /// <param name="httpContent">Http content.</param> /// <param name="uriParameters">URI parameters.</param> protected AbstractKinveyClientRequest(AbstractClient client, string requestMethod, string uriTemplate, Object httpContent, Dictionary <string, string> uriParameters) : this(client, client.BaseUrl, requestMethod, uriTemplate, httpContent, uriParameters) { }
/// <summary> /// Initializes a new instance of the <see cref="PullRequest{T}"/> class. /// </summary> /// <param name="client">Client that the user is logged in.</param> /// <param name="collection">Collection name.</param> /// <param name="cache">Cache.</param> /// <param name="deltaSetFetchingEnabled">If set to <c>true</c> delta set fetching enabled.</param> /// <param name="query">Query.</param> public PullRequest(AbstractClient client, string collection, ICache <T> cache, bool deltaSetFetchingEnabled, IQueryable <object> query) : base(client, collection, cache, query, ReadPolicy.FORCE_NETWORK, deltaSetFetchingEnabled) { }
internal DownloadMetaDataRequest(Dictionary <string, string> urlProperties, AbstractClient client) : base(client, "GET", REST_PATH, default(FileMetaData), urlProperties) { this.fileID = urlProperties["fileID"]; }
/// <summary> /// Initializes a new instance of the <see cref="NetworkFactory"/> class. /// </summary> /// <param name="client">Client that the user is logged in.</param> public NetworkFactory(AbstractClient client) { this.client = client; }
internal DeleteFileAndMetaDataRequest(Dictionary <string, string> urlProperties, AbstractClient client) : base(client, "DELETE", REST_PATH, default(KinveyDeleteResponse), urlProperties) { this.fileID = urlProperties["fileID"]; }
internal PingRequest(AbstractClient client, Dictionary <string, string> urlProperties) : base(client, "GET", REST_PATH, default(PingResponse), urlProperties) { }
/// <summary> /// Initializes a new instance of the <see cref="SaveRequest{T}"/> class. /// </summary> /// <param name="entity">Entity.</param> /// <param name="client">Client that the user is logged in.</param> /// <param name="collection">Collection name.</param> /// <param name="cache">Cache.</param> /// <param name="sync">Synchronization queue.</param> /// <param name="policy">Write policy.</param> public SaveRequest(T entity, AbstractClient client, string collection, ICache <T> cache, ISyncQueue sync, WritePolicy policy) : base(client, collection, cache, sync, policy) { this.entity = entity; }
/// <summary> /// Initializes a new instance of the <see cref="FindRequest{T}"/> class. /// </summary> /// <param name="client">Client.</param> /// <param name="collection">Collection name.</param> /// <param name="cache">Cache.</param> /// <param name="policy">Read policy.</param> /// <param name="deltaSetFetchingEnabled">If set to <c>true</c> delta set fetching enabled.</param> /// <param name="cacheDelegate">Cache delegate.</param> /// <param name="query">Query.</param> /// <param name="listIDs">List identifiers.</param> public FindRequest(AbstractClient client, string collection, ICache <T> cache, ReadPolicy policy, bool deltaSetFetchingEnabled, KinveyDelegate <List <T> > cacheDelegate, IQueryable <object> query, List <string> listIDs) : base(client, collection, cache, query, policy, deltaSetFetchingEnabled, listIDs) { this.cacheDelegate = cacheDelegate; }
/// <summary> /// Initializes a new instance of the <see cref="T:KinveyXamarin.CustomCommand`2"/> class. /// </summary> /// <param name="client">Client.</param> /// <param name="endpoint">Endpoint.</param> /// <param name="input">Input.</param> /// <param name="urlProperties">URL properties.</param> public CustomEndpointRequest(AbstractClient client, string endpoint, I input, Dictionary <string, string> urlProperties) : base(client, "POST", REST_PATH, input, urlProperties) { this.endpoint = endpoint; }
/// <summary> /// Initializes a new instance of the class. /// </summary> /// <param name="client">Client.</param> /// <param name="requestMethod">Request method.</param> /// <param name="uriTemplate">URI template.</param> /// <param name="httpContent">Http content.</param> /// <param name="uriParameters">URI parameters.</param> public NetworkRequest(AbstractClient client, string requestMethod, string uriTemplate, Object httpContent, Dictionary <string, string> uriParameters) : base(client, client.BaseUrl, requestMethod, uriTemplate, httpContent, uriParameters) { }
/// <summary> /// Initializes a new instance of the <see cref="RemoveRequest{T}"/> class. /// </summary> /// <param name="entityID">Entity Id.</param> /// <param name="client">Client that the user is logged in.</param> /// <param name="collection">Collection name.</param> /// <param name="cache">Cache.</param> /// <param name="sync">Synchronization queue.</param> /// <param name="policy">Write policy.</param> public RemoveRequest(string entityID, AbstractClient client, string collection, ICache <T> cache, ISyncQueue sync, WritePolicy policy) : base(client, collection, cache, sync, policy) { this.entityID = entityID; }