| // ***************************************************************************** |
| // Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency |
| // All rights reserved. This program and the accompanying materials |
| // are made available under the terms of the Eclipse Public License v1.0 |
| // which accompanies this distribution, and is available at |
| // http://www.eclipse.org/legal/epl-v10.html |
| // |
| // Contributors: |
| // Pierre Allard - initial API and implementation |
| // Regent L'Archeveque |
| // |
| // SPDX-License-Identifier: EPL-1.0 |
| // ***************************************************************************** |
| @GenModel(prefix="ApogyCoreTopology", |
| childCreationExtenders="true", |
| extensibleProviderFactory="true", |
| multipleEditorPages="false", |
| copyrightText="******************************************************************************* |
| Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency |
| All rights reserved. This program and the accompanying materials |
| are made available under the terms of the Eclipse Public License v1.0 |
| which accompanies this distribution, and is available at |
| http://www.eclipse.org/legal/epl-v10.html |
| |
| Contributors: |
| Pierre Allard - initial API and implementation |
| Regent L'Archeveque |
| |
| SPDX-License-Identifier: EPL-1.0 |
| *******************************************************************************", |
| modelName="ApogyCoreTopology") |
| @GenModel(dynamicTemplates="true", templateDirectory="platform:/plugin/org.eclipse.apogy.common.emf.codegen/templates") |
| @GenModel(modelDirectory="/org.eclipse.apogy.core.topology/src-gen") |
| @GenModel(editDirectory="/org.eclipse.apogy.core.topology.edit/src-gen") |
| |
| package org.eclipse.apogy.core.topology |
| |
| |
| import org.eclipse.apogy.common.topology.Node |
| import org.eclipse.apogy.common.topology.ReferencedGroupNode |
| import org.eclipse.apogy.core.environment.ApogyEnvironment |
| import org.eclipse.apogy.core.ResultsListNode |
| import org.eclipse.apogy.core.environment.WorksiteNode |
| import org.eclipse.apogy.core.invocator.AbstractTypeImplementation |
| import org.eclipse.apogy.core.invocator.Variable |
| import org.eclipse.apogy.core.ApogyTopology |
| import org.eclipse.apogy.core.FeatureOfInterestNode |
| import org.eclipse.apogy.core.FeatureOfInterest |
| import org.eclipse.apogy.core.invocator.InvocatorSession |
| import org.eclipse.apogy.common.Apogy |
| |
| // Types |
| |
| type SortedSet<T> wraps java.util.SortedSet |
| |
| |
| /* |
| * |
| * ApogyCoreTopologyFacade Singleton. |
| * |
| */ |
| @Apogy(isSingleton="true", hasCustomClass="true") |
| class ApogyCoreTopologyFacade |
| { |
| /* |
| * Returns the topology root associated with a specified Variable. |
| * @param variable The specified variable. |
| * @return The topology root associated with the variable, null if none is found. |
| */ |
| op Node getVariableOriginNode(Variable variable) |
| |
| /* |
| * Return the topology root associated with a specified AbstractTypeImplementation. |
| * @param abstractTypeImplementation The specified AbstractTypeImplementation. |
| * @return The topology root associated with the AbstractTypeImplementation, null if none is found. |
| */ |
| op Node getAbstractTypeImplementationOriginNode(AbstractTypeImplementation abstractTypeImplementation) |
| |
| /* |
| * Creates the ApogyEnvironmentNode associated with a specified ApogyEnvironment. |
| * @param apogyEnvironment The specified ApogyEnvironment. |
| * @return The ApogyEnvironmentNode. |
| */ |
| op ApogyEnvironmentNode createApogyEnvironmentNode(ApogyEnvironment apogyEnvironment) |
| |
| /* |
| * Apogy Topology Singleton. |
| */ |
| @GenModel(children="true", notify="true", property="None") |
| refers derived transient ApogyTopology[0..1] apogyTopology |
| |
| /* |
| * Initializes the {@link ApogyTopology}. |
| * @param environment Refers the loaded environment. |
| */ |
| op void initApogyTopology(ApogyEnvironment environment) |
| |
| /* |
| * Disposes the {@link ApogyTopology}. |
| */ |
| op void disposeApogyTopology() |
| |
| /* |
| * Finds the FeatureOfInterestNode associated with a specified FeatureOfInterest in the active session. |
| * @param featureOfInterest The specified FeatureOfInterest. |
| * @return The FeatureOfInterestNode associated with the specified FeatureOfInterest, null if none is found. |
| */ |
| op FeatureOfInterestNode getFeatureOfInterestNode(FeatureOfInterest featureOfInterest) |
| } |
| |
| /* |
| * This controller listens the {@link ApogyCoreInvocatorFacade#activeInvocatorSession} and |
| * sets the {@link ApogyTopology} |
| */ |
| @Apogy(isSingleton="true", hasCustomClass="true") |
| class ApogyTopologyController{ |
| /* |
| * Initializes the {@link ApogyCoreInvocatorFacade#activeInvocatorSession} listener. |
| */ |
| op void init() |
| |
| /* |
| * Disposes the {@link ApogyCoreInvocatorFacade#activeInvocatorSession} listener. |
| */ |
| op void dispose() |
| |
| /* |
| * Initializes or clear the active Apogy Topology |
| * @param session Reference to the session. If not null, the topology will be initialized. |
| * Otherwise, the topology will be disposed. |
| */ |
| op void initApogyTopology(InvocatorSession session) |
| } |
| |
| class SystemsTopologyAdapter |
| { |
| /* |
| * The Deployment to monitor. |
| */ |
| refers transient ApogyEnvironment deployment |
| |
| /* |
| * The topology representing the Systems found in the Deployment. |
| */ |
| refers transient ReferencedGroupNode systemsGroup |
| } |
| |
| |
| /* ------------------------------------------------------------------------- |
| * Specialized Nodes. |
| * ------------------------------------------------------------------------- */ |
| |
| /** |
| * A specialized Topology node representing the environment. |
| */ |
| @Apogy(hasCustomClass="true", hasCustomItemProvider="true") |
| class ApogyEnvironmentNode extends ReferencedGroupNode |
| { |
| refers transient ApogyEnvironment apogyEnvironment |
| |
| refers derived transient WorksiteNode[1] worksiteNode |
| |
| refers derived transient readonly ResultsListNode[1] resultsListNode |
| |
| refers derived transient readonly ApogySystemAPIsNode[1] apogySystemAPIsNode |
| |
| op void dispose() |
| } |
| |
| /** |
| * A specialized Topology node referring to all Systems. |
| */ |
| @Apogy(hasCustomClass="true") |
| class ApogySystemAPIsNode extends ReferencedGroupNode |
| { |
| refers transient ApogyEnvironment apogyEnvironment |
| } |
| |
| /** |
| * A specialized Node that represent a temporary node used for assemble of system and sub-systems. |
| */ |
| @Apogy(hasCustomItemProvider="true") |
| class TemporaryAssemblyNode extends ReferencedGroupNode |
| { |
| } |