Skip to main content

Class: PolicyAdministrationPointService

Class implementation of Policy Administration Point Component.

Implements

  • IPolicyAdministrationPointComponent

Constructors

Constructor

new PolicyAdministrationPointService(options?): PolicyAdministrationPointService

Create a new instance of PolicyAdministrationPointService (PAP).

Parameters

options?

IPolicyAdministrationPointServiceConstructorOptions

The options for the component.

Returns

PolicyAdministrationPointService

Properties

CLASS_NAME

readonly static CLASS_NAME: string

The class name of the Policy Administration Point Service.

Methods

className()

className(): string

Returns the class name of the component.

Returns

string

The class name of the component.

Implementation of

IPolicyAdministrationPointComponent.className


create()

create(policy): Promise<string>

Create a new policy with auto-generated UID.

Parameters

policy

JsonLdObjectWithOptionalAtId<IDataspaceProtocolPolicy>

The policy to create (uid will be auto-generated).

Returns

Promise<string>

The UID of the created policy.

Implementation of

IPolicyAdministrationPointComponent.create


update()

update(policy): Promise<void>

Update an existing policy.

Parameters

policy

IDataspaceProtocolPolicy

The policy to update (must include uid).

Returns

Promise<void>

Nothing.

Implementation of

IPolicyAdministrationPointComponent.update


get()

get(policyId): Promise<IDataspaceProtocolPolicy>

Get a policy from the entity storage.

Parameters

policyId

string

The ID of the policy to get.

Returns

Promise<IDataspaceProtocolPolicy>

The policy.

Implementation of

IPolicyAdministrationPointComponent.get


getAgreement()

getAgreement(agreementId): Promise<IDataspaceProtocolAgreement>

Get an agreement from the entity storage.

Parameters

agreementId

string

The ID of the agreement to get.

Returns

Promise<IDataspaceProtocolAgreement>

The agreement.

Implementation of

IPolicyAdministrationPointComponent.getAgreement


getOffer()

getOffer(offerId): Promise<IDataspaceProtocolOffer>

Get an offer from the entity storage.

Parameters

offerId

string

The ID of the offer to get.

Returns

Promise<IDataspaceProtocolOffer>

The offer.

Implementation of

IPolicyAdministrationPointComponent.getOffer


getSet()

getSet(setId): Promise<IDataspaceProtocolSet>

Get a set from the entity storage.

Parameters

setId

string

The ID of the set to get.

Returns

Promise<IDataspaceProtocolSet>

The set.

Implementation of

IPolicyAdministrationPointComponent.getSet


remove()

remove(policyId): Promise<void>

Remove a policy from the entity storage.

Parameters

policyId

string

The ID of the policy to remove.

Returns

Promise<void>

Implementation of

IPolicyAdministrationPointComponent.remove


query()

query(options?, conditions?, cursor?, limit?): Promise<{ cursor?: string; policies: IDataspaceProtocolPolicy[]; }>

Query the entity storage for policies.

Parameters

options?

Optional options to filter by assigner or assignee.

assigner?

string

The assigner to filter by.

assignee?

string

The assignee to filter by.

target?

string

The target to filter by.

action?

string

The action to filter by.

conditions?

EntityCondition<IDataspaceProtocolPolicy>

The conditions to query the entity storage with.

cursor?

string

The cursor to use for pagination.

limit?

number

The number of results to return per page.

Returns

Promise<{ cursor?: string; policies: IDataspaceProtocolPolicy[]; }>

The policies.

Implementation of

IPolicyAdministrationPointComponent.query