Class Provider
Definition
- Namespace:
- Tizen.Applications.DataControl
- Assembly:
- Tizen.Applications.DataControl.dll
Represents the Provider class for the DataControl provider application.
public abstract class Provider : IDisposable
- Inheritance
-
objectProvider
- Implements
-
System.IDisposable
Constructors
View SourceProvider(string)
Initializes the Provider class with the dataID.
Declaration
public Provider(string dataID)
Parameters
Type | Name | Description |
---|---|---|
string | dataID | The DataControl Data ID. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown in case of an invalid parameter. |
Properties
View SourceCurrentClientAppId
Gets the current client appid.
Declaration
public string CurrentClientAppId { get; }
Property Value
Type | Description |
---|---|
string |
CurrentProviderId
Gets the current provider ID.
Declaration
public string CurrentProviderId { get; }
Property Value
Type | Description |
---|---|
string |
DataID
Gets the data ID.
Declaration
public string DataID { get; }
Property Value
Type | Description |
---|---|
string |
Methods
View SourceDispose()
Releases all the resources used by the Provider class.
Declaration
public void Dispose()
Dispose(bool)
Releases unmanaged resources used by the Provider class specifying whether to perform a normal dispose operation.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | true for a normal dispose operation; false to finalize the handle. |
~Provider()
Destructor of the Provider class.
Declaration
protected ~Provider()
OnBulkInsert(IEnumerable<string>, BulkData)
Overrides this method if you want to handle the behavior when the bulk insert request is received.
Declaration
protected virtual BulkInsertResult OnBulkInsert(IEnumerable<string> query, BulkData bulkInsertData)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T><string> | query | The insert query list. |
BulkData | bulkInsertData | The bulk insert data. |
Returns
Type | Description |
---|---|
BulkInsertResult | The result of bulk insert operation. |
OnDataChangeListenRequest(string)
Overrides this method if you want to handle the behavior when the data change listen request is received.
Declaration
protected virtual DataChangeListenResult OnDataChangeListenRequest(string requestAppID)
Parameters
Type | Name | Description |
---|---|---|
string | requestAppID | The app ID sent data change listen request. |
Returns
Type | Description |
---|---|
DataChangeListenResult | The result of data change listen operation. |
OnDelete(string, string)
Overrides this method if you want to handle the behavior when the delete request is received.
Declaration
protected abstract DeleteResult OnDelete(string query, string where)
Parameters
Type | Name | Description |
---|---|---|
string | query | The delete query. |
string | where | The where statement. |
Returns
Type | Description |
---|---|
DeleteResult | The result of delete operation. |
OnInsert(string, Bundle)
Overrides this method if you want to handle the behavior when the insert request is received.
Declaration
protected abstract InsertResult OnInsert(string query, Bundle insertData)
Parameters
Type | Name | Description |
---|---|---|
string | query | The select query. |
Bundle | insertData | The insert data. |
Returns
Type | Description |
---|---|
InsertResult | The result of insert operation. |
OnMapAdd(string, string)
Overrides this method if you want to handle the behavior when the map add request is received.
Declaration
protected virtual MapAddResult OnMapAdd(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of added data. |
string | value | The value of added data. |
Returns
Type | Description |
---|---|
MapAddResult | The result of add operation. |
OnMapBulkAdd(BulkData)
Overrides this method if you want to handle the behavior when the bulk add request is received.
Declaration
protected virtual MapBulkAddResult OnMapBulkAdd(BulkData bulkAddData)
Parameters
Type | Name | Description |
---|---|---|
BulkData | bulkAddData | The bulk add data. |
Returns
Type | Description |
---|---|
MapBulkAddResult | The result of bulk add operation. |
OnMapGet(string)
Overrides this method if you want to handle the behavior when the map get request is received.
Declaration
protected virtual MapGetResult OnMapGet(string key)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of requested data. |
Returns
Type | Description |
---|---|
MapGetResult | The result of get operation. |
OnMapRemove(string, string)
Overrides this method if you want to handle the behavior when the delete request is received.
Declaration
protected virtual MapRemoveResult OnMapRemove(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of removed data. |
string | value | The value of removed data. |
Returns
Type | Description |
---|---|
MapRemoveResult | The result of remove operation. |
OnMapSet(string, string, string)
Overrides this method if you want to handle the behavior when the update request is received.
Declaration
protected virtual MapSetResult OnMapSet(string key, string oldValue, string newValue)
Parameters
Type | Name | Description |
---|---|---|
string | key | The key of set data. |
string | oldValue | The old value of set data. |
string | newValue | The new value. |
Returns
Type | Description |
---|---|
MapSetResult | The result of set operation. |
OnSelect(string, string, string[], int, string, int, int)
Overrides this method if you want to handle the behavior when the select request is received.
Declaration
protected abstract SelectResult OnSelect(string query, string where, string[] columList, int columnCount, string order, int pageNum, int countPerPage)
Parameters
Type | Name | Description |
---|---|---|
string | query | The select query. |
string | where | The where statement. |
string[] | columList | The requested column list. |
int | columnCount | The requested column count. |
string | order | The select order. |
int | pageNum | The page number. |
int | countPerPage | The count per page. |
Returns
Type | Description |
---|---|
SelectResult | The result of select operation. |
OnUpdate(string, string, Bundle)
Overrides this method if you want to handle the behavior when the update request is received.
Declaration
protected abstract UpdateResult OnUpdate(string query, string where, Bundle updateData)
Parameters
Type | Name | Description |
---|---|---|
string | query | The update query. |
string | where | The where statement. |
Bundle | updateData | The update data. |
Returns
Type | Description |
---|---|
UpdateResult | The result of update operation. |
Run()
Starts the Provider service.
Declaration
public void Run()
Remarks
Only one Provider service can be run for each process.
Exceptions
Type | Condition |
---|---|
System.UnauthorizedAccessException | Thrown in case a permission is denied. |
System.InvalidOperationException | Thrown in case of any internal error. |
SendDataChange(ChangeType, Bundle)
Sends a data change notification to consumer applications which have successfully added a data change listen.
Declaration
public void SendDataChange(ChangeType type, Bundle changedData)
Parameters
Type | Name | Description |
---|---|---|
ChangeType | type | The changed data type. |
Bundle | changedData | Customized information about the changed data. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown in case of an invalid parameter. |
System.UnauthorizedAccessException | Thrown in case a permission is denied. |
System.InvalidOperationException | Thrown in case of any internal error. |
Stop()
Stops the Provider service.
Declaration
public void Stop()