Class BaSyxRegistry
java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.BaSyxRegistry
- All Implemented Interfaces:
de.iip_ecosphere.platform.support.aas.Registry
Implements a registry recipe for BaSyx.
- Author:
- Holger Eichelberger, SSE
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApiprivate org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepositoryprivate static final Integerprivate org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApiprivate org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepositoryprivate de.iip_ecosphere.platform.support.aas.SetupSpec -
Constructor Summary
ConstructorsConstructorDescriptionBaSyxRegistry(de.iip_ecosphere.platform.support.aas.SetupSpec spec) Creates a registry instance from the given deployment specification. -
Method Summary
Modifier and TypeMethodDescriptionprivate Stream<org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor> allAas()Returns a stream of all known.voidvoidcreateSubmodel(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel) private org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellgetAas(org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository aasRepo, String aasId) Returns an AAS from a given repository catching potential exceptions.(package private) org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptorgetAasDescriptor(String identifier) Returns the descriptor for an AAS.(package private) org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApiReturns the internal AAS registry instance.private org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepositorygetAasRepo(String epUrl) Returns the (fallback) AAS repository for the given URL.(package private) org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepositoryReturns the default AAS repository of this registry.getEndpoint(de.iip_ecosphere.platform.support.aas.Aas aas) getEndpoint(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel) getEndpoint(String aasIdShort) (package private) org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApiReturns the internal submodel registry instance.private org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepositorygetSubmodelRepo(String epUrl) Returns the (fallback) submodel repository for the given URL.(package private) org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepositoryReturns the default submodel repository of this registry.voidregister(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel, String endpointUrl) de.iip_ecosphere.platform.support.aas.AasretrieveAas(String identifier) retrieveAas(String identifier, boolean populate) private de.iip_ecosphere.platform.support.aas.SubmodelretrieveSubmodel(BaSyxAas aas, String submodelId) Retrieves a submodel foraas.de.iip_ecosphere.platform.support.aas.SubmodelretrieveSubmodel(String aasIdentifier, String submodelIdentifier) private StringtoUriWithoutPath(String uri) Cuts the path of the given URI.
-
Field Details
-
PAGINATION_UNLIMITED
-
spec
private de.iip_ecosphere.platform.support.aas.SetupSpec spec -
aasRegistry
private org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi aasRegistry -
smRegistry
private org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi smRegistry -
aasRepo
private org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository aasRepo -
smRepo
private org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository smRepo
-
-
Constructor Details
-
BaSyxRegistry
BaSyxRegistry(de.iip_ecosphere.platform.support.aas.SetupSpec spec) Creates a registry instance from the given deployment specification.- Parameters:
spec- the deployment specification
-
-
Method Details
-
getAasRepository
org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository getAasRepository()Returns the default AAS repository of this registry.- Returns:
- the AAS repository
-
getSubmodelRepository
org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository getSubmodelRepository()Returns the default submodel repository of this registry.- Returns:
- the submodel repository
-
retrieveAas
- Specified by:
retrieveAasin interfacede.iip_ecosphere.platform.support.aas.Registry- Throws:
IOException
-
getAasDescriptor
org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor getAasDescriptor(String identifier) Returns the descriptor for an AAS.- Parameters:
identifier- the identifier of the AAS (may be null or empty for an identification based onidShort, interpreted as an URN if this starts withurn, seeIdentifierTypefor others, or as an endpoint if it starts withhttp://orhttps://)- Returns:
- the descriptor or null if the AAS cannot be found
-
retrieveAas
- Specified by:
retrieveAasin interfacede.iip_ecosphere.platform.support.aas.Registry- Throws:
IOException
-
getAas
private org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell getAas(org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository aasRepo, String aasId) throws IOException Returns an AAS from a given repository catching potential exceptions.- Parameters:
aasRepo- the AAS repositoryaasId- the AAS identifier, may be null or empty- Returns:
- the AAS or null for none
- Throws:
IOException- if the AAS cannot be accessed, e.g., as not permitted
-
getAasRepo
private org.eclipse.digitaltwin.basyx.aasrepository.client.ConnectedAasRepository getAasRepo(String epUrl) Returns the (fallback) AAS repository for the given URL.- Parameters:
epUrl- the repo URL- Returns:
- the repository or the fallback repository
-
allAas
private Stream<org.eclipse.digitaltwin.basyx.aasregistry.client.model.AssetAdministrationShellDescriptor> allAas()Returns a stream of all known.- Returns:
- the known AAS
-
getAasIdShorts
- Specified by:
getAasIdShortsin interfacede.iip_ecosphere.platform.support.aas.Registry
-
getAasIdentifiers
- Specified by:
getAasIdentifiersin interfacede.iip_ecosphere.platform.support.aas.Registry
-
retrieveSubmodel
public de.iip_ecosphere.platform.support.aas.Submodel retrieveSubmodel(String aasIdentifier, String submodelIdentifier) throws IOException - Specified by:
retrieveSubmodelin interfacede.iip_ecosphere.platform.support.aas.Registry- Throws:
IOException
-
retrieveSubmodel
private de.iip_ecosphere.platform.support.aas.Submodel retrieveSubmodel(BaSyxAas aas, String submodelId) throws IOException Retrieves a submodel foraas.- Parameters:
aas- the AASsubmodelId- the submodelId- Returns:
- the submodel or null if not found
- Throws:
IOException- if failed
-
getSubmodelRepo
private org.eclipse.digitaltwin.basyx.submodelrepository.client.ConnectedSubmodelRepository getSubmodelRepo(String epUrl) Returns the (fallback) submodel repository for the given URL.- Parameters:
epUrl- the repo URL- Returns:
- the repository or the fallback repository
-
toUriWithoutPath
Cuts the path of the given URI.- Parameters:
uri- the URI- Returns:
- the URI scheme, host, port without path
-
createAas
public void createAas(de.iip_ecosphere.platform.support.aas.Aas aas, String endpointURL) throws IOException - Specified by:
createAasin interfacede.iip_ecosphere.platform.support.aas.Registry- Throws:
IOException
-
createSubmodel
public void createSubmodel(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel) throws IOException - Specified by:
createSubmodelin interfacede.iip_ecosphere.platform.support.aas.Registry- Throws:
IOException
-
register
public void register(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel, String endpointUrl) - Specified by:
registerin interfacede.iip_ecosphere.platform.support.aas.Registry
-
getEndpoint
- Specified by:
getEndpointin interfacede.iip_ecosphere.platform.support.aas.Registry
-
getEndpoint
- Specified by:
getEndpointin interfacede.iip_ecosphere.platform.support.aas.Registry
-
getEndpoint
public String getEndpoint(de.iip_ecosphere.platform.support.aas.Aas aas, de.iip_ecosphere.platform.support.aas.Submodel submodel) - Specified by:
getEndpointin interfacede.iip_ecosphere.platform.support.aas.Registry
-
getAasRegistry
org.eclipse.digitaltwin.basyx.aasregistry.client.api.RegistryAndDiscoveryInterfaceApi getAasRegistry()Returns the internal AAS registry instance.- Returns:
- the internal AAS registry instance
-
getSubmodelRegistry
org.eclipse.digitaltwin.basyx.submodelregistry.client.api.SubmodelRegistryApi getSubmodelRegistry()Returns the internal submodel registry instance.- Returns:
- the internal submodel registry instance
-