blob: c4bed42c7789451d0299a4f679df16fc37de2227 [file] [log] [blame]
/*******************************************************************************
* Copyright (C) 2021 the Eclipse BaSyx Authors
*
* This program and the accompanying materials are made
* available under the terms of the Eclipse Public License 2.0
* which is available at https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
******************************************************************************/
package org.eclipse.basyx.testsuite.regression.aas.restapi;
import org.eclipse.basyx.aas.metamodel.map.AssetAdministrationShell;
import org.eclipse.basyx.aas.metamodel.map.descriptor.ModelUrn;
import org.eclipse.basyx.aas.restapi.AASModelProvider;
import org.eclipse.basyx.aas.restapi.VABMultiSubmodelProvider;
import org.eclipse.basyx.submodel.metamodel.map.SubModel;
import org.eclipse.basyx.submodel.restapi.SubModelProvider;
import org.eclipse.basyx.testsuite.regression.submodel.restapi.SimpleAASSubmodel;
import org.eclipse.basyx.vab.protocol.http.server.VABHTTPInterface;
public class StubAASServlet extends VABHTTPInterface<VABMultiSubmodelProvider> {
private static final long serialVersionUID = 8859337501045845823L;
// Used short ids
public static final String AASIDSHORT = "StubAAS";
public static final String SMIDSHORT = "StubSM";
// Used URNs
public static final ModelUrn AASURN = new ModelUrn("urn:fhg:es.iese:aas:1:1:myAAS#001");
public static final ModelUrn SMURN = new ModelUrn("urn:fhg:es.iese:aas:1:1:mySM#001");
public StubAASServlet() {
super(new VABMultiSubmodelProvider());
SubModel sm = new SubModel();
sm.setIdentification(SMURN.getIdType(), SMURN.getId());
sm.setIdShort(SMIDSHORT);
AssetAdministrationShell aas = new AssetAdministrationShell();
aas.addSubModel(sm);
aas.setIdShort(AASIDSHORT);
aas.setIdentification(AASURN);
getModelProvider().setAssetAdministrationShell(new AASModelProvider(aas));
getModelProvider().addSubmodel(new SubModelProvider(new SimpleAASSubmodel(SMIDSHORT)));
}
}