# Interface: IDataspaceApp

Interface describes a Dataspace App.

## Extends

- `IComponent`

## Methods

### processingGroups()? {#processinggroups}

> `optional` **processingGroups**(): `object`

The settings for the processing groups for tasks.

#### Returns

`object`

The options for each process group.

***

### activitiesHandled() {#activitieshandled}

> **activitiesHandled**(): [`IActivityQuery`](IActivityQuery.md)[]

The activities handled by the App.

#### Returns

[`IActivityQuery`](IActivityQuery.md)[]

A query that describes the set of activities handled by the App.

***

### supportedQueryTypes() {#supportedquerytypes}

> **supportedQueryTypes**(): `string`[]

The types of queries supported.

#### Returns

`string`[]

The types of queries supported by the Dataspace App to retrieve data.

***

### handleActivity()? {#handleactivity}

> `optional` **handleActivity**\<`T`\>(`activity`): `Promise`\<`T`\>

Handles an Activity and report about results through the Dataspace Data Plane Callback

#### Type Parameters

##### T

`T`

#### Parameters

##### activity

[`IDataspaceActivity`](IDataspaceActivity.md)

The Activity to be handled

#### Returns

`Promise`\<`T`\>

The result of executing the Activity.

***

### handleDataRequest()? {#handledatarequest}

> `optional` **handleDataRequest**(`dataRequest`, `cursor?`, `limit?`): `Promise`\<\{ `data`: `IJsonLdDocument`; `cursor?`: `string`; \}\>

Handles a Data Request.

#### Parameters

##### dataRequest

[`IDataRequest`](../type-aliases/IDataRequest.md)

The data request.

##### cursor?

`string`

Cursor that points to the next item in the result set.

##### limit?

`number`

Maximum number of entries retrieved or to be retrieved.

#### Returns

`Promise`\<\{ `data`: `IJsonLdDocument`; `cursor?`: `string`; \}\>

Data as JSON-Ld.

***

### subscribeToData()? {#subscribetodata}

> `optional` **subscribeToData**(`followActivity`): `Promise`\<`void`\>

Subscribe the app to produce data for a follower. Called by the
DS Connector after a push transfer enters STARTED state.

#### Parameters

##### followActivity

[`IFollowActivity`](IFollowActivity.md)

The Follow activity describing the follower + filter.

#### Returns

`Promise`\<`void`\>

Promise that resolves when the subscription is set up.

***

### unsubscribeToData()? {#unsubscribetodata}

> `optional` **unsubscribeToData**(`undoActivity`): `Promise`\<`void`\>

Undo a previous subscription. Called on transfer complete/terminate.

#### Parameters

##### undoActivity

[`IUndoActivity`](IUndoActivity.md)

The Undo activity referencing the original Follow.

#### Returns

`Promise`\<`void`\>

Promise that resolves when the subscription is torn down.
