Registry (Client API)

Overview - Common API - Client API - Admin API - Runtime API

Registry

Class representing an Abstract Registry.

Details

  • Module client

See also

Method Summary

Name Returns Description
add Promise Adds a new resource to the registry.
addAll Promise Adds a list of new resources to the registry.
addRegistry Promise Add a new asset registry.
constructor void Create a registry.
exists Promise Determines whether a specific resource exists in the registry.
existsRegistry Promise Determines whether a registry exists.
get Promise Get a specific resource in the registry.
getAll Promise Get all of the resources in the registry.
getAllRegistries Promise Get a list of all existing registries.
getRegistry Promise Get an existing registry.
remove Promise Remove an asset with a given type and id from the registry.
removeAll Promise Removes a list of resources from the registry.
resolve Promise Get a specific resource in the registry, and resolve all of its relationships to other assets, participants, and transactions. The result is a JavaScript object, and should only be used for visualization purposes. You cannot use the add or update functions with a resolved resource.
resolveAll Promise Get all of the resources in the registry, and resolve all of their relationships to other assets, participants, and transactions. The result is a JavaScript object, and should only be used for visualization purposes. You cannot use the add or update functions with a resolved resource.
update Promise Updates a resource in the registry.
updateAll Promise Updates a list of resources in the registry.

Method Details

getAllRegistries

Promise getAllRegistries( SecurityContext securitycontext, string registrytype, [boolean includesystem] )

Get a list of all existing registries.

Returns

Promise - A promise that will be resolved with an array of JSON objects representing the registries.

Parameters

Name Type Optional Description
securityContext SecurityContext false The user's security context.
registryType string false The type of this registry.
includeSystem boolean true True if system registries should be included (optional default is false)

getRegistry

Promise getRegistry( SecurityContext securitycontext, string registrytype, string id )

Get an existing registry.

Returns

Promise - A promise that will be resolved with a JSON object representing the registry.

Parameters

Name Type Optional Description
securityContext SecurityContext false The user's security context.
registryType string false The type of this registry.
id string false The unique identifier of the registry.

existsRegistry

Promise existsRegistry( SecurityContext securitycontext, string registrytype, string id )

Determines whether a registry exists.

Returns

Promise - A promise that will be resolved with true/false depending on whether the registry exists

Parameters

Name Type Optional Description
securityContext SecurityContext false The user's security context.
registryType string false The type of this registry.
id string false The unique identifier of the registry.

addRegistry

Promise addRegistry( SecurityContext securitycontext, string registrytype, string id, string name )

Add a new asset registry.

Returns

Promise - A promise that will be resolved with a JSON object representing the registry.

Parameters

Name Type Optional Description
securityContext SecurityContext false The user's security context.
registryType string false The type of this registry.
id string false The unique identifier of the registry.
name string false The name of the registry.

new Registry()

Create a registry. Note: Only to be called by framework code. Applications should retrieve instances from BusinessNetworkConnection

Parameters

Name Type Optional Description
registryType string false The type of this registry.
id string false The unique identifier of the registry.
name string false The display name for the registry.
securityContext SecurityContext false The users security context.
modelManager ModelManager false The ModelManager to use for this registry.
factory Factory false The factory to use for this registry.
serializer Serializer false The Serializer to use for this registry.
bnc BusinessNetworkConnection false Instance of the BusinessNetworkConnection TODO: Rationalize the bnc with the other objects - as the bnc contains these other arguments

addAll

Promise addAll( resources )

Adds a list of new resources to the registry.

Returns

Promise - A promise that will be resolved when the resource is added to the registry.

Parameters

Name Type Optional Description
resources false The resources to be added to the registry.

add

Promise add( Resource resource )

Adds a new resource to the registry.

Returns

Promise - A promise that will be resolved when the resource is added to the registry.

Parameters

Name Type Optional Description
resource Resource false The resource to be added to the registry.

updateAll

Promise updateAll( resources )

Updates a list of resources in the registry.

Returns

Promise - A promise that will be resolved when the resource is added to the registry.

Parameters

Name Type Optional Description
resources false The resources to be updated in the asset registry.

update

Promise update( Resource resource )

Updates a resource in the registry.

Returns

Promise - A promise that will be resolved when the resource is updated in the registry.

Parameters

Name Type Optional Description
resource Resource false The resource to be updated in the registry.

removeAll

Promise removeAll( ; resources )

Removes a list of resources from the registry.

Returns

Promise - A promise that will be resolved when the resource is added to the registry.

Parameters

Name Type Optional Description
resources ; false The resources, or the unique identifiers of the resources.

remove

Promise remove( Resource; string resource )

Remove an asset with a given type and id from the registry.

Returns

Promise - A promise that will be resolved when the resource is removed from the registry.

Parameters

Name Type Optional Description
resource Resource; string false The resource, or the unique identifier of the resource.

getAll

Promise getAll( )

Get all of the resources in the registry.

Returns

Promise - A promise that will be resolved with an array of JSON objects representing the resources.

Parameters

No parameters

get

Promise get( string id )

Get a specific resource in the registry.

Returns

Promise - A promise that will be resolved with a JSON object representing the resource.

Parameters

Name Type Optional Description
id string false The unique identifier of the resource.

exists

Promise exists( string id )

Determines whether a specific resource exists in the registry.

Returns

Promise - A promise that will be resolved with true/false depending on whether the resource exists.

Parameters

Name Type Optional Description
id string false The unique identifier of the resource.

resolveAll

Promise resolveAll( )

Get all of the resources in the registry, and resolve all of their relationships to other assets, participants, and transactions. The result is a JavaScript object, and should only be used for visualization purposes. You cannot use the add or update functions with a resolved resource.

Returns

Promise - A promise that will be resolved with an array of JavaScript objects representing the resources and all of their resolved relationships.

Parameters

No parameters

resolve

Promise resolve( string id )

Get a specific resource in the registry, and resolve all of its relationships to other assets, participants, and transactions. The result is a JavaScript object, and should only be used for visualization purposes. You cannot use the add or update functions with a resolved resource.

Returns

Promise - A promise that will be resolved with a JavaScript object representing the resource and all of its resolved relationships.

Parameters

Name Type Optional Description
id string false The unique identifier of the asset.