Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "BaSyx / Documentation / Components / AAS Server"

m
m (Replaces code with reference to the snippet)
Line 4: Line 4:
 
In the following, a small code snippet shows its usage when it is already deployed. It assumes that somewhere a registry is already running. For this registry, the [[BaSyx_/_Documentation_/_Components_/_Registry | Registry Component]] can be used.
 
In the following, a small code snippet shows its usage when it is already deployed. It assumes that somewhere a registry is already running. For this registry, the [[BaSyx_/_Documentation_/_Components_/_Registry | Registry Component]] can be used.
  
<syntaxhighlight lang="java" style="margin-left: 4em">
+
For illustration on how to create an AAS on the server provided by the component and how to retrieve it see the [https://git.eclipse.org/r/plugins/gitiles/basyx/basyx/+/master/examples/basys.examples/src/test/java/org/eclipse/basyx/examples/snippets/aas/registry/ConnectToAASEndpoints.java snippet] in the repository.
AssetAdministrationShell shell = new AssetAdministrationShell();
+
IIdentifier identifier = new ModelUrn("aasId");
+
shell.setIdentification(identifier);
+
shell.setIdShort("aasIdShort");
+
 
+
                IAASRegistryService aasRegistry = new AASRegistryProxy(URL); // URL has to be filled in by the user to point to the AAS registry
+
ConnectedAssetAdministrationShellManager manager = new ConnectedAssetAdministrationShellManager(aasRegistry);
+
                manager.createAAS(shell, identifier, COMPONENT_URL); // Component URL has to filled in by the user to point to the component
+
 
+
                // The registered AAS can then be retrieved using a manager configured in the same way
+
IAssetAdministrationShell remote = manager.retrieveAAS(identifier);
+
 
+
</syntaxhighlight>
+

Revision as of 03:45, 27 April 2020

AAS Server Component

The AAS server component provides an empty AAS server that can be used to host several AAS and Submodels. For its API usage see Aggregator API. In the following, a small code snippet shows its usage when it is already deployed. It assumes that somewhere a registry is already running. For this registry, the Registry Component can be used.

For illustration on how to create an AAS on the server provided by the component and how to retrieve it see the snippet in the repository.

Back to the top