blob: 1b3e4f42ffa75e5f4375054ff5464980e9587170 [file] [log] [blame]
package org.eclipse.basyx.examples.snippets.submodel;
import org.eclipse.basyx.aas.metamodel.map.descriptor.SubmodelDescriptor;
import org.eclipse.basyx.aas.registration.proxy.AASRegistryProxy;
import org.eclipse.basyx.submodel.metamodel.api.identifier.IIdentifier;
/**
* Snippet that showcases how to look up a Submodel in a RegistryComponent
*
* @author conradi
*
*/
public class LookupSubmodel {
/**
* Gets the Descriptor of the requested Submodel from a registry
*
* @param smIdentifier the Identifier of the Submodel to be looked up in the registry
* @param aasIdentifier the Identifier of the AAS the Submodel belongs to
* @param registryServerURL the URL of the registry server
* @return the SubmodelDescriptor looked up in the registry
*/
public static SubmodelDescriptor lookupSubmodel(IIdentifier smIdentifier, IIdentifier aasIdentifier, String registryServerURL) {
// Create a proxy pointing to the registry
AASRegistryProxy registryProxy = new AASRegistryProxy(registryServerURL);
// Lookup the Submodel in the registry
return registryProxy.lookupSubmodel(aasIdentifier, smIdentifier);
}
}